wee 0.4.0 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- data/ChangeLog +75 -0
- data/README +17 -9
- data/Rakefile +2 -2
- data/TODO +20 -0
- data/benchmark/Makefile +14 -9
- data/benchmark/counter.rb +11 -30
- data/benchmark/report_req.rb +12 -0
- data/doc/rdoc/classes/Array.html +12 -12
- data/doc/rdoc/classes/Cache/StorageCache.html +38 -38
- data/doc/rdoc/classes/Cache/Strategy/CapacityBounded.html +30 -30
- data/doc/rdoc/classes/Cache/Strategy/LFU.html +24 -24
- data/doc/rdoc/classes/Cache/Strategy/LRU.html +24 -24
- data/doc/rdoc/classes/Cache/Strategy/Unbounded.html +24 -24
- data/doc/rdoc/classes/Enumerable.html +6 -6
- data/doc/rdoc/classes/Object.html +12 -12
- data/doc/rdoc/classes/OgApplication.html +126 -0
- data/doc/rdoc/classes/OgScaffolder.html +401 -0
- data/doc/rdoc/classes/OgSession.html +172 -0
- data/doc/rdoc/classes/String.html +12 -12
- data/doc/rdoc/classes/Struct.html +12 -12
- data/doc/rdoc/classes/Wee.html +5 -62
- data/doc/rdoc/classes/Wee/AnswerDecoration.html +9 -9
- data/doc/rdoc/classes/Wee/Application.html +107 -39
- data/doc/rdoc/classes/Wee/Brush.html +22 -18
- data/doc/rdoc/classes/Wee/Brush/ActionCallbackMixin.html +17 -11
- data/doc/rdoc/classes/Wee/Brush/ActionURLCallbackMixin.html +18 -10
- data/doc/rdoc/classes/Wee/Brush/AnchorTag.html +30 -64
- data/doc/rdoc/classes/Wee/Brush/FileUploadTag.html +8 -10
- data/doc/rdoc/classes/Wee/Brush/FormTag.html +27 -79
- data/doc/rdoc/classes/Wee/Brush/GenericEncodedTextBrush.html +12 -12
- data/doc/rdoc/classes/Wee/Brush/GenericSingleTagBrush.html +146 -0
- data/doc/rdoc/classes/Wee/Brush/GenericTagBrush.html +179 -65
- data/doc/rdoc/classes/Wee/Brush/GenericTextBrush.html +12 -12
- data/doc/rdoc/classes/Wee/Brush/ImageButtonTag.html +16 -18
- data/doc/rdoc/classes/Wee/Brush/ImageTag.html +203 -0
- data/doc/rdoc/classes/Wee/Brush/InputCallbackMixin.html +17 -11
- data/doc/rdoc/classes/Wee/Brush/InputTag.html +15 -15
- data/doc/rdoc/classes/Wee/Brush/JavascriptTag.html +147 -0
- data/doc/rdoc/classes/Wee/Brush/Page.html +17 -17
- data/doc/rdoc/classes/Wee/Brush/SelectListTag.html +25 -50
- data/doc/rdoc/classes/Wee/Brush/SelectOptionTag.html +7 -38
- data/doc/rdoc/classes/Wee/Brush/SubmitButtonTag.html +7 -7
- data/doc/rdoc/classes/Wee/Brush/TableDataTag.html +15 -16
- data/doc/rdoc/classes/Wee/Brush/TableHeaderTag.html +7 -7
- data/doc/rdoc/classes/Wee/Brush/TableRowTag.html +65 -50
- data/doc/rdoc/classes/Wee/Brush/TableTag.html +7 -7
- data/doc/rdoc/classes/Wee/Brush/TextAreaTag.html +14 -64
- data/doc/rdoc/classes/Wee/Brush/TextInputTag.html +7 -7
- data/doc/rdoc/classes/Wee/Brush/ToCallback.html +146 -0
- data/doc/rdoc/classes/Wee/CallbackRegistry.html +40 -40
- data/doc/rdoc/classes/Wee/CallbackStream.html +18 -18
- data/doc/rdoc/classes/Wee/Canvas.html +24 -24
- data/doc/rdoc/classes/Wee/Component.html +232 -149
- data/doc/rdoc/classes/Wee/Component/OnAnswer.html +153 -0
- data/doc/rdoc/classes/Wee/Decoration.html +42 -42
- data/doc/rdoc/classes/Wee/Delegate.html +27 -27
- data/doc/rdoc/classes/Wee/ErrorResponse.html +12 -12
- data/doc/rdoc/classes/Wee/FormDecoration.html +148 -0
- data/doc/rdoc/classes/Wee/GenericResponse.html +6 -6
- data/doc/rdoc/classes/Wee/HtmlCanvas.html +296 -215
- data/doc/rdoc/classes/Wee/HtmlWriter.html +83 -81
- data/doc/rdoc/classes/Wee/LiteralMethodCallback.html +21 -16
- data/doc/rdoc/classes/Wee/MessageBox.html +180 -0
- data/doc/rdoc/classes/Wee/PageDecoration.html +30 -30
- data/doc/rdoc/classes/Wee/Presenter.html +237 -69
- data/doc/rdoc/classes/Wee/RedirectResponse.html +6 -6
- data/doc/rdoc/classes/Wee/RefreshResponse.html +6 -6
- data/doc/rdoc/classes/Wee/Request.html +18 -18
- data/doc/rdoc/classes/Wee/RequestHandler.html +43 -39
- data/doc/rdoc/classes/Wee/Response.html +24 -24
- data/doc/rdoc/classes/Wee/Session.html +746 -72
- data/doc/rdoc/classes/Wee/SimpleIdGenerator.html +18 -18
- data/doc/rdoc/classes/Wee/Snapshot.html +19 -19
- data/doc/rdoc/classes/Wee/Utils.html +138 -2
- data/doc/rdoc/classes/Wee/Utils/LRUCache.html +7 -7
- data/doc/rdoc/classes/Wee/ValueHolder.html +18 -18
- data/doc/rdoc/classes/Wee/WEBrickAdaptor.html +43 -68
- data/doc/rdoc/classes/Wee/WrapperDecoration.html +150 -0
- data/doc/rdoc/created.rid +1 -1
- data/doc/rdoc/files/README.html +29 -15
- data/doc/rdoc/files/lib/wee/adaptors/webrick_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/application_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/components/form_decoration_rb.html +101 -0
- data/doc/rdoc/files/lib/wee/components/messagebox_rb.html +101 -0
- data/doc/rdoc/files/lib/wee/components/page_decoration_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/components/wrapper_decoration_rb.html +101 -0
- data/doc/rdoc/files/lib/wee/components_rb.html +4 -1
- data/doc/rdoc/files/lib/wee/continuation/core/component_rb.html +101 -0
- data/doc/rdoc/files/lib/wee/continuation/session_rb.html +110 -0
- data/doc/rdoc/files/lib/wee/continuation_rb.html +116 -0
- data/doc/rdoc/files/lib/wee/core/callback_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/core/component_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/core/presenter_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/core_rb.html +3 -3
- data/doc/rdoc/files/lib/wee/databases/og_rb.html +108 -0
- data/doc/rdoc/files/lib/wee/renderer/html/brushes_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/renderer/html/canvas_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/renderer/html/writer_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/requesthandler_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/session_rb.html +1 -2
- data/doc/rdoc/files/lib/wee/utils/autoreload_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/utils/cache_rb.html +1 -1
- data/doc/rdoc/files/lib/wee/utils/helper_rb.html +1 -8
- data/doc/rdoc/files/lib/wee/utils_rb.html +110 -0
- data/doc/rdoc/files/lib/wee_rb.html +1 -1
- data/doc/rdoc/fr_class_index.html +11 -1
- data/doc/rdoc/fr_file_index.html +8 -0
- data/doc/rdoc/fr_method_index.html +269 -228
- data/examples/calculator.rb +69 -0
- data/examples/calendar.rb +5 -17
- data/examples/example.rb +2 -2
- data/examples/hw.rb +17 -0
- data/examples/live-update.rb +45 -0
- data/examples/og-test.rb +51 -0
- data/lib/wee.rb +1 -1
- data/lib/wee/adaptors/webrick.rb +2 -0
- data/lib/wee/application.rb +16 -0
- data/lib/wee/components.rb +3 -0
- data/lib/wee/components/form_decoration.rb +7 -0
- data/{test → lib/wee}/components/messagebox.rb +1 -1
- data/lib/wee/components/page_decoration.rb +5 -5
- data/lib/wee/components/wrapper_decoration.rb +7 -0
- data/lib/wee/continuation.rb +5 -0
- data/lib/wee/continuation/core/component.rb +55 -0
- data/lib/wee/continuation/session.rb +217 -0
- data/lib/wee/core/callback.rb +11 -6
- data/lib/wee/core/component.rb +45 -33
- data/lib/wee/core/presenter.rb +68 -0
- data/lib/wee/databases/og.rb +114 -0
- data/lib/wee/renderer/html/brushes.rb +179 -98
- data/lib/wee/renderer/html/canvas.rb +37 -13
- data/lib/wee/renderer/html/writer.rb +34 -32
- data/lib/wee/requesthandler.rb +6 -3
- data/lib/wee/session.rb +73 -54
- data/lib/wee/utils.rb +5 -0
- data/lib/wee/utils/autoreload.rb +1 -1
- data/lib/wee/utils/cache.rb +0 -2
- data/lib/wee/utils/helper.rb +40 -8
- data/test/components/calltest-cont.rb +16 -0
- data/test/components/calltest.rb +15 -10
- data/test/stress.rb +31 -28
- data/test/stress_and_measure.rb +53 -0
- data/test/stressed_application.rb +15 -0
- data/test/test_html_writer.rb +9 -4
- metadata +236 -195
- data/benchmark/bench.sh +0 -24
@@ -86,12 +86,15 @@
|
|
86
86
|
<h3 class="section-bar">Methods</h3>
|
87
87
|
|
88
88
|
<div class="name-list">
|
89
|
-
<a href="#
|
90
|
-
<a href="#
|
91
|
-
<a href="#
|
92
|
-
<a href="#
|
93
|
-
<a href="#
|
94
|
-
<a href="#
|
89
|
+
<a href="#M000127">bool_attr</a>
|
90
|
+
<a href="#M000132">css_class</a>
|
91
|
+
<a href="#M000134">css_class_for</a>
|
92
|
+
<a href="#M000129">html_attr</a>
|
93
|
+
<a href="#M000128">html_attr</a>
|
94
|
+
<a href="#M000130">method_missing</a>
|
95
|
+
<a href="#M000131">new</a>
|
96
|
+
<a href="#M000133">onclick_callback</a>
|
97
|
+
<a href="#M000135">with</a>
|
95
98
|
</div>
|
96
99
|
</div>
|
97
100
|
|
@@ -99,6 +102,13 @@
|
|
99
102
|
|
100
103
|
|
101
104
|
<!-- if includes -->
|
105
|
+
<div id="includes">
|
106
|
+
<h3 class="section-bar">Included Modules</h3>
|
107
|
+
|
108
|
+
<div id="includes-list">
|
109
|
+
<span class="include-name"><a href="ToCallback.html">Brush::ToCallback</a></span>
|
110
|
+
</div>
|
111
|
+
</div>
|
102
112
|
|
103
113
|
<div id="section">
|
104
114
|
|
@@ -113,24 +123,87 @@
|
|
113
123
|
<div id="methods">
|
114
124
|
<h3 class="section-bar">Public Class methods</h3>
|
115
125
|
|
116
|
-
<div id="method-
|
117
|
-
<a name="
|
126
|
+
<div id="method-M000127" class="method-detail">
|
127
|
+
<a name="M000127"></a>
|
128
|
+
|
129
|
+
<div class="method-heading">
|
130
|
+
<a href="#M000127" class="method-signature">
|
131
|
+
<span class="method-name">bool_attr</span><span class="method-args">(*attrs)</span>
|
132
|
+
</a>
|
133
|
+
</div>
|
134
|
+
|
135
|
+
<div class="method-description">
|
136
|
+
<p><a class="source-toggle" href="#"
|
137
|
+
onclick="toggleCode('M000127-source');return false;">[Source]</a></p>
|
138
|
+
<div class="method-source-code" id="M000127-source">
|
139
|
+
<pre>
|
140
|
+
<span class="ruby-comment cmt"># File lib/wee/renderer/html/brushes.rb, line 66</span>
|
141
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">bool_attr</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">attrs</span>)
|
142
|
+
<span class="ruby-identifier">attrs</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">a</span><span class="ruby-operator">|</span>
|
143
|
+
<span class="ruby-identifier">class_eval</span> <span class="ruby-node">"
|
144
|
+
def #{ a }(bool=true)
|
145
|
+
if bool
|
146
|
+
@attributes['#{ a }'] = nil
|
147
|
+
else
|
148
|
+
@attributes.delete('#{ a }')
|
149
|
+
end
|
150
|
+
self
|
151
|
+
end
|
152
|
+
"</span>
|
153
|
+
}
|
154
|
+
<span class="ruby-keyword kw">end</span>
|
155
|
+
</pre>
|
156
|
+
</div>
|
157
|
+
</div>
|
158
|
+
</div>
|
159
|
+
|
160
|
+
<div id="method-M000128" class="method-detail">
|
161
|
+
<a name="M000128"></a>
|
118
162
|
|
119
163
|
<div class="method-heading">
|
120
|
-
<a href="#
|
121
|
-
<span class="method-name">
|
164
|
+
<a href="#M000128" class="method-signature">
|
165
|
+
<span class="method-name">html_attr</span><span class="method-args">(*attrs)</span>
|
122
166
|
</a>
|
123
167
|
</div>
|
124
168
|
|
125
169
|
<div class="method-description">
|
126
170
|
<p><a class="source-toggle" href="#"
|
127
|
-
onclick="toggleCode('
|
128
|
-
<div class="method-source-code" id="
|
171
|
+
onclick="toggleCode('M000128-source');return false;">[Source]</a></p>
|
172
|
+
<div class="method-source-code" id="M000128-source">
|
129
173
|
<pre>
|
130
|
-
<span class="ruby-comment cmt"># File lib/wee/renderer/html/brushes.rb, line
|
131
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">
|
174
|
+
<span class="ruby-comment cmt"># File lib/wee/renderer/html/brushes.rb, line 81</span>
|
175
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-keyword kw">self</span>.<span class="ruby-identifier">html_attr</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">attrs</span>)
|
176
|
+
<span class="ruby-identifier">attrs</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">a</span><span class="ruby-operator">|</span>
|
177
|
+
<span class="ruby-identifier">class_eval</span> <span class="ruby-node">"
|
178
|
+
def #{ a }(value)
|
179
|
+
html_attr('#{ a }', value)
|
180
|
+
end
|
181
|
+
"</span>
|
182
|
+
}
|
183
|
+
<span class="ruby-keyword kw">end</span>
|
184
|
+
</pre>
|
185
|
+
</div>
|
186
|
+
</div>
|
187
|
+
</div>
|
188
|
+
|
189
|
+
<div id="method-M000131" class="method-detail">
|
190
|
+
<a name="M000131"></a>
|
191
|
+
|
192
|
+
<div class="method-heading">
|
193
|
+
<a href="#M000131" class="method-signature">
|
194
|
+
<span class="method-name">new</span><span class="method-args">(tag, is_single_tag=false)</span>
|
195
|
+
</a>
|
196
|
+
</div>
|
197
|
+
|
198
|
+
<div class="method-description">
|
199
|
+
<p><a class="source-toggle" href="#"
|
200
|
+
onclick="toggleCode('M000131-source');return false;">[Source]</a></p>
|
201
|
+
<div class="method-source-code" id="M000131-source">
|
202
|
+
<pre>
|
203
|
+
<span class="ruby-comment cmt"># File lib/wee/renderer/html/brushes.rb, line 108</span>
|
204
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">tag</span>, <span class="ruby-identifier">is_single_tag</span>=<span class="ruby-keyword kw">false</span>)
|
132
205
|
<span class="ruby-keyword kw">super</span>()
|
133
|
-
<span class="ruby-ivar">@tag</span> = <span class="ruby-identifier">tag</span>
|
206
|
+
<span class="ruby-ivar">@tag</span>, <span class="ruby-ivar">@is_single_tag</span> = <span class="ruby-identifier">tag</span>, <span class="ruby-identifier">is_single_tag</span>
|
134
207
|
<span class="ruby-ivar">@attributes</span> = <span class="ruby-constant">Hash</span>.<span class="ruby-identifier">new</span>
|
135
208
|
<span class="ruby-keyword kw">end</span>
|
136
209
|
</pre>
|
@@ -140,127 +213,138 @@
|
|
140
213
|
|
141
214
|
<h3 class="section-bar">Public Instance methods</h3>
|
142
215
|
|
143
|
-
<div id="method-
|
144
|
-
<a name="
|
216
|
+
<div id="method-M000132" class="method-detail">
|
217
|
+
<a name="M000132"></a>
|
145
218
|
|
146
219
|
<div class="method-heading">
|
147
|
-
<a href="#
|
220
|
+
<a href="#M000132" class="method-signature">
|
148
221
|
<span class="method-name">css_class</span><span class="method-args">(c)</span>
|
149
222
|
</a>
|
150
223
|
</div>
|
151
224
|
|
152
225
|
<div class="method-description">
|
153
226
|
<p><a class="source-toggle" href="#"
|
154
|
-
onclick="toggleCode('
|
155
|
-
<div class="method-source-code" id="
|
227
|
+
onclick="toggleCode('M000132-source');return false;">[Source]</a></p>
|
228
|
+
<div class="method-source-code" id="M000132-source">
|
156
229
|
<pre>
|
157
|
-
<span class="ruby-comment cmt"># File lib/wee/renderer/html/brushes.rb, line
|
230
|
+
<span class="ruby-comment cmt"># File lib/wee/renderer/html/brushes.rb, line 116</span>
|
158
231
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">css_class</span>(<span class="ruby-identifier">c</span>)
|
159
|
-
<span class="ruby-
|
160
|
-
<span class="ruby-keyword kw">self</span>
|
232
|
+
<span class="ruby-identifier">html_attr</span>(<span class="ruby-value str">"class"</span>, <span class="ruby-identifier">c</span>)
|
161
233
|
<span class="ruby-keyword kw">end</span>
|
162
234
|
</pre>
|
163
235
|
</div>
|
164
236
|
</div>
|
165
237
|
</div>
|
166
238
|
|
167
|
-
<div id="method-
|
168
|
-
<a name="
|
239
|
+
<div id="method-M000134" class="method-detail">
|
240
|
+
<a name="M000134"></a>
|
169
241
|
|
170
242
|
<div class="method-heading">
|
171
|
-
<a href="#
|
172
|
-
<span class="method-name">
|
243
|
+
<a href="#M000134" class="method-signature">
|
244
|
+
<span class="method-name">css_class_for</span><span class="method-args">(c)</span>
|
173
245
|
</a>
|
174
246
|
</div>
|
175
247
|
|
176
248
|
<div class="method-description">
|
249
|
+
<p>
|
250
|
+
This method construct the css-class attribute by looking up the property
|
251
|
+
from the current component.
|
252
|
+
</p>
|
177
253
|
<p><a class="source-toggle" href="#"
|
178
|
-
onclick="toggleCode('
|
179
|
-
<div class="method-source-code" id="
|
254
|
+
onclick="toggleCode('M000134-source');return false;">[Source]</a></p>
|
255
|
+
<div class="method-source-code" id="M000134-source">
|
180
256
|
<pre>
|
181
|
-
<span class="ruby-comment cmt"># File lib/wee/renderer/html/brushes.rb, line
|
182
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">
|
183
|
-
<span class="ruby-
|
184
|
-
<span class="ruby-
|
257
|
+
<span class="ruby-comment cmt"># File lib/wee/renderer/html/brushes.rb, line 131</span>
|
258
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">css_class_for</span>(<span class="ruby-identifier">c</span>)
|
259
|
+
<span class="ruby-identifier">prop</span> = <span class="ruby-value str">'css.'</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">c</span>
|
260
|
+
<span class="ruby-identifier">val</span> = <span class="ruby-ivar">@canvas</span>.<span class="ruby-identifier">current_component</span>.<span class="ruby-identifier">lookup_property</span>(<span class="ruby-identifier">prop</span>)
|
261
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-node">"no property found for: <#{ prop }>"</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">val</span>.<span class="ruby-identifier">nil?</span>
|
262
|
+
<span class="ruby-identifier">css_class</span>(<span class="ruby-identifier">val</span>)
|
185
263
|
<span class="ruby-keyword kw">end</span>
|
186
264
|
</pre>
|
187
265
|
</div>
|
188
266
|
</div>
|
189
267
|
</div>
|
190
268
|
|
191
|
-
<div id="method-
|
192
|
-
<a name="
|
269
|
+
<div id="method-M000130" class="method-detail">
|
270
|
+
<a name="M000130"></a>
|
193
271
|
|
194
272
|
<div class="method-heading">
|
195
|
-
<a href="#
|
196
|
-
<span class="method-name">method_missing</span><span class="method-args">(
|
273
|
+
<a href="#M000130" class="method-signature">
|
274
|
+
<span class="method-name">method_missing</span><span class="method-args">(id, attr)</span>
|
197
275
|
</a>
|
198
276
|
</div>
|
199
277
|
|
200
278
|
<div class="method-description">
|
201
279
|
<p><a class="source-toggle" href="#"
|
202
|
-
onclick="toggleCode('
|
203
|
-
<div class="method-source-code" id="
|
280
|
+
onclick="toggleCode('M000130-source');return false;">[Source]</a></p>
|
281
|
+
<div class="method-source-code" id="M000130-source">
|
204
282
|
<pre>
|
205
|
-
<span class="ruby-comment cmt"># File lib/wee/renderer/html/brushes.rb, line
|
206
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">method_missing</span>(<span class="ruby-identifier">
|
207
|
-
<span class="ruby-
|
208
|
-
<span class="ruby-keyword kw">self</span>
|
283
|
+
<span class="ruby-comment cmt"># File lib/wee/renderer/html/brushes.rb, line 104</span>
|
284
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">method_missing</span>(<span class="ruby-identifier">id</span>, <span class="ruby-identifier">attr</span>)
|
285
|
+
<span class="ruby-identifier">html_attr</span>(<span class="ruby-identifier">id</span>.<span class="ruby-identifier">to_s</span>, <span class="ruby-identifier">attr</span>)
|
209
286
|
<span class="ruby-keyword kw">end</span>
|
210
287
|
</pre>
|
211
288
|
</div>
|
212
289
|
</div>
|
213
290
|
</div>
|
214
291
|
|
215
|
-
<div id="method-
|
216
|
-
<a name="
|
292
|
+
<div id="method-M000133" class="method-detail">
|
293
|
+
<a name="M000133"></a>
|
217
294
|
|
218
295
|
<div class="method-heading">
|
219
|
-
<a href="#
|
220
|
-
<span class="method-name">
|
296
|
+
<a href="#M000133" class="method-signature">
|
297
|
+
<span class="method-name">onclick_callback</span><span class="method-args">(symbol=nil, *args, &block)</span>
|
221
298
|
</a>
|
222
299
|
</div>
|
223
300
|
|
224
301
|
<div class="method-description">
|
225
302
|
<p><a class="source-toggle" href="#"
|
226
|
-
onclick="toggleCode('
|
227
|
-
<div class="method-source-code" id="
|
303
|
+
onclick="toggleCode('M000133-source');return false;">[Source]</a></p>
|
304
|
+
<div class="method-source-code" id="M000133-source">
|
228
305
|
<pre>
|
229
|
-
<span class="ruby-comment cmt"># File lib/wee/renderer/html/brushes.rb, line
|
230
|
-
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">
|
231
|
-
<span class="ruby-
|
232
|
-
<span class="ruby-
|
306
|
+
<span class="ruby-comment cmt"># File lib/wee/renderer/html/brushes.rb, line 122</span>
|
307
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">onclick_callback</span>(<span class="ruby-identifier">symbol</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">args</span>, <span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
308
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">symbol</span> <span class="ruby-keyword kw">and</span> <span class="ruby-identifier">block</span>
|
309
|
+
<span class="ruby-identifier">url</span> = <span class="ruby-ivar">@canvas</span>.<span class="ruby-identifier">url_for_callback</span>(<span class="ruby-identifier">to_callback</span>(<span class="ruby-identifier">symbol</span>, <span class="ruby-identifier">args</span>, <span class="ruby-identifier">block</span>))
|
310
|
+
<span class="ruby-identifier">onclick</span>(<span class="ruby-node">"javascript: document.location.href='#{ url }';"</span>)
|
233
311
|
<span class="ruby-keyword kw">end</span>
|
234
312
|
</pre>
|
235
313
|
</div>
|
236
314
|
</div>
|
237
315
|
</div>
|
238
316
|
|
239
|
-
<div id="method-
|
240
|
-
<a name="
|
317
|
+
<div id="method-M000135" class="method-detail">
|
318
|
+
<a name="M000135"></a>
|
241
319
|
|
242
320
|
<div class="method-heading">
|
243
|
-
<a href="#
|
321
|
+
<a href="#M000135" class="method-signature">
|
244
322
|
<span class="method-name">with</span><span class="method-args">(text=nil, &block)</span>
|
245
323
|
</a>
|
246
324
|
</div>
|
247
325
|
|
248
326
|
<div class="method-description">
|
249
327
|
<p><a class="source-toggle" href="#"
|
250
|
-
onclick="toggleCode('
|
251
|
-
<div class="method-source-code" id="
|
328
|
+
onclick="toggleCode('M000135-source');return false;">[Source]</a></p>
|
329
|
+
<div class="method-source-code" id="M000135-source">
|
252
330
|
<pre>
|
253
|
-
<span class="ruby-comment cmt"># File lib/wee/renderer/html/brushes.rb, line
|
331
|
+
<span class="ruby-comment cmt"># File lib/wee/renderer/html/brushes.rb, line 138</span>
|
254
332
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">with</span>(<span class="ruby-identifier">text</span>=<span class="ruby-keyword kw">nil</span>, <span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
255
333
|
<span class="ruby-identifier">doc</span> = <span class="ruby-ivar">@canvas</span>.<span class="ruby-identifier">document</span>
|
256
|
-
<span class="ruby-
|
257
|
-
|
258
|
-
<span class="ruby-identifier">doc</span>.<span class="ruby-identifier">
|
259
|
-
<span class="ruby-
|
334
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@is_single_tag</span>
|
335
|
+
<span class="ruby-identifier">raise</span> <span class="ruby-constant">ArgumentError</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">text</span> <span class="ruby-keyword kw">or</span> <span class="ruby-identifier">block</span>
|
336
|
+
<span class="ruby-identifier">doc</span>.<span class="ruby-identifier">single_tag</span>(<span class="ruby-ivar">@tag</span>, <span class="ruby-ivar">@attributes</span>)
|
337
|
+
<span class="ruby-ivar">@closed</span> = <span class="ruby-keyword kw">true</span>
|
260
338
|
<span class="ruby-keyword kw">else</span>
|
261
|
-
<span class="ruby-
|
339
|
+
<span class="ruby-identifier">doc</span>.<span class="ruby-identifier">start_tag</span>(<span class="ruby-ivar">@tag</span>, <span class="ruby-ivar">@attributes</span>)
|
340
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">text</span>
|
341
|
+
<span class="ruby-identifier">doc</span>.<span class="ruby-identifier">text</span>(<span class="ruby-identifier">text</span>)
|
342
|
+
<span class="ruby-keyword kw">super</span>(<span class="ruby-identifier">text</span>, <span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
343
|
+
<span class="ruby-keyword kw">else</span>
|
344
|
+
<span class="ruby-keyword kw">super</span>(<span class="ruby-operator">&</span><span class="ruby-identifier">block</span>)
|
345
|
+
<span class="ruby-keyword kw">end</span>
|
346
|
+
<span class="ruby-identifier">doc</span>.<span class="ruby-identifier">end_tag</span>(<span class="ruby-ivar">@tag</span>)
|
262
347
|
<span class="ruby-keyword kw">end</span>
|
263
|
-
<span class="ruby-identifier">doc</span>.<span class="ruby-identifier">end_tag</span>(<span class="ruby-ivar">@tag</span>)
|
264
348
|
<span class="ruby-keyword kw">nil</span>
|
265
349
|
<span class="ruby-keyword kw">end</span>
|
266
350
|
</pre>
|
@@ -268,6 +352,36 @@
|
|
268
352
|
</div>
|
269
353
|
</div>
|
270
354
|
|
355
|
+
<h3 class="section-bar">Private Instance methods</h3>
|
356
|
+
|
357
|
+
<div id="method-M000129" class="method-detail">
|
358
|
+
<a name="M000129"></a>
|
359
|
+
|
360
|
+
<div class="method-heading">
|
361
|
+
<a href="#M000129" class="method-signature">
|
362
|
+
<span class="method-name">html_attr</span><span class="method-args">(attr, value)</span>
|
363
|
+
</a>
|
364
|
+
</div>
|
365
|
+
|
366
|
+
<div class="method-description">
|
367
|
+
<p><a class="source-toggle" href="#"
|
368
|
+
onclick="toggleCode('M000129-source');return false;">[Source]</a></p>
|
369
|
+
<div class="method-source-code" id="M000129-source">
|
370
|
+
<pre>
|
371
|
+
<span class="ruby-comment cmt"># File lib/wee/renderer/html/brushes.rb, line 93</span>
|
372
|
+
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">html_attr</span>(<span class="ruby-identifier">attr</span>, <span class="ruby-identifier">value</span>)
|
373
|
+
<span class="ruby-keyword kw">if</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">nil?</span>
|
374
|
+
<span class="ruby-ivar">@attributes</span>.<span class="ruby-identifier">delete</span>(<span class="ruby-identifier">attr</span>)
|
375
|
+
<span class="ruby-keyword kw">else</span>
|
376
|
+
<span class="ruby-ivar">@attributes</span>[<span class="ruby-identifier">attr</span>] = <span class="ruby-identifier">value</span>.<span class="ruby-identifier">to_s</span>
|
377
|
+
<span class="ruby-keyword kw">end</span>
|
378
|
+
<span class="ruby-keyword kw">self</span>
|
379
|
+
<span class="ruby-keyword kw">end</span>
|
380
|
+
</pre>
|
381
|
+
</div>
|
382
|
+
</div>
|
383
|
+
</div>
|
384
|
+
|
271
385
|
|
272
386
|
</div>
|
273
387
|
|
@@ -86,8 +86,8 @@
|
|
86
86
|
<h3 class="section-bar">Methods</h3>
|
87
87
|
|
88
88
|
<div class="name-list">
|
89
|
-
<a href="#
|
90
|
-
<a href="#
|
89
|
+
<a href="#M000106">new</a>
|
90
|
+
<a href="#M000107">with</a>
|
91
91
|
</div>
|
92
92
|
</div>
|
93
93
|
|
@@ -109,19 +109,19 @@
|
|
109
109
|
<div id="methods">
|
110
110
|
<h3 class="section-bar">Public Class methods</h3>
|
111
111
|
|
112
|
-
<div id="method-
|
113
|
-
<a name="
|
112
|
+
<div id="method-M000106" class="method-detail">
|
113
|
+
<a name="M000106"></a>
|
114
114
|
|
115
115
|
<div class="method-heading">
|
116
|
-
<a href="#
|
116
|
+
<a href="#M000106" class="method-signature">
|
117
117
|
<span class="method-name">new</span><span class="method-args">(text)</span>
|
118
118
|
</a>
|
119
119
|
</div>
|
120
120
|
|
121
121
|
<div class="method-description">
|
122
122
|
<p><a class="source-toggle" href="#"
|
123
|
-
onclick="toggleCode('
|
124
|
-
<div class="method-source-code" id="
|
123
|
+
onclick="toggleCode('M000106-source');return false;">[Source]</a></p>
|
124
|
+
<div class="method-source-code" id="M000106-source">
|
125
125
|
<pre>
|
126
126
|
<span class="ruby-comment cmt"># File lib/wee/renderer/html/brushes.rb, line 23</span>
|
127
127
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">text</span>)
|
@@ -135,19 +135,19 @@
|
|
135
135
|
|
136
136
|
<h3 class="section-bar">Public Instance methods</h3>
|
137
137
|
|
138
|
-
<div id="method-
|
139
|
-
<a name="
|
138
|
+
<div id="method-M000107" class="method-detail">
|
139
|
+
<a name="M000107"></a>
|
140
140
|
|
141
141
|
<div class="method-heading">
|
142
|
-
<a href="#
|
142
|
+
<a href="#M000107" class="method-signature">
|
143
143
|
<span class="method-name">with</span><span class="method-args">()</span>
|
144
144
|
</a>
|
145
145
|
</div>
|
146
146
|
|
147
147
|
<div class="method-description">
|
148
148
|
<p><a class="source-toggle" href="#"
|
149
|
-
onclick="toggleCode('
|
150
|
-
<div class="method-source-code" id="
|
149
|
+
onclick="toggleCode('M000107-source');return false;">[Source]</a></p>
|
150
|
+
<div class="method-source-code" id="M000107-source">
|
151
151
|
<pre>
|
152
152
|
<span class="ruby-comment cmt"># File lib/wee/renderer/html/brushes.rb, line 28</span>
|
153
153
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">with</span>
|
@@ -65,9 +65,7 @@
|
|
65
65
|
<tr class="top-aligned-row">
|
66
66
|
<td><strong>Parent:</strong></td>
|
67
67
|
<td>
|
68
|
-
|
69
|
-
Wee::Brush::InputTag
|
70
|
-
</a>
|
68
|
+
Brush::InputTag
|
71
69
|
</td>
|
72
70
|
</tr>
|
73
71
|
</table>
|
@@ -87,7 +85,7 @@ Most browsers do not send the "name" key together with the value
|
|
87
85
|
specified by "value", only "name.x" and
|
88
86
|
"name.y". This conforms to the standard. But Firefox also sends
|
89
87
|
"name"="value". This is why I raise an exception from
|
90
|
-
the <a href="ImageButtonTag.html#
|
88
|
+
the <a href="ImageButtonTag.html#M000137">value</a> method. Note that
|
91
89
|
it’s neccessary to parse the passed form-fields and generate a
|
92
90
|
"name" fields in the request, to make this image-button work.
|
93
91
|
</p>
|
@@ -101,8 +99,8 @@ it’s neccessary to parse the passed form-fields and generate a
|
|
101
99
|
<h3 class="section-bar">Methods</h3>
|
102
100
|
|
103
101
|
<div class="name-list">
|
104
|
-
<a href="#
|
105
|
-
<a href="#
|
102
|
+
<a href="#M000136">new</a>
|
103
|
+
<a href="#M000137">value</a>
|
106
104
|
</div>
|
107
105
|
</div>
|
108
106
|
|
@@ -131,21 +129,21 @@ it’s neccessary to parse the passed form-fields and generate a
|
|
131
129
|
<div id="methods">
|
132
130
|
<h3 class="section-bar">Public Class methods</h3>
|
133
131
|
|
134
|
-
<div id="method-
|
135
|
-
<a name="
|
132
|
+
<div id="method-M000136" class="method-detail">
|
133
|
+
<a name="M000136"></a>
|
136
134
|
|
137
135
|
<div class="method-heading">
|
138
|
-
<a href="#
|
136
|
+
<a href="#M000136" class="method-signature">
|
139
137
|
<span class="method-name">new</span><span class="method-args">()</span>
|
140
138
|
</a>
|
141
139
|
</div>
|
142
140
|
|
143
141
|
<div class="method-description">
|
144
142
|
<p><a class="source-toggle" href="#"
|
145
|
-
onclick="toggleCode('
|
146
|
-
<div class="method-source-code" id="
|
143
|
+
onclick="toggleCode('M000136-source');return false;">[Source]</a></p>
|
144
|
+
<div class="method-source-code" id="M000136-source">
|
147
145
|
<pre>
|
148
|
-
<span class="ruby-comment cmt"># File lib/wee/renderer/html/brushes.rb, line
|
146
|
+
<span class="ruby-comment cmt"># File lib/wee/renderer/html/brushes.rb, line 417</span>
|
149
147
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>
|
150
148
|
<span class="ruby-keyword kw">super</span>
|
151
149
|
<span class="ruby-identifier">type</span>(<span class="ruby-value str">'image'</span>)
|
@@ -157,21 +155,21 @@ it’s neccessary to parse the passed form-fields and generate a
|
|
157
155
|
|
158
156
|
<h3 class="section-bar">Public Instance methods</h3>
|
159
157
|
|
160
|
-
<div id="method-
|
161
|
-
<a name="
|
158
|
+
<div id="method-M000137" class="method-detail">
|
159
|
+
<a name="M000137"></a>
|
162
160
|
|
163
161
|
<div class="method-heading">
|
164
|
-
<a href="#
|
162
|
+
<a href="#M000137" class="method-signature">
|
165
163
|
<span class="method-name">value</span><span class="method-args">(v)</span>
|
166
164
|
</a>
|
167
165
|
</div>
|
168
166
|
|
169
167
|
<div class="method-description">
|
170
168
|
<p><a class="source-toggle" href="#"
|
171
|
-
onclick="toggleCode('
|
172
|
-
<div class="method-source-code" id="
|
169
|
+
onclick="toggleCode('M000137-source');return false;">[Source]</a></p>
|
170
|
+
<div class="method-source-code" id="M000137-source">
|
173
171
|
<pre>
|
174
|
-
<span class="ruby-comment cmt"># File lib/wee/renderer/html/brushes.rb, line
|
172
|
+
<span class="ruby-comment cmt"># File lib/wee/renderer/html/brushes.rb, line 422</span>
|
175
173
|
<span class="ruby-keyword kw">def</span> <span class="ruby-identifier">value</span>(<span class="ruby-identifier">v</span>)
|
176
174
|
<span class="ruby-identifier">raise</span> <span class="ruby-value str">"specified value will not be used in the request"</span>
|
177
175
|
<span class="ruby-keyword kw">end</span>
|