in ses-plugin-server/src/main/resources/buildServerResources/editSESParams.js [77:151]
$j('#editSQSParams').on('focusin', 'input', function (e) {
$j(document.getElementById('error_' + $j(e.target).attr('id'))).empty();
}).on('change', 'input', function (e) {
$j('#successMessage').hide();
var $elt = $j(e.target);
var anyChanged = $elt.data('initValue') !== $elt.val() || BS.SESPlugin.EditSQSParams.isAnyFieldChanged();
BS.SESPlugin.EditSQSParams.FormCrutch.setModified(anyChanged);
}).on('click', '#submit', function (e) {
sumbit();
}).on('click', '#check', function (e) {
sendRequest('check')
.done(function (data) {
if (data.errorFields && data.errorFields.length > 0) {
BS.TestConnectionDialog.show(false, data.description);
for (var i = 0; i < data.errorFields.length; ++i) {
BS.SESPlugin.EditSQSParams.FormCrutch.showError(data.errorFields[i], "Should not be empty");
}
} else {
BS.TestConnectionDialog.show(data.successful, data.description);
}
})
.fail(function (data) {
});
}).on('click', '#delete', function () {
if (!confirm("Delete all setting?")) return;
sendRequest('delete')
.done(function (data) {
$j('#editSQSParams #editSQSParamsTable').find('input:not(.enableDisableSESIntegration)').val('');
if (data.successful) {
}
})
.fail(function (data) {
});
}).on('click', '#receive', function () {
sendRequest('receive').done(function (data) {
if (data.errorFields && data.errorFields.length > 0) {
for (var i = 0; i < data.errorFields.length; ++i) {
BS.SESPlugin.EditSQSParams.FormCrutch.showError(data.errorFields[i], "Should not be empty");
}
} else {
alert(data.description);
BS.reload();
}
});
}).on('click', '#statusLabel', function () {
$j('#editSQSParams #status').show();
$j('#editSQSParams #statusLabel').hide();
}).on('click', '#enable-btn', function () {
$j('input[id=\'aws.sesIntegration.enabled\']').val('true');
sendRequest('enable')
.done(function () {
BS.reload();
});
}).on('click', '#disable-btn', function () {
var message;
if (BS.SESPlugin.EditSQSParams.FormCrutch.modified) {
message = "All unsaved changes will be discarded and SES integration will be disabled. Proceed?";
} else {
message = "SES integration will be disabled. Proceed?";
}
if (!confirm(message)) {
return;
}
$j('input[id=\'aws.sesIntegration.enabled\']').val('false');
sendRequest('enable')
.done(function () {
BS.reload();
});
});