class Pettanr.GroundPicture extends Peta.Element url: '/ground_pictures/' @singular: () -> 'GroundPicture' @plural: () -> 'GroundPictures' defaults: { id: null, x: 0, y: 0, repeat: 0 } @repeat_texts: () -> ['repeat', 'repeat-x', 'repeat-y', 'no-repeat'] panel: () -> new Pettanr.Panel({id: @get('panel_id')}) picture: () -> new Pettanr.Picture({id: @get('picture_id')}) @has_picture: () -> true tmb_opt_img_tag: (picture) -> new Pettanr.Image.SymbolPicture({ attr: { src: picture.r_url(), alt: @escape('caption') }, picture: picture }) symbol_option: () -> i = @picture() i.fetch({cache: true}).done => @symbol_picture = i.tmb_opt_img_tag() @trigger('ready:symbol') repeat_text: () -> Pettanr.GroundPicture.repeat_texts()[@get('repeat')] element_face: () -> new Pettanr.Views.GroundPicture.ElementFace({element: this}) initialize: () -> if @id @url = @url + @id