/*globals $, config, sbRoot, generate_bwlist*/
$(document).ready(function () {
$.getJSON(sbRoot + '/home/addShows/getIndexerLanguages', {}, function (data) {
var resultStr, flag, selected, current_lang_added = '';
if (data.results.length === 0) {
flag = ' class="flag" style="background-image:url(' + sbRoot + '/images/flags/' + config.show_lang + '.png)"';
resultStr = '';
} else {
current_lang_added = false;
$.each(data.results, function (index, obj) {
if (obj === config.show_lang) {
selected = ' selected="selected"';
current_lang_added = true;
}
else {
selected = '';
}
flag = ' class="flag" style="background-image:url(' + sbRoot + '/images/flags/' + obj + '.png);"';
resultStr += '';
});
if (!current_lang_added) {
resultStr += '';
}
}
$('#indexerLangSelectEdit').html(resultStr);
});
var all_exceptions = [];
$('#location').fileBrowser({title: 'Select Show Location'});
$('#submit').click(function () {
all_exceptions = [];
$('#exceptions_list').find('option').each (function () {
all_exceptions.push($(this).val());
});
$('#exceptions_list').val(all_exceptions);
if (config.show_isanime) {
generate_bwlist();
}
});
$('#addSceneName').click(function () {
var scene_ex = $('#SceneName').val();
var scene_ex_season = $('#SceneNameSeason').val();
var option = $('