1 class Pettanr.Picture extends Peta.Content
\r
13 @trace_routes: () ->
\r
15 resource_picture: ['resource_picture_picture', 'resource_picture']
\r
18 is_visible: (operators = Pettanr.cache.operators) ->
\r
22 @get('id') + '.' + @get('ext')
\r
28 'image/' + @get('ext')
\r
31 '/pictures/' + @filename()
\r
34 {src: @r_url(), width: @get('width'), height: @get('height')}
\r
36 tmb_opt_img_tag: () ->
\r
37 new Pettanr.Image.SymbolPicture({
\r
44 tail_opt_img_tag: (img) ->
\r
45 {src: img, width: @get('width'), height: @get('height')}
\r
47 tail_tmb_opt_img_tag: (img) ->
\r
48 wh = Pettanr.Imager.thumbnail_size(@get('width'), @get('height'))
\r
49 {src: img, width: wh[0], height: wh[1]}
\r
52 lgn = Pettanr.to_s(@license().license_group().get('caption'))
\r
53 ln = Pettanr.to_s(@license().get('caption'))
\r
54 lgn + '[' + ln + ']'
\r
56 symbol_option: (context, options) ->
\r
58 success: (symbol_item) =>
\r
59 options.success.call(context, symbol_item.to_symbol())
\r
63 if @head().resource_picture()
\r
69 #Picture.find( conditions => ['original_picture_id = ?', opid], :order => 'pictures.revision desc')
\r
72 Picture.head(@get('original_picture_id'))
\r
78 if @license_extend().reverse < 0
\r
81 ['', 'v', 'h', 'vh']
\r
83 is_showable: (operators = Pettanr.cache.operators) ->
\r
84 return false if not @original_picture()
\r
85 return true if @is_own(operators)
\r
86 #@is_enable() and @is_head()
\r
89 new Pettanr.Views.Picture.History({item: this})
\r
91 credit_icon_view: () ->
\r
92 new Pettanr.Views.Picture.CreditIcon({item: this})
\r
94 credit_view: (with_icon = true) ->
\r
95 new Pettanr.Views.Picture.Credit({item: this, with_icon: with_icon})
\r
99 @credit_icon = @credit_icon_view()
\r
101 f = (data, status) =>
\r
104 $.get(@url + '/credit', null, f, 'html')
\r
107 initialize: (attr = {}, options = {}) ->
\r
108 super(attr, options)
\r