rollout_ui 0.2.0 → 0.2.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. data/lib/rollout_ui/feature.rb +6 -2
  2. data/lib/rollout_ui/version.rb +1 -1
  3. data/spec/dummy/log/test.log +231 -10862
  4. data/spec/lib/rollout_ui/feature_spec.rb +3 -1
  5. metadata +7 -72
  6. data/spec/dummy/log/development.log +0 -15639
  7. data/spec/dummy/log/production.log +0 -19
  8. data/spec/dummy/log/stdout.log +0 -3192
  9. data/spec/dummy/tmp/cache/assets/C44/C60/sprockets%2F32619064c16276c9031bc469f111b6f1 +0 -369
  10. data/spec/dummy/tmp/cache/assets/CA9/290/sprockets%2Ffde33cd38c83e40045112ef236908326 +0 -1012
  11. data/spec/dummy/tmp/cache/assets/CB1/0F0/sprockets%2F097929f05538ada1621d2b34d0748fb8 +0 -0
  12. data/spec/dummy/tmp/cache/assets/D0C/460/sprockets%2Fbf6917215d0871b152f3d3ec4ece0486 +0 -0
  13. data/spec/dummy/tmp/cache/assets/D1E/9E0/sprockets%2Fb92e466db7d4e78f107d8386ea19560a +0 -0
  14. data/spec/dummy/tmp/cache/assets/D22/D60/sprockets%2F6c1d9d3c966b8286c00d8dd46bd54598 +0 -371
  15. data/spec/dummy/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705 +0 -0
  16. data/spec/dummy/tmp/cache/assets/D3E/870/sprockets%2F82e617ed3b33c78bb8340cdbd603d189 +0 -1015
  17. data/spec/dummy/tmp/cache/assets/D45/1B0/sprockets%2F89743b2dcefe650c86e16c60dc248a26 +0 -0
  18. data/spec/dummy/tmp/cache/assets/D54/ED0/sprockets%2F71c9fa01091d432b131da3bb73faf3d4 +0 -0
  19. data/spec/dummy/tmp/cache/assets/D62/900/sprockets%2F4d745068b58dab09efc05fd3bd030c05 +0 -1387
  20. data/spec/dummy/tmp/cache/assets/D71/220/sprockets%2Fd07f8aed535b53034c9a4489bd6cb45d +0 -374
  21. data/spec/dummy/tmp/cache/assets/D74/0C0/sprockets%2F28c2d3c4b8de13fe5b746c94d96042dd +0 -0
  22. data/spec/dummy/tmp/cache/assets/D7D/C20/sprockets%2Ff5f71be7464ea98757bc8e41df514a4b +0 -433
  23. data/spec/dummy/tmp/cache/assets/D84/210/sprockets%2Fabd0103ccec2b428ac62c94e4c40b384 +0 -0
  24. data/spec/dummy/tmp/cache/assets/D93/100/sprockets%2Ffd9e48a89d83e7b764e2de324ee888b6 +0 -917
  25. data/spec/dummy/tmp/cache/assets/DC2/770/sprockets%2F7f10ac108ce75bbb0e9877b50bcb22fe +0 -0
  26. data/spec/dummy/tmp/cache/assets/E00/850/sprockets%2Fd5e1f4415f71da50c8365f7ecdeca2ff +0 -436
  27. data/spec/dummy/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af +0 -0
  28. data/spec/dummy/tmp/cache/assets/E3E/230/sprockets%2F8156dcfebf95ff75b117c7e5bffb71dc +0 -372
  29. data/spec/dummy/tmp/cache/assets/E7A/F10/sprockets%2Ff3d71fbeaa5fdddf600a0ac52af1d8e2 +0 -0
  30. data/spec/dummy/tmp/capybara/capybara-201110152250496494273346.html +0 -141
  31. data/spec/dummy/tmp/capybara/capybara-201110152251237384633452.html +0 -141
  32. data/spec/dummy/tmp/capybara/capybara-201110152253073784924369.html +0 -141
  33. data/spec/dummy/tmp/capybara/capybara-201110152255118447806623.html +0 -141
  34. data/spec/dummy/tmp/capybara/capybara-201110152257286050916603.html +0 -141
  35. data/spec/dummy/tmp/capybara/capybara-201110152258202877532249.html +0 -139
  36. data/spec/dummy/tmp/capybara/capybara-201110152259224345897143.html +0 -139
  37. data/spec/dummy/tmp/pids/server.pid +0 -1
@@ -1,436 +0,0 @@
1
- o: ActiveSupport::Cache::Entry :@expires_in0: @value{"asset_paths["R/web/rollout_ui/lib/rollout_ui/engine/vendor/assets/stylesheets/normalize.css" body"�/*! normalize.css 2011-09-22T17:42 UTC - http://github.com/necolas/normalize.css */
2
-
3
- /* =============================================================================
4
- HTML5 display definitions
5
- ========================================================================== */
6
-
7
- /*
8
- * Corrects block display not defined in IE6/7/8/9 & FF3
9
- */
10
-
11
-
12
- article,
13
- aside,
14
- details,
15
- figcaption,
16
- figure,
17
- footer,
18
- header,
19
- hgroup,
20
- nav,
21
- section {
22
- display: block;
23
- }
24
-
25
- /*
26
- * Corrects inline-block display not defined in IE6/7/8/9 & FF3
27
- */
28
-
29
- audio,
30
- canvas,
31
- video {
32
- display: inline-block;
33
- *display: inline;
34
- *zoom: 1;
35
- }
36
-
37
- /*
38
- * Prevents modern browsers from displaying 'audio' without controls
39
- */
40
-
41
- audio:not([controls]) {
42
- display: none;
43
- }
44
-
45
- /*
46
- * Addresses styling for 'hidden' attribute not present in IE7/8/9, FF3, S4
47
- * Known issue: no IE6 support
48
- */
49
-
50
- [hidden] {
51
- display: none;
52
- }
53
-
54
-
55
- /* =============================================================================
56
- Base
57
- ========================================================================== */
58
-
59
- /*
60
- * 1. Corrects text resizing oddly in IE6/7 when body font-size is set using em units
61
- * http://clagnut.com/blog/348/#c790
62
- * 2. Keeps page centred in all browsers regardless of content height
63
- * 3. Prevents iOS text size adjust after orientation change, without disabling user zoom
64
- * www.456bereastreet.com/archive/201012/controlling_text_size_in_safari_for_ios_without_disabling_user_zoom/
65
- */
66
-
67
- html {
68
- font-size: 100%; /* 1 */
69
- overflow-y: scroll; /* 2 */
70
- -webkit-text-size-adjust: 100%; /* 3 */
71
- -ms-text-size-adjust: 100%; /* 3 */
72
- }
73
-
74
- /*
75
- * Addresses margins handled incorrectly in IE6/7
76
- */
77
-
78
- body {
79
- margin: 0;
80
- }
81
-
82
- /*
83
- * Addresses font-family inconsistency between 'textarea' and other form elements.
84
- */
85
-
86
- body,
87
- button,
88
- input,
89
- select,
90
- textarea {
91
- font-family: sans-serif;
92
- }
93
-
94
-
95
- /* =============================================================================
96
- Links
97
- ========================================================================== */
98
-
99
- a {
100
- color: #00e;
101
- }
102
-
103
- a:visited {
104
- color: #551a8b;
105
- }
106
-
107
- /*
108
- * Addresses outline displayed oddly in Chrome
109
- */
110
-
111
- a:focus {
112
- outline: thin dotted;
113
- }
114
-
115
- /*
116
- * Improves readability when focused and also mouse hovered in all browsers
117
- * people.opera.com/patrickl/experiments/keyboard/test
118
- */
119
-
120
- a:hover,
121
- a:active {
122
- outline: 0;
123
- }
124
-
125
-
126
- /* =============================================================================
127
- Typography
128
- ========================================================================== */
129
-
130
- /*
131
- * Addresses styling not present in IE7/8/9, S5, Chrome
132
- */
133
-
134
- abbr[title] {
135
- border-bottom: 1px dotted;
136
- }
137
-
138
- /*
139
- * Addresses style set to 'bolder' in FF3/4, S4/5, Chrome
140
- */
141
-
142
- b,
143
- strong {
144
- font-weight: bold;
145
- }
146
-
147
- blockquote {
148
- margin: 1em 40px;
149
- }
150
-
151
- /*
152
- * Addresses styling not present in S5, Chrome
153
- */
154
-
155
- dfn {
156
- font-style: italic;
157
- }
158
-
159
- /*
160
- * Addresses styling not present in IE6/7/8/9
161
- */
162
-
163
- mark {
164
- background: #ff0;
165
- color: #000;
166
- }
167
-
168
- /*
169
- * Corrects font family set oddly in IE6, S4/5, Chrome
170
- * en.wikipedia.org/wiki/User:Davidgothberg/Test59
171
- */
172
-
173
- pre,
174
- code,
175
- kbd,
176
- samp {
177
- font-family: monospace, serif;
178
- _font-family: 'courier new', monospace;
179
- font-size: 1em;
180
- }
181
-
182
- /*
183
- * Improves readability of pre-formatted text in all browsers
184
- */
185
-
186
- pre {
187
- white-space: pre;
188
- white-space: pre-wrap;
189
- word-wrap: break-word;
190
- }
191
-
192
- /*
193
- * 1. Addresses CSS quotes not supported in IE6/7
194
- * 2. Addresses quote property not supported in S4
195
- */
196
-
197
- /* 1 */
198
-
199
- q {
200
- quotes: none;
201
- }
202
-
203
- /* 2 */
204
-
205
- q:before,
206
- q:after {
207
- content: '';
208
- content: none;
209
- }
210
-
211
- small {
212
- font-size: 75%;
213
- }
214
-
215
- /*
216
- * Prevents sub and sup affecting line-height in all browsers
217
- * gist.github.com/413930
218
- */
219
-
220
- sub,
221
- sup {
222
- font-size: 75%;
223
- line-height: 0;
224
- position: relative;
225
- vertical-align: baseline;
226
- }
227
-
228
- sup {
229
- top: -0.5em;
230
- }
231
-
232
- sub {
233
- bottom: -0.25em;
234
- }
235
-
236
-
237
- /* =============================================================================
238
- Lists
239
- ========================================================================== */
240
-
241
- ul,
242
- ol {
243
- margin: 1em 0;
244
- padding: 0 0 0 40px;
245
- }
246
-
247
- dd {
248
- margin: 0 0 0 40px;
249
- }
250
-
251
- nav ul,
252
- nav ol {
253
- list-style: none;
254
- list-style-image: none;
255
- }
256
-
257
-
258
- /* =============================================================================
259
- Embedded content
260
- ========================================================================== */
261
-
262
- /*
263
- * 1. Removes border when inside 'a' element in IE6/7/8/9, FF3
264
- * 2. Improves image quality when scaled in IE7
265
- * code.flickr.com/blog/2008/11/12/on-ui-quality-the-little-things-client-side-image-resizing/
266
- */
267
-
268
- img {
269
- border: 0; /* 1 */
270
- -ms-interpolation-mode: bicubic; /* 2 */
271
- }
272
-
273
- /*
274
- * Corrects overflow displayed oddly in IE9
275
- */
276
-
277
- svg:not(:root) {
278
- overflow: hidden;
279
- }
280
-
281
-
282
- /* =============================================================================
283
- Figures
284
- ========================================================================== */
285
-
286
- /*
287
- * Addresses margin not present in IE6/7/8/9, S5, O11
288
- */
289
-
290
- figure {
291
- margin: 0;
292
- }
293
-
294
-
295
- /* =============================================================================
296
- Forms
297
- ========================================================================== */
298
-
299
- /*
300
- * Corrects margin displayed oddly in IE6/7
301
- */
302
-
303
- form {
304
- margin: 0;
305
- }
306
-
307
- /*
308
- * Define consistent border, margin, and padding
309
- */
310
-
311
- fieldset {
312
- border: 1px solid #c0c0c0;
313
- margin: 0 2px;
314
- padding: 0.35em 0.625em 0.75em;
315
- }
316
-
317
- /*
318
- * 1. Corrects color not being inherited in IE6/7/8/9
319
- * 2. Corrects alignment displayed oddly in IE6/7
320
- */
321
-
322
- legend {
323
- border: 0; /* 1 */
324
- *margin-left: -7px; /* 2 */
325
- }
326
-
327
- /*
328
- * 1. Corrects font size not being inherited in all browsers
329
- * 2. Addresses margins set differently in IE6/7, FF3/4, S5, Chrome
330
- * 3. Improves appearance and consistency in all browsers
331
- */
332
-
333
- button,
334
- input,
335
- select,
336
- textarea {
337
- font-size: 100%; /* 1 */
338
- margin: 0; /* 2 */
339
- vertical-align: baseline; /* 3 */
340
- *vertical-align: middle; /* 3 */
341
- }
342
-
343
- /*
344
- * Addresses FF3/4 setting line-height on 'input' using !important in the UA stylesheet
345
- */
346
-
347
- button,
348
- input {
349
- line-height: normal; /* 1 */
350
- }
351
-
352
- /*
353
- * 1. Improves usability and consistency of cursor style between image-type 'input' and others
354
- * 2. Corrects inability to style clickable 'input' types in iOS
355
- * 3. Corrects inner spacing displayed oddly in IE7 without effecting normal text inputs
356
- * Known issue: inner spacing remains in IE6
357
- */
358
-
359
- button,
360
- input[type="button"],
361
- input[type="reset"],
362
- input[type="submit"] {
363
- cursor: pointer; /* 1 */
364
- -webkit-appearance: button; /* 2 */
365
- *overflow: visible; /* 3 */
366
- }
367
-
368
- /*
369
- * 1. Addresses box sizing set to content-box in IE8/9
370
- * 2. Addresses excess padding in IE8/9
371
- */
372
-
373
- input[type="checkbox"],
374
- input[type="radio"] {
375
- box-sizing: border-box; /* 1 */
376
- padding: 0; /* 2 */
377
- }
378
-
379
- /*
380
- * 1. Addresses appearance set to searchfield in S5, Chrome
381
- * 2. Addresses box sizing set to border-box in S5, Chrome (include -moz to future-proof)
382
- */
383
-
384
- input[type="search"] {
385
- -webkit-appearance: textfield; /* 1 */
386
- -moz-box-sizing: content-box;
387
- -webkit-box-sizing: content-box; /* 2 */
388
- box-sizing: content-box;
389
- }
390
-
391
- /*
392
- * Corrects inner padding displayed oddly in S5, Chrome on OSX
393
- */
394
-
395
- input[type="search"]::-webkit-search-decoration {
396
- -webkit-appearance: none;
397
- }
398
-
399
- /*
400
- * Corrects inner padding and border displayed oddly in FF3/4
401
- * www.sitepen.com/blog/2008/05/14/the-devils-in-the-details-fixing-dojos-toolbar-buttons/
402
- */
403
-
404
- button::-moz-focus-inner,
405
- input::-moz-focus-inner {
406
- border: 0;
407
- padding: 0;
408
- }
409
-
410
- /*
411
- * 1. Removes default vertical scrollbar in IE6/7/8/9
412
- * 2. Improves readability and alignment in all browsers
413
- */
414
-
415
- textarea {
416
- overflow: auto; /* 1 */
417
- vertical-align: top; /* 2 */
418
- }
419
-
420
-
421
- /* =============================================================================
422
- Tables
423
- ========================================================================== */
424
-
425
- /*
426
- * Remove most spacing between table cells
427
- */
428
-
429
- table {
430
- border-collapse: collapse;
431
- border-spacing: 0;
432
- }
433
- "content_type"
434
- class"BundledAsset"
435
- mtime"2011-10-16T17:16:37-04:00"
436
- mtimeu: Time
@@ -1,372 +0,0 @@
1
- o: ActiveSupport::Cache::Entry :@expires_in0: @value{"asset_paths["R/web/rollout_ui/lib/rollout_ui/engine/vendor/assets/javascripts/jquery-ujs.js" body";/**
2
- * Unobtrusive scripting adapter for jQuery
3
- *
4
- * Requires jQuery 1.6.0 or later.
5
- * https://github.com/rails/jquery-ujs
6
-
7
- * Uploading file using rails.js
8
- * =============================
9
- *
10
- * By default, browsers do not allow files to be uploaded via AJAX. As a result, if there are any non-blank file fields
11
- * in the remote form, this adapter aborts the AJAX submission and allows the form to submit through standard means.
12
- *
13
- * The `ajax:aborted:file` event allows you to bind your own handler to process the form submission however you wish.
14
- *
15
- * Ex:
16
- * $('form').live('ajax:aborted:file', function(event, elements){
17
- * // Implement own remote file-transfer handler here for non-blank file inputs passed in `elements`.
18
- * // Returning false in this handler tells rails.js to disallow standard form submission
19
- * return false;
20
- * });
21
- *
22
- * The `ajax:aborted:file` event is fired when a file-type input is detected with a non-blank value.
23
- *
24
- * Third-party tools can use this hook to detect when an AJAX file upload is attempted, and then use
25
- * techniques like the iframe method to upload the file instead.
26
- *
27
- * Required fields in rails.js
28
- * ===========================
29
- *
30
- * If any blank required inputs (required="required") are detected in the remote form, the whole form submission
31
- * is canceled. Note that this is unlike file inputs, which still allow standard (non-AJAX) form submission.
32
- *
33
- * The `ajax:aborted:required` event allows you to bind your own handler to inform the user of blank required inputs.
34
- *
35
- * !! Note that Opera does not fire the form's submit event if there are blank required inputs, so this event may never
36
- * get fired in Opera. This event is what causes other browsers to exhibit the same submit-aborting behavior.
37
- *
38
- * Ex:
39
- * $('form').live('ajax:aborted:required', function(event, elements){
40
- * // Returning false in this handler tells rails.js to submit the form anyway.
41
- * // The blank required inputs are passed to this function in `elements`.
42
- * return ! confirm("Would you like to submit the form with missing info?");
43
- * });
44
- */
45
-
46
-
47
- (function($, undefined) {
48
- // Shorthand to make it a little easier to call public rails functions from within rails.js
49
- var rails;
50
-
51
- $.rails = rails = {
52
- // Link elements bound by jquery-ujs
53
- linkClickSelector: 'a[data-confirm], a[data-method], a[data-remote], a[data-disable-with]',
54
-
55
- // Select elements bound by jquery-ujs
56
- inputChangeSelector: 'select[data-remote], input[data-remote], textarea[data-remote]',
57
-
58
- // Form elements bound by jquery-ujs
59
- formSubmitSelector: 'form',
60
-
61
- // Form input elements bound by jquery-ujs
62
- formInputClickSelector: 'form input[type=submit], form input[type=image], form button[type=submit], form button:not(button[type])',
63
-
64
- // Form input elements disabled during form submission
65
- disableSelector: 'input[data-disable-with], button[data-disable-with], textarea[data-disable-with]',
66
-
67
- // Form input elements re-enabled after form submission
68
- enableSelector: 'input[data-disable-with]:disabled, button[data-disable-with]:disabled, textarea[data-disable-with]:disabled',
69
-
70
- // Form required input elements
71
- requiredInputSelector: 'input[name][required]:not([disabled]),textarea[name][required]:not([disabled])',
72
-
73
- // Form file input elements
74
- fileInputSelector: 'input:file',
75
-
76
- // Link onClick disable selector with possible reenable after remote submission
77
- linkDisableSelector: 'a[data-disable-with]',
78
-
79
- // Make sure that every Ajax request sends the CSRF token
80
- CSRFProtection: function(xhr) {
81
- var token = $('meta[name="csrf-token"]').attr('content');
82
- if (token) xhr.setRequestHeader('X-CSRF-Token', token);
83
- },
84
-
85
- // Triggers an event on an element and returns false if the event result is false
86
- fire: function(obj, name, data) {
87
- var event = $.Event(name);
88
- obj.trigger(event, data);
89
- return event.result !== false;
90
- },
91
-
92
- // Default confirm dialog, may be overridden with custom confirm dialog in $.rails.confirm
93
- confirm: function(message) {
94
- return confirm(message);
95
- },
96
-
97
- // Default ajax function, may be overridden with custom function in $.rails.ajax
98
- ajax: function(options) {
99
- return $.ajax(options);
100
- },
101
-
102
- // Submits "remote" forms and links with ajax
103
- handleRemote: function(element) {
104
- var method, url, data,
105
- crossDomain = element.data('cross-domain') || null,
106
- dataType = element.data('type') || ($.ajaxSettings && $.ajaxSettings.dataType),
107
- options;
108
-
109
- if (rails.fire(element, 'ajax:before')) {
110
-
111
- if (element.is('form')) {
112
- method = element.attr('method');
113
- url = element.attr('action');
114
- data = element.serializeArray();
115
- // memoized value from clicked submit button
116
- var button = element.data('ujs:submit-button');
117
- if (button) {
118
- data.push(button);
119
- element.data('ujs:submit-button', null);
120
- }
121
- } else if (element.is(rails.inputChangeSelector)) {
122
- method = element.data('method');
123
- url = element.data('url');
124
- data = element.serialize();
125
- if (element.data('params')) data = data + "&" + element.data('params');
126
- } else {
127
- method = element.data('method');
128
- url = element.attr('href');
129
- data = element.data('params') || null;
130
- }
131
-
132
- options = {
133
- type: method || 'GET', data: data, dataType: dataType, crossDomain: crossDomain,
134
- // stopping the "ajax:beforeSend" event will cancel the ajax request
135
- beforeSend: function(xhr, settings) {
136
- if (settings.dataType === undefined) {
137
- xhr.setRequestHeader('accept', '*/*;q=0.5, ' + settings.accepts.script);
138
- }
139
- return rails.fire(element, 'ajax:beforeSend', [xhr, settings]);
140
- },
141
- success: function(data, status, xhr) {
142
- element.trigger('ajax:success', [data, status, xhr]);
143
- },
144
- complete: function(xhr, status) {
145
- element.trigger('ajax:complete', [xhr, status]);
146
- },
147
- error: function(xhr, status, error) {
148
- element.trigger('ajax:error', [xhr, status, error]);
149
- }
150
- };
151
- // Only pass url to `ajax` options if not blank
152
- if (url) { options.url = url; }
153
-
154
- rails.ajax(options);
155
- }
156
- },
157
-
158
- // Handles "data-method" on links such as:
159
- // <a href="/users/5" data-method="delete" rel="nofollow" data-confirm="Are you sure?">Delete</a>
160
- handleMethod: function(link) {
161
- var href = link.attr('href'),
162
- method = link.data('method'),
163
- target = link.attr('target'),
164
- csrf_token = $('meta[name=csrf-token]').attr('content'),
165
- csrf_param = $('meta[name=csrf-param]').attr('content'),
166
- form = $('<form method="post" action="' + href + '"></form>'),
167
- metadata_input = '<input name="_method" value="' + method + '" type="hidden" />';
168
-
169
- if (csrf_param !== undefined && csrf_token !== undefined) {
170
- metadata_input += '<input name="' + csrf_param + '" value="' + csrf_token + '" type="hidden" />';
171
- }
172
-
173
- if (target) { form.attr('target', target); }
174
-
175
- form.hide().append(metadata_input).appendTo('body');
176
- form.submit();
177
- },
178
-
179
- /* Disables form elements:
180
- - Caches element value in 'ujs:enable-with' data store
181
- - Replaces element text with value of 'data-disable-with' attribute
182
- - Sets disabled property to true
183
- */
184
- disableFormElements: function(form) {
185
- form.find(rails.disableSelector).each(function() {
186
- var element = $(this), method = element.is('button') ? 'html' : 'val';
187
- element.data('ujs:enable-with', element[method]());
188
- element[method](element.data('disable-with'));
189
- element.prop('disabled', true);
190
- });
191
- },
192
-
193
- /* Re-enables disabled form elements:
194
- - Replaces element text with cached value from 'ujs:enable-with' data store (created in `disableFormElements`)
195
- - Sets disabled property to false
196
- */
197
- enableFormElements: function(form) {
198
- form.find(rails.enableSelector).each(function() {
199
- var element = $(this), method = element.is('button') ? 'html' : 'val';
200
- if (element.data('ujs:enable-with')) element[method](element.data('ujs:enable-with'));
201
- element.prop('disabled', false);
202
- });
203
- },
204
-
205
- /* For 'data-confirm' attribute:
206
- - Fires `confirm` event
207
- - Shows the confirmation dialog
208
- - Fires the `confirm:complete` event
209
-
210
- Returns `true` if no function stops the chain and user chose yes; `false` otherwise.
211
- Attaching a handler to the element's `confirm` event that returns a `falsy` value cancels the confirmation dialog.
212
- Attaching a handler to the element's `confirm:complete` event that returns a `falsy` value makes this function
213
- return false. The `confirm:complete` event is fired whether or not the user answered true or false to the dialog.
214
- */
215
- allowAction: function(element) {
216
- var message = element.data('confirm'),
217
- answer = false, callback;
218
- if (!message) { return true; }
219
-
220
- if (rails.fire(element, 'confirm')) {
221
- answer = rails.confirm(message);
222
- callback = rails.fire(element, 'confirm:complete', [answer]);
223
- }
224
- return answer && callback;
225
- },
226
-
227
- // Helper function which checks for blank inputs in a form that match the specified CSS selector
228
- blankInputs: function(form, specifiedSelector, nonBlank) {
229
- var inputs = $(), input,
230
- selector = specifiedSelector || 'input,textarea';
231
- form.find(selector).each(function() {
232
- input = $(this);
233
- // Collect non-blank inputs if nonBlank option is true, otherwise, collect blank inputs
234
- if (nonBlank ? input.val() : !input.val()) {
235
- inputs = inputs.add(input);
236
- }
237
- });
238
- return inputs.length ? inputs : false;
239
- },
240
-
241
- // Helper function which checks for non-blank inputs in a form that match the specified CSS selector
242
- nonBlankInputs: function(form, specifiedSelector) {
243
- return rails.blankInputs(form, specifiedSelector, true); // true specifies nonBlank
244
- },
245
-
246
- // Helper function, needed to provide consistent behavior in IE
247
- stopEverything: function(e) {
248
- $(e.target).trigger('ujs:everythingStopped');
249
- e.stopImmediatePropagation();
250
- return false;
251
- },
252
-
253
- // find all the submit events directly bound to the form and
254
- // manually invoke them. If anyone returns false then stop the loop
255
- callFormSubmitBindings: function(form) {
256
- var events = form.data('events'), continuePropagation = true;
257
- if (events !== undefined && events['submit'] !== undefined) {
258
- $.each(events['submit'], function(i, obj){
259
- if (typeof obj.handler === 'function') return continuePropagation = obj.handler(obj.data);
260
- });
261
- }
262
- return continuePropagation;
263
- },
264
-
265
- // replace element's html with the 'data-disable-with' after storing original html
266
- // and prevent clicking on it
267
- disableElement: function(element) {
268
- element.data('ujs:enable-with', element.html()); // store enabled state
269
- element.html(element.data('disable-with')); // set to disabled state
270
- element.bind('click.railsDisable', function(e) { // prevent further clicking
271
- return rails.stopEverything(e)
272
- });
273
- },
274
-
275
- // restore element to its original state which was disabled by 'disableElement' above
276
- enableElement: function(element) {
277
- if (element.data('ujs:enable-with') !== undefined) {
278
- element.html(element.data('ujs:enable-with')); // set to old enabled state
279
- // this should be element.removeData('ujs:enable-with')
280
- // but, there is currently a bug in jquery which makes hyphenated data attributes not get removed
281
- element.data('ujs:enable-with', false); // clean up cache
282
- }
283
- element.unbind('click.railsDisable'); // enable element
284
- }
285
-
286
- };
287
-
288
- $.ajaxPrefilter(function(options, originalOptions, xhr){ if ( !options.crossDomain ) { rails.CSRFProtection(xhr); }});
289
-
290
- $(rails.linkDisableSelector).live('ajax:complete', function() {
291
- rails.enableElement($(this));
292
- });
293
-
294
- $(rails.linkClickSelector).live('click.rails', function(e) {
295
- var link = $(this), method = link.data('method'), data = link.data('params');
296
- if (!rails.allowAction(link)) return rails.stopEverything(e);
297
-
298
- if (link.is(rails.linkDisableSelector)) rails.disableElement(link);
299
-
300
- if (link.data('remote') !== undefined) {
301
- if ( (e.metaKey || e.ctrlKey) && (!method || method === 'GET') && !data ) { return true; }
302
- rails.handleRemote(link);
303
- return false;
304
- } else if (link.data('method')) {
305
- rails.handleMethod(link);
306
- return false;
307
- }
308
- });
309
-
310
- $(rails.inputChangeSelector).live('change.rails', function(e) {
311
- var link = $(this);
312
- if (!rails.allowAction(link)) return rails.stopEverything(e);
313
-
314
- rails.handleRemote(link);
315
- return false;
316
- });
317
-
318
- $(rails.formSubmitSelector).live('submit.rails', function(e) {
319
- var form = $(this),
320
- remote = form.data('remote') !== undefined,
321
- blankRequiredInputs = rails.blankInputs(form, rails.requiredInputSelector),
322
- nonBlankFileInputs = rails.nonBlankInputs(form, rails.fileInputSelector);
323
-
324
- if (!rails.allowAction(form)) return rails.stopEverything(e);
325
-
326
- // skip other logic when required values are missing or file upload is present
327
- if (blankRequiredInputs && form.attr("novalidate") == undefined && rails.fire(form, 'ajax:aborted:required', [blankRequiredInputs])) {
328
- return rails.stopEverything(e);
329
- }
330
-
331
- if (remote) {
332
- if (nonBlankFileInputs) {
333
- return rails.fire(form, 'ajax:aborted:file', [nonBlankFileInputs]);
334
- }
335
-
336
- // If browser does not support submit bubbling, then this live-binding will be called before direct
337
- // bindings. Therefore, we should directly call any direct bindings before remotely submitting form.
338
- if (!$.support.submitBubbles && rails.callFormSubmitBindings(form) === false) return rails.stopEverything(e);
339
-
340
- rails.handleRemote(form);
341
- return false;
342
- } else {
343
- // slight timeout so that the submit button gets properly serialized
344
- setTimeout(function(){ rails.disableFormElements(form); }, 13);
345
- }
346
- });
347
-
348
- $(rails.formInputClickSelector).live('click.rails', function(event) {
349
- var button = $(this);
350
-
351
- if (!rails.allowAction(button)) return rails.stopEverything(event);
352
-
353
- // register the pressed submit button
354
- var name = button.attr('name'),
355
- data = name ? {name:name, value:button.val()} : null;
356
-
357
- button.closest('form').data('ujs:submit-button', data);
358
- });
359
-
360
- $(rails.formSubmitSelector).live('ajax:beforeSend.rails', function(event) {
361
- if (this == event.target) rails.disableFormElements($(this));
362
- });
363
-
364
- $(rails.formSubmitSelector).live('ajax:complete.rails', function(event) {
365
- if (this == event.target) rails.enableFormElements($(this));
366
- });
367
-
368
- })( jQuery );
369
- "content_type"application/javascript"
370
- class"BundledAsset"
371
- mtime"2011-10-16T17:29:03-04:00"
372
- mtimeu: Time