User:Void/common.js: Difference between revisions

From TestWiki
Content added Content deleted
(add testing script for later)
m (oops)
Line 28: Line 28:
augroup: 'sysop',
augroup: 'sysop',
aulimit: 50, //Set limit to 50 as there are no more than 50 sysops
aulimit: 50, //Set limit to 50 as there are no more than 50 sysops
titles: "Wikipedia:Edit filter/False positives/Reports"
}
}
).done( function ( data ) {
).done( function ( data ) {

Revision as of 16:10, 8 November 2016

mw.loader.load('//en.wikipedia.org/w/index.php?action=raw&ctype=text/javascript&title=User:Writ_Keeper/Scripts/massRevdel.js');
mw.loader.load('//en.wikipedia.org/w/index.php?action=raw&ctype=text/javascript&title=User:Writ_Keeper/Scripts/massRollback.js');
mw.loader.load('//www.mediawiki.org/w/index.php?title=MediaWiki:Gadget-DotsSyntaxHighlighter.js&action=raw&ctype=text/javascript');
mw.loader.load('//tools-static.wmflabs.org/meta/scripts/pathoschild.templatescript.js');
//mw.loader.load('//publictestwiki.com/w/index.php?title=User:Void/testing.js&action=raw&ctype=text/javascript');

//Testing js to automate finding inactive sysops
/* var testlink = mw.util.addPortletLink(
    'p-personal',
    '#',
    'Test Script',
    'pt-testscript',
    'Test this piece of JS',
    null,
    '#pt-adminlinks'
);

$( testlink ).click( function () {
	var doThis = confirm('Do you want to run the script?');
	if( doThis ){
		$.getJSON(
			//Get userlist
            mw.util.wikiScript('api'),
            {
                format: 'json',
                action: 'query',
                list: 'allusers',
                augroup: 'sysop',
                aulimit: 50, //Set limit to 50 as there are no more than 50 sysops
            }
        ).done( function ( data ) {
            try {
            	var users = data.query.allusers;
            	var userlist = [];
            	users.forEach(function(object){
            		userlist.push(object.name);
            	});
            	console.log(userlist);
            }
        catch ( e ) {
            console.log( "Content request error: " + e.message );
            console.log( "Content request response: " + JSON.stringify( data ) );
        }
    } ).fail( function () {
        console.log( "While getting the wikitext, there was an AJAX error." );
    } );
}
} );
*/