OSDN Git Service

fix: fetch fail
[pettanr/pettanr.git] / app / assets / javascripts / models / speech.js.coffee
index 7c158fd..2094552 100644 (file)
@@ -1,4 +1,5 @@
 class Pettanr.Speech extends Peta.Element\r
+  \r
   @singular: () ->\r
     'Speech'\r
   \r
@@ -13,32 +14,36 @@ class Pettanr.Speech extends Peta.Element
     height: 100\r
   } \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
+  @trace_routes: () ->\r
     {\r
-      top: @get('y'), left: @get('x'), \r
-      width: @get('width'), height: @get('height')\r
+      speech_balloon: 'speech_balloon',\r
+      symbol: ['speech_balloon', 'speech_balloon_template', 'system_picture']\r
     }\r
   \r
-  inner_style: () ->\r
+  pick: () ->\r
+    # \r
+    speech_balloon_template = @templates.speech_balloon_template\r
+    writing_format = @templates.writing_format\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
+      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
-  initialize: () ->\r
-    if @id\r
-      @url = @url + @id\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
-class Pettanr.Speech.Collection extends Backbone.Collection\r
-  model: Pettanr.Speech\r
-  url: '/Speeches'\r