diff options
| author | ryderr <r@okfoc.us> | 2014-10-29 13:36:03 -0400 |
|---|---|---|
| committer | ryderr <r@okfoc.us> | 2014-10-29 13:36:03 -0400 |
| commit | 2757e9b2d7d21228165fcdedd214ecb725fa43d7 (patch) | |
| tree | b5fa18d4ba7a2cd917d49b3c17bee5a30707e7ce /public/assets/javascripts/ui/reader/ShareView.js | |
| parent | 4e159d6b08512cd9a2370763ef296bd0111baf7f (diff) | |
| parent | 503c1eb313d01d3a73fac1e31b774749893b55d4 (diff) | |
Merge branch 'master' of github.com:okfocus/vvalls
Diffstat (limited to 'public/assets/javascripts/ui/reader/ShareView.js')
| -rw-r--r-- | public/assets/javascripts/ui/reader/ShareView.js | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/public/assets/javascripts/ui/reader/ShareView.js b/public/assets/javascripts/ui/reader/ShareView.js new file mode 100644 index 0000000..35c23ca --- /dev/null +++ b/public/assets/javascripts/ui/reader/ShareView.js @@ -0,0 +1,27 @@ +var ShareView = View.extend({ + el: ".share", + + events: { + "click #share_facebook": "facebook", + "click #share_twitter": "twitter", + }, + + initialize: function(opt){ + this.parent = opt.parent + }, + + facebook: function (e) { + e.preventDefault() + var msg = $(".roomName").html() + " on VValls" + var url = "https://www.facebook.com/share.php?u=" + encodeURIComponent(window.location.origin + window.location.pathname) + "&t=" + encodeURIComponent(msg); + window.open(url, "_blank") + }, + + twitter: function (e) { + e.preventDefault() + var msg = $(".roomName").html() + " on VValls" + var url = "https://twitter.com/home?status=" + encodeURIComponent(window.location.origin + window.location.pathname + " " + msg); + window.open(url, "_blank") + } + +}) |
