User:Irukaza/common.js:修订间差异

H萌娘,万物皆可H的百科全书!
跳到导航 跳到搜索
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);

2022年3月17日 (四) 18:22的最新版本