Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function makeStockContent( titles, content ) {
- var M = mw.mobileFrontend;
- mw.loader.using( 'mobile.editor.api').done( function() {
- var EditorApi = M.require( 'modules/editor/EditorApi' );
- titles.forEach( function( title ) {
- var api = new EditorApi( {
- title: title,
- isNewPage: true
- } );
- api.setContent( content );
- api.save();
- } );
- } );
- }
- var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
- var titles = [];
- for(var i=0; i < possible.length; i++ ) {
- titles.push(possible[i] + ' category test' );
- }
- makeStockContent( titles, '[[Category:Test]]' );
- makeStockContent( [ 'Category:Test' ], 'Testing.' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement