Improve the handling of subscription hyperlinks.

This commit is contained in:
Schimon Jehudah, Adv. 2024-07-09 19:17:40 +03:00
parent 12a0628767
commit 0785b167ad
2 changed files with 15 additions and 8 deletions

View file

@ -1,10 +1,17 @@
window.onload = function(){
// Convert ISO8601 To UTC/
// Fix button follow
let follow = document.querySelector('#follow');
feedUrl = location.href.replace(/^https?:/, 'feed:');
follow.href = feedUrl;
follow.onclick = window.open(feedUrl, "_self");
// Fix button subtome
document.querySelector('#subtome').href='https://www.subtome.com/#/subscribe?feeds='+location.href;
// Convert ISO8601 To UTC
for (let element of document.querySelectorAll('#articles > ul > li > div > h4, #feed > #header > h2#subtitle.date')) {
let timeStamp = new Date(element.textContent);
element.textContent = timeStamp.toUTCString();
}
// Parse Markdown/
// Parse Markdown
for (let element of document.querySelectorAll('#articles > ul > li > div > p')) {
let markDown = element.textContent
element.innerHTML = marked.parse(markDown);