MediaWiki:Common.js: Unterschied zwischen den Versionen

Zur Navigation springen Zur Suche springen
Obsolete Funktionen createSpoiler und createContentTabs entfernt
KKeine Bearbeitungszusammenfassung
(Obsolete Funktionen createSpoiler und createContentTabs entfernt)
 
(2 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt)
Zeile 1:
/* Folgendes Script wird in jedem Skin geladen */
 
// Imported from https://en.wikipedia.org/wiki/Wikipedia:FAQ/Main_Page as of April 1, 2008
 
if ( mw.config.get( 'wgIsMainPage' ) ) {
$( function () {
$( '#searchInput' ).focus();
} });
 
//================================================================================
Zeile 262 ⟶ 270:
})});
 
function createContentTabs() {
var ict = 0, divs = document.getElementsByTagName("div"), defaultTab;
for (var i = 0; i<divs.length; i++) {
var ctdiv = divs[i];
if (ctdiv.className == "Tabs") {
var firstTab, tabs;
ict++;
 
if (document.getElementById("ct_"+ict)) continue;
ctdiv.parentNode.id = "ct_"+ict;
tabs = ctdiv.childNodes;
defaultTab = ctdiv.title;
ctdiv.setAttribute("title", "");
 
for (var j=0; j<tabs.length; j++) {
var tab = tabs[j];
var toggle = document.createElement("a");
var tabName = tab.className;
if (!tabName) continue;
 
toggle.setAttribute('href', 'javascript:toggleTab(\'ct_'+ict+'\', \''+tabName+'\');');
toggle.setAttribute('id', 'ct_'+ict+'_'+tabName);
 
var spLabel = tab.innerHTML;
if (!spLabel) continue;
toggle.innerHTML = spLabel;
 
if (!firstTab) {
firstTab = tabName;
if (!defaultTab) {
defaultTab=tabName;
}
}
ctdiv.appendChild(toggle);
ctdiv.removeChild(tab);
}
toggleTab("ct_"+ict, defaultTab);
}
}
function toggleTab(ct_id, ct_tab) {
var a = document.getElementById(ct_id);
Zeile 320 ⟶ 288:
document.getElementById(ct_id+"_"+ct_tab).className = "active";
}
 
$(createSpoiler);
if(mw.config.get("wgAction") === "edit") {
$(createContentTabs);
document.getElementById("wpSaveWidget").classList.remove("oo-ui-flaggedElement-primary");
document.getElementById("wpSaveWidget").classList.remove("oo-ui-flaggedElement-progressive");
document.getElementById("wpPreviewWidget").classList.add("oo-ui-flaggedElement-primary");
document.getElementById("wpPreviewWidget").classList.add("oo-ui-flaggedElement-progressive");
}

Navigationsmenü