OSDN Git Service

fix panel editor
authoryasushiito <yas@pen-chan.jp>
Mon, 16 Jun 2014 09:27:42 +0000 (18:27 +0900)
committeryasushiito <yas@pen-chan.jp>
Mon, 16 Jun 2014 09:27:42 +0000 (18:27 +0900)
15 files changed:
app/assets/javascripts/manifest/work/buckets.js.coffee.erb
app/assets/javascripts/manifest/work/forms.js.coffee.erb
app/assets/javascripts/manifest/work/models.js.coffee.erb
app/assets/javascripts/manifest/work/profilers.js.coffee.erb
app/models/balloon.rb
app/models/ground_picture.rb
app/models/original_picture_license_group.rb
app/models/panel_picture.rb
app/models/sheet_panel.rb
app/models/speech.rb
app/views/layouts/application.html.erb
app/views/sheet_panels/_element.html.erb
lib/locmare/form.rb
public/local_manifest.json
public/manifest.json

index 7ec8c29..d36583b 100644 (file)
@@ -61,7 +61,6 @@
       'speech.speech_balloon_template_module_name',\r
       'speech.speech_balloon_template_settings',\r
       'speech.writing_format_module_name',\r
-      'speech.writing_format_settings',\r
     ]\r
   },\r
   speech: {\r
index a63b55b..6c45576 100644 (file)
       speech_balloon_template_settings: {\r
         row_break: true,\r
       },\r
-      writing_format_settings: {\r
-        label: {\r
-          type: 'none',\r
-        },\r
-        tag: {\r
-          type: 'hidden',\r
-        },\r
-      },\r
     },\r
     field_names: [\r
       'writing_format_id',\r
       'speech_balloon_template_module_name',\r
       'speech_balloon_template_settings',\r
       'writing_format_module_name',\r
-      'writing_format_settings',\r
     ],\r
   },\r
   ground_picture: {\r
     field_names: [\r
     ]\r
   },\r
+  plain_speech_balloon_speech_balloon: {\r
+    fields: {\r
+    },\r
+    field_names: [\r
+    ]\r
+  },\r
+  plain_speech_balloon_balloon: {\r
+    fields: {\r
+    },\r
+    field_names: [\r
+    ]\r
+  },\r
+  plain_speech_balloon_speech: {\r
+    fields: {\r
+    },\r
+    field_names: [\r
+    ]\r
+  },\r
+  square_speech_balloon_speech_balloon: {\r
+    fields: {\r
+    },\r
+    field_names: [\r
+    ]\r
+  },\r
+  square_speech_balloon_balloon: {\r
+    fields: {\r
+    },\r
+    field_names: [\r
+    ]\r
+  },\r
+  square_speech_balloon_speech: {\r
+    fields: {\r
+    },\r
+    field_names: [\r
+    ]\r
+  },\r
   test_speech_balloon_speech_balloon: {\r
     fields: {\r
       a: {\r
index 2dede08..228744e 100644 (file)
   ################################################################\r
   circle_speech_balloon_speech_balloon: {\r
     attributes: {\r
-      width: {\r
+    },\r
+  },\r
+  circle_speech_balloon_balloon: {\r
+    attributes: {\r
+    },\r
+  },\r
+  circle_speech_balloon_speech: {\r
+    attributes: {\r
+    },\r
+  },\r
+  plain_speech_balloon_speech_balloon: {\r
+    attributes: {\r
+    },\r
+  },\r
+  plain_speech_balloon_balloon: {\r
+    attributes: {\r
+    },\r
+  },\r
+  plain_speech_balloon_speech: {\r
+    attributes: {\r
+    },\r
+  },\r
+  square_speech_balloon_speech_balloon: {\r
+    attributes: {\r
+    },\r
+  },\r
+  square_speech_balloon_balloon: {\r
+    attributes: {\r
+    },\r
+  },\r
+  square_speech_balloon_speech: {\r
+    attributes: {\r
+    },\r
+  },\r
+  test_speech_balloon_speech_balloon: {\r
+    attributes: {\r
+      a: {\r
         type: 'number',\r
         rules : {\r
           required: true,\r
       },\r
     },\r
   },\r
-  circle_speech_balloon_speech_balloon: {\r
+  test_speech_balloon_balloon: {\r
     attributes: {\r
-      width: {\r
+      b: {\r
         type: 'number',\r
         rules : {\r
           required: true,\r
       },\r
     },\r
   },\r
-  circle_speech_balloon_speech_balloon: {\r
+  test_speech_balloon_speech: {\r
     attributes: {\r
-      width: {\r
+      c: {\r
         type: 'number',\r
         rules : {\r
           required: true,\r
index 75cb6f5..f06b26e 100644 (file)
       'height', \r
       'quotes', \r
       'speech_balloon_template_settings', \r
-      'writing_format_settings', \r
     ],\r
     associations: {\r
       belongs_to: [\r
index c80e92f..35f5971 100644 (file)
@@ -16,7 +16,7 @@ class Balloon < Peta::Element
 #  validates :caption, :presence => true
   validates :speech_balloon_template_settings, :boost => {:boost_name => :speech_balloon_template}
 
-  def _y
+  def attr_y
     self.attributes['y']
   end
   
@@ -58,7 +58,7 @@ self.system_picture_id = 1
   def style
     {
       'width' => self.width.to_s + 'px','height' => self.height.to_s + 'px',
-      'top' => self._y.to_s + 'px','left' => self.x.to_s + 'px'
+      'top' => self.attr_y.to_s + 'px','left' => self.x.to_s + 'px'
     }
   end
   
index 1f303ec..3ca5a11 100644 (file)
@@ -13,7 +13,7 @@ class GroundPicture < Peta::Element
   
   @@repeat_texts = ['repeat', 'repeat-x', 'repeat-y', 'no-repeat']
   
-  def _y
+  def attr_y
     self.attributes['y']
   end
   
@@ -48,7 +48,7 @@ class GroundPicture < Peta::Element
       'position' => 'absolute', 'top' => '0px', 'left' => '0px', 'z-index' => self.z, 
       'background-image' => "url(#{self.picture.url})", 
       'background-repeat' => self.repeat_text, 
-      'background-position' => "#{self.x}px #{self._y}px"
+      'background-position' => "#{self.x}px #{self.attr_y}px"
     }
     self.merge_opacity(r, opacity) if spot and spot != self
     r
index 54b22b6..a1a1cb2 100644 (file)
@@ -1,4 +1,4 @@
-class OriginalPictureLicenseGroup < ActiveRecord::Base
+class OriginalPictureLicenseGroup < Peta::Item
   belongs_to :original_picture
   belongs_to :license_group
   
index 38995ab..5a60b53 100644 (file)
@@ -13,7 +13,7 @@ class PanelPicture < Peta::Element
   validates :z, :presence => true, :numericality => {:greater_than => 0}
   validates :t, :presence => true, :numericality => {:greater_than_or_equal_to => 0}
   
-  def _y
+  def attr_y
     self.attributes['y']
   end
   
@@ -62,7 +62,7 @@ class PanelPicture < Peta::Element
   end
   
   def opt_div_style
-    "top:#{self._y}px; left:#{self.x}px; z-index:#{self.z}; position: absolute;"
+    "top:#{self.attr_y}px; left:#{self.x}px; z-index:#{self.z}; position: absolute;"
   end
   
   def opt_img_tag spot = nil, opacity = 20
index ceab91e..15b0798 100644 (file)
@@ -13,6 +13,10 @@ class SheetPanel < Peta::Element
   validates :z, :presence => true, :numericality => {:greater_than => 0}
   validates :t, :presence => true, :numericality => {:greater_than_or_equal_to => 0}
   
+  def attr_y
+    self.attributes['y']
+  end
+  
   def supply_default
     self.x = 15
     self.y = 15
index 12cd5b0..f64b002 100644 (file)
@@ -22,6 +22,10 @@ class Speech < Peta::Element
   
   @@text_align_texts = ['left', 'left', 'right', 'center']
   
+  def attr_y
+    self.attributes['y']
+  end
+  
   def supply_default
     self.x = 0
     self.y = 0
@@ -35,7 +39,7 @@ class Speech < Peta::Element
   
   def outer_style
     {
-      'top' => self._y, 'left' => self.x, 
+      'top' => self.attr_y, 'left' => self.x, 
       'width' => self.width, 'height' => self.height
     }
   end
index 6afe8c2..49436c3 100644 (file)
@@ -9,9 +9,8 @@
     <% end %>\r
     - <%= h(manifest.magic_numbers['profile']['users']['caption']) %>\r
   </title>\r
-  <%= stylesheet_link_tag "application" %>\r
+  <%= stylesheet_link_tag "test" %>\r
   <%= javascript_include_tag "application" %>\r
-  <%= raw panel_editor_javascript_include_tags %>\r
   <%= csrf_meta_tags %>\r
 </head>\r
 <body>\r
index 1bd4f61..cec7a5b 100644 (file)
@@ -1,4 +1,4 @@
-<div class="sheet_panel" style="top:<%= elm._y %>px; left:<%= elm.x %>px; z-index:<%= elm.z %>;">
+<div class="sheet_panel" style="top:<%= elm.attr_y %>px; left:<%= elm.x %>px; z-index:<%= elm.z %>;">
   <% if elm.panel -%>
     <%# blocked in panels/body panel = Panel.show elm.panel, author -%>
     <%= render 'panels/body', :panel => elm.panel, :operators => operators, :spot => nil %>
index 9c13327..71eb6cf 100644 (file)
@@ -72,7 +72,7 @@ module Locmare
     end
     
     def init_fields
-      @manifest.each_field do |field_name, field_manifest| 
+      @manifest.each_field do |field_name, field_manifest|
         boost_name = @item.class.find_boost_name(field_name)
         extend_model = if boost_name 
           @item.boosters[boost_name].extend_model
index f62ce44..ef33ae8 100644 (file)
         "width",\r
         "height",\r
         "quotes",\r
-        "speech_balloon_template_settings",\r
-        "writing_format_settings"\r
+        "speech_balloon_template_settings"\r
       ],\r
       "associations": {\r
         "belongs_to": [\r
         },\r
         "speech_balloon_template_settings": {\r
           "row_break": true\r
-        },\r
-        "writing_format_settings": {\r
-          "label": {\r
-            "type": "none"\r
-          },\r
-          "tag": {\r
-            "type": "hidden"\r
-          }\r
         }\r
       },\r
       "field_names": [\r
         "speech_balloon_template_id",\r
         "speech_balloon_template_module_name",\r
         "speech_balloon_template_settings",\r
-        "writing_format_module_name",\r
-        "writing_format_settings"\r
+        "writing_format_module_name"\r
       ]\r
     },\r
     "ground_picture": {\r
       "fields": {},\r
       "field_names": []\r
     },\r
+    "plain_speech_balloon_speech_balloon": {\r
+      "fields": {},\r
+      "field_names": []\r
+    },\r
+    "plain_speech_balloon_balloon": {\r
+      "fields": {},\r
+      "field_names": []\r
+    },\r
+    "plain_speech_balloon_speech": {\r
+      "fields": {},\r
+      "field_names": []\r
+    },\r
+    "square_speech_balloon_speech_balloon": {\r
+      "fields": {},\r
+      "field_names": []\r
+    },\r
+    "square_speech_balloon_balloon": {\r
+      "fields": {},\r
+      "field_names": []\r
+    },\r
+    "square_speech_balloon_speech": {\r
+      "fields": {},\r
+      "field_names": []\r
+    },\r
     "test_speech_balloon_speech_balloon": {\r
       "fields": {\r
         "a": {\r
         "speech.speech_balloon_template_id",\r
         "speech.speech_balloon_template_module_name",\r
         "speech.speech_balloon_template_settings",\r
-        "speech.writing_format_module_name",\r
-        "speech.writing_format_settings"\r
+        "speech.writing_format_module_name"\r
       ]\r
     },\r
     "speech": {},\r
index d3943fd..ea5ca53 100644 (file)
         }\r
       }\r
     },\r
+    "original_picture_license_group": {\r
+      "args": {\r
+        "boost": {\r
+          "license_group": {\r
+            "extend_model_class_name": "Attribute",\r
+            "item_name_for_extend_model": "attribute"\r
+          },\r
+          "credit_picture": {\r
+            "template_name": "license_group",\r
+            "extend_model_class_name": "CreditPicture",\r
+            "item_name_for_extend_model": "credit_picture"\r
+          }\r
+        }\r
+      }\r
+    },\r
     "speech_balloon_template": {\r
       "type": "template"\r
     },\r
         }\r
       }\r
     },\r
+    "original_picture_license_group": {\r
+      "attributes": {}\r
+    },\r
     "speech_balloon_template": {\r
       "associations": {\r
         "belongs_to": {\r
       }\r
     },\r
     "circle_speech_balloon_speech_balloon": {\r
+      "attributes": {}\r
+    },\r
+    "circle_speech_balloon_balloon": {\r
+      "attributes": {}\r
+    },\r
+    "circle_speech_balloon_speech": {\r
+      "attributes": {}\r
+    },\r
+    "plain_speech_balloon_speech_balloon": {\r
+      "attributes": {}\r
+    },\r
+    "plain_speech_balloon_balloon": {\r
+      "attributes": {}\r
+    },\r
+    "plain_speech_balloon_speech": {\r
+      "attributes": {}\r
+    },\r
+    "square_speech_balloon_speech_balloon": {\r
+      "attributes": {}\r
+    },\r
+    "square_speech_balloon_balloon": {\r
+      "attributes": {}\r
+    },\r
+    "square_speech_balloon_speech": {\r
+      "attributes": {}\r
+    },\r
+    "test_speech_balloon_speech_balloon": {\r
       "attributes": {\r
-        "width": {\r
+        "a": {\r
+          "type": "number",\r
+          "rules": {\r
+            "required": true,\r
+            "number": true\r
+          }\r
+        }\r
+      }\r
+    },\r
+    "test_speech_balloon_balloon": {\r
+      "attributes": {\r
+        "b": {\r
+          "type": "number",\r
+          "rules": {\r
+            "required": true,\r
+            "number": true\r
+          }\r
+        }\r
+      }\r
+    },\r
+    "test_speech_balloon_speech": {\r
+      "attributes": {\r
+        "c": {\r
           "type": "number",\r
           "rules": {\r
             "required": true,\r