MediaWiki:CharInsert.js: Różnice pomiędzy wersjami
Przejdź do nawigacji
Przejdź do wyszukiwania
Nie podano opisu zmian |
Nie podano opisu zmian |
||
| Linia 1: | Linia 1: | ||
function specialchar(text) | function specialchar(text) | ||
{ | { | ||
var actions = $('div[rel="characters"]').data('actions', {}); | var actions = $(document).find('div[rel="characters"]').data('actions', {}); | ||
$('div[rel="characters"].section div[rel="symbols"].page div')[0].appendChild( | $(document).find('div[rel="characters"].section div[rel="symbols"].page div')[0].appendChild( | ||
$($.wikiEditor.modules.toolbar.fn.buildCharacter(text, actions)).on('click', function (e) | $($.wikiEditor.modules.toolbar.fn.buildCharacter(text, actions)).on('click', function (e) | ||
{ | { | ||
Wersja z 07:10, 16 mar 2024
function specialchar(text)
{
var actions = $(document).find('div[rel="characters"]').data('actions', {});
$(document).find('div[rel="characters"].section div[rel="symbols"].page div')[0].appendChild(
$($.wikiEditor.modules.toolbar.fn.buildCharacter(text, actions)).on('click', function (e)
{
$.wikiEditor.modules.toolbar.fn.doAction(
$(this).parent().data('context'),
actions[$(this).attr('rel')]);
e.preventDefault();
return false;
})[0]);
}
(function()
{
$('span.charinsert').each(function()
{
var span = $(this)[0], text = span.textContent;
specialchar(text);
span.onclick = function()
{
$('div[rel="characters"].section div[rel="symbols"].page div span[rel="'+text+'"]').click();
};
});
}());