User:DannyS712 test/FNP.js
Appearance
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. |
![]() | Documentation for this user script can be added at User:DannyS712 test/FNP. |
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_init();
}
} );
} );
function FNP_init(){
console.log( 'Starting' );
FNP_form_start();
}
function FNP_form_start(){
console.log( 'Opening form' );
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' },
]
});
FNP_form.append({ type: 'header', label: 'Predicted class' });
FNP_form.append({
type: 'checkbox',
list: [
{ label: 'Stub', value: 'classStub' },
{ label: 'Start', value: 'classStart' },
{ label: 'C-class', value: 'classC' },
{ label: 'B-class', value: 'classB' },
{ label: 'Good', value: 'classGood' },
{ label: 'Featured', value: 'classFeatured' },
]
});
FNP_form.append({ type: 'header', label: 'Potential issues' });
FNP_form.append({
type: 'checkbox',
list: [
{ label: 'Vandalism', value: 'issueV' },
{ label: 'Spam', value: 'issueS' },
{ label: 'Attack', value: 'issueA' },
{ label: 'Copyvio', value: 'issueC' },
{ label: 'None', value: 'issueN' },
]
});
FNP_form.append({ type: 'submit', });
var FNP_form_shown = FNP_form.render();
FNP_window.setContent( FNP_form_shown );
FNP_window.display();
}
function FNP_run( form ){
console.log( 'Running' );
console.log( form, typeof form );
var options = form.srcElement;
console.log( form.isTrusted );
}