summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2018-12-13 09:54:41 +0300
committerAndrew Dolgov <[email protected]>2018-12-13 09:54:41 +0300
commite53959322b3a5d362346ceccf320a11b1e98a790 (patch)
treefff451983e482e4833a16dc67ae25a90197e5d3a /plugins
parentd53cdaf815c86bf66a5577f575f76831679ed4f2 (diff)
plugins/embed_original: move to attic repo
Diffstat (limited to 'plugins')
-rw-r--r--plugins/embed_original/button.pngbin1298 -> 0 bytes
-rw-r--r--plugins/embed_original/init.css13
-rw-r--r--plugins/embed_original/init.js56
-rw-r--r--plugins/embed_original/init.php59
4 files changed, 0 insertions, 128 deletions
diff --git a/plugins/embed_original/button.png b/plugins/embed_original/button.png
deleted file mode 100644
index e861201d5..000000000
--- a/plugins/embed_original/button.png
+++ /dev/null
Binary files 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 @@
-<?php
-class Embed_Original extends Plugin {
-
- /* @var PluginHost $host */
- private $host;
-
- function init($host) {
- $this->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 = "<img src=\"plugins/embed_original/button.png\"
- class='tagsPic' style=\"cursor : pointer\"
- onclick=\"embedOriginalArticle($id)\"
- title='".__('Toggle embed original')."'>";
-
- 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