Jump to content

User:Padawane/monobook.js

From Wikipedia, the free encyclopedia
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
// <nowiki>
function globalSearch()
{
  var pSearchElement = document.getElementById('searchform');

  var newElement = document.createElement("input");
  newElement.setAttribute("type", "button");
  newElement.setAttribute("name", "globalsearch");
  newElement.setAttribute("class", "searchButton");
  newElement.setAttribute("value", "Recherche globale");
  newElement.setAttribute("onClick", "startSearch()");

  pSearchElement.appendChild(newElement);
}
$(globalSearch);

// merci à Eskimo pour les autres icônes
function DeluxeBar() {
  if (document.createTextNode) {
  	var toolbar = document.getElementById("toolbar"); 
	if (!toolbar) return;
	
        ///// zone personnalisable ////
	var messages = new Array()
        // le texte a été splitté sinon Mediawiki casse tout...
	messages[0] = "{{subst:" + "Welcome on your page"  + "}}" +  "~~" + "~~";
	messages[1] = "{{subst:" + "welcome" + "}}" +  "~~" + "~~";
	messages[2] = "{{subst:" + "test" + "}}" +  "~~" + "~~";
	messages[3] = "{{subst:" + "test-n|page" + "}}" +  "~~" + "~~";
	messages[4] = "{{subst:" + "spam" + "}}" +  "~~" + "~~";
	messages[6] = "{{" + "delete" + "}}";


	var images = new Array()
	images[0] = "/media/wikipedia/fr/1/12/Button_accueilA.png";
	images[1] = "/media/wikipedia/fr/e/eb/Button_accueilB.png";
	images[2] = "/media/wikipedia/fr/0/00/Button_vandale.png";
        images[3] = "/media/wikipedia/fr/a/ad/Button_vandale2.png";
	images[4] = "/media/wikipedia/fr/f/fb/Button_spam2.png";
	images[6] = "/media/wikipedia/fr/f/f8/Button_suppr.png";


	var commentaires = new Array()
	commentaires[0] = "Welcome on your page !"
	commentaires[1] = "Welcome !"
	commentaires[2] = "Warning"

        commentaires[3] = "Warning";
        commentaires[4] = "Warning Spam" ;
        commentaires[6] = "ask for delete"; 

        ////////////////////////////////

	for (var i=0;i<messages.length;i++) {
		var img = document.createElement("img");
		img.setAttribute("src", images[i]);
		img.setAttribute("alt", commentaires[i]);

		var ref = document.createElement("a");
		ref.setAttribute("href", "javascript:insertTags('', \"" + messages[i] + "\", '');" + 
		                 "javascript:changeSummary(\"" + commentaires[i] + "\");" ); 
		ref.appendChild(img); 
		
		toolbar.appendChild(ref);
	}
  }
}
// </nowiki>