1 class Pettanr.Speech extends Peta.Element
\r
18 pick: (templates) ->
\r
20 speech_balloon_template = templates.speech_balloon_template
\r
21 writing_format = templates.writing_format
\r
23 speech_balloon_template_id: speech_balloon_template.get('id'),
\r
24 speech_balloon_template_module_name: speech_balloon_template.get('module_name'),
\r
25 speech_balloon_template_settings: speech_balloon_template.get('settings')
\r
26 writing_format_id: writing_format.get('id'),
\r
27 writing_format_module_name: writing_format.get('module_name'),
\r
28 writing_format_template_settings: writing_format.get('settings')
\r
31 speech_balloon: () ->
\r
32 new Pettanr.SpeechBalloon({id: @get('speech_balloon_id')})
\r
34 writing_format: () ->
\r
35 new Pettanr.WritingFormat({id: @get('writing_format_id')})
\r
37 @text_align_texts: () ->
\r
38 ['left', 'left', 'right', 'center']
\r
40 symbol_option: (cb) ->
\r
41 sb = @speech_balloon()
\r
42 sb.fetch({cache: true}).done =>
\r
43 sbt = sb.speech_balloon_template()
\r
44 sbt.fetch({cache: true}).done =>
\r
45 sp = sbt.system_picture()
\r
46 sp.fetch({cache: true}).done =>
\r
47 @trigger('ready:symbol', sp.tmb_opt_img_tag())
\r
49 text_align_text: () ->
\r
50 Pettanr.Speech.text_align_texts()[@get('text_align')]
\r
54 @render(@escape('content'))
\r
57 initialize: (attr, options) ->
\r
58 super(attr, options)
\r