From d445530fa08cdbe2088150a3e7d23596eab9b142 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Fri, 19 Feb 2021 17:15:22 +0300 Subject: format note on the client --- js/Article.js | 7 ++++++- js/Headlines.js | 2 +- js/common.js | 4 ++-- 3 files changed, 9 insertions(+), 4 deletions(-) (limited to 'js') diff --git a/js/Article.js b/js/Article.js index 21973518c..d039882ec 100644 --- a/js/Article.js +++ b/js/Article.js @@ -130,6 +130,11 @@ const Article = { Headlines.toggleUnread(id, 0); }, + renderNote: function (id, note) { + return `
+ ${App.FormFields.icon('note')}
${note ? App.escapeHtml(note) : ""}
+
`; + }, renderTags: function (id, tags) { const tags_short = tags.length > 5 ? tags.slice(0, 5) : tags; @@ -300,7 +305,7 @@ const Article = {
${hl.buttons}
-
${hl.note}
+ ${Article.renderNote(hl.id, hl.note)}
${hl.content} ${Article.renderEnclosures(hl.enclosures)} diff --git a/js/Headlines.js b/js/Headlines.js index 9bc5747c2..60066164f 100755 --- a/js/Headlines.js +++ b/js/Headlines.js @@ -483,7 +483,7 @@ const Headlines = {
-
${hl.note}
+ ${Article.renderNote(hl.id, hl.note)}
diff --git a/js/common.js b/js/common.js index e88b62602..e616c70ba 100755 --- a/js/common.js +++ b/js/common.js @@ -71,9 +71,9 @@ Element.prototype.fadeOut = function() { }()); }; -Element.prototype.fadeIn = function(display){ +Element.prototype.fadeIn = function(display = undefined){ this.style.opacity = 0; - this.style.display = display || "block"; + this.style.display = display == undefined ? "block" : display; const self = this; (function fade() { -- cgit v1.2.3