“MediaWiki:Gadget-site-shared.js”的版本间差异

添加133字节 、​ 2022年5月18日 (三) 09:44
// 使用Wikiplus小工具快速编辑
(mediawiki.page.gallery自帶)
(// 使用Wikiplus小工具快速编辑)
 
(未显示同一用户的2个中间版本)
* 3. 分类栏正确显示小写标题
* 4. 分类栏正确显示词曲作者的日文名
* 5. 触摸屏将packed-hover模式的gallery替换为packed
* 56. 移除Widget造成的多余<p>标签
* 67. 禁止使用InPageEdit快速编辑和快速重定向
* @Dependencies: mediawiki.Title, ext.gadget.site-lib
* @Author: 如无特殊说明,均为[[User:Bhsd]]
if ($('#mainpage-style').length) { return; } // 避免不必要的下载
console.log('Hook: wikipage.content, 开始下载主页样式表');
mw.loader.load( '//cdnfastly.jsdelivr.net/gh/bhsd-harry/LLWiki@1.4/widget/mainpage.min.css', 'text/css' );
hook.remove( download );
};
.text(function() { return this.title.slice(9); });
});
 
/**
* @Function: 触摸屏代替gallery的hover效果
* @Source: mediawiki.page.gallery
*/
if (window.ontouchstart !== undefined ||
window.DocumentTouch !== undefined && document instanceof window.DocumentTouch) {
hook.add(function($content) {
console.debug('Hook: wikipage.content, 开始移除gallery的hover效果');
$content.find( 'ul.mw-gallery-packed-hover ' ).addClass( 'mw-gallery-packed' )
.removeClass( 'mw-gallery-packed-hover' );
});
}
 
/**
 
/**
* @Function: 禁止使用InPageEdit快速编辑和快速重定向
* @Dependecies: ext.gadget.site-lib
*/
mw.messages.set('gadget-ipe-warn', wgULS({
'gadget-ipe-warn': '由于InPageEdit小工具$1,LLWiki无法正确判别页面是否已存在,LLWiki暂时限制该小工具的使用。', 'gadget-ipe-edit': '易造成编辑冲突',
'gadget-ipe-redirect': '无由於InPageEdit小工具無法正别页別頁面是否已存在,LLWiki暫時限制該小工具的使用。'
}) );
}, {
const noIPE = function(msg) {
'gadget-ipe-warn': '由於InPageEdit小工具$1,LLWiki暫時限制該小工具的使用。', 'gadget-ipe-edit': '易造成編輯衝突',
mw.notify( mw.msg( 'gadget-ipe-warn' ), {type: 'warn', autoHide: false, tag: 'InPageEdit'} );
'gadget-ipe-redirect': '無法正確判別頁面是否已存在'
}) );
const noIPE = function(msg) {
mw.notify( mw.msg( 'gadget-ipe-warn', mw.msg( 'gadget-ipe-' + (msg || 'redirect') ) ),
{type: 'warn', autoHide: false, tag: 'InPageEdit'} );
};
mw.hook( 'InPageEdit.quickEdit' ).add(function(data) {
data.$modalWindow.find( '.save-btn' ).prop('disabled', true);
noIPE( 'edit' );
});
mw.hook( 'InPageEdit.quickRedirect' ).add( noIPE );
mw.hook( 'InPageEdit.quickRename' ).add( noIPE );
16,874

个编辑