LLWiki正在建设中,欢迎
加入我们
!
查看“MediaWiki:Mobile.js”的源代码
←
MediaWiki:Mobile.js
跳转到导航
跳转到搜索
因为以下原因,您没有权限编辑本页:
您请求的操作仅限属于该用户组的用户执行:
用户
该页提供此wiki软件的界面文字,它已被保护以防止恶意修改。您可以点击右侧按钮在讨论页提出编辑请求,让管理人员代为编辑:
提出编辑请求
您无权编辑此JavaScript页面,因为编辑此页面可能会影响所有访问者。
您可以查看和复制此页面的源代码。
//<nowiki> // 由ResourceLoader直接调用,不可使用ES6语法 /** * @Description: 手机版全局JS * @Author: 如无特殊说明,均为[[User:Bhsd]] */ "use strict"; /* global wgULS */ mw.hook( 'wikipage.content' ).add(function( $content ) { const $collapsibleContent = $content.find( '.mw-collapsible:not(.mw-made-collapsible)' ), $sortableContent = $content.find( 'table.sortable' ); /** * @Function: 折叠 * @Source: [[moegirl:Mediawiki:Mobile.js]] */ if ($collapsibleContent.length) { console.log('Hook: wikipage.content,开始执行折叠'); mw.loader.using( 'jquery.makeCollapsible' ).then(function() { $collapsibleContent.makeCollapsible(); }); } // 表格排序 if ($sortableContent.length) { console.log('Hook: wikipage.content,开始执行表格排序'); mw.loader.using( 'jquery.tablesorter' ).then(function() { $sortableContent.tablesorter(); }); } // tabs-dropdown解析错误 $('.tabs-dropdown .tabs-content').append(function() { return $(this).next(); }); }); $(function() { // 快速编辑工具 if (['edit', 'submit'].includes( mw.config.get('wgAction') )) { $( '.mw-editTools' ).insertBefore( '#wpTextbox1' ); } else if (mw.config.get( 'wgCanonicalSpecialPageName' ) == 'MobileMenu') { mw.hook( 'mobile.menu' ).fire( $('#mw-mf-page-left').find( '.menu' ) ); } }); if (mw.config.get( 'wgCanonicalSpecialPageName' ) == "Recentchanges") { // 修改filter mw.hook( 'structuredChangeFilters.ui.initialized' ).add(function() { console.log('Hook: structuredChangeFilters.ui.initialized,开始修改filter'); mw.loader.using( ['mediawiki.Uri', 'ext.gadget.site-lib'] ).then(function() { const uri = new mw.Uri(), invert = uri.query.invert || 0, node = $( '.mw-rcfilters-ui-itemMenuOptionWidget-view-namespaces' ).first().clone() .insertAfter( $( '.mw-rcfilters-ui-filterMenuSectionOptionWidget' ).first() ) .attr('id', 'ooui-invert').removeClass( 'oo-ui-element-hidden' ) .on('click', function() { window.location.href = uri.extend({ invert: 1 - invert }); }); node.find( 'span.oo-ui-labelElement-label' ).text( wgULS("排除选项", "排除所選") ); node.find( 'input' ).prop('checked', invert > 0) .next().addClass( 'oo-ui-image-invert' ); }); }); } //</nowiki> // [[category:作为模块的小工具]] [[category:不可关闭的小工具]] [[category:手机版小工具]] // {{DEFAULTSORT:*}}
返回
MediaWiki:Mobile.js
。
导航菜单
个人工具
创建账号
登录
命名空间
系统消息
讨论
变体
查看
阅读
查看源代码
查看历史
更多
搜索
导航
首页
随机页面
最近更改
沙盒
互助客栈
方针与指引
帮助
工具
链入页面
相关更改
特殊页面
页面信息