Old: v23.06.01 - 2023-06-01 - Add direction button to switch direction LTR <-> RTL
New: v23.06.10 - 2023-06-09 - Replace GM_setValue/GM_getValue with GM.setValue/GM.getValue. Special thank you to CY Fung.
See: https://greasyfork.org/en/discussions/development/187288-converting-gm-setvalue-gm-getvalue-to-gm-setvalue-gm-getvalue
- @@ -1,120 +1,3 @@
-// ==UserScript==
-// @name Newspaper (Native RSS Reader)
-// @namespace i2p.schimon.newspaper
-// @description Native Feed Viewer. Render syndication web feeds (supports ActivityStreams, Atom, JSON, RDF and RSS)
-// @homepageURL https://sjehuda.github.io/newspaper.html
-// @supportURL https://greasyfork.org/en/scripts/465932-newspaper/feedback
-// @updateURL https://greasyfork.org/scripts/465932-newspaper/code/Newspaper.meta.js
-// @downloadURL https://greasyfork.org/scripts/465932-newspaper/code/Newspaper.user.js
-// @copyright 2023, Schimon Jehudah (http://schimon.i2p)
-// @license MIT; https://opensource.org/licenses/MIT
-// @icon data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDAgMTAwIj48dGV4dCB5PSIuOWVtIiBmb250LXNpemU9IjkwIj7wn5OwPC90ZXh0Pjwvc3ZnPgo=
-// @exclude *?streamburner=0
-// @exclude *?*streamburner=0
-// @match *://*/*
-// @version 23.06.01
-// @run-at document-start
-// ==/UserScript==
-
-//window.addEventListener("securitypolicyviolation", (e) => {
-// console.info(e.originalPolicy);
-//}, { passive : true, });
-
-/*
-
-NOTE
-
-RDF
-https://web.archive.org/web/20070504072733/http://www.svg.org/feeds/725.rss
-https://web.archive.org/web/20070402123623if_/http://blogs.forum.nokia.com/rss_entry_feed.rss
-
-OPML
-http://opml.org/?format=opml
-
-SML
-https://www.pclinuxos.com/forum/index.php?action=.xml
-
-
-TODO
-
-0) Skim pages (10 entries per page)
-
-1) "Lazy" Content media loader
- https://www.merixstudio.com/blog/lazy-loading-pure-javascript/
- https://css-tricks.com/the-complete-guide-to-lazy-loading-images/
-
-2) Dark mode
- body { color: WhiteSmoke; background: #333; }
- a { color: WhiteSmoke; }
- #top-navigation-button { background: '#555'; border: '2px solid WhiteSmoke'; }
- Example: https://alligator.io/feed.xml (Color schemes)
- Note: Waiting for Falkon https://bugs.kde.org/show_bug.cgi?id=468046
-
-3) Support OPML http://opml.org/?format=opml
- Support SML https://www.pclinuxos.com/forum/index.php?action=.xml
-
-4) Use JSON to store and apply inline CSS style per element
-
-5) Replace <xsl:text>#newspaper-oujs-</xsl:text> by <xsl:text>#</xsl:text><xsl:value-of select="title"/>
-
-6) Add instructions to
- navigator.userAgent.toLowerCase().includes('firefox')
- https://openuserjs.org/scripts/sjehuda/Newspaper#gecko
-
-NOTE
-
-1) <p class="explanation">This is a podcast RSS feed generated by <a href="https://castos.com/seriously-simple-podcasting/">Seriously Simple Podcasting</a>. It is meant for consumption by podcast feed readers using the URL in the address bar.</p>
-
-Design HTML as JSON
-
-
-
-NOTE Handling attributes
- "attributes": {
- "style" : {
- "direction" : "language"
- }
-}
-
-feedItems = {
- "div": "feed",
- "attributes": {
- "style" : "language",
- },
- "children" : {
- "div": "title",
- "div": "subtitle",
- "div": "links-bar",
- "div": "entry", // multiple alike
- "attributes": {
- "style" : "language",
- },
- "children" : {
- "div" : "title",
- "attributes": {
- "href" : ["url", "id"],
- "id" : "id",
- },
- "div" : ["authors", "author"],
- "div" : ["date_published", "date_modified"],
- "div" : ["content_html", "content_text"],
- "div" : "image",
- "div" : "tags",
- },
- }
- };
-
-FIXME
-
-1) Event listeners don't work on every page, yet.
- This is due to document.contentType (read only) determined as xml (Mainstream issue)
-
-2) https://imslp.org/wiki/Special:IMSLPRecordingsFeed/atom
- https://artemislena.eu/feed.json
-
-*/
-
-
- /*
-
- <!-- _The very simple technology that Fortune 500 and Web Giants are jealously trying to oppress and hide from you. -- Alex James Anderson_ -->
- @@ -200,7 +83,6 @@
- ---
-
- #### Upcoming changes:
- * Dark mode;
- * ToC: Toggle button/link;
- * ToC: Auto collaps when length exceeds N entries;
- * Provident Media Load "Lazy" (so-called) content media loader;
- @@ -276,6 +158,133 @@
-
- */
-
- +// ==UserScript==
- +// @name Newspaper (Native RSS Reader)
- +// @namespace i2p.schimon.newspaper
- +// @description Native Feed Viewer. Render syndication web feeds (supports ActivityStreams, Atom, JSON, RDF and RSS)
- +// @author Schimon Jehudah
- +// @collaborator CY Fung
- +// @homepageURL https://sjehuda.github.io/newspaper.html
- +// @supportURL https://greasyfork.org/en/scripts/465932-newspaper/feedback
- +// @updateURL https://greasyfork.org/scripts/465932-newspaper/code/Newspaper.meta.js
- +// @downloadURL https://greasyfork.org/scripts/465932-newspaper/code/Newspaper.user.js
- +// @copyright 2023, Schimon Jehudah (http://schimon.i2p)
- +// @license MIT; https://opensource.org/licenses/MIT
- +// @icon data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxMDAgMTAwIj48dGV4dCB5PSIuOWVtIiBmb250LXNpemU9IjkwIj7wn5OwPC90ZXh0Pjwvc3ZnPgo=
- +// @exclude *?streamburner=0
- +// @exclude *?*streamburner=0
- +// @match *://*/*
- +// @version 23.06.10
- +// @run-at document-start
- +// @grant GM.setValue
- +// @grant GM.getValue
- +// ==/UserScript==
- +
- +// ==GreasyFork==
- +// @author Schimon Jehudah
- +// @collaborator CY Fung
- +// @collaborator NotYou
- +// ==/GreasyFork==
- +
- +//window.addEventListener("securitypolicyviolation", (e) => {
- +// console.info(e.originalPolicy);
- +//}, { passive : true, });
- +
- +/*
- +
- +NOTE
- +
- +RDF
- +https://web.archive.org/web/20070504072733/http://www.svg.org/feeds/725.rss
- +https://web.archive.org/web/20070402123623if_/http://blogs.forum.nokia.com/rss_entry_feed.rss
- +
- +OPML
- +http://opml.org/?format=opml
- +
- +SML
- +https://www.pclinuxos.com/forum/index.php?action=.xml
- +https://simplemachines.org/
- +
- +TODO
- +
- +0) Skim pages (10 entries per page)
- +
- +1) Handle media load
- +** https://www.techrepublic.com/article/preloading-and-the-javascript-image-object/ **
- + https://www.merixstudio.com/blog/lazy-loading-pure-javascript/
- + https://css-tricks.com/the-complete-guide-to-lazy-loading-images/
- +
- +2) Dark mode
- + body { color: WhiteSmoke; background: #333; }
- + a { color: WhiteSmoke; }
- + #top-navigation-button { background: '#555'; border: '2px solid WhiteSmoke'; }
- + Example: https://alligator.io/feed.xml (Color schemes)
- + Note: Waiting for Falkon https://bugs.kde.org/show_bug.cgi?id=468046
- +
- +3) Support OPML http://opml.org/?format=opml
- + Support SML https://www.pclinuxos.com/forum/index.php?action=.xml
- +
- +4) Use JSON to store and apply inline CSS style per element
- +
- +5) Replace <xsl:text>#newspaper-oujs-</xsl:text> by <xsl:text>#</xsl:text><xsl:value-of select="title"/>
- +
- +6) Add instructions to
- + navigator.userAgent.toLowerCase().includes('firefox')
- + https://openuserjs.org/scripts/sjehuda/Newspaper#gecko
- +
- +NOTE
- +
- +1) <p class="explanation">This is a podcast RSS feed generated by <a href="https://castos.com/seriously-simple-podcasting/">Seriously Simple Podcasting</a>. It is meant for consumption by podcast feed readers using the URL in the address bar.</p>
- +
- +Design HTML as JSON
- +
- +
- +
- +NOTE Handling attributes
- + "attributes": {
- + "style" : {
- + "direction" : "language"
- + }
- +}
- +
- +feedItems = {
- + "div": "feed",
- + "attributes": {
- + "style" : "language",
- + },
- + "children" : {
- + "div": "title",
- + "div": "subtitle",
- + "div": "links-bar",
- + "div": "entry", // multiple alike
- + "attributes": {
- + "style" : "language",
- + },
- + "children" : {
- + "div" : "title",
- + "attributes": {
- + "href" : ["url", "id"],
- + "id" : "id",
- + },
- + "div" : ["authors", "author"],
- + "div" : ["date_published", "date_modified"],
- + "div" : ["content_html", "content_text"],
- + "div" : "image",
- + "div" : "tags",
- + },
- + }
- + };
- +
- +FIXME
- +
- +1) Event listeners don't work on every page, yet.
- + This is due to document.contentType (read only) determined as xml (Mainstream issue)
- +
- +2) https://imslp.org/wiki/Special:IMSLPRecordingsFeed/atom
- + https://artemislena.eu/feed.json
- +
- +*/
- +
- const
- namespace = 'i2p.schimon.newspaper',
- defaultTitle = 'Streamburner',
- @@ -324,7 +333,7 @@
- `<div class="about-newspaper" id="about-donate">
- <div><big><b>Donations</b></big></div>
- <p>No, thank you. Yet, I do appreciate your concern.</p>
- <p><big><b>Here are some things you can do</b></big></p>
- + <p><big><b>Here are some things you can do instead</b></big></p>
- <p>In no particular order …</p>
- <ul>
- <li>Talk with your friends about the benefits of RSS (i.e. Web Feeds). That would be a good table talk.</li>
- @@ -398,6 +407,7 @@
- <a href="https://sacred-texts.com/rss/new.xml">ISTA - Internet Sacred Text Archive</a>
- <a href="https://librivox.org/feed/">LibriVox</a>
- <a href="https://www.music-scores.com/blog/feed/">Music Scores Blog</a>
- + <a href="https://onlinebooks.library.upenn.edu/newrss.xml">New Online Books</a>
- <a href="https://www.nioc.eu/rss">Nioc Photos</a>
- <a href="https://www.transformativeworks.org/feed/">Organization for Transformative Works</a>
- <a href="https://www.brainyquote.com/link/quotebr.rss">Quotes</a>
- @@ -410,7 +420,9 @@
- <div class="category">
- <div>Blogroll & Videos</div>
- <a href="https://nerdy.dev/rss.xml">Adam Argyle</a>
- <a href="https://arantius.com/feed.rss">arantius.com</a>
- + <a href="https://altcensored.com/feed">altCensored</a>
- + <a href="https://arantius.com/feed.rss">Tony (Anthony) Lieuallen</a>
- + <a href="https://automationrhapsody.com/feed/">Automation Rhapsody</a>
- <a href="https://denshi.live/feeds/videos.atom">denshi.live</a>
- <a href="https://denshi.org/index.xml">DenshiSite</a>
- <a href="https://tilde.town/~dustin/index.xml">~dustin</a>
- @@ -420,6 +432,7 @@
- <a href="https://singpolyma.net/feed/action_stream/?full">Stephen Paul Weber</a>
- <a href="http://thedarnedestthing.com/atom.xml">the darnedest thing</a>
- <a href="https://geniusmusing.com/feed/rss">The Random Thoughts of GeniusMusing</a>
- + <a href="http://truthstreammedia.com/feed/">Truthstream Media</a>
- <a href="https://unixsheikh.com/feed.rss">unixsheikh.com</a>
- <a href="https://webring.xxiivv.com/#rss">Webring (index)</a>
- <a href="https://willnorris.com/atom.xml">willnorris.com</a>
- @@ -428,11 +441,14 @@
- <div>Comic, Entertainment & Games</div>
- <a href="https://abstrusegoose.com/atomfeed.xml">Abstruse Goose</a>
- <a href="https://www.basicinstructions.net/basic-instructions?format=rss">Basic Instructions</a>
- + <a href="http://cdrom.ca/feed.xml">CD-ROM Journal</a>
- <a href="https://www.crossfire.nu/feed/journals">Crossfire Journals</a>
- <a href="https://www.crossfire.nu/feed/news">Crossfire News</a>
- <a href="https://dieselsweeties.com/ds-unifeed.xml">Diesel Sweeties</a>
- <a href="https://www.dsogaming.com/feed/">DSOGaming</a>
- <a href="https://www.gamingonlinux.com/article_rss.php">GamingOnLinux</a>
- + <!-- a href="https://joyreactor.com/rss">JoyReactor</a -->
- + <!-- a href="https://joyreactor.cc/rss">JoyReactor (RU)</a -->
- <a href="https://lichess.org/blog.atom">Lichess</a>
- <a href="https://mindblur.thecomicseries.com/rss/">Mindblur</a>
- <a href="https://pikabu.ru/xmlfeeds.php?cmd=popular">pikabu.ru</a>
- @@ -546,7 +562,7 @@
- <a href="https://www.cryptogon.com/?feed=atom">cryptogon</a>
- <a href="https://mastodon.social/@Cryptome.rss">Cryptome</a>
- <a href="https://fakeologist.com/feed/">Fakeologist</a>
- <a href="https://leohohmann.com/feed/">LeoHohmann.com</a>
- + <a href="https://leohohmann.com/feed/">Leo Hohmann</a>
- <a href="https://www.elegislation.gov.hk/verified-chapters!en.rss.xml">List of Verified Legislation (Hong Kong e-Legislation)</a>
- <a href="https://off-guardian.org/feed/">OffGuardian</a>
- <a href="https://www.presstv.ir/rss.xml">Press TV</a>
- @@ -562,6 +578,7 @@
- <a href="https://www.thegatewaypundit.com/feed/">The Gateway Pundit</a>
- <a href="http://themostimportantnews.com/feed">The Most Important News</a>
- <a href="https://www.theorganicprepper.com/feed/">The Organic Prepper</a>
- + <a href="http://truthstreammedia.com/feed/">Truthstream Media</a>
- <a href="https://unlimitedhangout.com/feed/">Unlimited Hangout</a>
- </div>
- <div class="category">
- @@ -601,7 +618,7 @@
- <div>Music, Scores & Sound</div>
- <a href="https://320kbpshouse.net/feed">320KBPSHOUSE</a>
- <a href="https://acidstag.com/feed/">Acid Stag</a>
- <a href="https://www.free-scores.com/rss/fluxrss-uk.xml">Free-scores.com</a>
- + <a href="https://www.free-scores.com/rss/fluxrss-uk.xml">Free-Scores/a>
- <a href="https://www.frostclick.com/wp/index.php/feed/">FrostClick</a>
- <a href="https://intmusic.net/feed">IntMusic</a>
- <a href="https://itopmusicx.com/feed/">iTOPMUSICX</a>
- @@ -641,9 +658,11 @@
- <a href="https://speakfreeradio.com/feed/">Speak Free Radio</a>
- <a href="https://www.corbettreport.com/feed/">The Corbett Report</a>
- <a href="https://www.thehighersidechats.com/feed/">The Higherside Chats</a>
- + <a href="http://truthstreammedia.com/feed/">Truthstream Media</a>
- </div>
- <div class="category">
- <div>Product Shopping Reviews & Stores</div>
- + <div>Product, Real Estate, Shopping Reviews & Stores</div>
- + <a href="https://www.cambodiaproperty.info/feed/">Cambodia Property</a>
- +
- <a href="https://www.geartaker.com/feed/">Gear Taker</a>
- <a href="https://lab401.com/collections/flipper-zero.atom">Lab401</a>
- <a href="https://liliputing.com/feed/">Liliputing</a>
- @@ -651,6 +670,7 @@
- <a href="https://newatlas.com/index.rss">New Atlas</a>
- <a href="https://www.producthunt.com/feed">Product Hunt</a>
- <a href="https://www.sheknows.com/feed/">SheKnows</a>
- + <a href="https://www.techpowerup.com/rss/news">TechPowerUp</a>
- <a href="https://www.trustedreviews.com/feed">Trusted Reviews</a>
- </div>
- <div class="category">
- @@ -658,7 +678,9 @@
- <a href="https://campaignforliberty.org/feed/">Campaign for Liberty</a>
- <a href="https://fluoridealert.org/feed/">Fluoride Action Network</a>
- <a href="https://www.geoengineeringwatch.org/feed/atom/">Geoengineering Watch</a>
- + <a href="https://primarywater.org/?feed=rss2">Primary Water</a>
- <a href="https://stop5g.cz/us/feed/">Stop 5G</a>
- + <a href="https://stopthecrime.net/wp/feed/">Stop The Crime</a>
- </div>
- <div class="category">
- <div>Software, Guides & Technology</div>
- @@ -688,6 +710,13 @@
- <a href="https://tuxphones.com/rss/">TuxPhones</a>
- </div>
- <div class="category">
- + <div>Software Package Updates</div>
- + <a href="https://archlinux.org/feeds/packages/">Arch Linux: Recent package updates</a>
- + <a href="https://aur.archlinux.org/rss/">Arch Linux: AUR Newest Packages</a>
- + <a href="https://www.ctan.org/ctan-ann/atom.xml">CTAN: Comprehensive TeX Archive Network</a>
- + <a href="https://greasyfork.org/en/scripts.atom?sort=updated">Greasy Fork: Recent Updates</a>
- + </div>
- + <div class="category">
- <div>Software Project Updates</div>
- <a href="https://artixlinux.org/feed.php">Artix Linux</a>
- <a href="https://news.agpt.co/feed/">Auto-GPT</a>
- @@ -702,7 +731,6 @@
- <a href="https://blog.funkwhale.audio/feeds/all.atom.xml">Funkwhale</a>
- <a href="https://blogs.gnome.org/shell-dev/">GNOME Shell & Mutter</a>
- <a href="https://blog.gtk.org/feed/">GTK Development Blog</a>
- <a href="https://greasyfork.org/en/scripts.atom?sort=updated">Greasy Fork (Recent Updates)</a>
- <a href="https://jami.net/feed/">Jami</a>
- <a href="https://krita.org/en/feed/">Krita</a>
- <a href="https://leafletjs.com/atom.xml">Leaflet Dev Blog</a>
- @@ -718,6 +746,7 @@
- <a href="https://www.qemu.org/feed.xml">QEMU</a>
- <a href="https://reactos.org/index.xml">ReactOS</a>
- <a href="https://blog.replicant.us/feed/">Replicant</a>
- + <a href="https://blog.rust-lang.org/feed.xml">Rust</a>
- <a href="https://servo.org/blog/feed.xml">Servo</a>
- <a href="https://spidermonkey.dev/feed.xml">SpiderMonkey</a>
- <a href="https://translatelocally.com/rss/">Translate Locally</a>
- @@ -728,10 +757,13 @@
- <div class="category">
- <div>Standards & Protocols</div>
- <a href="https://gemini.circumlunar.space/news/atom.xml">Gemini Project</a>
- + <a href="https://www.gnunet.org/en/rss.xml">GNUnet</a>
- <a href="https://gopher.zone/index.xml">Highway to the Gopher Zone</a>
- <a href="https://geti2p.net/en/feed/blog/atom">I2P Blog</a>
- <a href="https://blog.ipfs.io/index.xml">IPFS Blog & News</a>
- + <a href="https://blog.ipfs.io/index.xml">IPFS</a>
- + <a href="https://blog.nymtech.net/feed">Nym</a>
- <a href="https://oxen.io/feed/atom">Oxen (Session & Lokinet)</a>
- + <a href="https://panoramix-project.eu/feed/">Panoramix</a>
- <a href="https://blog.torproject.org/feed.xml">Tor Project</a>
- <a href="https://www.w3.org/blog/news/feed/atom">W3C</a>
- <a href="https://xmpp.org/feeds/all.atom.xml">XMPP Blog</a>
- @@ -762,6 +794,9 @@
- <a href="https://bangumi.moe/rss/latest">Bangumi Moe</a>
- <a href="https://eztv.re/ezrss.xml">EZTV</a>
- <a href="http://firebit.org/rss.xml">FireBit</a>
- + <a href="https://fosstorrents.com/feed/distribution.xml">FOSS Torrents - Distributions</a>
- + <a href="https://fosstorrents.com/feed/game.xml">FOSS Torrents - Games</a>
- + <a href="https://fosstorrents.com/feed/software.xml">FOSS Torrents - Softwares</a>
- <a href="https://igg-games.com/feed">Install Guide Games</a>
- <a href="https://www.limetorrents.lol/rss/">Lime Torrents</a>
- <a href="https://nyaa.si/?page=rss">Nyaa</a>
- @@ -889,6 +924,7 @@
- <div>postmarketOS</div>
- <a class="news" href="https://apps.kde.org/alligator/">Alligator</a>
- <a class="news" href="https://gfeeds.gabmus.org/">Feeds</a>
- + <a class="music" href="https://gpodder.github.io/">gPodder</a>
- </div>
- <div class="subcategory">
- <div>Sailfish OS</div>
- @@ -1052,7 +1088,7 @@
- </div>
- <div>
- StreamBurner project and source code:
- <a href="https://gitgud.io/sjehuda/streamburner">https://gitgud.io/sjehuda/streamburner</a>
- + <a href="https://gitgud.io/sjehuda/streamburner">gitgud.io/sjehuda/streamburner</a>
- </div>
- </div>`,
- htmlBar =
- @@ -1060,8 +1096,9 @@
- <a id="follow" title="Subscribe to get the latest updates and news">Follow</a>
- <a class="cursor-pointer" id="subtome" title="Subscribe via SubToMe">SubToMe</a>
- <a id="direction" title="Switch direction">Direction</a>
- <a class="cursor-help" id="donate-newspaper" title="Learn how you can support">Support</a>
- + <a id="mode" title="Switch to dark mode">Dark View</a>
- <a class="cursor-help" id="about-newspaper" title="Learn about syndication feed">Help</a>
- + <a class="cursor-pointer" id="donate-newspaper" title="Learn how you can support">Support</a>
- </div>`,
- htmlEmpty =
- `<div class="notice no-entry" id="empty-feed">
- @@ -1115,6 +1152,9 @@
- color: #333;
- hyphens: auto; }
-
- +a {
- + color: #333; }
- +
- #feed {
- /*
- width: 98%;
- @@ -1127,7 +1167,6 @@
- padding: 1em 1em 0 1em; }
-
- #feed a {
- color: #333;
- display: inline-block; }
-
- #logo {
- @@ -1187,7 +1226,7 @@
- margin: auto;
- margin-bottom: 1em;
- margin-top: 1em;
- width: 90%;
- + width: 93%;
- text-align: center;
- direction: ltr;
- /* font-size: 90%; */ }
- @@ -1205,6 +1244,7 @@
- #links-bar > a:nth-child(1) {
- cursor: pointer;
- background: lavender; /* honeydew */
- + color: #333;
- border-color: grey;
- border-left-style: solid;
- border-radius: 2em; /* 40% */
- @@ -1220,7 +1260,8 @@
- cursor: help; }
-
- #toc {
- margin-left: 3%;
- + margin-left: 5%;
- + margin-right: 5%;
- padding: 5px; }
-
- #toc:before {
- @@ -1237,9 +1278,15 @@
- display: block;
- outline: none;
- padding: 5px 0;
- margin-left: 1%; }
- + margin-left: 1%;
- + white-space: nowrap;
- + overflow: hidden;
- + text-overflow: ellipsis;
- + text-decoration: none; }
-
- #toc > li > a:hover {
- + overflow: unset;
- + white-space: break-spaces;
- text-decoration: underline; }
-
- #toc > li > a:visited {
- @@ -1520,7 +1567,8 @@
- overflow: auto;
- display: inline-flex;
- max-height: 300px;
- border-radius: 4px; }
- + border-radius: 4px;
- + max-width: 100%; }
-
- .enclosures {
- background: #eee;
- @@ -1540,7 +1588,20 @@
- border-left: double;
- padding: 1em; }
-
- +.enclosure a {
- + white-space: nowrap;
- + overflow: hidden;
- + text-overflow: ellipsis;
- + text-decoration: none; }
- +
- +.enclosure {
- + display: flex; }
- +
- +.enclosure > a:hover {
- + text-decoration: underline; }
- +
- .enclosure > * {
- + white-space: nowrap;
- margin: 3px; }
-
- .enclosure > span:after {
- @@ -1640,6 +1701,7 @@
- white-space: unset; }
-
- #info-square {
- + direction: ltr;
- position: fixed;
- margin: auto;
- bottom: 0;
- @@ -1675,6 +1737,7 @@
- z-index : 1;
- /* set appearance */
- background : WhiteSmoke;
- + color: #555;
- border : 2px solid #555;
- border-radius : 50px;
- /* margin : 10px; */
- @@ -1689,7 +1752,8 @@
- /* disable selection marks */
- outline : none;
- user-select : none;
- cursor : default; }
- + /* cursor : default;
- + transform: rotate(-90deg) scale(1, -1); */ }
-
- #email-link {
- margin-top: 25px;
- @@ -1707,7 +1771,6 @@
- margin: auto;
- /* filter: drop-shadow(2px 4px 6px black); */ }
-
-
- #xslt-message {
- background: indianred; /* #2c3e50 coral */
- font-family: system-ui;
- @@ -1716,7 +1779,28 @@
- display: block;
- text-align: center; /* justify */
- text-decoration: none;
- direction: ltr; }`,
- + direction: ltr; }
- +
- +body.dark {
- + background: #333; }
- +
- +code.dark,
- +.enclosures.dark {
- + background: #555; }
- +
- +/* WONTFIX mainstream due to document.contentType is thought to be xml, which is not; it's html */
- +a.dark,
- +body.dark,
- +code.dark,
- +.enclosures.dark,
- +#empty-feed.dark {
- + color: WhiteSmoke; }
- +
- +#links-bar > a.dark {
- + color: WhiteSmoke !important; }
- +
- +#links-bar > a.dark:nth-child(1) {
- + color: #333 !important; }`,
- cssFileRTL = `
- html, body {
- text-align: right; }
- @@ -2065,7 +2149,7 @@
- subtitle.id = 'subtitle';
- feed.append(subtitle);
-
- let toc = newDocument.createElement('div');
- + let toc = newDocument.createElement('ol');
- toc.id = 'toc';
- feed.append(toc);
-
- @@ -2085,7 +2169,9 @@
- .replace(/(<([^>]+)>)/gi, "");
- //titleToc.textContent = item.actor.portablecontacts_net.preferredUsername;
- titleToc.href = `#newspaper-oujs-${index}`;
- toc.append(titleToc);
- + let liElement = newDocument.createElement('li');
- + liElement.append(titleToc)
- + toc.append(liElement);
-
- let entry = newDocument.createElement('div');
- entry.className = 'entry';
- @@ -2207,7 +2293,7 @@
- subtitle.id = 'subtitle';
- feed.append(subtitle);
-
- let toc = newDocument.createElement('div');
- + let toc = newDocument.createElement('ol');
- toc.id = 'toc';
- feed.append(toc);
-
- @@ -2257,7 +2343,9 @@
- titleToc.textContent = '*** No Title ***';
- }
- titleToc.href = `#newspaper-oujs-${index}`;
- toc.append(titleToc);
- + let liElement = newDocument.createElement('li');
- + liElement.append(titleToc)
- + toc.append(liElement);
-
- let entry = newDocument.createElement('div');
- entry.className = 'entry';
- @@ -2623,9 +2711,11 @@
- linksBar();
- follow(url);
- subToMe(url);
- + dark();
- + toggleMode();
- direction();
- //setBanner();
- truncateToc();
- + //truncateToc();
- feedInfo(date, type);
- formatDate();
- aboutPage();
- @@ -2766,6 +2856,7 @@
- // Blocked due to server policy
- // https://archlinux.org/feeds/packages/
- // https://www.openstreetmap.org/traces/rss
- +// https://artemislena.eu/feed.json
-
- // NOTE
- // Consider https://openuserjs.org/libs/BigTSDMB/setStyle
- @@ -2830,15 +2921,82 @@
- });
- }
-
- +async function dark() {
- + cssSelectors = [
- + 'body', 'code', 'a', '.enclosures', '#empty-feed'];
- + if (await GM.getValue('dark')) {
- + for (cssSelector of cssSelectors) {
- + for (element of document.querySelectorAll(cssSelector)) {
- + element.classList.add('dark');
- + let mode = document.querySelector('#mode');
- + mode.textContent = 'Light View';
- + mode.title = 'Switch to bright mode';
- + }
- + }
- + }
- +}
- +
- +function toggleMode() {
- + let mode = document.querySelector('#mode');
- + cssSelectors = [
- + 'body', 'code', 'a', '.enclosures', '#empty-feed'];
- + mode.addEventListener ("click", async function() {
- + if (await GM.getValue('dark')) {
- + await GM.setValue('dark', false);
- + mode.textContent = 'Dark View';
- + mode.title = 'Switch to dark mode';
- + for (cssSelector of cssSelectors) {
- + for (element of document.querySelectorAll(cssSelector)) {
- + element.classList.remove('dark');
- + }
- + }
- + } else {
- + await GM.setValue('dark', true);
- + mode.textContent = 'Light View';
- + mode.title = 'Switch to bright mode';
- + for (cssSelector of cssSelectors) {
- + for (element of document.querySelectorAll(cssSelector)) {
- + element.classList.add('dark');
- + }
- + }
- + }
- + });
- +}
- +
- +/*
- +function toggleMode() {
- + let mode = document.querySelector('#mode');
- + mode.addEventListener ("click", function() {
- + cssSelectors = [
- + 'body', 'code', 'a', '.enclosures', '#empty-feed'];
- + for (cssSelector of cssSelectors) {
- + for (element of document.querySelectorAll(cssSelector)) {
- + //element.style.color = 'WhiteSmoke';
- + element.classList.toggle('dark');
- + }
- + }
- + if (document.querySelector('body.dark')) {
- + mode.textContent = 'Light View';
- + mode.title = 'Switch to bright mode';
- + } else {
- + mode.textContent = 'Dark View';
- + mode.title = 'Switch to dark mode';
- + }
- + //document.querySelector('#links-bar > a:nth-child(1)').style.color = '#333';
- + //document.body.style.background = '#333';
- + });
- +}
- +*/
- +
- function direction() {
- let dir = document.querySelector('#direction');
- dir.addEventListener ("click", function() {
- + let dire = document.querySelector('#direction');
- + dire.addEventListener ("click", function() {
- if (document.dir == 'ltr' || !document.dir) {
- document.dir = 'rtl';
- dir.title = 'Set Left-to-right direction';
- + dire.title = 'Set direction: Left-to-right';
- } else {
- document.dir = 'ltr';
- dir.title = 'Set Right-to-left direction';
- + dire.title = 'Set direction: Right-to-left';
- }
- });
- }
- @@ -3102,7 +3260,7 @@
- if (document.querySelector('#top-navigation-button')) return;
- let divElement = document.createElement('div');
- divElement.id = 'top-navigation-button';
- divElement.innerHTML = '^'; // Better than ⬆️
- + divElement.innerHTML = '^'; // ^ is better than ⬆️⥣⇧⇪➦
- // behaviour
- divElement.onclick = () => {
- window.scrollTo({ top: 0 });
- @@ -3203,7 +3361,9 @@
- </style>
- </head>
- <body>
- <div id="loader">📰 Newspaper</div>
- + <div>📰 Newspaper</div>
- + <div>Web Feed Reader</div>
- + <div>Loading web feed...</div>
- +
- </body>
- </html>`,
- domParser = new DOMParser();