summaryrefslogtreecommitdiff
path: root/public/assets/javascripts/ui/reader/ShareView.js
blob: 35c23ca9b546dcc09a0a7fd0483a1c059742d180 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
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")
	}

})