User:Redactyll/common.js

importScript( 'User:Qwertyytrewqqwerty/DisamAssist.js' ); // Backlink: User:Qwertyytrewqqwerty/DisamAssist.js

// /*

INSTRUCTIONS:

Add the following line to your common.js: importScript('User:MusikAnimal/importWatchlist.js'); // Linkback: User:MusikAnimal/importWatchlist.js Please keep the linkback comment so I can see how many people use this)

There will be a new box at the top of your watchlist. Enter the username of the account whose watchlist you wish to import. You will also need their watchlist token, which can be found in their Preferences under the Watchlist tab. Special:Preferences

mw.loader.load('//en.wikipedia.org/w/index.php?title=User:Joeytje50/JWB.js/load.js&action=raw&ctype=text/javascript');

if($("#mw-watchlist-resetbutton").is(":visible")) { $("#mw-watchlist-resetbutton").after(		"" +			" Import watchlist " +			" Source watchlist username:  " +			" Source watchlist token:  (can be found at Special:Preferences#mw-prefsection-watchlist) " +			" " +			"Import " +		" "	); $("#import_watchlist_form").submit(function(e) {		$("#import_watchlist_form").find("input,button").prop("disabled",true);		$("#import_watchlist_progress").html("Fetching watchlist...")		importWatchlistArray = [];		// do this craziness until Promises are more well supported		tempCount = 0;		tempFn = function {			delete tempFn; // no dup calls			$("#import_watchlist_progress").html(importWatchlistArray.length + " watches queued for import");			for(var i=0; i<importWatchlistArray.length; i+=50) {				importWatches(importWatchlistArray.slice(i,i+49), function(ret) { tempCount += 50; if(tempCount < importWatchlistArray.length) { $("#import_watchlist_progress").html("Working... " + tempCount + " of " + importWatchlistArray.length + " imported"); } else { // done $("#import_watchlist_progress").html(" Complete! " + importWatchlistArray.length + " pages imported to watchlist :) ");						delete tempCount; // why not					}					if(!ret) {						$("#import_watchlist_progress").after(" Error while importing batch " + parseInt(i/50) + ". Not all pages may have imported. ")					}				}); }		}		getWatchlist(null, tempFn); e.preventDefault; }); }

function importWatches(watches, fn) { data = { action : "watch", format : "json", titles : watches.join("|"), token : mw.user.tokens.get('watchToken') }	$.ajax({		type : "POST",		dataType : "json",		url : mw.util.wikiScript('api'),		data : data,		success : function(data) {			return fn(true);		},		error : function(data) {			return fn(false);		}	}); }

function getWatchlist(wrcontinue, fn) { $.getJSON(mw.util.wikiScript('api') +		"?action=query&list=watchlistraw&wrowner="+$('#import_watchlist_username').val +		"&wrtoken="+$('#import_watchlist_token').val +		(wrcontinue ? "&wrcontinue="+wrcontinue : "") +		"&wrlimit=500&rawcontinue=&format=json", null, function(data) {			if(!data.watchlistraw) {				// error				$("#import_watchlist_progress").html(" Error fetching watchlist from user " + $("#import_watchlist_username").val + ". Possible username/token mismatch.");				$("#import_watchlist_form").find("input,button").prop("disabled",false);				return false;			}			// first push to array			for(var i=0; i<data.watchlistraw.length; i++) {				importWatchlistArray.push(data.watchlistraw[i].title);			}			if(data.watchlistraw.length === 500) {				// may still be more to export				if(data['query-continue'] && data['query-continue'].watchlistraw && data['query-continue'].watchlistraw.wrcontinue) {					getWatchlist(data['query-continue'].watchlistraw.wrcontinue,function { if(data.watchlistraw.length < 500) { // we're at the end tempFn; }					});				}			} else {				tempFn;			}	}); }

function getAjax(url) { // Return a new promise. return new Promise(function(resolve, reject) {   // Do the usual XHR stuff    var req = new XMLHttpRequest;    req.open('GET', url);

req.onload = function { // This is called even on 404 etc // so check the status if (req.status == 200) { // Resolve the promise with the response text resolve(req.response); }     else { // Otherwise reject with the status text // which will hopefully be a meaningful error reject(Error(req.statusText)); }   };

// Handle network errors req.onerror = function { reject(Error("Network Error")); };

// Make the request req.send; }); }

// importScript( 'User:Equazcion/ScriptInstaller.js' ); // Backlink: User:Equazcion/ScriptInstaller.js //

importScript('User:Theopolisme/Scripts/adminhighlighter.js'); //Linkback: User:Theopolisme/Scripts/adminhighlighter.js Added by Script installer importScript('User:Omni Flames/PendingChangesLink.js'); //Linkback: User:Omni Flames/PendingChangesLink.js Added by Script installer importScript('User:Theopolisme/Scripts/ajaxWatchlist.js'); //Linkback: User:Theopolisme/Scripts/ajaxWatchlist.js Added by Script installer importScript('User:Bility/convert24hourtime.js'); //Linkback: User:Bility/convert24hourtime.js Added by Script installer importScript('User:Ais523/stubtagtab2.js'); //Linkback: User:Ais523/stubtagtab2.js Added by Script installer importScript('User:Dipankan001/Edit Count.js'); //Linkback: User:Dipankan001/Edit Count.js Added by Script installer importScript('Wikipedia:Igloo/gloo.js'); //Linkback: Igloo/gloo.js Added by Script installer importScript('User:Writ Keeper/Scripts/massRollback.js'); //Linkback: User:Writ Keeper/Scripts/massRollback.js Added by Script installed importScript('User:Bellezzasolo/Scripts/ajaxrollsum.js'); //Linkback: User:Bellezzasolo/Scripts/ajaxrollsum.js Added by Script installer importScript('User:Evad37/ToDoLister.js'); //Linkback: User:Evad37/ToDoLister.js Added by Script installer importScript('User:Flooded with them hundreds/RandomSubmissionButton.js'); //Linkback: User:Flooded with them hundreds/RandomSubmissionButton.js Added by Script installer importScript('User:Numbermaniac/goToTop.js'); //Linkback: User:Numbermaniac/goToTop.js Added by Script installer importScript('User:Evad37/rater.js'); /*** BEGIN WIKIBREAK ENFORCER ***/ $(document).ready(function {

/*** Start editing here ***/

// When you want to end your break? // no leading zeroes. (example: 9 - correct, 09 - incorrect)

var date = { year: 2019, month: 9, day: 15}; var time = { hours: 12, minutes: 0, seconds: 0 };

/*** Stop editing here ***/ var currentDate = new Date; var enforcedBreakEnd = new Date(		date.year,date.month-1,date.day,time.hours,time.minutes,time.seconds); if (currentDate <= enforcedBreakEnd) { alert("Enforced wikibreak until "+enforcedBreakEnd.toLocaleString			+ "\n(now is "+currentDate.toLocaleString+")\n\nBye!"); location = "//"+location.host+"/w/index.php?title=" + "Special:Userlogout&returnto=Main_Page"; } }); /*** END WIKIBREAK ENFORCER ***/ mw.loader.load( "https://en.wikipedia.org/w/index.php?title=User:PerfektesChaos/js/lintHint/r.js&action=raw&maxage=86400&ctype=text/javascript" ); mw.loader.load( '/w/index.php?title=User:RedWarn/.js&action=raw&ctype=text/javascript' ); // Backlink: User:RedWarn/.js importScript('User:Ingenuity/preview.js'); //Linkback: User:Ingenuity/preview.js Added by Script installer importScript( 'User:DannyS712/Draft no cat.js' ); // Backlink: User:DannyS712/Draft no cat.js importScript( 'User:DannyS712/Draft re cat.js' ); // Backlink: User:DannyS712/Draft re cat.js /** * SWViewer * See * Authored by Tulsi Bhagat  * Shortcut key [alt-shift-v] */ mw.loader.using( [ 'mediawiki.util' ], function { "use strict"; mw.util.addPortletLink(	'p-tb',	'//swviewer.toolforge.org/',	'SWViewer',	't-swviewer',	'Launch SWViewer',	'v',	'#t-info' ); });