diff --git a/plugins/embed_original/button.png b/plugins/embed_original/button.png deleted file mode 100644 index e861201d5..000000000 Binary files a/plugins/embed_original/button.png and /dev/null differ diff --git a/plugins/embed_original/init.css b/plugins/embed_original/init.css deleted file mode 100644 index 5fb7e012e..000000000 --- a/plugins/embed_original/init.css +++ /dev/null @@ -1,13 +0,0 @@ -div.cdmContentInner iframe.embeddedContent { - overflow : auto; - width : 100%; - height : 600px; - border-width : 0px; -} - -div.postContent iframe.embeddedContent { - overflow : auto; - width : 100%; - height : 100%; - border-width : 0px; -} diff --git a/plugins/embed_original/init.js b/plugins/embed_original/init.js deleted file mode 100644 index 1e9fcb253..000000000 --- a/plugins/embed_original/init.js +++ /dev/null @@ -1,56 +0,0 @@ -function embedOriginalArticle(id) { - const hasSandbox = "sandbox" in document.createElement("iframe"); - - if (!hasSandbox) { - alert(__("Sorry, your browser does not support sandboxed iframes.")); - return; - } - - let c = false; - - if (App.isCombinedMode()) { - c = $$("div#RROW-" + id + " div[class=content-inner]")[0]; - } else if (id == Article.getActive()) { - c = $$(".post .content")[0]; - } - - if (c) { - const iframe = c.parentNode.getElementsByClassName("embeddedContent")[0]; - - if (iframe) { - Element.show(c); - c.parentNode.removeChild(iframe); - - if (App.isCombinedMode()) { - Article.cdmScrollToId(id, true); - } - - return; - } - } - - const query = { op: "pluginhandler", plugin: "embed_original", method: "getUrl", id: id }; - - xhrJson("backend.php", query, (reply) => { - if (reply) { - const iframe = new Element("iframe", { - class: "embeddedContent", - src: reply.url, - width: (c.parentNode.offsetWidth - 5) + 'px', - height: (c.parentNode.parentNode.offsetHeight - c.parentNode.firstChild.offsetHeight - 5) + 'px', - style: "overflow: auto; border: none; min-height: " + (document.body.clientHeight / 2) + "px;", - sandbox: 'allow-scripts', - }); - - if (c) { - Element.hide(c); - c.parentNode.insertBefore(iframe, c); - - if (App.isCombinedMode()) { - Article.cdmScrollToId(id, true); - } - } - } - }); - -} diff --git a/plugins/embed_original/init.php b/plugins/embed_original/init.php deleted file mode 100644 index 1925d141d..000000000 --- a/plugins/embed_original/init.php +++ /dev/null @@ -1,59 +0,0 @@ -host = $host; - - $host->add_hook($host::HOOK_ARTICLE_BUTTON, $this); - } - - function about() { - return array(1.0, - "Try to display original article content inside tt-rss", - "fox"); - } - - function get_js() { - return file_get_contents(dirname(__FILE__) . "/init.js"); - } - - function get_css() { - return file_get_contents(dirname(__FILE__) . "/init.css"); - } - - function hook_article_button($line) { - $id = $line["id"]; - - $rv = ""; - - return $rv; - } - - function getUrl() { - $id = $_REQUEST['id']; - - $sth = $this->pdo->prepare("SELECT link - FROM ttrss_entries, ttrss_user_entries - WHERE id = ? AND ref_id = id AND owner_uid = ?"); - $sth->execute([$id, $_SESSION['uid']]); - - if ($row = $sth->fetch()) { - $url = $row['link']; - } else { - $url = ""; - } - - print json_encode(array("url" => $url, "id" => $id)); - } - - function api_version() { - return 2; - } - -} \ No newline at end of file