]> git.wh0rd.org Git - tt-rss.git/commitdiff
split several social plugins from trunk to separate optional downloads (see forum)
authorAndrew Dolgov <fox@madoka.volgo-balt.ru>
Wed, 27 Mar 2013 11:18:38 +0000 (15:18 +0400)
committerAndrew Dolgov <fox@madoka.volgo-balt.ru>
Wed, 27 Mar 2013 11:18:38 +0000 (15:18 +0400)
20 files changed:
plugins/flattr/flattr.png [deleted file]
plugins/flattr/init.php [deleted file]
plugins/googleplus/googleplus.js [deleted file]
plugins/googleplus/googleplus.png [deleted file]
plugins/googleplus/init.php [deleted file]
plugins/identica/identica.js [deleted file]
plugins/identica/identica.png [deleted file]
plugins/identica/init.php [deleted file]
plugins/owncloud/init.php [deleted file]
plugins/owncloud/owncloud.js [deleted file]
plugins/owncloud/owncloud.png [deleted file]
plugins/pinterest/init.php [deleted file]
plugins/pinterest/pinterest.js [deleted file]
plugins/pinterest/pinterest.png [deleted file]
plugins/pocket/init.php [deleted file]
plugins/pocket/pocket.js [deleted file]
plugins/pocket/pocket.png [deleted file]
plugins/tweet/init.php [deleted file]
plugins/tweet/tweet.js [deleted file]
plugins/tweet/tweet.png [deleted file]

diff --git a/plugins/flattr/flattr.png b/plugins/flattr/flattr.png
deleted file mode 100644 (file)
index 4933ffc..0000000
Binary files a/plugins/flattr/flattr.png and /dev/null differ
diff --git a/plugins/flattr/init.php b/plugins/flattr/init.php
deleted file mode 100644 (file)
index b910198..0000000
+++ /dev/null
@@ -1,46 +0,0 @@
-<?php
-class Flattr extends Plugin {
-       private $link;
-       private $host;
-
-       function init($host) {
-               $this->link = $host->get_link();
-               $this->host = $host;
-
-               $host->add_hook($host::HOOK_ARTICLE_BUTTON, $this);
-       }
-
-       function about() {
-               return array(1.1,
-                       "Share articles on Flattr (if they exist in their catalogue)",
-                       "F. Eitel, N. Honing");
-       }
-
-  function hook_article_button($line) {
-
-    $rv = "";
-    $article_link = $line['link'];
-
-    if ($article_link) {
-        $encoded = urlencode($article_link);
-        $r = file_get_contents("https://api.flattr.com/rest/v2/things/lookup/?url=$encoded");
-        $response = json_decode($r, true);
-        $image = "<img src=\"plugins/flattr/flattr.png\"
-                       class='tagsPic' style=\"cursor : pointer\"
-                       title='".__('Flattr this article.')."'>";
-        // if Flattr has it in the catalogue, we display the button
-        if ($response and array_key_exists('link', $response)) {
-            $rv = "<a id='flattr' target='_blank' href='" . $response['link'] . "'> . $image . </a>";
-        } else {
-            // We can't submit a thing to the catalogue without giving a Flattr user id (who would be the owner)
-            // see http://developers.flattr.net/auto-submit
-            //$rv = "<a id='flattr' href='https://flattr.com/submit/auto?url=" . $encoded  . "'>" . $image . "</a>";
-            $rv = '';
-            // Another useful thing would be any rel=payment link (which would have the user id as well),
-            // but tt-rss is not checking that (yet), I believe. See http://developers.flattr.net/feed
-        }
-    }
-    return $rv;
-  }
-}
-?>
diff --git a/plugins/googleplus/googleplus.js b/plugins/googleplus/googleplus.js
deleted file mode 100644 (file)
index 027d9b4..0000000
+++ /dev/null
@@ -1,29 +0,0 @@
-       function shareArticleToGooglePlus(id) {
-       try {
-               var query = "?op=pluginhandler&plugin=googleplus&method=getInfo&id=" + param_escape(id);
-
-               console.log(query);
-
-               var d = new Date();
-      var ts = d.getTime();
-
-               var w = window.open('backend.php?op=backend&method=loading', 'ttrss_tweet',
-                       "status=0,toolbar=0,location=0,width=500,height=450,scrollbars=1,menubar=0");
-
-               new Ajax.Request("backend.php", {
-                       parameters: query,
-                       onComplete: function(transport) {
-                               var ti = JSON.parse(transport.responseText);
-
-                               var share_url = "https://plus.google.com/share?url=" + param_escape(ti.link);
-
-                               w.location.href = share_url;
-
-                       } });
-
-
-       } catch (e) {
-               exception_error("tweetArticle", e);
-       }
-       }
-
diff --git a/plugins/googleplus/googleplus.png b/plugins/googleplus/googleplus.png
deleted file mode 100644 (file)
index ac46126..0000000
Binary files a/plugins/googleplus/googleplus.png and /dev/null differ
diff --git a/plugins/googleplus/init.php b/plugins/googleplus/init.php
deleted file mode 100644 (file)
index 6045d2d..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-<?php
-class GooglePlus extends Plugin {
-       private $link;
-       private $host;
-
-       function init($host) {
-               $this->link = $host->get_link();
-               $this->host = $host;
-
-               $host->add_hook($host::HOOK_ARTICLE_BUTTON, $this);
-       }
-
-       function about() {
-               return array(1.0,
-                       "Share article on Google+",
-                       "homolibere");
-       }
-
-       function get_js() {
-               return file_get_contents(dirname(__FILE__) . "/googleplus.js");
-       }
-
-       function hook_article_button($line) {
-               $article_id = $line["id"];
-
-               $rv = "<img src=\"plugins/googleplus/googleplus.png\"
-                       class='tagsPic' style=\"cursor : pointer\"
-                       onclick=\"shareArticleToGooglePlus($article_id)\"
-                       title='".__('Share on Google+')."'>";
-
-               return $rv;
-       }
-
-       function getInfo() {
-               $id = db_escape_string($this->link, $_REQUEST['id']);
-
-               $result = db_query($this->link, "SELECT title, link
-                               FROM ttrss_entries, ttrss_user_entries
-                               WHERE id = '$id' AND ref_id = id AND owner_uid = " .$_SESSION['uid']);
-
-               if (db_num_rows($result) != 0) {
-                       $title = truncate_string(strip_tags(db_fetch_result($result, 0, 'title')),
-                               100, '...');
-                       $article_link = db_fetch_result($result, 0, 'link');
-               }
-
-               print json_encode(array("title" => $title, "link" => $article_link,
-                               "id" => $id));
-       }
-
-
-}
-?>
diff --git a/plugins/identica/identica.js b/plugins/identica/identica.js
deleted file mode 100644 (file)
index d31fc55..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-       function shareArticleToIdentica(id) {
-       try {
-               var query = "?op=pluginhandler&plugin=identica&method=getInfo&id=" + param_escape(id);
-
-               console.log(query);
-
-               var d = new Date();
-      var ts = d.getTime();
-
-               var w = window.open('backend.php?op=backend&method=loading', 'ttrss_tweet',
-                       "status=0,toolbar=0,location=0,width=600,height=500,scrollbars=1,menubar=0");
-
-               new Ajax.Request("backend.php", {
-                       parameters: query,
-                       onComplete: function(transport) {
-                               var ti = JSON.parse(transport.responseText);
-
-                               var share_url = "http://identi.ca/index.php?action=bookmarkpopup&_=" + ts +
-                                       "&title=" + param_escape(ti.title) +
-                                       "&url=" + param_escape(ti.link);
-
-                               w.location.href = share_url;
-
-                       } });
-
-
-       } catch (e) {
-               exception_error("shareArticleIdentica", e);
-       }
-       }
-
diff --git a/plugins/identica/identica.png b/plugins/identica/identica.png
deleted file mode 100644 (file)
index ee3cb61..0000000
Binary files a/plugins/identica/identica.png and /dev/null differ
diff --git a/plugins/identica/init.php b/plugins/identica/init.php
deleted file mode 100644 (file)
index 8e0ad4b..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-<?php
-class Identica extends Plugin {
-       private $link;
-       private $host;
-
-       function init($host) {
-               $this->link = $host->get_link();
-               $this->host = $host;
-
-               $host->add_hook($host::HOOK_ARTICLE_BUTTON, $this);
-       }
-
-       function about() {
-               return array(1.0,
-                       "Share articles on Identi.ca",
-                       "fox");
-       }
-
-       function get_js() {
-               return file_get_contents(dirname(__FILE__) . "/identica.js");
-       }
-
-       function hook_article_button($line) {
-               $article_id = $line["id"];
-
-               $rv = "<img src=\"plugins/identica/identica.png\"
-                       class='tagsPic' style=\"cursor : pointer\"
-                       onclick=\"shareArticleToIdentica($article_id)\"
-                       title='".__('Share on identi.ca')."'>";
-
-               return $rv;
-       }
-
-       function getInfo() {
-               $id = db_escape_string($this->link, $_REQUEST['id']);
-
-               $result = db_query($this->link, "SELECT title, link
-                               FROM ttrss_entries, ttrss_user_entries
-                               WHERE id = '$id' AND ref_id = id AND owner_uid = " .$_SESSION['uid']);
-
-               if (db_num_rows($result) != 0) {
-                       $title = truncate_string(strip_tags(db_fetch_result($result, 0, 'title')),
-                               100, '...');
-                       $article_link = db_fetch_result($result, 0, 'link');
-               }
-
-               print json_encode(array("title" => $title, "link" => $article_link,
-                               "id" => $id));
-       }
-
-
-}
-?>
diff --git a/plugins/owncloud/init.php b/plugins/owncloud/init.php
deleted file mode 100644 (file)
index 5d215b3..0000000
+++ /dev/null
@@ -1,96 +0,0 @@
-<?php
-require_once "config.php";
-
-class OwnCloud extends Plugin {
-  private $link;
-  private $host;
-
-  function about() {
-    return array(1.0,
-                "Adds support for OwnCloud ReadLater",
-                "cy8aer");
-  }
-
-  function init($host) {
-    $this->link = $host->get_link();
-    $this->host = $host;
-
-    $host->add_hook($host::HOOK_ARTICLE_BUTTON, $this);
-    $host->add_hook($host::HOOK_PREFS_TAB, $this);
-  }
-
-  function save() {
-    $owncloud_url = db_escape_string($this->link, $_POST["owncloud_url"]);
-    $this->host->set($this, "owncloud", $owncloud_url);
-    echo "Value set to $owncloud_url";
-  }
-
-  function get_js() {
-    return file_get_contents(dirname(__FILE__) . "/owncloud.js");
-  }
-
-  function hook_prefs_tab($args) {
-    if ($args != "prefPrefs") return;
-
-    print "<div dojoType=\"dijit.layout.AccordionPane\" title=\"".__("Owncloud")."\">";
-
-    print "<br/>";
-
-    $value = $this->host->get($this, "owncloud");
-    print "<form dojoType=\"dijit.form.Form\">";
-
-    print "<script type=\"dojo/method\" event=\"onSubmit\" args=\"evt\">
-           evt.preventDefault();
-           if (this.validate()) {
-               console.log(dojo.objectToQuery(this.getValues()));
-               new Ajax.Request('backend.php', {
-                                    parameters: dojo.objectToQuery(this.getValues()),
-                                    onComplete: function(transport) {
-                                         notify_info(transport.responseText);
-                                    }
-                                });
-           }
-           </script>";
-
-    print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"op\" value=\"pluginhandler\">";
-    print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"method\" value=\"save\">";
-    print "<input dojoType=\"dijit.form.TextBox\" style=\"display : none\" name=\"plugin\" value=\"owncloud\">";
-    print "<table width=\"100%\" class=\"prefPrefsList\">";
-        print "<tr><td width=\"40%\">".__("Owncloud url")."</td>";
-       print "<td class=\"prefValue\"><input dojoType=\"dijit.form.ValidationTextBox\" required=\"1\" name=\"owncloud_url\" regExp='^(http|https)://.*' value=\"$value\"></td></tr>";
-    print "</table>";
-    print "<p><button dojoType=\"dijit.form.Button\" type=\"submit\">".__("Save")."</button>";
-
-    print "</form>";
-
-    print "</div>"; #pane
-
-  }
-
-  function hook_article_button($line) {
-    return "<img src=\"plugins/owncloud/owncloud.png\"
-             style=\"cursor : pointer\" style=\"cursor : pointer\"
-             onclick=\"ownArticle(".$line["id"].")\"
-             class='tagsPic' title='".__('Bookmark on OwnCloud ')."'>";
-  }
-
-  function getOwnCloud() {
-    $id = db_escape_string($this->link, $_REQUEST['id']);
-
-    $result = db_query($this->link, "SELECT title, link
-                     FROM ttrss_entries, ttrss_user_entries
-                     WHERE id = '$id' AND ref_id = id AND owner_uid = " .$_SESSION['uid']);
-
-    if (db_num_rows($result) != 0) {
-      $title = truncate_string(strip_tags(db_fetch_result($result, 0, 'title')),
-                              100, '...');
-      $article_link = db_fetch_result($result, 0, 'link');
-    }
-
-    $own_url = $this->host->get($this, "owncloud");
-
-    print json_encode(array("title" => $title, "link" => $article_link,
-                           "id" => $id, "ownurl" => $own_url));
-  }
-}
-?>
diff --git a/plugins/owncloud/owncloud.js b/plugins/owncloud/owncloud.js
deleted file mode 100644 (file)
index df929e0..0000000
+++ /dev/null
@@ -1,27 +0,0 @@
-function ownArticle(id) {
-    try {
-       var query = "?op=pluginhandler&plugin=owncloud&method=getOwnCloud&id=" + param_escape(id);
-       
-       console.log(query);
-       
-       var d = new Date();
-       var ts = d.getTime();
-       
-       var w = window.open('backend.php?op=backend&method=loading', 'ttrss_tweet',
-                           "status=0,toolbar=0,location=0,width=600,height=500,scrollbars=1,menubar=0");
-       
-       new Ajax.Request("backend.php", {
-           parameters: query,
-           onComplete: function(transport) {
-               var ti = JSON.parse(transport.responseText);
-               
-               var share_url = ti.ownurl + "/apps/bookmarks/addBm.php?output=popup&url=" + param_escape(ti.link)
-                       + '&title=' +  ti.title;
-               
-               w.location.href = share_url;
-           } });
-    } catch (e) {
-       exception_error("ownArticle", e);
-    }
-}
-
diff --git a/plugins/owncloud/owncloud.png b/plugins/owncloud/owncloud.png
deleted file mode 100644 (file)
index d31ba92..0000000
Binary files a/plugins/owncloud/owncloud.png and /dev/null differ
diff --git a/plugins/pinterest/init.php b/plugins/pinterest/init.php
deleted file mode 100644 (file)
index 11fe64e..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-<?php
-class Pinterest extends Plugin {
-       private $link;
-       private $host;
-
-       function about() {
-               return array(1.0,
-                       "Share article on Pinterest",
-                       "?");
-       }
-
-       function init($host) {
-               $this->link = $host->get_link();
-               $this->host = $host;
-
-               $host->add_hook($host::HOOK_ARTICLE_BUTTON, $this);
-       }
-
-       function get_js() {
-               return file_get_contents(dirname(__FILE__) . "/pinterest.js");
-       }
-
-       function hook_article_button($line) {
-               $article_id = $line["id"];
-
-               $rv = "<img src=\"plugins/pinterest/pinterest.png\"
-                       class='tagsPic' style=\"cursor : pointer\"
-                       onclick=\"pinterest($article_id)\"
-                       title='".__('Pinterest')."'>";
-
-               return $rv;
-       }
-
-       function getInfo() {
-               $id = db_escape_string($this->link, $_REQUEST['id']);
-
-               $result = db_query($this->link, "SELECT title, link
-                               FROM ttrss_entries, ttrss_user_entries
-                               WHERE id = '$id' AND ref_id = id AND owner_uid = " .$_SESSION['uid']);
-
-               if (db_num_rows($result) != 0) {
-                       $title = truncate_string(strip_tags(db_fetch_result($result, 0, 'title')),
-                               100, '...');
-                       $article_link = db_fetch_result($result, 0, 'link');
-               }
-
-               print json_encode(array("title" => $title, "link" => $article_link,
-                               "id" => $id));
-       }
-
-
-}
-?>
diff --git a/plugins/pinterest/pinterest.js b/plugins/pinterest/pinterest.js
deleted file mode 100644 (file)
index 01c525f..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-       function pinterest(id) {
-       try {
-               var query = "?op=pluginhandler&plugin=pinterest&method=getInfo&id=" + param_escape(id);
-
-               console.log(query);
-
-               var d = new Date();
-      var ts = d.getTime();
-
-               var w = window.open('backend.php?op=backend&method=loading', 'ttrss_tweet',
-                       "status=0,toolbar=0,location=0,width=650,height=600,scrollbars=1,menubar=0");
-
-               new Ajax.Request("backend.php", {
-                       parameters: query,
-                       onComplete: function(transport) {
-                               var ti = JSON.parse(transport.responseText);
-
-                               var share_url = "http://pinterest.com/pin/create/button/?" +
-                                       "url=" + param_escape(ti.link) +
-                                       "&description=" + param_escape(ti.title);
-
-                               w.location.href = share_url;
-
-                       } });
-
-
-       } catch (e) {
-               exception_error("tweetArticle", e);
-       }
-       }
-
diff --git a/plugins/pinterest/pinterest.png b/plugins/pinterest/pinterest.png
deleted file mode 100644 (file)
index b85aed3..0000000
Binary files a/plugins/pinterest/pinterest.png and /dev/null differ
diff --git a/plugins/pocket/init.php b/plugins/pocket/init.php
deleted file mode 100644 (file)
index e96d080..0000000
+++ /dev/null
@@ -1,54 +0,0 @@
-<?php
-class Pocket extends Plugin {
-
-       private $link;
-       private $host;
-
-       function about() {
-               return array(1.0,
-                       "Share article on Pocket (formerly Read It Later)",
-                       "?");
-       }
-
-       function init($host) {
-               $this->link = $host->get_link();
-               $this->host = $host;
-
-               $host->add_hook($host::HOOK_ARTICLE_BUTTON, $this);
-       }
-
-       function get_js() {
-               return file_get_contents(dirname(__FILE__) . "/pocket.js");
-       }
-
-       function hook_article_button($line) {
-               $article_id = $line["id"];
-
-               $rv = "<img src=\"plugins/pocket/pocket.png\"
-                       class='tagsPic' style=\"cursor : pointer\"
-                       onclick=\"shareArticleToPocket($article_id)\"
-                       title='".__('Pocket')."'>";
-
-               return $rv;
-       }
-
-       function getInfo() {
-               $id = db_escape_string($this->link, $_REQUEST['id']);
-
-               $result = db_query($this->link, "SELECT title, link
-                               FROM ttrss_entries, ttrss_user_entries
-                               WHERE id = '$id' AND ref_id = id AND owner_uid = " .$_SESSION['uid']);
-
-               if (db_num_rows($result) != 0) {
-                       $title = truncate_string(strip_tags(db_fetch_result($result, 0, 'title')),
-                               100, '...');
-                       $article_link = db_fetch_result($result, 0, 'link');
-               }
-
-               print json_encode(array("title" => $title, "link" => $article_link,
-                               "id" => $id));
-       }
-
-
-}
-?>
diff --git a/plugins/pocket/pocket.js b/plugins/pocket/pocket.js
deleted file mode 100644 (file)
index 021d5bb..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-       function shareArticleToPocket(id) {
-       try {
-               var query = "?op=pluginhandler&plugin=pocket&method=getInfo&id=" + param_escape(id);
-
-               console.log(query);
-
-               var d = new Date();
-               var ts = d.getTime();
-
-               var w = window.open('backend.php?op=backend&method=loading', 'ttrss_tweet',
-                       "status=0,toolbar=0,location=0,width=500,height=400,scrollbars=1,menubar=0");
-
-               new Ajax.Request("backend.php", {
-                       parameters: query,
-                       onComplete: function(transport) {
-                               var ti = JSON.parse(transport.responseText);
-
-                               var share_url = "https://getpocket.com/save?" +
-                                       "&title=" + param_escape(ti.title) +
-                                       "&url=" + param_escape(ti.link);
-
-                               w.location.href = share_url;
-
-                       } });
-
-
-       } catch (e) {
-               exception_error("tweetArticle", e);
-       }
-       }
-
diff --git a/plugins/pocket/pocket.png b/plugins/pocket/pocket.png
deleted file mode 100644 (file)
index ff6bc85..0000000
Binary files a/plugins/pocket/pocket.png and /dev/null differ
diff --git a/plugins/tweet/init.php b/plugins/tweet/init.php
deleted file mode 100644 (file)
index bbcf783..0000000
+++ /dev/null
@@ -1,53 +0,0 @@
-<?php
-class Tweet extends Plugin {
-       private $link;
-       private $host;
-
-       function init($host) {
-               $this->link = $host->get_link();
-               $this->host = $host;
-
-               $host->add_hook($host::HOOK_ARTICLE_BUTTON, $this);
-       }
-
-       function about() {
-               return array(1.0,
-                       "Share article on Twitter",
-                       "fox");
-       }
-
-       function get_js() {
-               return file_get_contents(dirname(__FILE__) . "/tweet.js");
-       }
-
-       function hook_article_button($line) {
-               $article_id = $line["id"];
-
-               $rv = "<img src=\"plugins/tweet/tweet.png\"
-                       class='tagsPic' style=\"cursor : pointer\"
-                       onclick=\"tweetArticle($article_id)\"
-                       title='".__('Share on Twitter')."'>";
-
-               return $rv;
-       }
-
-       function getInfo() {
-               $id = db_escape_string($this->link, $_REQUEST['id']);
-
-               $result = db_query($this->link, "SELECT title, link
-                               FROM ttrss_entries, ttrss_user_entries
-                               WHERE id = '$id' AND ref_id = id AND owner_uid = " .$_SESSION['uid']);
-
-               if (db_num_rows($result) != 0) {
-                       $title = truncate_string(strip_tags(db_fetch_result($result, 0, 'title')),
-                               100, '...');
-                       $article_link = db_fetch_result($result, 0, 'link');
-               }
-
-               print json_encode(array("title" => $title, "link" => $article_link,
-                               "id" => $id));
-       }
-
-
-}
-?>
diff --git a/plugins/tweet/tweet.js b/plugins/tweet/tweet.js
deleted file mode 100644 (file)
index 07e89d5..0000000
+++ /dev/null
@@ -1,31 +0,0 @@
-       function tweetArticle(id) {
-       try {
-               var query = "?op=pluginhandler&plugin=tweet&method=getInfo&id=" + param_escape(id);
-
-               console.log(query);
-
-               var d = new Date();
-      var ts = d.getTime();
-
-               var w = window.open('backend.php?op=backend&method=loading', 'ttrss_tweet',
-                       "status=0,toolbar=0,location=0,width=500,height=400,scrollbars=1,menubar=0");
-
-               new Ajax.Request("backend.php", {
-                       parameters: query,
-                       onComplete: function(transport) {
-                               var ti = JSON.parse(transport.responseText);
-
-                               var share_url = "http://twitter.com/share?_=" + ts +
-                                       "&text=" + param_escape(ti.title) +
-                                       "&url=" + param_escape(ti.link);
-
-                               w.location.href = share_url;
-
-                       } });
-
-
-       } catch (e) {
-               exception_error("tweetArticle", e);
-       }
-       }
-
diff --git a/plugins/tweet/tweet.png b/plugins/tweet/tweet.png
deleted file mode 100644 (file)
index ad3c177..0000000
Binary files a/plugins/tweet/tweet.png and /dev/null differ