Difference between revisions of "MediaWiki:Common.js"
Mscottmoore (talk | contribs) (Testing jquery) |
Mscottmoore (talk | contribs) (Testing for pinyin table) |
||
Line 1: | Line 1: | ||
/* Any JavaScript here will be loaded for all users on every page load. */ | /* Any JavaScript here will be loaded for all users on every page load. */ | ||
+ | |||
+ | /*pinyin table scripts*/ | ||
$(document).ready( function() { | $(document).ready( function() { | ||
− | $(' | + | $('#table-settings').append('<input type="checkbox" id="table-toggle-ipa" value="true">'); |
− | $('.table-wade-giles'). | + | $('.table-zhuyin').hide(); |
+ | $('.table-wade-giles').hide(); | ||
+ | |||
+ | $('#table-toggle-ipa').change( function() { | ||
+ | if (this.val()) { | ||
+ | $('.table-ipa').show(); | ||
+ | } else { | ||
+ | $('.table-ipa').hide(); | ||
+ | }; | ||
+ | }); | ||
}); | }); |
Revision as of 03:01, 8 January 2015
/* Any JavaScript here will be loaded for all users on every page load. */
/*pinyin table scripts*/
$(document).ready( function() {
$('#table-settings').append('<input type="checkbox" id="table-toggle-ipa" value="true">');
$('.table-zhuyin').hide();
$('.table-wade-giles').hide();
$('#table-toggle-ipa').change( function() {
if (this.val()) {
$('.table-ipa').show();
} else {
$('.table-ipa').hide();
};
});
});