diff --git a/app/assets/javascripts/discourse/controllers/share_controller.js b/app/assets/javascripts/discourse/controllers/share_controller.js
index 93811b37e55..6dedc2e04ec 100644
--- a/app/assets/javascripts/discourse/controllers/share_controller.js
+++ b/app/assets/javascripts/discourse/controllers/share_controller.js
@@ -27,6 +27,17 @@ Discourse.ShareController = Discourse.Controller.extend({
close: function() {
this.set('link', '');
return false;
+ },
+
+ popupHeights: {
+ twitter: 265,
+ facebook: 315,
+ googlePlus: 600
+ },
+
+ sharePopup: function(target, url) {
+ window.open(url, '', 'menubar=no,toolbar=no,resizable=yes,scrollbars=yes,width=600,height=' + this.popupHeights[target]);
+ return false;
}
});
diff --git a/app/assets/javascripts/discourse/templates/share.js.handlebars b/app/assets/javascripts/discourse/templates/share.js.handlebars
index 914538db04b..dedd3be98b6 100644
--- a/app/assets/javascripts/discourse/templates/share.js.handlebars
+++ b/app/assets/javascripts/discourse/templates/share.js.handlebars
@@ -1,5 +1,14 @@
{{view.title}}
-
-
{{i18n share.close}}
+
+
+
+
diff --git a/app/assets/javascripts/discourse/views/share_view.js b/app/assets/javascripts/discourse/views/share_view.js
index 4f296c2e08e..30c5ea4f285 100644
--- a/app/assets/javascripts/discourse/views/share_view.js
+++ b/app/assets/javascripts/discourse/views/share_view.js
@@ -27,6 +27,18 @@ Discourse.ShareView = Discourse.View.extend({
}
}).observes('controller.link'),
+ facebookUrl: function() {
+ return ("http://www.facebook.com/sharer.php?u=" + this.get('controller.link'));
+ }.property('controller.link'),
+
+ twitterUrl: function() {
+ return ("http://twitter.com/home?status=" + this.get('controller.link'));
+ }.property('controller.link'),
+
+ googlePlusUrl: function() {
+ return ("https://plus.google.com/share?url=" + this.get('controller.link'));
+ }.property('controller.link'),
+
didInsertElement: function() {
var _this = this;
$('html').on('click.outside-share-link', function(e) {
diff --git a/app/assets/stylesheets/application/share_link.css.scss b/app/assets/stylesheets/application/share_link.css.scss
index c70e2241c77..d28815745c1 100644
--- a/app/assets/stylesheets/application/share_link.css.scss
+++ b/app/assets/stylesheets/application/share_link.css.scss
@@ -10,7 +10,7 @@
@include border-radius-all(3px);
@include box-shadow(1px 1px 5px $darkish_gray);
background-color: $light_gray;
- padding: 3px 7px 3px 7px;
+ padding: 3px 7px 5px 7px;
width: 300px;
@include fades-in(0.25s);
&.visible {
@@ -22,9 +22,14 @@
h3 {
font-size: 13px;
}
+ .social-link {
+ margin-left: 2px;
+ margin-right: 8px;
+ float: left;
+ font-size: 18px;
+ }
.link {
- display: block;
margin-right: 2px;
- text-align: right;
+ float: right;
}
}