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

Z Minecraft Wiki Polska
Przejdź do nawigacji Przejdź do wyszukiwania
Utworzono nową stronę "function specialchar(text) { var actions = $('div[rel="characters"]').data('actions', {}); $('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]); }"
 
Nie podano opisu zmian
Linia 12: Linia 12:
})[0]);
})[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();
};
});
}());

Wersja z 07:01, 16 mar 2024

function specialchar(text)
{
	var actions = $('div[rel="characters"]').data('actions', {});
	$('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();
		};
	});
}());