1 class Pettanr.Picture extends Peta.Content
\r
13 is_visible: (operators = Pettanr.cache.operators) ->
\r
17 @get('id') + '.' + @get('ext')
\r
23 'image/' + @get('ext')
\r
26 '/pictures/' + @filename()
\r
29 {src: @r_url(), width: @get('width'), height: @get('height')}
\r
31 tmb_opt_img_tag: () ->
\r
32 new Pettanr.Image.SymbolPicture({
\r
39 tail_opt_img_tag: (img) ->
\r
40 {src: img, width: @get('width'), height: @get('height')}
\r
42 tail_tmb_opt_img_tag: (img) ->
\r
43 wh = Pettanr.Imager.thumbnail_size(@get('width'), @get('height'))
\r
44 {src: img, width: wh[0], height: wh[1]}
\r
47 lgn = Pettanr.to_s(@license().license_group().get('caption'))
\r
48 ln = Pettanr.to_s(@license().get('caption'))
\r
49 lgn + '[' + ln + ']'
\r
51 symbol_option: () ->
\r
55 if @head().resource_picture()
\r
61 #Picture.find( conditions => ['original_picture_id = ?', opid], :order => 'pictures.revision desc')
\r
64 Picture.head(@get('original_picture_id'))
\r
70 if @license_extend().reverse < 0
\r
73 ['', 'v', 'h', 'vh']
\r
75 is_showable: (operators = Pettanr.cache.operators) ->
\r
76 return false if not @original_picture()
\r
77 return true if @is_own(operators)
\r
78 #@is_enable() and @is_head()
\r
81 new Pettanr.Views.Picture.History({item: this})
\r
83 credit_icon_view: () ->
\r
84 new Pettanr.Views.Picture.CreditIcon({item: this})
\r
86 credit_view: (with_icon = true) ->
\r
87 new Pettanr.Views.Picture.Credit({item: this, with_icon: with_icon})
\r
91 @credit_icon = @credit_icon_view()
\r
93 f = (data, status) =>
\r
96 $.get(@url + '/credit', null, f, 'html')
\r
99 initialize: (attr = {}, options = {}) ->
\r
100 super(attr, options)
\r