arturobernalg opened a new pull request, #563: URL: https://github.com/apache/jspwiki/pull/563
JSPWIKI-375: the plain editor asks for confirmation when the user leaves the page with changes that are not saved, and the WYSIWYG editor did not, so typed text was lost without a question. Change: the inline script of wysiwyg.jsp keeps the content of the editor once it is attached, and installs window.onbeforeunload with the same message as the plain editor (javascript.edit.areyousure, already translated). The handler answers only when the content differs from the one kept at the start, and it is removed when the form is sent, so Save and Cancel leave the page without a question. Measured in the browser with the war built from this branch, on a Tomcat 10.1 instance, WYSIWYG editor, on a page with a heading, bold and italic text, a link, a variable, two lists and a second heading: Opening the page and moving the cursor without typing: the handler does not ask. This was the check for false questions. Typing text and then going to another page: the browser stopped the navigation with its question about leaving the site. Before the change the same navigation went through without a question. Typing and pressing Save: the page was saved with the text and the handler was gone afterwards. Typing and pressing Cancel: the page was shown with the text discarded, with no question. What this does not cover: the page lock is still not released when the user leaves, which is the second part of the issue and is not changed here. There is no automated test, as the scripts have none in this repository. Only Chrome was tried, and only the default template; the legacy 210 template has its own wysiwyg.jsp and is not changed. The ChangeLog has the entry. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
