diff options
author | Andrew Dolgov <[email protected]> | 2013-03-21 23:29:06 +0400 |
---|---|---|
committer | Andrew Dolgov <[email protected]> | 2013-03-21 23:29:06 +0400 |
commit | 7fc2e87e17cb878406d29d050d25e3fee139591a (patch) | |
tree | b3f0981d2cbc62962802b4de5ae3aa886e6f0862 /js/viewfeed.js | |
parent | 3a693fa76f0cc6a38aa5642a08b48f58c29758bc (diff) |
add headline menu entry to show article url
Diffstat (limited to 'js/viewfeed.js')
-rw-r--r-- | js/viewfeed.js | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/js/viewfeed.js b/js/viewfeed.js index 5567c717a..35c9c12a7 100644 --- a/js/viewfeed.js +++ b/js/viewfeed.js @@ -1824,6 +1824,12 @@ function initHeadlinesMenu() { openArticleInNewWindow(this.getParent().callerRowId); }})); + menu.addChild(new dijit.MenuItem({ + label: __("Display article URL"), + onClick: function(event) { + displayArticleUrl(this.getParent().callerRowId); + }})); + menu.addChild(new dijit.MenuSeparator()); menu.addChild(new dijit.MenuItem({ @@ -2035,3 +2041,21 @@ function changeScore(id, pic) { exception_error("changeScore", e); } } + +function displayArticleUrl(id) { + try { + var query = "op=rpc&method=getlinkbyid&id=" + param_escape(id); + + new Ajax.Request("backend.php", { + parameters: query, + onComplete: function(transport) { + var reply = JSON.parse(transport.responseText); + + if (reply && reply.link) { + prompt(__("Article URL:"), reply.link); + } + } }); + } catch (e) { + exception_error("changeScore", e); + } +} |