| 
				 | 
				
| Regel 1: | 
Regel 1: | 
| − | /* <pre> */
  |   | 
| − |  * Fonctions générales de lancement de fonctions ou de script
  |   | 
| − |  */
  |   | 
|   |  |   |  | 
| − | /**
  |   | 
| − |  * Installation d'une nouvelle fonction de cette façon :
  |   | 
| − |  * addOnloadHook(nom_de_la_fonction); (sans parenthèses)
  |   | 
| − |  * La procédure suivante ne doit plus être utilisée
  |   | 
| − |  */
  |   | 
| − | if (!window.aOnloadFunctions) { 
  |   | 
| − |   var aOnloadFunctions = new Array(); 
  |   | 
| − | }
  |   | 
| − | 
  |   | 
| − | window.onload = function() 
  |   | 
| − | {
  |   | 
| − |   if (window.aOnloadFunctions) {
  |   | 
| − |     for (var _i=0; _i<aOnloadFunctions.length; _i++) {
  |   | 
| − |       aOnloadFunctions[_i]();
  |   | 
| − |     }
  |   | 
| − |   }
  |   | 
| − | }
  |   | 
| − | 
  |   | 
| − | function addLoadEvent(func) {
  |   | 
| − |         hookEvent('load', func);
  |   | 
| − | }
  |   | 
| − | 
  |   | 
| − | /**
  |   | 
| − |  * insertAfter : insérer un élément dans une page
  |   | 
| − |  */
  |   | 
| − | function insertAfter(parent, node, referenceNode) {
  |   | 
| − |         parent.insertBefore(node, referenceNode.nextSibling);
  |   | 
| − | }
  |   | 
| − | 
  |   | 
| − | /**
  |   | 
| − |  * Insérer un javascript d'une page particulière, idée de Mickachu
  |   | 
| − |  */
  |   | 
| − | function loadJs(page)
  |   | 
| − | {
  |   | 
| − |  document.write('<script type="text/javascript" src="' +
  |   | 
| − |                 'http://fr.wikipedia.org/w/index.php?title=' + page +
  |   | 
| − |                 '&action=raw&ctype=text/javascript&dontcountme=s"></script>');
  |   | 
| − | }
  |   | 
| − | 
  |   | 
| − | /**
  |   | 
| − |  * Projet JavaScript
  |   | 
| − |  */
  |   | 
| − | function obtenir(name)
  |   | 
| − | {
  |   | 
| − |   loadJs('MediaWiki:JSScripts/' + name);
  |   | 
| − | }
  |   | 
| − | 
  |   | 
| − | /* Fin des fonctions générales
  |   | 
| − | 
  |   | 
| − | 
  |   | 
| − |  * Amélioration de la page de recherche v3
  |   | 
| − |  * Auteur : Marc Mongenet
  |   | 
| − |  * Sous licence GFDL & GPL<nowiki>
  |   | 
| − |  */
  |   | 
| − | function SpecialSearchEnhanced3() 
  |   | 
| − | {
  |   | 
| − | 
  |   | 
| − |  function SearchForm(search_action_url, engine_url, engine_name, logo_url,
  |   | 
| − |                      search_field_name, search_field_value, site_field_name, site_field_value)
  |   | 
| − |  {
  |   | 
| − |    var span = document.createElement("div");
  |   | 
| − |    span.style.marginRight = "1em";
  |   | 
| − |    span.style.width="100%";
  |   | 
| − |    span.style.whiteSpace = "nowrap";
  |   | 
| − | 
  |   | 
| − |    var form = document.createElement("form");
  |   | 
| − |    form.method = "get";
  |   | 
| − |    form.action = search_action_url;
  |   | 
| − |    form.style.display = "inline";
  |   | 
| − |    span.appendChild(form);
  |   | 
| − | 
  |   | 
| − |    var input = document.createElement("input");
  |   | 
| − |    input.type = "hidden";
  |   | 
| − |    input.name = search_field_name;
  |   | 
| − |    form.appendChild(input);
  |   | 
| − | 
  |   | 
| − |    var site = document.createElement("input");
  |   | 
| − |    site.type = "hidden";
  |   | 
| − |    site.name = site_field_name;
  |   | 
| − |    site.value = site_field_value;
  |   | 
| − |    form.appendChild(site);
  |   | 
| − | 
  |   | 
| − |    var submit = document.createElement("input");
  |   | 
| − |    submit.type = "submit";
  |   | 
| − |    submit.value = "Recherche";
  |   | 
| − |    form.appendChild(submit);
  |   | 
| − | 
  |   | 
| − |    form.onsubmit = function() {
  |   | 
| − |      input.value = document.getElementById("lsearchbox").value;
  |   | 
| − |    }
  |   | 
| − | 
  |   | 
| − |    var a = document.createElement("a");
  |   | 
| − |    a.href = engine_url;
  |   | 
| − |    span.appendChild(a);
  |   | 
| − | 
  |   | 
| − |    var img = document.createElement("img");
  |   | 
| − |    img.src = logo_url;
  |   | 
| − |    img.alt = engine_name;
  |   | 
| − |    img.style.borderWidth = "0";
  |   | 
| − |    img.style.padding = "5px";
  |   | 
| − |    a.appendChild(img);
  |   | 
| − | 
  |   | 
| − |    return span;
  |   | 
| − |  }
  |   | 
| − | 
  |   | 
| − |  if (typeof SpecialSearchEnhanced3Disabled != 'undefined') return;
  |   | 
| − |  if (wgPageName != "Special:Search") return;
  |   | 
| − | 
  |   | 
| − |  var mainNode = document.getElementsByTagName("form");
  |   | 
| − |  if (!mainNode) return;
  |   | 
| − |  mainNode = mainNode[0];
  |   | 
| − |  mainNode.appendChild(document.createElement("center"));
  |   | 
| − |  mainNode = mainNode.lastChild;
  |   | 
| − | 
  |   | 
| − |  var searchValue = document.getElementById("lsearchbox").value;
  |   | 
| − |  var engine;
  |   | 
| − |  engine = SearchForm("http://partner.exalead.fr/search", "http://www.exalead.fr/", "Exalead",
  |   | 
| − |                      "http://www.wikipedia.fr/exalead.gif", "q", searchValue,
  |   | 
| − |                      "site", "fr.wikipedia.org");
  |   | 
| − |  mainNode.appendChild(engine);
  |   | 
| − |  engine = SearchForm("http://www.google.fr/search", "http://www.google.fr/", "Google",
  |   | 
| − |                      "http://www.google.com/logos/Logo_25wht.gif", "q", searchValue,
  |   | 
| − |                      "as_sitesearch", "fr.wikipedia.org");
  |   | 
| − |  mainNode.appendChild(engine);
  |   | 
| − |  engine = SearchForm("http://www.wikipediasearch.net/index.php", "http://www.wikipediasearch.net", "Wikipedia Search",
  |   | 
| − |                      "http://www.wikipediasearch.net/logo_mini.png", "action", searchValue,
  |   | 
| − |                      "lang", "fr");
  |   | 
| − |  mainNode.appendChild(engine);
  |   | 
| − |  engine = SearchForm("http://search.live.com/results.aspx", "http://search.live.com/", "Live",
  |   | 
| − |                      "http://search.live.com/s/affillogoLive.gif", "q", searchValue,
  |   | 
| − |                      "q1", "site:http://fr.wikipedia.org");
  |   | 
| − |  mainNode.appendChild(engine);
  |   | 
| − |  engine = SearchForm("http://fr.search.yahoo.com/search", "http://fr.search.yahoo.com/", "Yahoo!",
  |   | 
| − |                      "http://us.yimg.com/i/yahootogo/y88red2.gif", "p", searchValue,
  |   | 
| − |                      "vs", "fr.wikipedia.org");
  |   | 
| − |  mainNode.appendChild(engine);
  |   | 
| − | }
  |   | 
| − | addOnloadHook(SpecialSearchEnhanced3);
  |   | 
| − | /* Fin de la page de recherche</nowiki>
  |   | 
| − | /* </pre> */
  |   |