User:小躍/common.js
< User:小躍
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)
- Edge: Hold Ctrl while clicking Refresh, or press Ctrl-F5.
$.ajax('//tools-static.wmflabs.org/meta/scripts/pathoschild.templatescript.js', { dataType:'script', cache:true }).then(function() {
if(mw.config.get('wgPageName').match('Stewards/Confirm')&&mw.config.get('wgPageName')!='Stewards/Confirm'&&$.inArray(mw.config.get('wgAction'), ['edit', 'submit']) !== -1){
pathoschild.TemplateScript.add([
{
name:'Vote:Keep',
script: function(editor) {
editor
.replace(new RegExp('<section end','i'),'*{{'+'k'+'}}--~~'+'~~\n<section end')
.appendEditSummary('Vote Keep using Pathoschild.TemplateScript')
.options({ minor: true})
.clickDiff();
}
},
{
name:'Say:Thanks',
script: function(editor) {
editor
.replace(new RegExp('<section end','i'),'*Thanks for your Stewards work. --~~'+'~~\n<section end')
.appendEditSummary('Say Thanks using Pathoschild.TemplateScript')
.options({ minor: true})
.clickDiff();
}
}
]);
}
});//PT. end