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.
/* MARK EDITS AFTER MY OWN Description: Marks edits on contribution pages where the user's edit is not the most recent on that page. Does not mark pages on your watchlist, since you are already notified of those.*/if(typeof(unsafeWindow)!='undefined'){varconsole=unsafeWindow.console;importStylesheet=unsafeWindow.importStylesheet;mw=unsafeWindow.mw;sajax_init_object=unsafeWindow.sajax_init_object;}functionmarkEditsAfterMyOwn(){if(!mw.config.get('wgPageName').match('Special:Contributions'))return;importStylesheet('User:Gary/highlighted link.css');if($('#contentSub').children().eq(0).text()==mw.config.get('wgUserName'))varisOwnUserContributions=true;elsevarisOwnUserContributions=false;// get watchlist items first so that they aren't marked as well, only for current user's contributionsif(isOwnUserContributions)$.get(mw.config.get('wgScriptPath')+'/api.php',{action:'query',list:'watchlist',wllimit:500,format:'json'},markEditsAfterMyOwnWatchlist);elsemarkEditsAfterMyOwnMark('',false);};functionmarkEditsAfterMyOwnWatchlist(obj){varwatchlist=obj['query']['watchlist'];varpagesToIgnore={};for(vari=0;i<watchlist.length;i++){if(pagesToIgnore[watchlist[i]['title']])pagesToIgnore[watchlist[i]['title']]++;elsepagesToIgnore[watchlist[i]['title']]=1;}markEditsAfterMyOwnMark(pagesToIgnore,true);}functionmarkEditsAfterMyOwnMark(pagesToIgnore,isOwnUserContributions){if(isOwnUserContributions&&$.isEmptyObject(pagesToIgnore))$('#contentSub').append('. <span class="no-items-on-watchlist" style="color: #000; font-weight: bold;">Your watchlist is empty.</span>');if(!pagesToIgnore)pagesToIgnore={};varmarkedPages={};$('#bodyContent ul:last').children().each(function(){varedit=$(this);if(edit[0].nodeType==3)returntrue;varpageName=edit.children().eq(0).attr('title');if($('.mw-uctop',edit).length)markedPages[pageName]=1;else{if(markedPages[pageName])markedPages[pageName]++;else{// get the link to highlight itvarnodeNumber;varchildren=edit.children();varnormalNode=3;varminorNode=4;vardeletedNode=2;// Take the fourth A node. If not available, then always take the second.varlinkToHighlight=$('a:eq(3)',edit);if(!linkToHighlight.length)linkToHighlight=$('a:eq(1)',edit);// in most cases// if (children.eq(normalNode).length && children.eq(normalNode)[0].nodeName == 'A') nodeNumber = normalNode;// is a minor edit// else if (children.eq(minorNode).length && children.eq(minorNode)[0].nodeName == 'A') nodeNumber = minorNode;// a deleted edit// else if (children.eq(deletedNode).length && children.eq(deletedNode)[0].nodeName == 'A') nodeNumber = deletedNode;linkToHighlight.addClass(pagesToIgnore[pageName]?'highlighted-link-watched':'highlighted-link');markedPages[pageName]=1;}}});}$(markEditsAfterMyOwn);