diff options
author | Andrew Dolgov <[email protected]> | 2011-12-21 08:21:56 +0400 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2011-12-21 08:21:56 +0400 |
commit | 8e70d965a8e60aecd17073f71e9646bb0f6a4839 (patch) | |
tree | 37d013cd7d3934644ff647aa399fc2853be9ee69 /js/tweet_button.js | |
parent | f9ac31d6712b4400a616e49d6217d55edb0daf9c (diff) |
add missing files
Diffstat (limited to 'js/tweet_button.js')
-rw-r--r-- | js/tweet_button.js | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/js/tweet_button.js b/js/tweet_button.js new file mode 100644 index 000000000..d127010ac --- /dev/null +++ b/js/tweet_button.js @@ -0,0 +1,31 @@ + 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); + } + } + |