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
|
|
|
|
2015-03-10 00:13:58 +00:00
|
|
|
$('#anyQualities option:selected').each(function(i, d) {
|
|
|
|
anyQualArray.push($(d).val());
|
|
|
|
});
|
|
|
|
$('#bestQualities option:selected').each(function(i, d) {
|
|
|
|
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);
|
|
|
|
});
|
|
|
|
|
2015-03-14 19:51:14 +00:00
|
|
|
$('#statusSelect, #qualityPreset, #anyQualities, #bestQualities, #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
|
|
|
|
|
|
|
});
|