« MediaWiki:Gadget-AncreTitres.js » : différence entre les versions
Contenu supprimé Contenu ajouté
autre solution pour mettre un href |
jout d'un span englobant pour être cohérent avec editsection |
||
Ligne 15 :
description : "Obtenir une URL vers cette section",
descinterne : "Obtenir un [[Lien#interne]]",
linkcolor : "
fontSize : "
fontWeight : "normal",
afficheE : true,
afficheI : true,
Ligne 32 ⟶ 33 :
var i = 0;
var titre_courant;
if (!AncreTitres.afficheI && !AncreTitres.afficheE) return;
for (i = 0 ; i < titres.length ; i++){
var titre_courant = titres[i].parentNode;
Ligne 44 ⟶ 46 :
var small;
var link;
span = document.createElement('span');
with(span ) {
}
if (AncreTitres.afficheE) {
small = document.createElement('small'); with(small) {
innerHTML=AncreTitres.nom_ancre;
title=AncreTitres.description;
▲ style.color=AncreTitres.linkcolor;
▲ style.fontSize=AncreTitres.fontSize;
}
link = document.createElement('a');
Ligne 55 ⟶ 63 :
link.setAttribute("onclick", "window.prompt('Lien : ', this.getAttribute('ancre'));");
link.setAttribute("href", "javascript:;"); link.appendChild(small);
}
if (AncreTitres.afficheI) {
Ligne 61 ⟶ 69 :
innerHTML=AncreTitres.nom_lien_interne;
title=AncreTitres.descinterne;
▲ style.color=AncreTitres.linkcolor;
}
link = document.createElement('a');
Ligne 69 ⟶ 75 :
link.setAttribute("href", "javascript:;");
link.appendChild(small);
}
titre_courant.appendChild(span);
}
}
|