OSDN Git Service

fix: any
[pettanr/pettanr.git] / app / assets / javascripts / models / speech.js.coffee
index 4e26b4f..2094552 100644 (file)
@@ -1,18 +1,49 @@
-class Pettanr.SpeechBalloon extends Peta.Element\r
-  @single: () ->\r
+class Pettanr.Speech extends Peta.Element\r
+  \r
+  @singular: () ->\r
     'Speech'\r
   \r
   @plural: () ->\r
     'Speeches'\r
   \r
-  @colum_structures: ->\r
-    {}\r
-  \r
   defaults: {\r
-    x: 11\r
+    id: null,\r
+    x: 0,\r
+    y: 0,\r
+    width: 100,\r
+    height: 100\r
   } \r
   \r
-  initialize: () ->\r
-    confirm("Welcome to this world")\r
+  @trace_routes: () ->\r
+    {\r
+      speech_balloon: 'speech_balloon',\r
+      symbol: ['speech_balloon', 'speech_balloon_template', 'system_picture']\r
+    }\r
+  \r
+  pick: () ->\r
+    # \r
+    speech_balloon_template = @templates.speech_balloon_template\r
+    writing_format = @templates.writing_format\r
+    {\r
+      speech_balloon_template_id: speech_balloon_template.get('id'),\r
+      speech_balloon_template_module_name: speech_balloon_template.get('module_name'),\r
+      writing_format_id: writing_format.get('id'),\r
+      writing_format_module_name: writing_format.get('module_name'),\r
+    }\r
+  \r
+  @text_align_texts: () -> \r
+    ['left', 'left', 'right', 'center']\r
+  \r
+  text_align_text: () ->\r
+    Pettanr.Speech.text_align_texts()[@get('text_align')]\r
+  \r
+  scenario: () ->\r
+    @boosts('read')\r
+    @render(@escape('content'))\r
+  \r
+  plain_scenario: () ->\r
+    @escape('content')\r
+  \r
+  initialize: (attr, options) ->\r
+    super(attr, options)\r
   \r
-\r