This is an old revision of this page, as edited by Twinzor(talk | contribs) at 04:34, 15 January 2009(random attempts). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.Revision as of 04:34, 15 January 2009 by Twinzor(talk | contribs)(random attempts)
Code that you insert on this page could contain malicious content capable of compromising your account. If you import a script from another page with "importScript", "mw.loader.load", "iusc", or "lusc", take note that this causes you to dynamically load a remote script, which could be changed by others. Editors are responsible for all edits and actions they perform, including by scripts. User scripts are not centrally supported and may malfunction or become inoperable due to software changes. A guide to help you find broken scripts is available. If you are unsure whether code you are adding to this page is safe, you can ask at the appropriate village pump. This code will be executed when previewing this page.
Note: After saving, you have to bypass your browser's cache to see the changes. Google Chrome, Firefox, Microsoft Edge and Safari: Hold down the ⇧ Shift key and click the Reload toolbar button. For details and instructions about other browsers, see Wikipedia:Bypass your cache.
//<nowiki>//WikiMark////A bookmarking tool for Wikipedia.////By User:Twinzor on enwp.////99% of the code is copied from other scripts on WP.////If you improve my sloppy code, I would//appreaciate it if you could drop me//a line on my talkpage. Thanks!////To configure the script for yourself, you'll//first have to copy it to a user subpage of//you own.////Script doesn't work in IE, so prevent it from loading alltogether.varbrowser=navigator.appName;//if (browser != "Explorer") {//Reading configuration or setting defaults if not present:if(typeofWikimarkConfigWikimarksPage=='undefined'){varwikimarkspage="/WikiMarks";}else{varwikimarkspage="/"+WikimarkConfigWikimarksPage;}if(typeofWikimarkConfigListType=='undefined'){varlisttype="*";}else{varlisttype=WikimarkConfigListType;}if(typeofWikimarkConfigAddMenu=='undefined'){varaddMenulocation="p-cactions";varmenuPrefix="ca-";}elseif(WikimarkConfigAddMenu=="cactions"){varaddMenulocation="p-cactions";varmenuPrefix="ca-";}elseif(WikimarkConfigAddMenu=="personal"){varaddMenulocation="p-personal";varmenuPrefix="pt-";}elseif(WikimarkConfigAddMenu=="toolbox"){varaddMenulocation="p-tb";varmenuPrefix="t-";}elseif(WikimarkConfigAddMenu=="navigation"){varaddMenulocation="p-navigation";varmenuPrefix="n-";}else{varaddMenulocation="p-cactions";varmenuPrefix="ca-";}if(typeofWikimarkConfigViewMenu=='undefined'){varviewMenulocation="p-cactions";varmenuPrefixV="ca-";}elseif(WikimarkConfigViewMenu=="cactions"){varviewMenulocation="p-cactions";varmenuPrefixV="ca-";}elseif(WikimarkConfigViewMenu=="personal"){varviewMenulocation="p-personal";varmenuPrefixV="pt-";}elseif(WikimarkConfigViewMenu=="toolbox"){varviewMenulocation="p-tb";varmenuPrefixV="t-";}elseif(WikimarkConfigViewMenu=="navigation"){varviewMenulocation="p-navigation";varmenuPrefixV="n-";}else{varviewMenulocation="p-cactions";varmenuPrefixV="ca-";}if(typeofWikimarkConfigViewNextTo=='undefined'){varviewNextto='';}else{varviewNextto=document.getElementById("p-personal");// var viewNextto = document.getElementById(WikimarkConfigViewNextTo);// var viewNextto = menuPrefixV+WikimarkConfigViewNextTo;}if(typeofWikimarkConfigAddNextTo=='undefined'){varaddNextto='';}else{varaddNextto=document.getElementById(WikimarkConfigAddNextTo);// var addNextto = menuPrefix+WikimarkConfigAddNextTo;}varwikimarklinkprefix=wgServer+wgScript;varwikimarkEncodedUserName=encodeURIComponent(wgUserName);addOnloadHook(WikiMarkInit);functionWikiMarkInit(){varviewNextto=document.getElementById("pt-watchlist");jsMsg(WikimarkConfigViewNextTo+" "+viewNextto);addPortletLink(addMenulocation,'javascript:doAddWikiMark()','WikiMark',menuPrefix+'addwikimark','WikiMark this page','',addNextto);addPortletLink(viewMenulocation,wikimarklinkprefix+"?title=User:"+wikimarkEncodedUserName+wikimarkspage,'My WikiMarks',menuPrefixV+'showwikimark','Open your WikiMarks','',viewNextto);}functiondoAddWikiMark(){varwikimarkNewpage=wgPageName.replace("_"," ");varf;f=document.createElement("IFRAME");f.id="WikiMarksLoader";f.onload=function(){varwikimark_cmt="Adding [["+wikimarkNewpage+"]] to my WikiMarks list. (Using [[User:Twinzor/Wikimark|WikiMark]])";e=f.contentWindow.document.editform,e.wpTextbox1.value+=listtype+"["+"["+wikimarkNewpage+"]"+"]\n",e.wpSummary.value=wikimark_cmt,e.wpSave.click();variframe=document.getElementById('WikiMarksLoader');if(browser=="Safari"){iframe.style.display="none";}else{iframe.parentNode.removeChild(iframe);}jsMsg("'''"+wikimarkNewpage+"''' has been added to your WikiMarks.");};f.src=wikimarklinkprefix+"?title=User:"+wikimarkEncodedUserName+wikimarkspage+"&action=edit",document.body.appendChild(f);};//}// </nowiki>