From 372b96c895a44c55ab8523da82f2609f21ce4c14 Mon Sep 17 00:00:00 2001 From: Juraj Oravec Date: Thu, 20 Jun 2019 18:17:12 +0200 Subject: [PATCH] Rename placeholders Signed-off-by: Juraj Oravec --- readability/__init__.py | 20 ++++++++++---------- readability/data/Call.js | 6 +++--- readability/data/style.css | 16 ++++++++-------- 3 files changed, 21 insertions(+), 21 deletions(-) diff --git a/readability/__init__.py b/readability/__init__.py index 1593bd5..f797848 100644 --- a/readability/__init__.py +++ b/readability/__init__.py @@ -117,13 +117,13 @@ class Readability(Falkon.PluginInterface, QtCore.QObject): css = Falkon.QzTools.readAllFileContents( os.path.join(dataDir, "style.css") ).replace("\n", "") - css = css.replace("{1}", iconClose) - css = css.replace("{2}", iconCloseHover) - css = css.replace("{3}", iconDelete) - css = css.replace("{4}", iconPlus) - css = css.replace("{5}", iconMinus) - css = css.replace("{6}", iconArrow) - css = css.replace("{7}", iconControls) + css = css.replace("{iconClose}", iconClose) + css = css.replace("{iconCloseHover}", iconCloseHover) + css = css.replace("{iconDelete}", iconDelete) + css = css.replace("{iconPlus}", iconPlus) + css = css.replace("{iconMinus}", iconMinus) + css = css.replace("{iconArrow}", iconArrow) + css = css.replace("{iconControls}", iconControls) javascript = Falkon.QzTools.readAllFileContents( os.path.join(dataDir, "Readability.js") @@ -134,9 +134,9 @@ class Readability(Falkon.PluginInterface, QtCore.QObject): call = Falkon.QzTools.readAllFileContents( os.path.join(dataDir, "Call.js") ) - call = call.replace("{1}", javascript) - call = call.replace("{2}", toolbar) - call = call.replace("{3}", css) + call = call.replace("{readability.js}", javascript) + call = call.replace("{toolbar.js}", toolbar) + call = call.replace("{style.css}", css) self.view.page().runJavaScript(call) diff --git a/readability/data/Call.js b/readability/data/Call.js index fd9ea2e..d68b512 100644 --- a/readability/data/Call.js +++ b/readability/data/Call.js @@ -16,9 +16,9 @@ * along with this program. If not, see . * ============================================================ */ -{1} +{readability.js} -{2} +{toolbar.js} function callReadability(){ var article = new Readability(document).parse(); @@ -34,7 +34,7 @@ function readabilityHead(article){ head.appendChild(title); var css = document.createElement('style'); - css.innerHTML = '{3}'; + css.innerHTML = '{style.css}'; head.appendChild(css); var meta = document.createElement('meta'); diff --git a/readability/data/style.css b/readability/data/style.css index 30b098b..2c7ea6e 100644 --- a/readability/data/style.css +++ b/readability/data/style.css @@ -344,7 +344,7 @@ body.loaded { left: -16px; width: 24px; height: 24px; - background-image: url({6}); + background-image: url({iconArrow}); display: block; } @@ -480,7 +480,7 @@ body.loaded { } .remove-button { - background-image: url({3}); + background-image: url({iconDelete}); margin: 0 auto; border: 1px solid #c1c1c1; background-position: 10px 7px; @@ -494,35 +494,35 @@ body.loaded { /*======= Toolbar icons =======*/ .close-button { - background-image: url({1}); + background-image: url({iconClose}); height: 68px; background-position: center 8px; } .close-button:hover { - background-image: url({2}); + background-image: url({iconCloseHover}); background-color: #d94141; border-bottom: 1px solid #d94141; border-right: 1px solid #d94141; } .close-button:hover:active { - background-image: url({2}); + background-image: url({iconCloseHover}); background-color: #AE2325; border-bottom: 1px solid #AE2325; border-right: 1px solid #AE2325; } .style-button { - background-image: url({7}); + background-image: url({iconControls}); } .minus-button { - background-image: url({5}); + background-image: url({iconMinus}); } .plus-button { - background-image: url({4}); + background-image: url({iconPlus}); } @media print {