Class: FormElements::Button

Inherits:
ContainerElement
  • Object
show all
Defined in:
lib/reparcs/elements/form_elements.rb

Overview

A Button element ‘<button></button>’

Instance Method Summary collapse

Constructor Details

#initialize(attrs = {}) ⇒ Button

Creates a new button element, takes an optional hash of attributes as parameter.



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/reparcs/elements/form_elements.rb', line 10

def initialize(attrs={})
  aattrs = [
    "class", "id", "title", "xml:lang",
    "onclick", "ondblclick", "onkeydown", "onkeypress",
    "onkeyup", "onmousedown", "onmousemove", "onmouseout",
    "onmouseover", "onmouseup", "accesskey", "disabled",
    "name", "onblur", "onfocus", "tabindex", "type", "value"
  ]
  childs = [
    "abbr", "acronym", "address", "b", "bdo", "big", "blockquote",
    "br", "cite", "code", "dd", "del", "dfn", "div", "dl",
    "em", "h1", "h2", "h3", "h4", "h5", "h6", "hr", "i", "img",
    "ins", "kbd", "map", "noscript", "object", "ol", "p",
    "pre", "q", "samp", "script", "small", "span", "strong",
    "sub", "sup", "table", "tt", "ul", "var"
  ]
  super("button", aattrs, childs, attrs)
  @start_element = "<button"
  @end_element = "</button>"
end