Advertisement
Guest User

Untitled

a guest
Jan 27th, 2015
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.64 KB | None | 0 0
  1. function makeStockContent( titles, content ) {
  2. var M = mw.mobileFrontend;
  3. mw.loader.using( 'mobile.editor.api').done( function() {
  4. var EditorApi = M.require( 'modules/editor/EditorApi' );
  5. titles.forEach( function( title ) {
  6. var api = new EditorApi( {
  7. title: title,
  8. isNewPage: true
  9. } );
  10. api.setContent( content );
  11. api.save();
  12. } );
  13. } );
  14. }
  15.  
  16. var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
  17. var titles = [];
  18. for(var i=0; i < possible.length; i++ ) {
  19. titles.push(possible[i] + ' category test' );
  20. }
  21. makeStockContent( titles, '[[Category:Test]]' );
  22. makeStockContent( [ 'Category:Test' ], 'Testing.' );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement