MediaWiki:UserStatus/banner.js

/** * * @submodule              UserStatus/banner * @description            Notifies a user when editing someone else's status. * @author                 Americhino * @version                0.8.2 * @license                CC-BY-SA 3.0 **/ var $user = mw.config.get('wgTitle').split('/'); require(['jquery', 'mw', 'BannerNotification'], function($, mw, BannerNotification) {   $(function{ if (!($user[0] === wgUserName)) return; });   mw.hook('dev.i18n').add(function (i18n) { i18n.loadMessages('UserStatus').done(function (i18n) {           if ($user[1] === 'status') {                $(function{ if (!(wgAction === 'edit' || wgAction === 'submit')) return; new BannerNotification(i18n.msg('edit-warning').plain + '' + i18n.msg('go-back').plain + '', 'warn').show; });           }            },         );    }); }); importArticle({ type: 'script', article: 'u:dev:I18n-js/code.js' });