user-upload
3,547
回編集
(一部でautocollapseが正しくない問題の修正、&withCSS=で追加CSSを読み込むコード) |
(テンプレート:タブの実装) |
||
22行目: | 22行目: | ||
} | } | ||
function | mw.hook('wikipage.content').add(function($content) { | ||
/* 折り畳みボックス */ | |||
$content.find('table.collapsible').each(function() { | $content.find('table.collapsible').each(function() { | ||
var $table = $(this), | var $table = $(this), | ||
49行目: | 50行目: | ||
} | } | ||
}); | }); | ||
/* タブ */ | |||
$content.find('.tab-list').each(function() { | |||
var $tabList = $(this), | |||
$tabs = $tabList.find('> ul > li'), | |||
$tabContent = $tabList.nextAll('.tab-content'); | |||
$tabs.bind('click', function() { | |||
var $tab = $(this), | |||
index = $tab.data('tab') - 1; | |||
$tabs.removeClass('current-tab'); | |||
$tab.addClass('current-tab'); | |||
$tabContent.hide().eq(index).show(); | |||
}); | |||
}); | |||
}); | |||
/*旧エケペディアへの言語間リンクで「_」を「%20」に変換する*/ | /*旧エケペディアへの言語間リンクで「_」を「%20」に変換する*/ | ||
$('#p-lang a | $('#p-lang a:lang(akb49)').attr('href', function(i, href) { | ||
return href.replace('_', '%20', 'g'); | |||
}); | |||