From ff176878e36f9bb83e7deea23839ee1e39549bc0 Mon Sep 17 00:00:00 2001
From: Owen Leonard <oleonard@myacpl.org>
Date: Wed, 16 May 2012 15:30:01 -0400
Subject: [PATCH 1/1] Bug 7932 - twitter share doesn't work with
socialnetworks
The only way I can get this to work consistently is to use
Twitter's own code as documented here:
https://dev.twitter.com/docs/tweet-button
This requires that we use the tweet button generated by Twitter
rather than the smaller image we were using before. Using the
documented options for generating a custom button produced the
same inconsistent behavior this patch attempts to fix.
Because of the change of appearance I moved the Twitter button
to last in line so that similarly-sized buttons were grouped. I
also changed the configuration of the Google+ button to exclude
the count, saving some horizontal space.
This fix will have to be manually merged with the social
networks followup for Bug 7500 (image sprites) if and when that
patch is approved.
Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
---
koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt
index 2ab8f80..b827612 100644
--- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt
+++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-detail.tt
@@ -8,6 +8,7 @@
<script type="text/javascript" src="https://apis.google.com/js/plusone.js">
{lang: '[% lang %]'}
</script>
+ <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src="//platform.twitter.com/widgets.js";fjs.parentNode.insertBefore(js,fjs);}}(document,"script","twitter-wjs");</script>
[% END %]
<script type="text/javascript" src="/opac-tmpl/prog/en/lib/jquery/plugins/jquery.rating.js"></script>
<link rel="stylesheet" type="text/css" href="/opac-tmpl/prog/en/css/jquery.rating.css" />
@@ -1209,7 +1210,7 @@ YAHOO.util.Event.onContentReady("furtherm", function () {
<div id="social_networks">
<span>Share</span>
<div><a id="facebook" href="http://www.facebook.com/sharer.php?u=[% current_url |url %]&t=[% title |url %]" title="Share on Facebook">Facebook</a></div>
- <div><a id="twitter" href="http://twitter.com/share" title="Share on Twitter">Twitter</a></div>
+ <div><a id="twitter" href="https://twitter.com/share" class="twitter-share-button" data-count="none" data-text="[% title %]" data-url="https://[% current_url %]" data-lang="[% en %]">Tweet</a></div>
<div><a id="linkedin" href="http://www.linkedin.com/shareArticle?mini=true&url=[% current_url |url %]&title=[% title |url %]" title="Share on LinkedIn">LinkedIn</a></div>
<div><a id="delicious" href="http://www.delicious.com/save?url=[% current_url |url %]&title=[% title |url %]" title="Share on Delicious">Delicious</a></div>
<div><a id="email" href="mailto:ADRESSE?subject=TO READ : [% title %]>&body=[% title %]> [% current_url |url %]" title="Share by email">Email</a></div>
--
1.7.7.3