Permalink
Browse files

add Google+ share button

  • Loading branch information...
1 parent dd229ce commit 2af91c9cf66a225f405634249abb800addebb099 Jesse Young committed Feb 2, 2012
View
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
@@ -12,7 +12,6 @@ class Organization extends User
function set_defaults()
{
$this->set_design_setting('theme_name', "green");
- $this->set_design_setting('share_links', array('email','facebook','twitter'));
}
public function get_continue_setup_url()
View
@@ -18,6 +18,11 @@ function twitterShare()
openShare('https://twitter.com/home?status=' + encodeURIComponent(document.title + " - " + window.canonicalUrl),'twshare',726,436);
}
+function googlePlusShare()
+{
+ openShare('https://plusone.google.com/_/+1/confirm?url=' + encodeURIComponent(window.canonicalUrl), 'gshare', 500, 600);
+}
+
function emailShare(username)
{
openShare('/' + username + '/share?u=' + encodeURIComponent(window.canonicalUrl),'eshare',726,636);
@@ -1,9 +1,11 @@
<?php
return array(
- 'share:facebook' => "Share on Facebook",
- 'share:twitter' => "Share on Twitter",
- 'share:email' => "Share by email",
+ 'share:share' => "Share:",
+ 'share:facebook' => "Facebook",
+ 'share:twitter' => "Twitter",
+ 'share:googleplus' => "Google+",
+ 'share:email' => "Email",
'share:add_partners' => "Add partner organizations",
'share:add_users' => "Add Envaya users",
'share:browse_instructions' => "Click the organizations to share this page with:",
@@ -1,9 +1,11 @@
<?php
return array(
- 'share:facebook' => 'Sangira n\'abandi kuri facebook',
- 'share:twitter' => 'Sangira n\'abandi kuri Twitter',
- 'share:email' => 'Sangira n\'abandi kuri email',
+ 'share:share' => "Sangira n'abandi kuri:",
+ 'share:email' => 'Email',
+ 'share:facebook' => 'Facebook',
+ 'share:twitter' => 'Twitter',
+ 'share:googleplus' => 'Google+',
'share:add_partners' => 'Mwandike nk\'umufatanyabikorwa',
'share:add_users' => 'Andika abakoresha envaya',
'share:browse_instructions' => 'Kanda ibigo kugirango bisangire iyi paje na:',
@@ -1,9 +1,11 @@
<?php
return array(
- 'share:facebook' => "Sambaza kwenye Facebook",
- 'share:twitter' => "Sambaza kwenye Twitter",
- 'share:email' => "Sambaza kupitia email",
+ 'share:share' => "Sambaza:",
+ 'share:email' => "Barua pepe",
+ 'share:facebook' => "Facebook",
+ 'share:twitter' => "Twitter",
+ 'share:googleplus' => "Google+",
'share:add_partners' => "Ongeza mashirika ya ubia",
'share:email_label' => "Ingiza anwani za email ambazo unataka kusambaza ukurasa huu nazo:",
'share:subject_label' => "Mada ya ujumbe:",
@@ -844,15 +844,13 @@
text-align:center;
white-space:nowrap;
padding-top:8px;
+ font-size:10px;
}
.shareLinks a
{
- clear:both;
- text-align:right;
- font-size:10px;
- padding:3px 22px 3px 20px;
- background:url(/_media/images/share2.png) no-repeat right top;
+ padding:3px 18px 3px 22px;
+ background:url(/_media/images/share3.png) no-repeat right top;
}
ol ol
@@ -1,36 +1,33 @@
-<?php
- $share_links = @$vars['design']['share_links'];
-
- if (is_array($share_links) && sizeof($share_links) > 0)
- {
+<?php
+ if (isset($vars['design']))
+ {
echo view('js/share');
echo "<div class='shareLinks'>";
// no point in sharing a site that isn't publicly visible on facebook/twitter.
// but sharing by email is okay because emails are held until the org is approved
$onclick = $vars['site_approved'] ? 'ignoreDirty()' : 'alert('.json_encode(__('approval:waiting')).'); return false';
-
- if (in_array('email', $share_links))
- {
- echo "<a style='background-position:right -5px;height:18px' rel='nofollow' href='javascript:emailShare("
- .json_encode($vars['site_username']).")' onclick='ignoreDirty()'>";
- echo __('share:email');
- echo "</a>";
- }
- if (in_array('facebook', $share_links))
- {
- echo "<a style='background-position:right -36px' rel='nofollow' href='javascript:fbShare()' onclick='$onclick'>";
- echo __('share:facebook');
- echo "</a>";
- }
+ echo "<span style='font-weight:bold'>";
+ echo __('share:share');
+ echo "</span> &nbsp;&nbsp;&nbsp; ";
- if (in_array('twitter', $share_links))
- {
- echo "<a style='background-position:right -65px' rel='nofollow' href='javascript:twitterShare()' onclick='$onclick'>";
- echo __('share:twitter');
- echo "</a>";
- }
+ echo "<a style='background-position:left -5px;height:18px' rel='nofollow' href='javascript:emailShare("
+ .json_encode($vars['site_username']).")' onclick='ignoreDirty()'>";
+ echo __('share:email');
+ echo "</a>";
+
+ echo "<a style='background-position:left -36px' rel='nofollow' href='javascript:fbShare()' onclick='$onclick'>";
+ echo __('share:facebook');
+ echo "</a>";
+
+ echo "<a style='background-position:left -65px' rel='nofollow' href='javascript:twitterShare()' onclick='$onclick'>";
+ echo __('share:twitter');
+ echo "</a>";
+
+ echo "<a style='background-position:left -95px;padding-left:28px' rel='nofollow' href='javascript:googlePlusShare()' onclick='$onclick'>";
+ echo __('share:googleplus');
+ echo "</a>";
echo "</div>";
- }
+ }

0 comments on commit 2af91c9

Please sign in to comment.