User:Christian Sirolli/global.js

massCategorizationDelay = 1000; nullEditDelay = 1; window.AdvancedOasisUI = { accountNavFollowedPages: true, accountNavWatchlist: true, categoryRedlink: true, RCHeader: true, DefaultSourceMode: true, lightbox: true, activity2RC: true, userLang: true}; importArticles({   type: 'script',    articles: [        'u:dev:FindAndReplace/code.js',        'u:dev:NullEditButton/code.js',        //'u:dev:Bglinks.js',        'u:dev:AutoEditPages/code.js',        'u:dev:UnsafeScripts/code.js',        'u:dev:AntiUnicruft/code.js',        'u:dev:PortableCSSPad/code.js',        'u:dev:ReferencePopups/code.js',        'u:dev:CategoryRenameAuto-update/code.js',        'u:dev:MediaWiki:MassNullEdit/code.js',        'u:dev:MediaWiki:Rollback/code.js',        'u:dev:MediaWiki:MassCategorization/code.js',        'u:dev:Wikimarks/code.js',        //'u:dev:AjaxPatrol/code.js',        'u:community:User:Cizagna/ajaxpatrollinks.js',        'u:dev:UserTalkNotifications/code.js',        'u:dev:EditIntroButton/code.js',        'u:dev:AdvancedOasisUI/code.js',        //'u:dev:JWB/code.js,'    ] }); importScriptURI('//en.wikipedia.org/w/index.php?title=User:Joeytje50/JWB.js/load.js&action=raw&ctype=text/javascript'); importScriptURI('//en.wikipedia.org/w/index.php?title=User:Cacycle/wikEd.js' + '&action=raw&ctype=text/javascript'); /* jQuery Ajax Patrol Links @author Grunny */ function ajaxPatrolLinks { $( 'body' ).on( 'click', '.patrollink', function ( e ) {		e.preventDefault;		var	$patrolLink = $( this ).children( 'a' ),			$url = $patrolLink.attr( 'href' );		$patrolLink.html( '' );		$.get( $url, function { $patrolLink.removeAttr( 'href' ).css( 'color', 'grey' ).text( 'Marked as patrolled' ); } );	} ); } $( ajaxPatrolLinks ); function ajaxPatrolLinks { var a = document.evaluate('//span[@class="patrollink"]/a', document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null ).singleNodeValue; // dif article var b = document.evaluate('//div[@class="patrollink"]/a', document, null, XPathResult.FIRST_ORDERED_NODE_TYPE, null ).singleNodeValue; // new article if (b) a = b;	if (a) { var div = a.parentNode; div.style.cssText = 'color:Crimson'; var url = a.href; a.onclick = function (event) { var aj = sajax_init_object; if (aj) { while (div.firstChild) { div.removeChild(div.firstChild) } div.appendChild(document.createTextNode('[Marking as patrolled...]')); aj.onreadystatechange = function { if (aj.readyState == 4 && aj.status == 200) { while (div.firstChild) { div.removeChild(div.firstChild) } div.style.cssText = 'color:Silver'; div.appendChild(document.createTextNode('[Marked as patrolled]')); aj.onreadystatechange = null; }				};				aj.open("GET", url, true); aj.send(null); return false; }		};	} } addOnloadHook(ajaxPatrolLinks);