Jump to content

User:Ivocamp96/global.js

From Meta, a Wikimedia project coordination wiki

Note: After publishing, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5.
importScript(User:Splarka/portalpreview.js);
//TAB PER FEEDBACK
function addlimenulink(tabsli, nameli, idli, link)
{
var na = document.createElement('a');
na.href = link;
var mn = document.createElement('ul');
na.appendChild(document.createTextNode(nameli));
var li = document.createElement('li');
li.id = idli;
li.className = 'tabmenu';
li.appendChild(na);
li.appendChild(mn);
tabsli.appendChild(li);
return li;
}
 
$(function (){
 
var feba_page_url = wgServer+ '/w/index.php?title=Special:NewPages';
var tabs = document.getElementById('p-cactions').getElementsByTagName('ul')[0];
addlimenulink(tabs,'voti','febatb', feba_page_url); //puoi cambiare 'Voti' in qualcos'altro, ma non cambiare 'febatb'
var febatb = document.getElementById('febatb').getElementsByTagName('ul')[0];
 
//Una riga per ogni voce del menu
if ((wgNamespaceNumber == "0") || (wgNamespaceNumber == "12") || (wgPageName == "Speciale:Ricerca"));


function personalButtons()
{
  addToolbarButton('tb-xxx', 'javascript:addText("[[it:]]", "+interwiki", 0)',
  'Indirizzo URL dell'immagine', 'Interwiki', 'Interwiki');
  addToolbarButton('tb-xxx', 'javascript:addText("@import "http://meta.wikimedia.org/w/index.php?title=User:Ivocamp96/global.css&action=raw&ctype=text/css";", "+ import css", 0)',
  'Indirizzo URL dell'immagine', '@importcss', '@importcss');
  addToolbarButton('tb-xxx', 'javascript:addText("{{CURRENTDAY}}/{{CURRENTMONTH}}/{{CURRENTYEAR}}", "00/00/00", 0)',
  'Indirizzo URL dell'immagine', 'Data', 'Data');

}
addLoadEvent(personalButtons);

*/
//=== inizio RICERCA IN NAMESPACE ===
//Aggiunge un combo box in cui scegliere il "namespace" per 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('(Principale)', 0);
    searchNsMenu.options[searchNsMenu.options.length] = new Option('Discussione', 1);
    searchNsMenu.options[searchNsMenu.options.length] = new Option('Utente', 2);
    searchNsMenu.options[searchNsMenu.options.length] = new Option('Discussioni utente', 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('Immagine', 6);
    searchNsMenu.options[searchNsMenu.options.length] = new Option('Discussione immagine', 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('Aiuto', 12);
    searchNsMenu.options[searchNsMenu.options.length] = new Option('Discussioni Aiuto', 13);
    searchNsMenu.options[searchNsMenu.options.length] = new Option('Categoria', 14);
    searchNsMenu.options[searchNsMenu.options.length] = new Option('Discussioni Categoria', 15);
    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 ===
//
inc("User:Ivocamp96/statuschanger.js");