|
|
@ -25,15 +25,15 @@ function request_textpreview_update() {
|
|
|
|
const name = $element.attr('name'); // Get the name attribute of the element
|
|
|
|
const name = $element.attr('name'); // Get the name attribute of the element
|
|
|
|
data[name] = $element.is(':checkbox') ? ($element.is(':checked') ? $element.val() : false) : $element.val();
|
|
|
|
data[name] = $element.is(':checkbox') ? ($element.is(':checked') ? $element.val() : false) : $element.val();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
$('#text-preview-spinner').show();
|
|
|
|
$.abortiveSingularAjax({
|
|
|
|
$.abortiveSingularAjax({
|
|
|
|
type: "POST",
|
|
|
|
type: "POST",
|
|
|
|
url: preview_text_edit_filters_url,
|
|
|
|
url: preview_text_edit_filters_url,
|
|
|
|
data: data,
|
|
|
|
data: data,
|
|
|
|
namespace: 'watchEdit'
|
|
|
|
namespace: 'watchEdit'
|
|
|
|
}).done(function (data) {
|
|
|
|
}).done(function (data) {
|
|
|
|
|
|
|
|
$('#text-preview-spinner').fadeOut();
|
|
|
|
$('#filters-and-triggers #text-preview-before-inner').text(data['before_filter']);
|
|
|
|
$('#filters-and-triggers #text-preview-before-inner').text(data['before_filter']);
|
|
|
|
|
|
|
|
|
|
|
|
$('#filters-and-triggers #text-preview-inner')
|
|
|
|
$('#filters-and-triggers #text-preview-inner')
|
|
|
|
.text(data['after_filter'])
|
|
|
|
.text(data['after_filter'])
|
|
|
|
.highlightLines([
|
|
|
|
.highlightLines([
|
|
|
@ -42,10 +42,8 @@ function request_textpreview_update() {
|
|
|
|
'lines': data['trigger_line_numbers']
|
|
|
|
'lines': data['trigger_line_numbers']
|
|
|
|
}
|
|
|
|
}
|
|
|
|
]);
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}).fail(function (error) {
|
|
|
|
}).fail(function (error) {
|
|
|
|
|
|
|
|
$('#text-preview-spinner').fadeOut();
|
|
|
|
if (error.statusText === 'abort') {
|
|
|
|
if (error.statusText === 'abort') {
|
|
|
|
console.log('Request was aborted due to a new request being fired.');
|
|
|
|
console.log('Request was aborted due to a new request being fired.');
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|