From b46466cb271df9cc3eccb093f2d88da4cee19983 Mon Sep 17 00:00:00 2001 From: Ryan Herbert Date: Mon, 13 Nov 2017 17:51:39 +0100 Subject: [PATCH] tips.js include image into tips Adds an image at the end of the tip, expecting it to be stored within the tips directory at the config.doc_address with the name .png --- browser/js/tips.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/browser/js/tips.js b/browser/js/tips.js index ad57a2f91..aee13b8c5 100644 --- a/browser/js/tips.js +++ b/browser/js/tips.js @@ -44,7 +44,7 @@ TipsOfTheDay.prototype = { } var tip = this.tips[tip_id]; this.set_seen(tip_id); - return tip; + return {id: tip_id, content: tip}; }, load_next_unseen: function() { @@ -142,7 +142,9 @@ TipDecorator.prototype = { var tip_div = document.createElement('div'); tip_div.className = "left"; - tip_div.innerHTML = elem; + var tmp = elem.content; + tmp += "
"; + tip_div.innerHTML = tmp; div.appendChild(tip_div); -- GitLab