OSDN Git Service

af08756bace580e35af3aca71394c334e21c764b
[pettanr/pettanr.git] / app / assets / javascripts / view / show.js.coffee
1 class Pettanr.View.Show extends Pettanr.View\r
2   tagName: 'div'\r
3   className: 'show'\r
4   \r
5   constructor: (@item, options) ->\r
6     super(options)\r
7   \r
8   default_header_options: () ->\r
9     {\r
10       face: {\r
11         click: () =>\r
12           @trigger('http_get', @item.show_url())\r
13       },\r
14       label: {\r
15         click: () =>\r
16           @trigger('http_get', @item.show_url())\r
17       },\r
18       prof: {\r
19         click: () =>\r
20           @trigger('http_get', @item.prof_url())\r
21       },\r
22     }\r
23   \r
24   binder_header_options: () ->\r
25     {\r
26       face: {\r
27         click: () =>\r
28           @trigger('http_get', @item.show_url())\r
29       },\r
30       label: {\r
31         url: @item.play_url(),\r
32         click: () =>\r
33           @trigger('http_get', @item.play_url())\r
34       },\r
35       prof: {\r
36         click: () =>\r
37           @trigger('http_get', @item.prof_url())\r
38       },\r
39     }\r
40   \r
41   default_footer_options: () ->\r
42     {\r
43       actions: {\r
44         edit: {\r
45           click: () =>\r
46             @trigger('http_get', @item.edit_url())\r
47         }, \r
48         destroy: {\r
49           click: () =>\r
50             redirect = (url) =>\r
51               @trigger('http_get', url)\r
52             Pettanr.Proxy.destroy(@item, {redirect: redirect})\r
53         }, \r
54       }, \r
55     }\r
56   \r
57   add_credits: (options = {icon: true}) ->\r
58     @credits = new Pettanr.View.Credits(this, options)\r
59     @listenTo(@credits, 'click:credit:icon', @click_credit_icon)\r
60     this.$el.append(@credits.render().el)\r
61     @credits.push(@panel.licensed_pictures())\r
62   \r
63   click_authored_by: (author) ->\r
64     @trigger('http_get', author.show_url())\r
65   \r
66   click_credit_icon: (item) ->\r
67     @trigger('http_get', item.show_url())\r
68   \r