bivouac 0.0.6 → 0.0.7
Sign up to get free protection for your applications and to get access to all the features.
- data/README +9 -0
- data/bin/bivouac +15 -19
- data/doc/rdoc/classes/BivouacHelpers.html +117 -0
- data/doc/rdoc/classes/BivouacHelpers/BaseView.html +140 -0
- data/doc/rdoc/classes/BivouacHelpers/FormView.html +398 -0
- data/doc/rdoc/classes/BivouacHelpers/HtmlView.html +274 -0
- data/doc/rdoc/classes/BivouacHelpers/JavaScriptView.html +573 -0
- data/doc/rdoc/classes/BivouacHelpers/ScriptAculoUsView.html +258 -0
- data/doc/rdoc/classes/BivouacHelpers/TooltipView.html +158 -0
- data/doc/rdoc/classes/JavaScriptGenerator.html +564 -0
- data/doc/rdoc/created.rid +1 -1
- data/doc/rdoc/files/AUTHORS.html +14 -0
- data/doc/rdoc/files/COPYING.html +14 -0
- data/doc/rdoc/files/README.html +40 -1
- data/doc/rdoc/files/lib/bivouac/helpers/view/goh/base_rb.html +109 -0
- data/doc/rdoc/files/lib/bivouac/helpers/view/goh/form_rb.html +109 -0
- data/doc/rdoc/files/lib/bivouac/helpers/view/goh/html_rb.html +109 -0
- data/doc/rdoc/files/lib/bivouac/helpers/view/goh/javascript_rb.html +113 -0
- data/doc/rdoc/files/lib/bivouac/helpers/view/goh/scriptaculous_rb.html +113 -0
- data/doc/rdoc/files/lib/bivouac/helpers/view/goh/tooltip_rb.html +109 -0
- data/examples/bivouac_sample/app/bivouac_sample.rb +61 -0
- data/examples/bivouac_sample/app/controllers/autocomplete.rb +24 -0
- data/examples/bivouac_sample/app/controllers/drag_and_drop.rb +11 -0
- data/examples/bivouac_sample/app/controllers/index.rb +7 -0
- data/examples/bivouac_sample/app/controllers/observe.rb +14 -0
- data/examples/bivouac_sample/app/controllers/periodically_call.rb +12 -0
- data/examples/bivouac_sample/app/controllers/remote_form.rb +10 -0
- data/examples/bivouac_sample/app/controllers/remote_link.rb +11 -0
- data/examples/bivouac_sample/app/controllers/submit_remote.rb +17 -0
- data/examples/bivouac_sample/app/controllers/toggle.rb +10 -0
- data/examples/bivouac_sample/app/controllers/toggle_sortable.rb +11 -0
- data/examples/bivouac_sample/app/helpers/_helpers.rb +25 -0
- data/examples/bivouac_sample/app/helpers/source.rb +25 -0
- data/examples/bivouac_sample/app/views/_autocomplete_result.rb +9 -0
- data/examples/bivouac_sample/app/views/_drag_and_drop_result.rb +5 -0
- data/examples/bivouac_sample/app/views/_observe_result.rb +17 -0
- data/examples/bivouac_sample/app/views/_periodically_call_result.rb +5 -0
- data/examples/bivouac_sample/app/views/_remote_link_result.rb +5 -0
- data/examples/bivouac_sample/app/views/_sortable_result.rb +5 -0
- data/examples/bivouac_sample/app/views/_submit_remote_result.rb +5 -0
- data/examples/bivouac_sample/app/views/autocomplete.rb +28 -0
- data/examples/bivouac_sample/app/views/drag_and_drop.rb +35 -0
- data/examples/bivouac_sample/app/views/index.rb +19 -0
- data/examples/bivouac_sample/app/views/observe.rb +19 -0
- data/examples/bivouac_sample/app/views/periodically_call.rb +17 -0
- data/examples/bivouac_sample/app/views/remote_form.rb +19 -0
- data/examples/bivouac_sample/app/views/remote_link.rb +20 -0
- data/examples/bivouac_sample/app/views/submit_remote.rb +21 -0
- data/examples/bivouac_sample/app/views/toggle.rb +44 -0
- data/examples/bivouac_sample/app/views/toggle_sortable.rb +52 -0
- data/examples/bivouac_sample/config/environment.rb +37 -0
- data/examples/bivouac_sample/config/postamble.rb +62 -0
- data/examples/bivouac_sample/log/BivouacSample.log +77 -0
- data/examples/bivouac_sample/public/images/camping.png +0 -0
- data/examples/bivouac_sample/public/index.html +242 -0
- data/examples/bivouac_sample/public/javascripts/builder.js +131 -0
- data/examples/bivouac_sample/public/javascripts/controls.js +835 -0
- data/examples/bivouac_sample/public/javascripts/dragdrop.js +944 -0
- data/examples/bivouac_sample/public/javascripts/effects.js +1090 -0
- data/examples/bivouac_sample/public/javascripts/prototype.js +2515 -0
- data/examples/bivouac_sample/public/javascripts/scriptaculous.js +51 -0
- data/examples/bivouac_sample/public/javascripts/slider.js +278 -0
- data/examples/bivouac_sample/public/javascripts/tooltip.js +208 -0
- data/examples/bivouac_sample/public/javascripts/unittest.js +564 -0
- data/examples/bivouac_sample/public/stylesheets/autocomplete.css +22 -0
- data/examples/bivouac_sample/public/stylesheets/coderay.css +104 -0
- data/examples/bivouac_sample/script/generate +3 -0
- data/examples/bivouac_sample/script/server +5 -0
- data/lib/bivouac/helpers/view/goh/base.rb +16 -0
- data/lib/bivouac/helpers/view/goh/form.rb +170 -0
- data/lib/bivouac/helpers/view/goh/html.rb +138 -0
- data/lib/bivouac/helpers/view/goh/javascript.rb +532 -0
- data/lib/bivouac/helpers/view/goh/scriptaculous.rb +133 -0
- data/lib/bivouac/helpers/view/goh/tooltip.rb +33 -0
- data/lib/bivouac/template.rb +3 -3
- data/lib/bivouac/template/application/helpers_erb.rb +11 -0
- data/lib/bivouac/template/application/helpers_goh.rb +25 -0
- data/lib/bivouac/template/application/postamble.rb +62 -0
- data/lib/bivouac/template/application_erb.rb +4 -0
- data/lib/bivouac/template/application_goh.rb +4 -0
- data/lib/bivouac/template/environment.rb +19 -5
- data/lib/bivouac/template/server.rb +1 -1
- data/lib/bivouac/template/static/autocomplete.css +22 -0
- data/lib/bivouac/template/static/builder.js +131 -0
- data/lib/bivouac/template/static/controls.js +835 -0
- data/lib/bivouac/template/static/dragdrop.js +944 -0
- data/lib/bivouac/template/static/effects.js +1090 -0
- data/lib/bivouac/template/static/prototype.js +2515 -0
- data/lib/bivouac/template/static/scriptaculous.js +51 -0
- data/lib/bivouac/template/static/slider.js +278 -0
- data/lib/bivouac/template/static/tooltip.js +208 -0
- data/lib/bivouac/template/static/unittest.js +564 -0
- metadata +124 -7
- data/lib/bivouac/template/application/postamble_cgi.rb +0 -8
- data/lib/bivouac/template/application/postamble_fastcgi.rb +0 -8
- data/lib/bivouac/template/application/postamble_mongrel.rb +0 -19
- data/lib/bivouac/template/application/postamble_none.rb +0 -1
- data/lib/bivouac/template/application/postamble_webrick.rb +0 -19
@@ -0,0 +1,77 @@
|
|
1
|
+
# Logfile created on Mon Sep 10 21:52:55 +0200 2007 by /
|
2
|
+
allow_concurrency=false
|
3
|
+
allow_concurrency=false
|
4
|
+
allow_concurrency=false
|
5
|
+
allow_concurrency=false
|
6
|
+
allow_concurrency=false
|
7
|
+
allow_concurrency=false
|
8
|
+
allow_concurrency=false
|
9
|
+
allow_concurrency=false
|
10
|
+
allow_concurrency=false
|
11
|
+
allow_concurrency=false
|
12
|
+
allow_concurrency=false
|
13
|
+
allow_concurrency=false
|
14
|
+
allow_concurrency=false
|
15
|
+
allow_concurrency=false
|
16
|
+
allow_concurrency=false
|
17
|
+
allow_concurrency=false
|
18
|
+
allow_concurrency=false
|
19
|
+
allow_concurrency=false
|
20
|
+
allow_concurrency=false
|
21
|
+
allow_concurrency=false
|
22
|
+
allow_concurrency=false
|
23
|
+
allow_concurrency=false
|
24
|
+
allow_concurrency=false
|
25
|
+
allow_concurrency=false
|
26
|
+
allow_concurrency=false
|
27
|
+
allow_concurrency=false
|
28
|
+
allow_concurrency=false
|
29
|
+
allow_concurrency=false
|
30
|
+
allow_concurrency=false
|
31
|
+
allow_concurrency=false
|
32
|
+
allow_concurrency=false
|
33
|
+
allow_concurrency=false
|
34
|
+
allow_concurrency=false
|
35
|
+
allow_concurrency=false
|
36
|
+
allow_concurrency=false
|
37
|
+
allow_concurrency=false
|
38
|
+
allow_concurrency=false
|
39
|
+
allow_concurrency=false
|
40
|
+
allow_concurrency=false
|
41
|
+
allow_concurrency=false
|
42
|
+
allow_concurrency=false
|
43
|
+
allow_concurrency=false
|
44
|
+
allow_concurrency=false
|
45
|
+
allow_concurrency=false
|
46
|
+
allow_concurrency=false
|
47
|
+
allow_concurrency=false
|
48
|
+
allow_concurrency=false
|
49
|
+
allow_concurrency=false
|
50
|
+
allow_concurrency=false
|
51
|
+
allow_concurrency=false
|
52
|
+
allow_concurrency=false
|
53
|
+
allow_concurrency=false
|
54
|
+
allow_concurrency=false
|
55
|
+
allow_concurrency=false
|
56
|
+
allow_concurrency=false
|
57
|
+
allow_concurrency=false
|
58
|
+
allow_concurrency=false
|
59
|
+
allow_concurrency=false
|
60
|
+
allow_concurrency=false
|
61
|
+
allow_concurrency=false
|
62
|
+
allow_concurrency=false
|
63
|
+
allow_concurrency=false
|
64
|
+
allow_concurrency=false
|
65
|
+
allow_concurrency=false
|
66
|
+
allow_concurrency=false
|
67
|
+
allow_concurrency=false
|
68
|
+
allow_concurrency=false
|
69
|
+
allow_concurrency=false
|
70
|
+
allow_concurrency=false
|
71
|
+
allow_concurrency=false
|
72
|
+
allow_concurrency=false
|
73
|
+
allow_concurrency=false
|
74
|
+
allow_concurrency=false
|
75
|
+
allow_concurrency=false
|
76
|
+
allow_concurrency=false
|
77
|
+
allow_concurrency=false
|
Binary file
|
@@ -0,0 +1,242 @@
|
|
1
|
+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
2
|
+
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
3
|
+
<html>
|
4
|
+
<head>
|
5
|
+
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
|
6
|
+
<title>Bivouac: Welcome aboard</title>
|
7
|
+
<style type="text/css" media="screen">
|
8
|
+
body {
|
9
|
+
margin: 0;
|
10
|
+
margin-bottom: 25px;
|
11
|
+
padding: 0;
|
12
|
+
background-color: #f0f0f0;
|
13
|
+
font-family: "Lucida Grande", "Bitstream Vera Sans", "Verdana";
|
14
|
+
font-size: 13px;
|
15
|
+
color: #333;
|
16
|
+
}
|
17
|
+
|
18
|
+
h1 {
|
19
|
+
font-size: 28px;
|
20
|
+
color: #000;
|
21
|
+
}
|
22
|
+
|
23
|
+
a {color: #03c}
|
24
|
+
a:hover {
|
25
|
+
background-color: #03c;
|
26
|
+
color: white;
|
27
|
+
text-decoration: none;
|
28
|
+
}
|
29
|
+
|
30
|
+
|
31
|
+
#page {
|
32
|
+
background-color: #f0f0f0;
|
33
|
+
width: 750px;
|
34
|
+
margin: 0;
|
35
|
+
margin-left: auto;
|
36
|
+
margin-right: auto;
|
37
|
+
}
|
38
|
+
|
39
|
+
#content {
|
40
|
+
float: left;
|
41
|
+
background-color: white;
|
42
|
+
border: 3px solid #aaa;
|
43
|
+
border-top: none;
|
44
|
+
padding: 25px;
|
45
|
+
width: 500px;
|
46
|
+
}
|
47
|
+
|
48
|
+
#sidebar {
|
49
|
+
float: right;
|
50
|
+
width: 175px;
|
51
|
+
}
|
52
|
+
|
53
|
+
#footer {
|
54
|
+
clear: both;
|
55
|
+
}
|
56
|
+
|
57
|
+
|
58
|
+
#header, #about, #getting-started {
|
59
|
+
padding-left: 75px;
|
60
|
+
padding-right: 30px;
|
61
|
+
}
|
62
|
+
|
63
|
+
|
64
|
+
#header {
|
65
|
+
background-image: url("images/camping.png");
|
66
|
+
background-repeat: no-repeat;
|
67
|
+
background-position: top right;
|
68
|
+
height: 100px;
|
69
|
+
}
|
70
|
+
#header h1, #header h2 {margin: 0}
|
71
|
+
#header h2 {
|
72
|
+
color: #888;
|
73
|
+
font-weight: normal;
|
74
|
+
font-size: 16px;
|
75
|
+
}
|
76
|
+
|
77
|
+
|
78
|
+
#about h3 {
|
79
|
+
margin: 0;
|
80
|
+
margin-bottom: 10px;
|
81
|
+
font-size: 14px;
|
82
|
+
}
|
83
|
+
|
84
|
+
#about-content {
|
85
|
+
background-color: #ffd;
|
86
|
+
border: 1px solid #fc0;
|
87
|
+
margin-left: -11px;
|
88
|
+
}
|
89
|
+
#about-content table {
|
90
|
+
margin-top: 10px;
|
91
|
+
margin-bottom: 10px;
|
92
|
+
font-size: 11px;
|
93
|
+
border-collapse: collapse;
|
94
|
+
}
|
95
|
+
#about-content td {
|
96
|
+
padding: 10px;
|
97
|
+
padding-top: 3px;
|
98
|
+
padding-bottom: 3px;
|
99
|
+
}
|
100
|
+
#about-content td.name {color: #555}
|
101
|
+
#about-content td.value {color: #000}
|
102
|
+
|
103
|
+
#about-content.failure {
|
104
|
+
background-color: #fcc;
|
105
|
+
border: 1px solid #f00;
|
106
|
+
}
|
107
|
+
#about-content.failure p {
|
108
|
+
margin: 0;
|
109
|
+
padding: 10px;
|
110
|
+
}
|
111
|
+
|
112
|
+
|
113
|
+
#getting-started {
|
114
|
+
border-top: 1px solid #ccc;
|
115
|
+
margin-top: 25px;
|
116
|
+
padding-top: 15px;
|
117
|
+
}
|
118
|
+
#getting-started h1 {
|
119
|
+
margin: 0;
|
120
|
+
font-size: 20px;
|
121
|
+
}
|
122
|
+
#getting-started h2 {
|
123
|
+
margin: 0;
|
124
|
+
font-size: 14px;
|
125
|
+
font-weight: normal;
|
126
|
+
color: #333;
|
127
|
+
margin-bottom: 25px;
|
128
|
+
}
|
129
|
+
#getting-started ol {
|
130
|
+
margin-left: 0;
|
131
|
+
padding-left: 0;
|
132
|
+
}
|
133
|
+
#getting-started li {
|
134
|
+
font-size: 18px;
|
135
|
+
color: #888;
|
136
|
+
margin-bottom: 25px;
|
137
|
+
}
|
138
|
+
#getting-started li h2 {
|
139
|
+
margin: 0;
|
140
|
+
font-weight: normal;
|
141
|
+
font-size: 18px;
|
142
|
+
color: #333;
|
143
|
+
}
|
144
|
+
#getting-started li p {
|
145
|
+
color: #555;
|
146
|
+
font-size: 13px;
|
147
|
+
}
|
148
|
+
|
149
|
+
|
150
|
+
#search {
|
151
|
+
margin: 0;
|
152
|
+
padding-top: 10px;
|
153
|
+
padding-bottom: 10px;
|
154
|
+
font-size: 11px;
|
155
|
+
}
|
156
|
+
#search input {
|
157
|
+
font-size: 11px;
|
158
|
+
margin: 2px;
|
159
|
+
}
|
160
|
+
#search-text {width: 170px}
|
161
|
+
|
162
|
+
|
163
|
+
#sidebar ul {
|
164
|
+
margin-left: 0;
|
165
|
+
padding-left: 0;
|
166
|
+
}
|
167
|
+
#sidebar ul h3 {
|
168
|
+
margin-top: 25px;
|
169
|
+
font-size: 16px;
|
170
|
+
padding-bottom: 10px;
|
171
|
+
border-bottom: 1px solid #ccc;
|
172
|
+
}
|
173
|
+
#sidebar li {
|
174
|
+
list-style-type: none;
|
175
|
+
}
|
176
|
+
#sidebar ul.links li {
|
177
|
+
margin-bottom: 5px;
|
178
|
+
}
|
179
|
+
|
180
|
+
</style>
|
181
|
+
</head>
|
182
|
+
<body>
|
183
|
+
<div id="page">
|
184
|
+
<div id="sidebar">
|
185
|
+
<ul id="sidebar-items">
|
186
|
+
<li>
|
187
|
+
<form id="search" action="http://www.google.com/search" method="get">
|
188
|
+
<input type="hidden" name="hl" value="en" />
|
189
|
+
<input type="text" id="search-text" name="q" value="site:code.whytheluckystiff.net/camping " />
|
190
|
+
<input type="submit" value="Search" /> the Camping site
|
191
|
+
</form>
|
192
|
+
</li>
|
193
|
+
|
194
|
+
<li>
|
195
|
+
<h3>Join the community</h3>
|
196
|
+
<ul class="links">
|
197
|
+
<li><a href="http://redhanded.hobix.com/bits/campingAMicroframework.html">Camping</a></li>
|
198
|
+
<li><a href="http://code.whytheluckystiff.net/camping">Wiki</a></li>
|
199
|
+
<li><a href="http://code.whytheluckystiff.net/camping/browser/">Code</a></li>
|
200
|
+
<li><a href="http://code.whytheluckystiff.net/camping/report/1">Bug tracker</a></li>
|
201
|
+
</ul>
|
202
|
+
</li>
|
203
|
+
|
204
|
+
<li>
|
205
|
+
<h3>Browse the documentation</h3>
|
206
|
+
<ul class="links">
|
207
|
+
<li><a href="http://camping.rubyforge.org/files/README.html">Camping API</a></li>
|
208
|
+
<li><a href="http://stdlib.rubyonrails.org/">Ruby standard library</a></li>
|
209
|
+
<li><a href="http://corelib.rubyonrails.org/">Ruby core</a></li>
|
210
|
+
</ul>
|
211
|
+
</li>
|
212
|
+
</ul>
|
213
|
+
</div>
|
214
|
+
|
215
|
+
<div id="content">
|
216
|
+
<div id="header">
|
217
|
+
<h1>Welcome aboard</h1>
|
218
|
+
<h2>You can now go in the tent!</h2>
|
219
|
+
</div>
|
220
|
+
|
221
|
+
<div id="getting-started">
|
222
|
+
<h1>Getting started</h1>
|
223
|
+
<h2>Here’s how to get rolling:</h2>
|
224
|
+
|
225
|
+
<ol>
|
226
|
+
<li>
|
227
|
+
<h2>Use <tt>script/generate</tt> to create your models and controllers</h2>
|
228
|
+
<p>To see all available options, run it without parameters.</p>
|
229
|
+
</li>
|
230
|
+
|
231
|
+
<li>
|
232
|
+
<h2>That's all folks...</h2>
|
233
|
+
<p>...time for barbecue!</p>
|
234
|
+
</li>
|
235
|
+
</ol>
|
236
|
+
</div>
|
237
|
+
</div>
|
238
|
+
|
239
|
+
<div id="footer"> </div>
|
240
|
+
</div>
|
241
|
+
</body>
|
242
|
+
</html>
|
@@ -0,0 +1,131 @@
|
|
1
|
+
// script.aculo.us builder.js v1.7.0, Fri Jan 19 19:16:36 CET 2007
|
2
|
+
|
3
|
+
// Copyright (c) 2005, 2006 Thomas Fuchs (http://script.aculo.us, http://mir.aculo.us)
|
4
|
+
//
|
5
|
+
// script.aculo.us is freely distributable under the terms of an MIT-style license.
|
6
|
+
// For details, see the script.aculo.us web site: http://script.aculo.us/
|
7
|
+
|
8
|
+
var Builder = {
|
9
|
+
NODEMAP: {
|
10
|
+
AREA: 'map',
|
11
|
+
CAPTION: 'table',
|
12
|
+
COL: 'table',
|
13
|
+
COLGROUP: 'table',
|
14
|
+
LEGEND: 'fieldset',
|
15
|
+
OPTGROUP: 'select',
|
16
|
+
OPTION: 'select',
|
17
|
+
PARAM: 'object',
|
18
|
+
TBODY: 'table',
|
19
|
+
TD: 'table',
|
20
|
+
TFOOT: 'table',
|
21
|
+
TH: 'table',
|
22
|
+
THEAD: 'table',
|
23
|
+
TR: 'table'
|
24
|
+
},
|
25
|
+
// note: For Firefox < 1.5, OPTION and OPTGROUP tags are currently broken,
|
26
|
+
// due to a Firefox bug
|
27
|
+
node: function(elementName) {
|
28
|
+
elementName = elementName.toUpperCase();
|
29
|
+
|
30
|
+
// try innerHTML approach
|
31
|
+
var parentTag = this.NODEMAP[elementName] || 'div';
|
32
|
+
var parentElement = document.createElement(parentTag);
|
33
|
+
try { // prevent IE "feature": http://dev.rubyonrails.org/ticket/2707
|
34
|
+
parentElement.innerHTML = "<" + elementName + "></" + elementName + ">";
|
35
|
+
} catch(e) {}
|
36
|
+
var element = parentElement.firstChild || null;
|
37
|
+
|
38
|
+
// see if browser added wrapping tags
|
39
|
+
if(element && (element.tagName.toUpperCase() != elementName))
|
40
|
+
element = element.getElementsByTagName(elementName)[0];
|
41
|
+
|
42
|
+
// fallback to createElement approach
|
43
|
+
if(!element) element = document.createElement(elementName);
|
44
|
+
|
45
|
+
// abort if nothing could be created
|
46
|
+
if(!element) return;
|
47
|
+
|
48
|
+
// attributes (or text)
|
49
|
+
if(arguments[1])
|
50
|
+
if(this._isStringOrNumber(arguments[1]) ||
|
51
|
+
(arguments[1] instanceof Array)) {
|
52
|
+
this._children(element, arguments[1]);
|
53
|
+
} else {
|
54
|
+
var attrs = this._attributes(arguments[1]);
|
55
|
+
if(attrs.length) {
|
56
|
+
try { // prevent IE "feature": http://dev.rubyonrails.org/ticket/2707
|
57
|
+
parentElement.innerHTML = "<" +elementName + " " +
|
58
|
+
attrs + "></" + elementName + ">";
|
59
|
+
} catch(e) {}
|
60
|
+
element = parentElement.firstChild || null;
|
61
|
+
// workaround firefox 1.0.X bug
|
62
|
+
if(!element) {
|
63
|
+
element = document.createElement(elementName);
|
64
|
+
for(attr in arguments[1])
|
65
|
+
element[attr == 'class' ? 'className' : attr] = arguments[1][attr];
|
66
|
+
}
|
67
|
+
if(element.tagName.toUpperCase() != elementName)
|
68
|
+
element = parentElement.getElementsByTagName(elementName)[0];
|
69
|
+
}
|
70
|
+
}
|
71
|
+
|
72
|
+
// text, or array of children
|
73
|
+
if(arguments[2])
|
74
|
+
this._children(element, arguments[2]);
|
75
|
+
|
76
|
+
return element;
|
77
|
+
},
|
78
|
+
_text: function(text) {
|
79
|
+
return document.createTextNode(text);
|
80
|
+
},
|
81
|
+
|
82
|
+
ATTR_MAP: {
|
83
|
+
'className': 'class',
|
84
|
+
'htmlFor': 'for'
|
85
|
+
},
|
86
|
+
|
87
|
+
_attributes: function(attributes) {
|
88
|
+
var attrs = [];
|
89
|
+
for(attribute in attributes)
|
90
|
+
attrs.push((attribute in this.ATTR_MAP ? this.ATTR_MAP[attribute] : attribute) +
|
91
|
+
'="' + attributes[attribute].toString().escapeHTML() + '"');
|
92
|
+
return attrs.join(" ");
|
93
|
+
},
|
94
|
+
_children: function(element, children) {
|
95
|
+
if(typeof children=='object') { // array can hold nodes and text
|
96
|
+
children.flatten().each( function(e) {
|
97
|
+
if(typeof e=='object')
|
98
|
+
element.appendChild(e)
|
99
|
+
else
|
100
|
+
if(Builder._isStringOrNumber(e))
|
101
|
+
element.appendChild(Builder._text(e));
|
102
|
+
});
|
103
|
+
} else
|
104
|
+
if(Builder._isStringOrNumber(children))
|
105
|
+
element.appendChild(Builder._text(children));
|
106
|
+
},
|
107
|
+
_isStringOrNumber: function(param) {
|
108
|
+
return(typeof param=='string' || typeof param=='number');
|
109
|
+
},
|
110
|
+
build: function(html) {
|
111
|
+
var element = this.node('div');
|
112
|
+
$(element).update(html.strip());
|
113
|
+
return element.down();
|
114
|
+
},
|
115
|
+
dump: function(scope) {
|
116
|
+
if(typeof scope != 'object' && typeof scope != 'function') scope = window; //global scope
|
117
|
+
|
118
|
+
var tags = ("A ABBR ACRONYM ADDRESS APPLET AREA B BASE BASEFONT BDO BIG BLOCKQUOTE BODY " +
|
119
|
+
"BR BUTTON CAPTION CENTER CITE CODE COL COLGROUP DD DEL DFN DIR DIV DL DT EM FIELDSET " +
|
120
|
+
"FONT FORM FRAME FRAMESET H1 H2 H3 H4 H5 H6 HEAD HR HTML I IFRAME IMG INPUT INS ISINDEX "+
|
121
|
+
"KBD LABEL LEGEND LI LINK MAP MENU META NOFRAMES NOSCRIPT OBJECT OL OPTGROUP OPTION P "+
|
122
|
+
"PARAM PRE Q S SAMP SCRIPT SELECT SMALL SPAN STRIKE STRONG STYLE SUB SUP TABLE TBODY TD "+
|
123
|
+
"TEXTAREA TFOOT TH THEAD TITLE TR TT U UL VAR").split(/\s+/);
|
124
|
+
|
125
|
+
tags.each( function(tag){
|
126
|
+
scope[tag] = function() {
|
127
|
+
return Builder.node.apply(Builder, [tag].concat($A(arguments)));
|
128
|
+
}
|
129
|
+
});
|
130
|
+
}
|
131
|
+
}
|