diff options
| author | Jules Laplace <julescarbon@gmail.com> | 2017-12-23 11:27:23 +0100 |
|---|---|---|
| committer | Jules Laplace <julescarbon@gmail.com> | 2017-12-23 11:27:23 +0100 |
| commit | b6777c92daf6e2becfb0efb3316a05885ce18109 (patch) | |
| tree | 39665d675536ca545467ecde4a54b5932cb4eed7 | |
| parent | 566390b9716b9db84902d30b5b295d5df5a86670 (diff) | |
strip carriage returns when displaying comments (messes with pre-line)
| -rw-r--r-- | public/assets/js/lib/views/details/commentform.js | 16 | ||||
| -rw-r--r-- | public/assets/js/util/format.js | 2 |
2 files changed, 9 insertions, 9 deletions
diff --git a/public/assets/js/lib/views/details/commentform.js b/public/assets/js/lib/views/details/commentform.js index a14caa3..db08ef1 100644 --- a/public/assets/js/lib/views/details/commentform.js +++ b/public/assets/js/lib/views/details/commentform.js @@ -1,32 +1,32 @@ var CommentForm = FormView.extend({ - + el: "#comment_form", - + events: { "focus textarea": 'focus', "mouseup input[type=file]": 'focus', }, - + action: "", - + initialize: function(){ this.__super__.initialize.call(this) this.template = this.$(".template").html() this.$comment = this.$("[name=comment]") }, - + load: function(thread){ this.action = "/api/thread/" + thread.id + "/comment" if (thread.settings.noupload) { this.$("[type=file]").hide() } }, - + focus: function(){ this.$el.addClass('focused') $("[name=comment]").prop("required", false) }, - + validate: function(){ var errors = [] var comment = $("[name=comment]").val() @@ -40,4 +40,4 @@ var CommentForm = FormView.extend({ success: function(){ window.location.reload() } -})
\ No newline at end of file +}) diff --git a/public/assets/js/util/format.js b/public/assets/js/util/format.js index 7032305..4115c47 100644 --- a/public/assets/js/util/format.js +++ b/public/assets/js/util/format.js @@ -223,7 +223,7 @@ function tidy_urls (s, short_urls) { return '<a href="' + url + '" target="_blank">' + url + '</a>' } }); - }).join("\n") + }).join("\n").replace(/\r/g, "") return ret } function get_domain(url){ |
