1 class Pettanr.PanelPicture extends Peta.Element
\r
2 url: '/panel_pictures/'
\r
15 new Pettanr.Picture({id: @get('picture_id')})
\r
21 v = if @get('height') > 0
\r
25 h = if @get('width') > 0
\r
30 res = res # format of /1.png?subdir=v
\r
31 # res += '/' unless res.empty? # format of /v/1.png
\r
35 @picture().filename() + '?subdir=' + @flip()
\r
38 '/pictures/' + @filename()
\r
40 opt_div_style: () ->
\r
41 "top:#{@get('y')}px; left:#{@get('x')}px; z-index:#{@get('z')}; position: absolute;"
\r
43 opt_img_tag: (spot = null, opacity = 20) ->
\r
44 o = if spot and spot != this
\r
45 "opacity: #{opacity.to_f/100}; filter:alpha(opacity=#{opacity});"
\r
48 @tag_attributes('img', {
\r
49 class: "panel-picture",
\r
50 vPicture: @get('id'),
\r
52 width: Math.abs(@get('width')),
\r
53 height: Math.abs(@get('height')),
\r
54 picture_id: @get('picture_id'),
\r
56 alt: @get('caption'),
\r
60 tmb_opt_img_tag: (picture) ->
\r
61 wh = Pettanr.Imager.thumbnail_size(@get('width'), @get('height'))
\r
62 new Pettanr.AppHelperImg({src: picture.r_url(), size: Math.abs(wh[0]), alt: @get('caption')})
\r
64 symbol_option: (cb) ->
\r
68 cb(_this.tmb_opt_img_tag(i))
\r
74 class Pettanr.PanelPicture.Collection extends Backbone.Collection
\r
75 model: Pettanr.PanelPicture
\r
76 url: '/panel_pictures'
\r