52.402
Bearbeitungen
Keine Bearbeitungszusammenfassung |
K (hm.) |
||
Zeile 1:
//================================================================================
/* Spoiler-Button */
function createSpoilerButtons() {
var els = document.getElementsByTagName('*');
var pattern = new RegExp("(^|\\s)jp(\\s|$)");
for (i = 0; i < els.length; i++) {
if ( pattern.test(els[i].className) ) {
var toInsert = document.getElementById('firstHeading');
var els1 = document.getElementsByTagName('*');
var pattern1 = new RegExp("(^|\\s)topicon(\\s|$)");
for (i = 0; i < els1.length; i++) {
if ( pattern1.test(els1[i].className) ) {
toInsert = els1[i];
break;
}
}
var container = document.getElementById('content');
var div2 = document.createElement('div');
div2.className = '_toggle de';
div2.style.cssFloat = 'right';
div2.style.textAlign = 'right';
div2.style.width = '190px';
div2.style.fontSize = '120%';
var span = document.createElement('span');
span.className = '_toggler_hide-de _toggler_show-jp';
span.appendChild(document.createTextNode('Spoiler anzeigen '));
div2.appendChild(span);
var img = document.createElement('img');
img.src = '/images/thumb/b/bd/Close.png/25px-Close.png';
img.style.verticalAlign = 'middle';
div2.appendChild(img);
container.insertBefore(div2,toInsert);
var div2 = document.createElement('div');
div2.className = '_toggle de';
div2.style.display = 'none';
div2.style.cssFloat = 'right';
div2.style.textAlign = 'right';
div2.style.width = '190px';
container.insertBefore(div2,toInsert);
var div2 = document.createElement('div');
div2.className = '_toggle jp';
div2.style.display = 'none';
div2.style.cssFloat = 'right';
div2.style.textAlign = 'right';
div2.style.width = '190px';
container.insertBefore(div2,toInsert);
var div2 = document.createElement('div');
div2.className = '_toggle jp';
div2.style.display = 'none';
div2.style.cssFloat = 'right';
div2.style.textAlign = 'right';
div2.style.width = '190px';
div2.style.fontSize = '60%';
var span = document.createElement('span');
span.className = '_toggler_hide-jp _toggler_show-de';
span.appendChild(document.createTextNode('(Spoiler verbergen) '));
div2.appendChild(span);
var img = document.createElement('img');
img.src = '/images/thumb/7/7f/Open.png/25px-Open.png';
img.style.verticalAlign = 'middle';
div2.appendChild(img);
container.insertBefore(div2,toInsert);
break;
}
}
}
$(createSpoilerButtons);
/* Folgendes Script wird in jedem Skin geladen */
Zeile 261 ⟶ 342:
}
})});
//================================================================================
if (typeof showAllSpoiler == 'undefined' ) {
var showAllSpoiler = 0;
}
function createSpoiler() {
if (showAllSpoiler || spoilersDone) return;
var indexSpoiler = 0;
// iterate over all < div >-elements
var divs = document.getElementsByTagName("div");
for (var i=0; i<divs.length; i++) {
var Spoiler = divs[i];
if (Spoiler.className == "spoiler") {
indexSpoiler++;
Spoiler.style.display = "none";
var SpoilerToggle = document.createElement("a");
SpoilerToggle.className = 'spoilerButton';
SpoilerToggle.setAttribute('id', 'SpoilerToggle' +indexSpoiler);
SpoilerToggle.setAttribute('href', 'javascript:toggleObjectVisibility(\'Spoiler' + indexSpoiler + '\');');
var spLabel = Spoiler.getAttribute("title");
Spoiler.setAttribute("title", "");
if (!spLabel) spLabel = "Spoiler";
var SpoilerToggleText = document.createTextNode(spLabel);
SpoilerToggle.appendChild(SpoilerToggleText);
document.getElementById("bodyContent").insertBefore(
SpoilerToggle,
Spoiler
);
Spoiler.setAttribute('id', 'Spoiler' + indexSpoiler);
}
}
spoilersDone = true;
}
function createContentTabs() {
|