MediaWiki:Edittools.js : Différence entre versions
De geoLwiki - Guide géologique du Luxembourg
(Nouvelle page : MediaWiki:Edittools.js From MediaWiki.org Jump to: navigation, search Note - After saving, you may have to bypass your browser's cache to see the changes. Mozilla / Firefox / Safar...) |
|||
(3 révisions intermédiaires par le même utilisateur non affichées) | |||
Ligne 1 : | Ligne 1 : | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
/* <source lang="javascript"><nowiki> Top of Javascript */ | /* <source lang="javascript"><nowiki> Top of Javascript */ | ||
// Drop down box for the Special character menu in [[MediaWiki:Edittools]] | // Drop down box for the Special character menu in [[MediaWiki:Edittools]] | ||
Ligne 11 : | Ligne 4 : | ||
// Adapted from: | // Adapted from: | ||
// http://commons.wikimedia.org/wiki/MediaWiki:Edittools.js | // http://commons.wikimedia.org/wiki/MediaWiki:Edittools.js | ||
− | + | ||
// Switch for people that don't want it | // Switch for people that don't want it | ||
if (load_edittools == true) | if (load_edittools == true) | ||
{ | { | ||
− | + | ||
function addCharSubsetMenu() { | function addCharSubsetMenu() { | ||
var specialchars = document.getElementById('specialchars'); | var specialchars = document.getElementById('specialchars'); | ||
Ligne 24 : | Ligne 17 : | ||
menu += "<option>Latin</option>"; | menu += "<option>Latin</option>"; | ||
menu += "<option>Greek</option>"; | menu += "<option>Greek</option>"; | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
menu += "<option>French</option>"; | menu += "<option>French</option>"; | ||
menu += "<option>German</option>"; | menu += "<option>German</option>"; | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
− | + | ||
menu += "</select>"; | menu += "</select>"; | ||
specialchars.innerHTML = menu + specialchars.innerHTML; | specialchars.innerHTML = menu + specialchars.innerHTML; | ||
Ligne 77 : | Ligne 43 : | ||
else if (window.attachEvent) | else if (window.attachEvent) | ||
window.attachEvent("onload", addCharSubsetMenu); | window.attachEvent("onload", addCharSubsetMenu); | ||
− | + | ||
} | } | ||
/* Bottom of Javascript </nowiki></source>*/ | /* Bottom of Javascript </nowiki></source>*/ | ||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− | |||
− |
Version actuelle en date du 29 octobre 2008 à 09:39
/* <source lang="javascript"><nowiki> Top of Javascript */ // Drop down box for the Special character menu in [[MediaWiki:Edittools]] // will be called from [[MediaWiki:Common.js]]. // Adapted from: // http://commons.wikimedia.org/wiki/MediaWiki:Edittools.js // Switch for people that don't want it if (load_edittools == true) { function addCharSubsetMenu() { var specialchars = document.getElementById('specialchars'); if (specialchars) { var menu = "<select style=\"display:inline\" onChange=\"chooseCharSubset(selectedIndex)\">"; menu += "<option>Standard</option>"; menu += "<option>Latin</option>"; menu += "<option>Greek</option>"; menu += "<option>French</option>"; menu += "<option>German</option>"; menu += "</select>"; specialchars.innerHTML = menu + specialchars.innerHTML; // Standard-CharSubset chooseCharSubset(0); } } // CharSubset selection function chooseCharSubset(s) { var l = document.getElementById('specialchars').getElementsByTagName('p'); for (var i = 0; i < l.length ; i++) { l[i].style.display = i == s ? 'inline' : 'none'; // l[i].style.visibility = i == s ? 'visible' : 'hidden'; } } // Menu insertion if (window.addEventListener) window.addEventListener("load", addCharSubsetMenu, false); else if (window.attachEvent) window.attachEvent("onload", addCharSubsetMenu); } /* Bottom of Javascript </nowiki></source>*/