リビジョン | 2f211a919bc8f20e1e9f0e46e5660eb21b3a424a (tree) |
---|---|
日時 | 2015-10-23 08:38:24 |
作者 | ![]() |
コミッター | yasushiito |
t#:
@@ -1,4 +1,5 @@ | ||
1 | 1 | class Pettanr.View.Social extends Pettanr.View |
2 | + className: 'social' | |
2 | 3 | |
3 | 4 | constructor: (@item, @context, options) -> |
4 | 5 | super(options) |
@@ -14,21 +15,28 @@ class Pettanr.View.Social extends Pettanr.View | ||
14 | 15 | this.$el.append(@twitter.render().el) |
15 | 16 | this.$el.append(@facebook.render().el) |
16 | 17 | this.$el.append(@hatena.render().el) |
18 | + @append_rb() | |
17 | 19 | this |
18 | 20 | |
21 | + refresh: () -> | |
22 | + @facebook.refresh() | |
23 | + | |
19 | 24 | class Pettanr.View.Social.Twitter extends Pettanr.View |
25 | + className: 'social-button' | |
20 | 26 | |
21 | 27 | render: () -> |
22 | 28 | this.$el.html('') |
23 | - this.$el.append('<script type="text/javascript"src="http://platform.twitter.com/widgets.js"></script><a href="http://twitter.com/share" class="twitter-share-button"data-count="horizontal" data-via="opsatwit"data-lang="ja">Tweet</a>') | |
29 | + this.$el.append('<a href="http://twitter.com/share" class="twitter-share-button"data-count="horizontal" data-via="opsatwit"data-lang="ja">Tweet</a><script type="text/javascript"src="http://platform.twitter.com/widgets.js"></script>') | |
24 | 30 | this |
25 | 31 | |
26 | 32 | refresh: () -> |
27 | 33 | |
28 | 34 | class Pettanr.View.Social.Facebook extends Pettanr.View |
35 | + className: 'social-button' | |
29 | 36 | |
30 | 37 | render: () -> |
31 | 38 | this.$el.html('') |
39 | + this.$el.append('<div id="fb-root"></div>') | |
32 | 40 | this.$el.append('<div class="fb-like" data-href="' + window.location.href + '" data-layout="button_count" data-action="like" data-show-faces="true" data-share="false"></div>') |
33 | 41 | this |
34 | 42 |
@@ -36,10 +44,14 @@ class Pettanr.View.Social.Facebook extends Pettanr.View | ||
36 | 44 | FB.XFBML.parse() |
37 | 45 | |
38 | 46 | class Pettanr.View.Social.Hatena extends Pettanr.View |
47 | + className: 'social-button' | |
39 | 48 | |
40 | 49 | render: () -> |
41 | 50 | this.$el.html('') |
42 | - this.$el.append('<a href="http://b.hatena.ne.jp/entry/" class="hatena-bookmark-button" data-hatena-bookmark-layout="standard-balloon" data-hatena-bookmark-lang="ja" title="add bookmark"><img src="https://b.st-hatena.com/images/entry-button/button-only@2x.png" alt="add hatebu" width="20" height="20" style="border: none;" /></a><script type="text/javascript" src="https://b.st-hatena.com/js/bookmark_button.js" charset="utf-8" async="async"></script>') | |
51 | + url = 'http://b.hatena.ne.jp/entry/' + window.location.href | |
52 | + console.log(url) | |
53 | + title = document.title | |
54 | + this.$el.append('<a href="' + url + '" class="hatena-bookmark-button" data-hatena-bookmark-title="' + title + '" data-hatena-bookmark-layout="standard-balloon" data-hatena-bookmark-lang="ja" title="このエントリーをはてなブックマークに追加"><img src="https://b.st-hatena.com/images/entry-button/button-only@2x.png" alt="このエントリーをはてなブックマークに追加" width="20" height="20" style="border: none;" /></a><script type="text/javascript" src="https://b.st-hatena.com/js/bookmark_button.js" charset="utf-8" async="async"></script>') | |
43 | 55 | this |
44 | 56 | |
45 | 57 | refresh: () -> |
@@ -444,6 +444,10 @@ ul.scenarios_elements { | ||
444 | 444 | width: 150px; |
445 | 445 | } |
446 | 446 | |
447 | +.social-button { | |
448 | + float: left; | |
449 | +} | |
450 | + | |
447 | 451 | .show-owner-footer a { |
448 | 452 | margin: 0.5em; |
449 | 453 | } |
@@ -13,7 +13,6 @@ | ||
13 | 13 | |
14 | 14 | <div id="pettanr"> |
15 | 15 | </div> |
16 | -<div id="fb-root"></div> | |
17 | 16 | <script> |
18 | 17 | (function(d, s, id) { |
19 | 18 | var js, fjs = d.getElementsByTagName(s)[0]; |