summaryrefslogtreecommitdiff
path: root/public/assets/javascripts/ui/reader/ShareView.js
diff options
context:
space:
mode:
authorJules Laplace <jules@okfoc.us>2014-10-30 18:00:09 -0400
committerJules Laplace <jules@okfoc.us>2014-10-30 18:00:09 -0400
commit72270af02efb9609482ea50e918fe6d2ca7785a2 (patch)
tree058880c7147b6e4927e2663082faa9a9b4638ba2 /public/assets/javascripts/ui/reader/ShareView.js
parent1efe4601867053e297e91e70388b48e90b12b61f (diff)
parent75f6a29f57f6147c83c8fb60bc5d36d8c6268f72 (diff)
merge
Diffstat (limited to 'public/assets/javascripts/ui/reader/ShareView.js')
-rw-r--r--public/assets/javascripts/ui/reader/ShareView.js27
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")
+ }
+
+})