MediaWiki:CharInsert.js: Różnice pomiędzy wersjami

Z Minecraft Wiki Polska
Przejdź do nawigacji Przejdź do wyszukiwania
Anulowanie wersji 161233 autorstwa BartoszKonkol (dyskusja)
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', {});
window.addEventListener("load", function()
setTimeout(() =>
{
{
$(document).find('div.sections div[rel="characters"].section div.pages div[rel="symbols"].page div')[0].appendChild(
$(document).find('div.sections div[rel="characters"].section div.pages div[rel="symbols"].page div')[0].appendChild(
Linia 14: Linia 14:
return false;
return false;
})[0]);
})[0]);
});
}, 1000);
}
}



Wersja z 08:10, 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', {});
	setTimeout(() =>
	{
		$(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]);
	}, 1000);
}

(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();
		};
	});
}());