| 1 |
(function ($, undefined) { |
| 2 |
$(function() { |
| 3 |
"use strict"; |
| 4 |
|
| 5 |
$(document).on('change', 'select[name="hh_x_frame_options_value"]', function () { |
| 6 |
var $el = $('input[name="hh_x_frame_options_domain"]'), |
| 7 |
disabled = $(this).find('option:selected').val() != 'allow-from' || this.disabled; |
| 8 |
if ($el.length) { |
| 9 |
$el.prop('disabled', disabled).toggle(!disabled); |
| 10 |
} |
| 11 |
}).on('change', 'select[name="hh_access_control_allow_origin_value"]', function () { |
| 12 |
var $el = $('input[name="hh_access_control_allow_origin_url"]'), |
| 13 |
disabled = $(this).find('option:selected').val() != 'origin' || this.disabled; |
| 14 |
if ($el.length) { |
| 15 |
$el.prop('disabled', disabled).toggle(!disabled); |
| 16 |
} |
| 17 |
}).on('change', '.http-header', function () { |
| 18 |
var $this = $(this), |
| 19 |
$el = $this.closest('tr').find('.http-header-value'); |
| 20 |
|
| 21 |
if (!$el.length) { |
| 22 |
return; |
| 23 |
} |
| 24 |
|
| 25 |
if (Number($this.val()) === 1) { |
| 26 |
$el.prop('disabled', false); |
| 27 |
} else { |
| 28 |
$el.prop('disabled', true); |
| 29 |
} |
| 30 |
}).on('change', 'input[name="hh_x_frame_options"]', function () { |
| 31 |
$('select[name="hh_x_frame_options_value"]').trigger('change'); |
| 32 |
}).on('change', 'input[name="hh_access_control_allow_origin"]', function () { |
| 33 |
$('select[name="hh_access_control_allow_origin_value"]').trigger('change'); |
| 34 |
}); |
| 35 |
}); |
| 36 |
})(jQuery); |