bivouac 0.0.6 → 0.0.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (98) hide show
  1. data/README +9 -0
  2. data/bin/bivouac +15 -19
  3. data/doc/rdoc/classes/BivouacHelpers.html +117 -0
  4. data/doc/rdoc/classes/BivouacHelpers/BaseView.html +140 -0
  5. data/doc/rdoc/classes/BivouacHelpers/FormView.html +398 -0
  6. data/doc/rdoc/classes/BivouacHelpers/HtmlView.html +274 -0
  7. data/doc/rdoc/classes/BivouacHelpers/JavaScriptView.html +573 -0
  8. data/doc/rdoc/classes/BivouacHelpers/ScriptAculoUsView.html +258 -0
  9. data/doc/rdoc/classes/BivouacHelpers/TooltipView.html +158 -0
  10. data/doc/rdoc/classes/JavaScriptGenerator.html +564 -0
  11. data/doc/rdoc/created.rid +1 -1
  12. data/doc/rdoc/files/AUTHORS.html +14 -0
  13. data/doc/rdoc/files/COPYING.html +14 -0
  14. data/doc/rdoc/files/README.html +40 -1
  15. data/doc/rdoc/files/lib/bivouac/helpers/view/goh/base_rb.html +109 -0
  16. data/doc/rdoc/files/lib/bivouac/helpers/view/goh/form_rb.html +109 -0
  17. data/doc/rdoc/files/lib/bivouac/helpers/view/goh/html_rb.html +109 -0
  18. data/doc/rdoc/files/lib/bivouac/helpers/view/goh/javascript_rb.html +113 -0
  19. data/doc/rdoc/files/lib/bivouac/helpers/view/goh/scriptaculous_rb.html +113 -0
  20. data/doc/rdoc/files/lib/bivouac/helpers/view/goh/tooltip_rb.html +109 -0
  21. data/examples/bivouac_sample/app/bivouac_sample.rb +61 -0
  22. data/examples/bivouac_sample/app/controllers/autocomplete.rb +24 -0
  23. data/examples/bivouac_sample/app/controllers/drag_and_drop.rb +11 -0
  24. data/examples/bivouac_sample/app/controllers/index.rb +7 -0
  25. data/examples/bivouac_sample/app/controllers/observe.rb +14 -0
  26. data/examples/bivouac_sample/app/controllers/periodically_call.rb +12 -0
  27. data/examples/bivouac_sample/app/controllers/remote_form.rb +10 -0
  28. data/examples/bivouac_sample/app/controllers/remote_link.rb +11 -0
  29. data/examples/bivouac_sample/app/controllers/submit_remote.rb +17 -0
  30. data/examples/bivouac_sample/app/controllers/toggle.rb +10 -0
  31. data/examples/bivouac_sample/app/controllers/toggle_sortable.rb +11 -0
  32. data/examples/bivouac_sample/app/helpers/_helpers.rb +25 -0
  33. data/examples/bivouac_sample/app/helpers/source.rb +25 -0
  34. data/examples/bivouac_sample/app/views/_autocomplete_result.rb +9 -0
  35. data/examples/bivouac_sample/app/views/_drag_and_drop_result.rb +5 -0
  36. data/examples/bivouac_sample/app/views/_observe_result.rb +17 -0
  37. data/examples/bivouac_sample/app/views/_periodically_call_result.rb +5 -0
  38. data/examples/bivouac_sample/app/views/_remote_link_result.rb +5 -0
  39. data/examples/bivouac_sample/app/views/_sortable_result.rb +5 -0
  40. data/examples/bivouac_sample/app/views/_submit_remote_result.rb +5 -0
  41. data/examples/bivouac_sample/app/views/autocomplete.rb +28 -0
  42. data/examples/bivouac_sample/app/views/drag_and_drop.rb +35 -0
  43. data/examples/bivouac_sample/app/views/index.rb +19 -0
  44. data/examples/bivouac_sample/app/views/observe.rb +19 -0
  45. data/examples/bivouac_sample/app/views/periodically_call.rb +17 -0
  46. data/examples/bivouac_sample/app/views/remote_form.rb +19 -0
  47. data/examples/bivouac_sample/app/views/remote_link.rb +20 -0
  48. data/examples/bivouac_sample/app/views/submit_remote.rb +21 -0
  49. data/examples/bivouac_sample/app/views/toggle.rb +44 -0
  50. data/examples/bivouac_sample/app/views/toggle_sortable.rb +52 -0
  51. data/examples/bivouac_sample/config/environment.rb +37 -0
  52. data/examples/bivouac_sample/config/postamble.rb +62 -0
  53. data/examples/bivouac_sample/log/BivouacSample.log +77 -0
  54. data/examples/bivouac_sample/public/images/camping.png +0 -0
  55. data/examples/bivouac_sample/public/index.html +242 -0
  56. data/examples/bivouac_sample/public/javascripts/builder.js +131 -0
  57. data/examples/bivouac_sample/public/javascripts/controls.js +835 -0
  58. data/examples/bivouac_sample/public/javascripts/dragdrop.js +944 -0
  59. data/examples/bivouac_sample/public/javascripts/effects.js +1090 -0
  60. data/examples/bivouac_sample/public/javascripts/prototype.js +2515 -0
  61. data/examples/bivouac_sample/public/javascripts/scriptaculous.js +51 -0
  62. data/examples/bivouac_sample/public/javascripts/slider.js +278 -0
  63. data/examples/bivouac_sample/public/javascripts/tooltip.js +208 -0
  64. data/examples/bivouac_sample/public/javascripts/unittest.js +564 -0
  65. data/examples/bivouac_sample/public/stylesheets/autocomplete.css +22 -0
  66. data/examples/bivouac_sample/public/stylesheets/coderay.css +104 -0
  67. data/examples/bivouac_sample/script/generate +3 -0
  68. data/examples/bivouac_sample/script/server +5 -0
  69. data/lib/bivouac/helpers/view/goh/base.rb +16 -0
  70. data/lib/bivouac/helpers/view/goh/form.rb +170 -0
  71. data/lib/bivouac/helpers/view/goh/html.rb +138 -0
  72. data/lib/bivouac/helpers/view/goh/javascript.rb +532 -0
  73. data/lib/bivouac/helpers/view/goh/scriptaculous.rb +133 -0
  74. data/lib/bivouac/helpers/view/goh/tooltip.rb +33 -0
  75. data/lib/bivouac/template.rb +3 -3
  76. data/lib/bivouac/template/application/helpers_erb.rb +11 -0
  77. data/lib/bivouac/template/application/helpers_goh.rb +25 -0
  78. data/lib/bivouac/template/application/postamble.rb +62 -0
  79. data/lib/bivouac/template/application_erb.rb +4 -0
  80. data/lib/bivouac/template/application_goh.rb +4 -0
  81. data/lib/bivouac/template/environment.rb +19 -5
  82. data/lib/bivouac/template/server.rb +1 -1
  83. data/lib/bivouac/template/static/autocomplete.css +22 -0
  84. data/lib/bivouac/template/static/builder.js +131 -0
  85. data/lib/bivouac/template/static/controls.js +835 -0
  86. data/lib/bivouac/template/static/dragdrop.js +944 -0
  87. data/lib/bivouac/template/static/effects.js +1090 -0
  88. data/lib/bivouac/template/static/prototype.js +2515 -0
  89. data/lib/bivouac/template/static/scriptaculous.js +51 -0
  90. data/lib/bivouac/template/static/slider.js +278 -0
  91. data/lib/bivouac/template/static/tooltip.js +208 -0
  92. data/lib/bivouac/template/static/unittest.js +564 -0
  93. metadata +124 -7
  94. data/lib/bivouac/template/application/postamble_cgi.rb +0 -8
  95. data/lib/bivouac/template/application/postamble_fastcgi.rb +0 -8
  96. data/lib/bivouac/template/application/postamble_mongrel.rb +0 -19
  97. data/lib/bivouac/template/application/postamble_none.rb +0 -1
  98. data/lib/bivouac/template/application/postamble_webrick.rb +0 -19
@@ -0,0 +1,258 @@
1
+
2
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
3
+ <html>
4
+ <head>
5
+ <title>
6
+ Bivouac, the Documentation &raquo; Module: BivouacHelpers::ScriptAculoUsView
7
+ </title>
8
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
9
+ <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
10
+ <script language="JavaScript" type="text/javascript">
11
+ // <![CDATA[
12
+
13
+ function toggleSource( id )
14
+ {
15
+ var elem
16
+ var link
17
+
18
+ if( document.getElementById )
19
+ {
20
+ elem = document.getElementById( id )
21
+ link = document.getElementById( "l_" + id )
22
+ }
23
+ else if ( document.all )
24
+ {
25
+ elem = eval( "document.all." + id )
26
+ link = eval( "document.all.l_" + id )
27
+ }
28
+ else
29
+ return false;
30
+
31
+ if( elem.style.display == "block" )
32
+ {
33
+ elem.style.display = "none"
34
+ link.innerHTML = "show source"
35
+ }
36
+ else
37
+ {
38
+ elem.style.display = "block"
39
+ link.innerHTML = "hide source"
40
+ }
41
+ }
42
+
43
+ function openCode( url )
44
+ {
45
+ window.open( url, "SOURCE_CODE", "width=400,height=400,scrollbars=yes" )
46
+ }
47
+ // ]]>
48
+ </script>
49
+ </head>
50
+ <body>
51
+ <!--
52
+ <div id="menu">
53
+ <h3 class="title">Module: BivouacHelpers::ScriptAculoUsView</h3>
54
+ </div>
55
+ -->
56
+ <div id="fullpage">
57
+ <div id="pager">
58
+ <table>
59
+ <tr><td><img src="../../rubyfr.png" /></td>
60
+ <td id="pagertd">
61
+ <strong># Module: BivouacHelpers::ScriptAculoUsView<br />
62
+ [
63
+ "<a href="../../files/README.html" value="File: README">README</a>",
64
+ "<a href="../../files/AUTHORS.html" value="File: AUTHORS">AUTHORS</a>",
65
+ "<a href="../../files/COPYING.html" value="File: COPYING">COPYING</a>",
66
+ "<a href="../../files/lib/bivouac/helpers/view/goh/base_rb.html" value="File: base.rb">lib/bivouac/helpers/view/goh/base.rb</a>",
67
+ "<a href="../../files/lib/bivouac/helpers/view/goh/form_rb.html" value="File: form.rb">lib/bivouac/helpers/view/goh/form.rb</a>",
68
+ "<a href="../../files/lib/bivouac/helpers/view/goh/html_rb.html" value="File: html.rb">lib/bivouac/helpers/view/goh/html.rb</a>",
69
+ "<a href="../../files/lib/bivouac/helpers/view/goh/tooltip_rb.html" value="File: tooltip.rb">lib/bivouac/helpers/view/goh/tooltip.rb</a>",
70
+ "<a href="../../files/lib/bivouac/helpers/view/goh/scriptaculous_rb.html" value="File: scriptaculous.rb">lib/bivouac/helpers/view/goh/scriptaculous.rb</a>",
71
+ "<a href="../../files/lib/bivouac/helpers/view/goh/javascript_rb.html" value="File: javascript.rb">lib/bivouac/helpers/view/goh/javascript.rb</a>",
72
+ <a href="http://greg.rubyfr.net">nil</a>].each do<br />
73
+ <a href="../../classes/JavaScriptGenerator.html" title="Class: JavaScriptGenerator">JavaScriptGenerator</a>.view_html<br />
74
+ <a href="../../classes/BivouacHelpers.html" title="Module: BivouacHelpers">BivouacHelpers</a>.view_html<br />
75
+ <a href="../../classes/BivouacHelpers/TooltipView.html" title="Module: BivouacHelpers::TooltipView">BivouacHelpers::TooltipView</a>.view_html<br />
76
+ <a href="../../classes/BivouacHelpers/ScriptAculoUsView.html" title="Module: BivouacHelpers::ScriptAculoUsView">BivouacHelpers::ScriptAculoUsView</a>.view_html<br />
77
+ <a href="../../classes/BivouacHelpers/BaseView.html" title="Module: BivouacHelpers::BaseView">BivouacHelpers::BaseView</a>.view_html<br />
78
+ <a href="../../classes/BivouacHelpers/JavaScriptView.html" title="Module: BivouacHelpers::JavaScriptView">BivouacHelpers::JavaScriptView</a>.view_html<br />
79
+ <a href="../../classes/BivouacHelpers/HtmlView.html" title="Module: BivouacHelpers::HtmlView">BivouacHelpers::HtmlView</a>.view_html<br />
80
+ <a href="../../classes/BivouacHelpers/FormView.html" title="Module: BivouacHelpers::FormView">BivouacHelpers::FormView</a>.view_html<br />
81
+ end</strong>
82
+ </td></tr>
83
+ </table>
84
+ </ul>
85
+ </div>
86
+
87
+
88
+ <div id="BivouacHelpers::ScriptAculoUsView" class="page_shade">
89
+ <div class="page">
90
+ <h3>Module BivouacHelpers::ScriptAculoUsView &lt; Object</h3>
91
+
92
+ (in files
93
+ <a href="../../files/lib/bivouac/helpers/view/goh/scriptaculous_rb.html">lib/bivouac/helpers/view/goh/scriptaculous.rb</a>
94
+ )
95
+
96
+ <p>
97
+ bivouac/helpers/view/html
98
+ </p>
99
+
100
+
101
+
102
+
103
+
104
+ <h2 class="ruled">Methods</h2>
105
+ <h4 class="ruled">Public Instance method:
106
+ <strong><a name="M000024">draggable_element(element_id, options = {})</a></strong> <a href="#M000024"><img src="../../permalink.gif" border="0" title="Permalink to Public Instance method: draggable_element" /></a></h4>
107
+
108
+ <p>
109
+ Makes the element with the DOM ID specified by <tt>element_id</tt>
110
+ draggable.
111
+ </p>
112
+ <p>
113
+ Example:
114
+ </p>
115
+ <pre>
116
+ draggable_element(&quot;my_image&quot;, :revert =&gt; true)
117
+ </pre>
118
+ <p>
119
+ You can change the behaviour with various options, see <a
120
+ href="http://script.aculo.us">script.aculo.us</a> for more documentation.
121
+ </p>
122
+
123
+ <div class="sourcecode">
124
+ <p class="source-link">[ <a href="javascript:toggleSource('M000024_source')" id="l_M000024_source">show source</a> ]</p>
125
+ <div id="M000024_source" class="dyn-source">
126
+ <pre>
127
+ <span class="ruby-comment cmt"># File lib/bivouac/helpers/view/goh/scriptaculous.rb, line 94</span>
128
+ 94: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">draggable_element</span>(<span class="ruby-identifier">element_id</span>, <span class="ruby-identifier">options</span> = {})
129
+ 95: <span class="ruby-identifier">javascript_tag</span>(<span class="ruby-identifier">draggable_element_js</span>(<span class="ruby-identifier">element_id</span>, <span class="ruby-identifier">options</span>) <span class="ruby-operator">+</span> <span class="ruby-value str">&quot;;\n&quot;</span>)
130
+ 96: <span class="ruby-keyword kw">end</span>
131
+ </pre>
132
+ </div>
133
+ </div>
134
+ <h4 class="ruled">Public Instance method:
135
+ <strong><a name="M000025">drop_receiving_element(element_id, options = {})</a></strong> <a href="#M000025"><img src="../../permalink.gif" border="0" title="Permalink to Public Instance method: drop_receiving_element" /></a></h4>
136
+
137
+ <p>
138
+ Makes the element with the DOM ID specified by <tt>element_id</tt> receive
139
+ dropped draggable elements (created by <a
140
+ href="ScriptAculoUsView.html#M000024">draggable_element</a>). and make an
141
+ AJAX call. By default, the action called gets the DOM ID of the element as
142
+ parameter.
143
+ </p>
144
+ <p>
145
+ Example:
146
+ </p>
147
+ <pre>
148
+ drop_receiving_element(&quot;my_cart&quot;, :onDrop =&gt; {
149
+ :url =&gt; R(CartAdd),
150
+ :update =&gt; 'drop-info'
151
+ } )
152
+ </pre>
153
+ <p>
154
+ You can change the behaviour with various options, see <a
155
+ href="http://script.aculo.us">script.aculo.us</a> for more documentation.
156
+ </p>
157
+
158
+ <div class="sourcecode">
159
+ <p class="source-link">[ <a href="javascript:toggleSource('M000025_source')" id="l_M000025_source">show source</a> ]</p>
160
+ <div id="M000025_source" class="dyn-source">
161
+ <pre>
162
+ <span class="ruby-comment cmt"># File lib/bivouac/helpers/view/goh/scriptaculous.rb, line 115</span>
163
+ 115: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">drop_receiving_element</span>(<span class="ruby-identifier">element_id</span>, <span class="ruby-identifier">options</span> = {})
164
+ 116: <span class="ruby-identifier">javascript_tag</span>(<span class="ruby-identifier">drop_receiving_element_js</span>(<span class="ruby-identifier">element_id</span>, <span class="ruby-identifier">options</span>) <span class="ruby-operator">+</span> <span class="ruby-value str">&quot;;\n&quot;</span>)
165
+ 117: <span class="ruby-keyword kw">end</span>
166
+ </pre>
167
+ </div>
168
+ </div>
169
+ <h4 class="ruled">Public Instance method:
170
+ <strong><a name="M000023">sortable_element( element_id, options = {} )</a></strong> <a href="#M000023"><img src="../../permalink.gif" border="0" title="Permalink to Public Instance method: sortable_element" /></a></h4>
171
+
172
+ <p>
173
+ Makes the element with the DOM ID specified by <tt>element_id</tt> sortable
174
+ by drag-and-drop and make an Ajax call whenever the sort order has changed.
175
+ By default, the action called gets the serialized sortable element as
176
+ parameters.
177
+ </p>
178
+ <p>
179
+ See <a href="http://script.aculo.us">script.aculo.us</a> for avalaible
180
+ options.
181
+ </p>
182
+ <p>
183
+ If you wan&#8216;t to use <tt>onChange</tt> and/or <tt>onUpdate</tt> you
184
+ can pass a javascript string or a Hash, if you want to call a remote
185
+ function.
186
+ </p>
187
+ <p>
188
+ Example:
189
+ </p>
190
+ <pre>
191
+ ul( :id =&gt; 'my_list' ) do
192
+ li &quot;Google&quot;
193
+ li &quot;Yahoo&quot;
194
+ li &quot;Accoona&quot;
195
+ li &quot;Ask.com&quot;
196
+ li &quot;Baidu&quot;
197
+ li &quot;Exalead&quot;
198
+ li &quot;Voila&quot;
199
+ li &quot;Lycos&quot;
200
+ end
201
+ sortable_element( 'my_list',
202
+ :onChange =&gt; {
203
+ :url =&gt; R(SaveListOrder),
204
+ :success =&gt; visual_effect( :highlight, 'my_list' )
205
+ }
206
+ )
207
+ </pre>
208
+
209
+ <div class="sourcecode">
210
+ <p class="source-link">[ <a href="javascript:toggleSource('M000023_source')" id="l_M000023_source">show source</a> ]</p>
211
+ <div id="M000023_source" class="dyn-source">
212
+ <pre>
213
+ <span class="ruby-comment cmt"># File lib/bivouac/helpers/view/goh/scriptaculous.rb, line 54</span>
214
+ 54: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">sortable_element</span>( <span class="ruby-identifier">element_id</span>, <span class="ruby-identifier">options</span> = {} )
215
+ 55: <span class="ruby-identifier">javascript_tag</span>( <span class="ruby-identifier">sortable_element_js</span>( <span class="ruby-identifier">element_id</span>, <span class="ruby-identifier">options</span> ) <span class="ruby-operator">+</span> <span class="ruby-value str">&quot;;\n&quot;</span> )
216
+ 56: <span class="ruby-keyword kw">end</span>
217
+ </pre>
218
+ </div>
219
+ </div>
220
+ <h4 class="ruled">Public Instance method:
221
+ <strong><a name="M000022">visual_effect(name, element_id = false, js_options = {})</a></strong> <a href="#M000022"><img src="../../permalink.gif" border="0" title="Permalink to Public Instance method: visual_effect" /></a></h4>
222
+
223
+ <p>
224
+ Returns a JavaScript snippet to be used on the Ajax callbacks for starting
225
+ visual effects.
226
+ </p>
227
+
228
+ <div class="sourcecode">
229
+ <p class="source-link">[ <a href="javascript:toggleSource('M000022_source')" id="l_M000022_source">show source</a> ]</p>
230
+ <div id="M000022_source" class="dyn-source">
231
+ <pre>
232
+ <span class="ruby-comment cmt"># File lib/bivouac/helpers/view/goh/scriptaculous.rb, line 11</span>
233
+ 11: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">visual_effect</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">element_id</span> = <span class="ruby-keyword kw">false</span>, <span class="ruby-identifier">js_options</span> = {})
234
+ 12: <span class="ruby-identifier">element</span> = <span class="ruby-identifier">element_id</span> <span class="ruby-value">? </span><span class="ruby-identifier">element_id</span> <span class="ruby-operator">:</span> <span class="ruby-value str">&quot;element&quot;</span>
235
+ 13:
236
+ 14: <span class="ruby-identifier">js_options</span>[<span class="ruby-identifier">:queue</span>] = <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">js_options</span>[<span class="ruby-identifier">:queue</span>].<span class="ruby-identifier">is_a?</span>(<span class="ruby-constant">Hash</span>)
237
+ 15: <span class="ruby-value str">'{'</span> <span class="ruby-operator">+</span> <span class="ruby-identifier">js_options</span>[<span class="ruby-identifier">:queue</span>].<span class="ruby-identifier">map</span> {<span class="ruby-operator">|</span><span class="ruby-identifier">k</span>, <span class="ruby-identifier">v</span><span class="ruby-operator">|</span> <span class="ruby-identifier">k</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">:limit</span> <span class="ruby-operator">?</span> <span class="ruby-node">&quot;#{k}:#{v}&quot;</span> <span class="ruby-operator">:</span> <span class="ruby-node">&quot;#{k}:'#{v}'&quot;</span> }.<span class="ruby-identifier">join</span>(<span class="ruby-value str">','</span>) <span class="ruby-operator">+</span> <span class="ruby-value str">'}'</span>
238
+ 16: <span class="ruby-keyword kw">elsif</span> <span class="ruby-identifier">js_options</span>[<span class="ruby-identifier">:queue</span>]
239
+ 17: <span class="ruby-node">&quot;'#{js_options[:queue]}'&quot;</span>
240
+ 18: <span class="ruby-keyword kw">end</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">js_options</span>[<span class="ruby-identifier">:queue</span>]
241
+ 19:
242
+ 20: <span class="ruby-keyword kw">if</span> <span class="ruby-constant">TOGGLE_EFFECTS</span>.<span class="ruby-identifier">include?</span> <span class="ruby-identifier">name</span>.<span class="ruby-identifier">to_sym</span>
243
+ 21: <span class="ruby-node">%(Effect.toggle(#{element.inspect},'#{name.to_s.gsub(/^toggle_/,'')}',#{options_for_javascript(js_options)}))</span>
244
+ 22: <span class="ruby-keyword kw">else</span>
245
+ 23: <span class="ruby-node">%(new Effect.#{name.to_s.camelize}('#{element}',#{options_for_javascript(js_options)}))</span>
246
+ 24: <span class="ruby-keyword kw">end</span>
247
+ 25: <span class="ruby-keyword kw">end</span>
248
+ </pre>
249
+ </div>
250
+ </div>
251
+
252
+ </div>
253
+ </div>
254
+
255
+
256
+ </div>
257
+ </body>
258
+ </html>
@@ -0,0 +1,158 @@
1
+
2
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
3
+ <html>
4
+ <head>
5
+ <title>
6
+ Bivouac, the Documentation &raquo; Module: BivouacHelpers::TooltipView
7
+ </title>
8
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
9
+ <link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
10
+ <script language="JavaScript" type="text/javascript">
11
+ // <![CDATA[
12
+
13
+ function toggleSource( id )
14
+ {
15
+ var elem
16
+ var link
17
+
18
+ if( document.getElementById )
19
+ {
20
+ elem = document.getElementById( id )
21
+ link = document.getElementById( "l_" + id )
22
+ }
23
+ else if ( document.all )
24
+ {
25
+ elem = eval( "document.all." + id )
26
+ link = eval( "document.all.l_" + id )
27
+ }
28
+ else
29
+ return false;
30
+
31
+ if( elem.style.display == "block" )
32
+ {
33
+ elem.style.display = "none"
34
+ link.innerHTML = "show source"
35
+ }
36
+ else
37
+ {
38
+ elem.style.display = "block"
39
+ link.innerHTML = "hide source"
40
+ }
41
+ }
42
+
43
+ function openCode( url )
44
+ {
45
+ window.open( url, "SOURCE_CODE", "width=400,height=400,scrollbars=yes" )
46
+ }
47
+ // ]]>
48
+ </script>
49
+ </head>
50
+ <body>
51
+ <!--
52
+ <div id="menu">
53
+ <h3 class="title">Module: BivouacHelpers::TooltipView</h3>
54
+ </div>
55
+ -->
56
+ <div id="fullpage">
57
+ <div id="pager">
58
+ <table>
59
+ <tr><td><img src="../../rubyfr.png" /></td>
60
+ <td id="pagertd">
61
+ <strong># Module: BivouacHelpers::TooltipView<br />
62
+ [
63
+ "<a href="../../files/README.html" value="File: README">README</a>",
64
+ "<a href="../../files/AUTHORS.html" value="File: AUTHORS">AUTHORS</a>",
65
+ "<a href="../../files/COPYING.html" value="File: COPYING">COPYING</a>",
66
+ "<a href="../../files/lib/bivouac/helpers/view/goh/base_rb.html" value="File: base.rb">lib/bivouac/helpers/view/goh/base.rb</a>",
67
+ "<a href="../../files/lib/bivouac/helpers/view/goh/form_rb.html" value="File: form.rb">lib/bivouac/helpers/view/goh/form.rb</a>",
68
+ "<a href="../../files/lib/bivouac/helpers/view/goh/html_rb.html" value="File: html.rb">lib/bivouac/helpers/view/goh/html.rb</a>",
69
+ "<a href="../../files/lib/bivouac/helpers/view/goh/tooltip_rb.html" value="File: tooltip.rb">lib/bivouac/helpers/view/goh/tooltip.rb</a>",
70
+ "<a href="../../files/lib/bivouac/helpers/view/goh/scriptaculous_rb.html" value="File: scriptaculous.rb">lib/bivouac/helpers/view/goh/scriptaculous.rb</a>",
71
+ "<a href="../../files/lib/bivouac/helpers/view/goh/javascript_rb.html" value="File: javascript.rb">lib/bivouac/helpers/view/goh/javascript.rb</a>",
72
+ <a href="http://greg.rubyfr.net">nil</a>].each do<br />
73
+ <a href="../../classes/JavaScriptGenerator.html" title="Class: JavaScriptGenerator">JavaScriptGenerator</a>.view_html<br />
74
+ <a href="../../classes/BivouacHelpers.html" title="Module: BivouacHelpers">BivouacHelpers</a>.view_html<br />
75
+ <a href="../../classes/BivouacHelpers/TooltipView.html" title="Module: BivouacHelpers::TooltipView">BivouacHelpers::TooltipView</a>.view_html<br />
76
+ <a href="../../classes/BivouacHelpers/ScriptAculoUsView.html" title="Module: BivouacHelpers::ScriptAculoUsView">BivouacHelpers::ScriptAculoUsView</a>.view_html<br />
77
+ <a href="../../classes/BivouacHelpers/BaseView.html" title="Module: BivouacHelpers::BaseView">BivouacHelpers::BaseView</a>.view_html<br />
78
+ <a href="../../classes/BivouacHelpers/JavaScriptView.html" title="Module: BivouacHelpers::JavaScriptView">BivouacHelpers::JavaScriptView</a>.view_html<br />
79
+ <a href="../../classes/BivouacHelpers/HtmlView.html" title="Module: BivouacHelpers::HtmlView">BivouacHelpers::HtmlView</a>.view_html<br />
80
+ <a href="../../classes/BivouacHelpers/FormView.html" title="Module: BivouacHelpers::FormView">BivouacHelpers::FormView</a>.view_html<br />
81
+ end</strong>
82
+ </td></tr>
83
+ </table>
84
+ </ul>
85
+ </div>
86
+
87
+
88
+ <div id="BivouacHelpers::TooltipView" class="page_shade">
89
+ <div class="page">
90
+ <h3>Module BivouacHelpers::TooltipView &lt; Object</h3>
91
+
92
+ (in files
93
+ <a href="../../files/lib/bivouac/helpers/view/goh/tooltip_rb.html">lib/bivouac/helpers/view/goh/tooltip.rb</a>
94
+ )
95
+
96
+ <p>
97
+ bivouac/helpers/view/html
98
+ </p>
99
+
100
+
101
+
102
+
103
+
104
+ <h2 class="ruled">Methods</h2>
105
+ <h4 class="ruled">Public Instance method:
106
+ <strong><a name="M000021">tooltip( name, element ) {|| ...}</a></strong> <a href="#M000021"><img src="../../permalink.gif" border="0" title="Permalink to Public Instance method: tooltip" /></a></h4>
107
+
108
+ <p>
109
+ Returns an html div (id <tt>name</tt>) as a <a
110
+ href="TooltipView.html#M000021">tooltip</a> for <tt>element</tt>.
111
+ </p>
112
+ <pre>
113
+ div( id =&gt; &quot;tooltip_me&quot; ) do
114
+ &quot;Hello World&quot;
115
+ end
116
+ tooltip( &quot;i_m_the_tooltip&quot;, &quot;tooltip_me&quot; ) do
117
+ &quot;Content of the tooltip&quot;
118
+ end # =&gt;
119
+ &lt;div id=&quot;tooltip_me&quot;&gt;
120
+ Hello World
121
+ &lt;/div&gt;
122
+ &lt;div id = &quot;i_m_the_tooltip&quot; style = &quot;display:none;&quot;&gt;
123
+ Content of the tooltip
124
+ &lt;/div&gt;
125
+ &lt;script&gt;
126
+ var i_m_the_tooltip = new Tooltip( 'tooltip_me', 'i_m_the_tooltip' )
127
+ &lt;/script&gt;
128
+ </pre>
129
+ <p>
130
+ See <a
131
+ href="http://blog.innerewut.de/tooltip">blog.innerewut.de/tooltip</a> for
132
+ more information about <a href="TooltipView.html#M000021">tooltip</a>
133
+ </p>
134
+
135
+ <div class="sourcecode">
136
+ <p class="source-link">[ <a href="javascript:toggleSource('M000021_source')" id="l_M000021_source">show source</a> ]</p>
137
+ <div id="M000021_source" class="dyn-source">
138
+ <pre>
139
+ <span class="ruby-comment cmt"># File lib/bivouac/helpers/view/goh/tooltip.rb, line 24</span>
140
+ 24: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">tooltip</span>( <span class="ruby-identifier">name</span>, <span class="ruby-identifier">element</span>, <span class="ruby-operator">&amp;</span><span class="ruby-identifier">block</span> )
141
+ 25: <span class="ruby-identifier">div</span>( <span class="ruby-identifier">:id</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-identifier">name</span>, <span class="ruby-identifier">:style</span> =<span class="ruby-operator">&gt;</span> <span class="ruby-value str">&quot;display:none;&quot;</span> ) <span class="ruby-keyword kw">do</span>
142
+ 26: <span class="ruby-keyword kw">yield</span>( )
143
+ 27: <span class="ruby-keyword kw">end</span>
144
+ 28: <span class="ruby-identifier">script</span> <span class="ruby-keyword kw">do</span>
145
+ 29: <span class="ruby-node">&quot;var #{name} = new Tooltip( '#{element}', '#{name}' )&quot;</span>
146
+ 30: <span class="ruby-keyword kw">end</span>
147
+ 31: <span class="ruby-keyword kw">end</span>
148
+ </pre>
149
+ </div>
150
+ </div>
151
+
152
+ </div>
153
+ </div>
154
+
155
+
156
+ </div>
157
+ </body>
158
+ </html>
@@ -0,0 +1,564 @@
1
+
2
+ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
3
+ <html>
4
+ <head>
5
+ <title>
6
+ Bivouac, the Documentation &raquo; Class: JavaScriptGenerator
7
+ </title>
8
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
9
+ <link rel="stylesheet" href=".././rdoc-style.css" type="text/css" media="screen" />
10
+ <script language="JavaScript" type="text/javascript">
11
+ // <![CDATA[
12
+
13
+ function toggleSource( id )
14
+ {
15
+ var elem
16
+ var link
17
+
18
+ if( document.getElementById )
19
+ {
20
+ elem = document.getElementById( id )
21
+ link = document.getElementById( "l_" + id )
22
+ }
23
+ else if ( document.all )
24
+ {
25
+ elem = eval( "document.all." + id )
26
+ link = eval( "document.all.l_" + id )
27
+ }
28
+ else
29
+ return false;
30
+
31
+ if( elem.style.display == "block" )
32
+ {
33
+ elem.style.display = "none"
34
+ link.innerHTML = "show source"
35
+ }
36
+ else
37
+ {
38
+ elem.style.display = "block"
39
+ link.innerHTML = "hide source"
40
+ }
41
+ }
42
+
43
+ function openCode( url )
44
+ {
45
+ window.open( url, "SOURCE_CODE", "width=400,height=400,scrollbars=yes" )
46
+ }
47
+ // ]]>
48
+ </script>
49
+ </head>
50
+ <body>
51
+ <!--
52
+ <div id="menu">
53
+ <h3 class="title">Class: JavaScriptGenerator</h3>
54
+ </div>
55
+ -->
56
+ <div id="fullpage">
57
+ <div id="pager">
58
+ <table>
59
+ <tr><td><img src="../rubyfr.png" /></td>
60
+ <td id="pagertd">
61
+ <strong># Class: JavaScriptGenerator<br />
62
+ [
63
+ "<a href="../files/README.html" value="File: README">README</a>",
64
+ "<a href="../files/AUTHORS.html" value="File: AUTHORS">AUTHORS</a>",
65
+ "<a href="../files/COPYING.html" value="File: COPYING">COPYING</a>",
66
+ "<a href="../files/lib/bivouac/helpers/view/goh/base_rb.html" value="File: base.rb">lib/bivouac/helpers/view/goh/base.rb</a>",
67
+ "<a href="../files/lib/bivouac/helpers/view/goh/form_rb.html" value="File: form.rb">lib/bivouac/helpers/view/goh/form.rb</a>",
68
+ "<a href="../files/lib/bivouac/helpers/view/goh/html_rb.html" value="File: html.rb">lib/bivouac/helpers/view/goh/html.rb</a>",
69
+ "<a href="../files/lib/bivouac/helpers/view/goh/tooltip_rb.html" value="File: tooltip.rb">lib/bivouac/helpers/view/goh/tooltip.rb</a>",
70
+ "<a href="../files/lib/bivouac/helpers/view/goh/scriptaculous_rb.html" value="File: scriptaculous.rb">lib/bivouac/helpers/view/goh/scriptaculous.rb</a>",
71
+ "<a href="../files/lib/bivouac/helpers/view/goh/javascript_rb.html" value="File: javascript.rb">lib/bivouac/helpers/view/goh/javascript.rb</a>",
72
+ <a href="http://greg.rubyfr.net">nil</a>].each do<br />
73
+ <a href="../classes/JavaScriptGenerator.html" title="Class: JavaScriptGenerator">JavaScriptGenerator</a>.view_html<br />
74
+ <a href="../classes/BivouacHelpers.html" title="Module: BivouacHelpers">BivouacHelpers</a>.view_html<br />
75
+ <a href="../classes/BivouacHelpers/TooltipView.html" title="Module: BivouacHelpers::TooltipView">BivouacHelpers::TooltipView</a>.view_html<br />
76
+ <a href="../classes/BivouacHelpers/ScriptAculoUsView.html" title="Module: BivouacHelpers::ScriptAculoUsView">BivouacHelpers::ScriptAculoUsView</a>.view_html<br />
77
+ <a href="../classes/BivouacHelpers/BaseView.html" title="Module: BivouacHelpers::BaseView">BivouacHelpers::BaseView</a>.view_html<br />
78
+ <a href="../classes/BivouacHelpers/JavaScriptView.html" title="Module: BivouacHelpers::JavaScriptView">BivouacHelpers::JavaScriptView</a>.view_html<br />
79
+ <a href="../classes/BivouacHelpers/HtmlView.html" title="Module: BivouacHelpers::HtmlView">BivouacHelpers::HtmlView</a>.view_html<br />
80
+ <a href="../classes/BivouacHelpers/FormView.html" title="Module: BivouacHelpers::FormView">BivouacHelpers::FormView</a>.view_html<br />
81
+ end</strong>
82
+ </td></tr>
83
+ </table>
84
+ </ul>
85
+ </div>
86
+
87
+
88
+ <div id="JavaScriptGenerator" class="page_shade">
89
+ <div class="page">
90
+ <h3>Class JavaScriptGenerator &lt; Object</h3>
91
+
92
+ (in files
93
+ <a href="../files/lib/bivouac/helpers/view/goh/javascript_rb.html">lib/bivouac/helpers/view/goh/javascript.rb</a>
94
+ )
95
+
96
+
97
+
98
+
99
+
100
+ <h2 class="ruled">Methods</h2>
101
+ <h4 class="ruled">Public Instance method:
102
+ <strong><a name="M000003">&lt;&lt;(javascript)</a></strong> <a href="#M000003"><img src="../permalink.gif" border="0" title="Permalink to Public Instance method: &lt;&lt;" /></a></h4>
103
+
104
+ <p>
105
+ Writes raw JavaScript to the page.
106
+ </p>
107
+
108
+ <div class="sourcecode">
109
+ <p class="source-link">[ <a href="javascript:toggleSource('M000003_source')" id="l_M000003_source">show source</a> ]</p>
110
+ <div id="M000003_source" class="dyn-source">
111
+ <pre>
112
+ <span class="ruby-comment cmt"># File lib/bivouac/helpers/view/goh/javascript.rb, line 54</span>
113
+ 54: <span class="ruby-keyword kw">def</span> <span class="ruby-operator">&lt;&lt;</span>(<span class="ruby-identifier">javascript</span>)
114
+ 55: <span class="ruby-ivar">@source</span> <span class="ruby-operator">&lt;&lt;</span> <span class="ruby-identifier">javascript</span>
115
+ 56: <span class="ruby-keyword kw">end</span>
116
+ </pre>
117
+ </div>
118
+ </div>
119
+ <h4 class="ruled">Public Instance method:
120
+ <strong><a name="M000001">[]( id )</a></strong> <a href="#M000001"><img src="../permalink.gif" border="0" title="Permalink to Public Instance method: []" /></a></h4>
121
+
122
+ <p>
123
+ Returns a element reference by finding it through <tt>id</tt> in the DOM.
124
+ This element can then be used for further method calls. Examples:
125
+ </p>
126
+ <pre>
127
+ page['blank_slate'] # =&gt; $('blank_slate');
128
+ page['blank_slate'].show # =&gt; $('blank_slate').show();
129
+ page['blank_slate'].show('first').up # =&gt; $('blank_slate').show('first').up();
130
+ </pre>
131
+
132
+ <div class="sourcecode">
133
+ <p class="source-link">[ <a href="javascript:toggleSource('M000001_source')" id="l_M000001_source">show source</a> ]</p>
134
+ <div id="M000001_source" class="dyn-source">
135
+ <pre>
136
+ <span class="ruby-comment cmt"># File lib/bivouac/helpers/view/goh/javascript.rb, line 24</span>
137
+ 24: <span class="ruby-keyword kw">def</span> <span class="ruby-operator">[]</span>( <span class="ruby-identifier">id</span> )
138
+ 25: <span class="ruby-comment cmt"># JavaScriptElementProxy.new(self, id)</span>
139
+ 26: <span class="ruby-keyword kw">end</span>
140
+ </pre>
141
+ </div>
142
+ </div>
143
+ <h4 class="ruled">Public Instance method:
144
+ <strong><a name="M000004">alert(message)</a></strong> <a href="#M000004"><img src="../permalink.gif" border="0" title="Permalink to Public Instance method: alert" /></a></h4>
145
+
146
+ <p>
147
+ Displays an <a href="JavaScriptGenerator.html#M000004">alert</a> dialog
148
+ with the given <tt>message</tt>.
149
+ </p>
150
+
151
+ <div class="sourcecode">
152
+ <p class="source-link">[ <a href="javascript:toggleSource('M000004_source')" id="l_M000004_source">show source</a> ]</p>
153
+ <div id="M000004_source" class="dyn-source">
154
+ <pre>
155
+ <span class="ruby-comment cmt"># File lib/bivouac/helpers/view/goh/javascript.rb, line 59</span>
156
+ 59: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">alert</span>(<span class="ruby-identifier">message</span>)
157
+ 60: <span class="ruby-identifier">call</span>( <span class="ruby-value str">&quot;alert&quot;</span>, <span class="ruby-identifier">message</span> )
158
+ 61: <span class="ruby-keyword kw">end</span>
159
+ </pre>
160
+ </div>
161
+ </div>
162
+ <h4 class="ruled">Public Instance method:
163
+ <strong><a name="M000005">assign( variable, value )</a></strong> <a href="#M000005"><img src="../permalink.gif" border="0" title="Permalink to Public Instance method: assign" /></a></h4>
164
+
165
+ <p>
166
+ Assigns the JavaScript <tt>variable</tt> the given <tt>value</tt>.
167
+ </p>
168
+
169
+ <div class="sourcecode">
170
+ <p class="source-link">[ <a href="javascript:toggleSource('M000005_source')" id="l_M000005_source">show source</a> ]</p>
171
+ <div id="M000005_source" class="dyn-source">
172
+ <pre>
173
+ <span class="ruby-comment cmt"># File lib/bivouac/helpers/view/goh/javascript.rb, line 64</span>
174
+ 64: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">assign</span>( <span class="ruby-identifier">variable</span>, <span class="ruby-identifier">value</span> )
175
+ 65: <span class="ruby-identifier">record</span> <span class="ruby-node">&quot;#{variable} = #{value.inspect}&quot;</span>
176
+ 66: <span class="ruby-keyword kw">end</span>
177
+ </pre>
178
+ </div>
179
+ </div>
180
+ <h4 class="ruled">Public Instance method:
181
+ <strong><a name="M000010">call(function, *arguments)</a></strong> <a href="#M000010"><img src="../permalink.gif" border="0" title="Permalink to Public Instance method: call" /></a></h4>
182
+
183
+ <p>
184
+ Calls the JavaScript <tt>function</tt>, optionally with the given
185
+ <tt>arguments</tt>.
186
+ </p>
187
+
188
+ <div class="sourcecode">
189
+ <p class="source-link">[ <a href="javascript:toggleSource('M000010_source')" id="l_M000010_source">show source</a> ]</p>
190
+ <div id="M000010_source" class="dyn-source">
191
+ <pre>
192
+ <span class="ruby-comment cmt"># File lib/bivouac/helpers/view/goh/javascript.rb, line 104</span>
193
+ 104: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">call</span>(<span class="ruby-identifier">function</span>, <span class="ruby-operator">*</span><span class="ruby-identifier">arguments</span>)
194
+ 105: <span class="ruby-identifier">record</span> <span class="ruby-node">&quot;#{function}(#{arguments_for_call(arguments)});\n&quot;</span>
195
+ 106: <span class="ruby-keyword kw">end</span>
196
+ </pre>
197
+ </div>
198
+ </div>
199
+ <h4 class="ruled">Public Instance method:
200
+ <strong><a name="M000020">delay(seconds = 1) {|| ...}</a></strong> <a href="#M000020"><img src="../permalink.gif" border="0" title="Permalink to Public Instance method: delay" /></a></h4>
201
+
202
+ <p>
203
+ Executes the content of the block after a <a
204
+ href="JavaScriptGenerator.html#M000020">delay</a> of <tt>seconds</tt>.
205
+ Example:
206
+ </p>
207
+ <pre>
208
+ page.delay(20) do
209
+ page.visual_effect :fade, 'notice'
210
+ end
211
+ </pre>
212
+
213
+ <div class="sourcecode">
214
+ <p class="source-link">[ <a href="javascript:toggleSource('M000020_source')" id="l_M000020_source">show source</a> ]</p>
215
+ <div id="M000020_source" class="dyn-source">
216
+ <pre>
217
+ <span class="ruby-comment cmt"># File lib/bivouac/helpers/view/goh/javascript.rb, line 175</span>
218
+ 175: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">delay</span>(<span class="ruby-identifier">seconds</span> = <span class="ruby-value">1</span>)
219
+ 176: <span class="ruby-identifier">record</span> <span class="ruby-value str">&quot;setTimeout(function() {\n\n&quot;</span>
220
+ 177: <span class="ruby-keyword kw">yield</span>
221
+ 178: <span class="ruby-identifier">record</span> <span class="ruby-node">&quot;}, #{(seconds * 1000).to_i})&quot;</span>
222
+ 179: <span class="ruby-keyword kw">end</span>
223
+ </pre>
224
+ </div>
225
+ </div>
226
+ <h4 class="ruled">Public Instance method:
227
+ <strong><a name="M000006">draggable( id, options = {} )</a></strong> <a href="#M000006"><img src="../permalink.gif" border="0" title="Permalink to Public Instance method: draggable" /></a></h4>
228
+
229
+ <p>
230
+ Creates a script.aculo.us <a
231
+ href="JavaScriptGenerator.html#M000006">draggable</a> element. See
232
+ ActionView::Helpers::ScriptaculousHelper for more information.
233
+ </p>
234
+
235
+ <div class="sourcecode">
236
+ <p class="source-link">[ <a href="javascript:toggleSource('M000006_source')" id="l_M000006_source">show source</a> ]</p>
237
+ <div id="M000006_source" class="dyn-source">
238
+ <pre>
239
+ <span class="ruby-comment cmt"># File lib/bivouac/helpers/view/goh/javascript.rb, line 70</span>
240
+ 70: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">draggable</span>( <span class="ruby-identifier">id</span>, <span class="ruby-identifier">options</span> = {} )
241
+ 71: <span class="ruby-identifier">record</span> <span class="ruby-ivar">@context</span>.<span class="ruby-identifier">draggable_element_js</span>( <span class="ruby-identifier">id</span>, <span class="ruby-identifier">options</span> ) <span class="ruby-operator">+</span> <span class="ruby-value str">&quot;;\n&quot;</span>
242
+ 72: <span class="ruby-keyword kw">end</span>
243
+ </pre>
244
+ </div>
245
+ </div>
246
+ <h4 class="ruled">Public Instance method:
247
+ <strong><a name="M000007">drop_receiving( id, options = {} )</a></strong> <a href="#M000007"><img src="../permalink.gif" border="0" title="Permalink to Public Instance method: drop_receiving" /></a></h4>
248
+
249
+ <p>
250
+ Creates a script.aculo.us drop receiving element. See
251
+ ActionView::Helpers::ScriptaculousHelper for more information.
252
+ </p>
253
+
254
+ <div class="sourcecode">
255
+ <p class="source-link">[ <a href="javascript:toggleSource('M000007_source')" id="l_M000007_source">show source</a> ]</p>
256
+ <div id="M000007_source" class="dyn-source">
257
+ <pre>
258
+ <span class="ruby-comment cmt"># File lib/bivouac/helpers/view/goh/javascript.rb, line 76</span>
259
+ 76: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">drop_receiving</span>( <span class="ruby-identifier">id</span>, <span class="ruby-identifier">options</span> = {} )
260
+ 77: <span class="ruby-identifier">record</span> <span class="ruby-ivar">@context</span>.<span class="ruby-identifier">drop_receiving_element_js</span>( <span class="ruby-identifier">id</span>, <span class="ruby-identifier">options</span> ) <span class="ruby-operator">+</span> <span class="ruby-value str">&quot;;\n&quot;</span>
261
+ 78: <span class="ruby-keyword kw">end</span>
262
+ </pre>
263
+ </div>
264
+ </div>
265
+ <h4 class="ruled">Public Instance method:
266
+ <strong><a name="M000008">hide( *ids )</a></strong> <a href="#M000008"><img src="../permalink.gif" border="0" title="Permalink to Public Instance method: hide" /></a></h4>
267
+
268
+ <p>
269
+ Hides the visible DOM elements with the given <tt>ids</tt>.
270
+ </p>
271
+
272
+ <div class="sourcecode">
273
+ <p class="source-link">[ <a href="javascript:toggleSource('M000008_source')" id="l_M000008_source">show source</a> ]</p>
274
+ <div id="M000008_source" class="dyn-source">
275
+ <pre>
276
+ <span class="ruby-comment cmt"># File lib/bivouac/helpers/view/goh/javascript.rb, line 81</span>
277
+ 81: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">hide</span>( <span class="ruby-operator">*</span><span class="ruby-identifier">ids</span> )
278
+ 82: <span class="ruby-identifier">loop_on_multiple_args</span> <span class="ruby-value str">'Element.hide'</span>, <span class="ruby-identifier">ids</span>
279
+ 83: <span class="ruby-keyword kw">end</span>
280
+ </pre>
281
+ </div>
282
+ </div>
283
+ <h4 class="ruled">Public Instance method:
284
+ <strong><a name="M000009">insert_html(position, id, data)</a></strong> <a href="#M000009"><img src="../permalink.gif" border="0" title="Permalink to Public Instance method: insert_html" /></a></h4>
285
+
286
+ <p>
287
+ Inserts HTML at the specified <tt>position</tt> relative to the DOM element
288
+ identified by the given <tt>id</tt>.
289
+ </p>
290
+ <p>
291
+ <tt>position</tt> may be one of:
292
+ </p>
293
+ <table>
294
+ <tr><td valign="top"><tt>:top</tt>:</td><td>HTML is inserted inside the element, before the element&#8216;s existing
295
+ content.
296
+
297
+ </td></tr>
298
+ <tr><td valign="top"><tt>:bottom</tt>:</td><td>HTML is inserted inside the element, after the element&#8216;s existing
299
+ content.
300
+
301
+ </td></tr>
302
+ <tr><td valign="top"><tt>:before</tt>:</td><td>HTML is inserted immediately preceeding the element.
303
+
304
+ </td></tr>
305
+ <tr><td valign="top"><tt>:after</tt>:</td><td>HTML is inserted immediately following the element.
306
+
307
+ </td></tr>
308
+ </table>
309
+ <p>
310
+ <tt>data</tt> may be a string of HTML to insert.
311
+ </p>
312
+
313
+ <div class="sourcecode">
314
+ <p class="source-link">[ <a href="javascript:toggleSource('M000009_source')" id="l_M000009_source">show source</a> ]</p>
315
+ <div id="M000009_source" class="dyn-source">
316
+ <pre>
317
+ <span class="ruby-comment cmt"># File lib/bivouac/helpers/view/goh/javascript.rb, line 98</span>
318
+ 98: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">insert_html</span>(<span class="ruby-identifier">position</span>, <span class="ruby-identifier">id</span>, <span class="ruby-identifier">data</span>)
319
+ 99: <span class="ruby-identifier">insertion</span> = <span class="ruby-identifier">position</span>.<span class="ruby-identifier">to_s</span>.<span class="ruby-identifier">camelize</span>
320
+ 100: <span class="ruby-identifier">call</span> <span class="ruby-node">&quot;new Insertion.#{insertion}&quot;</span>, <span class="ruby-identifier">id</span>, <span class="ruby-identifier">data</span>
321
+ 101: <span class="ruby-keyword kw">end</span>
322
+ </pre>
323
+ </div>
324
+ </div>
325
+ <h4 class="ruled">Public Instance method:
326
+ <strong><a name="M000011">redirect_to(location)</a></strong> <a href="#M000011"><img src="../permalink.gif" border="0" title="Permalink to Public Instance method: redirect_to" /></a></h4>
327
+
328
+ <p>
329
+ Redirects the browser to the given <tt>location</tt>.
330
+ </p>
331
+
332
+ <div class="sourcecode">
333
+ <p class="source-link">[ <a href="javascript:toggleSource('M000011_source')" id="l_M000011_source">show source</a> ]</p>
334
+ <div id="M000011_source" class="dyn-source">
335
+ <pre>
336
+ <span class="ruby-comment cmt"># File lib/bivouac/helpers/view/goh/javascript.rb, line 109</span>
337
+ 109: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">redirect_to</span>(<span class="ruby-identifier">location</span>)
338
+ 110: <span class="ruby-identifier">assign</span> <span class="ruby-value str">'window.location.href'</span>, <span class="ruby-identifier">location</span>
339
+ 111: <span class="ruby-keyword kw">end</span>
340
+ </pre>
341
+ </div>
342
+ </div>
343
+ <h4 class="ruled">Public Instance method:
344
+ <strong><a name="M000012">remove(*ids)</a></strong> <a href="#M000012"><img src="../permalink.gif" border="0" title="Permalink to Public Instance method: remove" /></a></h4>
345
+
346
+ <p>
347
+ Removes the DOM elements with the given ids from the page.
348
+ </p>
349
+
350
+ <div class="sourcecode">
351
+ <p class="source-link">[ <a href="javascript:toggleSource('M000012_source')" id="l_M000012_source">show source</a> ]</p>
352
+ <div id="M000012_source" class="dyn-source">
353
+ <pre>
354
+ <span class="ruby-comment cmt"># File lib/bivouac/helpers/view/goh/javascript.rb, line 114</span>
355
+ 114: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">remove</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">ids</span>)
356
+ 115: <span class="ruby-identifier">loop_on_multiple_args</span> <span class="ruby-value str">'Element.remove'</span>, <span class="ruby-identifier">ids</span>
357
+ 116: <span class="ruby-keyword kw">end</span>
358
+ </pre>
359
+ </div>
360
+ </div>
361
+ <h4 class="ruled">Public Instance method:
362
+ <strong><a name="M000014">replace(id, data)</a></strong> <a href="#M000014"><img src="../permalink.gif" border="0" title="Permalink to Public Instance method: replace" /></a></h4>
363
+
364
+ <p>
365
+ Replaces the &quot;outer HTML&quot; (i.e., the entire element, not just its
366
+ contents) of the DOM element with the given <tt>id</tt>.
367
+ </p>
368
+ <p>
369
+ <tt>data</tt> may be a string of HTML to insert. For example:
370
+ </p>
371
+ <pre>
372
+ # Replace the DOM element having ID 'person-45' with the
373
+ # 'person' partial for the appropriate object.
374
+ replace 'person-45', render( 'person', :object =&gt; @person )
375
+ </pre>
376
+
377
+ <div class="sourcecode">
378
+ <p class="source-link">[ <a href="javascript:toggleSource('M000014_source')" id="l_M000014_source">show source</a> ]</p>
379
+ <div id="M000014_source" class="dyn-source">
380
+ <pre>
381
+ <span class="ruby-comment cmt"># File lib/bivouac/helpers/view/goh/javascript.rb, line 139</span>
382
+ 139: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">replace</span>(<span class="ruby-identifier">id</span>, <span class="ruby-identifier">data</span>)
383
+ 140: <span class="ruby-identifier">call</span> <span class="ruby-value str">'Element.replace'</span>, <span class="ruby-identifier">id</span>, <span class="ruby-identifier">data</span>
384
+ 141: <span class="ruby-keyword kw">end</span>
385
+ </pre>
386
+ </div>
387
+ </div>
388
+ <h4 class="ruled">Public Instance method:
389
+ <strong><a name="M000013">replace_html(id, data)</a></strong> <a href="#M000013"><img src="../permalink.gif" border="0" title="Permalink to Public Instance method: replace_html" /></a></h4>
390
+
391
+ <p>
392
+ Replaces the inner HTML of the DOM element with the given <tt>id</tt>.
393
+ </p>
394
+ <p>
395
+ <tt>data</tt> may be a string of HTML to insert
396
+ </p>
397
+ <pre>
398
+ # Replace the HTML of the DOM element having ID 'person-45' with the
399
+ # 'person' partial for the appropriate object.
400
+ replace_html 'person-45', render( 'person', :object =&gt; @person )
401
+ </pre>
402
+
403
+ <div class="sourcecode">
404
+ <p class="source-link">[ <a href="javascript:toggleSource('M000013_source')" id="l_M000013_source">show source</a> ]</p>
405
+ <div id="M000013_source" class="dyn-source">
406
+ <pre>
407
+ <span class="ruby-comment cmt"># File lib/bivouac/helpers/view/goh/javascript.rb, line 126</span>
408
+ 126: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">replace_html</span>(<span class="ruby-identifier">id</span>, <span class="ruby-identifier">data</span>)
409
+ 127: <span class="ruby-identifier">call</span> <span class="ruby-value str">'Element.update'</span>, <span class="ruby-identifier">id</span>, <span class="ruby-identifier">data</span>
410
+ 128: <span class="ruby-keyword kw">end</span>
411
+ </pre>
412
+ </div>
413
+ </div>
414
+ <h4 class="ruled">Public Instance method:
415
+ <strong><a name="M000002">select(pattern)</a></strong> <a href="#M000002"><img src="../permalink.gif" border="0" title="Permalink to Public Instance method: select" /></a></h4>
416
+
417
+ <p>
418
+ Returns a collection reference by finding it through a CSS <tt>pattern</tt>
419
+ in the DOM. This collection can then be used for further method calls.
420
+ Examples:
421
+ </p>
422
+ <pre>
423
+ page.select('p') # =&gt; $$('p');
424
+ page.select('p.welcome b').first # =&gt; $$('p.welcome b').first();
425
+ page.select('p.welcome b').first.hide # =&gt; $$('p.welcome b').first().hide();
426
+ </pre>
427
+ <p>
428
+ You can also use prototype enumerations with the collection. Observe:
429
+ </p>
430
+ <pre>
431
+ page.select('#items li').each do |value|
432
+ value.hide
433
+ end
434
+ # =&gt; $$('#items li').each(function(value) { value.hide(); });
435
+ </pre>
436
+ <p>
437
+ Though you can <a href="JavaScriptGenerator.html#M000010">call</a> the
438
+ block param anything you want, they are always rendered in the javascript
439
+ as &#8216;value, index.&#8217; Other enumerations, like collect() return
440
+ the last statement:
441
+ </p>
442
+ <pre>
443
+ page.select('#items li').collect('hidden') do |item|
444
+ item.hide
445
+ end
446
+ # =&gt; var hidden = $$('#items li').collect(function(value, index) { return value.hide(); });
447
+ </pre>
448
+
449
+ <div class="sourcecode">
450
+ <p class="source-link">[ <a href="javascript:toggleSource('M000002_source')" id="l_M000002_source">show source</a> ]</p>
451
+ <div id="M000002_source" class="dyn-source">
452
+ <pre>
453
+ <span class="ruby-comment cmt"># File lib/bivouac/helpers/view/goh/javascript.rb, line 49</span>
454
+ 49: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">select</span>(<span class="ruby-identifier">pattern</span>)
455
+ 50: <span class="ruby-comment cmt"># JavaScriptElementCollectionProxy.new(self, pattern)</span>
456
+ 51: <span class="ruby-keyword kw">end</span>
457
+ </pre>
458
+ </div>
459
+ </div>
460
+ <h4 class="ruled">Public Instance method:
461
+ <strong><a name="M000015">show(*ids)</a></strong> <a href="#M000015"><img src="../permalink.gif" border="0" title="Permalink to Public Instance method: show" /></a></h4>
462
+
463
+ <p>
464
+ Shows hidden DOM elements with the given <tt>ids</tt>.
465
+ </p>
466
+
467
+ <div class="sourcecode">
468
+ <p class="source-link">[ <a href="javascript:toggleSource('M000015_source')" id="l_M000015_source">show source</a> ]</p>
469
+ <div id="M000015_source" class="dyn-source">
470
+ <pre>
471
+ <span class="ruby-comment cmt"># File lib/bivouac/helpers/view/goh/javascript.rb, line 144</span>
472
+ 144: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">show</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">ids</span>)
473
+ 145: <span class="ruby-identifier">loop_on_multiple_args</span> <span class="ruby-value str">'Element.show'</span>, <span class="ruby-identifier">ids</span>
474
+ 146: <span class="ruby-keyword kw">end</span>
475
+ </pre>
476
+ </div>
477
+ </div>
478
+ <h4 class="ruled">Public Instance method:
479
+ <strong><a name="M000016">sortable(id, options = {})</a></strong> <a href="#M000016"><img src="../permalink.gif" border="0" title="Permalink to Public Instance method: sortable" /></a></h4>
480
+
481
+ <p>
482
+ Creates a script.aculo.us <a
483
+ href="JavaScriptGenerator.html#M000016">sortable</a> element. Useful to
484
+ recreate <a href="JavaScriptGenerator.html#M000016">sortable</a> elements
485
+ after items get added or deleted.
486
+ </p>
487
+
488
+ <div class="sourcecode">
489
+ <p class="source-link">[ <a href="javascript:toggleSource('M000016_source')" id="l_M000016_source">show source</a> ]</p>
490
+ <div id="M000016_source" class="dyn-source">
491
+ <pre>
492
+ <span class="ruby-comment cmt"># File lib/bivouac/helpers/view/goh/javascript.rb, line 150</span>
493
+ 150: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">sortable</span>(<span class="ruby-identifier">id</span>, <span class="ruby-identifier">options</span> = {})
494
+ 151: <span class="ruby-identifier">record</span> <span class="ruby-ivar">@context</span>.<span class="ruby-identifier">sortable_element_js</span>( <span class="ruby-identifier">id</span>, <span class="ruby-identifier">options</span> ) <span class="ruby-operator">+</span> <span class="ruby-value str">&quot;;\n&quot;</span>
495
+ 152: <span class="ruby-keyword kw">end</span>
496
+ </pre>
497
+ </div>
498
+ </div>
499
+ <h4 class="ruled">Public Instance method:
500
+ <strong><a name="M000018">toggle(*ids)</a></strong> <a href="#M000018"><img src="../permalink.gif" border="0" title="Permalink to Public Instance method: toggle" /></a></h4>
501
+
502
+ <p>
503
+ Toggles the visibility of the DOM elements with the given <tt>ids</tt>.
504
+ </p>
505
+
506
+ <div class="sourcecode">
507
+ <p class="source-link">[ <a href="javascript:toggleSource('M000018_source')" id="l_M000018_source">show source</a> ]</p>
508
+ <div id="M000018_source" class="dyn-source">
509
+ <pre>
510
+ <span class="ruby-comment cmt"># File lib/bivouac/helpers/view/goh/javascript.rb, line 161</span>
511
+ 161: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">toggle</span>(<span class="ruby-operator">*</span><span class="ruby-identifier">ids</span>)
512
+ 162: <span class="ruby-identifier">loop_on_multiple_args</span> <span class="ruby-value str">'Element.toggle'</span>, <span class="ruby-identifier">ids</span>
513
+ 163: <span class="ruby-keyword kw">end</span>
514
+ </pre>
515
+ </div>
516
+ </div>
517
+ <h4 class="ruled">Public Instance method:
518
+ <strong><a name="M000017">unsortable( id )</a></strong> <a href="#M000017"><img src="../permalink.gif" border="0" title="Permalink to Public Instance method: unsortable" /></a></h4>
519
+
520
+ <p>
521
+ Creates a script.aculo.us <a
522
+ href="JavaScriptGenerator.html#M000017">unsortable</a> element. Useful to
523
+ recreate <a href="JavaScriptGenerator.html#M000017">unsortable</a> elements
524
+ after items get added or deleted.
525
+ </p>
526
+
527
+ <div class="sourcecode">
528
+ <p class="source-link">[ <a href="javascript:toggleSource('M000017_source')" id="l_M000017_source">show source</a> ]</p>
529
+ <div id="M000017_source" class="dyn-source">
530
+ <pre>
531
+ <span class="ruby-comment cmt"># File lib/bivouac/helpers/view/goh/javascript.rb, line 156</span>
532
+ 156: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">unsortable</span>( <span class="ruby-identifier">id</span> )
533
+ 157: <span class="ruby-identifier">record</span> <span class="ruby-ivar">@context</span>.<span class="ruby-identifier">unsortable_element_js</span>( <span class="ruby-identifier">id</span> ) <span class="ruby-operator">+</span> <span class="ruby-value str">&quot;;\n&quot;</span>
534
+ 158: <span class="ruby-keyword kw">end</span>
535
+ </pre>
536
+ </div>
537
+ </div>
538
+ <h4 class="ruled">Public Instance method:
539
+ <strong><a name="M000019">visual_effect(name, element_id = false, js_options = {})</a></strong> <a href="#M000019"><img src="../permalink.gif" border="0" title="Permalink to Public Instance method: visual_effect" /></a></h4>
540
+
541
+ <p>
542
+ Starts a <a href="http://script.aculo.us">script.aculo.us</a> visual
543
+ effect.
544
+ </p>
545
+
546
+ <div class="sourcecode">
547
+ <p class="source-link">[ <a href="javascript:toggleSource('M000019_source')" id="l_M000019_source">show source</a> ]</p>
548
+ <div id="M000019_source" class="dyn-source">
549
+ <pre>
550
+ <span class="ruby-comment cmt"># File lib/bivouac/helpers/view/goh/javascript.rb, line 166</span>
551
+ 166: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">visual_effect</span>(<span class="ruby-identifier">name</span>, <span class="ruby-identifier">element_id</span> = <span class="ruby-keyword kw">false</span>, <span class="ruby-identifier">js_options</span> = {})
552
+ 167: <span class="ruby-identifier">record</span>( <span class="ruby-ivar">@context</span>.<span class="ruby-identifier">visual_effect</span>( <span class="ruby-identifier">name</span>, <span class="ruby-identifier">element_id</span>, <span class="ruby-identifier">js_options</span> ) <span class="ruby-operator">+</span> <span class="ruby-value str">&quot;;\n&quot;</span> )
553
+ 168: <span class="ruby-keyword kw">end</span>
554
+ </pre>
555
+ </div>
556
+ </div>
557
+
558
+ </div>
559
+ </div>
560
+
561
+
562
+ </div>
563
+ </body>
564
+ </html>