snoopdave commented on code in PR #319:
URL: https://github.com/apache/roller/pull/319#discussion_r4636769484
##########
app/src/main/webapp/WEB-INF/jsps/editor/EntryEditor.jsp:
##########
@@ -142,7 +151,19 @@
<%-- Rich text editor functions --%>
+ // Entries with HTML that Summernote would run or drop open in the textarea
+ // as HTML; see rich-editor-content.js. Summernote starts the editor on any
+ // call, so every call checks this first.
+ var richEditorStarted = false;
+
$(document).ready(function () {
+ if
(RollerRichEditor.hasActiveHtml(document.getElementById('edit_content').value))
{
+ $('#edit_content_html_notice').show();
+
RollerRichEditor.trackCursor(document.getElementById('edit_content'));
+ $("#edit_content").one("change", warnBeforeLeaving);
Review Comment:
**Important:** A textarea `change` event fires after the field loses focus,
so typing here and leaving the page while the field is still focused may never
install the leave-page warning. Use a one-time `input` listener for typed
edits, and keep programmatic media insertion covered.
--
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]