From acc39fd2f0eaf516dbb534232ed5f631c269886b Mon Sep 17 00:00:00 2001 From: Mischa POSLAWSKY Date: Tue, 7 Aug 2018 03:43:58 +0200 Subject: [PATCH] edit/page: editor notification of save results Unobtrusive indication of success. --- edit/page.js | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/edit/page.js b/edit/page.js index e2475a7..45f0104 100644 --- a/edit/page.js +++ b/edit/page.js @@ -22,10 +22,19 @@ CKEDITOR.plugins.add('inlinesave', { ajaxpost.onreadystatechange = function () { if (ajaxpost.readyState != 4) return; // not done yet - if (ajaxpost.status != 200) - alert('Foutcode '+ajaxpost.status+' bij opslaan: '+ajaxpost.responseText); - else + if (ajaxpost.status == 200) { editor.resetDirty(); + new CKEDITOR.plugins.notification(editor, { + message: 'Pagina is succesvol opgeslagen', + type: 'success', + }).show(); + } + else { + new CKEDITOR.plugins.notification(editor, { + message: 'Foutcode '+ajaxpost.status+' bij opslaan: '+ajaxpost.responseText, + type: 'warning', + }).show(); + } }; ajaxpost.send(data); }, -- 2.30.0