1 class Pettanr.SpeechBalloon extends Peta.Element
\r
2 url: '/speech_balloons/'
\r
16 @pick_item_name: () ->
\r
17 'speech_balloon_template'
\r
19 @traceable_item_names: () ->
\r
20 ['speech', 'balloon']
\r
22 trace_from_speech: () ->
\r
24 trace_from_balloon: () ->
\r
26 pick: (templates) ->
\r
28 speech_balloon_template = templates.speech_balloon_template
\r
30 speech_balloon_template_id: speech_balloon_template.get('id'),
\r
31 speech_balloon_template_module_name: speech_balloon_template.get('module_name')
\r
35 new Pettanr.Cache.Retriever(Pettanr.Panel, @get('panel_id'))
\r
37 speech_balloon_template: () ->
\r
38 new Pettanr.Cache.Retriever(Pettanr.SpeechBalloonTemplate, @get('speech_balloon_template_id'))
\r
43 symbol_option: () ->
\r
44 retriever = @speech_balloon_template()
\r
45 @listenTo(retriever, 'retrieve', @retrieve_speech_balloon_template)
\r
46 retriever.retrieve()
\r
48 retrieve_speech_balloon_template: (speech_balloon_template) ->
\r
49 retriever = speech_balloon_template.system_picture()
\r
50 @listenTo(retriever, 'retrieve', @retrieve_system_picture)
\r
51 retriever.retrieve()
\r
53 retrieve_system_picture: (system_picture) ->
\r
54 @trigger('ready:symbol', system_picture.tmb_opt_img_tag())
\r
56 filer_caption: () ->
\r
57 retriever = @retriever()
\r
58 @listenTo(retriever, 'retrieve', @retrieve_filer_caption)
\r
59 retriever.retrieve()
\r
61 retrieve_filer_caption: (item) ->
\r
62 caption = item.escape('caption')
\r
63 @trigger('ready:caption', caption)
\r
65 plain_scenario: () ->
\r
69 new Pettanr.Views.SpeechBalloon.ElementFace({element: this})
\r
71 initialize: (attr, options) ->
\r
72 super(attr, options)
\r