diff options
| author | Andrew Dolgov <noreply@fakecake.org> | 2021-02-24 21:56:52 +0300 |
|---|---|---|
| committer | Andrew Dolgov <noreply@fakecake.org> | 2021-02-24 21:56:52 +0300 |
| commit | 93940d2a9f80d9e1dac49b5eb7db23230d31c5f6 (patch) | |
| tree | 71016661f6017918d0934eb462bd9552018d557a /plugins/af_readability/init.js | |
| parent | 8b022c2bfb356d7dddaf334bc931d6dec77086fb (diff) | |
| parent | 1adacd057230aea4ede29dab510385bf01cf99a3 (diff) | |
Merge branch 'master' of git.fakecake.org:fox/tt-rss into weblate-integration
Diffstat (limited to 'plugins/af_readability/init.js')
| -rw-r--r-- | plugins/af_readability/init.js | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/plugins/af_readability/init.js b/plugins/af_readability/init.js index 3155475cc..0232ed32d 100644 --- a/plugins/af_readability/init.js +++ b/plugins/af_readability/init.js @@ -1,9 +1,11 @@ +/* global xhr, App, Plugins, Article, Notify */ + Plugins.Af_Readability = { orig_attr_name: 'data-readability-orig-content', self: this, embed: function(id) { - const content = $$(App.isCombinedMode() ? ".cdm[data-article-id=" + id + "] .content-inner" : - ".post[data-article-id=" + id + "] .content")[0]; + const content = App.find(App.isCombinedMode() ? `.cdm[data-article-id="${id}"] .content-inner` : + `.post[data-article-id="${id}"] .content`); if (content.hasAttribute(self.orig_attr_name)) { content.innerHTML = content.getAttribute(self.orig_attr_name); @@ -16,7 +18,7 @@ Plugins.Af_Readability = { Notify.progress("Loading, please wait..."); - xhrJson("backend.php",{ op: "pluginhandler", plugin: "af_readability", method: "embed", param: id }, (reply) => { + xhr.json("backend.php", App.getPhArgs("af_readability", "embed", {id: id}), (reply) => { if (content && reply.content) { content.setAttribute(self.orig_attr_name, content.innerHTML); |