From e53959322b3a5d362346ceccf320a11b1e98a790 Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Thu, 13 Dec 2018 09:54:41 +0300 Subject: [PATCH] plugins/embed_original: move to attic repo --- plugins/embed_original/button.png | Bin 1298 -> 0 bytes plugins/embed_original/init.css | 13 ------- plugins/embed_original/init.js | 56 ---------------------------- plugins/embed_original/init.php | 59 ------------------------------ 4 files changed, 128 deletions(-) delete mode 100644 plugins/embed_original/button.png delete mode 100644 plugins/embed_original/init.css delete mode 100644 plugins/embed_original/init.js delete mode 100644 plugins/embed_original/init.php diff --git a/plugins/embed_original/button.png b/plugins/embed_original/button.png deleted file mode 100644 index e861201d52b06fde1df0e9886bccba8100bda615..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1298 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbKJOS+@4BLl<6zM9{GlYxANWRDM1WTXPEMT z6T|F;%L(K%$WAeFmr+d+=P3ps};un2_NGR&4c rAQI~^Q=tBX!{`1Sr`o^k8miforxdRA*}1C`ln^~#{an^LB{Ts5)M8fq 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