if (!('isekai' in window)) window.isekai = {}; /** * @class isekai.ContribDialog * @param {*} config */ isekai.ContribDialog = function IsekaiContribDialog(config) { isekai.ContribDialog.super.call(this, config); this.broken = false; }; OO.inheritClass(isekai.ContribDialog, OO.ui.ProcessDialog); isekai.ContribDialog.static.name = 'isekaicontrib-dialog'; isekai.ContribDialog.static.title = mw.msg('isekaicontrib-dialog-title'); isekai.ContribDialog.static.actions = [ { action: 'cancel', label: mw.msg('isekaicontrib-dialog-cancel'), flags: ['safe', 'close'] } ]; isekai.ContribDialog.prototype.initialize = function () { isekai.ContribDialog.super.prototype.initialize.apply(this, arguments); this.api = new mw.Api(); this.content = new OO.ui.PanelLayout({ padded: false }); //加载动画 this.loadingWidget = new OO.ui.ProgressBarWidget({ progress: false, classes: ['isekai-contrib-loading'] }); this.content.$element.append(this.loadingWidget.$element); //贡献者列表容器 this.content.$element.append('
'); this.contribContainer = this.content.$element.find('.isekai-contrib-list'); this.$body.append(this.content.$element); } isekai.ContribDialog.prototype.getUserAvatar = function (userName) { var template = mw.config.get('wgIsekaiContributorAvatar'); if (template) { return template.replace(/\%s/g, userName); } else { return ''; } }; /** * 生成用户栏目html * @param {any} userData - 用户信息 * @returns {string} 生成的html */ isekai.ContribDialog.prototype.getUserListItem = function (userData) { return '' + '' + '