MediaWiki:Common.js: Unterschied zwischen den Versionen
Zur Navigation springen
Zur Suche springen
Loki (Diskussion | Beiträge) (test) |
Loki (Diskussion | Beiträge) Keine Bearbeitungszusammenfassung |
||
Zeile 172: | Zeile 172: | ||
window[func2](var21,var22); | window[func2](var21,var22); | ||
window[func3](var31,var32); | window[func3](var31,var32); | ||
} | |||
function multiCall12( func1,var11,func2,var21,var22 ) { | |||
window[func1](var11); | |||
window[func2](var21,var22); | |||
} | } |
Version vom 28. April 2013, 08:24 Uhr
/* Das folgende JavaScript wird für alle Benutzer geladen. */ if (mwCustomEditButtons) { mwCustomEditButtons[mwCustomEditButtons.length] = { "imageFile": "http://shadowhelix.pegasus.de/images/1/1b/Button_empty.png", "speedTip": "a2060 a2070 ad adh adsw ahb aj1 aj2 aj3 aj4 b&s b6w b:adl\nb:m ber berlim bs btech cp! crit ctech c&d d6w db dc dnadoa\ndids dids2 dj eids el eme fd fe fk fk2 fmf fogw fr gidw\ngrim gk gz hbew hbk h hr jdk kd ke ken kf kk kz ldv ls73\nmat merc mg mk mn mshfs mst mst2 mum naqb nl ns otr pb\nped pz rhb r2 r3 ra:s rds rk rl rrmp srz sa sdk sh sk sk2 sl slr\nsls sls2 sls3 sls4 sm sm2 sota63 sota64 sota73 sox sqb sr\nsr2 sr3 sr4 sr4a sr4er srk srk3 ssch ss ss2 ssk ssk2 stech\nsühb sw sz tw ub uqb uw vd vf vn vr2 vt wda wds wpsi ww\n", "tagOpen": '', "tagClose": "", "sampleText": ""}; } function createFunctionButtons() { var Selection = document.getElementsByClassName( "jsFunctionButton" ); for ( var i = Selection.length - 1; i >= 0 ; i-- ) { var input = Selection[i].id.split("_"); var jsFunction = input.shift(); var Button = document.createElement( "a" ); var inputString = ""; for ( var j = 0; j < input.length; j++ ) { inputString = inputString + "'"+input[j]; if (j != input.length - 1) { inputString = inputString + "',"; } else { inputString = inputString + "'"; } } Button.setAttribute( "href", "javascript:"+jsFunction+"("+inputString+")" ); Button.appendChild( Selection[i].childNodes[0] ); $(Selection[i]).replaceWith( Button ); } } function toggleVisibility( targetClass, targetID ) { var objects = document.getElementsByClassName( targetClass ); for ( var i = 0; i < objects.length; i++ ) { if (objects[i].id != targetID) { objects[i].style.display = 'none'; } else { objects[i].style.display = ''; } } } function toggleVisibilityMatch( targetClass, targetID ) { var objects = document.getElementsByClassName( targetClass ); for ( var i = 0; i < objects.length; i++ ) { if (objects[i].id.search(targetID) == -1) { objects[i].style.display = 'none'; } else { objects[i].style.display = ''; } } } function toggleWeight( targetClass, targetID ) { var objects = document.getElementsByClassName( targetClass ); for ( var i = 0; i < objects.length; i++ ) { if (objects[i].id != targetID) { objects[i].style.fontWeight = 'normal'; } else { objects[i].style.fontWeight = 'bold'; } } } function switchWeight( targetClass, targetID ) { var objects = document.getElementsByClassName( targetClass ); for ( var i = 0; i < objects.length; i++ ) { if (objects[i].id == targetID) { if (objects[i].style.fontWeight == '700') { objects[i].style.fontWeight = 'normal'; } else { objects[i].style.fontWeight = 'bold'; } } } } function switchVisibility( targetClass, targetID ) { var objects = document.getElementsByClassName( targetClass ); for ( var i = 0; i < objects.length; i++ ) { if (objects[i].id == targetID) { if (objects[i].style.display == 'none') { objects[i].style.display = ''; } else { objects[i].style.display = 'none'; } } } } function switchVisibilityOnClass( targetClass ) { var objects = document.getElementsByClassName( targetClass ); for ( var i = 0; i < objects.length; i++ ) { if (objects[i].style.display == 'none') { objects[i].style.display = ''; } else { objects[i].style.display = 'none'; } } } function resetVisibility( targetClass, allVisible ) { var objects = document.getElementsByClassName( targetClass ); for ( var i = 0; i < objects.length; i++ ) { if (allVisible != 0) { objects[i].style.display = ''; } else { objects[i].style.display = 'none'; } } } function resetWeight( targetClass, allNormal ) { var objects = document.getElementsByClassName( targetClass ); for ( var i = 0; i < objects.length; i++ ) { if (allNormal != 0) { objects[i].style.fontWeight = 'normal'; } else { objects[i].style.fontWeight = 'bold'; } } } function multiCall122( func1,var11,func2,var21,var22,func3,var31,var32 ) { window[func1](var11); window[func2](var21,var22); window[func3](var31,var32); } function multiCall222( func1,var11,var12,func2,var21,var22,func3,var31,var32 ) { window[func1](var11,var12); window[func2](var21,var22); window[func3](var31,var32); } function multiCall12( func1,var11,func2,var21,var22 ) { window[func1](var11); window[func2](var21,var22); } function multiCall22( func1,var11,var12,func2,var21,var22 ) { window[func1](var11,var12); window[func2](var21,var22); } addOnloadHook( createFunctionButtons );