2014-11-20 22:25:33 +00:00
|
|
|
function setFromPresets (preset) {
|
2015-07-16 23:09:27 +00:00
|
|
|
var elCustomQuality = $('.show-if-quality-custom'),
|
2014-11-20 22:25:33 +00:00
|
|
|
selected = 'selected';
|
2015-09-29 13:17:58 +00:00
|
|
|
if (preset = parseInt(preset)) {
|
|
|
|
elCustomQuality.hide();
|
2014-03-10 05:18:05 +00:00
|
|
|
|
2015-09-29 13:17:58 +00:00
|
|
|
var upgrade = !0;
|
|
|
|
$('#anyQualities, #bestQualities').find('option').each(function() {
|
|
|
|
if (upgrade && 'bestQualities' === $(this).parent().attr('id')) {
|
|
|
|
upgrade = !1;
|
|
|
|
switch (preset) {
|
|
|
|
case 3: preset = 128 + 32 + 4; break;
|
|
|
|
case 164: preset = 256 + 64 + 16 + 4; break;
|
|
|
|
case 336: preset = 256; break;
|
|
|
|
default: preset = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
$(this).attr(selected, ((preset & parseInt($(this).val())) ? selected : false));
|
|
|
|
});
|
|
|
|
} else
|
|
|
|
elCustomQuality.show();
|
2014-11-20 22:25:33 +00:00
|
|
|
}
|
2014-03-10 05:18:05 +00:00
|
|
|
|
2014-11-20 22:25:33 +00:00
|
|
|
$(document).ready(function() {
|
|
|
|
var elQualityPreset = $('#qualityPreset'),
|
|
|
|
selected = ':selected';
|
2014-03-10 05:18:05 +00:00
|
|
|
|
2014-11-20 22:25:33 +00:00
|
|
|
elQualityPreset.change(function() {
|
2015-09-29 13:17:58 +00:00
|
|
|
setFromPresets($(this).find(selected).val());
|
2014-11-20 22:25:33 +00:00
|
|
|
});
|
2014-03-10 05:18:05 +00:00
|
|
|
|
2014-11-20 22:25:33 +00:00
|
|
|
setFromPresets(elQualityPreset.find(selected).val());
|
|
|
|
});
|