You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@roller.apache.org by ad...@apache.org on 2019/06/12 10:02:43 UTC

[roller] branch ROL-2136-5.2.x created (now e7bf827)

This is an automated email from the ASF dual-hosted git repository.

adityasharma pushed a change to branch ROL-2136-5.2.x
in repository https://gitbox.apache.org/repos/asf/roller.git.


      at e7bf827  Reverted: unwanted changes (ROL-2136)

This branch includes the following new commits:

     new 7e94603  Improved: Editor should confirm user before leaving the page (ROL-2136) On the pages where editors are used, if the user has done some unsaved changes. Before closing window/tab it should confirm user. Done following changes: 1. Included UnsavedChanges plugin for Xinha editor that implicitly handles it 2. Added custom code to add confimation box for text area which adds an event handler to beforeunload event if the text area is changed.
     new e7bf827  Reverted: unwanted changes (ROL-2136)

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[roller] 02/02: Reverted: unwanted changes (ROL-2136)

Posted by ad...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

adityasharma pushed a commit to branch ROL-2136-5.2.x
in repository https://gitbox.apache.org/repos/asf/roller.git

commit e7bf8273fb32493bd51dcea4f8646bf545c71406
Author: Aditya Sharma <ia...@gmail.com>
AuthorDate: Mon Jun 3 22:29:08 2019 +0530

    Reverted: unwanted changes (ROL-2136)
---
 app/src/main/webapp/WEB-INF/jsps/editor/EntryEditor.jsp | 1 -
 1 file changed, 1 deletion(-)

diff --git a/app/src/main/webapp/WEB-INF/jsps/editor/EntryEditor.jsp b/app/src/main/webapp/WEB-INF/jsps/editor/EntryEditor.jsp
index 1d463f8..1a2df74 100644
--- a/app/src/main/webapp/WEB-INF/jsps/editor/EntryEditor.jsp
+++ b/app/src/main/webapp/WEB-INF/jsps/editor/EntryEditor.jsp
@@ -127,7 +127,6 @@
         }
         // Added event listener to confirm once the editor content is changed
         jQuery("#edit_content").one("change", function() {
-            console.log("this");
             jQuery(window).on("beforeunload", function(event) {
                 // Chrome requires returnValue to be set and original event is found as originalEvent
                 // see https://developer.mozilla.org/en-US/docs/Web/API/WindowEventHandlers/onbeforeunload#Example


[roller] 01/02: Improved: Editor should confirm user before leaving the page (ROL-2136) On the pages where editors are used, if the user has done some unsaved changes. Before closing window/tab it should confirm user. Done following changes: 1. Included UnsavedChanges plugin for Xinha editor that implicitly handles it 2. Added custom code to add confimation box for text area which adds an event handler to beforeunload event if the text area is changed.

Posted by ad...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

adityasharma pushed a commit to branch ROL-2136-5.2.x
in repository https://gitbox.apache.org/repos/asf/roller.git

commit 7e9460396355007675f27e2794bc868ffb731cf5
Author: Aditya Sharma <ia...@gmail.com>
AuthorDate: Mon Jun 3 22:18:19 2019 +0530

    Improved: Editor should confirm user before leaving the page
    (ROL-2136)
    On the pages where editors are used, if the user has done some unsaved changes. Before closing window/tab it should confirm user.
    Done following changes:
    1. Included UnsavedChanges plugin for Xinha editor that implicitly handles it
    2. Added custom code to add confimation box for text area which adds an event handler to beforeunload event if the text area is changed.
---
 app/src/main/webapp/WEB-INF/jsps/editor/EntryEditor.jsp | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/app/src/main/webapp/WEB-INF/jsps/editor/EntryEditor.jsp b/app/src/main/webapp/WEB-INF/jsps/editor/EntryEditor.jsp
index 5050b29..1d463f8 100644
--- a/app/src/main/webapp/WEB-INF/jsps/editor/EntryEditor.jsp
+++ b/app/src/main/webapp/WEB-INF/jsps/editor/EntryEditor.jsp
@@ -125,6 +125,17 @@
                 textAreaElement.focus();
             }
         }
+        // Added event listener to confirm once the editor content is changed
+        jQuery("#edit_content").one("change", function() {
+            console.log("this");
+            jQuery(window).on("beforeunload", function(event) {
+                // Chrome requires returnValue to be set and original event is found as originalEvent
+                // see https://developer.mozilla.org/en-US/docs/Web/API/WindowEventHandlers/onbeforeunload#Example
+                if (event.originalEvent)
+                    event.originalEvent.returnValue = "Are you sure you want to leave?";
+                return "Are you sure you want to leave?";
+            });
+        });
     </script>
 </s:if>
 <s:else>
@@ -169,7 +180,7 @@
                 'edit_content', 'edit_summary'
             ];
 
-            xinha_plugins = xinha_plugins ? xinha_plugins :[];
+            xinha_plugins = xinha_plugins ? xinha_plugins :[ 'UnsavedChanges'];
             if(!Xinha.loadPlugins(xinha_plugins, xinha_init)) return;
 
             xinha_config = xinha_config ? xinha_config() : new Xinha.Config();