User:Per/monobook.js: Difference between revisions

From OLPC
Jump to navigation Jump to search
(added js snipet for better usability with screen reader software)
 
(Unfortunately, this script doesn't work like it should: http://blind.wikia.com/wiki/Accessibility_and_Wikis#Section_title_and_edit_link)
 
Line 1: Line 1:
// ============================================================
// BEGIN Moving of the editsection links
/*
* moveEditsection
* Dieses Script verschiebt die [Bearbeiten]-Buttons vom rechten Fensterrand
* direkt rechts neben die jeweiligen Überschriften.
* This script moves the [edit]-buttons from the right border of the window
* directly right next to the corresponding headings.
*
* Zum Abschalten die folgende Zeile (ohne führendes Sternchen) in die eigene
* monobook.js (zu finden unter [[Special:Mypage/monobook.js|Benutzer:Name/monobook.js]]) kopieren:
* var oldEditsectionLinks = true;
*
* dbenzhuser (de:Benutzer:Dbenzhuser)
*/
function moveEditsection() {
if (typeof oldEditsectionLinks == 'undefined' || oldEditsectionLinks == false) {
var spans = document.getElementsByTagName("span");
for(var i = 0; i < spans.length; i++) {
if(spans[i].className == "editsection") {
spans[i].style.fontSize = "x-small";
spans[i].style.fontWeight = "normal";
spans[i].style.cssFloat = "none";
spans[i].style.marginLeft = "0px";
spans[i].parentNode.appendChild(document.createTextNode(" "));
spans[i].parentNode.appendChild(spans[i]);
}
}
}
}
// onload
addOnloadHook(moveEditsection);
// END Moving of the editsection links
// ============================================================

Latest revision as of 07:25, 23 July 2008