Sha256: 2ed047e80845763b56d8ef1ef2e8bb14f2dedb4113388129e76fb8626ce0b6b2

Contents?: true

Size: 1.64 KB

Versions: 9

Compression:

Stored size: 1.64 KB

Contents

module Arbre
  module HTML

    AUTO_BUILD_ELEMENTS = [ :a, :abbr, :address, :area, :article, :aside, :audio, :b, :base,
                       :bdo, :blockquote, :body, :br, :button, :canvas, :caption, :cite,
                       :code, :col, :colgroup, :command, :datalist, :dd, :del, :details,
                       :dfn, :div, :dl, :dt, :em, :embed, :fieldset, :figcaption, :figure,
                       :footer, :form, :h1, :h2, :h3, :h4, :h5, :h6, :head, :header, :hgroup, 
                       :hr, :html, :i, :iframe, :img, :input, :ins, :keygen, :kbd, :label, 
                       :legend, :li, :link, :map, :mark, :menu, :menuitem, :meta, :meter, :nav, :noscript, 
                       :object, :ol, :optgroup, :option, :output, :param, :pre, :progress, :q,
                       :s, :samp, :script, :section, :select, :small, :source, :span,
                       :strong, :style, :sub, :summary, :sup, :svg, :table, :tbody, :td,
                       :textarea, :tfoot, :th, :thead, :time, :title, :tr, :track, :ul, :var, :video, :wbr ]

    HTML5_ELEMENTS = [ :p ] + AUTO_BUILD_ELEMENTS

    AUTO_BUILD_ELEMENTS.each do |name|
      class_eval <<-EOF
        class #{name.to_s.capitalize} < Tag
          builder_method :#{name}
        end
      EOF
    end

    class P < Tag
      builder_method :para
    end

    class Table < Tag
      def initialize(*)
        super
        set_table_tag_defaults
      end

      protected

      # Set some good defaults for tables
      def set_table_tag_defaults
        set_attribute :border,      0
        set_attribute :cellspacing, 0
        set_attribute :cellpadding, 0
      end
    end

  end
end

Version data entries

9 entries across 9 versions & 2 rubygems

Version Path
date_n_time_picker_activeadmin-0.1.2 vendor/bundle/ruby/2.6.0/gems/arbre-1.4.0/lib/arbre/html/html5_elements.rb
date_n_time_picker_activeadmin-0.1.1 vendor/bundle/ruby/2.6.0/gems/arbre-1.4.0/lib/arbre/html/html5_elements.rb
arbre-1.4.0 lib/arbre/html/html5_elements.rb
arbre-1.3.0 lib/arbre/html/html5_elements.rb
arbre-1.2.1 lib/arbre/html/html5_elements.rb
arbre-1.2.0 lib/arbre/html/html5_elements.rb
arbre-1.2.0.rc1 lib/arbre/html/html5_elements.rb
arbre-1.1.1 lib/arbre/html/html5_elements.rb
arbre-1.0.3 lib/arbre/html/html5_elements.rb