「MediaWiki:Common.js」の版間の差分
ナビゲーションに移動
検索に移動
('_'→' ' php側で書き換えるようにした) |
(fix editintro) |
||
120行目: | 120行目: | ||
}); | }); | ||
mw.loader.using( [ 'mediawiki.util' ] ).done( function () { | |||
/* カテゴリごとにeditintroを設定する */ | /* カテゴリごとにeditintroを設定する */ | ||
var CATEGORY_EDITINTRO_TABLE = { | |||
'メンバー': 'ヘルプ:メンバーページのスタイル/editintro' , | 'メンバー': 'ヘルプ:メンバーページのスタイル/editintro' , | ||
'元メンバー': 'ヘルプ:メンバーページのスタイル/editintro' , | '元メンバー': 'ヘルプ:メンバーページのスタイル/editintro' , | ||
128行目: | 128行目: | ||
}; | }; | ||
function addEditIntro(templateName) { | |||
$( '.mw-editsection,#quickbar, #ca-edit' ).find( 'a' ).each( function ( i, el ) { | |||
el.href = $( this ).attr( 'href' ) + '&editintro=' + templateName; | |||
} ); | |||
}; | }; | ||
if (mw.config.get('wgNamespaceNumber') == 0) { | if (mw.config.get('wgNamespaceNumber') == 0) { | ||
$(function(){ | $(function(){ | ||
var catContainer = mw.config.get( 'wgCategories' ); | |||
$.each(catContainer, function(index, value) { | |||
if(ei = CATEGORY_EDITINTRO_TABLE[value]) { | |||
addEditIntro(ei); | |||
return; | |||
} | |||
}); | |||
}); | }); | ||
} | } | ||
}); |