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>// get URL parameters (used for page type variables)varUrlParameters=newArray();readparams();functionreadparams(){varasReadInUrlParameters;varasReadInUrlParameter;// Get URL parametersasReadInUrlParameters=location.search.substring(1,location.search.length).split("&");for(i=0;i<asReadInUrlParameters.length;i++){asReadInUrlParameter=asReadInUrlParameters[i].split("=");UrlParameters[decodeURIComponent(asReadInUrlParameter[0])]=decodeURIComponent(asReadInUrlParameter[1]);}}functionnewtext(subj,text,wo){//wo=1 : Text austauschen//wo=2 : Text am Ende anhängen//wo=3 : Text vorne Einfügenif(subj>""){if(document.editform.wpSummary.value>"")document.editform.wpSummary.value+=", ";document.editform.wpSummary.value=document.editform.wpSummary.value+subj;}switch(wo){case1:document.editform.wpTextbox1.value=text+'\n';break;case2:document.editform.wpTextbox1.value=document.editform.wpTextbox1.value+'\n'+text;break;case3:document.editform.wpTextbox1.value=text+'\n'+document.editform.wpTextbox1.value;break;}document.editform.wpTextbox1.focus();}varisEdit=((UrlParameters['action']=='edit')||(UrlParameters['action']=='submit'));functionaddpersonalityrightsbutton(){mediaWiki.util.addPortletLink("p-tb","javascript:addpersonalityrights();","Personality rights","p-impart","Vorlage:Personality rights ergänzen","");}if(mw.config.get('wgCanonicalNamespace')=='File')$(addpersonalityrightsbutton);functionaddpersonalityrights(){if(!isEdit){location.href="//commons.wikimedia.org/w/index.php?title="+wgPageName+"&action=edit§ion=2";}else{addpersonalityrights2();}}functionaddpersonalityrights2(type){newtext("+[[Template:Personality rights]]","{{Personality rights}}",3);varregexp=document.editform.wpTextbox1.value.match(/(={2,}[^\n]*\n)/g);varlastheadline=RegExp.$1;}if(UrlParameters["addimpart"]){window.setTimeout(function(){$(addpersonalityrights2);},500);}//</nowiki>