summaryrefslogtreecommitdiff
path: root/plugins/af_readability/init.js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2022-12-13 20:08:43 +0300
committerAndrew Dolgov <[email protected]>2022-12-13 20:08:43 +0300
commit8ea537123d1cef38f25f9fbe92e3a9c0f89de55a (patch)
tree0b40ea733af15c1f33403e42afc8afa14d48b87c /plugins/af_readability/init.js
parent313f12ae9306fc62bbbfa10310a2feb20aa274c5 (diff)
move af_readability out of master tree
Diffstat (limited to 'plugins/af_readability/init.js')
-rw-r--r--plugins/af_readability/init.js35
1 files changed, 0 insertions, 35 deletions
diff --git a/plugins/af_readability/init.js b/plugins/af_readability/init.js
deleted file mode 100644
index 0232ed32d..000000000
--- a/plugins/af_readability/init.js
+++ /dev/null
@@ -1,35 +0,0 @@
-/* global xhr, App, Plugins, Article, Notify */
-
-Plugins.Af_Readability = {
- orig_attr_name: 'data-readability-orig-content',
- self: this,
- embed: function(id) {
- 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);
- content.removeAttribute(self.orig_attr_name);
-
- if (App.isCombinedMode()) Article.cdmMoveToId(id);
-
- return;
- }
-
- Notify.progress("Loading, please wait...");
-
- xhr.json("backend.php", App.getPhArgs("af_readability", "embed", {id: id}), (reply) => {
-
- if (content && reply.content) {
- content.setAttribute(self.orig_attr_name, content.innerHTML);
- content.innerHTML = reply.content;
- Notify.close();
-
- if (App.isCombinedMode()) Article.cdmMoveToId(id);
-
- } else {
- Notify.error("Unable to fetch full text for this article");
- }
- });
- }
-};