$(document).ready(function() { $('#checkAll').live('click', function(){ var seasCheck = this; $('.dirCheck').each(function(){ this.checked = seasCheck.checked; }); }); $('#submitShowDirs').click(function(){ var dirArr = new Array(); $('.dirCheck').each(function(i,w) { if (this.checked == true) { var show = $(this).attr('id'); var indexer = $(this).closest('tr').find('select').val(); dirArr.push(encodeURIComponent(indexer + '|' + show)); } }); if (dirArr.length == 0) return false; url = sbRoot+'/home/addShows/addExistingShows?promptForSettings='+ ($('#promptForSettings').prop('checked') ? 'on' : 'off'); url += '&shows_to_add='+dirArr.join('&shows_to_add='); window.location.href = url; }); function loadContent() { var url = ''; $('.dir_check').each(function(i,w){ if ($(w).is(':checked')) { if (url.length) url += '&'; url += 'rootDir=' + encodeURIComponent($(w).attr('id')); } }); $('#tableDiv').html('