註:重取頁面,文方新焉。
- Firefox / Safari:押 Shift 並點 重新載入,或合鍵 Ctrl-F5 或 Ctrl-R(Mac 為 ⌘-R)。
- Google Chrome:點 Ctrl-Shift-R(Mac為 ⌘-Shift-R)。
- Internet Explorer:押 Ctrl 並點 重新整理,或合鍵 Ctrl-F5。
- Opera:須至 Tools → Preferences 清謄本(Mac 為 Opera → Preferences)。
/* 此之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); }); } var applyDarkMode = function() { if(window.matchMedia && document.body) { var match = window.matchMedia('(prefers-color-scheme: dark)'); if(match.matches) { document.body.classList.add('dark-mode'); } match.addEventListener('change', function(event) { var darkMode = event.matches; document.body.classList.toggle('dark-mode', darkMode); }); } }; mw.loader.using(['mediawiki.util'], function() { addToggleFeature('hangul'); addToggleFeature('kaeriten'); document.querySelector('input#searchInput').addEventListener('input', function() { $(this).trigger('keypress'); }); applyDarkMode(); window.addEventListener('load', applyDarkMode); }); 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 } }); });