Note: After saving, you have to bypass your browser's cache to see the changes. Internet Explorer: press Ctrl-F5, Mozilla: hold down Shift while clicking Reload (or press Ctrl-Shift-R), Opera/Konqueror: press F5, Safari: hold down Shift + Alt while clicking Reload, Chrome: hold down Shift while clicking Reload.
// <nowiki>functiongetParamValue(paramName){varcmdRe=RegExp('[&?]'+paramName+'=([^&]*)');varh=document.location;varm=cmdRe.exec(h);if(m){try{returndecodeURIComponent(m[1]);}catch(someError){}}returnnull;}functioninsertText(text,wo,subject,autoedit){autoedit=autoedit||false;//wo=1 : Text austauschen//wo=2 : Text vorne Einfügen//wo=3 etc : Text am Ende anhängenif(isEdit){if(subject>""){if(document.getElementById('wpSummary').value>"")document.getElementById('wpSummary').value+=", ";document.getElementById('wpSummary').value=document.getElementById('wpSummary').value+subject;}switch(wo){case1:document.getElementById('wpTextbox1').value=text+'\n';break;case2:document.getElementById('wpTextbox1').value=text+'\n'+document.getElementById('wpTextbox1').value;break;default:document.getElementById('wpTextbox1').value=document.getElementById('wpTextbox1').value+'\n'+text;break;}if(autoedit){document.getElementById('wpSave').click();}else{document.getElementById('wpTextbox1').focus();}}else{location.href=wgScript+'?title='+encodeURIComponent(getLemma())+'&action=edit'+'&subject='+encodeURIComponent(subject)+'&text='+encodeURIComponent(text)+'&wo='+encodeURIComponent(wo)+'&autoedit='+autoedit;}}functiongetLemma(){//Littlvarlemma;if(isContrib&&(getParamValue("target")>""))lemma=getParamValue("target");elseif(getParamValue("title")>"")lemma=getParamValue("title");else{lemma=decodeURIComponent(location.href.substring(location.href.indexOf("/wiki/")+6)).split('#')[0];// fix linky links (?redirect=no)//lemma = lemma.split['\x3F'][0];if(lemma.indexOf("redirect=no")!=-1)lemma=lemma.substring(0,lemma.indexOf("redirect=no")-1);}// if (lemma.substring(0, 5) == "Bild:") lemma=lemma.slice(5);// if (lemma.substring(0, 10) == "Kategorie:") lemma=lemma.slice(10);if(isPHP)lemma=lemma.split('+').join('_');returnlemma;}functionopenWindow(url){varres=window.open(url,'_blank');if(!res)alert("openWindow: window.open() returned null");}functiongetUploader(){// Get uploader from first point in the list under "File history"// Uploader is stored in second A tag in UL tag under "File history"// Returns title of user page (without name space) in URL formvarel=document.getElementById('filehistory')if(!el){varreq;if(req=newRequest()){req.open("GET",document.getElementById('ca-history').firstChild.href.match(/http:\/\/commons.wikimedia.org(.+)/)[1],false);req.send("");varhistory=document.createElement('ul');history.innerHTML=req.responseText.match(/<ul\s+id="pagehistory">([^]*<\/LI>)\s<\/UL>/i)[1];returnencodeURIComponent(history.lastChild.getElementsByTagName('span')[0].getElementsByTagName('a')[0].innerHTML);}alert("getUploader: Cannot find filehistory ... exiting");returnnull;}while(el.nextSibling){el=el.nextSibling;if(el.tagName&&el.tagName.toLowerCase()=='table')break;}if(!el){alert("getUploader: Cannot find table tag ... exiting");returnnull;}varas=el.getElementsByTagName('a');varre1=newRegExp((mw.config.get('wgServer')+mw.config.get('wgArticlePath').substr(0,wgArticlePath.length-2)).replace(/\./g,'\\.')+'User:(.*)$');varre2=newRegExp((wgServer+wgScript).replace(/\./g,'\\.')+'\\?title=User:([^&]*)');varm;for(vark=0;k<as.length;k++){m=re1.exec(as[k].href);if(m)returnm[1];m=re2.exec(as[k].href);if(m)returnm[1];}alert("getUploader: Cannot find uploader ... exiting");returnnull;}functionnewRequest(){try{if(window.XMLHttpRequest){returnnewXMLHttpRequest();}else{returnnewActiveXObject("MSXML2.XMLHTTP");}}catch(e){returnfalse;}}////////////////////////////////////////////////////////////////////////////////////////// trim()// Leerzeichen am Anfang und Ende entfernenfunctiontrim(str){returnstr.replace(/^\s*|\s*$/g,"");}/* * Stringlänge überprüfen für Zusammenfassungszeile */functionEditCommentLength(str){return(199-str.length);}// ------------// Param PDD// page type variables: namespacesvarisArticle=(wgNamespaceNumber==0);varisArticleTalk=(wgNamespaceNumber==1);varisImage=(wgCanonicalNamespace=="Image");varisCategory=(wgCanonicalNamespace=="Category");varisTemplate=(wgCanonicalNamespace=="Template");varisGeneric=false;if((!isImage)&&(!isCategory)&&(!isTemplate))isGeneric=true;varisProject=(wgCanonicalNamespace=="Project");varisUser=(wgCanonicalNamespace=="User");varisUserTalk=(wgCanonicalNamespace=="User_talk");varisHelp=(wgCanonicalNamespace=="Help");// page type variables: namespace == -1varisSpecial=(wgCanonicalNamespace=="Special");varisRestore=(isSpecial&&(wgCanonicalSpecialPageName=="Undelete"));varisContrib=(isSpecial&&(wgCanonicalSpecialPageName=="Contributions"));varisWatchlist=(isSpecial&&(wgCanonicalSpecialPageName=="Watchlist"));// page type variables: namespace == -1varisTalk=(!isSpecial&&(wgNamespaceNumber%2==1));// page type variables: other stuffvarisPHP=(document.URL.indexOf('index.php')>0);varisDiff=getParamValue('diff');varisEdit=((getParamValue('action')=='edit')||(getParamValue('action')=='submit'));varisHistory=(getParamValue('action')=='history');// /param// ------------//</nowiki>