From ae65f3fa406f90544b2afa166a274746bebce68d Mon Sep 17 00:00:00 2001 From: yasushiito Date: Wed, 26 Mar 2014 08:46:47 +0900 Subject: [PATCH] fix remove tree --- .../javascripts/manifest/work/items.js.coffee.erb | 103 + .../javascripts/manifest/work/models.js.coffee.erb | 78 - app/assets/javascripts/panels.js.coffee | 1 + app/assets/javascripts/system.js.coffee | 1 + config/environments/development.rb | 1 - .../list_group/list/includes/auto.rb | 15 +- lib/locmare/list_group/list/private.rb | 6 +- lib/manifest.rb | 1 + lib/manifest/item.rb | 22 + lib/manifest/item/base.rb | 16 + lib/manifest/item/binder.rb | 16 + lib/manifest/item/content.rb | 15 + lib/manifest/item/element.rb | 18 + lib/manifest/item/item.rb | 15 + lib/manifest/item/leaf.rb | 18 + lib/manifest/item/owner.rb | 15 + lib/manifest/item/root.rb | 16 + lib/manifest/manifest.rb | 3 +- lib/manifest/model.rb | 5 +- lib/manifest/model/association.rb | 14 + lib/manifest/model/association/has_many.rb | 6 +- lib/manifest/model/association/has_one.rb | 4 + lib/manifest/model/peta.rb | 24 - lib/manifest/model/peta/base.rb | 18 - lib/manifest/model/peta/binder.rb | 21 - lib/manifest/model/peta/content.rb | 18 - lib/manifest/model/peta/element.rb | 21 - lib/manifest/model/peta/item.rb | 18 - lib/manifest/model/peta/leaf.rb | 18 - lib/manifest/model/peta/owner.rb | 18 - lib/manifest/model/peta/root.rb | 21 - lib/peta/binder.rb | 2 +- lib/peta/element.rb | 22 + lib/peta/element_nestable_content.rb | 2 +- lib/peta/item.rb | 18 +- lib/peta/leaf.rb | 19 + public/manifest.json | 2879 +------------------- 37 files changed, 448 insertions(+), 3060 deletions(-) create mode 100644 app/assets/javascripts/manifest/work/items.js.coffee.erb create mode 100644 lib/manifest/item.rb create mode 100644 lib/manifest/item/base.rb create mode 100644 lib/manifest/item/binder.rb create mode 100644 lib/manifest/item/content.rb create mode 100644 lib/manifest/item/element.rb create mode 100644 lib/manifest/item/item.rb create mode 100644 lib/manifest/item/leaf.rb create mode 100644 lib/manifest/item/owner.rb create mode 100644 lib/manifest/item/root.rb delete mode 100644 lib/manifest/model/peta.rb delete mode 100644 lib/manifest/model/peta/base.rb delete mode 100644 lib/manifest/model/peta/binder.rb delete mode 100644 lib/manifest/model/peta/content.rb delete mode 100644 lib/manifest/model/peta/element.rb delete mode 100644 lib/manifest/model/peta/item.rb delete mode 100644 lib/manifest/model/peta/leaf.rb delete mode 100644 lib/manifest/model/peta/owner.rb delete mode 100644 lib/manifest/model/peta/root.rb diff --git a/app/assets/javascripts/manifest/work/items.js.coffee.erb b/app/assets/javascripts/manifest/work/items.js.coffee.erb new file mode 100644 index 00000000..41defde9 --- /dev/null +++ b/app/assets/javascripts/manifest/work/items.js.coffee.erb @@ -0,0 +1,103 @@ +#マニフェスト +@items = { + scroll: { + type: 'binder', + args: { + }, + }, + scroll_panel: { + type: 'leaf', + args: { + parent_model_name: 'scroll', + }, + }, + comic: { + type: 'binder', + args: { + }, + }, + story: { + type: 'binder', + args: { + }, + }, + story_sheet: { + type: 'leaf', + args: { + parent_model_name: 'story', + }, + }, + sheet: { + type: 'root', + args: { + }, + }, + sheet_panel: { + type: 'element', + args: { + parent_model_name: 'sheet', + }, + }, + panel: { + type: 'root', + args: { + }, + }, + panel_picture: { + type: 'element', + args: { + parent_model_name: 'panel', + }, + }, + speech_balloon: { + type: 'element', + args: { + parent_model_name: 'speech_balloon', + }, + }, + balloon: { + type: 'element', + args: { + parent_model_name: 'speech_balloon', + }, + }, + speech: { + type: 'element', + args: { + parent_model_name: 'scroll', + }, + }, + ground_picture: { + type: 'element', + args: { + parent_model_name: 'panel', + }, + }, + ground_color: { + type: 'element', + args: { + parent_model_name: 'panel', + }, + }, + original_picture: { + }, + picture: { + }, + resource_picture: { + }, + speech_balloon_template: { + }, + writing_format: { + }, + license_group: { + }, + license: { + }, + author: { + }, + artist: { + }, + system_picture: { + }, +} + diff --git a/app/assets/javascripts/manifest/work/models.js.coffee.erb b/app/assets/javascripts/manifest/work/models.js.coffee.erb index 8437e64c..5ba5d44c 100644 --- a/app/assets/javascripts/manifest/work/models.js.coffee.erb +++ b/app/assets/javascripts/manifest/work/models.js.coffee.erb @@ -1,12 +1,6 @@ #マニフェスト @models = { scroll: { - peta: { - type: 'binder', - args: { - leaf_tree_name: 'owner', - }, - }, associations: { belongs_to: { author: { @@ -58,9 +52,6 @@ }, }, scroll_panel: { - peta: { - type: 'leaf', - }, associations: { belongs_to: { panel: { @@ -108,12 +99,6 @@ }, }, comic: { - peta: { - type: 'binder', - args: { - leaf_tree_name: 'owner', - }, - }, associations: { belongs_to: { author: { @@ -162,12 +147,6 @@ }, }, story: { - peta: { - type: 'binder', - args: { - leaf_tree_name: 'owner', - }, - }, associations: { belongs_to: { comic: { @@ -226,9 +205,6 @@ }, }, story_sheet: { - peta: { - type: 'leaf', - }, associations: { belongs_to: { story: { @@ -274,12 +250,6 @@ }, }, sheet: { - peta: { - type: 'root', - args: { - element_tree_name: 'owner', - }, - }, associations: { belongs_to: { author: { @@ -344,12 +314,6 @@ }, }, sheet_panel: { - peta: { - type: 'element', - args: { - element_tree_name: 'owner', - }, - }, associations: { belongs_to: { sheet: { @@ -416,12 +380,6 @@ }, }, panel: { - peta: { - type: 'root', - args: { - element_tree_name: 'panel', - }, - }, associations: { belongs_to: { author: { @@ -504,12 +462,6 @@ }, }, panel_picture: { - peta: { - type: 'element', - args: { - element_tree_name: 'panel', - }, - }, associations: { belongs_to: { panel: { @@ -595,12 +547,6 @@ }, }, speech_balloon: { - peta: { - type: 'element', - args: { - element_tree_name: 'panel', - }, - }, extend_column_name: 'classname', associations: { belongs_to: { @@ -670,12 +616,6 @@ }, }, balloon: { - peta: { - type: 'element', - args: { - element_tree_name: 'panel', - }, - }, associations: { belongs_to: { speech_balloon: { @@ -750,12 +690,6 @@ }, }, speech: { - peta: { - type: 'element', - args: { - element_tree_name: 'panel', - }, - }, associations: { belongs_to: { speech_balloon: { @@ -872,12 +806,6 @@ }, }, ground_picture: { - peta: { - type: 'element', - args: { - element_tree_name: 'panel', - }, - }, associations: { belongs_to: { panel: { @@ -957,12 +885,6 @@ }, }, ground_color: { - peta: { - type: 'element', - args: { - element_tree_name: 'panel', - }, - }, associations: { belongs_to: { panel: { diff --git a/app/assets/javascripts/panels.js.coffee b/app/assets/javascripts/panels.js.coffee index c8462002..efa51517 100644 --- a/app/assets/javascripts/panels.js.coffee +++ b/app/assets/javascripts/panels.js.coffee @@ -9,6 +9,7 @@ $ -> confirm( ) editor = window.PettanrEditor manifest = { + items: window.items, controllers: window.controllers, models: window.models, system_resources: window.system_resources, diff --git a/app/assets/javascripts/system.js.coffee b/app/assets/javascripts/system.js.coffee index e51224a8..08c9c074 100644 --- a/app/assets/javascripts/system.js.coffee +++ b/app/assets/javascripts/system.js.coffee @@ -1,5 +1,6 @@ $ -> manifest = { + items: window.items, controllers: window.controllers, models: window.models, system_resources: window.system_resources, diff --git a/config/environments/development.rb b/config/environments/development.rb index 0cbf0483..9eea6b01 100644 --- a/config/environments/development.rb +++ b/config/environments/development.rb @@ -2,7 +2,6 @@ Pettanr::Application.configure do ActiveSupport::Dependencies.autoload_paths << File::join( Rails.root, 'lib') ActiveSupport::Dependencies.explicitly_unloadable_constants << 'Editor' - ActiveSupport::Dependencies.explicitly_unloadable_constants << 'Peta' ActiveSupport::Dependencies.explicitly_unloadable_constants << 'ManifestBase' ActiveSupport::Dependencies.explicitly_unloadable_constants << 'Manifest' ActiveSupport::Dependencies.explicitly_unloadable_constants << 'LocalManifest' diff --git a/lib/local_manifest/list_group/list/includes/auto.rb b/lib/local_manifest/list_group/list/includes/auto.rb index cc30cfd8..26661681 100644 --- a/lib/local_manifest/list_group/list/includes/auto.rb +++ b/lib/local_manifest/list_group/list/includes/auto.rb @@ -23,9 +23,20 @@ module LocalManifest self.model_manifest.tree[self.list_group.tree_name] end + def parent_includes parent_model + p parent_model.item_name + if parent_model.parent_model + p ({parent_model.item_name => parent_includes(parent_model.parent_model)}) + {parent_model.item_name => parent_includes(parent_model.parent_model)} + else + {parent_model.item_name => {}} + end + end + def includes - if self.tree_manifest - self.tree_manifest.include_hash + p self.model.item_name + if self.model.parent_model + self.parent_includes self.model.parent_model else {} end diff --git a/lib/locmare/list_group/list/private.rb b/lib/locmare/list_group/list/private.rb index c583bcfc..0ab82b6d 100644 --- a/lib/locmare/list_group/list/private.rb +++ b/lib/locmare/list_group/list/private.rb @@ -8,7 +8,11 @@ module Locmare end def where_condition operators - owner_model = @model_manifest.tree[@tree_name].root_model + owner_model = if tree = @model_manifest.tree[@tree_name] + @model_manifest.tree[@tree_name].root_model + else + @model + end case owner_model.owner_type when :author operator = operators.author diff --git a/lib/manifest.rb b/lib/manifest.rb index 43291513..03191407 100644 --- a/lib/manifest.rb +++ b/lib/manifest.rb @@ -1,5 +1,6 @@ require_dependency 'manifest_base/manifest_base' require_dependency "manifest/manifest" +require_dependency "manifest/item" require_dependency "manifest/controller" require_dependency "manifest/model" require_dependency "manifest/system_resource" diff --git a/lib/manifest/item.rb b/lib/manifest/item.rb new file mode 100644 index 00000000..5bc58a52 --- /dev/null +++ b/lib/manifest/item.rb @@ -0,0 +1,22 @@ +ManifestBase.require_modules "manifest/item/", + %w|base item owner content root element binder leaf| + +module Manifest + class ItemFactory < ManifestBase::Factory + include ItemModule + + def self.types + { + 'item' => ItemPeta, 'owner' => OwnerPeta, 'content' => ContentPeta, + 'root' => RootPeta, 'element' => ElementPeta, + 'binder' => BinderPeta, 'leaf' => LeafPeta + } + end + + def self.default_type + 'item' + end + + end +end + diff --git a/lib/manifest/item/base.rb b/lib/manifest/item/base.rb new file mode 100644 index 00000000..c3a901f1 --- /dev/null +++ b/lib/manifest/item/base.rb @@ -0,0 +1,16 @@ +module Manifest + module ItemModule + class BasePeta < ManifestBase::TypeNameArgs + + def set_default + super + end + + def init + super + end + + end + + end +end diff --git a/lib/manifest/item/binder.rb b/lib/manifest/item/binder.rb new file mode 100644 index 00000000..1e18b275 --- /dev/null +++ b/lib/manifest/item/binder.rb @@ -0,0 +1,16 @@ +module Manifest + module ItemModule + class BinderPeta < BasePeta + attr :leaf_tree_name + + def set_default + super + end + + def init + super + end + + end + end +end diff --git a/lib/manifest/item/content.rb b/lib/manifest/item/content.rb new file mode 100644 index 00000000..c64303b1 --- /dev/null +++ b/lib/manifest/item/content.rb @@ -0,0 +1,15 @@ +module Manifest + module ItemModule + class ContentPeta < BasePeta + + def set_default + super + end + + def init + super + end + + end + end +end diff --git a/lib/manifest/item/element.rb b/lib/manifest/item/element.rb new file mode 100644 index 00000000..9a4ed72d --- /dev/null +++ b/lib/manifest/item/element.rb @@ -0,0 +1,18 @@ +module Manifest + module ItemModule + class ElementPeta < BasePeta + attr :parent_model_name + + def set_default + super + ManifestBase.alert_undefined_message 'parent_model_name', self.module_message unless @args['parent_model_name'] + end + + def init + super + @parent_model_name = @args['parent_model_name'] + end + + end + end +end diff --git a/lib/manifest/item/item.rb b/lib/manifest/item/item.rb new file mode 100644 index 00000000..636e8252 --- /dev/null +++ b/lib/manifest/item/item.rb @@ -0,0 +1,15 @@ +module Manifest + module ItemModule + class ItemPeta < BasePeta + + def set_default + super + end + + def init + super + end + + end + end +end diff --git a/lib/manifest/item/leaf.rb b/lib/manifest/item/leaf.rb new file mode 100644 index 00000000..519e6fd7 --- /dev/null +++ b/lib/manifest/item/leaf.rb @@ -0,0 +1,18 @@ +module Manifest + module ItemModule + class LeafPeta < BasePeta + attr :parent_model_name + + def set_default + super + ManifestBase.alert_undefined_message 'parent_model_name', self.module_message unless @args['parent_model_name'] + end + + def init + super + @parent_model_name = @args['parent_model_name'] + end + + end + end +end diff --git a/lib/manifest/item/owner.rb b/lib/manifest/item/owner.rb new file mode 100644 index 00000000..6b9d76a7 --- /dev/null +++ b/lib/manifest/item/owner.rb @@ -0,0 +1,15 @@ +module Manifest + module ItemModule + class OwnerPeta < BasePeta + + def set_default + super + end + + def init + super + end + + end + end +end diff --git a/lib/manifest/item/root.rb b/lib/manifest/item/root.rb new file mode 100644 index 00000000..be050820 --- /dev/null +++ b/lib/manifest/item/root.rb @@ -0,0 +1,16 @@ +module Manifest + module ItemModule + class RootPeta < BasePeta + attr :element_tree_name + + def set_default + super + end + + def init + super + end + + end + end +end diff --git a/lib/manifest/manifest.rb b/lib/manifest/manifest.rb index 69ea9962..070d7120 100644 --- a/lib/manifest/manifest.rb +++ b/lib/manifest/manifest.rb @@ -2,7 +2,7 @@ module Manifest class Manifest cattr_accessor :manifest attr :system_resources, :magic_numbers, - :controllers, :models, :module_names + :items, :controllers, :models, :module_names # call me before load routes.rb # routes.rb needs engine_resources manifest in system_resources # ex. it's adding license_groups routes @@ -16,6 +16,7 @@ module Manifest def init # managers can't initialize before load application.rb return unless defined? ::Pettanr + @items = ManifestBase.load_type_name_args(self, @global_json, 'items', ItemFactory) @controllers = Controller.load(self, @global_json, 'controllers') @models = Model.load(self, @global_json, 'models') end diff --git a/lib/manifest/model.rb b/lib/manifest/model.rb index 6b860714..c225c382 100644 --- a/lib/manifest/model.rb +++ b/lib/manifest/model.rb @@ -1,11 +1,11 @@ ManifestBase.require_modules "manifest/model/", - %w|attribute association list tree peta| + %w|attribute association list tree| module Manifest class Model < ManifestBase::Base include ModelModule - attr :attributes, :associations, :tree, :list, :peta, :extend_column_name + attr :attributes, :associations, :tree, :list, :extend_column_name def set_default super @@ -38,7 +38,6 @@ module Manifest @json['tree'].each {|tree_name, parent_model_name| @tree[tree_name] = Tree.new(self, tree_name, parent_model_name) } - @peta = ManifestBase.load_type_args(self, @json, 'peta', PetaFactory) @extend_column_name = @json['extend_column_name'] @list = ManifestBase.load_value self, @json, 'list', List end diff --git a/lib/manifest/model/association.rb b/lib/manifest/model/association.rb index 07246649..b9e101c4 100644 --- a/lib/manifest/model/association.rb +++ b/lib/manifest/model/association.rb @@ -26,6 +26,20 @@ module Manifest @parent.name end + def each_parent_model + @belongs_to.each do |name, belongs_to_manifest| + next unless @parent.classify.element? + if @parent.classify.my_peta.type == 'element' + next unless belongs_to_manifest.model.my_peta.type == 'root' + end + if @parent.classify.my_peta.type == 'leaf' + next unless belongs_to_manifest.model.my_peta.type == 'binder' + end + p [@parent.classify , belongs_to_manifest.model] + yield belongs_to_manifest.model + end + end + def child_element_name child_model if @has_one[child_model.item_name] child_model.item_name diff --git a/lib/manifest/model/association/has_many.rb b/lib/manifest/model/association/has_many.rb index 2d5e7dde..98ed7310 100644 --- a/lib/manifest/model/association/has_many.rb +++ b/lib/manifest/model/association/has_many.rb @@ -6,7 +6,7 @@ module Manifest def set_default super - @values['model_name'] ||= @name.singularize + @values['model_name'] ||= ::Manifest.singularize @name @values['foreign_key'] ||= @parent.model_name + '_id' end @@ -17,6 +17,10 @@ module Manifest @through = @values['through'] end + def through? + @through.blank? == false + end + def model ::Manifest.item_name_to_model @model_name end diff --git a/lib/manifest/model/association/has_one.rb b/lib/manifest/model/association/has_one.rb index 6db1fc55..20f0721d 100644 --- a/lib/manifest/model/association/has_one.rb +++ b/lib/manifest/model/association/has_one.rb @@ -16,6 +16,10 @@ module Manifest @foreign_key = @values['foreign_key'] end + def through? + @through.blank? == false + end + def model ::Manifest.item_name_to_model @model_name end diff --git a/lib/manifest/model/peta.rb b/lib/manifest/model/peta.rb deleted file mode 100644 index c23fb47c..00000000 --- a/lib/manifest/model/peta.rb +++ /dev/null @@ -1,24 +0,0 @@ -ManifestBase.require_modules "manifest/model/peta/", - %w|base item owner content root element binder leaf| - -module Manifest - module ModelModule - class PetaFactory < ManifestBase::Factory - include PetaModule - - def self.types - { - 'item' => ItemPeta, 'owner' => OwnerPeta, 'content' => ContentPeta, - 'root' => RootPeta, 'element' => ElementPeta, - 'binder' => BinderPeta, 'leaf' => LeafPeta - } - end - - def self.default_type - 'item' - end - - end - - end -end diff --git a/lib/manifest/model/peta/base.rb b/lib/manifest/model/peta/base.rb deleted file mode 100644 index ce562eeb..00000000 --- a/lib/manifest/model/peta/base.rb +++ /dev/null @@ -1,18 +0,0 @@ -module Manifest - module ModelModule - module PetaModule - class BasePeta < ManifestBase::TypeArgs - - def set_default - super - end - - def init - super - end - - end - - end - end -end diff --git a/lib/manifest/model/peta/binder.rb b/lib/manifest/model/peta/binder.rb deleted file mode 100644 index 8c59a844..00000000 --- a/lib/manifest/model/peta/binder.rb +++ /dev/null @@ -1,21 +0,0 @@ -module Manifest - module ModelModule - module PetaModule - class BinderPeta < BasePeta - attr :leaf_tree_name - - def set_default - super - ManifestBase.alert_undefined_message 'leaf_tree_name', self.module_message unless @args['leaf_tree_name'] - end - - def init - super - @leaf_tree_name = @args['leaf_tree_name'] - end - - end - - end - end -end diff --git a/lib/manifest/model/peta/content.rb b/lib/manifest/model/peta/content.rb deleted file mode 100644 index 2c134c93..00000000 --- a/lib/manifest/model/peta/content.rb +++ /dev/null @@ -1,18 +0,0 @@ -module Manifest - module ModelModule - module PetaModule - class ContentPeta < BasePeta - - def set_default - super - end - - def init - super - end - - end - - end - end -end diff --git a/lib/manifest/model/peta/element.rb b/lib/manifest/model/peta/element.rb deleted file mode 100644 index 28a5a718..00000000 --- a/lib/manifest/model/peta/element.rb +++ /dev/null @@ -1,21 +0,0 @@ -module Manifest - module ModelModule - module PetaModule - class ElementPeta < BasePeta - attr :element_tree_name - - def set_default - super - ManifestBase.alert_undefined_message 'element_tree_name', self.module_message unless @args['element_tree_name'] - end - - def init - super - @element_tree_name = @args['element_tree_name'] - end - - end - - end - end -end diff --git a/lib/manifest/model/peta/item.rb b/lib/manifest/model/peta/item.rb deleted file mode 100644 index 9a9fbf20..00000000 --- a/lib/manifest/model/peta/item.rb +++ /dev/null @@ -1,18 +0,0 @@ -module Manifest - module ModelModule - module PetaModule - class ItemPeta < BasePeta - - def set_default - super - end - - def init - super - end - - end - - end - end -end diff --git a/lib/manifest/model/peta/leaf.rb b/lib/manifest/model/peta/leaf.rb deleted file mode 100644 index ad672f33..00000000 --- a/lib/manifest/model/peta/leaf.rb +++ /dev/null @@ -1,18 +0,0 @@ -module Manifest - module ModelModule - module PetaModule - class LeafPeta < BasePeta - - def set_default - super - end - - def init - super - end - - end - - end - end -end diff --git a/lib/manifest/model/peta/owner.rb b/lib/manifest/model/peta/owner.rb deleted file mode 100644 index be63c290..00000000 --- a/lib/manifest/model/peta/owner.rb +++ /dev/null @@ -1,18 +0,0 @@ -module Manifest - module ModelModule - module PetaModule - class OwnerPeta < BasePeta - - def set_default - super - end - - def init - super - end - - end - - end - end -end diff --git a/lib/manifest/model/peta/root.rb b/lib/manifest/model/peta/root.rb deleted file mode 100644 index e5963ecb..00000000 --- a/lib/manifest/model/peta/root.rb +++ /dev/null @@ -1,21 +0,0 @@ -module Manifest - module ModelModule - module PetaModule - class RootPeta < BasePeta - attr :element_tree_name - - def set_default - super - ManifestBase.alert_undefined_message 'element_tree_name', self.module_message unless @args['element_tree_name'] - end - - def init - super - @element_tree_name = @args['element_tree_name'] - end - - end - - end - end -end diff --git a/lib/peta/binder.rb b/lib/peta/binder.rb index 9d0aa6c1..64b52e6c 100644 --- a/lib/peta/binder.rb +++ b/lib/peta/binder.rb @@ -5,7 +5,7 @@ module Peta # Dynamic Methods def self._leaf_tree_name - self.my_manifest.peta.leaf_tree_name + self.my_peta.leaf_tree_name end def self.load_manifest diff --git a/lib/peta/element.rb b/lib/peta/element.rb index ccdbbf86..d666e714 100644 --- a/lib/peta/element.rb +++ b/lib/peta/element.rb @@ -4,6 +4,28 @@ module Peta # Dynamic ClassMethods + def self.load_manifest + super + # Class Methods + self.my_manifest.associations.each_parent_model do |parent_model| + define_singleton_method("parent_model") do + parent_model + end + end + # Instance Methods + end + + def self.element? + true + end + + def self.root_model + if self.parent_model + self.parent_model.root_model + else + self + end + end def self.list_opt_for_panel {} diff --git a/lib/peta/element_nestable_content.rb b/lib/peta/element_nestable_content.rb index eed0fa19..315bdce8 100644 --- a/lib/peta/element_nestable_content.rb +++ b/lib/peta/element_nestable_content.rb @@ -5,7 +5,7 @@ module Peta # Dynamic Methods def self._element_tree_name - self.my_manifest.peta.element_tree_name + self.my_peta.element_tree_name end def self.load_manifest diff --git a/lib/peta/item.rb b/lib/peta/item.rb index b6ac63da..cfd771ca 100644 --- a/lib/peta/item.rb +++ b/lib/peta/item.rb @@ -18,7 +18,7 @@ module Peta define_singleton_method("valid_encode_columns") do r end - define_singleton_method("parent_model") do |tree_name| + define_singleton_method("parent_modela") do |tree_name| self.my_manifest.tree[tree_name].parent_model end define_singleton_method("child_models") do |tree_name| @@ -40,6 +40,10 @@ module Peta before_validation :valid_encode + def self.my_peta + Manifest.manifest.items[self.item_name] + end + def self.my_manifest Manifest.manifest.models[self.item_name] end @@ -64,6 +68,18 @@ module Peta false end + def self.element? + false + end + + def self.root? + false + end + + def self.parent_model + nil + end + def self.path_name with_engine = false self.plural.underscore end diff --git a/lib/peta/leaf.rb b/lib/peta/leaf.rb index 8dedbd6d..81574a9c 100644 --- a/lib/peta/leaf.rb +++ b/lib/peta/leaf.rb @@ -4,6 +4,25 @@ module Peta # Dynamic ClassMethods + def self.load_manifest + super + # Class Methods + self.my_manifest.associations.each_parent_model do |parent_model| + define_singleton_method("parent_model") do + parent_model + end + end + # Instance Methods + end + + def self.element? + true + end + + def self.root_model + self.parent_model + end + def self.play_list_where cid ['scroll_panels.scroll_id = ?', cid] end diff --git a/public/manifest.json b/public/manifest.json index 370e21c3..fe97bc51 100644 --- a/public/manifest.json +++ b/public/manifest.json @@ -1,4 +1,90 @@ { + "items": { + "scroll": { + "type": "binder", + "args": {} + }, + "scroll_panel": { + "type": "leaf", + "args": { + "parent_model_name_name": "scroll" + } + }, + "comic": { + "type": "binder", + "args": {} + }, + "story": { + "type": "binder", + "args": {} + }, + "story_sheet": { + "type": "leaf", + "args": { + "parent_model_name": "story" + } + }, + "sheet": { + "type": "root", + "args": {} + }, + "sheet_panel": { + "type": "element", + "args": { + "parent_model_name": "sheet" + } + }, + "panel": { + "type": "root", + "args": {} + }, + "panel_picture": { + "type": "element", + "args": { + "parent_model_name": "panel" + } + }, + "speech_balloon": { + "type": "element", + "args": { + "parent_model_name": "speech_balloon" + } + }, + "balloon": { + "type": "element", + "args": { + "parent_model_name": "speech_balloon" + } + }, + "speech": { + "type": "element", + "args": { + "parent_model_name": "scroll" + } + }, + "ground_picture": { + "type": "element", + "args": { + "parent_model_name": "panel" + } + }, + "ground_color": { + "type": "element", + "args": { + "parent_model_name": "panel" + } + }, + "original_picture": {}, + "picture": {}, + "resource_picture": {}, + "speech_balloon_template": {}, + "writing_format": {}, + "license_group": {}, + "license": {}, + "author": {}, + "artist": {}, + "system_picture": {} + }, "controllers": { "scrolls": { "actions": { @@ -896,12 +982,6 @@ }, "models": { "scroll": { - "peta": { - "type": "binder", - "args": { - "leaf_tree_name": "owner" - } - }, "associations": { "belongs_to": { "author": {} @@ -950,9 +1030,6 @@ } }, "scroll_panel": { - "peta": { - "type": "leaf" - }, "associations": { "belongs_to": { "panel": {}, @@ -997,12 +1074,6 @@ } }, "comic": { - "peta": { - "type": "binder", - "args": { - "leaf_tree_name": "owner" - } - }, "associations": { "belongs_to": { "author": {} @@ -1048,12 +1119,6 @@ } }, "story": { - "peta": { - "type": "binder", - "args": { - "leaf_tree_name": "owner" - } - }, "associations": { "belongs_to": { "comic": {} @@ -1108,9 +1173,6 @@ } }, "story_sheet": { - "peta": { - "type": "leaf" - }, "associations": { "belongs_to": { "story": {}, @@ -1153,12 +1215,6 @@ } }, "sheet": { - "peta": { - "type": "root", - "args": { - "element_tree_name": "owner" - } - }, "associations": { "belongs_to": { "author": {} @@ -1219,12 +1275,6 @@ } }, "sheet_panel": { - "peta": { - "type": "element", - "args": { - "element_tree_name": "owner" - } - }, "associations": { "belongs_to": { "sheet": {}, @@ -1288,12 +1338,6 @@ } }, "panel": { - "peta": { - "type": "root", - "args": { - "element_tree_name": "panel" - } - }, "associations": { "belongs_to": { "author": {} @@ -1368,12 +1412,6 @@ } }, "panel_picture": { - "peta": { - "type": "element", - "args": { - "element_tree_name": "panel" - } - }, "associations": { "belongs_to": { "panel": {} @@ -1456,12 +1494,6 @@ } }, "speech_balloon": { - "peta": { - "type": "element", - "args": { - "element_tree_name": "panel" - } - }, "extend_column_name": "classname", "associations": { "belongs_to": { @@ -1525,12 +1557,6 @@ } }, "balloon": { - "peta": { - "type": "element", - "args": { - "element_tree_name": "panel" - } - }, "associations": { "belongs_to": { "speech_balloon": {}, @@ -1601,12 +1627,6 @@ } }, "speech": { - "peta": { - "type": "element", - "args": { - "element_tree_name": "panel" - } - }, "associations": { "belongs_to": { "speech_balloon": {}, @@ -1723,12 +1743,6 @@ } }, "ground_picture": { - "peta": { - "type": "element", - "args": { - "element_tree_name": "panel" - } - }, "associations": { "belongs_to": { "panel": {} @@ -1808,12 +1822,6 @@ } }, "ground_color": { - "peta": { - "type": "element", - "args": { - "element_tree_name": "panel" - } - }, "associations": { "belongs_to": { "panel": {} @@ -2669,2720 +2677,5 @@ "provider_sources": [ "http://sourceforge.jp/projects/pettanr/wiki/ProviderSource/attach/provider_source.json" ] - }, - "locals": { - "profilers": { - "scroll": { - "column_names": [ - "title", - "description", - "visible", - "author_id" - ], - "associations": { - "belongs_to": [ - "author" - ], - "has_many": [ - "scroll_panels.by_scroll", - "panels.by_scroll" - ] - } - }, - "scroll_panel": { - "column_names": [ - "scroll_id", - "panel_id", - "t", - "author_id" - ], - "associations": { - "belongs_to": [ - "scroll", - "panel" - ] - } - }, - "comic": { - "column_names": [ - "title", - "description", - "visible", - "author_id" - ], - "associations": { - "belongs_to": [ - "author" - ], - "has_many": [ - "stories.by_comic" - ] - } - }, - "story": { - "column_names": [ - "comic_id", - "title", - "description", - "t", - "visible" - ], - "associations": { - "belongs_to": [ - "comic" - ], - "has_many": [ - "story_sheets.by_story", - "sheets.by_story" - ] - } - }, - "story_sheet": { - "column_names": [ - "story_id", - "sheet_id", - "t", - "author_id" - ], - "associations": { - "belongs_to": [ - "story", - "sheet" - ] - } - }, - "sheet": { - "column_names": [ - "caption", - "width", - "height", - "visible", - "author_id" - ], - "associations": { - "belongs_to": [ - "author" - ], - "has_many": [ - "story_sheets.by_sheet", - "stories.by_sheet", - "sheet_panels.by_sheet", - "panels.by_sheet" - ] - } - }, - "sheet_panel": { - "column_names": [ - "sheet_id", - "panel_id", - "x", - "y", - "z", - "t", - "author_id" - ], - "associations": { - "belongs_to": [ - "sheet", - "panel" - ] - } - }, - "panel": { - "column_names": [ - "width", - "height", - "border", - "caption", - "publish", - "author_id" - ], - "associations": { - "belongs_to": [ - "author" - ], - "has_many": [ - "scroll_panels.by_panel", - "scrolls.by_panel", - "sheet_panels.by_panel", - "sheets.by_panel", - "panel_pictures.by_panel", - "speech_balloons.by_panel", - "ground_pictures.by_panel", - "ground_colors.by_panel" - ] - } - }, - "panel_picture": { - "column_names": [ - "panel_id", - "picture_id", - "caption", - "x", - "y", - "width", - "height", - "link", - "z", - "t" - ], - "associations": { - "belongs_to": [ - "panel" - ] - } - }, - "speech_balloon": { - "column_names": [ - "panel_id", - "speech_balloon_template_id", - "classname", - "z", - "t", - "settings", - "caption" - ], - "associations": { - "belongs_to": [ - "panel" - ], - "has_one": [ - "balloon.by_speech_balloon", - "speech.by_speech_balloon" - ] - } - }, - "speech": { - "column_names": [ - "speech_balloon_id", - "writing_format_id", - "content", - "font_size", - "text_align", - "fore_color", - "x", - "y", - "width", - "height", - "quotes", - "settings" - ], - "associations": { - "belongs_to": [ - "speech_balloon", - "writing_format" - ] - } - }, - "balloon": { - "column_names": [ - "speech_balloon_id", - "system_picture_id", - "x", - "y", - "width", - "height", - "r", - "settings" - ], - "associations": { - "belongs_to": [ - "speech_balloon", - "system_picture" - ] - } - }, - "ground_picture": { - "column_names": [ - "panel_id", - "picture_id", - "caption", - "repeat", - "x", - "y", - "z", - "t" - ], - "associations": { - "belongs_to": [ - "panel" - ] - } - }, - "ground_color": { - "column_names": [ - "panel_id", - "caption", - "code", - "orientation", - "xy", - "wh", - "z", - "t" - ], - "associations": { - "belongs_to": [ - "panel" - ] - } - }, - "original_picture": { - "column_names": [ - "ext", - "width", - "height", - "filesize", - "artist_id", - "md5", - "uploaded_at", - "published_at", - "stopped_at" - ], - "associations": { - "belongs_to": [ - "artist" - ], - "has_one": [ - "resource_picture.by_original_picture" - ] - } - }, - "picture": { - "column_names": [ - "original_picture_id", - "revision", - "ext", - "width", - "height", - "filesize", - "artist_id", - "license_id", - "md5", - "artist_name", - "credit", - "settings", - "classname" - ], - "associations": { - "belongs_to": [ - "license", - "artist" - ] - } - }, - "resource_picture": { - "column_names": [ - "original_picture_id", - "revision", - "ext", - "width", - "height", - "filesize", - "artist_id", - "license_id", - "md5", - "artist_name", - "credit", - "settings", - "picture_id", - "classname" - ], - "associations": { - "belongs_to": [ - "original_picture", - "license", - "artist" - ] - } - }, - "speech_balloon_template": { - "column_names": [ - "name", - "classname", - "caption", - "t", - "system_picture_id", - "settings" - ], - "associations": { - "belongs_to": [ - "system_picture" - ] - } - }, - "writing_format": { - "column_names": [ - "name", - "classname", - "caption", - "system_picture_id", - "settings" - ], - "associations": { - "belongs_to": [ - "system_picture" - ], - "has_many": [] - } - }, - "license_group": { - "column_names": [ - "name", - "classname", - "caption", - "url" - ], - "associations": { - "has_many": [ - "licenses.by_license_group" - ] - } - }, - "license": { - "column_names": [ - "license_group_id", - "name", - "caption", - "system_picture_id", - "url", - "settings", - "credit_pictures" - ], - "associations": { - "belongs_to": [ - "license_group", - "system_picture" - ], - "has_many": [ - "resource_pictures.by_license" - ] - } - }, - "author": { - "column_names": [ - "name", - "user_id" - ], - "associations": { - "has_many": [ - "scrolls.by_author", - "scroll_panels.by_author", - "comics.by_author", - "stories.by_author", - "sheets.by_author", - "sheet_panels.by_author", - "panels.by_author", - "panel_pictures.by_author", - "speech_balloons.by_author", - "balloons.by_author", - "speeches.by_author", - "ground_pictures.by_author", - "ground_colors.by_author" - ] - } - }, - "artist": { - "column_names": [ - "name", - "author_id" - ], - "associations": { - "has_many": [ - "resource_pictures.by_artist" - ] - } - }, - "system_picture": { - "column_names": [ - "ext", - "width", - "height", - "filesize", - "md5" - ], - "associations": { - "has_many": [ - "licenses.by_system_picture" - ] - } - } - }, - "filers": { - "scroll": { - "symbol": {}, - "caption": { - "type": "default", - "args": { - "face": { - "type": "column", - "args": { - "column_name": "title" - } - }, - "link": { - "type": "action", - "args": { - "action_name": "play" - } - } - } - }, - "summary": {}, - "edit": {} - }, - "scroll_panel": { - "symbol": { - "type": "default", - "args": { - "link": { - "type": "none" - } - } - }, - "caption": { - "type": "none" - }, - "summary": {}, - "edit": { - "type": "none" - } - }, - "comic": { - "symbol": {}, - "caption": { - "type": "default", - "args": { - "face": { - "type": "column", - "args": { - "column_name": "title" - } - } - } - }, - "summary": {}, - "edit": {} - }, - "story": { - "symbol": {}, - "caption": { - "type": "default", - "args": { - "face": { - "type": "method", - "args": { - "method_name": "title_with_t" - } - }, - "link": { - "type": "action", - "args": { - "action_name": "play" - } - } - } - }, - "summary": {}, - "edit": {} - }, - "story_sheet": { - "symbol": { - "type": "default", - "args": { - "link": { - "type": "none" - } - } - }, - "caption": { - "type": "none" - }, - "summary": {}, - "edit": { - "type": "none" - } - }, - "sheet": { - "symbol": {}, - "caption": { - "type": "default", - "args": { - "face": {}, - "link": { - "type": "action", - "args": { - "action_name": "play" - } - } - } - }, - "summary": {}, - "edit": {} - }, - "sheet_panel": { - "symbol": { - "type": "default", - "args": { - "link": { - "type": "none" - } - } - }, - "caption": { - "type": "none" - }, - "summary": {}, - "edit": { - "type": "none" - } - }, - "panel": { - "symbol": {}, - "caption": { - "type": "default", - "args": { - "link": { - "type": "none" - } - } - }, - "summary": {}, - "edit": {} - }, - "panel_picture": { - "symbol": { - "type": "default", - "args": { - "face": { - "type": "picture" - } - } - }, - "caption": { - "type": "default", - "args": { - "link": { - "type": "none" - } - } - }, - "summary": {}, - "edit": { - "type": "none" - } - }, - "speech_balloon": { - "symbol": { - "type": "default", - "args": { - "face": { - "type": "picture" - } - } - }, - "caption": { - "type": "default", - "args": { - "face": { - "type": "method", - "args": { - "method_name": "plain_scenario" - } - }, - "link": { - "type": "none" - } - } - }, - "summary": {}, - "edit": { - "type": "none" - } - }, - "speech": { - "symbol": { - "type": "default", - "args": { - "face": { - "type": "picture" - } - } - }, - "caption": { - "type": "default", - "args": { - "face": { - "type": "column", - "args": { - "column_name": "content" - } - }, - "link": { - "type": "none" - } - } - }, - "summary": {}, - "edit": { - "type": "none" - } - }, - "balloon": { - "symbol": { - "type": "default", - "args": { - "face": { - "type": "picture" - } - } - }, - "caption": { - "type": "none" - }, - "summary": {}, - "edit": { - "type": "none" - } - }, - "ground_picture": { - "symbol": { - "type": "default", - "args": { - "face": { - "type": "picture" - } - } - }, - "caption": { - "type": "default", - "args": { - "link": { - "type": "none" - } - } - }, - "summary": {}, - "edit": { - "type": "none" - } - }, - "ground_color": { - "symbol": { - "type": "template", - "args": { - "template_name": "symbol" - } - }, - "caption": { - "type": "default", - "args": { - "link": { - "type": "none" - } - } - }, - "summary": {}, - "edit": { - "type": "none" - } - }, - "original_picture": { - "symbol": { - "type": "default", - "args": { - "face": { - "type": "picture" - } - } - }, - "caption": { - "type": "default", - "args": { - "face": { - "type": "method", - "args": { - "method_name": "revision" - } - }, - "link": { - "type": "action", - "args": { - "action_name": "history" - } - } - } - }, - "summary": {}, - "edit": { - "type": "template", - "args": { - "template_name": "publish" - } - } - }, - "picture": { - "symbol": { - "type": "default", - "args": { - "face": { - "type": "picture" - } - } - }, - "caption": { - "type": "default", - "args": { - "face": { - "type": "column", - "args": { - "column_name": "revision" - } - } - } - }, - "summary": {}, - "edit": { - "type": "none" - } - }, - "resource_picture": { - "symbol": { - "type": "default", - "args": { - "face": { - "type": "picture" - } - } - }, - "caption": { - "type": "none" - }, - "summary": {}, - "edit": { - "type": "none" - } - }, - "speech_balloon_template": { - "symbol": { - "type": "default", - "args": { - "face": { - "type": "picture" - } - } - }, - "caption": {}, - "summary": { - "type": "none" - }, - "edit": { - "type": "none" - } - }, - "writing_format": { - "symbol": {}, - "caption": {}, - "summary": { - "type": "none" - }, - "edit": { - "type": "none" - } - }, - "license_group": { - "symbol": {}, - "caption": { - "type": "default", - "args": { - "link": { - "type": "url_column", - "args": { - "column_name": "url" - } - } - } - }, - "summary": { - "type": "none" - }, - "edit": { - "type": "none" - } - }, - "license": { - "symbol": {}, - "caption": { - "type": "default", - "args": { - "face": { - "type": "method", - "args": { - "method_name": "caption_with_group" - } - }, - "link": { - "type": "url_column", - "args": { - "column_name": "url" - } - } - } - }, - "summary": {}, - "edit": { - "type": "none" - } - }, - "author": { - "symbol": {}, - "caption": { - "type": "default", - "args": { - "face": { - "type": "column", - "args": { - "column_name": "name" - } - } - } - }, - "summary": {}, - "edit": { - "type": "account" - } - }, - "artist": { - "symbol": {}, - "caption": { - "type": "default", - "args": { - "face": { - "type": "column", - "args": { - "column_name": "name" - } - } - } - }, - "summary": {}, - "edit": { - "type": "account" - } - }, - "system_picture": { - "symbol": { - "type": "default", - "args": { - "face": { - "type": "picture" - } - } - }, - "caption": { - "type": "none" - }, - "summary": { - "type": "none" - }, - "edit": { - "type": "none" - } - } - }, - "list_groups": { - "scroll": { - "lists": { - "public": { - "type": "public" - }, - "private": { - "type": "private" - }, - "by_author": { - "type": "filter" - }, - "by_panel": { - "type": "through_filter", - "args": { - "through": "scroll_panels" - } - }, - "play": { - "type": "play", - "args": { - "filter_item_name": "scroll", - "filter_model_name": "scroll_panel", - "filter_key": "scroll_id" - } - } - } - }, - "scroll_panel": { - "tree_name": "owner", - "lists": { - "public": { - "type": "public" - }, - "private": { - "type": "private" - }, - "by_scroll": { - "type": "filter" - }, - "by_panel": { - "type": "filter" - }, - "by_author": { - "type": "filter", - "args": { - "tree_name": "scroll_owner" - } - } - } - }, - "comic": { - "lists": { - "public": { - "type": "public" - }, - "private": { - "type": "private" - }, - "by_author": { - "type": "foreign_filter", - "args": { - "tree_name": "comic_owner" - } - } - } - }, - "story": { - "tree_name": "owner", - "lists": { - "public": { - "type": "public" - }, - "private": { - "type": "private" - }, - "by_comic": { - "type": "filter" - }, - "by_sheet": { - "type": "through_filter", - "args": { - "through": "story_sheets" - } - }, - "by_author": { - "type": "foreign_filter", - "args": { - "tree_name": "comic_owner" - } - }, - "play": { - "type": "play" - } - } - }, - "story_sheet": { - "tree_name": "owner", - "lists": { - "public": { - "type": "public" - }, - "private": { - "type": "private" - }, - "by_story": { - "type": "filter" - }, - "by_sheet": { - "type": "filter" - }, - "by_author": { - "type": "foreign_filter", - "args": { - "tree_name": "comic_owner" - } - } - } - }, - "sheet": { - "lists": { - "public": { - "type": "public" - }, - "private": { - "type": "private" - }, - "by_story": { - "type": "through_filter", - "args": { - "through": "story_sheets" - } - }, - "by_panel": { - "type": "through_filter", - "args": { - "through": "sheet_panels" - } - }, - "by_author": { - "type": "filter" - }, - "play": { - "type": "play" - } - } - }, - "sheet_panel": { - "tree_name": "owner", - "lists": { - "public": { - "type": "public" - }, - "private": { - "type": "private" - }, - "by_sheet": { - "type": "filter" - }, - "by_panel": { - "type": "filter" - }, - "by_author": { - "type": "foreign_filter", - "args": { - "tree_name": "sheet_owner" - } - } - } - }, - "panel": { - "lists": { - "public": { - "type": "public" - }, - "private": { - "type": "private" - }, - "by_scroll": { - "type": "through_filter", - "args": { - "through": "scroll_panels" - } - }, - "by_sheet": { - "type": "through_filter", - "args": { - "through": "sheet_panels" - } - }, - "by_author": { - "type": "filter" - }, - "by_speech_balloon_template": { - "type": "through_filter" - } - } - }, - "panel_picture": { - "tree_name": "owner", - "lists": { - "public": { - "type": "public" - }, - "private": { - "type": "private" - }, - "by_panel": { - "type": "filter" - }, - "by_author": { - "type": "foreign_filter", - "args": { - "tree_name": "panel_owner" - } - } - } - }, - "speech_balloon": { - "tree_name": "owner", - "lists": { - "public": { - "type": "public" - }, - "private": { - "type": "private" - }, - "by_panel": { - "type": "filter" - }, - "by_speech_balloon_template": { - "type": "filter" - }, - "by_author": { - "type": "foreign_filter", - "args": { - "tree_name": "panel_owner" - } - } - } - }, - "speech": { - "tree_name": "owner", - "lists": { - "public": { - "type": "public" - }, - "private": { - "type": "private" - }, - "by_panel": { - "type": "filter" - }, - "by_speech_balloon": { - "type": "filter" - }, - "by_author": { - "type": "foreign_filter", - "args": { - "tree_name": "panel_owner" - } - } - } - }, - "balloon": { - "tree_name": "owner", - "lists": { - "public": { - "type": "public" - }, - "by_speech_balloon": { - "type": "filter" - }, - "by_writing_format": { - "type": "filter" - }, - "by_author": { - "type": "foreign_filter", - "args": { - "tree_name": "panel_owner" - } - } - } - }, - "ground_picture": { - "tree_name": "owner", - "lists": { - "public": { - "type": "public" - }, - "private": { - "type": "private" - }, - "by_panel": { - "type": "filter" - }, - "by_author": { - "type": "foreign_filter", - "args": { - "tree_name": "panel_owner" - } - } - } - }, - "ground_color": { - "tree_name": "owner", - "lists": { - "public": { - "type": "public" - }, - "private": { - "type": "private" - }, - "by_panel": { - "type": "filter" - }, - "by_author": { - "type": "foreign_filter", - "args": { - "tree_name": "panel_owner" - } - } - } - }, - "original_picture": { - "lists": { - "private": { - "type": "private" - } - } - }, - "picture": {}, - "resource_picture": { - "lists": { - "public": { - "type": "public" - }, - "private": { - "type": "private" - }, - "by_original_picture": { - "type": "filter" - }, - "by_license": { - "type": "filter" - }, - "by_artist": { - "type": "filter" - } - } - }, - "speech_balloon_template": { - "lists": { - "public": { - "type": "public" - }, - "select_items": { - "type": "system_resource" - } - } - }, - "writing_format": { - "lists": { - "public": { - "type": "public" - }, - "select_items": { - "type": "system_resource" - }, - "by_system_picture": { - "type": "filter" - } - } - }, - "license_group": { - "lists": { - "public": { - "type": "public" - }, - "select_items": { - "type": "system_resource" - } - } - }, - "license": { - "lists": { - "public": { - "type": "public" - }, - "by_license_group": { - "type": "filter" - }, - "by_system_picture": { - "type": "filter" - } - } - }, - "author": { - "lists": { - "public": { - "type": "public" - } - } - }, - "artist": { - "lists": { - "public": { - "type": "public" - } - } - }, - "system_picture": { - "lists": { - "public": { - "type": "public" - } - } - } - }, - "forms": { - "base": { - "scroll": { - "fields": { - "title": { - "args": { - "label": { - "args": { - "row_break": true - } - }, - "tag": { - "type": "text" - }, - "row_break": true - } - }, - "description": { - "args": { - "label": { - "args": { - "row_break": true - } - }, - "tag": { - "type": "text_area" - } - } - }, - "visible": { - "args": { - "tag": { - "type": "select" - }, - "row_break": true - } - }, - "id": { - "args": { - "label": { - "type": "none" - }, - "tag": { - "type": "hidden" - } - } - }, - "author_id": { - "args": { - "label": { - "type": "none" - }, - "tag": { - "type": "hidden" - } - } - } - }, - "field_names": [ - "title", - "description", - "visible", - "id", - "author_id" - ] - }, - "scroll_panel": { - "fields": { - "scroll_id": { - "args": { - "tag": { - "type": "number" - } - } - }, - "panel_id": { - "args": { - "tag": { - "type": "number" - } - } - }, - "t": { - "args": { - "tag": { - "type": "number" - } - } - }, - "id": { - "args": { - "label": { - "type": "none" - }, - "tag": { - "type": "hidden" - } - } - } - }, - "field_names": [ - "scroll_id", - "panel_id", - "t", - "id" - ] - }, - "comic": { - "fields": { - "title": { - "args": { - "label": { - "args": { - "row_break": true - } - }, - "tag": { - "type": "text" - }, - "row_break": true - } - }, - "description": { - "args": { - "label": { - "args": { - "row_break": true - } - }, - "tag": { - "type": "text_area" - } - } - }, - "visible": { - "args": { - "tag": { - "type": "select" - }, - "row_break": true - } - }, - "id": { - "args": { - "label": { - "type": "none" - }, - "tag": { - "type": "hidden" - } - } - }, - "author_id": { - "args": { - "label": { - "type": "none" - }, - "tag": { - "type": "hidden" - } - } - } - }, - "field_names": [ - "title", - "description", - "visible", - "id", - "author_id" - ] - }, - "story": { - "fields": { - "comic_id": { - "args": { - "label": { - "type": "none" - }, - "tag": { - "type": "hidden" - } - } - }, - "title": { - "args": { - "label": { - "args": { - "row_break": true - } - }, - "tag": { - "type": "text" - }, - "row_break": true - } - }, - "description": { - "args": { - "label": { - "args": { - "row_break": true - } - }, - "tag": { - "type": "text_area" - }, - "row_break": true - } - }, - "visible": { - "args": { - "tag": { - "type": "select" - }, - "row_break": true - } - }, - "t": { - "args": { - "tag": { - "type": "number" - } - } - }, - "id": { - "args": { - "label": { - "type": "none" - }, - "tag": { - "type": "hidden" - } - } - }, - "author_id": { - "args": { - "label": { - "type": "none" - }, - "tag": { - "type": "hidden" - } - } - } - }, - "field_names": [ - "comic_id", - "title", - "description", - "visible", - "t", - "id", - "author_id" - ] - }, - "story_sheet": { - "fields": { - "story_id": { - "args": { - "label": { - "type": "none" - }, - "tag": { - "type": "number" - } - } - }, - "sheet_id": { - "args": { - "label": { - "type": "none" - }, - "tag": { - "type": "number" - } - } - }, - "t": { - "args": { - "tag": { - "type": "number" - } - } - }, - "id": { - "args": { - "label": { - "type": "none" - }, - "tag": { - "type": "hidden" - } - } - } - }, - "field_names": [ - "story_id", - "sheet_id", - "t", - "id" - ] - }, - "sheet": { - "fields": { - "caption": { - "args": { - "label": { - "args": { - "row_break": true - } - }, - "tag": { - "type": "text" - }, - "row_break": true - } - }, - "width": { - "args": { - "tag": { - "type": "number" - } - } - }, - "height": { - "args": { - "tag": { - "type": "number" - }, - "row_break": true - } - }, - "visible": { - "args": { - "tag": { - "type": "select" - }, - "row_break": true - } - }, - "id": { - "args": { - "label": { - "type": "none" - }, - "tag": { - "type": "hidden" - } - } - }, - "author_id": { - "args": { - "label": { - "type": "none" - }, - "tag": { - "type": "hidden" - } - } - } - }, - "field_names": [ - "caption", - "width", - "height", - "visible", - "id", - "author_id" - ] - }, - "sheet_panel": { - "fields": { - "sheet_id": { - "args": { - "tag": { - "type": "number" - } - } - }, - "panel_id": { - "args": { - "tag": { - "type": "number" - } - } - }, - "x": { - "args": { - "tag": { - "type": "number" - } - } - }, - "y": { - "args": { - "tag": { - "type": "number" - }, - "row_break": true - } - }, - "z": { - "args": { - "label": { - "type": "none" - }, - "tag": { - "type": "hidden" - } - } - }, - "t": { - "args": { - "label": { - "type": "none" - }, - "tag": { - "type": "hidden" - } - } - }, - "id": { - "args": { - "label": { - "type": "none" - }, - "tag": { - "type": "hidden" - } - } - } - }, - "field_names": [ - "sheet_id", - "panel_id", - "x", - "y", - "z", - "t", - "id" - ] - }, - "panel": { - "fields": { - "caption": { - "args": { - "tag": { - "type": "text" - }, - "row_break": true - } - }, - "width": { - "args": { - "tag": { - "type": "number" - } - } - }, - "height": { - "args": { - "tag": { - "type": "number" - }, - "row_break": true - } - }, - "border": { - "args": { - "tag": { - "type": "number" - } - } - }, - "publish": { - "args": { - "tag": { - "type": "select" - }, - "row_break": true - } - }, - "id": { - "args": { - "label": { - "type": "none" - }, - "tag": { - "type": "hidden" - } - } - }, - "author_id": { - "args": { - "label": { - "type": "none" - }, - "tag": { - "type": "hidden" - } - } - } - }, - "field_names": [ - "caption", - "width", - "height", - "border", - "publish", - "id", - "author_id" - ] - }, - "panel_picture": { - "fields": { - "caption": { - "args": { - "tag": { - "type": "text" - }, - "row_break": true - } - }, - "x": { - "args": { - "tag": { - "type": "number" - } - } - }, - "y": { - "args": { - "tag": { - "type": "number" - }, - "row_break": true - } - }, - "width": { - "args": { - "tag": { - "type": "number" - }, - "helpers": { - "size": { - "type": "size", - "args": { - "dom_class": "panel_picture_width_tool" - } - } - }, - "row_break": true - } - }, - "height": { - "args": { - "tag": { - "type": "number" - }, - "helpers": { - "size": { - "type": "size", - "args": { - "dom_class": "panel_picture_height_tool" - } - } - }, - "row_break": true - } - }, - "link": { - "args": { - "tag": { - "type": "text" - }, - "row_break": true - } - }, - "id": { - "args": { - "label": { - "type": "none" - }, - "tag": { - "type": "hidden" - } - } - }, - "panel_id": { - "args": { - "label": { - "type": "none" - }, - "tag": { - "type": "hidden" - } - } - }, - "picture_id": { - "args": { - "tag": { - "type": "hidden" - }, - "helpers": { - "popup": { - "type": "popup", - "args": { - "source": "pictures" - } - } - } - } - }, - "z": { - "args": { - "label": { - "type": "none" - }, - "tag": { - "type": "hidden" - } - } - }, - "t": { - "args": { - "label": { - "type": "none" - }, - "tag": { - "type": "hidden" - } - } - } - }, - "field_names": [ - "caption", - "x", - "y", - "width", - "height", - "link", - "id", - "panel_id", - "picture_id", - "z", - "t" - ] - }, - "speech_balloon": { - "fields": { - "speech_balloon.id": { - "args": { - "label": { - "type": "none" - }, - "tag": { - "type": "hidden" - } - } - }, - "speech_balloon.panel_id": { - "args": { - "label": { - "type": "none" - }, - "tag": { - "type": "hidden" - } - } - }, - "speech_balloon.speech_balloon_template_id": { - "args": { - "label": { - "type": "none" - }, - "tag": { - "type": "hidden" - } - } - }, - "speech_balloon.caption": { - "args": { - "tag": { - "type": "text" - }, - "row_break": true - } - }, - "speech_balloon.z": { - "args": { - "label": { - "type": "none" - }, - "tag": { - "type": "hidden" - } - } - }, - "speech_balloon.t": { - "args": { - "label": { - "type": "none" - }, - "tag": { - "type": "hidden" - } - } - }, - "speech_balloon.classname": { - "args": { - "label": { - "type": "none" - }, - "tag": { - "type": "hidden" - } - } - }, - "speech_balloon.settings": { - "args": { - "label": { - "type": "none" - }, - "tag": { - "type": "hidden" - } - } - }, - "balloon.id": { - "type": "part", - "args": { - "label": { - "type": "none" - }, - "tag": { - "type": "hidden" - } - } - }, - "balloon.speech_balloon_id": { - "type": "part", - "args": { - "label": { - "type": "none" - }, - "tag": { - "type": "hidden" - } - } - }, - "balloon.system_picture_id": { - "type": "part", - "args": { - "label": { - "type": "none" - }, - "tag": { - "type": "hidden" - } - } - }, - "balloon.r": { - "type": "part", - "args": { - "tag": { - "type": "number" - }, - "helpers": { - "tail_angle": { - "type": "size", - "args": {} - } - }, - "row_break": true - } - }, - "balloon.x": { - "type": "part", - "args": { - "tag": { - "type": "number" - } - } - }, - "balloon.y": { - "type": "part", - "args": { - "label": {}, - "tag": { - "type": "number" - }, - "row_break": true - } - }, - "balloon.width": { - "type": "part", - "args": { - "tag": { - "type": "number" - } - } - }, - "balloon.height": { - "type": "part", - "args": { - "tag": { - "type": "number" - }, - "row_break": true - } - }, - "balloon.settings": { - "type": "part", - "args": { - "label": { - "type": "none" - }, - "tag": { - "type": "hidden" - } - } - }, - "speech.id": { - "type": "part", - "args": { - "label": { - "type": "none" - }, - "tag": { - "type": "hidden" - } - } - }, - "speech.speech_balloon_id": { - "type": "part", - "args": { - "label": { - "type": "none" - }, - "tag": { - "type": "hidden" - } - } - }, - "speech.x": { - "type": "part", - "args": { - "label": { - "type": "none" - }, - "tag": { - "type": "hidden" - } - } - }, - "speech.y": { - "type": "part", - "args": { - "label": { - "type": "none" - }, - "tag": { - "type": "hidden" - } - } - }, - "speech.width": { - "type": "part", - "args": { - "label": { - "type": "none" - }, - "tag": { - "type": "hidden" - } - } - }, - "speech.height": { - "type": "part", - "args": { - "label": { - "type": "none" - }, - "tag": { - "type": "hidden" - } - } - }, - "speech.writing_format_id": { - "type": "part", - "args": { - "tag": { - "type": "select" - } - } - }, - "speech.font_size": { - "type": "part", - "args": { - "tag": { - "type": "select" - }, - "row_break": true - } - }, - "speech.text_align": { - "type": "part", - "args": { - "tag": { - "type": "select" - } - } - }, - "speech.quotes": { - "type": "part", - "args": { - "tag": { - "type": "text" - } - } - }, - "speech.content": { - "type": "part", - "args": { - "label": { - "args": { - "row_break": true - } - }, - "tag": { - "type": "text_area", - "args": { - "options": { - "size": "45x5" - } - } - } - } - }, - "speech.fore_color": { - "type": "part", - "args": { - "label": { - "row_break": true - }, - "tag": { - "type": "hidden" - }, - "helpers": { - "color": { - "type": "color", - "args": { - "wrapper": "speech-fore_color-wrap" - } - } - } - } - }, - "speech.settings": { - "type": "part", - "args": { - "label": { - "type": "none" - }, - "tag": { - "type": "hidden" - } - } - } - } - }, - "ground_picture": { - "fields": { - "id": { - "args": { - "label": { - "type": "none" - }, - "tag": { - "type": "hidden" - } - } - }, - "panel_id": { - "args": { - "label": { - "type": "none" - }, - "tag": { - "type": "hidden" - } - } - }, - "picture_id": { - "args": { - "label": { - "type": "none" - }, - "tag": { - "type": "hidden" - } - } - }, - "caption": { - "args": { - "tag": { - "type": "text" - }, - "row_break": true - } - }, - "repeat": { - "args": { - "tag": { - "type": "select", - "args": { - "source": "magic_number", - "key": "ground_picture_repeat_items" - } - }, - "row_break": true - } - }, - "x": { - "args": { - "tag": { - "type": "number" - } - } - }, - "y": { - "args": { - "tag": { - "type": "number" - }, - "row_break": true - } - }, - "z": { - "args": { - "label": { - "type": "none" - }, - "tag": { - "type": "hidden" - } - } - }, - "t": { - "args": { - "label": { - "type": "none" - }, - "tag": { - "type": "hidden" - } - } - } - }, - "field_names": [ - "caption", - "repeat", - "x", - "y", - "z", - "t", - "id", - "panel_id", - "picture_id" - ] - }, - "ground_color": { - "fields": { - "id": { - "args": { - "label": { - "type": "none" - }, - "tag": { - "type": "hidden" - } - } - }, - "panel_id": { - "args": { - "label": { - "type": "none" - }, - "tag": { - "type": "hidden" - } - } - }, - "caption": { - "args": { - "tag": { - "type": "text" - }, - "row_break": true - } - }, - "code": { - "args": { - "label": { - "args": { - "row_break": true - } - }, - "tag": { - "type": "hidden" - }, - "helpers": { - "color": { - "type": "color", - "args": { - "wrapper": "ground_color-code-wrap" - } - } - }, - "row_break": true - } - }, - "orientation": { - "args": { - "tag": { - "type": "select" - }, - "row_break": true - } - }, - "xy": { - "args": { - "tag": { - "type": "number" - } - } - }, - "wh": { - "args": { - "tag": { - "type": "number" - }, - "row_break": true - } - }, - "z": { - "args": { - "label": { - "type": "none" - }, - "tag": { - "type": "hidden" - } - } - }, - "t": { - "args": { - "label": { - "type": "none" - }, - "tag": { - "type": "hidden" - } - } - } - }, - "field_names": [ - "id", - "panel_id", - "caption", - "code", - "orientation", - "xy", - "wh", - "z", - "t" - ] - }, - "author": { - "fields": { - "id": { - "args": { - "label": { - "type": "none" - }, - "tag": { - "type": "hidden" - } - } - }, - "name": { - "args": { - "label": { - "args": { - "row_break": true - } - }, - "tag": { - "type": "text" - }, - "row_break": true - } - } - }, - "field_names": [ - "id", - "name" - ] - }, - "artist": { - "fields": { - "id": { - "args": { - "label": { - "type": "none" - }, - "tag": { - "type": "hidden" - } - } - }, - "name": { - "args": { - "label": { - "args": { - "row_break": true - } - }, - "tag": { - "type": "text" - }, - "row_break": true - } - } - }, - "field_names": [ - "id", - "name" - ] - } - }, - "extend": { - "CircleSpeechBalloon": { - "base": "speech_balloon", - "fields": {}, - "field_names": [ - "speech_balloon.caption", - "balloon.r", - "balloon.x", - "balloon.y", - "balloon.width", - "balloon.height", - "balloon.id", - "balloon.speech_balloon_id", - "balloon.system_picture_id", - "balloon.settings", - "speech.writing_format_id", - "speech.font_size", - "speech.text_align", - "speech.quotes", - "speech.content", - "speech.fore_color", - "speech.id", - "speech.speech_balloon_id", - "speech.x", - "speech.y", - "speech.width", - "speech.height", - "speech.settings", - "speech_balloon.id", - "speech_balloon.panel_id", - "speech_balloon.speech_balloon_template_id", - "speech_balloon.classname", - "speech_balloon.z", - "speech_balloon.t", - "speech_balloon.settings" - ] - }, - "PlainSpeechBalloon": { - "base": "speech_balloon", - "fields": { - "balloon.r": { - "type": "part", - "args": { - "label": { - "type": "none" - }, - "tag": { - "type": "hidden" - } - } - } - }, - "field_names": [ - "speech_balloon.caption", - "balloon.r", - "balloon.x", - "balloon.y", - "balloon.width", - "balloon.height", - "balloon.id", - "balloon.speech_balloon_id", - "balloon.system_picture_id", - "balloon.settings", - "speech.writing_format_id", - "speech.font_size", - "speech.text_align", - "speech.quotes", - "speech.content", - "speech.fore_color", - "speech.id", - "speech.speech_balloon_id", - "speech.x", - "speech.y", - "speech.width", - "speech.height", - "speech.settings", - "speech_balloon.id", - "speech_balloon.panel_id", - "speech_balloon.speech_balloon_template_id", - "speech_balloon.classname", - "speech_balloon.z", - "speech_balloon.t", - "speech_balloon.settings" - ] - }, - "SquareSpeechBalloon": { - "base": "speech_balloon", - "fields": { - "balloon.r": { - "type": "part", - "args": { - "label": { - "type": "none" - }, - "tag": { - "type": "hidden" - } - } - } - }, - "field_names": [ - "speech_balloon.caption", - "balloon.r", - "balloon.x", - "balloon.y", - "balloon.width", - "balloon.height", - "balloon.id", - "balloon.speech_balloon_id", - "balloon.system_picture_id", - "balloon.settings", - "speech.writing_format_id", - "speech.font_size", - "speech.text_align", - "speech.quotes", - "speech.content", - "speech.fore_color", - "speech.id", - "speech.speech_balloon_id", - "speech.x", - "speech.y", - "speech.width", - "speech.height", - "speech.settings", - "speech_balloon.id", - "speech_balloon.panel_id", - "speech_balloon.speech_balloon_template_id", - "speech_balloon.classname", - "speech_balloon.z", - "speech_balloon.t", - "speech_balloon.settings" - ] - } - } - } } } \ No newline at end of file -- 2.11.0