kaui 0.1.16 → 0.1.17

Sign up to get free protection for your applications and to get access to all the features.
Files changed (54) hide show
  1. data/app/controllers/kaui/refunds_controller.rb +0 -1
  2. data/app/views/kaui/refunds/new.html.erb +0 -10
  3. data/lib/kaui/version.rb +1 -1
  4. data/test/dummy/kaui_xna.sh +3 -0
  5. data/test/dummy/log/development.log +10 -98790
  6. data/test/dummy/log/test.log +19082 -123895
  7. data/test/dummy/tmp/cache/assets/C94/4E0/sprockets%2Fea1476dc10a3348303f74d111f70441a +0 -0
  8. data/test/dummy/tmp/cache/assets/{D07/DA0/sprockets%2Ffaad9b18203975dbf0c60f3234a51874 → C97/AF0/sprockets%2F26f7a8493d749271945a322974eee4e5} +0 -0
  9. data/test/dummy/tmp/cache/assets/{C8D/080/sprockets%2F4556c595251e3b8d4f688467e330da26 → C9C/870/sprockets%2F0402b03b507fa5960706b72da0d690f6} +0 -0
  10. data/test/dummy/tmp/cache/assets/CD0/9D0/sprockets%2F5c9508c21501c73fbe00473a09b1f5f4 +0 -0
  11. data/test/dummy/tmp/cache/assets/CD6/8E0/sprockets%2Fda1d0827029118e54fe463a0c0ff1568 +0 -0
  12. data/test/dummy/tmp/cache/assets/CD8/370/sprockets%2F357970feca3ac29060c1e3861e2c0953 +0 -0
  13. data/test/dummy/tmp/cache/assets/CEA/300/sprockets%2Fdf2ad5c9d0990441c2bf59883383d652 +0 -0
  14. data/test/dummy/tmp/cache/assets/{C95/690/sprockets%2Fc4b083702793f7599f4a3069c50f89a8 → D27/040/sprockets%2F94720e86301d9fdc78e0c291ce997fe5} +0 -0
  15. data/test/dummy/tmp/cache/assets/{E10/BE0/sprockets%2F9c06f8f8da4e736ccf6de8360cd39bfa → D29/500/sprockets%2F8ca0512b5c1a8cedb3ea5009152976b0} +0 -0
  16. data/test/dummy/tmp/cache/assets/D32/200/sprockets%2Ffa467106e01bda5d6246baea72159d64 +0 -0
  17. data/test/dummy/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705 +0 -0
  18. data/test/dummy/tmp/cache/assets/{CF7/710/sprockets%2F86d43448e1fc383cb6f3d752ef288882 → D38/920/sprockets%2F1c247930427b0d25cdf6e18b8ace607d} +0 -0
  19. data/test/dummy/tmp/cache/assets/D39/5E0/sprockets%2F59fd338be48a81a17a2a785cbd1612b4 +0 -0
  20. data/test/dummy/tmp/cache/assets/D44/170/sprockets%2Fac15571bce3f926a498da7cd09322d97 +0 -0
  21. data/test/dummy/tmp/cache/assets/{CAA/680/sprockets%2F3824d037523f650518fb22acab75559d → D46/610/sprockets%2F570cb35b90cf9cfd735673ebfb149326} +0 -0
  22. data/test/dummy/tmp/cache/assets/D4E/1B0/sprockets%2Ff7cbd26ba1d28d48de824f0e94586655 +0 -0
  23. data/test/dummy/tmp/cache/assets/D5A/EA0/sprockets%2Fd771ace226fc8215a3572e0aa35bb0d6 +0 -0
  24. data/test/dummy/tmp/cache/assets/D6C/710/sprockets%2F1765773caead06c0a6a19ea9de2453f7 +0 -0
  25. data/test/dummy/tmp/cache/assets/{CE0/8A0/sprockets%2Fc18dc7330236e7db17d280973d617b9a → D76/190/sprockets%2F477d2af6fe05c48f45ea721df3334be9} +0 -0
  26. data/test/dummy/tmp/cache/assets/D76/910/sprockets%2Ff99b4bdc434e11e8634e6af62fe805e0 +0 -0
  27. data/test/dummy/tmp/cache/assets/{DDF/650/sprockets%2Fbe16f0bf3d2b7af18010acbd53ba22f5 → D99/170/sprockets%2Fedd15cb243afc9888e2ae132be19d270} +0 -0
  28. data/test/dummy/tmp/cache/assets/D9F/{160/sprockets%2F510462e1ebd5dbb7ae20888b77f9bed2 → 550/sprockets%2Ff62dc25db0a8b19d619890ef1b94ea0f} +0 -0
  29. data/test/dummy/tmp/cache/assets/{CC2/520/sprockets%2F9637f46d37325381f96d96d94ae0bc50 → DBC/150/sprockets%2Fca62a9ed25e5faa10eb00524dcf72f09} +0 -0
  30. data/test/dummy/tmp/cache/assets/{CFF/A00/sprockets%2F642f58fb154eff788f45c881b294e818 → DCC/380/sprockets%2F5155cbf5f547ab9dfd05ad7f243b9da0} +0 -0
  31. data/test/dummy/tmp/cache/assets/DDC/400/sprockets%2Fcffd775d018f68ce5dba1ee0d951a994 +0 -0
  32. data/test/dummy/tmp/cache/assets/{E22/F40/sprockets%2Faffacf2e6be325520bd3bfd2096b6dd4 → DEA/1E0/sprockets%2Fcceef1ff985f87dc5a3a279337f18d8e} +0 -0
  33. data/test/dummy/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af +0 -0
  34. data/test/dummy/tmp/cache/assets/E20/230/sprockets%2F7d3b1348fdf74cf1b6ba2107fbbac5af +0 -0
  35. data/test/dummy/tmp/cache/assets/E23/0C0/sprockets%2F6fea9cc1fe74102feb0015cecf63b5fb +0 -0
  36. metadata +382 -412
  37. data/app/controllers/kaui/tags_controller.rb +0 -85
  38. data/app/views/kaui/account_emails/edit.html.erb +0 -6
  39. data/app/views/kaui/analytics/payments_over_time.html.erb +0 -9
  40. data/app/views/kaui/tags/_form.html.erb +0 -25
  41. data/app/views/kaui/tags/edit.html.erb +0 -6
  42. data/app/views/kaui/tags/index.html.erb +0 -25
  43. data/app/views/kaui/tags/new.html.erb +0 -5
  44. data/app/views/kaui/tags/show.html.erb +0 -15
  45. data/test/dummy/tmp/cache/assets/CDF/1F0/sprockets%2F76ac5628a0c4d1b976cb622ec4493751 +0 -381
  46. data/test/dummy/tmp/cache/assets/CEC/5B0/sprockets%2F1695e8510891108e3950e2a3e4fdf9df +0 -0
  47. data/test/dummy/tmp/cache/assets/D04/1D0/sprockets%2F3baf64d90ead2434455d2296227ba8a2 +0 -7038
  48. data/test/dummy/tmp/cache/assets/D05/510/sprockets%2F1c14866e2401c27b0ff5e33d1b92c4e8 +0 -0
  49. data/test/dummy/tmp/cache/assets/D17/DD0/sprockets%2F665455ecdc7609b23f4ecb366d86055a +0 -9409
  50. data/test/dummy/tmp/cache/assets/D79/1E0/sprockets%2F97b08ebe07a73d8195ba124ffb45f98b +0 -7038
  51. data/test/dummy/tmp/cache/assets/E07/1E0/sprockets%2F5a3fe6e98fdf72bbe75c605e54ebc5b0 +0 -9409
  52. data/test/dummy/tmp/cache/assets/E24/9D0/sprockets%2Fb966ab0a50fda3c156fbad4d8ab73ef6 +0 -381
  53. data/test/functional/kaui/account_emails_controller_test.rb +0 -51
  54. data/test/functional/kaui/tags_controller_test.rb +0 -51
@@ -1,85 +0,0 @@
1
- module Kaui
2
- class TagsController < ApplicationController
3
- # GET /tags
4
- # GET /tags.json
5
- def index
6
- @tags = Tag.all
7
-
8
- respond_to do |format|
9
- format.html # index.html.erb
10
- format.json { render :json => @tags }
11
- end
12
- end
13
-
14
- # GET /tags/1
15
- # GET /tags/1.json
16
- def show
17
- @tag = Tag.find(params[:id])
18
-
19
- respond_to do |format|
20
- format.html # show.html.erb
21
- format.json { render :json => @tag }
22
- end
23
- end
24
-
25
- # GET /tags/new
26
- # GET /tags/new.json
27
- def new
28
- @tag = Tag.new
29
-
30
- respond_to do |format|
31
- format.html # new.html.erb
32
- format.json { render :json => @tag }
33
- end
34
- end
35
-
36
- # GET /tags/1/edit
37
- def edit
38
- @tag = Tag.find(params[:id])
39
- end
40
-
41
- # POST /tags
42
- # POST /tags.json
43
- def create
44
- @tag = Tag.new(params[:tag])
45
-
46
- respond_to do |format|
47
- if @tag.save
48
- format.html { redirect_to @tag, :notice => 'Tag was successfully created.' }
49
- format.json { render :json => @tag, :status => :created, :location => @tag }
50
- else
51
- format.html { render :action => "new" }
52
- format.json { render :json => @tag.errors, :status => :unprocessable_entity }
53
- end
54
- end
55
- end
56
-
57
- # PUT /tags/1
58
- # PUT /tags/1.json
59
- def update
60
- @tag = Tag.find(params[:id])
61
-
62
- respond_to do |format|
63
- if @tag.update_attributes(params[:tag])
64
- format.html { redirect_to @tag, :notice => 'Tag was successfully updated.' }
65
- format.json { head :no_content }
66
- else
67
- format.html { render :action => "edit" }
68
- format.json { render :json => @tag.errors, :status => :unprocessable_entity }
69
- end
70
- end
71
- end
72
-
73
- # DELETE /tags/1
74
- # DELETE /tags/1.json
75
- def destroy
76
- @tag = Tag.find(params[:id])
77
- @tag.destroy
78
-
79
- respond_to do |format|
80
- format.html { redirect_to tags_url }
81
- format.json { head :no_content }
82
- end
83
- end
84
- end
85
- end
@@ -1,6 +0,0 @@
1
- <h1>Editing account_email</h1>
2
-
3
- <%= render 'form' %>
4
-
5
- <%= link_to 'Show', @account_email %> |
6
- <%= link_to 'Back', kaui_engine.account_emails_path %>
@@ -1,9 +0,0 @@
1
- <h2>Number of payments created over time</h2>
2
-
3
- <div id="chart"></div>
4
-
5
- <%= javascript_tag do %>
6
- $(document).ready(function() {
7
- drawGraph(<%=raw @payments.dates.to_json %>, <%=raw @payments.values.to_json %>, "chart");
8
- });
9
- <% end %>
@@ -1,25 +0,0 @@
1
- <%= form_for(@tag) do |f| %>
2
- <% if @tag.errors.any? %>
3
- <div id="error_explanation">
4
- <h2><%= pluralize(@tag.errors.count, "error") %> prohibited this tag from being saved:</h2>
5
-
6
- <ul>
7
- <% @tag.errors.full_messages.each do |msg| %>
8
- <li><%= msg %></li>
9
- <% end %>
10
- </ul>
11
- </div>
12
- <% end %>
13
-
14
- <div class="field">
15
- <%= f.label :tagDefinitionId %><br />
16
- <%= f.text_field :tagDefinitionId %>
17
- </div>
18
- <div class="field">
19
- <%= f.label :tagDefinitionName %><br />
20
- <%= f.text_field :tagDefinitionName %>
21
- </div>
22
- <div class="actions">
23
- <%= f.submit %>
24
- </div>
25
- <% end %>
@@ -1,6 +0,0 @@
1
- <h1>Editing tag</h1>
2
-
3
- <%= render 'form' %>
4
-
5
- <%= link_to 'Show', @tag %> |
6
- <%= link_to 'Back', tags_path %>
@@ -1,25 +0,0 @@
1
- <h1>Listing tags</h1>
2
-
3
- <table>
4
- <tr>
5
- <th>Tagdefinitionid</th>
6
- <th>Tagdefinitionname</th>
7
- <th></th>
8
- <th></th>
9
- <th></th>
10
- </tr>
11
-
12
- <% @tags.each do |tag| %>
13
- <tr>
14
- <td><%= tag.tagDefinitionId %></td>
15
- <td><%= tag.tagDefinitionName %></td>
16
- <td><%= link_to 'Show', tag %></td>
17
- <td><%= link_to 'Edit', edit_tag_path(tag) %></td>
18
- <td><%= link_to 'Destroy', tag, confirm: 'Are you sure?', method: :delete %></td>
19
- </tr>
20
- <% end %>
21
- </table>
22
-
23
- <br />
24
-
25
- <%= link_to 'New Tag', new_tag_path %>
@@ -1,5 +0,0 @@
1
- <h1>New tag</h1>
2
-
3
- <%= render 'form' %>
4
-
5
- <%= link_to 'Back', tags_path %>
@@ -1,15 +0,0 @@
1
- <p id="notice"><%= notice %></p>
2
-
3
- <p>
4
- <b>Tagdefinitionid:</b>
5
- <%= @tag.tagDefinitionId %>
6
- </p>
7
-
8
- <p>
9
- <b>Tagdefinitionname:</b>
10
- <%= @tag.tagDefinitionName %>
11
- </p>
12
-
13
-
14
- <%= link_to 'Edit', edit_tag_path(@tag) %> |
15
- <%= link_to 'Back', tags_path %>
@@ -1,381 +0,0 @@
1
- o: ActiveSupport::Cache::Entry :@compressedF:@created_atf1345257322.281:@expires_in0: @value"i?{"
2
- class"ProcessedAsset"logical_path"jquery_ujs.js"
3
- mtime"2012-08-14T09:37:41-07:00" lengthi�<" digest"%0ff3e5680ead3dadeee021c144835311" source"�<(function($, undefined) {
4
-
5
- /**
6
- * Unobtrusive scripting adapter for jQuery
7
- *
8
- * Requires jQuery 1.6.0 or later.
9
- * https://github.com/rails/jquery-ujs
10
-
11
- * Uploading file using rails.js
12
- * =============================
13
- *
14
- * By default, browsers do not allow files to be uploaded via AJAX. As a result, if there are any non-blank file fields
15
- * in the remote form, this adapter aborts the AJAX submission and allows the form to submit through standard means.
16
- *
17
- * The `ajax:aborted:file` event allows you to bind your own handler to process the form submission however you wish.
18
- *
19
- * Ex:
20
- * $('form').live('ajax:aborted:file', function(event, elements){
21
- * // Implement own remote file-transfer handler here for non-blank file inputs passed in `elements`.
22
- * // Returning false in this handler tells rails.js to disallow standard form submission
23
- * return false;
24
- * });
25
- *
26
- * The `ajax:aborted:file` event is fired when a file-type input is detected with a non-blank value.
27
- *
28
- * Third-party tools can use this hook to detect when an AJAX file upload is attempted, and then use
29
- * techniques like the iframe method to upload the file instead.
30
- *
31
- * Required fields in rails.js
32
- * ===========================
33
- *
34
- * If any blank required inputs (required="required") are detected in the remote form, the whole form submission
35
- * is canceled. Note that this is unlike file inputs, which still allow standard (non-AJAX) form submission.
36
- *
37
- * The `ajax:aborted:required` event allows you to bind your own handler to inform the user of blank required inputs.
38
- *
39
- * !! Note that Opera does not fire the form's submit event if there are blank required inputs, so this event may never
40
- * get fired in Opera. This event is what causes other browsers to exhibit the same submit-aborting behavior.
41
- *
42
- * Ex:
43
- * $('form').live('ajax:aborted:required', function(event, elements){
44
- * // Returning false in this handler tells rails.js to submit the form anyway.
45
- * // The blank required inputs are passed to this function in `elements`.
46
- * return ! confirm("Would you like to submit the form with missing info?");
47
- * });
48
- */
49
-
50
- // Shorthand to make it a little easier to call public rails functions from within rails.js
51
- var rails;
52
-
53
- $.rails = rails = {
54
- // Link elements bound by jquery-ujs
55
- linkClickSelector: 'a[data-confirm], a[data-method], a[data-remote], a[data-disable-with]',
56
-
57
- // Select elements bound by jquery-ujs
58
- inputChangeSelector: 'select[data-remote], input[data-remote], textarea[data-remote]',
59
-
60
- // Form elements bound by jquery-ujs
61
- formSubmitSelector: 'form',
62
-
63
- // Form input elements bound by jquery-ujs
64
- formInputClickSelector: 'form input[type=submit], form input[type=image], form button[type=submit], form button:not(button[type])',
65
-
66
- // Form input elements disabled during form submission
67
- disableSelector: 'input[data-disable-with], button[data-disable-with], textarea[data-disable-with]',
68
-
69
- // Form input elements re-enabled after form submission
70
- enableSelector: 'input[data-disable-with]:disabled, button[data-disable-with]:disabled, textarea[data-disable-with]:disabled',
71
-
72
- // Form required input elements
73
- requiredInputSelector: 'input[name][required]:not([disabled]),textarea[name][required]:not([disabled])',
74
-
75
- // Form file input elements
76
- fileInputSelector: 'input:file',
77
-
78
- // Link onClick disable selector with possible reenable after remote submission
79
- linkDisableSelector: 'a[data-disable-with]',
80
-
81
- // Make sure that every Ajax request sends the CSRF token
82
- CSRFProtection: function(xhr) {
83
- var token = $('meta[name="csrf-token"]').attr('content');
84
- if (token) xhr.setRequestHeader('X-CSRF-Token', token);
85
- },
86
-
87
- // Triggers an event on an element and returns false if the event result is false
88
- fire: function(obj, name, data) {
89
- var event = $.Event(name);
90
- obj.trigger(event, data);
91
- return event.result !== false;
92
- },
93
-
94
- // Default confirm dialog, may be overridden with custom confirm dialog in $.rails.confirm
95
- confirm: function(message) {
96
- return confirm(message);
97
- },
98
-
99
- // Default ajax function, may be overridden with custom function in $.rails.ajax
100
- ajax: function(options) {
101
- return $.ajax(options);
102
- },
103
-
104
- // Default way to get an element's href. May be overridden at $.rails.href.
105
- href: function(element) {
106
- return element.attr('href');
107
- },
108
-
109
- // Submits "remote" forms and links with ajax
110
- handleRemote: function(element) {
111
- var method, url, data, crossDomain, dataType, options;
112
-
113
- if (rails.fire(element, 'ajax:before')) {
114
- crossDomain = element.data('cross-domain') || null;
115
- dataType = element.data('type') || ($.ajaxSettings && $.ajaxSettings.dataType);
116
-
117
- if (element.is('form')) {
118
- method = element.attr('method');
119
- url = element.attr('action');
120
- data = element.serializeArray();
121
- // memoized value from clicked submit button
122
- var button = element.data('ujs:submit-button');
123
- if (button) {
124
- data.push(button);
125
- element.data('ujs:submit-button', null);
126
- }
127
- } else if (element.is(rails.inputChangeSelector)) {
128
- method = element.data('method');
129
- url = element.data('url');
130
- data = element.serialize();
131
- if (element.data('params')) data = data + "&" + element.data('params');
132
- } else {
133
- method = element.data('method');
134
- url = rails.href(element);
135
- data = element.data('params') || null;
136
- }
137
-
138
- options = {
139
- type: method || 'GET', data: data, dataType: dataType, crossDomain: crossDomain,
140
- // stopping the "ajax:beforeSend" event will cancel the ajax request
141
- beforeSend: function(xhr, settings) {
142
- if (settings.dataType === undefined) {
143
- xhr.setRequestHeader('accept', '*/*;q=0.5, ' + settings.accepts.script);
144
- }
145
- return rails.fire(element, 'ajax:beforeSend', [xhr, settings]);
146
- },
147
- success: function(data, status, xhr) {
148
- element.trigger('ajax:success', [data, status, xhr]);
149
- },
150
- complete: function(xhr, status) {
151
- element.trigger('ajax:complete', [xhr, status]);
152
- },
153
- error: function(xhr, status, error) {
154
- element.trigger('ajax:error', [xhr, status, error]);
155
- }
156
- };
157
- // Only pass url to `ajax` options if not blank
158
- if (url) { options.url = url; }
159
-
160
- return rails.ajax(options);
161
- } else {
162
- return false;
163
- }
164
- },
165
-
166
- // Handles "data-method" on links such as:
167
- // <a href="/users/5" data-method="delete" rel="nofollow" data-confirm="Are you sure?">Delete</a>
168
- handleMethod: function(link) {
169
- var href = rails.href(link),
170
- method = link.data('method'),
171
- target = link.attr('target'),
172
- csrf_token = $('meta[name=csrf-token]').attr('content'),
173
- csrf_param = $('meta[name=csrf-param]').attr('content'),
174
- form = $('<form method="post" action="' + href + '"></form>'),
175
- metadata_input = '<input name="_method" value="' + method + '" type="hidden" />';
176
-
177
- if (csrf_param !== undefined && csrf_token !== undefined) {
178
- metadata_input += '<input name="' + csrf_param + '" value="' + csrf_token + '" type="hidden" />';
179
- }
180
-
181
- if (target) { form.attr('target', target); }
182
-
183
- form.hide().append(metadata_input).appendTo('body');
184
- form.submit();
185
- },
186
-
187
- /* Disables form elements:
188
- - Caches element value in 'ujs:enable-with' data store
189
- - Replaces element text with value of 'data-disable-with' attribute
190
- - Sets disabled property to true
191
- */
192
- disableFormElements: function(form) {
193
- form.find(rails.disableSelector).each(function() {
194
- var element = $(this), method = element.is('button') ? 'html' : 'val';
195
- element.data('ujs:enable-with', element[method]());
196
- element[method](element.data('disable-with'));
197
- element.prop('disabled', true);
198
- });
199
- },
200
-
201
- /* Re-enables disabled form elements:
202
- - Replaces element text with cached value from 'ujs:enable-with' data store (created in `disableFormElements`)
203
- - Sets disabled property to false
204
- */
205
- enableFormElements: function(form) {
206
- form.find(rails.enableSelector).each(function() {
207
- var element = $(this), method = element.is('button') ? 'html' : 'val';
208
- if (element.data('ujs:enable-with')) element[method](element.data('ujs:enable-with'));
209
- element.prop('disabled', false);
210
- });
211
- },
212
-
213
- /* For 'data-confirm' attribute:
214
- - Fires `confirm` event
215
- - Shows the confirmation dialog
216
- - Fires the `confirm:complete` event
217
-
218
- Returns `true` if no function stops the chain and user chose yes; `false` otherwise.
219
- Attaching a handler to the element's `confirm` event that returns a `falsy` value cancels the confirmation dialog.
220
- Attaching a handler to the element's `confirm:complete` event that returns a `falsy` value makes this function
221
- return false. The `confirm:complete` event is fired whether or not the user answered true or false to the dialog.
222
- */
223
- allowAction: function(element) {
224
- var message = element.data('confirm'),
225
- answer = false, callback;
226
- if (!message) { return true; }
227
-
228
- if (rails.fire(element, 'confirm')) {
229
- answer = rails.confirm(message);
230
- callback = rails.fire(element, 'confirm:complete', [answer]);
231
- }
232
- return answer && callback;
233
- },
234
-
235
- // Helper function which checks for blank inputs in a form that match the specified CSS selector
236
- blankInputs: function(form, specifiedSelector, nonBlank) {
237
- var inputs = $(), input,
238
- selector = specifiedSelector || 'input,textarea';
239
- form.find(selector).each(function() {
240
- input = $(this);
241
- // Collect non-blank inputs if nonBlank option is true, otherwise, collect blank inputs
242
- if (nonBlank ? input.val() : !input.val()) {
243
- inputs = inputs.add(input);
244
- }
245
- });
246
- return inputs.length ? inputs : false;
247
- },
248
-
249
- // Helper function which checks for non-blank inputs in a form that match the specified CSS selector
250
- nonBlankInputs: function(form, specifiedSelector) {
251
- return rails.blankInputs(form, specifiedSelector, true); // true specifies nonBlank
252
- },
253
-
254
- // Helper function, needed to provide consistent behavior in IE
255
- stopEverything: function(e) {
256
- $(e.target).trigger('ujs:everythingStopped');
257
- e.stopImmediatePropagation();
258
- return false;
259
- },
260
-
261
- // find all the submit events directly bound to the form and
262
- // manually invoke them. If anyone returns false then stop the loop
263
- callFormSubmitBindings: function(form, event) {
264
- var events = form.data('events'), continuePropagation = true;
265
- if (events !== undefined && events['submit'] !== undefined) {
266
- $.each(events['submit'], function(i, obj){
267
- if (typeof obj.handler === 'function') return continuePropagation = obj.handler(event);
268
- });
269
- }
270
- return continuePropagation;
271
- },
272
-
273
- // replace element's html with the 'data-disable-with' after storing original html
274
- // and prevent clicking on it
275
- disableElement: function(element) {
276
- element.data('ujs:enable-with', element.html()); // store enabled state
277
- element.html(element.data('disable-with')); // set to disabled state
278
- element.bind('click.railsDisable', function(e) { // prevent further clicking
279
- return rails.stopEverything(e)
280
- });
281
- },
282
-
283
- // restore element to its original state which was disabled by 'disableElement' above
284
- enableElement: function(element) {
285
- if (element.data('ujs:enable-with') !== undefined) {
286
- element.html(element.data('ujs:enable-with')); // set to old enabled state
287
- // this should be element.removeData('ujs:enable-with')
288
- // but, there is currently a bug in jquery which makes hyphenated data attributes not get removed
289
- element.data('ujs:enable-with', false); // clean up cache
290
- }
291
- element.unbind('click.railsDisable'); // enable element
292
- }
293
-
294
- };
295
-
296
- $.ajaxPrefilter(function(options, originalOptions, xhr){ if ( !options.crossDomain ) { rails.CSRFProtection(xhr); }});
297
-
298
- $(document).delegate(rails.linkDisableSelector, 'ajax:complete', function() {
299
- rails.enableElement($(this));
300
- });
301
-
302
- $(document).delegate(rails.linkClickSelector, 'click.rails', function(e) {
303
- var link = $(this), method = link.data('method'), data = link.data('params');
304
- if (!rails.allowAction(link)) return rails.stopEverything(e);
305
-
306
- if (link.is(rails.linkDisableSelector)) rails.disableElement(link);
307
-
308
- if (link.data('remote') !== undefined) {
309
- if ( (e.metaKey || e.ctrlKey) && (!method || method === 'GET') && !data ) { return true; }
310
-
311
- if (rails.handleRemote(link) === false) { rails.enableElement(link); }
312
- return false;
313
-
314
- } else if (link.data('method')) {
315
- rails.handleMethod(link);
316
- return false;
317
- }
318
- });
319
-
320
- $(document).delegate(rails.inputChangeSelector, 'change.rails', function(e) {
321
- var link = $(this);
322
- if (!rails.allowAction(link)) return rails.stopEverything(e);
323
-
324
- rails.handleRemote(link);
325
- return false;
326
- });
327
-
328
- $(document).delegate(rails.formSubmitSelector, 'submit.rails', function(e) {
329
- var form = $(this),
330
- remote = form.data('remote') !== undefined,
331
- blankRequiredInputs = rails.blankInputs(form, rails.requiredInputSelector),
332
- nonBlankFileInputs = rails.nonBlankInputs(form, rails.fileInputSelector);
333
-
334
- if (!rails.allowAction(form)) return rails.stopEverything(e);
335
-
336
- // skip other logic when required values are missing or file upload is present
337
- if (blankRequiredInputs && form.attr("novalidate") == undefined && rails.fire(form, 'ajax:aborted:required', [blankRequiredInputs])) {
338
- return rails.stopEverything(e);
339
- }
340
-
341
- if (remote) {
342
- if (nonBlankFileInputs) {
343
- return rails.fire(form, 'ajax:aborted:file', [nonBlankFileInputs]);
344
- }
345
-
346
- // If browser does not support submit bubbling, then this live-binding will be called before direct
347
- // bindings. Therefore, we should directly call any direct bindings before remotely submitting form.
348
- if (!$.support.submitBubbles && $().jquery < '1.7' && rails.callFormSubmitBindings(form, e) === false) return rails.stopEverything(e);
349
-
350
- rails.handleRemote(form);
351
- return false;
352
-
353
- } else {
354
- // slight timeout so that the submit button gets properly serialized
355
- setTimeout(function(){ rails.disableFormElements(form); }, 13);
356
- }
357
- });
358
-
359
- $(document).delegate(rails.formInputClickSelector, 'click.rails', function(event) {
360
- var button = $(this);
361
-
362
- if (!rails.allowAction(button)) return rails.stopEverything(event);
363
-
364
- // register the pressed submit button
365
- var name = button.attr('name'),
366
- data = name ? {name:name, value:button.val()} : null;
367
-
368
- button.closest('form').data('ujs:submit-button', data);
369
- });
370
-
371
- $(document).delegate(rails.formSubmitSelector, 'ajax:beforeSend.rails', function(event) {
372
- if (this == event.target) rails.disableFormElements($(this));
373
- });
374
-
375
- $(document).delegate(rails.formSubmitSelector, 'ajax:complete.rails', function(event) {
376
- if (this == event.target) rails.enableFormElements($(this));
377
- });
378
-
379
- })( jQuery );
380
- "dependency_digest"%2cd1d2f8ab16360cb1694393844f1d1f"required_paths["j/Users/pierre/.rvm/gems/jruby-1.6.7.2/gems/jquery-rails-2.0.2/vendor/assets/javascripts/jquery_ujs.js"dependency_paths[{" path"j/Users/pierre/.rvm/gems/jruby-1.6.7.2/gems/jquery-rails-2.0.2/vendor/assets/javascripts/jquery_ujs.js"
381
- mtime"2012-08-14T09:37:41-07:00" digest"%0ff3e5680ead3dadeee021c144835311"