Added few tweaks, improved notifications #23

Merged
andydixon merged 3 commits from v2-dev into master 2024-10-01 23:37:45 +02:00
Showing only changes of commit 2b4999f65c - Show all commits
+8 -2
View File
@@ -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');