1 class Pettanr.PanelPicture extends Peta.Element
\r
16 v = if @get('height') > 0
\r
20 h = if @get('width') > 0
\r
25 res = res # format of /1.png?subdir=v
\r
26 # res += '/' unless res.empty? # format of /v/1.png
\r
30 @picture().filename() + '?subdir=' + @flip()
\r
33 '/pictures/' + @filename()
\r
35 opt_div_style: () ->
\r
36 "top:#{@get('y')}px; left:#{@get('x')}px; z-index:#{@get('z')}; position: absolute;"
\r
38 opt_img_tag: (spot = null, opacity = 20) ->
\r
39 o = if spot and spot != this
\r
40 "opacity: #{opacity.to_f/100}; filter:alpha(opacity=#{opacity});"
\r
43 @tag_attributes('img', {
\r
44 class: "panel-picture",
\r
45 vPicture: @get('id'),
\r
47 width: Math.abs(@get('width')),
\r
48 height: Math.abs(@get('height')),
\r
49 picture_id: @get('picture_id'),
\r
51 alt: @get('caption'),
\r
55 tmb_opt_img_tag: () ->
\r
56 wh = Pettanr.Imager.thumbnail_size(@get('width'), @get('height'))
\r
57 {src: @r_url(), width: Math.abs(wh[0]), height: Math.abs(wh[1]), alt: @get('caption')}
\r
59 symbol_option: () ->
\r
60 @picture().symbol_option()
\r
66 class Pettanr.PanelPicture.Collection extends Backbone.Collection
\r
67 model: Pettanr.PanelPicture
\r
68 url: '/panel_pictures'
\r