edit/page: editor notification of save results
authorMischa POSLAWSKY <perl@shiar.org>
Tue, 7 Aug 2018 01:43:58 +0000 (03:43 +0200)
committerMischa POSLAWSKY <perl@shiar.org>
Tue, 7 Aug 2018 01:50:10 +0000 (03:50 +0200)
Unobtrusive indication of success.

edit/page.js

index e2475a7e2de83140b89a36a8382bfd946f166973..45f0104e022d8136b96efadbe5f754cb8a3ce42e 100644 (file)
@@ -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);
                        },