imported>=海豚= |
imported>Irukaza |
| 第1行: |
第1行: |
| /* global mediaWiki */
| | |
| (function(mw) {
| |
| if (!String.prototype.includes) String.prototype.includes = function includes(search, start) {
| |
| 'use strict';
| |
| if (typeof start !== 'number') start = 0;
| |
| if (start + search.length > this.length) return false;
| |
| return this.indexOf(search, start) !== -1;
| |
| };
| |
| mw.loader.implement('AnnToolsSendWelcomeMessage', function() {
| |
| var message = '{{Welcome}}',
| |
| errorFun = function errorFun(_, self) {
| |
| unbindFun();
| |
| self.addClass('unsend');
| |
| return false;
| |
| },
| |
| unbindFun = function unbindFun() {
| |
| if ($('#welcomeClear').length > 0) $('#welcomeClear').remove();
| |
| $('#welcomeAsk').append('<span id="welcomeClear">返回</span>');
| |
| $('#welcomeClear').on('click.welcome', function() {
| |
| $('#welcomeAsk').remove();
| |
| });
| |
| };
| |
| if (mw.config.get('wgNamespaceIds').user_talk == mw.config.get('wgNamespaceNumber') && !mw.config.get('wgPageName').includes('/') && mw.config.get('wgEditMessage') == 'creating' && $('#wpTextbox1')[0] && !$('#wpTextbox1').val()) $('#wpTextbox1').val(message);
| |