查看“︁MediaWiki:Common.js”︁的源代码
←
MediaWiki:Common.js
跳转到导航
跳转到搜索
因为以下原因,您没有权限编辑该页面:
您请求的操作仅限属于该用户组的用户执行:
管理员
本页面提供本维基软件的界面文本,并受到保护以防止滥用。 要添加或更改所有维基的翻译,请使用MediaWiki的本地化项目
translatewiki.net
。
您无权编辑此JavaScript页面,因为编辑此页面可能会影响所有网站访客。
您可以查看和复制此页面的源代码。
/* 尘月维基:窄屏整页等比缩放 + 左侧栏强制常显 */ ( function () { var BASE = 1120; /* 1) 窄屏整页等比缩放,保证手机与电脑布局完全一致 */ function fit() { var root = document.documentElement; var w = ( window.innerWidth || root.clientWidth ); if ( w > 0 && w < BASE + 40 ) { root.style.zoom = ( w / ( BASE + 64 ) ).toFixed(4); } else { root.style.zoom = ''; } } /* 2) 左侧栏钉在正文左边:兜底手机浏览器 flex 降级时侧栏掉到页尾 */ function pinSidebar() { var block = document.getElementById( 'mw-content-block' ); var nav = document.getElementById( 'mw-site-navigation' ); var wrap = document.getElementById( 'mw-content-wrapper' ); if ( !block || !nav || !wrap ) { return; } var narrow = ( window.innerWidth || document.documentElement.clientWidth ) < 1200; if ( !narrow ) { [ block, nav, wrap ].forEach( function ( el ) { [ 'display', 'float', 'width', 'flex', 'order', 'position', 'visibility', 'max-width', 'min-width', 'align-items' ].forEach( function ( p ) { el.style.removeProperty( p ); } ); } ); return; } /* DOM 顺序兜底:侧栏若排在正文之后,挪到正文前面 */ if ( block.contains( nav ) && block.contains( wrap ) && ( nav.compareDocumentPosition( wrap ) & Node.DOCUMENT_POSITION_PRECEDING ) ) { block.insertBefore( nav, wrap ); } block.style.setProperty( 'display', 'flex', 'important' ); block.style.setProperty( 'align-items', 'flex-start', 'important' ); nav.style.setProperty( 'display', 'block', 'important' ); nav.style.setProperty( 'float', 'none', 'important' ); nav.style.setProperty( 'position', 'static', 'important' ); nav.style.setProperty( 'visibility', 'visible', 'important' ); nav.style.setProperty( 'width', '186px', 'important' ); nav.style.setProperty( 'flex', '0 0 186px', 'important' ); nav.style.setProperty( 'order', '0', 'important' ); nav.style.setProperty( 'max-width', 'none', 'important' ); wrap.style.setProperty( 'order', '1', 'important' ); wrap.style.setProperty( 'flex', '1 1 auto', 'important' ); wrap.style.setProperty( 'min-width', '0', 'important' ); } function run() { fit(); pinSidebar(); } if ( document.readyState === 'loading' ) { document.addEventListener( 'DOMContentLoaded', run ); } else { run(); } window.addEventListener( 'load', run ); window.addEventListener( 'resize', run ); window.addEventListener( 'orientationchange', run ); }() );
此页面嵌入的页面:
Template:' + template + '
(
查看源代码
)
返回
MediaWiki:Common.js
。
导航菜单
个人工具
登录
associated-pages
系统消息
讨论
English
查看
阅读
查看源代码
查看历史
更多
搜索
导航
首页
创建新页面
最近更改
随机页面
特殊页面
社区
帮助
社区专页
工具
上传文件
链入页面
相关更改
个人
登录
工具
链入页面
相关更改
页面信息