MediaWiki:CharInsert.js: Różnice pomiędzy wersjami
Przejdź do nawigacji
Przejdź do wyszukiwania
Nie podano opisu zmian |
Nie podano opisu zmian |
||
| Linia 3: | Linia 3: | ||
$(document).find('div.sections div[rel="characters"].section div.index div[rel="symbols"]').click(); | $(document).find('div.sections div[rel="characters"].section div.index div[rel="symbols"]').click(); | ||
var actions = $(document).find('div.sections div[rel="characters"].section').data('actions', {}); | var actions = $(document).find('div.sections div[rel="characters"].section').data('actions', {}); | ||
$(document).find('div.sections div[rel="characters"].section div.pages div[rel="symbols"].page div')[0].appendChild( | window.addEventListener("load", function() | ||
$($.wikiEditor.modules.toolbar.fn.buildCharacter(text, actions)).on('click', function (e) | { | ||
$(document).find('div.sections div[rel="characters"].section div.pages div[rel="symbols"].page div')[0].appendChild( | |||
$($.wikiEditor.modules.toolbar.fn.buildCharacter(text, actions)).on('click', function(e) | |||
{ | { | ||
$.wikiEditor.modules.toolbar.fn.doAction( | $.wikiEditor.modules.toolbar.fn.doAction( | ||
| Linia 12: | Linia 14: | ||
return false; | return false; | ||
})[0]); | })[0]); | ||
}); | |||
} | } | ||
Wersja z 07:36, 16 mar 2024
function specialchar(text)
{
$(document).find('div.sections div[rel="characters"].section div.index div[rel="symbols"]').click();
var actions = $(document).find('div.sections div[rel="characters"].section').data('actions', {});
window.addEventListener("load", function()
{
$(document).find('div.sections div[rel="characters"].section div.pages 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()
{
$(document).find('div[rel="characters"].section div[rel="symbols"].page div span[rel="'+text+'"]').click();
};
});
}());