Jump to content

User:DannyS712 test/FNP.js

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by DannyS712 test (talk | contribs) at 03:38, 13 June 2019 (continue). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
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.
var scriptUrl = mw.config.get( 'wgScriptPath' ) + '/api.php';

mw.loader.using( ['mediawiki.util', 'ext.gadget.Twinkle'], function () {
    $(document).ready( function () { 
    	var page = mw.config.get('wgPageName');
    	console.log( page );
    	if ( page && page === 'Special:BlankPage/FilteredNewPages'){
    		FNP_start();
    	}
    } );
} );

function FNP_start(){
	console.log( 'run' );
	var FNP_window = new Morebits.simpleWindow();
	FNP_window.setTitle('Filtered new pages feed');
	FNP_window.setScriptName('Filtered new pages');
	
	var FNP_form = new Morebits.quickForm( FNP_run, null );
	FNP_form.append({
		type: 'header',
		label: 'State'
	});
	FNP_form.append({
		type: 'checkbox',
		list: [
			{
				label: 'Unreviewed pages',
				value: 'unreviewed'
			},
			{
				label: 'Reviewed pages',
				value: 'reviewed'
			},
			]
	});
	FNP_form.append({
		type: 'header',
		label: 'Type'
	});
	FNP_form.append({
		type: 'checkbox',
		list: [
			{
				label: 'Nominated for deletion',
				value: 'deletion'
			},
			{
				label: 'Redirects',
				value: 'redirect',
			},
			{
				label: 'All others',
				value: 'other'
			},
			]
	});
	FNP_form.append({
		type: 'header',
		label: 'That'
	});
	FNP_form.append({
		type: 'checkbox',
		list: [
			{
				label: 'Have no categories',
				value: 'noCat'
			},
			{
				label: 'Have no citations',
				value: 'noCite'
			},
			{
				label: 'Are orphaned',
				value: 'orphan'
			},
			{
				label: 'Were previously deleted',
				value: 'wereDel'
			},
			{
				label: 'Were created by newcomers (non-autoconfirmed users)',
				value: 'newcomers'
			},
			{
				label: 'Were created by learners (newly autoconfirmed users',
				value: 'learners'
			},
			{
				label: 'Were created by blocked users',
				value: 'blocked'
			},
			{
				label: 'Were created by bots',
				value: 'bot'
			},
			]
	});
	var FNP_form_shown = FNP_form.render();
	
	FNP_window.setContent( FNP_form_shown );
	
	FNP_window.display();
}

function FNP_run(){
	console.log( 'Running' );
}