• R/O
  • HTTP
  • SSH
  • HTTPS

pettanr: コミット

サーバ側、Railsシステム本体


コミットメタ情報

リビジョン2f211a919bc8f20e1e9f0e46e5660eb21b3a424a (tree)
日時2015-10-23 08:38:24
作者yasushiito <yas@pen-...>
コミッターyasushiito

ログメッセージ

t#:

変更サマリ

差分

--- a/app/assets/javascripts/view/social.js.coffee
+++ b/app/assets/javascripts/view/social.js.coffee
@@ -1,4 +1,5 @@
11 class Pettanr.View.Social extends Pettanr.View
2+ className: 'social'
23
34 constructor: (@item, @context, options) ->
45 super(options)
@@ -14,21 +15,28 @@ class Pettanr.View.Social extends Pettanr.View
1415 this.$el.append(@twitter.render().el)
1516 this.$el.append(@facebook.render().el)
1617 this.$el.append(@hatena.render().el)
18+ @append_rb()
1719 this
1820
21+ refresh: () ->
22+ @facebook.refresh()
23+
1924 class Pettanr.View.Social.Twitter extends Pettanr.View
25+ className: 'social-button'
2026
2127 render: () ->
2228 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>')
2430 this
2531
2632 refresh: () ->
2733
2834 class Pettanr.View.Social.Facebook extends Pettanr.View
35+ className: 'social-button'
2936
3037 render: () ->
3138 this.$el.html('')
39+ this.$el.append('<div id="fb-root"></div>')
3240 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>')
3341 this
3442
@@ -36,10 +44,14 @@ class Pettanr.View.Social.Facebook extends Pettanr.View
3644 FB.XFBML.parse()
3745
3846 class Pettanr.View.Social.Hatena extends Pettanr.View
47+ className: 'social-button'
3948
4049 render: () ->
4150 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>')
4355 this
4456
4557 refresh: () ->
--- a/app/assets/stylesheets/test.css.scss
+++ b/app/assets/stylesheets/test.css.scss
@@ -444,6 +444,10 @@ ul.scenarios_elements {
444444 width: 150px;
445445 }
446446
447+.social-button {
448+ float: left;
449+}
450+
447451 .show-owner-footer a {
448452 margin: 0.5em;
449453 }
--- a/app/views/layouts/yasapp.html.erb
+++ b/app/views/layouts/yasapp.html.erb
@@ -13,7 +13,6 @@
1313
1414 <div id="pettanr">
1515 </div>
16-<div id="fb-root"></div>
1716 <script>
1817 (function(d, s, id) {
1918 var js, fjs = d.getElementsByTagName(s)[0];
旧リポジトリブラウザで表示