summaryrefslogtreecommitdiff
path: root/js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2012-12-23 14:52:18 +0400
committerAndrew Dolgov <[email protected]>2012-12-23 14:52:18 +0400
commit19c7350770788edf3ae0bb1fd6d95876667adbf6 (patch)
treee539d53acd796375d7feba1efd66d3850fd14db1 /js
parent83e6e313be6de7d6e3f155a13c821ab82da12575 (diff)
experimental new plugin system
Diffstat (limited to 'js')
-rw-r--r--js/mail_button.js61
-rw-r--r--js/note_button.js51
-rw-r--r--js/share_button.js21
-rw-r--r--js/tweet_button.js31
4 files changed, 0 insertions, 164 deletions
diff --git a/js/mail_button.js b/js/mail_button.js
deleted file mode 100644
index 0fcb0d80f..000000000
--- a/js/mail_button.js
+++ /dev/null
@@ -1,61 +0,0 @@
-function emailArticle(id) {
- try {
- if (!id) {
- var ids = getSelectedArticleIds2();
-
- if (ids.length == 0) {
- alert(__("No articles are selected."));
- return;
- }
-
- id = ids.toString();
- }
-
- if (dijit.byId("emailArticleDlg"))
- dijit.byId("emailArticleDlg").destroyRecursive();
-
- var query = "backend.php?op=rpc&method=buttonPlugin&plugin=mail&plugin_method=emailArticle&param=" + param_escape(id);
-
- dialog = new dijit.Dialog({
- id: "emailArticleDlg",
- title: __("Forward article by email"),
- style: "width: 600px",
- execute: function() {
- if (this.validate()) {
-
- new Ajax.Request("backend.php", {
- parameters: dojo.objectToQuery(this.attr('value')),
- onComplete: function(transport) {
-
- var reply = JSON.parse(transport.responseText);
-
- var error = reply['error'];
-
- if (error) {
- alert(__('Error sending email:') + ' ' + error);
- } else {
- notify_info('Your message has been sent.');
- dialog.hide();
- }
-
- } });
- }
- },
- href: query});
-
- var tmph = dojo.connect(dialog, 'onLoad', function() {
- dojo.disconnect(tmph);
-
- new Ajax.Autocompleter('emailArticleDlg_destination', 'emailArticleDlg_dst_choices',
- "backend.php?op=rpc&method=buttonPlugin&plugin=mail&plugin_method=completeEmails",
- { tokens: '', paramName: "search" });
- });
-
- dialog.show();
-
- } catch (e) {
- exception_error("emailArticle", e);
- }
-}
-
-
diff --git a/js/note_button.js b/js/note_button.js
deleted file mode 100644
index c9347ab19..000000000
--- a/js/note_button.js
+++ /dev/null
@@ -1,51 +0,0 @@
-function editArticleNote(id) {
- try {
-
- var query = "backend.php?op=rpc&method=buttonPlugin&plugin=note&plugin_method=edit&param=" + param_escape(id);
-
- if (dijit.byId("editNoteDlg"))
- dijit.byId("editNoteDlg").destroyRecursive();
-
- dialog = new dijit.Dialog({
- id: "editNoteDlg",
- title: __("Edit article note"),
- style: "width: 600px",
- execute: function() {
- if (this.validate()) {
- var query = dojo.objectToQuery(this.attr('value'));
-
- notify_progress("Saving article note...", true);
-
- new Ajax.Request("backend.php", {
- parameters: query,
- onComplete: function(transport) {
- notify('');
- dialog.hide();
-
- var reply = JSON.parse(transport.responseText);
-
- cache_delete("article:" + id);
-
- var elem = $("POSTNOTE-" + id);
-
- if (elem) {
- Element.hide(elem);
- elem.innerHTML = reply.note;
-
- if (reply.raw_length != 0)
- new Effect.Appear(elem);
- }
-
- }});
- }
- },
- href: query,
- });
-
- dialog.show();
-
- } catch (e) {
- exception_error("editArticleNote", e);
- }
-}
-
diff --git a/js/share_button.js b/js/share_button.js
deleted file mode 100644
index 7645940e7..000000000
--- a/js/share_button.js
+++ /dev/null
@@ -1,21 +0,0 @@
-function shareArticle(id) {
- try {
- if (dijit.byId("shareArticleDlg"))
- dijit.byId("shareArticleDlg").destroyRecursive();
-
- var query = "backend.php?op=rpc&method=buttonPlugin&plugin=share&plugin_method=shareArticle&param=" + param_escape(id);
-
- dialog = new dijit.Dialog({
- id: "shareArticleDlg",
- title: __("Share article by URL"),
- style: "width: 600px",
- href: query});
-
- dialog.show();
-
- } catch (e) {
- exception_error("emailArticle", e);
- }
-}
-
-
diff --git a/js/tweet_button.js b/js/tweet_button.js
deleted file mode 100644
index d127010ac..000000000
--- a/js/tweet_button.js
+++ /dev/null
@@ -1,31 +0,0 @@
- function tweetArticle(id) {
- try {
- var query = "?op=rpc&method=buttonPlugin&plugin=tweet&plugin_method=getTweetInfo&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);
- }
- }
-