class Pettanr.Speech extends Peta.Element url: '/speeches/' @singular: () -> 'Speech' @plural: () -> 'Speeches' defaults: { id: null, x: 0, y: 0, width: 100, height: 100 } speech_balloon: () -> new Pettanr.SpeechBalloon({id: @get('speech_balloon_id')}) @text_align_texts: () -> ['left', 'left', 'right', 'center'] symbol_option: (cb) -> sb = @speech_balloon() sb.fetch().done -> sbt = sb.speech_balloon_template() sbt.fetch().done -> sp = sbt.system_picture() sp.fetch().done -> cb(sp.tmb_opt_img_tag()) text_align_text: () -> Pettanr.Speech.text_align_texts()[@get('text_align')] scenario: () -> @boosts('read') @render(@get('content')) initialize: () -> if @id @url = @url + @id