MediaWiki:Common.js: Unterschied zwischen den Versionen

Obsolete Funktionen createSpoiler und createContentTabs entfernt
(Cursor-Platzierung auf der Hauptseite immer in der Suchbox)
(Obsolete Funktionen createSpoiler und createContentTabs entfernt)
 
(Eine dazwischenliegende Version desselben Benutzers wird nicht angezeigt)
Zeile 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 328 ⟶ 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");