From a8af764be9b48ad0bf9eaca3e90f48af2c62ee3c Mon Sep 17 00:00:00 2001 From: yasushiito Date: Wed, 5 Mar 2014 08:18:03 +0900 Subject: [PATCH] element --- app/controllers/scrolls_controller.rb | 2 +- app/controllers/sheets_controller.rb | 6 +- app/controllers/stories_controller.rb | 2 +- app/models/balloon.rb | 7 + app/models/ground_color.rb | 3 +- app/models/ground_picture.rb | 3 +- app/models/panel_picture.rb | 12 +- app/models/scroll_panel.rb | 2 +- app/models/sheet_panel.rb | 2 +- app/models/speech.rb | 15 ++ app/models/speech_balloon.rb | 3 +- app/models/story_sheet.rb | 2 +- app/views/ground_colors/_element.html.erb | 4 +- app/views/ground_pictures/_element.html.erb | 4 +- app/views/panel_pictures/_element.html.erb | 5 +- app/views/panels/_body.html.erb | 4 +- app/views/speech_balloons/_element.html.erb | 16 +- lib/common.rb | 5 + lib/editor/editor.rb | 27 +++- lib/editor/panel_editor.rb | 4 + lib/editor/pool.rb | 45 +++++- lib/manifest/model.rb | 29 ++++ lib/manifest/model/association.rb | 8 + lib/peta/content.rb | 19 ++- lib/peta/element.rb | 239 +++++++--------------------- lib/peta/item.rb | 48 +++--- 26 files changed, 259 insertions(+), 257 deletions(-) diff --git a/app/controllers/scrolls_controller.rb b/app/controllers/scrolls_controller.rb index b9f52d5b..8faed6b3 100644 --- a/app/controllers/scrolls_controller.rb +++ b/app/controllers/scrolls_controller.rb @@ -28,7 +28,7 @@ class ScrollsController < ApplicationController format.html { @scroll = @item if @operators.author - @new_panel_items = assist_items('panel', 'private_list') + @new_panel_items = assist_items('panel', 'private') #@new_panel_filer = assist_filer 'panel', @new_panel_items end } diff --git a/app/controllers/sheets_controller.rb b/app/controllers/sheets_controller.rb index d36dfb75..571a2687 100644 --- a/app/controllers/sheets_controller.rb +++ b/app/controllers/sheets_controller.rb @@ -33,12 +33,12 @@ class SheetsController < ApplicationController def show_html_format format format.html { if @operators.author - @new_panel_items = assist_items('panel', 'private_list') + @new_panel_items = assist_items('panel', 'private') #new_panel_filer = assist_filer 'panel', @new_panel_items - @new_story_items = assist_items('story', 'private_list') + @new_story_items = assist_items('story', 'private') #new_story_filer = assist_filer 'story', @new_story_items - @fresh_story_items = assist_items('story_sheet', 'private_list').map {|ss| ss.story} + @fresh_story_items = assist_items('story_sheet', 'private').map {|ss| ss.story} #@fresh_story_filer = assist_filer 'story', @fresh_story_items end } diff --git a/app/controllers/stories_controller.rb b/app/controllers/stories_controller.rb index 1058c62a..0b8fea2e 100644 --- a/app/controllers/stories_controller.rb +++ b/app/controllers/stories_controller.rb @@ -33,7 +33,7 @@ class StoriesController < ApplicationController def show_html_format format format.html { if @operators.author - @new_sheet_items = assist_items('sheet', 'private_list') + @new_sheet_items = assist_items('sheet', 'private') #@new_sheet_filer = assist_filer 'sheet', @new_sheet_items end } diff --git a/app/models/balloon.rb b/app/models/balloon.rb index d759dad6..b36a825c 100644 --- a/app/models/balloon.rb +++ b/app/models/balloon.rb @@ -76,6 +76,13 @@ self.system_picture_id = 1 {:include => {:speech_balloon => {:include => {:panel => {:include => {:author => {} }}, :speech => {}, :speech_balloon_template => {} }}}} end + 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' + } + end + def copy_attributes r = self.attributes r.delete 'id' diff --git a/app/models/ground_color.rb b/app/models/ground_color.rb index e71ebb01..4bb6124d 100644 --- a/app/models/ground_color.rb +++ b/app/models/ground_color.rb @@ -1,6 +1,5 @@ -class GroundColor < Peta::Content +class GroundColor < Peta::Element load_manifest - include Peta::Element include ElementInspire belongs_to :panel belongs_to :color diff --git a/app/models/ground_picture.rb b/app/models/ground_picture.rb index 3fcc19aa..1564b2a8 100644 --- a/app/models/ground_picture.rb +++ b/app/models/ground_picture.rb @@ -1,6 +1,5 @@ -class GroundPicture < Peta::Content +class GroundPicture < Peta::Element load_manifest - include Peta::Element include ElementInspire belongs_to :panel belongs_to :picture diff --git a/app/models/panel_picture.rb b/app/models/panel_picture.rb index 12e88aa5..4c463d9a 100644 --- a/app/models/panel_picture.rb +++ b/app/models/panel_picture.rb @@ -1,6 +1,5 @@ -class PanelPicture < Peta::Content +class PanelPicture < Peta::Element load_manifest - include Peta::Element include ElementInspire belongs_to :panel belongs_to :picture @@ -94,10 +93,11 @@ class PanelPicture < Peta::Content def opt_img_tag spot = nil, opacity = 20 o = (spot and spot != self) ? "opacity: #{opacity.to_f/100}; filter:alpha(opacity=#{opacity});" : '' - {:id => self.tag_id(:img), :panel_id => self.tag_panel_id, :element_id => self.tag_element_id, :element_type => self.tag_element_type, - :class => "panel-picture", :vPicture => self.id, - :src => self.url, :width => self.width.abs, :height => self.height.abs, :picture_id => self.picture_id, :ext => self.picture.ext, :alt => self.caption, - :style => "#{o}"} + self.tag_attributes(:img, { + :class => "panel-picture", :vPicture => self.id, + :src => self.url, :width => self.width.abs, :height => self.height.abs, :picture_id => self.picture_id, :ext => self.picture.ext, :alt => self.caption, + :style => "#{o}" + }) end def tmb_opt_img_tag diff --git a/app/models/scroll_panel.rb b/app/models/scroll_panel.rb index 8153e6d8..356efd0e 100644 --- a/app/models/scroll_panel.rb +++ b/app/models/scroll_panel.rb @@ -1,4 +1,4 @@ -class ScrollPanel < Peta::Content +class ScrollPanel < Peta::Element load_manifest belongs_to :author belongs_to :panel diff --git a/app/models/sheet_panel.rb b/app/models/sheet_panel.rb index a8a45a11..300980c2 100644 --- a/app/models/sheet_panel.rb +++ b/app/models/sheet_panel.rb @@ -1,4 +1,4 @@ -class SheetPanel < Peta::Content +class SheetPanel < Peta::Element load_manifest belongs_to :author belongs_to :panel diff --git a/app/models/speech.rb b/app/models/speech.rb index 1d489b42..506671c6 100644 --- a/app/models/speech.rb +++ b/app/models/speech.rb @@ -50,6 +50,21 @@ class Speech < Peta::Content 'speech' end + def outer_style + { + 'top' => self.y, 'left' => self.x, + 'width' => self.width, 'height' => self.height + } + end + + def inner_style + { + 'font-size' => self.font_size.to_s + 'em', + 'text-align' => self.text_align_text, + 'color' => '#' + format("%06x", self.fore_color) + } + end + def text_align_text @@text_align_texts[self.text_align] end diff --git a/app/models/speech_balloon.rb b/app/models/speech_balloon.rb index 4ad6472e..7f9507a7 100644 --- a/app/models/speech_balloon.rb +++ b/app/models/speech_balloon.rb @@ -1,6 +1,5 @@ -class SpeechBalloon < Peta::Content +class SpeechBalloon < Peta::Element load_manifest - include Peta::Element include ElementInspire has_one :balloon, :dependent => :destroy has_one :speech, :dependent => :destroy diff --git a/app/models/story_sheet.rb b/app/models/story_sheet.rb index 8306c762..3650fe5f 100644 --- a/app/models/story_sheet.rb +++ b/app/models/story_sheet.rb @@ -1,4 +1,4 @@ -class StorySheet < Peta::Content +class StorySheet < Peta::Element load_manifest belongs_to :author belongs_to :story diff --git a/app/views/ground_colors/_element.html.erb b/app/views/ground_colors/_element.html.erb index 5d1d59f3..0a8579a1 100644 --- a/app/views/ground_colors/_element.html.erb +++ b/app/views/ground_colors/_element.html.erb @@ -1,3 +1,3 @@ -
class="pettanr-comic-ground-color" style="<%= elm.opt_div_style(spot) -%>"> +<%= content_tag :div, element.tag_attributes(:div, {'class' => "pettanr-comic-ground-color", 'style' => element.opt_div_style(spot)}) do %> -
+<% end %> diff --git a/app/views/ground_pictures/_element.html.erb b/app/views/ground_pictures/_element.html.erb index 105e48f8..c176ada3 100644 --- a/app/views/ground_pictures/_element.html.erb +++ b/app/views/ground_pictures/_element.html.erb @@ -1,3 +1,3 @@ -
class="pettanr-comic-ground-picture" style="<%= elm.opt_div_style(full_url(elm.picture.url), spot) -%>"> +<%= content_tag :div, element.tag_attributes(:div, {'class' => "pettanr-comic-ground-picture", 'style' => element.opt_div_style(full_url(element.picture.url), spot)}) do %> -
+<% end %> diff --git a/app/views/panel_pictures/_element.html.erb b/app/views/panel_pictures/_element.html.erb index ba7e09e1..13c65eee 100644 --- a/app/views/panel_pictures/_element.html.erb +++ b/app/views/panel_pictures/_element.html.erb @@ -1,4 +1,3 @@ -<%= content_tag :div, elm.tag_attributes do %> -
class="pettanr-panel-picture-wrapper" style="<%= elm.opt_div_style() -%>"> - <%= link_to_unless(elm.link.blank?, tag(:img, elm.opt_img_tag(spot)), elm.link) %> +<%= content_tag :div, element.tag_attributes(:div, {'class' => "pettanr-panel-picture-wrapper", 'style' => element.opt_div_style()}) do %> + <%= link_to_unless(element.link.blank?, tag(:img, element.opt_img_tag(spot)), element.link) %> <% end %> diff --git a/app/views/panels/_body.html.erb b/app/views/panels/_body.html.erb index e3d504dc..84c2a9d7 100644 --- a/app/views/panels/_body.html.erb +++ b/app/views/panels/_body.html.erb @@ -6,8 +6,8 @@ <% end %> <%= content_tag :div, :id => panel.tag_id, :panel_id => panel.tag_panel_id, :class => "pettanr-comic-panel", :style => "width: #{panel.width}px; height: #{panel.height}px; border-style: solid; border-width: #{panel.border}px; border-color: black; background-color: white;" do %> <% if panel.visible? operators -%> - <% panel.panel_elements.each do |elm| %> - <%= render elm.class.to_s.tableize + '/element', :elm => elm, :spot => spot %> + <% panel.panel_elements.each do |element| %> + <%= render element.path_name + '/element', :element => element, :spot => spot %> <% end %> <% else %>

<%= t('panels.hidden') %>

diff --git a/app/views/speech_balloons/_element.html.erb b/app/views/speech_balloons/_element.html.erb index c2c52cfe..41d60911 100644 --- a/app/views/speech_balloons/_element.html.erb +++ b/app/views/speech_balloons/_element.html.erb @@ -1,8 +1,8 @@ -
balloon_id="<%= elm.balloon.tag_element_part_id -%>" speech_id="<%= elm.speech.tag_element_part_id -%>" class="pettanr-comic-balloon" style="width:<%= elm.balloon.width -%>px; height:<%= elm.balloon.height -%>px; top:<%= elm.balloon.y -%>px; left:<%= elm.balloon.x -%>px; z-index:<%= elm.z -%>; "> - class="pettanr-balloon" src="<%= elm.balloon.system_picture.url -%>" alt="<%= elm.caption -%>"> -
-
style="font-size:<%= elm.speech.font_size -%>em; text-align:<%= elm.speech.text_align_text -%>; color:#<%= format("%06x", elm.speech.fore_color) -%>;"> - <%= raw elm.speech.writing_format.engine_model.render(elm.speech.content) -%> -
-
-
+<%= content_tag :div, element.tag_attributes(:div, {'class' => "pettanr-comic-balloon", 'style' => raw(element.balloon.style.merge({'z-index' => element.z}).to_style)}) do %> + <%= tag :img, element.balloon.tag_attributes(nil, {'class' => "pettanr-balloon", 'src' => element.balloon.system_picture.url, 'alt' => element.caption}) %> + <%= content_tag :div, {'class' => "pettanr-comic-speech", 'style' => raw(element.speech.outer_style.to_style)} do %> + <%= content_tag :div, element.speech.tag_attributes(nil, {'class' => "pettanr-comic-speech-inner", 'style' => raw(element.speech.inner_style.to_style)}) do %> + <%= raw element.speech.writing_format.engine_model.render(element.speech.content) -%> + <% end %> + <% end %> +<% end %> diff --git a/lib/common.rb b/lib/common.rb index 7d0eb2ee..04c5856d 100644 --- a/lib/common.rb +++ b/lib/common.rb @@ -16,5 +16,10 @@ class Hash def to_attr self.map {|k, n| "#{k}=\"#{n}\"" }.join(' ') end + + def to_style + self.map {|k, n| "#{k}: #{n}" }.join('; ') + end + end diff --git a/lib/editor/editor.rb b/lib/editor/editor.rb index 79e5d88f..20cd2a92 100644 --- a/lib/editor/editor.rb +++ b/lib/editor/editor.rb @@ -4,7 +4,8 @@ module Editor class Editor include EditorModule - + cattr_accessor :eid + @@eid = 0 class Generator def initialize editor @editor = editor @@ -30,15 +31,25 @@ module Editor attr_accessor :root_item, :dock, :generator, :operators def initialize root_item, operators + @@eid += 1 @root_item = root_item @operators = operators @dock = self.new_dock - @pool = Pool.new @root_item + @pool = Pool.new self, @root_item @generator = Generator.new self + @@eid = 0 if @@eid > 0x7fffff end #InstanceMethods + def name + 'owner' + end + + def eid + @@eid + end + def new_dock Dock.new self end @@ -55,6 +66,18 @@ module Editor self.template_dir + self.template_file_name end + def register + @root_item.editor = self + @root_item.each_elements(self.name) do |element| + element.editor = self + element.parent = @root_item + end + end + + def eid + 'editor-' + @@eid.to_s + end + def dom_id 'editor-' + @root_item.id.to_s end diff --git a/lib/editor/panel_editor.rb b/lib/editor/panel_editor.rb index ad7b2be9..43f39235 100644 --- a/lib/editor/panel_editor.rb +++ b/lib/editor/panel_editor.rb @@ -1,6 +1,10 @@ require_dependency "editor/panel_dock/panel_dock" module Editor class PanelEditor < Editor + def name + 'panel' + end + def new_dock PanelDock.new self end diff --git a/lib/editor/pool.rb b/lib/editor/pool.rb index fbb750c0..ace50c38 100644 --- a/lib/editor/pool.rb +++ b/lib/editor/pool.rb @@ -1,12 +1,49 @@ module Editor module EditorModule class Pool - attr_accessor :root_item, :tabs - def initialize root_item + attr_accessor :editor, :root_item, :pool, :index + def initialize editor, root_item + @editor = editor @root_item = root_item - @root_item.each_elements('panel') do |element| - element.pool = self + @pool = {} + @index = 1 + self.editize + end + + # regist stored element + def editize + self.register @root_item + @root_item.each_elements(self.name) do |element| + self.register element + end + end + + def register item + @item.editor = @editor + parent_model = item.parent_model(@editor.name) + if parent_model + item.parent = find + end + if item.new_record? + if parent_model + # element + item.parent__send__ "build_#{parent_model.child_element_name(item.item_name)}" + else + # root + + end + item.pool_id = @index + @index += 1 + else + item.pool_id = item.id end + @pool[item.item_name] ||= {'stored' => {}, 'new' => {}} + @pool[item.item_name][item.dom_pool_type] ||= {} + @pool[item.item_name][item.dom_pool_type][item.pool_id] = item + end + + def unregister item + end end diff --git a/lib/manifest/model.rb b/lib/manifest/model.rb index 07071955..f11b84ac 100644 --- a/lib/manifest/model.rb +++ b/lib/manifest/model.rb @@ -64,6 +64,10 @@ module Manifest ::Manifest.item_name_to_model @model_name end + def table_name + self.classify.table_name + end + def valid_encode_columns r = [] @attributes.each {|attribute_name, attribute| @@ -84,6 +88,31 @@ module Manifest false end + def each_child_model_manifest tree_name + ::Manifest.models.each {|child_model_name, child_model_manifest| + next unless child_model_manifest.tree[tree_name] + next unless child_model_manifest.tree[tree_name].parent_model_name == @model_name + yield child_model_manifest + } + end + + def child_models tree_name + r = [] + self.each_child_model_manifest(tree_name) {|child_model_manifest| + r << child_model_manifest.classify + } + r + end + + def child_element_names tree_name + r = [] + self.each_child_model_manifest(tree_name) {|child_model_manifest| + # has_one ? + r << self.associations.child_element_name(child_model_manifest.model_name) + } + r + end + end end diff --git a/lib/manifest/model/association.rb b/lib/manifest/model/association.rb index f21d0820..60e31188 100644 --- a/lib/manifest/model/association.rb +++ b/lib/manifest/model/association.rb @@ -43,6 +43,14 @@ module Manifest @model.model_manifest end + def child_element_name child_item_name + if @has_one[child_item_name] + child_model_manifest.model_name + else + child_model_manifest.table_name + end + end + end end diff --git a/lib/peta/content.rb b/lib/peta/content.rb index 337daa4a..fbc9cf81 100644 --- a/lib/peta/content.rb +++ b/lib/peta/content.rb @@ -2,7 +2,7 @@ module Peta class Content < Item self.abstract_class = true - # Dynamic ClassMethods + # Dynamic Methods def self._content? self.my_manifest.content_model @@ -24,6 +24,7 @@ module Peta def self.load_manifest super + # Class Methods f = self._content? define_singleton_method("content?") do f @@ -43,9 +44,21 @@ module Peta define_singleton_method("owner_column") do o end + define_singleton_method("child_models") do |tree_name| + self.my_manifest.child_models tree_name + end + # Instance Methods + define_method("parent_model") do |tree_name| + self.__send__ self.class.parent_model(tree_name).item_name + end + define_method("elements") do |tree_name| + self.my_manifest.child_element_names(tree_name).map {|element_name| + self.__send__ element_name + } + end end - # ClassMethods + # Class Methods def self.operator operators return nil unless self.owner_type @@ -61,7 +74,7 @@ module Peta raise ActiveRecord::Forbidden unless content.own?(operators) content end - #InstanceMethods + # Instance Methods def owner_model self.class.owner_model ? self.__send__(self.class.owner_model.item_name) : self diff --git a/lib/peta/element.rb b/lib/peta/element.rb index 8346bffa..4f345eb9 100644 --- a/lib/peta/element.rb +++ b/lib/peta/element.rb @@ -1,193 +1,64 @@ module Peta - module Element - def self.included(base) - base.extend(ClassMethods) - base.__send__ :include, InstanceMethods + class Element < Content + self.abstract_class = true + + # Dynamic ClassMethods + + + def self.list_opt_for_panel + {} + end + + def self.show_opt_for_panel + {} + end + + def self.json_opt_for_panel + {} + end + + def has_picture? + false + end + + def has_part? + false + end + + def parts + @parts ||= [] + end + + def extend_column + nil + end + + def extend_element_name + self.extend_column ? self.attributes[extend_column] : self.element_name + end + + def parent + @parent + end + + def parent= content + @parent = content end - module ClassMethods - def colum_structures - raise - end - - def list_opt_for_panel - {} - end - - def show_opt_for_panel - {} - end - - def json_opt_for_panel - {} - end - - def path_name with_engine = false - self.to_s.tableize - end - + def scenario_template with_engine = false + self.path_name(with_engine) + '/scenario' end - module InstanceMethods - private - - public - - def has_picture? - false - end - - def has_part? - false - end - - def parts - @parts ||= [] - end - - def has_helper? column_name - self.class.colum_structures[column_name] and self.class.colum_structures[column_name][:helper] - end - - def element_name - self.class.to_s.underscore - end - - def extend_column - nil - end - - def extend_element_name - self.extend_column ? self.attributes[extend_column] : self.element_name - end - - def find_configurations hash, key - if hash[key].is_a? String - self.find_configurations hash, hash[key] - else - return hash[key] - end - end - - def element_index - @element_index ||= self.t - end - - def parent - @parent ||= self.panel - end - - def parent= content - @parent = content - end - - def new_index - @new_index - end - - def new_index= v - @new_index = v - end - - def new_panel - @new_panel - end - - def new_panel= v - @new_panel = v - end - - def get_panel - self.panel || @new_panel - end - - def tag_id c = nil - 'panel' + self.tag_panel_id + self.tag_element_type + self.tag_element_id + c.to_s - end - - def field_tag_id f - self.tag_id + f.to_s - end - - def tag_panel_id - self.get_panel.new_record? ? '0' : self.get_panel.id.to_s - end - - def tag_element_id - self.new_record? ? '0' : self.id.to_s - end - - def tag_element_type - raise - end - - def tag_new_index - self.new_index.to_s - end - - def path_name with_engine = false - self.class.path_name(with_engine) - end - - def form_template with_engine = false - self.path_name(with_engine) + '/form' - end - - def scenario_template with_engine = false - self.path_name(with_engine) + '/scenario' - end - - def element_face_template with_engine = false - self.path_name(with_engine) + '/element_face' - end - - def form_helper_template(colum_name) - self.class.colum_structures[colum_name][:helper] - end - - def tag_attributes column = nil, opt = {} - { - :id => self.field_tag_id(column), :panel_id => self.tag_panel_id, - :element_id => self.tag_element_id, :element_type => self.tag_element_type - }.merge(opt) - end - - def field_tag_attributes column, no_attr, opt = {} - self.tag_attributes(column).merge( - {:column => column, :new_index => self.tag_new_index, :no_attr => no_attr} - ).merge(opt) - end - - #render element by body - def any_tag_attributes name = nil, opt = {} - r = self.tag_attributes(name) - r.merge!( - {:new_index => self.tag_new_index} - ) if self.new_index - r.merge(opt) - end - - def select_tag_attributes(selected, column, no_attr) - [ - :last, :first, - {:html => {:selected => selected}}, - self.field_tag_attributes(column, no_attr) - ] - end - - def tag_attr column = nil, opt = {} - self.tag_attributes(column, opt).to_attr - end - - def field_tag_attr column, no_attr, opt = {} - self.field_tag_attributes(column, no_attr, opt).to_attr - end - - def any_tag_attr name = nil, opt = {} - self.any_tag_attributes(name, opt).to_attr - end - + def element_face_template with_engine = false + self.path_name(with_engine) + '/element_face' end + + def tag_attributes column = nil, opt = {} + r = super + r.merge({'data-parent_dom_id' => self.parent.dom_item_id}) if self.editor + r + end + end end diff --git a/lib/peta/item.rb b/lib/peta/item.rb index e85876a9..f9a3de74 100644 --- a/lib/peta/item.rb +++ b/lib/peta/item.rb @@ -86,14 +86,6 @@ module Peta {} end - def self.visible_count - self.count self.visible_count_options - end - - def self.visible_count_options - [] - end - #InstanceMethods def item_name @@ -150,31 +142,42 @@ module Peta true end - def pool - @pool + def editor + @editor + end + + def editor=(e) + @editor = e + end + + def pool_id + @pool_id || self.id + end + + def pool_id=(i) + @pool_id = i end def dom_id - self.new_record? ? '1' : self.id.to_s + self.pool_id.to_s end def dom_pool_type self.new_record? ? 'stored' : 'new' end - def dom_item_id column_name = nil - r = self.dom_pool_type + '-' + self.item_name + '-' + self.dom_id - r += '-' + column_name.to_s if column_name - r + def dom_item_id name = nil + r = [self.editor.eid, self.dom_pool_type, self.item_name, self.dom_id] + r += name.to_s if column_name + r.join '-' end - def tag_attributes column_name = nil, opt = {} + def tag_attributes name = nil, opt = {} r = { 'data-pool_type' => self.dom_pool_type, 'data-id' => self.dom_id, 'data-item_name' => self.item_name } - r.merge!({'id' => self.dom_item_id(column_name)}) if self.pool - # 'data-parent_dom_id' => self.parent.dom_item_id + r.merge!({'id' => self.dom_item_id(name)}) if self.editor r.merge!(opt) r end @@ -185,14 +188,5 @@ module Peta ) end - #render element by body - def any_tag_attributes name = nil, opt = {} - r = self.tag_attributes(name) - r.merge!( - {:new_index => self.tag_new_index} - ) if self.new_index - r.merge(opt) - end - end end -- 2.11.0