diff options
| author | Julie Lala <jules@okfoc.us> | 2014-06-04 02:14:06 -0400 |
|---|---|---|
| committer | Julie Lala <jules@okfoc.us> | 2014-06-04 02:14:06 -0400 |
| commit | 9fee5d3d3e6bb98f364f03e2ee750203c49d01e9 (patch) | |
| tree | d574c886ea2aef6f3e1c182da847fc6c721325f4 /public/assets/javascripts/ui/share.js | |
| parent | 26d1b0f11818867501b08e77dde46f18c8c518fc (diff) | |
thinkin about where i wanna put all the ui code
Diffstat (limited to 'public/assets/javascripts/ui/share.js')
| -rw-r--r-- | public/assets/javascripts/ui/share.js | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/public/assets/javascripts/ui/share.js b/public/assets/javascripts/ui/share.js new file mode 100644 index 0000000..d31aa89 --- /dev/null +++ b/public/assets/javascripts/ui/share.js @@ -0,0 +1,25 @@ +var share = { + init: function(){ + share.bind() + }, + bind: function(){ + $("#facebook").click(share.facebook) + $("#twitter").click(share.twitter) + }, + url: "http://vvalls.com/", + facebook_msg: "", + twitter_msg: "", + openLink: function (url) { + window.open(url, "_blank"); + }, + facebook: function () { + var url = "https://www.facebook.com/share.php?u=" + encodeURIComponent(share.url) + "&t=" + encodeURIComponent(share.facebook_msg); + share.openLink(url); + return false; + }, + twitter: function () { + var url = "https://twitter.com/home?status=" + encodeURIComponent(share.url + " " + share.twitter_msg); + share.openLink(url); + return false; + } +} |
