From 3b635c755788e7e29e9b1d43056d809916fcfe8d Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 27 Feb 2020 07:59:57 +0300 Subject: fix plugins/note javascript part broken by previous changeset --- plugins/af_readability/init.js | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 plugins/af_readability/init.js (limited to 'plugins/af_readability/init.js') diff --git a/plugins/af_readability/init.js b/plugins/af_readability/init.js new file mode 100644 index 000000000..fd603cbf1 --- /dev/null +++ b/plugins/af_readability/init.js @@ -0,0 +1,17 @@ +Plugins.Af_Readability = { + embed: function(id) { + Notify.progress("Loading, please wait..."); + + xhrJson("backend.php",{ op: "pluginhandler", plugin: "af_readability", method: "embed", param: id }, (reply) => { + const content = $$(App.isCombinedMode() ? ".cdm[data-article-id=" + id + "] .content-inner" : + ".post[data-article-id=" + id + "] .content")[0]; + + if (content && reply.content) { + content.innerHTML = reply.content; + Notify.close(); + } else { + Notify.error("Unable to fetch content for this article"); + } + }); + } +}; -- cgit v1.2.3-54-g00ecf