子權未逮,有因如纂此頁: 此頁司版,錮之以遠濫。 您沒有權限來編輯此 JavaScript 頁面,因為這會影響到所有的網站訪客。 爾可視及複之本頁之原始碼。 /* 此之JavaScript將載於全簿之頁。 */ var removeToggleMenu = function(featureName) { var menu = document.querySelector('a.toggle-' + featureName); menu && menu.parentNode.removeChild(menu); } var applyToggleMenu = function(featureName) { var menu = document.querySelector('a.toggle-' + featureName); if(!menu) return; var url = new URL(location.href); url.searchParams.set(featureName, 'toggle'); menu.href = url.href; } var applyToggleFeature = function(featureName) { var localStorage = window.localStorage; var url = new URL(location.href); var urlParam = url.searchParams.get(featureName); var lsParam = localStorage && localStorage.getItem(featureName); var use = urlParam || lsParam || 'false'; if(urlParam == 'toggle') { use = lsParam == 'false' ? 'true' : 'false'; url.searchParams.set(featureName, use); location.href = url.href; } if(use == 'true') { document.body.classList.add('use-' + featureName); } if(use == 'false') { document.body.classList.remove('use-' + featureName); } localStorage && localStorage.setItem(featureName, use); }; var addToggleFeature = function(featureName) { applyToggleFeature(featureName); window.addEventListener('load', function() { applyToggleFeature(featureName); }); applyToggleMenu(featureName); window.addEventListener('load', function() { applyToggleMenu(featureName); }); } mw.loader.using(['mediawiki.util'], function() { addToggleFeature('hangul'); addToggleFeature('kaeriten'); document.querySelector('input#searchInput').addEventListener('input', function() { $(this).trigger('keypress'); }); }); var sectionCJK = { type: 'booklet', label: '漢', pages: { 'Punct': { layout: 'characters', label: '、。〃', characters: [' ', '、', '。', '〃', '〄', '々', '〆', '〇', '〈', '〉', '《', '》', '「', '」', '『', '』', '【', '】', '〒', '〓', '〔', '〕', '〖', '〗', '〘', '〙', '〚', '〛', '〜', '〝', '〞', '〟', '〠', '〡', '〢', '〣', '〤', '〥', '〦', '〧', '〨', '〩', '〪', '〫', '〬', '〭', '〮', '〯', '〰', '〱', '〲', '〳', '〴', '〵', '〶', '〷', '〸', '〹', '〺', '〻', '〼', '〽'] }, 'IDC': { layout: 'characters', label: '⿰⿱⿻', characters: ['⿰', '⿱', '⿲', '⿳', '⿴', '⿵', '⿶', '⿷', '⿸', '⿹', '⿺', '⿻'] }, 'Kanbun': { layout: 'characters', label: '㆑㆒㆓', characters: ['㆐', '㆑', '㆒', '㆓', '㆔', '㆕', '㆖', '㆗', '㆘', '㆙', '㆚', '㆛', '㆜', '㆝', '㆞', '㆟'] } } } mw.hook('wikiEditor.toolbarReady').add(function($textarea) { $textarea.wikiEditor('addToToolbar', { 'sections': { 'CJK': sectionCJK } }); }); 返MediaWiki:Common.js。