mraible commented on code in PR #319:
URL: https://github.com/apache/roller/pull/319#discussion_r4637216662
##########
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:
The textarea fallback now installs the leave-page warning on the first
`input` event, and media insertion triggers `input` instead of `change`, so
both typed and inserted edits arm it. `NewUserJourneyIT` now publishes an entry
with a click handler, switches the weblog to the rich editor, types into the
fallback textarea without leaving it and checks the beforeunload handler is
armed, then does the same after inserting a media file through the dialog.
`EntryEditorRichContentTest.theTextareaFallbackWarnsWhileTheAuthorTypes` keeps
the JSP wired that way.
--
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]