jqr-helpers 1.0.28 → 1.0.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/Readme.md CHANGED
@@ -50,6 +50,8 @@ the dialog content from a remote route)
50
50
  * `tab_container` - create a tab container
51
51
  * `date_picker_tag` - create a date picker
52
52
  * `buttonset` - create a radio button set
53
+ * `quick_radio_set` - create a radio button set FAST - these are not true jQuery UI buttons but
54
+ they load a heck of a lot faster when you have dozens or hundreds of them.
53
55
  * `button_to_external` - create a working `button_to` button inside an existing form (!)
54
56
  * `will_paginate_ajax` - create a `will_paginate` interface that uses Ajax to
55
57
  replace the paginated contents.
@@ -327,6 +327,21 @@
327
327
  return false;
328
328
  }
329
329
 
330
+ function ujsQuickButtonClick(event) {
331
+ var radio = $(event.currentTarget).prev('input');
332
+ var form = radio[0].form;
333
+ var name = $(radio).attr('name');
334
+ $(form).find('input[name="' + name + '"]').each(function() {
335
+ $(this).next('label').removeClass('ui-state-active');
336
+ });
337
+
338
+ $(event.currentTarget).addClass('ui-state-active');
339
+ }
340
+
341
+ function ujsQuickButtonHover(event) {
342
+ $j(event.currentTarget).toggleClass('ui-state-hover');
343
+ }
344
+
330
345
  function ujsLoadPlugins(event) {
331
346
 
332
347
  function addHiddenField(form, name, value) {
@@ -376,6 +391,7 @@
376
391
  $('.ujs-button-set', event.target).each(function() {
377
392
  $(this).buttonset();
378
393
  });
394
+
379
395
  $('.ujs-tab-container', event.target).each(function() {
380
396
  var options = $(this).data('tab-options');
381
397
  options = $.extend(options, {
@@ -410,6 +426,10 @@
410
426
  $(document).on('ajax:success', '.ujs-ajax', ujsAjaxSuccess);
411
427
  $(document).on('ajax:error', '.ujs-ajax', ujsAjaxError);
412
428
  $(document).on('click', '[data-ujs-confirm=true]', ujsConfirmClick);
429
+ $(document).on('click', '.ujs-quick-buttonset label',
430
+ ujsQuickButtonClick);
431
+ $(document).on('mouseenter mouseleave', '.ujs-quick-buttonset label',
432
+ ujsQuickButtonHover);
413
433
  }
414
434
  else {
415
435
  $('body').live('jqr.load', ujsLoadPlugins);
@@ -421,6 +441,9 @@
421
441
  $('.ujs-ajax').live('ajax:success', ujsAjaxSuccess);
422
442
  $('.ujs-ajax').live('ajax:error', ujsAjaxError);
423
443
  $('[data-ujs-confirm=true]').live('click', ujsConfirmClick);
444
+ $('.ujs-quick-buttonset label').live('click', ujsQuickButtonClick);
445
+ $('.ujs-quick-buttonset label').live('mouseenter mouseleave',
446
+ ujsQuickButtonHover);
424
447
  }
425
448
  $('body').trigger('jqr.load');
426
449
 
@@ -6,13 +6,13 @@
6
6
  <title>
7
7
  Class: JqrHelpers::Generators::InstallGenerator
8
8
 
9
- &mdash; Documentation by YARD 0.8.7.3
9
+ &mdash; Documentation by YARD 0.8.5.2
10
10
 
11
11
  </title>
12
12
 
13
- <link rel="stylesheet" href="../../css/style.css" type="text/css" charset="utf-8" />
13
+ <link rel="stylesheet" href="../../css/style.css" type="text/css" media="screen" charset="utf-8" />
14
14
 
15
- <link rel="stylesheet" href="../../css/common.css" type="text/css" charset="utf-8" />
15
+ <link rel="stylesheet" href="../../css/common.css" type="text/css" media="screen" charset="utf-8" />
16
16
 
17
17
  <script type="text/javascript" charset="utf-8">
18
18
  hasFrames = window.top.frames.main ? true : false;
@@ -201,9 +201,9 @@
201
201
  </div>
202
202
 
203
203
  <div id="footer">
204
- Generated on Thu Jan 30 16:04:14 2014 by
204
+ Generated on Sun Feb 2 15:17:54 2014 by
205
205
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
206
- 0.8.7.3 (ruby-1.9.3).
206
+ 0.8.5.2 (ruby-1.9.3).
207
207
  </div>
208
208
 
209
209
  </body>
@@ -6,13 +6,13 @@
6
6
  <title>
7
7
  Module: JqrHelpers::Generators
8
8
 
9
- &mdash; Documentation by YARD 0.8.7.3
9
+ &mdash; Documentation by YARD 0.8.5.2
10
10
 
11
11
  </title>
12
12
 
13
- <link rel="stylesheet" href="../css/style.css" type="text/css" charset="utf-8" />
13
+ <link rel="stylesheet" href="../css/style.css" type="text/css" media="screen" charset="utf-8" />
14
14
 
15
- <link rel="stylesheet" href="../css/common.css" type="text/css" charset="utf-8" />
15
+ <link rel="stylesheet" href="../css/common.css" type="text/css" media="screen" charset="utf-8" />
16
16
 
17
17
  <script type="text/javascript" charset="utf-8">
18
18
  hasFrames = window.top.frames.main ? true : false;
@@ -106,9 +106,9 @@
106
106
  </div>
107
107
 
108
108
  <div id="footer">
109
- Generated on Thu Jan 30 16:04:14 2014 by
109
+ Generated on Sun Feb 2 15:17:54 2014 by
110
110
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
111
- 0.8.7.3 (ruby-1.9.3).
111
+ 0.8.5.2 (ruby-1.9.3).
112
112
  </div>
113
113
 
114
114
  </body>
@@ -6,13 +6,13 @@
6
6
  <title>
7
7
  Class: JqrHelpers::Helpers::PanelRenderer
8
8
 
9
- &mdash; Documentation by YARD 0.8.7.3
9
+ &mdash; Documentation by YARD 0.8.5.2
10
10
 
11
11
  </title>
12
12
 
13
- <link rel="stylesheet" href="../../css/style.css" type="text/css" charset="utf-8" />
13
+ <link rel="stylesheet" href="../../css/style.css" type="text/css" media="screen" charset="utf-8" />
14
14
 
15
- <link rel="stylesheet" href="../../css/common.css" type="text/css" charset="utf-8" />
15
+ <link rel="stylesheet" href="../../css/common.css" type="text/css" media="screen" charset="utf-8" />
16
16
 
17
17
  <script type="text/javascript" charset="utf-8">
18
18
  hasFrames = window.top.frames.main ? true : false;
@@ -114,36 +114,6 @@
114
114
 
115
115
 
116
116
 
117
- <h2>Instance Attribute Summary <small>(<a href="#" class="summary_toggle">collapse</a>)</small></h2>
118
- <ul class="summary">
119
-
120
- <li class="public ">
121
- <span class="summary_signature">
122
-
123
- <a href="#panels-instance_method" title="#panels (instance method)">- (Array&lt;Hash&gt;) <strong>panels</strong> </a>
124
-
125
-
126
-
127
- </span>
128
-
129
-
130
-
131
-
132
-
133
-
134
-
135
-
136
-
137
-
138
-
139
-
140
- <span class="summary_desc"><div class='inline'></div></span>
141
-
142
- </li>
143
-
144
-
145
- </ul>
146
-
147
117
 
148
118
 
149
119
 
@@ -223,7 +193,7 @@
223
193
  </h3><div class="docstring">
224
194
  <div class="discussion">
225
195
 
226
- <p>Returns a new instance of PanelRenderer</p>
196
+ <p>A new instance of PanelRenderer</p>
227
197
 
228
198
 
229
199
  </div>
@@ -237,12 +207,12 @@
237
207
  <pre class="lines">
238
208
 
239
209
 
240
- 12
241
210
  13
242
- 14</pre>
211
+ 14
212
+ 15</pre>
243
213
  </td>
244
214
  <td>
245
- <pre class="code"><span class="info file"># File 'lib/jqr-helpers/helpers.rb', line 12</span>
215
+ <pre class="code"><span class="info file"># File 'lib/jqr-helpers/helpers.rb', line 13</span>
246
216
 
247
217
  <span class='kw'>def</span> <span class='id identifier rubyid_initialize'>initialize</span>
248
218
  <span class='kw'>self</span><span class='period'>.</span><span class='id identifier rubyid_panels'>panels</span> <span class='op'>=</span> <span class='lbracket'>[</span><span class='rbracket'>]</span>
@@ -254,65 +224,6 @@
254
224
 
255
225
  </div>
256
226
 
257
- <div id="instance_attr_details" class="attr_details">
258
- <h2>Instance Attribute Details</h2>
259
-
260
-
261
- <span id="panels=-instance_method"></span>
262
- <div class="method_details first">
263
- <h3 class="signature first" id="panels-instance_method">
264
-
265
- - (<tt>Array&lt;Hash&gt;</tt>) <strong>panels</strong>
266
-
267
-
268
-
269
-
270
-
271
- </h3><div class="docstring">
272
- <div class="discussion">
273
-
274
-
275
- </div>
276
- </div>
277
- <div class="tags">
278
-
279
- <p class="tag_title">Returns:</p>
280
- <ul class="return">
281
-
282
- <li>
283
-
284
-
285
- <span class='type'>(<tt>Array&lt;Hash&gt;</tt>)</span>
286
-
287
-
288
-
289
- </li>
290
-
291
- </ul>
292
-
293
- </div><table class="source_code">
294
- <tr>
295
- <td>
296
- <pre class="lines">
297
-
298
-
299
- 10
300
- 11
301
- 12</pre>
302
- </td>
303
- <td>
304
- <pre class="code"><span class="info file"># File 'lib/jqr-helpers/helpers.rb', line 10</span>
305
-
306
- <span class='kw'>def</span> <span class='id identifier rubyid_panels'>panels</span>
307
- <span class='ivar'>@panels</span>
308
- <span class='kw'>end</span></pre>
309
- </td>
310
- </tr>
311
- </table>
312
- </div>
313
-
314
- </div>
315
-
316
227
 
317
228
  <div id="instance_method_details" class="method_details_list">
318
229
  <h2>Instance Method Details</h2>
@@ -398,7 +309,6 @@ be passed as is into the HTML &lt;li&gt; tag.</p>
398
309
  <pre class="lines">
399
310
 
400
311
 
401
- 24
402
312
  25
403
313
  26
404
314
  27
@@ -417,10 +327,11 @@ be passed as is into the HTML &lt;li&gt; tag.</p>
417
327
  40
418
328
  41
419
329
  42
420
- 43</pre>
330
+ 43
331
+ 44</pre>
421
332
  </td>
422
333
  <td>
423
- <pre class="code"><span class="info file"># File 'lib/jqr-helpers/helpers.rb', line 24</span>
334
+ <pre class="code"><span class="info file"># File 'lib/jqr-helpers/helpers.rb', line 25</span>
424
335
 
425
336
  <span class='kw'>def</span> <span class='id identifier rubyid_panel'>panel</span><span class='lparen'>(</span><span class='id identifier rubyid_title'>title</span><span class='comma'>,</span> <span class='id identifier rubyid_url_or_options'>url_or_options</span><span class='op'>=</span><span class='lbrace'>{</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='id identifier rubyid_options'>options</span><span class='op'>=</span><span class='lbrace'>{</span><span class='rbrace'>}</span><span class='comma'>,</span> <span class='op'>&amp;</span><span class='id identifier rubyid_block'>block</span><span class='rparen'>)</span>
426
337
  <span class='kw'>if</span> <span class='id identifier rubyid_url_or_options'>url_or_options</span><span class='period'>.</span><span class='id identifier rubyid_is_a?'>is_a?</span><span class='lparen'>(</span><span class='const'>String</span><span class='rparen'>)</span>
@@ -452,9 +363,9 @@ be passed as is into the HTML &lt;li&gt; tag.</p>
452
363
  </div>
453
364
 
454
365
  <div id="footer">
455
- Generated on Thu Jan 30 16:04:14 2014 by
366
+ Generated on Sun Feb 2 15:18:54 2014 by
456
367
  <a href="http://yardoc.org" title="Yay! A Ruby Documentation Tool" target="_parent">yard</a>
457
- 0.8.7.3 (ruby-1.9.3).
368
+ 0.8.5.2 (ruby-1.9.3).
458
369
  </div>
459
370
 
460
371
  </body>