OSDN Git Service

fix:asoc system
[pettanr/pettanr.git] / app / assets / javascripts / models / speech_balloon.js.coffee
index 1d0f0a5..6fb8af1 100644 (file)
@@ -1,18 +1,55 @@
 class Pettanr.SpeechBalloon extends Peta.Element\r
-  @single: () ->\r
+  \r
+  @singular: () ->\r
     'SpeechBalloon'\r
   \r
   @plural: () ->\r
     'SpeechBalloons'\r
   \r
-  @colum_structures: ->\r
-    {}\r
-  \r
   defaults: {\r
-    x: 11\r
+    id: null,\r
+    z: null,\r
+    t: null\r
   } \r
   \r
-  initialize: () ->\r
-    confirm("Welcome to this world")\r
+  @pick_item_name: () ->\r
+    'speech_balloon_template'\r
+  \r
+  @traceable_item_names: () ->\r
+    ['speech', 'balloon']\r
+  \r
+  pick: () ->\r
+    # \r
+    speech_balloon_template = @templates.speech_balloon_template\r
+    {\r
+      speech_balloon_template_id: speech_balloon_template.get('id'),\r
+      speech_balloon_template_module_name: speech_balloon_template.get('module_name')\r
+    }\r
+  \r
+  @trace_routes: () ->\r
+    {\r
+      symbol: ['speech_balloon_template', 'system_picture'],\r
+    }\r
+  \r
+  @has_picture: () ->\r
+    false\r
+  \r
+  filer_caption: (context, options) ->\r
+    @get_child('balloon', this, {\r
+      success: (balloon) => \r
+        @get_child('speech', this, {\r
+          success: (speech) => \r
+            plain_scenario = @plain_scenario() + balloon.plain_scenario() + speech.plain_scenario()\r
+            options.success.call(context, plain_scenario)\r
+        })\r
+    })\r
+  \r
+  plain_scenario: () ->\r
+    @escape('caption')\r
+  \r
+  element_face: () ->\r
+    new Pettanr.Views.SpeechBalloon.ElementFace({element: this})\r
+  \r
+  initialize: (attr, options) ->\r
+    super(attr, options)\r
   \r
-\r