attached 0.4.9 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.rdoc +1 -1
- data/lib/attached/version.rb +1 -1
- data/test/dummy/db/development.sqlite3 +0 -0
- data/test/dummy/db/test.sqlite3 +0 -0
- data/test/dummy/log/development.log +835 -0
- data/test/dummy/log/test.log +137 -0
- data/test/dummy/public/system/audios/files/full/cfa1d542-0751-4a19-8ab9-654ca37f2e5f.aac +0 -0
- data/test/dummy/public/system/audios/files/full/e891aa42-ad53-437b-8e9a-f0f995a0db05.aac +0 -0
- data/test/dummy/public/system/audios/files/large/cfa1d542-0751-4a19-8ab9-654ca37f2e5f.aac +0 -0
- data/test/dummy/public/system/audios/files/large/e891aa42-ad53-437b-8e9a-f0f995a0db05.aac +0 -0
- data/test/dummy/public/system/audios/files/original/cfa1d542-0751-4a19-8ab9-654ca37f2e5f.wav +0 -0
- data/test/dummy/public/system/audios/files/original/e891aa42-ad53-437b-8e9a-f0f995a0db05.wav +0 -0
- data/test/dummy/public/system/audios/files/small/cfa1d542-0751-4a19-8ab9-654ca37f2e5f.aac +0 -0
- data/test/dummy/public/system/audios/files/small/e891aa42-ad53-437b-8e9a-f0f995a0db05.aac +0 -0
- data/test/dummy/public/system/images/files/full/{91295f80-fd11-41e0-bd87-9a65c9522d41.jpg → 28cea102-6921-4c74-b267-a9463523287b.jpg} +0 -0
- data/test/dummy/public/system/images/files/full/{f64ccdbd-6ba3-4075-8216-b5c2844ea37d.jpg → 9e7edbc5-a72d-4b65-994f-a6d0caccc2a7.jpg} +0 -0
- data/test/dummy/public/system/images/files/large/{91295f80-fd11-41e0-bd87-9a65c9522d41.jpg → 28cea102-6921-4c74-b267-a9463523287b.jpg} +0 -0
- data/test/dummy/public/system/images/files/large/{f64ccdbd-6ba3-4075-8216-b5c2844ea37d.jpg → 9e7edbc5-a72d-4b65-994f-a6d0caccc2a7.jpg} +0 -0
- data/test/dummy/public/system/images/files/original/{91295f80-fd11-41e0-bd87-9a65c9522d41.png → 28cea102-6921-4c74-b267-a9463523287b.png} +0 -0
- data/test/dummy/public/system/images/files/original/{f64ccdbd-6ba3-4075-8216-b5c2844ea37d.png → 9e7edbc5-a72d-4b65-994f-a6d0caccc2a7.png} +0 -0
- data/test/dummy/public/system/images/files/small/{91295f80-fd11-41e0-bd87-9a65c9522d41.jpg → 28cea102-6921-4c74-b267-a9463523287b.jpg} +0 -0
- data/test/dummy/public/system/images/files/small/{f64ccdbd-6ba3-4075-8216-b5c2844ea37d.jpg → 9e7edbc5-a72d-4b65-994f-a6d0caccc2a7.jpg} +0 -0
- data/test/dummy/public/system/images/files/thumb/{91295f80-fd11-41e0-bd87-9a65c9522d41.jpg → 28cea102-6921-4c74-b267-a9463523287b.jpg} +0 -0
- data/test/dummy/public/system/images/files/thumb/{f64ccdbd-6ba3-4075-8216-b5c2844ea37d.jpg → 9e7edbc5-a72d-4b65-994f-a6d0caccc2a7.jpg} +0 -0
- data/test/dummy/tmp/cache/assets/C7C/B60/sprockets%2F1cb0d840f0900935f9f040a9830f5377 +0 -0
- data/test/dummy/tmp/cache/assets/CD8/370/sprockets%2F357970feca3ac29060c1e3861e2c0953 +35 -0
- data/test/dummy/tmp/cache/assets/CED/D50/sprockets%2Fef34074b876e29fa53d3037565ec546f +0 -0
- data/test/dummy/tmp/cache/assets/D02/3F0/sprockets%2Fd44d45a0620ff596f72b107a5a95a1b2 +0 -0
- data/test/dummy/tmp/cache/assets/D06/B40/sprockets%2F25fca4643219052b0d5c66cf2c71f72f +0 -0
- data/test/dummy/tmp/cache/assets/D0E/EA0/sprockets%2F3c367918f399744aa0cda0909abab914 +9324 -0
- data/test/dummy/tmp/cache/assets/D1F/A20/sprockets%2F67f17e9a7b532c954d561da98ed47b05 +9324 -0
- data/test/dummy/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705 +0 -0
- data/test/dummy/tmp/cache/assets/D4E/1B0/sprockets%2Ff7cbd26ba1d28d48de824f0e94586655 +66 -0
- data/test/dummy/tmp/cache/assets/D5A/EA0/sprockets%2Fd771ace226fc8215a3572e0aa35bb0d6 +71 -0
- data/test/dummy/tmp/cache/assets/D64/230/sprockets%2F7cf200c925cfe75d60cb8f04280ac52c +0 -0
- data/test/dummy/tmp/cache/assets/D6C/050/sprockets%2Fa1101bd74c6a59f8ba82dce3955662dd +0 -0
- data/test/dummy/tmp/cache/assets/D73/9B0/sprockets%2Ff6eeb33602682bd6ff6d1f177f6b142d +0 -0
- data/test/dummy/tmp/cache/assets/D7F/FF0/sprockets%2F6c80e3e8b9603fd78a2bdf835b8843dd +391 -0
- data/test/dummy/tmp/cache/assets/DA7/530/sprockets%2Fe36b8fcf5914a3a6bf058abfe7367b19 +0 -0
- data/test/dummy/tmp/cache/assets/DA9/950/sprockets%2Ff7bd0c153686b3ff51dd8b94aac8b948 +0 -0
- data/test/dummy/tmp/cache/assets/DAF/010/sprockets%2Fed8df31cb575ad8557b99bc2f6097d2c +391 -0
- data/test/dummy/tmp/cache/assets/DB7/6C0/sprockets%2F386e9196dd0f9efdce6f92ce93a6d107 +0 -0
- data/test/dummy/tmp/cache/assets/DCB/880/sprockets%2F5eda3d5476bc5d7d3c08350e0c89daea +0 -0
- data/test/dummy/tmp/cache/assets/DDC/400/sprockets%2Fcffd775d018f68ce5dba1ee0d951a994 +9690 -0
- data/test/dummy/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af +0 -0
- data/test/dummy/tmp/cache/assets/E34/0E0/sprockets%2F0fefcc68a94a693fb476eefa0b7eb2e1 +0 -0
- metadata +118 -104
Binary file
|
@@ -0,0 +1,66 @@
|
|
1
|
+
o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1321778869.535031:@value{I"
|
2
|
+
class:EFI"ProcessedAsset;
|
3
|
+
FI"logical_path;
|
4
|
+
F"application.jsI"
|
5
|
+
FI"0$root/app/assets/javascripts/application.js;
|
6
|
+
FI"content_type;
|
7
|
+
FI"application/javascript;
|
8
|
+
FI"
|
9
|
+
mtime;
|
10
|
+
FI"2011-10-21T01:12:57-07:00;
|
11
|
+
FI"length;
|
12
|
+
FiI"digest;
|
13
|
+
F"%76b5cf06ef313cbe17d4d4e186643af6I"source;
|
14
|
+
FI"
|
15
|
+
|
16
|
+
|
17
|
+
;
|
18
|
+
FI"dependency_digest;
|
19
|
+
F"%c855c7ebd6c4e18d491b8f40ba0b822fI"required_paths;
|
20
|
+
F["f/Users/kevin/.rvm/gems/ruby-1.9.3-p0/gems/jquery-rails-1.0.18/vendor/assets/javascripts/jquery.js"j/Users/kevin/.rvm/gems/ruby-1.9.3-p0/gems/jquery-rails-1.0.18/vendor/assets/javascripts/jquery_ujs.jsI"+$root/app/assets/javascripts/audios.js;
|
21
|
+
FI"+$root/app/assets/javascripts/images.js;
|
22
|
+
FI")$root/app/assets/javascripts/main.js;
|
23
|
+
FI"0$root/app/assets/javascripts/application.js;
|
24
|
+
FI"dependency_paths;
|
25
|
+
F[{I" path;
|
26
|
+
FI"!$root/app/assets/javascripts;
|
27
|
+
FI"
|
28
|
+
mtime;
|
29
|
+
FI"2011-10-21T00:34:32-07:00;
|
30
|
+
FI"digest;
|
31
|
+
F"%ad4d4d94a9dcadc39f9e2bd3e6752b76{I" path;
|
32
|
+
FI"0$root/app/assets/javascripts/application.js;
|
33
|
+
FI"
|
34
|
+
mtime;
|
35
|
+
FI"2011-10-21T01:12:57-07:00;
|
36
|
+
FI"digest;
|
37
|
+
F"%cdc1c7bd97c7020c243b1d5eb2ba54ca{I" path;
|
38
|
+
F"f/Users/kevin/.rvm/gems/ruby-1.9.3-p0/gems/jquery-rails-1.0.18/vendor/assets/javascripts/jquery.jsI"
|
39
|
+
mtime;
|
40
|
+
FI"2011-11-18T10:07:16-08:00;
|
41
|
+
FI"digest;
|
42
|
+
F"%9475167b7e5ccaa0fcfa3efd0648d57e{I" path;
|
43
|
+
F"j/Users/kevin/.rvm/gems/ruby-1.9.3-p0/gems/jquery-rails-1.0.18/vendor/assets/javascripts/jquery_ujs.jsI"
|
44
|
+
mtime;
|
45
|
+
FI"2011-11-18T10:07:16-08:00;
|
46
|
+
FI"digest;
|
47
|
+
F"%1a59cbf476d8f05d33c8effac16ddd96{I" path;
|
48
|
+
FI"+$root/app/assets/javascripts/audios.js;
|
49
|
+
FI"
|
50
|
+
mtime;
|
51
|
+
FI"2011-10-21T01:13:09-07:00;
|
52
|
+
FI"digest;
|
53
|
+
F"%334780944ca955913e695585788b2def{I" path;
|
54
|
+
FI"+$root/app/assets/javascripts/images.js;
|
55
|
+
FI"
|
56
|
+
mtime;
|
57
|
+
FI"2011-10-21T01:13:05-07:00;
|
58
|
+
FI"digest;
|
59
|
+
F"%334780944ca955913e695585788b2def{I" path;
|
60
|
+
FI")$root/app/assets/javascripts/main.js;
|
61
|
+
FI"
|
62
|
+
mtime;
|
63
|
+
FI"2011-10-21T01:13:11-07:00;
|
64
|
+
FI"digest;
|
65
|
+
F"%334780944ca955913e695585788b2defI"
|
66
|
+
F"%334780944ca955913e695585788b2def
|
@@ -0,0 +1,71 @@
|
|
1
|
+
o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1321778869.43799:@value{I"
|
2
|
+
class:EFI"ProcessedAsset;
|
3
|
+
FI"logical_path;
|
4
|
+
F"application.cssI"
|
5
|
+
FI"1$root/app/assets/stylesheets/application.css;
|
6
|
+
FI"content_type;
|
7
|
+
FI"
|
8
|
+
FI"
|
9
|
+
mtime;
|
10
|
+
FI"2011-10-21T01:48:22-07:00;
|
11
|
+
FI"length;
|
12
|
+
Fi�I"digest;
|
13
|
+
F"%e780696f26242c4680c859d821eff36dI"source;
|
14
|
+
FI"�/*
|
15
|
+
|
16
|
+
|
17
|
+
*/
|
18
|
+
|
19
|
+
|
20
|
+
html, body
|
21
|
+
{
|
22
|
+
font-family: Helvetica, Verdana, Arial, sans-serif;
|
23
|
+
font-style: normal;
|
24
|
+
font-weight: normal;
|
25
|
+
}
|
26
|
+
|
27
|
+
.field_with_errors
|
28
|
+
{
|
29
|
+
display: inline;
|
30
|
+
}
|
31
|
+
;
|
32
|
+
FI"dependency_digest;
|
33
|
+
F"%ffac0f6c0fd86af0ca0bda77abc7138dI"required_paths;
|
34
|
+
F[ I"1$root/app/assets/stylesheets/application.css;
|
35
|
+
FI",$root/app/assets/stylesheets/audios.css;
|
36
|
+
FI",$root/app/assets/stylesheets/images.css;
|
37
|
+
FI"*$root/app/assets/stylesheets/main.css;
|
38
|
+
FI"dependency_paths;
|
39
|
+
F[
|
40
|
+
{I" path;
|
41
|
+
FI"!$root/app/assets/stylesheets;
|
42
|
+
FI"
|
43
|
+
mtime;
|
44
|
+
FI"2011-10-21T01:48:22-07:00;
|
45
|
+
FI"digest;
|
46
|
+
F"%3126a765f30a2c554b38597e783411cd{I" path;
|
47
|
+
FI"1$root/app/assets/stylesheets/application.css;
|
48
|
+
FI"
|
49
|
+
mtime;
|
50
|
+
FI"2011-10-21T01:48:22-07:00;
|
51
|
+
FI"digest;
|
52
|
+
F"%f58a89971e5751452f88c314e045dddf{I" path;
|
53
|
+
FI",$root/app/assets/stylesheets/audios.css;
|
54
|
+
FI"
|
55
|
+
mtime;
|
56
|
+
FI"2011-10-21T01:13:27-07:00;
|
57
|
+
FI"digest;
|
58
|
+
F"%334780944ca955913e695585788b2def{I" path;
|
59
|
+
FI",$root/app/assets/stylesheets/images.css;
|
60
|
+
FI"
|
61
|
+
mtime;
|
62
|
+
FI"2011-10-21T01:13:25-07:00;
|
63
|
+
FI"digest;
|
64
|
+
F"%334780944ca955913e695585788b2def{I" path;
|
65
|
+
FI"*$root/app/assets/stylesheets/main.css;
|
66
|
+
FI"
|
67
|
+
mtime;
|
68
|
+
FI"2011-10-21T01:13:29-07:00;
|
69
|
+
FI"digest;
|
70
|
+
F"%334780944ca955913e695585788b2defI"
|
71
|
+
F"%334780944ca955913e695585788b2def
|
Binary file
|
Binary file
|
Binary file
|
@@ -0,0 +1,391 @@
|
|
1
|
+
o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1321778869.507443:@value{I"
|
2
|
+
class:EFI"ProcessedAsset;
|
3
|
+
FI"logical_path;
|
4
|
+
F"jquery_ujs.jsI"
|
5
|
+
F"j/Users/kevin/.rvm/gems/ruby-1.9.3-p0/gems/jquery-rails-1.0.18/vendor/assets/javascripts/jquery_ujs.jsI"content_type;
|
6
|
+
FI"application/javascript;
|
7
|
+
FI"
|
8
|
+
mtime;
|
9
|
+
FI"2011-11-18T10:07:16-08:00;
|
10
|
+
FI"length;
|
11
|
+
Fi$;I"digest;
|
12
|
+
F"%1a59cbf476d8f05d33c8effac16ddd96I"source;
|
13
|
+
FI"$;(function($, undefined) {
|
14
|
+
|
15
|
+
/**
|
16
|
+
* Unobtrusive scripting adapter for jQuery
|
17
|
+
*
|
18
|
+
* Requires jQuery 1.6.0 or later.
|
19
|
+
* https://github.com/rails/jquery-ujs
|
20
|
+
|
21
|
+
* Uploading file using rails.js
|
22
|
+
* =============================
|
23
|
+
*
|
24
|
+
* By default, browsers do not allow files to be uploaded via AJAX. As a result, if there are any non-blank file fields
|
25
|
+
* in the remote form, this adapter aborts the AJAX submission and allows the form to submit through standard means.
|
26
|
+
*
|
27
|
+
* The `ajax:aborted:file` event allows you to bind your own handler to process the form submission however you wish.
|
28
|
+
*
|
29
|
+
* Ex:
|
30
|
+
* $('form').live('ajax:aborted:file', function(event, elements){
|
31
|
+
* // Implement own remote file-transfer handler here for non-blank file inputs passed in `elements`.
|
32
|
+
* // Returning false in this handler tells rails.js to disallow standard form submission
|
33
|
+
* return false;
|
34
|
+
* });
|
35
|
+
*
|
36
|
+
* The `ajax:aborted:file` event is fired when a file-type input is detected with a non-blank value.
|
37
|
+
*
|
38
|
+
* Third-party tools can use this hook to detect when an AJAX file upload is attempted, and then use
|
39
|
+
* techniques like the iframe method to upload the file instead.
|
40
|
+
*
|
41
|
+
* Required fields in rails.js
|
42
|
+
* ===========================
|
43
|
+
*
|
44
|
+
* If any blank required inputs (required="required") are detected in the remote form, the whole form submission
|
45
|
+
* is canceled. Note that this is unlike file inputs, which still allow standard (non-AJAX) form submission.
|
46
|
+
*
|
47
|
+
* The `ajax:aborted:required` event allows you to bind your own handler to inform the user of blank required inputs.
|
48
|
+
*
|
49
|
+
* !! Note that Opera does not fire the form's submit event if there are blank required inputs, so this event may never
|
50
|
+
* get fired in Opera. This event is what causes other browsers to exhibit the same submit-aborting behavior.
|
51
|
+
*
|
52
|
+
* Ex:
|
53
|
+
* $('form').live('ajax:aborted:required', function(event, elements){
|
54
|
+
* // Returning false in this handler tells rails.js to submit the form anyway.
|
55
|
+
* // The blank required inputs are passed to this function in `elements`.
|
56
|
+
* return ! confirm("Would you like to submit the form with missing info?");
|
57
|
+
* });
|
58
|
+
*/
|
59
|
+
|
60
|
+
// Shorthand to make it a little easier to call public rails functions from within rails.js
|
61
|
+
var rails;
|
62
|
+
|
63
|
+
$.rails = rails = {
|
64
|
+
// Link elements bound by jquery-ujs
|
65
|
+
linkClickSelector: 'a[data-confirm], a[data-method], a[data-remote], a[data-disable-with]',
|
66
|
+
|
67
|
+
// Select elements bound by jquery-ujs
|
68
|
+
inputChangeSelector: 'select[data-remote], input[data-remote], textarea[data-remote]',
|
69
|
+
|
70
|
+
// Form elements bound by jquery-ujs
|
71
|
+
formSubmitSelector: 'form',
|
72
|
+
|
73
|
+
// Form input elements bound by jquery-ujs
|
74
|
+
formInputClickSelector: 'form input[type=submit], form input[type=image], form button[type=submit], form button:not(button[type])',
|
75
|
+
|
76
|
+
// Form input elements disabled during form submission
|
77
|
+
disableSelector: 'input[data-disable-with], button[data-disable-with], textarea[data-disable-with]',
|
78
|
+
|
79
|
+
// Form input elements re-enabled after form submission
|
80
|
+
enableSelector: 'input[data-disable-with]:disabled, button[data-disable-with]:disabled, textarea[data-disable-with]:disabled',
|
81
|
+
|
82
|
+
// Form required input elements
|
83
|
+
requiredInputSelector: 'input[name][required]:not([disabled]),textarea[name][required]:not([disabled])',
|
84
|
+
|
85
|
+
// Form file input elements
|
86
|
+
fileInputSelector: 'input:file',
|
87
|
+
|
88
|
+
// Link onClick disable selector with possible reenable after remote submission
|
89
|
+
linkDisableSelector: 'a[data-disable-with]',
|
90
|
+
|
91
|
+
// Make sure that every Ajax request sends the CSRF token
|
92
|
+
CSRFProtection: function(xhr) {
|
93
|
+
var token = $('meta[name="csrf-token"]').attr('content');
|
94
|
+
if (token) xhr.setRequestHeader('X-CSRF-Token', token);
|
95
|
+
},
|
96
|
+
|
97
|
+
// Triggers an event on an element and returns false if the event result is false
|
98
|
+
fire: function(obj, name, data) {
|
99
|
+
var event = $.Event(name);
|
100
|
+
obj.trigger(event, data);
|
101
|
+
return event.result !== false;
|
102
|
+
},
|
103
|
+
|
104
|
+
// Default confirm dialog, may be overridden with custom confirm dialog in $.rails.confirm
|
105
|
+
confirm: function(message) {
|
106
|
+
return confirm(message);
|
107
|
+
},
|
108
|
+
|
109
|
+
// Default ajax function, may be overridden with custom function in $.rails.ajax
|
110
|
+
ajax: function(options) {
|
111
|
+
return $.ajax(options);
|
112
|
+
},
|
113
|
+
|
114
|
+
// Submits "remote" forms and links with ajax
|
115
|
+
handleRemote: function(element) {
|
116
|
+
var method, url, data,
|
117
|
+
crossDomain = element.data('cross-domain') || null,
|
118
|
+
dataType = element.data('type') || ($.ajaxSettings && $.ajaxSettings.dataType),
|
119
|
+
options;
|
120
|
+
|
121
|
+
if (rails.fire(element, 'ajax:before')) {
|
122
|
+
|
123
|
+
if (element.is('form')) {
|
124
|
+
method = element.attr('method');
|
125
|
+
url = element.attr('action');
|
126
|
+
data = element.serializeArray();
|
127
|
+
// memoized value from clicked submit button
|
128
|
+
var button = element.data('ujs:submit-button');
|
129
|
+
if (button) {
|
130
|
+
data.push(button);
|
131
|
+
element.data('ujs:submit-button', null);
|
132
|
+
}
|
133
|
+
} else if (element.is(rails.inputChangeSelector)) {
|
134
|
+
method = element.data('method');
|
135
|
+
url = element.data('url');
|
136
|
+
data = element.serialize();
|
137
|
+
if (element.data('params')) data = data + "&" + element.data('params');
|
138
|
+
} else {
|
139
|
+
method = element.data('method');
|
140
|
+
url = element.attr('href');
|
141
|
+
data = element.data('params') || null;
|
142
|
+
}
|
143
|
+
|
144
|
+
options = {
|
145
|
+
type: method || 'GET', data: data, dataType: dataType, crossDomain: crossDomain,
|
146
|
+
// stopping the "ajax:beforeSend" event will cancel the ajax request
|
147
|
+
beforeSend: function(xhr, settings) {
|
148
|
+
if (settings.dataType === undefined) {
|
149
|
+
xhr.setRequestHeader('accept', '*/*;q=0.5, ' + settings.accepts.script);
|
150
|
+
}
|
151
|
+
return rails.fire(element, 'ajax:beforeSend', [xhr, settings]);
|
152
|
+
},
|
153
|
+
success: function(data, status, xhr) {
|
154
|
+
element.trigger('ajax:success', [data, status, xhr]);
|
155
|
+
},
|
156
|
+
complete: function(xhr, status) {
|
157
|
+
element.trigger('ajax:complete', [xhr, status]);
|
158
|
+
},
|
159
|
+
error: function(xhr, status, error) {
|
160
|
+
element.trigger('ajax:error', [xhr, status, error]);
|
161
|
+
}
|
162
|
+
};
|
163
|
+
// Only pass url to `ajax` options if not blank
|
164
|
+
if (url) { options.url = url; }
|
165
|
+
|
166
|
+
rails.ajax(options);
|
167
|
+
}
|
168
|
+
},
|
169
|
+
|
170
|
+
// Handles "data-method" on links such as:
|
171
|
+
// <a href="/users/5" data-method="delete" rel="nofollow" data-confirm="Are you sure?">Delete</a>
|
172
|
+
handleMethod: function(link) {
|
173
|
+
var href = link.attr('href'),
|
174
|
+
method = link.data('method'),
|
175
|
+
target = link.attr('target'),
|
176
|
+
csrf_token = $('meta[name=csrf-token]').attr('content'),
|
177
|
+
csrf_param = $('meta[name=csrf-param]').attr('content'),
|
178
|
+
form = $('<form method="post" action="' + href + '"></form>'),
|
179
|
+
metadata_input = '<input name="_method" value="' + method + '" type="hidden" />';
|
180
|
+
|
181
|
+
if (csrf_param !== undefined && csrf_token !== undefined) {
|
182
|
+
metadata_input += '<input name="' + csrf_param + '" value="' + csrf_token + '" type="hidden" />';
|
183
|
+
}
|
184
|
+
|
185
|
+
if (target) { form.attr('target', target); }
|
186
|
+
|
187
|
+
form.hide().append(metadata_input).appendTo('body');
|
188
|
+
form.submit();
|
189
|
+
},
|
190
|
+
|
191
|
+
/* Disables form elements:
|
192
|
+
- Caches element value in 'ujs:enable-with' data store
|
193
|
+
- Replaces element text with value of 'data-disable-with' attribute
|
194
|
+
- Sets disabled property to true
|
195
|
+
*/
|
196
|
+
disableFormElements: function(form) {
|
197
|
+
form.find(rails.disableSelector).each(function() {
|
198
|
+
var element = $(this), method = element.is('button') ? 'html' : 'val';
|
199
|
+
element.data('ujs:enable-with', element[method]());
|
200
|
+
element[method](element.data('disable-with'));
|
201
|
+
element.prop('disabled', true);
|
202
|
+
});
|
203
|
+
},
|
204
|
+
|
205
|
+
/* Re-enables disabled form elements:
|
206
|
+
- Replaces element text with cached value from 'ujs:enable-with' data store (created in `disableFormElements`)
|
207
|
+
- Sets disabled property to false
|
208
|
+
*/
|
209
|
+
enableFormElements: function(form) {
|
210
|
+
form.find(rails.enableSelector).each(function() {
|
211
|
+
var element = $(this), method = element.is('button') ? 'html' : 'val';
|
212
|
+
if (element.data('ujs:enable-with')) element[method](element.data('ujs:enable-with'));
|
213
|
+
element.prop('disabled', false);
|
214
|
+
});
|
215
|
+
},
|
216
|
+
|
217
|
+
/* For 'data-confirm' attribute:
|
218
|
+
- Fires `confirm` event
|
219
|
+
- Shows the confirmation dialog
|
220
|
+
- Fires the `confirm:complete` event
|
221
|
+
|
222
|
+
Returns `true` if no function stops the chain and user chose yes; `false` otherwise.
|
223
|
+
Attaching a handler to the element's `confirm` event that returns a `falsy` value cancels the confirmation dialog.
|
224
|
+
Attaching a handler to the element's `confirm:complete` event that returns a `falsy` value makes this function
|
225
|
+
return false. The `confirm:complete` event is fired whether or not the user answered true or false to the dialog.
|
226
|
+
*/
|
227
|
+
allowAction: function(element) {
|
228
|
+
var message = element.data('confirm'),
|
229
|
+
answer = false, callback;
|
230
|
+
if (!message) { return true; }
|
231
|
+
|
232
|
+
if (rails.fire(element, 'confirm')) {
|
233
|
+
answer = rails.confirm(message);
|
234
|
+
callback = rails.fire(element, 'confirm:complete', [answer]);
|
235
|
+
}
|
236
|
+
return answer && callback;
|
237
|
+
},
|
238
|
+
|
239
|
+
// Helper function which checks for blank inputs in a form that match the specified CSS selector
|
240
|
+
blankInputs: function(form, specifiedSelector, nonBlank) {
|
241
|
+
var inputs = $(), input,
|
242
|
+
selector = specifiedSelector || 'input,textarea';
|
243
|
+
form.find(selector).each(function() {
|
244
|
+
input = $(this);
|
245
|
+
// Collect non-blank inputs if nonBlank option is true, otherwise, collect blank inputs
|
246
|
+
if (nonBlank ? input.val() : !input.val()) {
|
247
|
+
inputs = inputs.add(input);
|
248
|
+
}
|
249
|
+
});
|
250
|
+
return inputs.length ? inputs : false;
|
251
|
+
},
|
252
|
+
|
253
|
+
// Helper function which checks for non-blank inputs in a form that match the specified CSS selector
|
254
|
+
nonBlankInputs: function(form, specifiedSelector) {
|
255
|
+
return rails.blankInputs(form, specifiedSelector, true); // true specifies nonBlank
|
256
|
+
},
|
257
|
+
|
258
|
+
// Helper function, needed to provide consistent behavior in IE
|
259
|
+
stopEverything: function(e) {
|
260
|
+
$(e.target).trigger('ujs:everythingStopped');
|
261
|
+
e.stopImmediatePropagation();
|
262
|
+
return false;
|
263
|
+
},
|
264
|
+
|
265
|
+
// find all the submit events directly bound to the form and
|
266
|
+
// manually invoke them. If anyone returns false then stop the loop
|
267
|
+
callFormSubmitBindings: function(form, event) {
|
268
|
+
var events = form.data('events'), continuePropagation = true;
|
269
|
+
if (events !== undefined && events['submit'] !== undefined) {
|
270
|
+
$.each(events['submit'], function(i, obj){
|
271
|
+
if (typeof obj.handler === 'function') return continuePropagation = obj.handler(event);
|
272
|
+
});
|
273
|
+
}
|
274
|
+
return continuePropagation;
|
275
|
+
},
|
276
|
+
|
277
|
+
// replace element's html with the 'data-disable-with' after storing original html
|
278
|
+
// and prevent clicking on it
|
279
|
+
disableElement: function(element) {
|
280
|
+
element.data('ujs:enable-with', element.html()); // store enabled state
|
281
|
+
element.html(element.data('disable-with')); // set to disabled state
|
282
|
+
element.bind('click.railsDisable', function(e) { // prevent further clicking
|
283
|
+
return rails.stopEverything(e)
|
284
|
+
});
|
285
|
+
},
|
286
|
+
|
287
|
+
// restore element to its original state which was disabled by 'disableElement' above
|
288
|
+
enableElement: function(element) {
|
289
|
+
if (element.data('ujs:enable-with') !== undefined) {
|
290
|
+
element.html(element.data('ujs:enable-with')); // set to old enabled state
|
291
|
+
// this should be element.removeData('ujs:enable-with')
|
292
|
+
// but, there is currently a bug in jquery which makes hyphenated data attributes not get removed
|
293
|
+
element.data('ujs:enable-with', false); // clean up cache
|
294
|
+
}
|
295
|
+
element.unbind('click.railsDisable'); // enable element
|
296
|
+
}
|
297
|
+
|
298
|
+
};
|
299
|
+
|
300
|
+
$.ajaxPrefilter(function(options, originalOptions, xhr){ if ( !options.crossDomain ) { rails.CSRFProtection(xhr); }});
|
301
|
+
|
302
|
+
$(rails.linkDisableSelector).live('ajax:complete', function() {
|
303
|
+
rails.enableElement($(this));
|
304
|
+
});
|
305
|
+
|
306
|
+
$(rails.linkClickSelector).live('click.rails', function(e) {
|
307
|
+
var link = $(this), method = link.data('method'), data = link.data('params');
|
308
|
+
if (!rails.allowAction(link)) return rails.stopEverything(e);
|
309
|
+
|
310
|
+
if (link.is(rails.linkDisableSelector)) rails.disableElement(link);
|
311
|
+
|
312
|
+
if (link.data('remote') !== undefined) {
|
313
|
+
if ( (e.metaKey || e.ctrlKey) && (!method || method === 'GET') && !data ) { return true; }
|
314
|
+
rails.handleRemote(link);
|
315
|
+
return false;
|
316
|
+
} else if (link.data('method')) {
|
317
|
+
rails.handleMethod(link);
|
318
|
+
return false;
|
319
|
+
}
|
320
|
+
});
|
321
|
+
|
322
|
+
$(rails.inputChangeSelector).live('change.rails', function(e) {
|
323
|
+
var link = $(this);
|
324
|
+
if (!rails.allowAction(link)) return rails.stopEverything(e);
|
325
|
+
|
326
|
+
rails.handleRemote(link);
|
327
|
+
return false;
|
328
|
+
});
|
329
|
+
|
330
|
+
$(rails.formSubmitSelector).live('submit.rails', function(e) {
|
331
|
+
var form = $(this),
|
332
|
+
remote = form.data('remote') !== undefined,
|
333
|
+
blankRequiredInputs = rails.blankInputs(form, rails.requiredInputSelector),
|
334
|
+
nonBlankFileInputs = rails.nonBlankInputs(form, rails.fileInputSelector);
|
335
|
+
|
336
|
+
if (!rails.allowAction(form)) return rails.stopEverything(e);
|
337
|
+
|
338
|
+
// skip other logic when required values are missing or file upload is present
|
339
|
+
if (blankRequiredInputs && form.attr("novalidate") == undefined && rails.fire(form, 'ajax:aborted:required', [blankRequiredInputs])) {
|
340
|
+
return rails.stopEverything(e);
|
341
|
+
}
|
342
|
+
|
343
|
+
if (remote) {
|
344
|
+
if (nonBlankFileInputs) {
|
345
|
+
return rails.fire(form, 'ajax:aborted:file', [nonBlankFileInputs]);
|
346
|
+
}
|
347
|
+
|
348
|
+
// If browser does not support submit bubbling, then this live-binding will be called before direct
|
349
|
+
// bindings. Therefore, we should directly call any direct bindings before remotely submitting form.
|
350
|
+
if (!$.support.submitBubbles && $().jquery < '1.7' && rails.callFormSubmitBindings(form, e) === false) return rails.stopEverything(e);
|
351
|
+
|
352
|
+
rails.handleRemote(form);
|
353
|
+
return false;
|
354
|
+
} else {
|
355
|
+
// slight timeout so that the submit button gets properly serialized
|
356
|
+
setTimeout(function(){ rails.disableFormElements(form); }, 13);
|
357
|
+
}
|
358
|
+
});
|
359
|
+
|
360
|
+
$(rails.formInputClickSelector).live('click.rails', function(event) {
|
361
|
+
var button = $(this);
|
362
|
+
|
363
|
+
if (!rails.allowAction(button)) return rails.stopEverything(event);
|
364
|
+
|
365
|
+
// register the pressed submit button
|
366
|
+
var name = button.attr('name'),
|
367
|
+
data = name ? {name:name, value:button.val()} : null;
|
368
|
+
|
369
|
+
button.closest('form').data('ujs:submit-button', data);
|
370
|
+
});
|
371
|
+
|
372
|
+
$(rails.formSubmitSelector).live('ajax:beforeSend.rails', function(event) {
|
373
|
+
if (this == event.target) rails.disableFormElements($(this));
|
374
|
+
});
|
375
|
+
|
376
|
+
$(rails.formSubmitSelector).live('ajax:complete.rails', function(event) {
|
377
|
+
if (this == event.target) rails.enableFormElements($(this));
|
378
|
+
});
|
379
|
+
|
380
|
+
})( jQuery );
|
381
|
+
;
|
382
|
+
FI"dependency_digest;
|
383
|
+
F"%0c9cf302d735015946a58d81a81db3f9I"required_paths;
|
384
|
+
F["j/Users/kevin/.rvm/gems/ruby-1.9.3-p0/gems/jquery-rails-1.0.18/vendor/assets/javascripts/jquery_ujs.jsI"dependency_paths;
|
385
|
+
F[{I" path;
|
386
|
+
F"j/Users/kevin/.rvm/gems/ruby-1.9.3-p0/gems/jquery-rails-1.0.18/vendor/assets/javascripts/jquery_ujs.jsI"
|
387
|
+
mtime;
|
388
|
+
FI"2011-11-18T10:07:16-08:00;
|
389
|
+
FI"digest;
|
390
|
+
F"%1a59cbf476d8f05d33c8effac16ddd96I"
|
391
|
+
F"%334780944ca955913e695585788b2def
|