From 2b4999f65cb6cd286af30681a2cc30541844059a Mon Sep 17 00:00:00 2001 From: Andy Dixon Date: Tue, 1 Oct 2024 22:35:20 +0100 Subject: [PATCH] Refined feedback --- cms/js/cms.js | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/cms/js/cms.js b/cms/js/cms.js index fcd3cd9..fc874db 100644 --- a/cms/js/cms.js +++ b/cms/js/cms.js @@ -116,14 +116,15 @@ $(document).ready(function () { }, success: function (response) { if (typeof response.error != "undefined") { - alert(response.error); + showMessage(response.error,"error"); } else { + showMessage("New page Created","success"); $('#frameContainer').contents().get(0).location.href = response.url; $("#newPageForm").dialog("close"); // Close the modal on success } }, error: function () { - alert('Failed to create the new page.'); + showMessage("Failed to create the new page (API error)","error"); } }); }); @@ -195,6 +196,11 @@ $(document).ready(function () { }); +/** + * Show A message bar across the top of the screen for a few seconds + * @param message - string - message to be shown + * @param type - string "success" or "error" + */ function showMessage(message, type) { var messageBar = $('#message-bar');