From 48b4fec4a5d31001b1edc8187efd93fe919ae9ab Mon Sep 17 00:00:00 2001 From: Navan Chauhan Date: Sat, 12 Dec 2020 16:54:25 +0530 Subject: [PATCH] updated --- real-time/config.json | 1 + real-time/index.html | 44 ++++++++++++++++++++++++++++++++++++++----- 2 files changed, 40 insertions(+), 5 deletions(-) diff --git a/real-time/config.json b/real-time/config.json index 28873c1..0e64259 100644 --- a/real-time/config.json +++ b/real-time/config.json @@ -30,6 +30,7 @@ config_extra = { "Responsive-Images": true, "direct-link": false, "show-date":true, + "show_configuration": true, "left-column":true, "defaults": { "limit": 5, diff --git a/real-time/index.html b/real-time/index.html index eb243e8..f01ab04 100644 --- a/real-time/index.html +++ b/real-time/index.html @@ -16,10 +16,18 @@

News Now

-
- -
-
+
+
+
+
+
+
+
+ +
@@ -45,6 +53,9 @@ async function myfunc(key){ var ignore_tags = feeds[key]["ignore"] var ignore_tags = (ignore_tags === undefined) ? [] : ignore_tags + var extra_keys = feeds[key]["extra_keys"] + var extra_keys = (extra_keys === undefined) ? false : extra_keys + var contents = document.createElement("a") contents.href = "#" + key contents.classList.add("list-group-item","list-group-item-action") @@ -130,6 +141,19 @@ async function myfunc(key){ } } + if (extra_keys != false){ + for(var i = 0; i < extra_keys.length; i++) { + node_extra = document.createElement("p") + node_extra.classList.add("card-text") + node_extra.innerHTML = entry[extra_keys[i]] + if (config_extra["left-column"]){ + left_col_body.appendChild(node_extra) + } else { + node_content.appendChild(node_extra) + } + } + } + node.appendChild(node_title) node_body.appendChild(node_content) @@ -165,8 +189,18 @@ async function myfunc(key){ (async () => { for(var key in feeds) { let result = await myfunc(key); -}})(); +} +config_el = document.getElementById("configuration") +config_el.innerHTML = "

Feeds

" + JSON.stringify(feeds,null,2) + "

Misc

" + JSON.stringify(config_extra,null,2) + "
" +if (config_extra["show_configuration"]) { + config_button = document.getElementById("configuration-button"); + config_button.classList.remove("invisible") +} +})(); + + + \ No newline at end of file