« MediaWiki:Gadget-AncreTitres.js » : différence entre les versions
Contenu supprimé Contenu ajouté
mAucun résumé des modifications |
un peu plus clair [avec un éditeur externe] |
||
Ligne 1 :
//<pre><nowiki>
/*
* AncreTitres
Ligne 11 :
//////////////////////ZONE PERSONNALISABLE//////////////////////
var AncreTitres_nom_ancre = "[
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 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 + "#" +
setAttribute("onclick", "window.prompt('Lien : ', this.getAttribute('ancre'));");
appendChild(small);
|