2015-03-10 00:13:58 +00:00
|
|
|
$(document).ready(function(){
|
2014-03-10 05:18:05 +00:00
|
|
|
|
2015-03-10 00:13:58 +00:00
|
|
|
$('#saveDefaultsButton').click(function() {
|
|
|
|
var anyQualArray = [], bestQualArray = [];
|
2014-06-02 03:43:37 +00:00
|
|
|
|
2018-02-02 22:24:33 +00:00
|
|
|
$('#wanted-qualities option:selected').each(function(i, d) {
|
2015-03-10 00:13:58 +00:00
|
|
|
anyQualArray.push($(d).val());
|
|
|
|
});
|
2018-01-29 02:26:23 +00:00
|
|
|
$('#upgrade-qualities option:selected').each(function(i, d) {
|
2015-03-10 00:13:58 +00:00
|
|
|
bestQualArray.push($(d).val());
|
|
|
|
});
|
2014-03-10 05:18:05 +00:00
|
|
|
|
2015-03-10 00:13:58 +00:00
|
|
|
$.get(sbRoot + '/config/general/saveAddShowDefaults', {
|
|
|
|
default_status: $('#statusSelect').val(),
|
|
|
|
any_qualities: anyQualArray.join(','),
|
|
|
|
best_qualities: bestQualArray.join(','),
|
2015-03-14 19:51:14 +00:00
|
|
|
default_wanted_begin: $('#wanted_begin').val(),
|
|
|
|
default_wanted_latest: $('#wanted_latest').val(),
|
2015-03-10 00:13:58 +00:00
|
|
|
default_flatten_folders: $('#flatten_folders').prop('checked'),
|
|
|
|
default_scene: $('#scene').prop('checked'),
|
|
|
|
default_subtitles: $('#subtitles').prop('checked'),
|
2015-08-09 03:12:49 +00:00
|
|
|
default_anime: $('#anime').prop('checked'),
|
|
|
|
default_tag: $('#tag').val()
|
2015-03-10 00:13:58 +00:00
|
|
|
});
|
2014-03-10 05:18:05 +00:00
|
|
|
|
2015-03-10 00:13:58 +00:00
|
|
|
new PNotify({
|
|
|
|
title: 'Saving Defaults',
|
|
|
|
text: 'Saving your "add show" defaults.',
|
|
|
|
shadow: false
|
|
|
|
});
|
|
|
|
|
|
|
|
$(this).attr('disabled', true);
|
|
|
|
});
|
|
|
|
|
2018-02-02 22:24:33 +00:00
|
|
|
$('#statusSelect, #quality-preset, #wanted-qualities, #upgrade-qualities, #wanted_begin, #wanted_latest,'
|
2015-08-09 03:12:49 +00:00
|
|
|
+ ' #flatten_folders, #scene, #subtitles, #anime, #tag').change(function() {
|
2015-03-10 00:13:58 +00:00
|
|
|
$('#saveDefaultsButton').attr('disabled', false);
|
|
|
|
});
|
2014-03-10 05:18:05 +00:00
|
|
|
|
2018-01-29 02:26:23 +00:00
|
|
|
});
|