1 class Pettanr.PanelPicture extends Peta.Element
\r
2 url: '/panel_pictures/'
\r
16 @pick_item_name: () ->
\r
20 Manifest.item_name_to_model(@pick_item_name())
\r
22 @traceable_item_names: () ->
\r
23 ['ground_picture', 'picture']
\r
25 @is_traceable: (item_name) ->
\r
26 _.contains(@traceable_item_names(), item_name)
\r
28 trace_from_ground_picture: () ->
\r
30 trace_from_picture: () ->
\r
33 new Pettanr.Picture({id: @get('picture_id')})
\r
35 panel: (options = {}) ->
\r
36 new Pettanr.Panel({id: @get('panel_id')}, options)
\r
42 v = if @get('height') > 0
\r
46 h = if @get('width') > 0
\r
51 res = res # format of /1.png?subdir=v
\r
52 # res += '/' unless res.empty? # format of /v/1.png
\r
55 filename: (picture) ->
\r
56 q = if _.isEmpty(@flip())
\r
59 '?subdir=' + @flip()
\r
60 picture.filename() + q
\r
63 '/pictures/' + @filename(picture)
\r
65 tmb_opt_img_tag: (picture) ->
\r
66 new Pettanr.Image.SymbolPicture({
\r
68 src: picture.r_url(),
\r
69 alt: @escape('caption')
\r
74 symbol_option: () ->
\r
76 i.fetch({cache: true}).done =>
\r
77 @trigger('ready:symbol', i.tmb_opt_img_tag())
\r
80 new Pettanr.Views.PanelPicture.ElementFace({element: this})
\r
85 @bind('change:width', () ->
\r