reparcs 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,225 @@
1
+ include Base
2
+
3
+ #XHTML form elements
4
+ module FormElements
5
+
6
+ #A Button element '<button></button>'
7
+ class Button < ContainerElement
8
+ #Creates a new button element, takes an optional
9
+ #hash of attributes as parameter.
10
+ def initialize(attrs={})
11
+ aattrs = [
12
+ "class", "id", "title", "xml:lang",
13
+ "onclick", "ondblclick", "onkeydown", "onkeypress",
14
+ "onkeyup", "onmousedown", "onmousemove", "onmouseout",
15
+ "onmouseover", "onmouseup", "accesskey", "disabled",
16
+ "name", "onblur", "onfocus", "tabindex", "type", "value"
17
+ ]
18
+ childs = [
19
+ "abbr", "acronym", "address", "b", "bdo", "big", "blockquote",
20
+ "br", "cite", "code", "dd", "del", "dfn", "div", "dl",
21
+ "em", "h1", "h2", "h3", "h4", "h5", "h6", "hr", "i", "img",
22
+ "ins", "kbd", "map", "noscript", "object", "ol", "p",
23
+ "pre", "q", "samp", "script", "small", "span", "strong",
24
+ "sub", "sup", "table", "tt", "ul", "var"
25
+ ]
26
+ super("button", aattrs, childs, attrs)
27
+ @start_element = "<button"
28
+ @end_element = "</button>"
29
+ end
30
+ end
31
+
32
+ #A Fieldset element
33
+ class FieldSet < ContainerElement
34
+ #Creates a new fieldset element, takes an optional
35
+ #hash of attributes as parameter.
36
+ def initialize(attrs={})
37
+ aattrs = [
38
+ "class", "id", "title", "xml:lang",
39
+ "onclick", "ondblclick", "onkeydown", "onkeypress",
40
+ "onkeyup", "onmousedown", "onmousemove", "onmouseout",
41
+ "onmouseover", "onmouseup"
42
+ ]
43
+ childs = [
44
+ "a", "abbr", "acronym", "address", "b", "bdo", "big",
45
+ "button", "caption", "cite", "code", "dd", "del", "dfn",
46
+ "div", "dt", "em", "fieldset", "form", "h1", "h2", "h3",
47
+ "h4", "h5", "h6", "i", "ins", "kbd", "label", "legend",
48
+ "li", "object", "p", "pre", "q", "samp", "small" ,"span",
49
+ "strong", "sub", "sup", "td", "th", "tt", "var"
50
+ ]
51
+ super("fieldset", aattrs, childs, attrs)
52
+ @start_element = "<fieldset"
53
+ @end_element = "</fieldset>"
54
+ end
55
+ end
56
+
57
+ #A form element
58
+ class Form < ContainerElement
59
+ #Creates a new Form element, takes an optional
60
+ #hash of attributes as parameter.
61
+ def initialize(attrs={})
62
+ aattrs = [
63
+ "class", "id", "title", "dir", "xml:lang",
64
+ "onclick", "ondblclick", "onkeydown", "onkeypress",
65
+ "onkeyup", "onmousedown", "onmousemove", "onmouseout",
66
+ "onmouseover", "onmouseup", "accept", "accept-charsets",
67
+ "action", "enctype", "method", "onreset", "onsubmit"
68
+ ]
69
+ childs = [
70
+ "address", "blockquote", "del", "div", "dl", "fieldset",
71
+ "h1", "h2", "h3", "h4", "h5", "h6", "hr", "ins",
72
+ "noscript", "ol", "p", "pre", "script", "table", "ul"
73
+ ]
74
+ super("form", aattrs, childs, attrs)
75
+ @start_element = "<form"
76
+ @end_element = "</form>"
77
+ end
78
+ end
79
+
80
+ #A Input element
81
+ class Input < Element
82
+ #Creates a new Input element, takes an optional
83
+ #hash of attributes as parameters.
84
+ def initialize(attrs={})
85
+ aattrs = [
86
+ "class", "id", "title", "dir", "xml:lang",
87
+ "onclick", "ondblclick", "onkeydown", "onkeypress",
88
+ "onkeyup", "onmousedown", "onmousemove", "onmouseout",
89
+ "onmouseover", "onmouseup", "accept", "accesskey",
90
+ "alt", "checked", "disabled", "maxlength", "name",
91
+ "onblur", "onchange", "onblur", "onfocus", "onselect",
92
+ "readonly", "src", "tabindex", "type", "usemap", "value"
93
+ ]
94
+ super("input", aattrs, attrs)
95
+ @start_element = "<input"
96
+ @end_element = " />"
97
+ end
98
+ end
99
+
100
+ #A Label element
101
+ class Label < ContainerElement
102
+ #Creates a new Label element, takes an optional
103
+ #hash of attributes as parameter.
104
+ def initialize(attrs={})
105
+ aattrs = [
106
+ "class", "id", "title", "dir", "xml:lang",
107
+ "onclick", "ondblclick", "onkeydown", "onkeypress",
108
+ "onkeyup", "onmousedown", "onmousemove", "onmouseout",
109
+ "onmouseover", "onmouseup", "for"
110
+ ]
111
+ childs = [
112
+ "a", "abbr", "acronym", "b", "bdo", "big", "br", "button",
113
+ "cite", "code", "del", "dfn", "em", "i", "ins", "kbd",
114
+ "label", "map", "object", "q", "samp", "script", "select",
115
+ "small", "span", "strong", "sub", "sup", "textarea",
116
+ "tt", "var"
117
+ ]
118
+ super("label", aattrs, childs, attrs)
119
+ @start_element = "<label"
120
+ @end_element = "</label>"
121
+ end
122
+ end
123
+
124
+ #A Legend element
125
+ class Legend < ContainerElement
126
+ #Creates a new Legend element, takes an optional
127
+ #hash of attributes as parameter.
128
+ def initialize(attrs={})
129
+ aattrs = [
130
+ "class", "id", "title", "dir", "xml:lang",
131
+ "onclick", "ondblclick", "onkeydown", "onkeypress",
132
+ "onkeyup", "onmousedown", "onmousemove", "onmouseout",
133
+ "onmouseover", "onmouseup", "accesskey", "charset"
134
+ ]
135
+ childs = [
136
+ "a", "abbr", "acronym", "b", "bdo", "big", "br", "button",
137
+ "cite", "code", "del", "dfn", "em", "i", "img", "input",
138
+ "ins", "kbd", "label", "map", "object", "q", "samp",
139
+ "script", "select", "small", "span", "strong", "sub",
140
+ "sup", "textarea", "tt", "var"
141
+ ]
142
+ super("legend", aattrs, childs, attrs)
143
+ @start_element = "<legend"
144
+ @end_element = "</legend>"
145
+ end
146
+ end
147
+
148
+ #A select element
149
+ class Select < ContainerElement
150
+ #Creates a new Select element, takes an optional hash
151
+ #of attributes as parameter.
152
+ def initialize(attrs={})
153
+ aattrs = [
154
+ "class", "id", "title", "dir", "xml:lang",
155
+ "onclick", "ondblclick", "onkeydown", "onkeypress",
156
+ "onkeyup", "onmousedown", "onmousemove", "onmouseout",
157
+ "onmouseover", "onmouseup", "accesskey", "charset", "style"
158
+ ]
159
+ childs = ["optgroup", "option"]
160
+ super("select", aattrs, childs, attrs)
161
+ @start_element = "<select"
162
+ @end_element = "</select>"
163
+ end
164
+ end
165
+
166
+ #A option group element
167
+ class OptionGroup < ContainerElement
168
+ #Creates a new OptionGroup element. takes an optional
169
+ #hash of attributes as parameter.
170
+ def initialize(attrs={})
171
+ aattrs = [
172
+ "class", "id", "title", "dir", "xml:lang",
173
+ "onclick", "ondblclick", "onkeydown", "onkeypress",
174
+ "onkeyup", "onmousedown", "onmousemove", "onmouseout",
175
+ "onmouseover", "onmouseup", "charset", "style"
176
+ ]
177
+ childs = ["option"]
178
+ super("optgroup", aattrs, childs, attrs)
179
+ @start_element = "<optgroup"
180
+ @end_element = "</optgroup>"
181
+ end
182
+ end
183
+
184
+ #A option element '<option></option>'
185
+ class Option < ContainerElement
186
+ #Creates a new Option element, takes an optional hash
187
+ #of attributes as parameter.
188
+ def initialize(attrs={})
189
+ aattrs = [
190
+ "class", "id", "title", "dir", "xml:lang",
191
+ "onclick", "ondblclick", "onkeydown", "onkeypress",
192
+ "onkeyup", "onmousedown", "onmousemove", "onmouseout",
193
+ "onmouseover", "onmouseup", "style"
194
+ ]
195
+ super("option", aattrs, [], attrs)
196
+ @start_element = "<option"
197
+ @end_element = "</option>"
198
+ end
199
+ end
200
+
201
+ #A text area element.
202
+ class TextArea < ContainerElement
203
+ #Creates a new TextArea element, takes an optional
204
+ #hash of attributes as parameter.
205
+ def initialize(attrs={})
206
+ aattrs = [
207
+ "class", "id", "title", "dir", "xml:lang",
208
+ "onclick", "ondblclick", "onkeydown", "onkeypress",
209
+ "onkeyup", "onmousedown", "onmousemove", "onmouseout",
210
+ "onmouseover", "onmouseup", "style", "charset", "hreflang"
211
+ ]
212
+ childs = [
213
+ "a", "abbr", "acronym", "b", "bdo", "big", "br", "button",
214
+ "cite","code", "del" , "dfn", "em", "i", "img", "input",
215
+ "ins", "kbd", "label", "map", "object", "q", "samp", "script",
216
+ "select", "small", "span", "strong", "sub", "sup",
217
+ "textarea", "tt", "var"
218
+ ]
219
+ super("textarea", aattrs, childs, attrs)
220
+ @start_element = "<textarea"
221
+ @end_element = "</textarea>"
222
+ end
223
+ end
224
+
225
+ end
@@ -0,0 +1,33 @@
1
+ include Base
2
+
3
+ #XHTML hypertext elements
4
+ module HypertextElements
5
+
6
+ #An anchor element
7
+ #Use: Define an anchor
8
+ class Anchor < ContainerElement
9
+ #Create a new Anchor
10
+ def initialize(attrs={})
11
+ aattrs = [
12
+ "class", "id", "title", "dir", "xml:lang",
13
+ "hreflang", "accesskey", "charset", "href",
14
+ "rel", "rev", "tabindex", "type", "coords",
15
+ "shape", "onblur", "onclick", "ondblclick",
16
+ "onfocus", "onkeydown", "onkeypress", "onkeyup",
17
+ "onmousedown", "onmousemove", "onmouseout",
18
+ "onmouseover", "onmouseup"
19
+ ]
20
+ childs = [
21
+ "abbr", "acronym", "b", "big", "br", "button",
22
+ "cite", "code", "del", "dfn", "em", "i", "img",
23
+ "input", "ins", "kbd", "label", "map", "object",
24
+ "q", "samp", "script", "select", "small", "span",
25
+ "strong", "sub", "sup", "textarea", "tt", "var"
26
+ ]
27
+ super("a", aattrs, childs, attrs)
28
+ @start_element = "<a"
29
+ @end_element = "</a>"
30
+ end
31
+ end
32
+
33
+ end
@@ -0,0 +1,64 @@
1
+ include Base
2
+
3
+ #XHTML image elements
4
+ module ImageElements
5
+
6
+ #A Image element.
7
+ class Image < Element
8
+ #Creates a new Image element, takes an optional
9
+ #hash of attributes as parameter.
10
+ def initialize(attrs={})
11
+ aattrs = [
12
+ "class", "id", "title", "dir", "xml:lang",
13
+ "onclick", "ondblclick", "onkeydown", "onkeypress",
14
+ "onkeyup", "onmousedown", "onmousemove", "onmouseout",
15
+ "onmouseover", "onmouseover", "onmouseup", "style"
16
+ ]
17
+ super("img", aattrs, attrs)
18
+ @start_element = "<img"
19
+ @end_element = " />"
20
+ end
21
+ end
22
+
23
+ #A Image map element '<map></map>'
24
+ class ImageMap < ContainerElement
25
+ #Creates a new ImageMap element, takes an optional
26
+ #hash of attributes as parameter.
27
+ def initialize(attrs={})
28
+ aattrs = [
29
+ "class", "id", "title", "dir", "xml:lang",
30
+ "onclick", "ondblclick", "onkeydown", "onkeypress",
31
+ "onkeyup", "onmousedown", "onmousemove", "onmouseout",
32
+ "onmouseover", "onmouseover", "onmouseup", "style"
33
+ ]
34
+ childs = [
35
+ "address", "area", "blockquote", "del", "div", "dl",
36
+ "fieldset", "form", "h1", "h2", "h3", "h4", "h5", "h6",
37
+ "hr", "ins", "noscript", "ol", "p", "pre", "script",
38
+ "table", "ul"
39
+ ]
40
+ super("map", aattrs. childs, attrs)
41
+ @start_element = "<map"
42
+ @end_element = "</map>"
43
+ end
44
+ end
45
+
46
+ #A image map region element '<area />'
47
+ class ImageMapRegion < Element
48
+ #Creates a new ImageMapRegion element, takes an optional
49
+ #hash of attributes as parameter.
50
+ def initialize(attrs={})
51
+ aattrs = [
52
+ "class", "id", "title", "dir", "xml:lang",
53
+ "onclick", "ondblclick", "onkeydown", "onkeypress",
54
+ "onkeyup", "onmousedown", "onmousemove", "onmouseout",
55
+ "onmouseover", "onmouseover", "onmouseup", "style",
56
+ "accesskey", "alt", "coords", "href", "shape", "tabindex"
57
+ ]
58
+ super("area", aattrs, attrs)
59
+ @start_element = "<area"
60
+ @end_element = " />"
61
+ end
62
+ end
63
+
64
+ end
@@ -0,0 +1,24 @@
1
+ include Base
2
+
3
+ #XHTML link elements.
4
+ module LinkElements
5
+
6
+ #A link element '<link />'
7
+ class Link < Element
8
+ #Creates a new Link element, takes an optional hash
9
+ #of attributes as parameter.
10
+ def initialize(attrs={})
11
+ aattrs = [
12
+ "class", "id", "title", "charset", "dir",
13
+ "hreflang", "xml:lang", "onclick", "ondblclick",
14
+ "onkeydown", "onkeypress", "onkeyup", "onmousedown",
15
+ "onmousemove", "onmouseout", "onmouseover", "onmouseup",
16
+ "style", "href", "media", "rel", "rev", "type"
17
+ ]
18
+ super("link", aattrs, attrs)
19
+ @start_element = "<link"
20
+ @end_element = " />"
21
+ end
22
+ end
23
+
24
+ end
@@ -0,0 +1,151 @@
1
+ include Base
2
+
3
+ #XHTML list elements
4
+ module ListElements
5
+
6
+ #A definition list element '<dl></dl>'
7
+ class DefinitionList < ContainerElement
8
+ #Creates a new DefinitionList element, takes an optional hash of attributes
9
+ #as parameter.
10
+ def initialize(attrs={})
11
+ aattrs = [
12
+ "class", "id", "title", "dir", "xml:lang",
13
+ "onclick", "ondblclick", "onkeydown",
14
+ "onkeypress", "onkeyup", "onmousedown",
15
+ "onmousemove", "onmouseout", "onmouseover",
16
+ "onmouseup", "style"
17
+ ]
18
+ childs = ["dd", "dt"]
19
+ super("dl", aattrs, childs, attrs)
20
+ @start_element = "<dl"
21
+ @end_element = "</dl>"
22
+ end
23
+ end
24
+
25
+ #A definition description element '<dd></dd>' for use
26
+ #within a DefiniitonList.
27
+ #Use: define a definition.
28
+ class DefinitionDescription < ContainerElement
29
+ #Create a new Definition, takes an optional hash
30
+ #of attributes as parameter.
31
+ def initialize(attrs={})
32
+ aattrs = [
33
+ "class", "id", "title", "dir" ,"xml:lang",
34
+ "onclick", "ondblclick", "onkeydown",
35
+ "onkeypress", "onkeyup", "onmousedown",
36
+ "onmousemove", "onmouseout", "onmouseover",
37
+ "onmouseup"
38
+ ]
39
+ childs = [
40
+ "a", "abbr", "acronym", "b" ,"bdo", "big",
41
+ "blockquote", "br", "button", "cite", "code",
42
+ "del", "dfn", "div", "dl", "fieldset", "form",
43
+ "h1", "h2", "h3", "h4", "h5", "h6", "hr",
44
+ "i", "img", "input", "ins", "kbd", "label",
45
+ "map", "noscript", "object", "ol", "p", "pre",
46
+ "q", "samp", "script", "select", "small", "span",
47
+ "strong", "sub", "sup", "table", "textarea",
48
+ "tt", "ul", "var"
49
+ ]
50
+ super("dd", aattrs, childs, attrs)
51
+ @start_element = "<dd"
52
+ @end_element = "</dd>"
53
+ end
54
+ end
55
+
56
+ #A defintion term element '<dt></dt>' for use
57
+ #within a DefintionList.
58
+ #Use: define a definition term.
59
+ class DefinitionTerm < ContainerElement
60
+ #Create a new DefinitionTerm, takes an optional hash of attributes
61
+ #as parameter
62
+ def initialize(attrs={})
63
+ aattrs = [
64
+ "class", "id", "title", "dir", "xml:lang",
65
+ "onclick", "ondblclick", "onkeydown",
66
+ "onkeypress", "onkeyup", "onmousedown",
67
+ "onmousemove", "onmouseout", "onmouseover",
68
+ "onmouseup", "style"
69
+ ]
70
+ childs = [
71
+ "a", "abbr", "acronym", "b", "bdo", "big",
72
+ "br", "button", "cite", "code", "del", "dfn",
73
+ "em", "i", "img", "input", "ins", "kbd", "label",
74
+ "map", "object", "q", "samp", "script", "select",
75
+ "small", "span", "strong", "sub", "sup",
76
+ "textarea", "tt", "var"
77
+ ]
78
+ super("dt", aattrs, childs, attrs)
79
+ @start_element = "<dt"
80
+ @end_element = "</dt>"
81
+ end
82
+ end
83
+
84
+ #A OrderedList element '<ol></ol>'
85
+ #Use: Define a ordered list.
86
+ class OrderedList < ContainerElement
87
+ #Create a new OrderedList, takes an optional hash of attributes
88
+ #as parameter.
89
+ def initialize(attrs={})
90
+ aattrs = [
91
+ "class", "id", "title", "dir", "xml:lang",
92
+ "onclick", "ondblclick", "onkeydown",
93
+ "onkeypress", "onkeyup", "onmousedown",
94
+ "onmousemove", "onmouseout", "onmouseover",
95
+ "onmouseup", "style"
96
+ ]
97
+ childs = ["li"]
98
+ super("ol", aattrs, childs, attrs)
99
+ @start_element = "<ol"
100
+ @end_element = "</ol>"
101
+ end
102
+ end
103
+
104
+ #A UnorderedList element '<ul></ul>'
105
+ class UnorderedList < ContainerElement
106
+ #Create a new UnorderedList, takes an optional hash
107
+ #of attributes as parameter.
108
+ def initialize(attrs={})
109
+ aattrs = [
110
+ "class", "id", "title", "dir", "xml:lang",
111
+ "onclick", "ondblclick", "onkeydown",
112
+ "onkeypress", "onkeyup", "onmousedown",
113
+ "onmousemove", "onmouseout", "onmouseover",
114
+ "onmouseup", "style"
115
+ ]
116
+ childs = ["li"]
117
+ super("ul", aattrs, childs, attrs)
118
+ @start_element = "<ul"
119
+ @end_element = "</ul>"
120
+ end
121
+ end
122
+
123
+ #A ListItem element '<li></li>' for use within a UnorderedList or
124
+ #a OrderedList.
125
+ class ListItem < ContainerElement
126
+ #Create a new ListItem element, takes an optional hash of attributes as parameter.
127
+ def initialize(attrs={})
128
+ aattrs = [
129
+ "class", "id", "title", "dir", "xml:lang",
130
+ "onclick", "ondblclick", "onkeydown",
131
+ "onkeypress", "onkeyup", "onmousedown",
132
+ "onmousemove", "onmouseout", "onmouseover",
133
+ "onmouseup", "style"
134
+ ]
135
+ childs = [
136
+ "a", "abbr", "acronym", "b", "bdo", "big", "br",
137
+ "button", "cite", "code", "del", "dfn", "div",
138
+ "dl", "em", "fieldset", "form", "h1", "h2",
139
+ "h3", "h4", "h5", "h6", "hr", "i", "img", "input",
140
+ "ins", "kbd", "label", "map", "noscript", "object",
141
+ "ol", "p", "pre", "q", "samp", "script", "select",
142
+ "small", "span", "strong", "sub", "sup",
143
+ "textarea", "tt", "ul", "var"
144
+ ]
145
+ super("li", aattrs, childs, attrs)
146
+ @start_element = "<li"
147
+ @end_element = "</li>"
148
+ end
149
+ end
150
+
151
+ end
@@ -0,0 +1,21 @@
1
+ include Base
2
+
3
+ #XHTML meta elements.
4
+ module MetaElements
5
+
6
+ #A meta element '<meta />'
7
+ class Meta < Element
8
+ #Creates a new Meta element, takes an optional hash
9
+ #of attributes as parameter.
10
+ def initialize(attrs={})
11
+ aattrs = [
12
+ "id", "dir", "xml:lang", "content",
13
+ "http-equiv", "scheme"
14
+ ]
15
+ super("meta", aattrs, attrs)
16
+ @start_element = "<meta"
17
+ @end_element = " />"
18
+ end
19
+ end
20
+
21
+ end
@@ -0,0 +1,47 @@
1
+ include Base
2
+
3
+ #XHTML object elements
4
+ module ObjectElements
5
+
6
+ #A Object element '<object></object>'
7
+ class Object < ContainerElement
8
+ #Create a new object element, takes an optional hash
9
+ #of attributes as parameter.
10
+ def initialize(attrs={})
11
+ aattrs = [
12
+ "class", "id", "title", "dir", "xml:lang",
13
+ "onclick", "ondblclick", "onkeydown",
14
+ "onkeypress", "onkeyup", "onmousedown",
15
+ "onmousemove", "onmouseout", "onmouseover",
16
+ "onmouseup", "style", "classid", "codebase",
17
+ "codetype", "data", "type", "archive",
18
+ "declare", "standby", "height", "width",
19
+ "tabindex"
20
+ ]
21
+ childs = [
22
+ "a", "abbr", "acronym", "b", "bdo", "big",
23
+ "br", "button", "cite", "code", "del",
24
+ "dfn", "em", "i", "img", "input", "ins",
25
+ "kbd", "label", "map", "object", "param",
26
+ "q", "samp", "script", "select", "small",
27
+ "span", "strong", "sub", "sup", "textarea",
28
+ "tt", "var"
29
+ ]
30
+ super("object", aattrs, childs, attrs)
31
+ @start_element = "<object"
32
+ @end_element = "</object>"
33
+ end
34
+ end
35
+
36
+ #A Param element '<param />'
37
+ class Param < Element
38
+ #Create a new Param element
39
+ def initialize(attrs={})
40
+ aattrs = ["id", "name", "type", "value", "valuetype"]
41
+ super("param", aattrs, attrs)
42
+ @start_element = "<param"
43
+ @end_element = " />"
44
+ end
45
+ end
46
+
47
+ end