User:Yumeto/global.js

From Meta, a Wikimedia project coordination wiki

Note: After publishing, you may have to bypass your browser's cache to see the changes.

  • Firefox / Safari: Hold Shift while clicking Reload, or press either Ctrl-F5 or Ctrl-R (⌘-R on a Mac)
  • Google Chrome: Press Ctrl-Shift-R (⌘-Shift-R on a Mac)
  • Internet Explorer / Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Press Ctrl-F5.
/* Cat-a-lot - changes category of multiple files */
mw.loader.using(['jquery.ui', 'mediawiki.util'], function(){
	mw.loader.load('//commons.wikimedia.org/w/load.php?modules=ext.gadget.Cat-a-lot');
});
/*HotCat*/
mw.loader.using("mediawiki.user", function () {
  $('body').on( 'submit', '#hotcatCommitForm', function () {
    // The variable "this" refers to the form. Its fields can be accessed directly, e.g.
    // this.wpTextbox1 gives you the textarea containing the page text of the edit.
    var submitType = this.wpDiff;
    if (submitType && (!this.oldid || this.oldid.value == '0')) {
      // Switch form submission from diff to save. Don't do this if "oldid" is set to anything but '0':
      // that indicates an edit conflict with yourself, and in that case you really, really do want
      // to see the diff!
      this.wpEditToken.value = mw.user.tokens.get("csrfToken");
      submitType.name = submitType.value = 'wpSave';
    }
    return true;
  });
});
window.hotcat_use_category_links = true;

mw.loader.load('//meta.wikimedia.org/w/index.php?title=User:Xiplus/TwinkleGlobal.js&action=raw&ctype=text/javascript');
mw.loader.load('https://wikiplus-app.com/Main.js');