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
32 speech_balloon_template_settings: speech_balloon_template.get('settings')
\r
36 new Pettanr.Cache.Retriever(Pettanr.Panel, @get('panel_id'))
\r
38 speech_balloon_template: () ->
\r
39 new Pettanr.Cache.Retriever(Pettanr.SpeechBalloonTemplate, @get('speech_balloon_template_id'))
\r
44 symbol_option: () ->
\r
45 retriever = @speech_balloon_template()
\r
46 @listenTo(retriever, 'retrieve', @retrieve_speech_balloon_template)
\r
47 retriever.retrieve()
\r
49 retrieve_speech_balloon_template: (speech_balloon_template) ->
\r
50 retriever = speech_balloon_template.system_picture()
\r
51 @listenTo(retriever, 'retrieve', @retrieve_system_picture)
\r
52 retriever.retrieve()
\r
54 retrieve_system_picture: (system_picture) ->
\r
55 @trigger('ready:symbol', system_picture.tmb_opt_img_tag())
\r
57 filer_caption: () ->
\r
58 retriever = @retriever()
\r
59 @listenTo(retriever, 'retrieve', @retrieve_filer_caption)
\r
60 retriever.retrieve()
\r
62 retrieve_filer_caption: (item) ->
\r
63 caption = item.escape('caption')
\r
64 @trigger('ready:caption', caption)
\r
66 plain_scenario: () ->
\r
70 new Pettanr.Views.SpeechBalloon.ElementFace({element: this})
\r
72 initialize: (attr, options) ->
\r
73 super(attr, options)
\r