2014-03-10 05:18:05 +00:00
|
|
|
$(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)
|
2014-06-27 11:00:16 +00:00
|
|
|
url += '&';
|
2014-03-10 05:18:05 +00:00
|
|
|
url += 'rootDir=' + encodeURIComponent($(w).attr('id'));
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
2014-10-24 13:16:46 +00:00
|
|
|
$('#tableDiv').html('<img id="searchingAnim" src="' + sbRoot + '/images/loading32' + themeSpinner + '.gif" height="32" width="32" /> loading folders...');
|
2014-03-10 05:18:05 +00:00
|
|
|
$.get(sbRoot+'/home/addShows/massAddTable', url, function(data) {
|
|
|
|
$('#tableDiv').html(data);
|
|
|
|
$("#addRootDirTable").tablesorter({
|
|
|
|
//sortList: [[1,0]],
|
|
|
|
widgets: ['zebra'],
|
|
|
|
headers: {
|
|
|
|
0: { sorter: false }
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
var last_txt = '';
|
|
|
|
$('#rootDirText').change(function() {
|
|
|
|
if (last_txt == $('#rootDirText').val())
|
|
|
|
return false;
|
|
|
|
else
|
|
|
|
last_txt = $('#rootDirText').val();
|
|
|
|
$('#rootDirStaticList').html('');
|
|
|
|
$('#rootDirs option').each(function(i, w) {
|
2014-09-30 22:20:37 +00:00
|
|
|
$('#rootDirStaticList').append('<li class="ui-state-default ui-corner-all"><input type="checkbox" class="dir_check" id="'+$(w).val()+'" checked=checked> <label for="'+$(w).val()+'" style="color:#09A2FF;"><b>'+$(w).val()+'</b></label></li>')
|
2014-03-10 05:18:05 +00:00
|
|
|
});
|
|
|
|
loadContent();
|
|
|
|
});
|
|
|
|
|
|
|
|
$('.dir_check').live('click', loadContent);
|
|
|
|
|
|
|
|
$('.showManage').live('click', function() {
|
|
|
|
$( "#tabs" ).tabs( 'select', 0 );
|
|
|
|
});
|
|
|
|
|
|
|
|
});
|