This is an old revision of this page, as edited by Gxnx0xmx0xn(talk | contribs) at 01:10, 8 March 2015(←Created page with '// gn0Marks // // // A bookmarking tool for Wikipedia. // Adapted (i.e., jury-rigged) in 2015 by User:Gxnx0xmx0xn on enwp from WikiMarks by User:Twinzor on enwp....'). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.Revision as of 01:10, 8 March 2015 by Gxnx0xmx0xn(talk | contribs)(←Created page with '// gn0Marks // // // A bookmarking tool for Wikipedia. // Adapted (i.e., jury-rigged) in 2015 by User:Gxnx0xmx0xn on enwp from WikiMarks by User:Twinzor on enwp....')
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.
// gn0Marks ////// A bookmarking tool for Wikipedia.// Adapted (i.e., jury-rigged) in 2015 by User:Gxnx0xmx0xn on enwp from WikiMarks by User:Twinzor on enwp.//// See User:Gxnx0xmx0xn/gn0Marks/ for more info on installation.//////////////////////////// //// gn0m0n.com //// //////////////// // ////////////// // ////////////// // ////////////// // ////////////// // //////////////////////////// PS: I don't really know JavaScript so this is probably a klugey solution. But it works for me.//Reading configuration or setting defaults if not present:if(typeofWikimarkConfigWikimarksPage=='undefined'){varwikimarkspage="/WikiMarks";}else{varwikimarkspage="/"+WikimarkConfigWikimarksPage;}if(typeofWikimarkConfigKeepSection=='undefined'){varwikimarksect=0;}else{varwikimarksect=WikimarkConfigKeepSection;}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(typeofWikimarkConfigWikimarksUsername=='undefined'){varwikimarkEncodedUserName=encodeURIComponent(wgUserName);}else{varwikimarkEncodedUserName=WikimarkConfigWikimarksUsername;}varwikimarklinkprefix=wgServer+wgScript;$(WikiMarkInit);functionWikiMarkInit(){if(typeofWikimarkConfigViewNextTo=='undefined'){varviewNextto='';}else{varviewNextto=document.getElementById(menuPrefixV+WikimarkConfigViewNextTo);}if(typeofWikimarkConfigAddNextTo=='undefined'){varaddNextto='';}else{varaddNextto=document.getElementById(menuPrefix+WikimarkConfigAddNextTo);}addPortletLink(addMenulocation,'javascript:doAddWikiMark()','WikiMark yo',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(/_/g," ");if(wikimarkNewpage.indexOf("File:")==0){wikimarkNewpage=":"+wikimarkNewpage;}elseif(wikimarkNewpage.indexOf("Category:")==0){wikimarkNewpage=":"+wikimarkNewpage;}varwikimarkNewpageName=wikimarkNewpage;if(wikimarksect==1){varnewpageURL=___location.href;if(newpageURL.indexOf("#")){anchor=newpageURL.split("#");newpageSect=anchor[1];varwikimarkNewpageLink=wikimarkNewpage;wikimarkNewpage=wikimarkNewpage+"#"+newpageSect;wikimarkNewpage=wikimarkNewpage.replace(/_/g," ");wikimarkNewpageName=wikimarkNewpageLink+" (Section: "+newpageSect+")";}}varf;f=window.open(wikimarklinkprefix+"?title=User:"+wikimarkEncodedUserName+wikimarkspage+"&action=edit&output=embed")f.id="WikiMarksLoader";if(wikimarkNewpageName==wikimarkNewpage){varwikimarkLinktext=wikimarkNewpage;}else{varwikimarkLinktext=wikimarkNewpage+"|"+wikimarkNewpageName;}f.onload=function(){varwikimark_cmt="Adding [["+wikimarkNewpage+"]] to my WikiMarks list.";e=f.document.editform;e.wpTextbox1.value+=listtype+"["+"["+wikimarkLinktext+"]"+"]\n";e.wpSummary.value=wikimark_cmt;e.wpSave.click();f.close();jsMsg("'''"+wikimarkNewpageName+"''' has been added to your WikiMarks.");};}