MediaWiki:Common.js
[Wikipedia|▼Menu]

お知らせ: 保存した後、ブラウザのキャッシュをクリアしてページを再読み込みする必要があります。

多くの Windows や Linux のブラウザ

Ctrl を押しながら F5 を押す。

Mac における Safari

? Shift を押しながら、更新ボタン
をクリックする。

Mac における Chrome や Firefox

? Cmd と ? Shift を押しながら R を押す。

詳細についてはWikipedia:キャッシュを消すをご覧ください。/* ここに書いたスクリプトは全ての外装に反映されます *//* global mw, $ *//* jshint strict:false, browser:true */mw.loader.using( ['mediawiki.util'], function () { /** * Map addPortletLink to mw.util * @deprecated: Use mw.util.addPortletLink instead. */ mw.log.deprecate( window, 'addPortletLink', mw.util.addPortletLink, '代わりにmw.util.addPortletLinkを使用してください' ); /** * Test if an element has a certain class * @deprecated: Use $(element).hasClass() instead. */ mw.log.deprecate( window, 'hasClass', function ( element, className ) { return $( element ).hasClass( className ); }, '代わりにjQuery.hasClass()を使用してください' ); /** &withJS= URL parameter, &withCSS= URL parameter ******* * [[mw:Snippets/Load JS and CSS by URL]]より。MediaWiki空間に置かれているスクリプトまたはスタイルシートを * [[Special:Mypage/common.js]]または[[Special:Mypage/common.css]]を編集しないで体験できるようにする * @source https://www.mediawiki.org/wiki/Snippets/Load_JS_and_CSS_by_URL * @revision 2020-04-04 */ var extraCSS = mw.util.getParamValue( 'withCSS' ), extraJS = mw.util.getParamValue( 'withJS' ); if ( extraCSS ) { // WARNING: DO NOT REMOVE THIS "IF" - REQUIRED FOR SECURITY (against XSS/CSRF attacks) if ( /^MediaWiki:[^&<>=%#]*\.css$/.test( extraCSS ) ) { mw.loader.load( '/w/index.php?title=' + encodeURIComponent( extraCSS ) + '&action=raw&ctype=text/css', 'text/css' ); } else { mw.notify( 'MediaWiki名前空間のページのみ許可されています。', { title: 'withCSSパラメータの値が不正です' } ); } } if ( extraJS ) { // WARNING: DO NOT REMOVE THIS "IF" - REQUIRED FOR SECURITY (against XSS/CSRF attacks) if ( /^MediaWiki:[^&<>=%#]*\.js$/.test( extraJS ) ) { mw.loader.load( '/w/index.php?title=' + encodeURIComponent( extraJS ) + '&action=raw&ctype=text/javascript' ); } else { mw.notify( 'MediaWiki名前空間のページのみ許可されています。', { title: 'withJSパラメータの値が不正です' } ); } } /** Dynamic Navigation Bars (experimental) ************************************* * * Description: See [[Wikipedia:NavFrame]]. * Maintainers: UNMAINTAINED */ var collapseCaption = '隠す'; var expandCaption = '表示'; // set up the words in your language var navigationBarHide = '[' + collapseCaption + ']'; var navigationBarShow = '[' + expandCaption + ']'; /** * Shows and hides content and picture (if available) of navigation bars. * * @param {number} indexNavigationBar The index of navigation bar to be toggled * @param {jQuery.Event} event Event object * @return {boolean} */ function toggleNavigationBar( indexNavigationBar, event ) { var navToggle = document.getElementById( 'NavToggle' + indexNavigationBar ); var navFrame = document.getElementById( 'NavFrame' + indexNavigationBar ); var navChild; if ( !navFrame |。!navToggle ) { return false; } // If shown now if ( navToggle.firstChild.data === navigationBarHide ) { for ( navChild = navFrame.firstChild; navChild !== null; navChild = navChild.nextSibling ) { if ( $( navChild ).hasClass( 'NavContent' ) ) { navChild.style.display = 'none'; } } navToggle.firstChild.data = navigationBarShow; // If hidden now } else if ( navToggle.firstChild.data === navigationBarShow ) { for ( navChild = navFrame.firstChild; navChild !== null; navChild = navChild.nextSibling ) { if ( $( navChild ).hasClass( 'NavContent' ) ) { navChild.style.display = 'block'; } } navToggle.firstChild.data = navigationBarHide; } if (event !== undefined) { event.preventDefault(); } } /** * Adds show/hide-button to navigation bars. * * @param {jQuery} $content */ function createNavigationBarToggleButton( $content ) { var j, navChild, navToggle, navToggleText, isCollapsed, indexNavigationBar = 0; // Iterate over all < div >-elements var $divs = $content.find( 'div.NavFrame:not(.mw-collapsible)' ); $divs.each( function ( i, navFrame ) { indexNavigationBar++; navToggle = document.createElement( 'a' ); navToggle.className = 'NavToggle'; navToggle.setAttribute( 'id', 'NavToggle' + indexNavigationBar ); navToggle.setAttribute( 'href', '#' ); $( navToggle ).on( 'click', $.proxy( toggleNavigationBar, null, indexNavigationBar ) ); isCollapsed = true; /** * Check if any children are already hidden. This loop is here for backwards compatibility: * the old way of making NavFrames start out collapsed was to manually add style="display:none" * to all the NavPic/NavContent elements. Since this was bad for accessibility (no way to make * the content visible without JavaScript support), the new recommended way is to add the class * "collapsed" to the NavFrame itself, just like with collapsible tables. */ for ( navChild = navFrame.firstChild; navChild !== null && !isCollapsed; navChild = navChild.nextSibling ) { if ( $( navChild ).hasClass( 'NavPic' ) |。


次ページ
記事の検索
おまかせリスト
▼オプションを表示
ブックマーク登録
mixiチェック!
Twitterに投稿
オプション/リンク一覧
話題のニュース
列車運行情報
暇つぶしWikipedia

Size:31 KB
出典: フリー百科事典『ウィキペディア(Wikipedia)
担当:undef