Site Notice

hello, world

MediaWiki:Js-InPageEdit-v2.js/uninstall.js

From Project-EPB Commons
< MediaWiki:Js-InPageEdit-v2.js
Revision as of 01:10, 4 November 2019 by 机智的小鱼君 (talk | contribs) ([InPageEdit] 没有编辑摘要 //使用ipe进行的快速编辑)

Invoke this: https://common.wjghj.cn/js/{{#replace:{{#replace:Js-InPageEdit-v2.js/uninstall.js|Js-|}}|.js|}}

Note: After saving, 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: Hold Ctrl while clicking Refresh, or press Ctrl-F5
  • Opera: Go to Menu → Settings (Opera → Preferences on a Mac) and then to Privacy & security → Clear browsing data → Cached images and files.
/**** 注意,运行此代码ipe就会从你的个人js被删除,所以不要随便使用…… ****/
new mw.Api().get({
  action: 'parse',
  prop: 'wikitext',
  page: 'User:' + mw.config.get('wgUserName') + '/common.js'
}).done(function(data){
  var wikitext = data.parse.wikitext['*'],
      finalText = wikitext.replace( /mw\.loader\.load\((\s)*(\'|\")https:\/\/common\.wjghj\.cn\/js\/InPageEdit-v2(\'|\")(\s)*\)(\;)?/ig , '');
  console.info(wikitext);
  console.info(finalText);
  new mw.Api().post({
    action: 'edit',
    title: 'User:' + mw.config.get('wgUserName') + '/common.js',
    text: finalText,
    summary: 'Uninstall InPageEdit',
    token: mw.user.tokens.get('editToken')
  }).done(function(){console.info('Uninstall InPageEdit - Done')});
});