Skip to content

Commit

Permalink
Add close-window-with-edited-text warning to conversations and comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Said Achmiz committed Oct 23, 2018
1 parent ec6f07d commit a7a649f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion templates/conversation.html
Expand Up @@ -15,7 +15,7 @@ <h1 class="page-main-heading">Send private message</h1>
<input name="subject" autocomplete="off" type="text">
</div>{% endif %}
<div class="textarea-container">
<textarea name="text">{{ markdown-source }}</textarea>
<textarea name="text" onkeyup="enableBeforeUnload();" onchange="enableBeforeUnload();">{{ markdown-source }}</textarea>
<span class="markdown-reference-link">You <em>cannot</em> use Markdown here—plain text only.</span>
<button type="button" class="guiedit-mobile-auxiliary-button guiedit-mobile-help-button">Help</button>
<button type="button" class="guiedit-mobile-auxiliary-button guiedit-mobile-exit-button">Exit</button>
Expand Down
4 changes: 2 additions & 2 deletions www/script.js
Expand Up @@ -262,7 +262,7 @@ Element.prototype.injectReplyForm = function(editMarkdownSource) {
e.innerHTML = "<button class='cancel-comment-button' tabindex='-1'>Cancel</button>" +
"<form method='post'>" +
"<div class='textarea-container'>" +
"<textarea name='text'></textarea>" +
"<textarea name='text' onkeyup='enableBeforeUnload();' onchange='enableBeforeUnload();'></textarea>" +
(withparent ? "<input type='hidden' name='parent-comment-id' value='" + e.getCommentId() + "'>" : "") +
(editCommentId ? "<input type='hidden' name='edit-comment-id' value='" + editCommentId + "'>" : "") +
"<span class='markdown-reference-link'>You can use <a href='http://commonmark.org/help/' target='_blank'>Markdown</a> here.</span>" +
Expand All @@ -282,7 +282,7 @@ Element.prototype.injectReplyForm = function(editMarkdownSource) {
}
}
let textarea = e.querySelector("textarea");
textarea.value = (editMarkdownSource ? editMarkdownSource : "");
textarea.value = editMarkdownSource || "";
textarea.addTextareaFeatures();
textarea.focus();
}
Expand Down

0 comments on commit a7a649f

Please sign in to comment.