shareable 0.0.2 → 0.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.md CHANGED
@@ -56,7 +56,7 @@ The helper method for each social link, is the site name joined with an undersco
56
56
  ```
57
57
 
58
58
  To override the default view for a button, place your own template file in the
59
- app/views/shareable/ directory and prepend your filename with an underscore.
59
+ app/views/shareable/ directory of your app and prepend your filename with an underscore.
60
60
 
61
61
  E.g.: facebook_button -> app/views/shareable/_facebook.html.erb
62
62
 
@@ -1,4 +1,18 @@
1
1
  <!--script src='http://platform.twitter.com/widgets.js' type='text/javascript'></script> -->
2
+ <%- if defined?(Turbolinks) %>
3
+ <%= output_once :twitter do %>
4
+ <script src="//platform.twitter.com/widgets.js"></script>
5
+ <% end %>
6
+ <% else -%>
7
+ <script>!function(d,s,id){
8
+ var js,fjs=d.getElementsByTagName(s)[0];
9
+ if(!d.getElementById(id)){
10
+ js=d.createElement(s);
11
+ js.id=id;js.src="//platform.twitter.com/widgets.js";
12
+ fjs.parentNode.insertBefore(js,fjs);}} (document,"script","twitter-wjs");
13
+ </script>
14
+ <% end -%>
15
+
2
16
  <a href='http://twitter.com/share'
3
17
  class='twitter-share-button'
4
18
  data-url='<%= options[:url] %>'
@@ -10,12 +24,4 @@
10
24
  data-counturl='<%= options[:counturl] %>'
11
25
  data-hashtags='<%= options[:hashtags] %>'
12
26
  data-size='<%= options[:size] %>'
13
- data-dnt='<%= options[:dnt] %>'>Tweet</a>
14
-
15
- <script>!function(d,s,id){
16
- var js,fjs=d.getElementsByTagName(s)[0];
17
- if(!d.getElementById(id)){
18
- js=d.createElement(s);
19
- js.id=id;js.src="//platform.twitter.com/widgets.js";
20
- fjs.parentNode.insertBefore(js,fjs);}} (document,"script","twitter-wjs");
21
- </script>
27
+ data-dnt='<%= options[:dnt] %>'>Tweet</a>
@@ -1,3 +1,3 @@
1
1
  module Shareable
2
- VERSION = "0.0.2"
2
+ VERSION = "0.0.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: shareable
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-03-24 00:00:00.000000000 Z
12
+ date: 2014-02-05 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport