class Pettanr.Speech extends Peta.Element\r
+ url: '/speeches/'\r
+ \r
@singular: () ->\r
'Speech'\r
\r
height: 100\r
} \r
\r
+ speech_balloon: () ->\r
+ new Pettanr.SpeechBalloon({id: @get('speech_balloon_id')})\r
+ \r
@text_align_texts: () -> \r
['left', 'left', 'right', 'center']\r
\r
- symbol_option: () ->\r
- @speech_balloon().speech_balloon_template().symbol_option()\r
- \r
- outer_style: () ->\r
- {\r
- top: @get('y'), left: @get('x'), \r
- width: @get('width'), height: @get('height')\r
- }\r
- \r
- inner_style: () ->\r
- {\r
- 'font-size': Pettanr.to_s(@get('font_size')) + 'em',\r
- 'text-align': @text_align_text(), \r
- color: '#' + ('000000' + Pettanr.to_s(@get('fore_color'))).slice(-6)\r
- }\r
+ symbol_option: (cb) ->\r
+ sb = @speech_balloon()\r
+ sb.fetch({cache: true}).done ->\r
+ sbt = sb.speech_balloon_template()\r
+ sbt.fetch({cache: true}).done ->\r
+ sp = sbt.system_picture()\r
+ sp.fetch({cache: true}).done ->\r
+ cb(sp.tmb_opt_img_tag())\r
\r
text_align_text: () ->\r
Pettanr.Speech.text_align_texts()[@get('text_align')]\r
\r
+ scenario: () ->\r
+ @boosts('read')\r
+ @render(@get('content'))\r
+ \r
+ \r
initialize: () ->\r
if @id\r
@url = @url + @id\r
\r
-class Pettanr.Speech.Collection extends Backbone.Collection\r
- model: Pettanr.Speech\r
- url: '/Speeches'\r