Utenti:Melos/monobook.js/cercanameSpaces.js
Aspettu
Nota: doppu aviri sarvatu, hai a puliri la cache di lu tò browser pi vìdiri li canciamenti: Mozilla: clicca supra reload (oppure ctrl-r), IE / Opera: ctrl-f5, Safari: cmd-r, Konqueror ctrl-r.
/*<noinclude>
Si pò fari la ricerca nta un namespace particulari agghiuncennu na combo box.
L'idìa di stu tool fu di [[:en:User:Ilmari Karonen|Ilmari Karonen]]
e [[Utente:Jalo|io]] mi limitai a adattàrilu a it.wiki
</noinclude><pre><nowiki>*/
//=== nnizziu RICERCA 'N NAMESPACE ===
//Agghiunci un combo box unni si scegghi lu "namespace" pi la ricerca
$(function () {
var searchGoButton = document.getElementById('searchGoButton');
if (!searchGoButton) return;
var searchNsHidden = document.createElement('input');
searchNsHidden.id = 'searchNsHidden';
searchNsHidden.type = 'hidden';
searchNsHidden.name = 'ns0';
searchNsHidden.value = '1';
var searchNsMenu = document.createElement('select');
searchNsMenu.id = 'searchNsMenu';
searchNsMenu.name = 'ns';
searchNsMenu.options[searchNsMenu.options.length] = new Option('(Principali)', 0);
searchNsMenu.options[searchNsMenu.options.length] = new Option('Discussioni', 1);
searchNsMenu.options[searchNsMenu.options.length] = new Option('Utenti', 2);
searchNsMenu.options[searchNsMenu.options.length] = new Option('Discussioni utenti', 3);
searchNsMenu.options[searchNsMenu.options.length] = new Option('Wikipedia', 4);
searchNsMenu.options[searchNsMenu.options.length] = new Option('Discussioni Wikipedia', 5);
searchNsMenu.options[searchNsMenu.options.length] = new Option('Mmàggini', 6);
searchNsMenu.options[searchNsMenu.options.length] = new Option('Discussione mmàggini', 7);
searchNsMenu.options[searchNsMenu.options.length] = new Option('MediaWiki', 8);
searchNsMenu.options[searchNsMenu.options.length] = new Option('Discussioni MediaWiki', 9);
searchNsMenu.options[searchNsMenu.options.length] = new Option('Template', 10);
searchNsMenu.options[searchNsMenu.options.length] = new Option('Discussioni Template', 11);
searchNsMenu.options[searchNsMenu.options.length] = new Option('Aiutu', 12);
searchNsMenu.options[searchNsMenu.options.length] = new Option('Discussioni Aiutu', 13);
searchNsMenu.options[searchNsMenu.options.length] = new Option('Catigurìa', 14);
searchNsMenu.options[searchNsMenu.options.length] = new Option('Discussioni Catigurìa', 15);
searchNsMenu.options[searchNsMenu.options.length] = new Option('Purtali', 100);
searchNsMenu.options[searchNsMenu.options.length] = new Option('Discussioni portale', 101);
searchNsMenu.options[searchNsMenu.options.length] = new Option('Pruggettu', 102);
searchNsMenu.options[searchNsMenu.options.length] = new Option('Discussioni pruggettu', 103);
searchNsMenu.onchange = function () {
searchNsHidden.name = 'ns' + (this.selectedIndex < 0 ? '0' : this.options[this.selectedIndex].value);
}
searchNsMenu.style.width = '10.9em';
searchNsMenu.style.margin = '0';
searchNsMenu.style.fontSize = '95%';
searchGoButton.parentNode.insertBefore(searchNsHidden, searchGoButton);
searchGoButton.parentNode.insertBefore(searchNsMenu, searchGoButton);
});
//=== fine RICERCA IN NAMESPACE ===
//</nowiki></pre>