updated
This commit is contained in:
parent
5f466d02b8
commit
48b4fec4a5
|
@ -30,6 +30,7 @@ config_extra = {
|
|||
"Responsive-Images": true,
|
||||
"direct-link": false,
|
||||
"show-date":true,
|
||||
"show_configuration": true,
|
||||
"left-column":true,
|
||||
"defaults": {
|
||||
"limit": 5,
|
||||
|
|
|
@ -16,10 +16,18 @@
|
|||
<h1 align="center" class="display-1">News Now</h1>
|
||||
<main>
|
||||
<div class="container">
|
||||
<div class="list-group pb-4" id="contents"></div>
|
||||
|
||||
<div id="feed">
|
||||
</div></div>
|
||||
<section>
|
||||
<div class="list-group pb-4" id="contents"></div>
|
||||
</section>
|
||||
<section>
|
||||
<div class="pb-4">
|
||||
<a href="#configuration" id="configuration-button" class="btn btn-info invisible" data-toggle="collapse">Show Configuration</a>
|
||||
<div id="configuration" class="collapse"></div>
|
||||
</section>
|
||||
<section>
|
||||
<div id="feed"></div>
|
||||
</srction>
|
||||
</div>
|
||||
</main>
|
||||
<script type="text/javascript" src="./config.json"></script>
|
||||
<script src="./js/rss-parser.js"></script>
|
||||
|
@ -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 = "<h3> Feeds </h3> <pre>" + JSON.stringify(feeds,null,2) + "</pre> <h2> Misc </h2> <pre>" + JSON.stringify(config_extra,null,2) + "</pre>"
|
||||
if (config_extra["show_configuration"]) {
|
||||
config_button = document.getElementById("configuration-button");
|
||||
config_button.classList.remove("invisible")
|
||||
}
|
||||
|
||||
})();
|
||||
</script>
|
||||
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.6/umd/popper.min.js" integrity="sha384-wHAiFfRlMFy6i5SRaxvfOCifBUQy1xHdJ/yoi7FRNXMRBu5WHdZYu1hA6ZOblgut" crossorigin="anonymous"></script>
|
||||
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/js/bootstrap.min.js" integrity="sha384-B0UglyR+jN6CkvvICOB2joaf5I4l3gm9GU6Hc1og6Ls7i6U/mkkaduKaBhlAXv9k" crossorigin="anonymous"></script>
|
||||
<noscript>Uh Oh! Your browser does not support JavaScript or JavaScript is currently disabled. Please enable JavaScript or switch to a different browser.</noscript>
|
||||
</body></html>
|
Loading…
Reference in New Issue