リビジョン | b49c73c78a5625e0b59de9d1a0d5b2f67e853c25 (tree) |
---|---|
日時 | 2015-10-22 11:51:43 |
作者 | ![]() |
コミッター | yasushiito |
add: social button
@@ -15,9 +15,13 @@ class Pettanr.Balloon extends Peta.Element | ||
15 | 15 | r: 0 |
16 | 16 | } |
17 | 17 | |
18 | + @pick_item_name: () -> | |
19 | + 'speech_balloon_template' | |
20 | + | |
18 | 21 | @trace_routes: () -> |
19 | 22 | { |
20 | 23 | speech_balloon: 'speech_balloon', |
24 | + speech_balloon_template: ['speech_balloon', 'speech_balloon_template'], | |
21 | 25 | symbol: ['speech_balloon', 'speech_balloon_template', 'system_picture'] |
22 | 26 | } |
23 | 27 |
@@ -42,7 +42,7 @@ class Pettanr.Picture extends Peta.Content | ||
42 | 42 | symbol_option: (context, options) -> |
43 | 43 | @retrieve(this, { |
44 | 44 | success: (symbol_item) => |
45 | - options.success.call(context, symbol_item.to_symbol()) | |
45 | + options.success.call(context, symbol_item.symbol_file()) | |
46 | 46 | fail: (response, opt) => |
47 | 47 | options.fail.call(context, response, opt) |
48 | 48 | }) |
@@ -14,9 +14,13 @@ class Pettanr.Speech extends Peta.Element | ||
14 | 14 | height: 100 |
15 | 15 | } |
16 | 16 | |
17 | + @pick_item_name: () -> | |
18 | + 'speech_balloon_template' | |
19 | + | |
17 | 20 | @trace_routes: () -> |
18 | 21 | { |
19 | 22 | speech_balloon: 'speech_balloon', |
23 | + speech_balloon_template: ['speech_balloon', 'speech_balloon_template'], | |
20 | 24 | symbol: ['speech_balloon', 'speech_balloon_template', 'system_picture'] |
21 | 25 | } |
22 | 26 |
@@ -123,6 +123,8 @@ class Pettanr.View.Layout.Sns extends Pettanr.View.Layout.Base | ||
123 | 123 | @listenTo(view, 'http_get', @body_http_get) |
124 | 124 | @listenTo(view, 'http_post', @body_http_post) |
125 | 125 | @body.refresh(view) |
126 | + if view.social | |
127 | + view.social.refresh() | |
126 | 128 | |
127 | 129 | body_fail: (response, options) -> |
128 | 130 | @error_dialog.start(response, options) |
@@ -0,0 +1,46 @@ | ||
1 | +class Pettanr.View.Social extends Pettanr.View | |
2 | + | |
3 | + constructor: (@item, @context, options) -> | |
4 | + super(options) | |
5 | + | |
6 | + initialize: (options) -> | |
7 | + super(options) | |
8 | + @twitter = new Pettanr.View.Social.Twitter() | |
9 | + @facebook = new Pettanr.View.Social.Facebook() | |
10 | + @hatena = new Pettanr.View.Social.Hatena() | |
11 | + | |
12 | + render: () -> | |
13 | + this.$el.html('') | |
14 | + this.$el.append(@twitter.render().el) | |
15 | + this.$el.append(@facebook.render().el) | |
16 | + this.$el.append(@hatena.render().el) | |
17 | + this | |
18 | + | |
19 | +class Pettanr.View.Social.Twitter extends Pettanr.View | |
20 | + | |
21 | + render: () -> | |
22 | + 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>') | |
24 | + this | |
25 | + | |
26 | + refresh: () -> | |
27 | + | |
28 | +class Pettanr.View.Social.Facebook extends Pettanr.View | |
29 | + | |
30 | + render: () -> | |
31 | + this.$el.html('') | |
32 | + 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 | + this | |
34 | + | |
35 | + refresh: () -> | |
36 | + FB.XFBML.parse() | |
37 | + | |
38 | +class Pettanr.View.Social.Hatena extends Pettanr.View | |
39 | + | |
40 | + render: () -> | |
41 | + 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>') | |
43 | + this | |
44 | + | |
45 | + refresh: () -> | |
46 | + |
@@ -666,6 +666,8 @@ class Pettanr.Views.Scroll.Play extends Pettanr.View.Show | ||
666 | 666 | this.$el.append(@header.render().el) |
667 | 667 | this.$el.append(@authored_by.render().el) |
668 | 668 | this.$el.append(@body.render().el) |
669 | + @social = new Pettanr.View.Social() | |
670 | + this.$el.append(@social.render().el) | |
669 | 671 | # this.$el.append(@owner.render().el) if @item.is_own() |
670 | 672 | this |
671 | 673 |
@@ -11,9 +11,22 @@ class Pettanr.Views.Scroll.Show extends Pettanr.View.Show | ||
11 | 11 | this.$el.html('') |
12 | 12 | this.$el.append(@header.render().el) |
13 | 13 | this.$el.append(@authored_by.render().el) |
14 | + h3 = new Tag.H3({content: Pettanr.AppHelper.t_m('Scroll.description')}) | |
15 | + this.$el.append(h3.render().el) | |
16 | + desc = new Tag.Div({content: @item.escape('description'), class_name: 'scroll-description'}) | |
17 | + this.$el.append(desc.render().el) | |
18 | + label_button = new Pettanr.View.Button(@item.play_url(), I18n.t('scrolls.play.title'), { | |
19 | + click: () => | |
20 | + @trigger('http_get', @item.play_url()) | |
21 | + }) | |
22 | + h2 = new Tag.H2({content: label_button.render().el}) | |
23 | + this.$el.append(h2.render().el) | |
14 | 24 | this.$el.append(@owner.render().el) if @item.is_own() |
15 | 25 | this |
16 | 26 | |
27 | + http_get: (url) -> | |
28 | + @trigger('http_get', url) | |
29 | + | |
17 | 30 | click_pick: () -> |
18 | 31 | @trigger('pick', @item) |
19 | 32 |
@@ -1413,6 +1413,7 @@ | ||
1413 | 1413 | tag: { |
1414 | 1414 | type: 'select', |
1415 | 1415 | }, |
1416 | + row_break: true, | |
1416 | 1417 | }, |
1417 | 1418 | license_settings: { |
1418 | 1419 | # boost_name: 'license_group', |
@@ -405,6 +405,12 @@ ul.scenarios_elements { | ||
405 | 405 | margin-left: 20px; |
406 | 406 | } |
407 | 407 | |
408 | +.scroll-description { | |
409 | + margin-left: 20px; | |
410 | + margin-bottom: 20px; | |
411 | + font-size: 1.8em; | |
412 | +} | |
413 | + | |
408 | 414 | .player { |
409 | 415 | list-style-type: none; |
410 | 416 | margin: 0; |
@@ -438,6 +444,10 @@ ul.scenarios_elements { | ||
438 | 444 | width: 150px; |
439 | 445 | } |
440 | 446 | |
447 | +.show-owner-footer a { | |
448 | + margin: 0.5em; | |
449 | +} | |
450 | + | |
441 | 451 | .filer { |
442 | 452 | list-style-type: none; |
443 | 453 | margin: 0; |
@@ -13,6 +13,16 @@ | ||
13 | 13 | |
14 | 14 | <div id="pettanr"> |
15 | 15 | </div> |
16 | +<div id="fb-root"></div> | |
17 | + <script> | |
18 | + (function(d, s, id) { | |
19 | + var js, fjs = d.getElementsByTagName(s)[0]; | |
20 | + if (d.getElementById(id)) return; | |
21 | + js = d.createElement(s); js.id = id; | |
22 | + js.src = "//connect.facebook.net/ja_JP/sdk.js#xfbml=1&version=v2.5"; | |
23 | + fjs.parentNode.insertBefore(js, fjs); | |
24 | + }(document, 'script', 'facebook-jssdk')); | |
25 | + </script> | |
16 | 26 | <script type="text/template" id="header_template"> |
17 | 27 | <span id="logo"> |
18 | 28 | <a class="logo" href="/"><&= title &></a> |
@@ -3446,7 +3446,8 @@ | ||
3446 | 3446 | "license_id": { |
3447 | 3447 | "tag": { |
3448 | 3448 | "type": "select" |
3449 | - } | |
3449 | + }, | |
3450 | + "row_break": true | |
3450 | 3451 | }, |
3451 | 3452 | "license_settings": { |
3452 | 3453 | "row_break": true |