« MediaWiki:Gadget-AncreTitres.js » : différence entre les versions

Contenu supprimé Contenu ajouté
Pabix (discussion | contributions)
mAucun résumé des modifications
Pabix (discussion | contributions)
un peu plus clair [avec un éditeur externe]
Ligne 1 :
//<pre><nowiki>
/*
* AncreTitres
Ligne 11 :
 
//////////////////////ZONE PERSONNALISABLE//////////////////////
var AncreTitres_nom_ancre = "[lienURL]"; // Texte lien externe
var AncreTitres_nom_lien_interne = "[[lien]]"; // Texte lien interne
var AncreTitres_description = "Obtenir une URL vers cette section"; // Infobulle du lien
Ligne 35 :
i++;
if (titre_courant.className.match(/mw-headline/g)) {
var ancre_nom wgPageName + "#" += noeud_precedent(titre_courant.parentNode).lastChild.name);
var small = document.createElement('small'); with(small) {
innerHTML=AncreTitres_nom_ancre;
Ligne 42 ⟶ 43 :
}
var link = document.createElement('a'); with(link) {
setAttribute("ancre", wgServer + wgScriptPath + "/index.php?title=" + wgPageName + "#" + ancre_nom ;
wgPageName + "#" + noeud_precedent(titre_courant.parentNode).lastChild.name);
setAttribute("onclick", "window.prompt('Lien : ', this.getAttribute('ancre'));");
appendChild(small);
Ligne 55 :
}
link = document.createElement('a'); with(link) {
setAttribute("ancre", "[[" + wgPageName + "#" + noeud_precedent(titre_courant.parentNode).lastChild.name)ancre_nom + "]]";
setAttribute("onclick", "window.prompt('Lien : ', this.getAttribute('ancre'));");
appendChild(small);