OSDN Git Service

clean
[pettanr/pettanr.git] / app / assets / javascripts / models / speech_balloon_template.js.coffee
1 class Pettanr.SpeechBalloonTemplate extends Peta.Template\r
2   url: '/speech_balloon_templates/'\r
3   \r
4   @singular: () ->\r
5     'SpeechBalloonTemplate'\r
6   \r
7   @plural: () ->\r
8     'SpeechBalloonTemplates'\r
9   \r
10   defaults: {\r
11     id: null\r
12   } \r
13   \r
14   system_picture: () ->\r
15     new Pettanr.SystemPicture({id: @get('system_picture_id')})\r
16   \r
17   symbol_option: (cb) ->\r
18     i = @system_picture()\r
19     i.fetch({cache: true}).done =>\r
20       cb(i.tmb_opt_img_tag())\r
21   \r
22   parsed_settings: () ->\r
23     JSON.parse(@get('settings'))\r
24   \r
25   initialize: () ->\r
26     if @id\r
27       @url = @url + @id\r
28     \r