MediaWiki:CharInsert.js: Różnice pomiędzy wersjami
Przejdź do nawigacji
Przejdź do wyszukiwania
Nie podano opisu zmian |
Anulowanie wersji 161233 autorstwa BartoszKonkol (dyskusja) |
||
| Linia 19: | Linia 19: | ||
(function() | (function() | ||
{ | { | ||
$(' | $('span.charinsert').each(function() | ||
{ | { | ||
var span = $(this)[0], text = span.textContent; | var span = $(this)[0], text = span.textContent; | ||
Wersja z 07:45, 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();
};
});
}());