OSDN Git Service

Merge branch 'v06' of git.sourceforge.jp:/gitroot/pettanr/pettanr into v06
[pettanr/pettanr.git] / app / assets / javascripts / models / speech_balloon_template.js.coffee
index dcf4c9f..0e54f78 100644 (file)
@@ -1,2 +1,28 @@
 class Pettanr.SpeechBalloonTemplate extends Peta.Template\r
-\r
+  url: '/speech_balloon_templates/'\r
+  \r
+  @singular: () ->\r
+    'SpeechBalloonTemplate'\r
+  \r
+  @plural: () ->\r
+    'SpeechBalloonTemplates'\r
+  \r
+  defaults: {\r
+    id: null\r
+  } \r
+  \r
+  system_picture: () ->\r
+    new Pettanr.SystemPicture({id: @get('system_picture_id')})\r
+  \r
+  symbol_option: () ->\r
+    i = @system_picture()\r
+    i.fetch({cache: true}).done =>\r
+      @trigger('ready:symbol', i.tmb_opt_img_tag())\r
+  \r
+  parsed_settings: () ->\r
+    JSON.parse(@get('settings'))\r
+  \r
+  initialize: () ->\r
+    if @id\r
+      @url = @url + @id\r
+    \r