Jump to content

User:DannyS712 test/in cat.js

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by DannyS712 test (talk | contribs) at 02:31, 23 January 2019 (convert to set category (Category:AfC submissions with categories) with logging of pages). 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.
mw.loader.using( 'mediawiki.util', function () {
    importScript('User:DannyS712 test/append.js');
    $(document).ready( function () { 
        var link = mw.util.addPortletLink( 'p-cactions', '#', 'Cats', 'ca-cats', 'cats'); 
        $( link ).click( function ( event ) {
            event.preventDefault();
            cats();
        } );
    } );
} );
function cats () {
	console.log( page );
	var getAFCdrafts = {
        action: 'query',
        list: 'categorymembers',
        cmlimit: number,
        cmtitle: 'Category:AfC submissions with categories',
        cmprop: 'title',
        format: 'json'
	};
	$.get( mw.config.get( 'wgScriptPath' ) + '/api.php', getAFCdrafts, function( AFCdrafts ) {
		var pages = catResponse.query.categorymembers;
		var listed = [];
		var links = "";
		for (var i = 0; i < pages.length; i++) {
			console.log( pages[i].title );
			listed.push('* [[' + pages[i].title + ']]\n');
			links = links + listed[i];
		}
	} );
}