From 2ce28303518c42cd17096145beecc1c89110429f Mon Sep 17 00:00:00 2001 From: NunoSempere Date: Fri, 15 Sep 2023 12:39:14 +0300 Subject: [PATCH] in readability, center images and add max-width. --- plugins/readability/readability.c | 2 +- plugins/readability/readability.h | 2 +- plugins/readability/readability.js | 22 ++++++++++++++-------- rose | Bin 43280 -> 43280 bytes 4 files changed, 16 insertions(+), 10 deletions(-) diff --git a/plugins/readability/readability.c b/plugins/readability/readability.c index 327f212..894b9b4 100644 --- a/plugins/readability/readability.c +++ b/plugins/readability/readability.c @@ -1,7 +1,7 @@ #include #include #include -#define READABILITY_N 85314 + 1000 +#define READABILITY_N 85433 + 1000 void read_readability_js(char* string) { diff --git a/plugins/readability/readability.h b/plugins/readability/readability.h index 4139213..a292e0a 100644 --- a/plugins/readability/readability.h +++ b/plugins/readability/readability.h @@ -1,7 +1,7 @@ #ifndef READABILITY #define READABILITY -#define READABILITY_N 85314 + 1000 +#define READABILITY_N 85433 + 1000 void read_readability_js(char* string); diff --git a/plugins/readability/readability.js b/plugins/readability/readability.js index 9310961..0a5bda7 100644 --- a/plugins/readability/readability.js +++ b/plugins/readability/readability.js @@ -2377,10 +2377,18 @@ document.body.innerHTML = `

${article.title}

\n${article.content}` /* Hack for archive.is */ -var styles +var styles = ` +img { + max-width: 80% !important; + height: auto; + display: block; + margin-left: auto; + margin-right: auto; +} +` if (document.domain == "archive.is" ){ - styles = ` + styles+= ` li > span { display: none !important; @@ -2400,9 +2408,7 @@ if (document.domain == "archive.is" ){ ` } -if(styles != null){ - var styleSheet = document.createElement('style') - styleSheet.innerText = styles - document.head.appendChild(styleSheet) - console.log('Style changed') -} +var styleSheet = document.createElement('style') +styleSheet.innerText = styles +document.head.appendChild(styleSheet) +console.log('Style changed') diff --git a/rose b/rose index 83810a0472869f41ce91fddeb85803d18f02ab0c..1b778adabda2a8adb08357d191ccf303645bbfe3 100755 GIT binary patch delta 304 zcmbPmiD|+mrVSa)B5SXHo*lWizb(G|_Fnt!lQ)B|f701p!>s9FUtj6b`Td3A)BpcH zI*-5j`5Z|1ntl{yVA#*dz`)?qdC0T#h~a@34M2%z+e%vo2KKsokIwfm?t^u_?>zQ` z^~wMLu7(E;Pa0kV8UfT@BFw<>;ygrtAIOv!LeGH4HXq?IJP_*`bC_Sg1tfB*k~J!f-juog4pqRkV+9&oXhQ639P})2rk&Rn|sf3G9!kJINiI2mRI|t5o-@Gknf-t+0rh=uOiQeRijl!D~8a8ME E0CRSYEC2ui delta 325 zcmbPmiD|+mrVSa)B2}@fM{ey5=5Dh5XcHti{~nvO!r{#|%$ol7b(S8T*Ix)e`~Tmg z^L^*B7v@j?|93S!V0hB-l1Jxpk6zPd!VC;A7(w#QM>t{~V-BbB%eOFqfJf)|7e9c? zf$Clycn+j{O?L<~Fzjap%N_FUJYsm@g*#B9+1A09fq}iw4QR!SWlv#Noq7EKzaxrW z)*!p4K@{u*8S~;Mhy%3P@Bqkae)$HVAcIfmGmuHOfB*k~eRXqcuog3;_T~v;54hwr zi}f=~N(zdt^!3Zj%k`3S^7C_(Qj5~{lJj$c8aMYR@^ed+a`8zx@(DQcad>evWdk|R eV2;P;Z8;N!*$p)nEcHzECQob>-ki{|K?4A;MvkWd