rubylight 1.0.1 → 1.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (67) hide show
  1. data/README.rdoc +11 -7
  2. data/lib/rubylight/version.rb +1 -1
  3. metadata +10 -136
  4. data/MIT-LICENSE +0 -20
  5. data/Rakefile +0 -37
  6. data/test/dummy/Rakefile +0 -7
  7. data/test/dummy/app/assets/images/1.jpg +0 -0
  8. data/test/dummy/app/assets/images/large.png +0 -0
  9. data/test/dummy/app/assets/images/thumb.jpg +0 -0
  10. data/test/dummy/app/assets/images/thumb.png +0 -0
  11. data/test/dummy/app/assets/javascripts/application.js +0 -10
  12. data/test/dummy/app/assets/javascripts/home.js +0 -2
  13. data/test/dummy/app/assets/stylesheets/application.css +0 -8
  14. data/test/dummy/app/assets/stylesheets/home.css +0 -4
  15. data/test/dummy/app/controllers/application_controller.rb +0 -3
  16. data/test/dummy/app/controllers/home_controller.rb +0 -5
  17. data/test/dummy/app/helpers/application_helper.rb +0 -2
  18. data/test/dummy/app/helpers/home_helper.rb +0 -2
  19. data/test/dummy/app/views/home/index.html.haml +0 -2
  20. data/test/dummy/app/views/layouts/application.html.erb +0 -15
  21. data/test/dummy/config.ru +0 -4
  22. data/test/dummy/config/application.rb +0 -45
  23. data/test/dummy/config/boot.rb +0 -10
  24. data/test/dummy/config/database.yml +0 -25
  25. data/test/dummy/config/environment.rb +0 -5
  26. data/test/dummy/config/environments/development.rb +0 -30
  27. data/test/dummy/config/environments/production.rb +0 -60
  28. data/test/dummy/config/environments/test.rb +0 -39
  29. data/test/dummy/config/initializers/backtrace_silencers.rb +0 -7
  30. data/test/dummy/config/initializers/inflections.rb +0 -10
  31. data/test/dummy/config/initializers/mime_types.rb +0 -5
  32. data/test/dummy/config/initializers/secret_token.rb +0 -7
  33. data/test/dummy/config/initializers/session_store.rb +0 -8
  34. data/test/dummy/config/initializers/wrap_parameters.rb +0 -14
  35. data/test/dummy/config/locales/en.yml +0 -5
  36. data/test/dummy/config/routes.rb +0 -60
  37. data/test/dummy/db/development.sqlite3 +0 -0
  38. data/test/dummy/db/schema.rb +0 -16
  39. data/test/dummy/log/development.log +0 -3858
  40. data/test/dummy/log/production.log +0 -224
  41. data/test/dummy/public/404.html +0 -26
  42. data/test/dummy/public/422.html +0 -26
  43. data/test/dummy/public/500.html +0 -26
  44. data/test/dummy/public/favicon.ico +0 -0
  45. data/test/dummy/script/rails +0 -6
  46. data/test/dummy/test/functional/home_controller_test.rb +0 -9
  47. data/test/dummy/test/unit/helpers/home_helper_test.rb +0 -4
  48. data/test/dummy/tmp/cache/assets/C6F/830/sprockets%2F53156008748ee1f204b02643e5c16a6a +0 -16
  49. data/test/dummy/tmp/cache/assets/CA9/240/sprockets%2F0a8008b0737953f41a8a7b08307e77cb +0 -16
  50. data/test/dummy/tmp/cache/assets/CB9/FA0/sprockets%2Fa1863b6fc859a4348e41a5240889fa27 +0 -374
  51. data/test/dummy/tmp/cache/assets/CDF/870/sprockets%2Fb878faf942403e313a5b103e5d80488e +0 -28
  52. data/test/dummy/tmp/cache/assets/CE6/560/sprockets%2Fecc51273a18292241960719cbe899cfb +0 -18
  53. data/test/dummy/tmp/cache/assets/D17/AB0/sprockets%2F5c9a32ccb0692131b7bf677fb77937b6 +0 -18
  54. data/test/dummy/tmp/cache/assets/D32/A10/sprockets%2F13fe41fee1fe35b49d145bcc06610705 +0 -54
  55. data/test/dummy/tmp/cache/assets/D54/ED0/sprockets%2F71c9fa01091d432b131da3bb73faf3d4 +0 -197
  56. data/test/dummy/tmp/cache/assets/D5E/C30/sprockets%2F421d71dbc41e4efceae210d855f16117 +0 -395
  57. data/test/dummy/tmp/cache/assets/D73/030/sprockets%2Fc364507281a666a47d6c9d16bbad9efc +0 -27
  58. data/test/dummy/tmp/cache/assets/D7D/FC0/sprockets%2F1f94aa5b9cec9554f135bb198db799b3 +0 -203
  59. data/test/dummy/tmp/cache/assets/D80/080/sprockets%2Fcd9c69336a9b3be0bde87986adb24792 +0 -16
  60. data/test/dummy/tmp/cache/assets/D84/210/sprockets%2Fabd0103ccec2b428ac62c94e4c40b384 +0 -10009
  61. data/test/dummy/tmp/cache/assets/D98/8B0/sprockets%2Fedbef6e0d0a4742346cf479f2c522eb0 +0 -30
  62. data/test/dummy/tmp/cache/assets/D9D/A60/sprockets%2Fa88ab4e49bb7203b8e0586c38efdd2b0 +0 -884
  63. data/test/dummy/tmp/cache/assets/DD3/B30/sprockets%2F92d8bd6a4785d5eb46dbaeebdc542039 +0 -18
  64. data/test/dummy/tmp/cache/assets/E04/890/sprockets%2F2f5173deea6c795b8fdde723bb4b63af +0 -67
  65. data/test/dummy/tmp/cache/assets/E5A/4B0/sprockets%2Fddb87630e146e40f58ac25addedadfbf +0 -9289
  66. data/test/rubylight_test.rb +0 -7
  67. data/test/test_helper.rb +0 -10
@@ -1,28 +0,0 @@
1
- o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1338638750.225659: @value{I"
2
- class:EFI"BundledAsset;
3
- FI"id;
4
- F"%a490ee2a3d54688e4a4dccb73a30f33aI"logical_path;
5
- F" home.jsI"
6
- FI")$root/app/assets/javascripts/home.js;
7
- FI"content_type;
8
- FI"application/javascript;
9
- FI"
10
- mtime;
11
- FI"2012-05-30T21:49:37-04:00;
12
- FI" body;
13
- FI"�// Place all the behaviors and hooks related to the matching controller here.
14
- // All this logic will automatically be available in application.js.
15
- ;
16
- ;
17
- FI"asset_paths;
18
- F[I")$root/app/assets/javascripts/home.js;
19
- FI"dependency_paths;
20
- F[{I" path;
21
- FI")$root/app/assets/javascripts/home.js;
22
- FI"
23
- mtime;
24
- FIu: Time
25
- : @_zoneI"EDT;
26
- T:
27
- F"%cf014c3522a3f0027343667d20617855I"
28
- F"%0868aba5d4b750d3a9421721ea3d9b9c
@@ -1,18 +0,0 @@
1
- o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1338645769.731324: @value{I"
2
- class:EFI"StaticAsset;
3
- FI"id;
4
- F"%5f1eb717f96948cb0097e28f455cf658I"logical_path;
5
- FI"large.png;
6
- TI"
7
- FI"&$root/app/assets/images/large.png;
8
- FI"content_type;
9
- FI"image/png;
10
- FI"
11
- mtime;
12
- FI"2012-05-06T10:22:48-04:00;
13
- FI" length;
14
- FI"
15
- 71563;
16
- FI" digest;
17
- F"%8e7ce5e884ce8fcd5ae5a98c8b2e1dfbI"
18
- F"%0868aba5d4b750d3a9421721ea3d9b9c
@@ -1,18 +0,0 @@
1
- o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1338638750.506529: @value{I"
2
- class:EFI"StaticAsset;
3
- FI"id;
4
- F"%32e7b878105dd7c5f9316053d9e2cc07I"logical_path;
5
- FI"thumb.jpg;
6
- TI"
7
- FI"&$root/app/assets/images/thumb.jpg;
8
- FI"content_type;
9
- FI"image/jpeg;
10
- FI"
11
- mtime;
12
- FI"2012-05-07T16:30:41-04:00;
13
- FI" length;
14
- FI"
15
- 14932;
16
- FI" digest;
17
- F"%3a53e8c0c5a2f142080e0e0794048a25I"
18
- F"%0868aba5d4b750d3a9421721ea3d9b9c
@@ -1,54 +0,0 @@
1
- o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1338638950.722194: @value{I"
2
- class:EFI"BundledAsset;
3
- FI"id;
4
- F"%d2b59cb73da6adf54719758350c52714I"logical_path;
5
- FI"application.css;
6
- TI"
7
- FI"1$root/app/assets/stylesheets/application.css;
8
- FI"content_type;
9
- FI"
10
- FI"
11
- mtime;
12
- FI"2012-06-02T08:09:05-04:00;
13
- FI" body;
14
- FI";/*
15
- * This is a manifest file that'll automatically include all the stylesheets available in this directory
16
- * and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
17
- * the top of the compiled file, but it's generally better to create a new file per style scope.
18
- */
19
-
20
- ;
21
- FI"asset_paths;
22
- F[I"1$root/app/assets/stylesheets/application.css;
23
- F"</projects/rubylight/app/assets/stylesheets/lightbox.cssI"*$root/app/assets/stylesheets/home.css;
24
- FI"dependency_paths;
25
- F[ {I" path;
26
- FI"1$root/app/assets/stylesheets/application.css;
27
- FI"
28
- mtime;
29
- FIu: Time
30
- : @_zoneI"EDT;
31
- T:
32
- F"%5ead7672f033b8aaa1d341fd3e353058{I" path;
33
- FI"!$root/app/assets/stylesheets;
34
- FI"
35
- mtime;
36
- FIu;
37
- ; I"EDT;
38
- T;
39
- ;i;"w�;i���I"hexdigest;
40
- F"%ab6abc11976664c4cd80b0bcd285b868{I" path;
41
- F"</projects/rubylight/app/assets/stylesheets/lightbox.cssI"
42
- mtime;
43
- FIu;
44
- ; I"EDT;
45
- T;
46
- F"%f3540700ed2b9994426fe1692259b1b4{I" path;
47
- FI"*$root/app/assets/stylesheets/home.css;
48
- FI"
49
- mtime;
50
- FIu;
51
- ; I"EDT;
52
- T;
53
- F"%9207cf0e315a9f268bbcbc1032491b57I"
54
- F"%0868aba5d4b750d3a9421721ea3d9b9c
@@ -1,197 +0,0 @@
1
- o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1338638950.7510667: @value{ I" length:EFi_I" digest;
2
- F"%221774d2f028f227f8a426c30aff8c6bI" source;
3
- FI"_/*
4
- * This is a manifest file that'll automatically include all the stylesheets available in this directory
5
- * and any sub-directories. You're free to add application-wide styles to this file and they'll appear at
6
- * the top of the compiled file, but it's generally better to create a new file per style scope.
7
- */
8
-
9
- /* line 6, ../sass/lightbox.sass */
10
- #lightboxOverlay {
11
- position: absolute;
12
- top: 0;
13
- left: 0;
14
- z-index: 9999;
15
- background-color: black;
16
- filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=85);
17
- opacity: 0.85;
18
- display: none;
19
- }
20
-
21
- /* line 15, ../sass/lightbox.sass */
22
- #lightbox {
23
- position: absolute;
24
- left: 0;
25
- width: 100%;
26
- z-index: 10000;
27
- text-align: center;
28
- line-height: 0;
29
- font-family: "lucida grande", tahoma, verdana, arial, sans-serif;
30
- font-weight: normal;
31
- }
32
- /* line 24, ../sass/lightbox.sass */
33
- #lightbox img {
34
- width: auto;
35
- height: auto;
36
- }
37
- /* line 27, ../sass/lightbox.sass */
38
- #lightbox a img {
39
- border: none;
40
- }
41
-
42
- /* line 30, ../sass/lightbox.sass */
43
- .lb-outerContainer {
44
- position: relative;
45
- background-color: white;
46
- *zoom: 1;
47
- width: 250px;
48
- height: 250px;
49
- margin: 0 auto;
50
- -webkit-border-radius: 4px;
51
- -moz-border-radius: 4px;
52
- -ms-border-radius: 4px;
53
- -o-border-radius: 4px;
54
- border-radius: 4px;
55
- }
56
- /* line 38, ../../../../.rvm/gems/ruby-1.9.2-p290/gems/compass-0.12.1/frameworks/compass/stylesheets/compass/utilities/general/_clearfix.scss */
57
- .lb-outerContainer:after {
58
- content: "";
59
- display: table;
60
- clear: both;
61
- }
62
-
63
- /* line 39, ../sass/lightbox.sass */
64
- .lb-container {
65
- padding: 10px;
66
- }
67
-
68
- /* line 42, ../sass/lightbox.sass */
69
- .lb-loader {
70
- position: absolute;
71
- top: 40%;
72
- left: 0%;
73
- height: 25%;
74
- width: 100%;
75
- text-align: center;
76
- line-height: 0;
77
- }
78
-
79
- /* line 51, ../sass/lightbox.sass */
80
- .lb-nav {
81
- position: absolute;
82
- top: 0;
83
- left: 0;
84
- height: 100%;
85
- width: 100%;
86
- z-index: 10;
87
- }
88
-
89
- /* line 59, ../sass/lightbox.sass */
90
- .lb-container > .nav {
91
- left: 0;
92
- }
93
-
94
- /* line 62, ../sass/lightbox.sass */
95
- .lb-nav a {
96
- outline: none;
97
- }
98
-
99
- /* line 65, ../sass/lightbox.sass */
100
- .lb-prev, .lb-next {
101
- width: 49%;
102
- height: 100%;
103
- background-image: url("data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7");
104
- /* Trick IE into showing hover */
105
- display: block;
106
- }
107
-
108
- /* line 72, ../sass/lightbox.sass */
109
- .lb-prev {
110
- left: 0;
111
- float: left;
112
- }
113
-
114
- /* line 76, ../sass/lightbox.sass */
115
- .lb-next {
116
- right: 0;
117
- float: right;
118
- }
119
-
120
- /* line 81, ../sass/lightbox.sass */
121
- .lb-prev:hover {
122
- background: url(prev.png) left 48% no-repeat;
123
- }
124
-
125
- /* line 85, ../sass/lightbox.sass */
126
- .lb-next:hover {
127
- background: url(next.png) right 48% no-repeat;
128
- }
129
-
130
- /* line 88, ../sass/lightbox.sass */
131
- .lb-dataContainer {
132
- margin: 0 auto;
133
- padding-top: 5px;
134
- *zoom: 1;
135
- width: 100%;
136
- -moz-border-radius-bottomleft: 4px;
137
- -webkit-border-bottom-left-radius: 4px;
138
- -ms-border-bottom-left-radius: 4px;
139
- -o-border-bottom-left-radius: 4px;
140
- border-bottom-left-radius: 4px;
141
- -moz-border-radius-bottomright: 4px;
142
- -webkit-border-bottom-right-radius: 4px;
143
- -ms-border-bottom-right-radius: 4px;
144
- -o-border-bottom-right-radius: 4px;
145
- border-bottom-right-radius: 4px;
146
- }
147
- /* line 38, ../../../../.rvm/gems/ruby-1.9.2-p290/gems/compass-0.12.1/frameworks/compass/stylesheets/compass/utilities/general/_clearfix.scss */
148
- .lb-dataContainer:after {
149
- content: "";
150
- display: table;
151
- clear: both;
152
- }
153
-
154
- /* line 95, ../sass/lightbox.sass */
155
- .lb-data {
156
- padding: 0 10px;
157
- color: #bbbbbb;
158
- }
159
- /* line 98, ../sass/lightbox.sass */
160
- .lb-data .lb-details {
161
- width: 85%;
162
- float: left;
163
- text-align: left;
164
- line-height: 1.1em;
165
- }
166
- /* line 103, ../sass/lightbox.sass */
167
- .lb-data .lb-caption {
168
- font-size: 13px;
169
- font-weight: bold;
170
- line-height: 1em;
171
- }
172
- /* line 107, ../sass/lightbox.sass */
173
- .lb-data .lb-number {
174
- display: block;
175
- clear: left;
176
- padding-bottom: 1em;
177
- font-size: 11px;
178
- }
179
- /* line 112, ../sass/lightbox.sass */
180
- .lb-data .lb-close {
181
- width: 35px;
182
- float: right;
183
- padding-bottom: 0.7em;
184
- outline: none;
185
- }
186
- /* line 117, ../sass/lightbox.sass */
187
- .lb-data .lb-close:hover {
188
- cursor: pointer;
189
- }
190
- /*
191
- Place all the styles related to the matching controller here.
192
- They will automatically be included in application.css.
193
- */
194
-
195
- ;
196
- FI"
197
- F"%d2b59cb73da6adf54719758350c52714
@@ -1,395 +0,0 @@
1
- o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1338638750.2097213: @value{I"
2
- class:EFI"BundledAsset;
3
- FI"id;
4
- F"%17515e6304eaa7d80a404d587dae13a2I"logical_path;
5
- F"jquery_ujs.jsI"
6
- F"g/usr/local/rvm/gems/ruby-1.9.3-p0/gems/jquery-rails-1.0.19/vendor/assets/javascripts/jquery_ujs.jsI"content_type;
7
- FI"application/javascript;
8
- FI"
9
- mtime;
10
- FI"2012-02-07T20:31:56-05:00;
11
- FI" body;
12
- FI"�;(function($, undefined) {
13
-
14
- /**
15
- * Unobtrusive scripting adapter for jQuery
16
- *
17
- * Requires jQuery 1.6.0 or later.
18
- * https://github.com/rails/jquery-ujs
19
-
20
- * Uploading file using rails.js
21
- * =============================
22
- *
23
- * By default, browsers do not allow files to be uploaded via AJAX. As a result, if there are any non-blank file fields
24
- * in the remote form, this adapter aborts the AJAX submission and allows the form to submit through standard means.
25
- *
26
- * The `ajax:aborted:file` event allows you to bind your own handler to process the form submission however you wish.
27
- *
28
- * Ex:
29
- * $('form').live('ajax:aborted:file', function(event, elements){
30
- * // Implement own remote file-transfer handler here for non-blank file inputs passed in `elements`.
31
- * // Returning false in this handler tells rails.js to disallow standard form submission
32
- * return false;
33
- * });
34
- *
35
- * The `ajax:aborted:file` event is fired when a file-type input is detected with a non-blank value.
36
- *
37
- * Third-party tools can use this hook to detect when an AJAX file upload is attempted, and then use
38
- * techniques like the iframe method to upload the file instead.
39
- *
40
- * Required fields in rails.js
41
- * ===========================
42
- *
43
- * If any blank required inputs (required="required") are detected in the remote form, the whole form submission
44
- * is canceled. Note that this is unlike file inputs, which still allow standard (non-AJAX) form submission.
45
- *
46
- * The `ajax:aborted:required` event allows you to bind your own handler to inform the user of blank required inputs.
47
- *
48
- * !! Note that Opera does not fire the form's submit event if there are blank required inputs, so this event may never
49
- * get fired in Opera. This event is what causes other browsers to exhibit the same submit-aborting behavior.
50
- *
51
- * Ex:
52
- * $('form').live('ajax:aborted:required', function(event, elements){
53
- * // Returning false in this handler tells rails.js to submit the form anyway.
54
- * // The blank required inputs are passed to this function in `elements`.
55
- * return ! confirm("Would you like to submit the form with missing info?");
56
- * });
57
- */
58
-
59
- // Shorthand to make it a little easier to call public rails functions from within rails.js
60
- var rails;
61
-
62
- $.rails = rails = {
63
- // Link elements bound by jquery-ujs
64
- linkClickSelector: 'a[data-confirm], a[data-method], a[data-remote], a[data-disable-with]',
65
-
66
- // Select elements bound by jquery-ujs
67
- inputChangeSelector: 'select[data-remote], input[data-remote], textarea[data-remote]',
68
-
69
- // Form elements bound by jquery-ujs
70
- formSubmitSelector: 'form',
71
-
72
- // Form input elements bound by jquery-ujs
73
- formInputClickSelector: 'form input[type=submit], form input[type=image], form button[type=submit], form button:not(button[type])',
74
-
75
- // Form input elements disabled during form submission
76
- disableSelector: 'input[data-disable-with], button[data-disable-with], textarea[data-disable-with]',
77
-
78
- // Form input elements re-enabled after form submission
79
- enableSelector: 'input[data-disable-with]:disabled, button[data-disable-with]:disabled, textarea[data-disable-with]:disabled',
80
-
81
- // Form required input elements
82
- requiredInputSelector: 'input[name][required]:not([disabled]),textarea[name][required]:not([disabled])',
83
-
84
- // Form file input elements
85
- fileInputSelector: 'input:file',
86
-
87
- // Link onClick disable selector with possible reenable after remote submission
88
- linkDisableSelector: 'a[data-disable-with]',
89
-
90
- // Make sure that every Ajax request sends the CSRF token
91
- CSRFProtection: function(xhr) {
92
- var token = $('meta[name="csrf-token"]').attr('content');
93
- if (token) xhr.setRequestHeader('X-CSRF-Token', token);
94
- },
95
-
96
- // Triggers an event on an element and returns false if the event result is false
97
- fire: function(obj, name, data) {
98
- var event = $.Event(name);
99
- obj.trigger(event, data);
100
- return event.result !== false;
101
- },
102
-
103
- // Default confirm dialog, may be overridden with custom confirm dialog in $.rails.confirm
104
- confirm: function(message) {
105
- return confirm(message);
106
- },
107
-
108
- // Default ajax function, may be overridden with custom function in $.rails.ajax
109
- ajax: function(options) {
110
- return $.ajax(options);
111
- },
112
-
113
- // Submits "remote" forms and links with ajax
114
- handleRemote: function(element) {
115
- var method, url, data,
116
- crossDomain = element.data('cross-domain') || null,
117
- dataType = element.data('type') || ($.ajaxSettings && $.ajaxSettings.dataType),
118
- options;
119
-
120
- if (rails.fire(element, 'ajax:before')) {
121
-
122
- if (element.is('form')) {
123
- method = element.attr('method');
124
- url = element.attr('action');
125
- data = element.serializeArray();
126
- // memoized value from clicked submit button
127
- var button = element.data('ujs:submit-button');
128
- if (button) {
129
- data.push(button);
130
- element.data('ujs:submit-button', null);
131
- }
132
- } else if (element.is(rails.inputChangeSelector)) {
133
- method = element.data('method');
134
- url = element.data('url');
135
- data = element.serialize();
136
- if (element.data('params')) data = data + "&" + element.data('params');
137
- } else {
138
- method = element.data('method');
139
- url = element.attr('href');
140
- data = element.data('params') || null;
141
- }
142
-
143
- options = {
144
- type: method || 'GET', data: data, dataType: dataType, crossDomain: crossDomain,
145
- // stopping the "ajax:beforeSend" event will cancel the ajax request
146
- beforeSend: function(xhr, settings) {
147
- if (settings.dataType === undefined) {
148
- xhr.setRequestHeader('accept', '*/*;q=0.5, ' + settings.accepts.script);
149
- }
150
- return rails.fire(element, 'ajax:beforeSend', [xhr, settings]);
151
- },
152
- success: function(data, status, xhr) {
153
- element.trigger('ajax:success', [data, status, xhr]);
154
- },
155
- complete: function(xhr, status) {
156
- element.trigger('ajax:complete', [xhr, status]);
157
- },
158
- error: function(xhr, status, error) {
159
- element.trigger('ajax:error', [xhr, status, error]);
160
- }
161
- };
162
- // Only pass url to `ajax` options if not blank
163
- if (url) { options.url = url; }
164
-
165
- return rails.ajax(options);
166
- } else {
167
- return false;
168
- }
169
- },
170
-
171
- // Handles "data-method" on links such as:
172
- // <a href="/users/5" data-method="delete" rel="nofollow" data-confirm="Are you sure?">Delete</a>
173
- handleMethod: function(link) {
174
- var href = link.attr('href'),
175
- method = link.data('method'),
176
- target = link.attr('target'),
177
- csrf_token = $('meta[name=csrf-token]').attr('content'),
178
- csrf_param = $('meta[name=csrf-param]').attr('content'),
179
- form = $('<form method="post" action="' + href + '"></form>'),
180
- metadata_input = '<input name="_method" value="' + method + '" type="hidden" />';
181
-
182
- if (csrf_param !== undefined && csrf_token !== undefined) {
183
- metadata_input += '<input name="' + csrf_param + '" value="' + csrf_token + '" type="hidden" />';
184
- }
185
-
186
- if (target) { form.attr('target', target); }
187
-
188
- form.hide().append(metadata_input).appendTo('body');
189
- form.submit();
190
- },
191
-
192
- /* Disables form elements:
193
- - Caches element value in 'ujs:enable-with' data store
194
- - Replaces element text with value of 'data-disable-with' attribute
195
- - Sets disabled property to true
196
- */
197
- disableFormElements: function(form) {
198
- form.find(rails.disableSelector).each(function() {
199
- var element = $(this), method = element.is('button') ? 'html' : 'val';
200
- element.data('ujs:enable-with', element[method]());
201
- element[method](element.data('disable-with'));
202
- element.prop('disabled', true);
203
- });
204
- },
205
-
206
- /* Re-enables disabled form elements:
207
- - Replaces element text with cached value from 'ujs:enable-with' data store (created in `disableFormElements`)
208
- - Sets disabled property to false
209
- */
210
- enableFormElements: function(form) {
211
- form.find(rails.enableSelector).each(function() {
212
- var element = $(this), method = element.is('button') ? 'html' : 'val';
213
- if (element.data('ujs:enable-with')) element[method](element.data('ujs:enable-with'));
214
- element.prop('disabled', false);
215
- });
216
- },
217
-
218
- /* For 'data-confirm' attribute:
219
- - Fires `confirm` event
220
- - Shows the confirmation dialog
221
- - Fires the `confirm:complete` event
222
-
223
- Returns `true` if no function stops the chain and user chose yes; `false` otherwise.
224
- Attaching a handler to the element's `confirm` event that returns a `falsy` value cancels the confirmation dialog.
225
- Attaching a handler to the element's `confirm:complete` event that returns a `falsy` value makes this function
226
- return false. The `confirm:complete` event is fired whether or not the user answered true or false to the dialog.
227
- */
228
- allowAction: function(element) {
229
- var message = element.data('confirm'),
230
- answer = false, callback;
231
- if (!message) { return true; }
232
-
233
- if (rails.fire(element, 'confirm')) {
234
- answer = rails.confirm(message);
235
- callback = rails.fire(element, 'confirm:complete', [answer]);
236
- }
237
- return answer && callback;
238
- },
239
-
240
- // Helper function which checks for blank inputs in a form that match the specified CSS selector
241
- blankInputs: function(form, specifiedSelector, nonBlank) {
242
- var inputs = $(), input,
243
- selector = specifiedSelector || 'input,textarea';
244
- form.find(selector).each(function() {
245
- input = $(this);
246
- // Collect non-blank inputs if nonBlank option is true, otherwise, collect blank inputs
247
- if (nonBlank ? input.val() : !input.val()) {
248
- inputs = inputs.add(input);
249
- }
250
- });
251
- return inputs.length ? inputs : false;
252
- },
253
-
254
- // Helper function which checks for non-blank inputs in a form that match the specified CSS selector
255
- nonBlankInputs: function(form, specifiedSelector) {
256
- return rails.blankInputs(form, specifiedSelector, true); // true specifies nonBlank
257
- },
258
-
259
- // Helper function, needed to provide consistent behavior in IE
260
- stopEverything: function(e) {
261
- $(e.target).trigger('ujs:everythingStopped');
262
- e.stopImmediatePropagation();
263
- return false;
264
- },
265
-
266
- // find all the submit events directly bound to the form and
267
- // manually invoke them. If anyone returns false then stop the loop
268
- callFormSubmitBindings: function(form, event) {
269
- var events = form.data('events'), continuePropagation = true;
270
- if (events !== undefined && events['submit'] !== undefined) {
271
- $.each(events['submit'], function(i, obj){
272
- if (typeof obj.handler === 'function') return continuePropagation = obj.handler(event);
273
- });
274
- }
275
- return continuePropagation;
276
- },
277
-
278
- // replace element's html with the 'data-disable-with' after storing original html
279
- // and prevent clicking on it
280
- disableElement: function(element) {
281
- element.data('ujs:enable-with', element.html()); // store enabled state
282
- element.html(element.data('disable-with')); // set to disabled state
283
- element.bind('click.railsDisable', function(e) { // prevent further clicking
284
- return rails.stopEverything(e)
285
- });
286
- },
287
-
288
- // restore element to its original state which was disabled by 'disableElement' above
289
- enableElement: function(element) {
290
- if (element.data('ujs:enable-with') !== undefined) {
291
- element.html(element.data('ujs:enable-with')); // set to old enabled state
292
- // this should be element.removeData('ujs:enable-with')
293
- // but, there is currently a bug in jquery which makes hyphenated data attributes not get removed
294
- element.data('ujs:enable-with', false); // clean up cache
295
- }
296
- element.unbind('click.railsDisable'); // enable element
297
- }
298
-
299
- };
300
-
301
- $.ajaxPrefilter(function(options, originalOptions, xhr){ if ( !options.crossDomain ) { rails.CSRFProtection(xhr); }});
302
-
303
- $(document).delegate(rails.linkDisableSelector, 'ajax:complete', function() {
304
- rails.enableElement($(this));
305
- });
306
-
307
- $(document).delegate(rails.linkClickSelector, 'click.rails', function(e) {
308
- var link = $(this), method = link.data('method'), data = link.data('params');
309
- if (!rails.allowAction(link)) return rails.stopEverything(e);
310
-
311
- if (link.is(rails.linkDisableSelector)) rails.disableElement(link);
312
-
313
- if (link.data('remote') !== undefined) {
314
- if ( (e.metaKey || e.ctrlKey) && (!method || method === 'GET') && !data ) { return true; }
315
-
316
- if (rails.handleRemote(link) === false) { rails.enableElement(link); }
317
- return false;
318
-
319
- } else if (link.data('method')) {
320
- rails.handleMethod(link);
321
- return false;
322
- }
323
- });
324
-
325
- $(document).delegate(rails.inputChangeSelector, 'change.rails', function(e) {
326
- var link = $(this);
327
- if (!rails.allowAction(link)) return rails.stopEverything(e);
328
-
329
- rails.handleRemote(link);
330
- return false;
331
- });
332
-
333
- $(document).delegate(rails.formSubmitSelector, 'submit.rails', function(e) {
334
- var form = $(this),
335
- remote = form.data('remote') !== undefined,
336
- blankRequiredInputs = rails.blankInputs(form, rails.requiredInputSelector),
337
- nonBlankFileInputs = rails.nonBlankInputs(form, rails.fileInputSelector);
338
-
339
- if (!rails.allowAction(form)) return rails.stopEverything(e);
340
-
341
- // skip other logic when required values are missing or file upload is present
342
- if (blankRequiredInputs && form.attr("novalidate") == undefined && rails.fire(form, 'ajax:aborted:required', [blankRequiredInputs])) {
343
- return rails.stopEverything(e);
344
- }
345
-
346
- if (remote) {
347
- if (nonBlankFileInputs) {
348
- return rails.fire(form, 'ajax:aborted:file', [nonBlankFileInputs]);
349
- }
350
-
351
- // If browser does not support submit bubbling, then this live-binding will be called before direct
352
- // bindings. Therefore, we should directly call any direct bindings before remotely submitting form.
353
- if (!$.support.submitBubbles && $().jquery < '1.7' && rails.callFormSubmitBindings(form, e) === false) return rails.stopEverything(e);
354
-
355
- rails.handleRemote(form);
356
- return false;
357
-
358
- } else {
359
- // slight timeout so that the submit button gets properly serialized
360
- setTimeout(function(){ rails.disableFormElements(form); }, 13);
361
- }
362
- });
363
-
364
- $(document).delegate(rails.formInputClickSelector, 'click.rails', function(event) {
365
- var button = $(this);
366
-
367
- if (!rails.allowAction(button)) return rails.stopEverything(event);
368
-
369
- // register the pressed submit button
370
- var name = button.attr('name'),
371
- data = name ? {name:name, value:button.val()} : null;
372
-
373
- button.closest('form').data('ujs:submit-button', data);
374
- });
375
-
376
- $(document).delegate(rails.formSubmitSelector, 'ajax:beforeSend.rails', function(event) {
377
- if (this == event.target) rails.disableFormElements($(this));
378
- });
379
-
380
- $(document).delegate(rails.formSubmitSelector, 'ajax:complete.rails', function(event) {
381
- if (this == event.target) rails.enableFormElements($(this));
382
- });
383
-
384
- })( jQuery );
385
- ;
386
- FI"asset_paths;
387
- F["g/usr/local/rvm/gems/ruby-1.9.3-p0/gems/jquery-rails-1.0.19/vendor/assets/javascripts/jquery_ujs.jsI"dependency_paths;
388
- F[{I" path;
389
- F"g/usr/local/rvm/gems/ruby-1.9.3-p0/gems/jquery-rails-1.0.19/vendor/assets/javascripts/jquery_ujs.jsI"
390
- mtime;
391
- FIu: Time
392
- : @_zoneI"EST;
393
- T:
394
- F"%28dc1785f8d56ea0de4c0728f358d811I"
395
- F"%0868aba5d4b750d3a9421721ea3d9b9c