跳转到内容

MediaWiki:Mobile.js

维基百科,自由的百科全书

这是本页的一个历史版本,由Jon (WMF)留言 | 贡献2020年9月23日 (三) 04:20编辑。这可能和当前版本存在着巨大的差异。

注意:保存之后,你必须清除浏览器缓存才能看到做出的更改。Google ChromeFirefoxMicrosoft EdgeSafari:按住⇧ Shift键并单击工具栏的“刷新”按钮。参阅Help:绕过浏览器缓存以获取更多帮助。
/* 这里的任何JavaScript将为使用移动版网站的用户加载 */

mw.loader.using(['mediawiki.util', 'ext.gadget.site-lib'], function () {

    /* 當需要時載入對應的 scripts */
    var importScriptRL=function(page){
    	mw.loader.load(mw.config.get('wgScript')+'?title='+mw.util.wikiUrlencode(page)+'&action=raw&ctype=text/javascript&_='+Math.floor((new Date())/1000/60/60/24/7));
    };
    
    if (mw.config.get('wgAction') == "edit" || mw.config.get('wgAction') == "submit" || mw.config.get('wgCanonicalSpecialPageName') == 'Search') { // scripts specific to editing pages
      importScriptRL('MediaWiki:Mobile.js\/edit.js');
    }

});

// (please translate if you know English)
// maintenance: Some user scripts may be using the following deprecated functions on mobile.
// These functions are no longer supported and should be updated to use mw.loader.getScript.
// https://www.mediawiki.org/wiki/ResourceLoader/Migration_guide_(users)#Legacy_removals
function importScript() {
  // please uncomment the following line when translated.
  // mw.notify('A user script you are using is running on mobile and using a deprecated function importScript. Please update it.' );
}