Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

using addthis for sharing.

  • Loading branch information...
commit 1d4662298f4406c75b303cb182543f8ea83628a6 1 parent d5ed83b
@jarmo authored
Showing with 13 additions and 38 deletions.
  1. +0 −33 public/script.js
  2. +13 −5 views/index.haml
View
33 public/script.js
@@ -44,10 +44,6 @@ $(function() {
History.replaceState(null, "Hacker Says - quote by " + slide.find("cite").text(), slide.data("id"));
_gaq.push(['_trackPageview']);
- renderTwitterButton();
- renderFacebookButton();
- renderGooglePlusButton();
-
if (total - index == 5) loadNewQuotes();
clearTimeout(readingTimer);
readingTimer = setTimeout(function() {
@@ -85,34 +81,5 @@ $(function() {
return time * 1000;
}
- function renderTwitterButton() {
- var btn = '<a href="https://twitter.com/share" class="twitter-share-button" data-text="I like this quote at programming-quotes.com" data-hashtags="programming" data-url="' + window.location.href + '">Tweet</a>';
- $("#tweet-button").html(btn);
-
- if (typeof twttr == 'undefined')
- $.getScript("//platform.twitter.com/widgets.js", load)
- else
- load()
-
- function load() { twttr.widgets.load() }
- }
-
- function renderFacebookButton() {
- var btn = '<div class="fb-like" data-send="false" data-layout="button_count" data-width="70" data-show-faces="false" data-font="arial"></div>';
- $("#fb-button").html(btn);
- if (typeof FB == 'undefined')
- $.getScript("//connect.facebook.net/en_US/all.js#xfbml=1", parse)
- else
- parse()
-
- function parse() { FB.XFBML.parse() }
- }
-
- function renderGooglePlusButton() {
- var btn = '<div class="g-plusone" data-size="small" data-href="' + window.location.href + '"></div>';
- $("#gplus-button").html(btn);
- gapi.plusone.go();
- }
-
});
View
18 views/index.haml
@@ -20,8 +20,6 @@
%p
%span {{{c}}}
%cite {{a}}
- %script(type="text/javascript" src="https://apis.google.com/js/plusone.js")
- {parsetags: 'explicit'}
:javascript
var _gaq = _gaq || [];
_gaq.push(['_setAccount', 'UA-12994604-4']);
@@ -33,6 +31,12 @@
ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
})();
+ :javascript
+ var addthis_config = {
+ data_ga_property: _gaq[0][1],
+ data_ga_social: true
+ };
+ %script(type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=ra-4fb7bd6e61eecb7a")
%body(data-theme="sepia")
#header
@@ -71,6 +75,10 @@
%a.pause(href="#") pause
%a.resume(href="#") resume
#share
- .button#tweet-button
- .button#fb-button
- .button#gplus-button
+ .addthis_toolbox.addthis_default_style
+ %a.addthis_button_preferred_1
+ %a.addthis_button_preferred_2
+ %a.addthis_button_preferred_3
+ %a.addthis_button_preferred_4
+ %a.addthis_button_compact
+ %a.addthis_counter.addthis_bubble_style
Please sign in to comment.
Something went wrong with that request. Please try again.