Difference between revisions of "MediaWiki:Common.js"
From Beyond Social
| Line 2: | Line 2: | ||
| − | |||
| − | |||
| − | |||
/* for Editorial_selection Form */ | /* for Editorial_selection Form */ | ||
| − | + | var allarticles = $('label[class*=issue_]'); //label elements with class contains issue_* | |
| − | var allarticles = $( | + | var checkboxesSpan =$('.checkboxesSpan'); |
| + | |||
| + | $(document).ready( | ||
| + | function(){ | ||
| + | checkboxesSpan.css('display','none'); //hide on load | ||
allarticles.css('display','none'); | allarticles.css('display','none'); | ||
| + | } | ||
| + | ) | ||
| + | |||
//get issue check boxes | //get issue check boxes | ||
| Line 18: | Line 22: | ||
var checked; | var checked; | ||
var boxval | var boxval | ||
| + | |||
| + | |||
checkboxes.click( | checkboxes.click( | ||
Revision as of 14:42, 17 December 2016
/* Any JavaScript here will be loaded for all users on every page load. */
/* for Editorial_selection Form */
var allarticles = $('label[class*=issue_]'); //label elements with class contains issue_*
var checkboxesSpan =$('.checkboxesSpan');
$(document).ready(
function(){
checkboxesSpan.css('display','none'); //hide on load
allarticles.css('display','none');
}
)
//get issue check boxes
var checkboxes = $('input.createboxInput[value*="Issue"]');
var clickedbox ;
var checked;
var boxval
checkboxes.click(
function(){
console.log('click');
clickedbox = $(this);
checked = clickedbox.prop('checked');
boxval = clickedbox.val();
console.log( clickedbox, checked, boxval );
// if checked == true -> show articles within baxval category
// if checked == false -> hide articles within baxval category
}
)