From 6a330e9b09d05873213fd949bed0fb8b5e0c7ad1 Mon Sep 17 00:00:00 2001 From: NunoSempere Date: Tue, 14 Feb 2023 02:07:23 +0100 Subject: tweak: nicer blockquotes also fix bug in archive.is / bloomberg. --- plugins/readability/readability.c | 2 +- plugins/readability/readability.h | 2 +- plugins/readability/readability.js | 36 ++++++++++++++++++++++++++ plugins/readability/recompute_READABILITY_N.sh | 2 +- 4 files changed, 39 insertions(+), 3 deletions(-) (limited to 'plugins/readability') diff --git a/plugins/readability/readability.c b/plugins/readability/readability.c index 0ae9d44..ff7e4d1 100644 --- a/plugins/readability/readability.c +++ b/plugins/readability/readability.c @@ -1,7 +1,7 @@ #include #include #include -#define READABILITY_N 84251 + 1 +#define READABILITY_N 84824 + 1 void read_readability_js(char* string){ FILE *fp=fopen("/home/loki/Documents/core/software/fresh/C/rose-browser/rose-browser/plugins/readability/readability.js", "r"); diff --git a/plugins/readability/readability.h b/plugins/readability/readability.h index 5fe0628..09293a2 100644 --- a/plugins/readability/readability.h +++ b/plugins/readability/readability.h @@ -1,7 +1,7 @@ #ifndef READABILITY #define READABILITY -#define READABILITY_N 84251 + 1 +#define READABILITY_N 84824 + 1 void read_readability_js(char* string); diff --git a/plugins/readability/readability.js b/plugins/readability/readability.js index 21f3e3a..ee3d9c0 100644 --- a/plugins/readability/readability.js +++ b/plugins/readability/readability.js @@ -2319,6 +2319,21 @@ body { left: 0; width: 100%; } + +/* Block quotes */ + +blockquote{ + width:60%; + margin: 5px auto; + font-style:italic; + color: #555555; + padding: 1.2em 30px 1.2em 75px; + border-left:8px solid #005386 ; + line-height:1.3; + position: relative; + background: #F0F0F0; +} + ` /* @@ -2338,3 +2353,24 @@ var documentClone = document.cloneNode(true); var article = new Readability(documentClone).parse(); document.head.innerHTML = `${article.title}\n${style_sheet_simple}` document.body.innerHTML = `

${article.title}

\n${article.content}` + + +/* Hack for archive.is */ +var styles + +if (document.domain == "archive.is" ){ + styles = ` + + li > span { + display: none; !important + } + + ` +} + +if(styles != null){ + var styleSheet = document.createElement('style') + styleSheet.innerText = styles + document.head.appendChild(styleSheet) + console.log('Style changed') +} diff --git a/plugins/readability/recompute_READABILITY_N.sh b/plugins/readability/recompute_READABILITY_N.sh index 3ca6e38..1e136e9 100755 --- a/plugins/readability/recompute_READABILITY_N.sh +++ b/plugins/readability/recompute_READABILITY_N.sh @@ -3,6 +3,6 @@ function sedr(){ find ./ -type f -exec sed -i -e "$1" {} \; } ## e.g., sedr "s/target/replacement/g" -READABILITY_N=$(wc -c ./plugins/*/readability.js | cut -d " " -f 1) +READABILITY_N=$(wc -c readability.js | cut -d " " -f 1) sedr "s/^#define READABILITY_N .*/#define READABILITY_N $READABILITY_N + 1/g" -- cgit v1.2.3