LLWiki正在建設中,歡迎加入我們

「User:Bhsd」修訂間的差異

出自LLWiki
跳至導覽 跳至搜尋
第36行: 第36行:
===JavaScript===
===JavaScript===
{{#vardefine:content|<code lang="js">mw.hook( 'wikipage.content' )</code>}}{{#vardefine:ready|<code>$.ready</code>}}
{{#vardefine:content|<code lang="js">mw.hook( 'wikipage.content' )</code>}}{{#vardefine:ready|<code>$.ready</code>}}
试着整理下本站各主要JS脚本(全局JS和Gadgets)的合理执行时机:
试着整理下本站各主要JS脚本(全局JS和Gadgets)的合理执行时机:[<span id="myJsSize" style="color:#0645ad;cursor:pointer">展开</span>]
{| class="wikitable sortable" style="padding-bottom:1px;text-align:center;"
{| class="wikitable sortable" style="padding-bottom:1px;text-align:center;"
! JS文件 !! 桌面版 !! 移动版 !! style="display:none" | 大小(KB)
! JS文件 !! 桌面版 !! 移动版 !! style="display:none" | 大小(KB)

於 2020年12月4日 (五) 01:23 的修訂

簡歷

待辦事項

無。

經驗總結

CSS

移動版已知會自動添加以下樣式:

table, caption, tbody, tfoot, thead, tr, th, td {
	font-size: 100%;
}
table {
	border-collapse: collapse;
}
.content table {
	margin: 1em 0;
	overflow: auto;
	overflow-y: hidden;
	overflow-x: auto;
}
@media only screen and (max-width: 720px) {
	.content table {
		display: block;
		width: 100% !important;
	}
}

JavaScript

試着整理下本站各主要JS腳本(全局JS和Gadgets)的合理執行時機:[展開]

JS文件 桌面版 移動版 大小(KB)
common.js mw.hook( 'wikipage.content' )$.ready
mobile.js mw.hook( 'wikipage.content' )或移動版菜單生成後
code-prettify mw.hook( 'wikipage.content' ) mw.hook( 'wikipage.content' )
copyLyrics mw.hook( 'wikipage.content' ) mw.hook( 'wikipage.content' )
exlinks mw.hook( 'wikipage.content' ) mw.hook( 'wikipage.content' )
hideConversionTab 移動版語言選單生成後
lyricsTip
MobileDiff
mobile-Backtotop $.ready $.ready
noteTA mw.hook( 'wikipage.content' ) mw.hook( 'wikipage.content' )
ReferenceTooltips mw.hook( 'wikipage.content' )
sharelink $.ready $.ready
toc-custom $.ready
translation
UTCLiveClock $.ready $.ready
CommentsInLocalTime mw.hook( 'wikipage.content' ) mw.hook( 'wikipage.content' )
TalkHelper CommentsInLocalTime執行完後 CommentsInLocalTime執行完後
stickyHeading mw.hook( 'wikipage.content' ) mw.hook( 'wikipage.content' )
autocomplete 編輯區按下Tab鍵時
charinsert $.ready $.ready
contentBackup $.ready $.ready
custommenu $.ready 移動版菜單生成後
editCount $.ready 移動版菜單生成後
mobileEdit 移動版JS加載完成後,具體時間不好確定,暫定為$.ready再延遲0.5秒
notEditTopSection $.ready
PreviewWithVariant TransclusionPreviews執行完後 TransclusionPreviews執行完後
pxruler $.ready
TransclusionPreviews $.ready $.ready
Wikiplus $.ready
Cat-a-lot $.ready
HotCat $.ready
mobile-HotCat MobileCategories執行完後
HotDefaultSort $.ready
MobileCategories $.ready
uploader $.ready
SearchNamespace $.ready 移動版搜索框生成後
CleanDeleteReasons $.ready $.ready
mobileBlock $.ready
patrolPlus $.ready
patrolRevisions $.ready $.ready
site-lib 無條件 無條件
site-shared

繁簡轉換

全局JS 轉換方式 參數
common.js 自動 wgUserVariant
mobile.js 自動 + 手動 wgUserVariantwgUserLanguage
Gadgets 轉換方式 參數
exlinks 手動 wgUserLanguage
sharelink 手動 wgUserLanguage
toc-custom 自動 + 手動 wgUserVariant
UTCLiveClock
hideConversionTab
mobile-Backtotop
code-prettify
ReferenceTooltips 自動 + 手動 wgUserVariantwgUserLanguage
copyLyrics
noteTA 自動 + 手動 wgUserVariantwgUserLanguage
CommentsInLocalTime 手動 wgUserVariant
TalkHelper
stickyHeading
custommenu 自動 + 手動 wgUserLanguage
contentBackup 手動 wgUserLanguage
editCount
Wikiplus 手動 wgUserLanguage
PreviewWithVariant 不轉換
autocomplete 不轉換 + 手動 wgUserVariant
charinsert 自動 + 手動 wgUserVariant
notEditTopSection
mobileEdit 手動 wgUserLanguage
pxruler 手動 wgUserLanguage
TransclusionPreviews 手動 wgUserLanguage
MobileCategories 自動 + 手動 wgUserVariantwgUserLanguage
HotCat 手動 wgUserVariant
mobile-HotCat
Cat-a-lot 手動 wgUserLanguage
HotDefaultSort
SearchNamespace 手動 wgUserLanguage
uploader 手動 wgUserLanguage
CleanDeleteReasons
patrolPlus 手動 wgUserLanguage
patrolRevisions 手動 wgUserLanguage
mobileBlock 手動 wgUserLanguage
site-lib
Widgets 轉換方式 參數
bilibili 自動 wgUserVariant
bgimage
countdown 自動 wgUserVariant
lyrics 自動 wgUserVariant
年表標籤/篩選
songposition 自動 wgUserVariant
Widget:遊戲主界面