opal-rails 0.3.1 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/assets/javascripts/opal-jquery.js +17 -74
- data/lib/assets/javascripts/opal-spec.js +48 -133
- data/lib/assets/javascripts/opal.js +577 -805
- data/lib/opal/rails/version.rb +2 -2
- data/spec/integration/assigns_spec.rb +3 -0
- data/test_app/app/views/application/with_assignments.js.opal +0 -23
- metadata +5 -5
@@ -3,24 +3,20 @@
|
|
3
3
|
var __opal = Opal, self = __opal.top, __scope = __opal, nil = __opal.nil, __breaker = __opal.breaker, __slice = __opal.slice, __module = __opal.module;
|
4
4
|
|
5
5
|
return (function(__base){
|
6
|
-
// line 1, opal-jquery/document, module Document
|
7
6
|
function Document() {};
|
8
7
|
Document = __module(__base, "Document", Document);
|
9
8
|
var Document_prototype = Document.prototype, __scope = Document._scope, TMP_1;
|
10
9
|
|
11
|
-
// line 2, opal-jquery/document, Document.[]
|
12
10
|
Document['$[]'] = function(selector) {
|
13
11
|
|
14
12
|
return $(selector);
|
15
13
|
};
|
16
14
|
|
17
|
-
// line 6, opal-jquery/document, Document.find
|
18
15
|
Document.$find = function(selector) {
|
19
16
|
|
20
17
|
return this['$[]'](selector)
|
21
18
|
};
|
22
19
|
|
23
|
-
// line 10, opal-jquery/document, Document.id
|
24
20
|
Document.$id = function(id) {
|
25
21
|
|
26
22
|
|
@@ -34,13 +30,11 @@
|
|
34
30
|
|
35
31
|
};
|
36
32
|
|
37
|
-
// line 22, opal-jquery/document, Document.parse
|
38
33
|
Document.$parse = function(str) {
|
39
34
|
|
40
35
|
return $(str);
|
41
36
|
};
|
42
37
|
|
43
|
-
// line 26, opal-jquery/document, Document.ready?
|
44
38
|
Document['$ready?'] = TMP_1 = function() {
|
45
39
|
var __context, block;
|
46
40
|
block = TMP_1._p || nil, __context = block._s, TMP_1._p = null;
|
@@ -58,13 +52,11 @@
|
|
58
52
|
|
59
53
|
};
|
60
54
|
|
61
|
-
// line 40, opal-jquery/document, Document.title
|
62
55
|
Document.$title = function() {
|
63
56
|
|
64
57
|
return document.title;
|
65
58
|
};
|
66
59
|
|
67
|
-
// line 44, opal-jquery/document, Document.title=
|
68
60
|
Document['$title='] = function(title) {
|
69
61
|
|
70
62
|
return document.title = title;
|
@@ -77,24 +69,21 @@
|
|
77
69
|
var __opal = Opal, self = __opal.top, __scope = __opal, nil = __opal.nil, __breaker = __opal.breaker, __slice = __opal.slice, __klass = __opal.klass;
|
78
70
|
|
79
71
|
return (function(__base, __super){
|
80
|
-
// line 3, opal-jquery/element, class Element
|
81
72
|
function Element() {};
|
82
73
|
Element = __klass(__base, __super, "Element", Element);
|
83
|
-
var Element_prototype = Element.prototype, __scope = Element._scope, TMP_1, TMP_2, TMP_3;
|
84
74
|
|
85
|
-
|
75
|
+
;Element._sdonate(["$find", "$id", "$new", "$parse"]); var Element_prototype = Element.prototype, __scope = Element._scope, TMP_1, TMP_2, TMP_3;
|
76
|
+
|
86
77
|
Element.$find = function(selector) {
|
87
78
|
|
88
79
|
return $(selector);
|
89
80
|
};
|
90
81
|
|
91
|
-
// line 8, opal-jquery/element, Element.id
|
92
82
|
Element.$id = function(id) {
|
93
83
|
|
94
84
|
return __scope.Document.$id(id)
|
95
85
|
};
|
96
86
|
|
97
|
-
// line 12, opal-jquery/element, Element.new
|
98
87
|
Element.$new = function(tag) {
|
99
88
|
if (tag == null) {
|
100
89
|
tag = "div"
|
@@ -102,13 +91,11 @@
|
|
102
91
|
return $(document.createElement(tag));
|
103
92
|
};
|
104
93
|
|
105
|
-
// line 16, opal-jquery/element, Element.parse
|
106
94
|
Element.$parse = function(str) {
|
107
95
|
|
108
96
|
return $(str);
|
109
97
|
};
|
110
98
|
|
111
|
-
// line 20, opal-jquery/element, Element#[]
|
112
99
|
Element_prototype['$[]'] = function(name) {
|
113
100
|
|
114
101
|
return this.attr(name) || "";
|
@@ -126,19 +113,16 @@
|
|
126
113
|
|
127
114
|
Element_prototype.$append_to = Element_prototype.appendTo;
|
128
115
|
|
129
|
-
// line 73, opal-jquery/element, Element#append_to_body
|
130
116
|
Element_prototype.$append_to_body = function() {
|
131
117
|
|
132
118
|
return this.appendTo(document.body);
|
133
119
|
};
|
134
120
|
|
135
|
-
// line 77, opal-jquery/element, Element#append_to_head
|
136
121
|
Element_prototype.$append_to_head = function() {
|
137
122
|
|
138
123
|
return this.appendTo(document.head);
|
139
124
|
};
|
140
125
|
|
141
|
-
// line 93, opal-jquery/element, Element#at
|
142
126
|
Element_prototype.$at = function(index) {
|
143
127
|
|
144
128
|
|
@@ -160,7 +144,6 @@
|
|
160
144
|
|
161
145
|
Element_prototype.$children = Element_prototype.children;
|
162
146
|
|
163
|
-
// line 146, opal-jquery/element, Element#class_name
|
164
147
|
Element_prototype.$class_name = function() {
|
165
148
|
|
166
149
|
|
@@ -174,7 +157,6 @@
|
|
174
157
|
|
175
158
|
};
|
176
159
|
|
177
|
-
// line 168, opal-jquery/element, Element#class_name=
|
178
160
|
Element_prototype['$class_name='] = function(name) {
|
179
161
|
|
180
162
|
|
@@ -185,7 +167,6 @@
|
|
185
167
|
return this;
|
186
168
|
};
|
187
169
|
|
188
|
-
// line 196, opal-jquery/element, Element#css
|
189
170
|
Element_prototype.$css = function(name, value) {
|
190
171
|
var __a, __b;if (value == null) {
|
191
172
|
value = nil
|
@@ -202,7 +183,6 @@
|
|
202
183
|
return this;
|
203
184
|
};
|
204
185
|
|
205
|
-
// line 220, opal-jquery/element, Element#animate
|
206
186
|
Element_prototype.$animate = TMP_1 = function(params) {
|
207
187
|
var speed = nil, __a, __context, block;
|
208
188
|
block = TMP_1._p || nil, __context = block._s, TMP_1._p = null;
|
@@ -221,7 +201,6 @@
|
|
221
201
|
;
|
222
202
|
};
|
223
203
|
|
224
|
-
// line 237, opal-jquery/element, Element#each
|
225
204
|
Element_prototype.$each = TMP_2 = function() {
|
226
205
|
var __context, __yield;
|
227
206
|
__yield = TMP_2._p || nil, __context = __yield._s, TMP_2._p = null;
|
@@ -234,7 +213,6 @@
|
|
234
213
|
|
235
214
|
Element_prototype.$find = Element_prototype.find;
|
236
215
|
|
237
|
-
// line 257, opal-jquery/element, Element#first
|
238
216
|
Element_prototype.$first = function() {
|
239
217
|
|
240
218
|
return this.length ? this.first() : nil;
|
@@ -244,7 +222,6 @@
|
|
244
222
|
|
245
223
|
Element_prototype['$has_class?'] = Element_prototype.hasClass;
|
246
224
|
|
247
|
-
// line 265, opal-jquery/element, Element#html
|
248
225
|
Element_prototype.$html = function() {
|
249
226
|
|
250
227
|
return this.html() || "";
|
@@ -252,7 +229,6 @@
|
|
252
229
|
|
253
230
|
Element_prototype['$html='] = Element_prototype.html;
|
254
231
|
|
255
|
-
// line 271, opal-jquery/element, Element#id
|
256
232
|
Element_prototype.$id = function() {
|
257
233
|
|
258
234
|
|
@@ -266,7 +242,6 @@
|
|
266
242
|
|
267
243
|
};
|
268
244
|
|
269
|
-
// line 283, opal-jquery/element, Element#id=
|
270
245
|
Element_prototype['$id='] = function(id) {
|
271
246
|
|
272
247
|
|
@@ -280,7 +255,6 @@
|
|
280
255
|
|
281
256
|
};
|
282
257
|
|
283
|
-
// line 295, opal-jquery/element, Element#inspect
|
284
258
|
Element_prototype.$inspect = function() {
|
285
259
|
|
286
260
|
|
@@ -300,7 +274,6 @@
|
|
300
274
|
|
301
275
|
};
|
302
276
|
|
303
|
-
// line 313, opal-jquery/element, Element#length
|
304
277
|
Element_prototype.$length = function() {
|
305
278
|
|
306
279
|
return this.length;
|
@@ -308,7 +281,6 @@
|
|
308
281
|
|
309
282
|
Element_prototype.$next = Element_prototype.next;
|
310
283
|
|
311
|
-
// line 319, opal-jquery/element, Element#off
|
312
284
|
Element_prototype.$off = function(event_name, selector, handler) {
|
313
285
|
if (handler == null) {
|
314
286
|
handler = nil
|
@@ -325,7 +297,6 @@
|
|
325
297
|
return handler;
|
326
298
|
};
|
327
299
|
|
328
|
-
// line 333, opal-jquery/element, Element#on
|
329
300
|
Element_prototype.$on = TMP_3 = function(event_name, selector) {
|
330
301
|
var __context, block;
|
331
302
|
block = TMP_3._p || nil, __context = block._s, TMP_3._p = null;
|
@@ -367,7 +338,6 @@
|
|
367
338
|
|
368
339
|
Element_prototype.$trigger = Element_prototype.trigger;
|
369
340
|
|
370
|
-
// line 369, opal-jquery/element, Element#value
|
371
341
|
Element_prototype.$value = function() {
|
372
342
|
|
373
343
|
return this.val() || "";
|
@@ -379,8 +349,7 @@
|
|
379
349
|
|
380
350
|
Element_prototype.$show = Element_prototype.show;
|
381
351
|
|
382
|
-
Element_prototype.$toggle = Element_prototype.toggle;
|
383
|
-
;Element._sdonate(["$find", "$id", "$new", "$parse"]);
|
352
|
+
return Element_prototype.$toggle = Element_prototype.toggle;
|
384
353
|
})(self, jQuery)
|
385
354
|
})();
|
386
355
|
// lib/opal-jquery/event.rb
|
@@ -388,12 +357,11 @@
|
|
388
357
|
var __opal = Opal, self = __opal.top, __scope = __opal, nil = __opal.nil, __breaker = __opal.breaker, __slice = __opal.slice, __klass = __opal.klass;
|
389
358
|
|
390
359
|
return (function(__base, __super){
|
391
|
-
// line 1, opal-jquery/event, class Event
|
392
360
|
function Event() {};
|
393
361
|
Event = __klass(__base, __super, "Event", Event);
|
362
|
+
|
394
363
|
var Event_prototype = Event.prototype, __scope = Event._scope;
|
395
364
|
|
396
|
-
// line 2, opal-jquery/event, Event#current_target
|
397
365
|
Event_prototype.$current_target = function() {
|
398
366
|
|
399
367
|
return $(this.currentTarget);
|
@@ -403,13 +371,11 @@
|
|
403
371
|
|
404
372
|
Event_prototype.$prevent_default = Event_prototype.preventDefault;
|
405
373
|
|
406
|
-
// line 10, opal-jquery/event, Event#page_x
|
407
374
|
Event_prototype.$page_x = function() {
|
408
375
|
|
409
376
|
return this.pageX;
|
410
377
|
};
|
411
378
|
|
412
|
-
// line 14, opal-jquery/event, Event#page_y
|
413
379
|
Event_prototype.$page_y = function() {
|
414
380
|
|
415
381
|
return this.pageY;
|
@@ -419,7 +385,6 @@
|
|
419
385
|
|
420
386
|
Event_prototype.$stop_propagation = Event_prototype.stopPropagation;
|
421
387
|
|
422
|
-
// line 22, opal-jquery/event, Event#target
|
423
388
|
Event_prototype.$target = function() {
|
424
389
|
|
425
390
|
|
@@ -431,82 +396,73 @@
|
|
431
396
|
|
432
397
|
};
|
433
398
|
|
434
|
-
// line 32, opal-jquery/event, Event#type
|
435
399
|
Event_prototype.$type = function() {
|
436
400
|
|
437
401
|
return this.type;
|
438
402
|
};
|
439
403
|
|
440
|
-
// line 36, opal-jquery/event, Event#which
|
441
404
|
Event_prototype.$which = function() {
|
442
405
|
|
443
406
|
return this.which;
|
444
407
|
};
|
445
408
|
|
409
|
+
return nil;
|
446
410
|
})(self, $.Event)
|
447
411
|
})();
|
448
412
|
// lib/opal-jquery/http.rb
|
449
413
|
(function() {
|
450
|
-
var __opal = Opal, self = __opal.top, __scope = __opal, nil = __opal.nil, __breaker = __opal.breaker, __slice = __opal.slice, __klass = __opal.klass,
|
414
|
+
var __opal = Opal, self = __opal.top, __scope = __opal, nil = __opal.nil, __breaker = __opal.breaker, __slice = __opal.slice, __klass = __opal.klass, __hash2 = __opal.hash2;
|
451
415
|
|
452
416
|
return (function(__base, __super){
|
453
|
-
// line 7, opal-jquery/http, class HTTP
|
454
417
|
function HTTP() {};
|
455
418
|
HTTP = __klass(__base, __super, "HTTP", HTTP);
|
456
|
-
|
419
|
+
|
420
|
+
;HTTP._sdonate(["$get", "$post"]); var HTTP_prototype = HTTP.prototype, __scope = HTTP._scope, TMP_1, TMP_2, TMP_3, TMP_4;
|
457
421
|
HTTP_prototype.body = HTTP_prototype.error_message = HTTP_prototype.method = HTTP_prototype.status_code = HTTP_prototype.url = HTTP_prototype.errback = HTTP_prototype.json = HTTP_prototype.ok = HTTP_prototype.settings = HTTP_prototype.callback = nil;
|
458
422
|
|
459
|
-
// line 8, opal-jquery/http, HTTP#body
|
460
423
|
HTTP_prototype.$body = function() {
|
461
424
|
|
462
425
|
return this.body
|
463
|
-
};
|
426
|
+
}, nil;
|
464
427
|
|
465
|
-
// line 9, opal-jquery/http, HTTP#error_message
|
466
428
|
HTTP_prototype.$error_message = function() {
|
467
429
|
|
468
430
|
return this.error_message
|
469
|
-
};
|
431
|
+
}, nil;
|
470
432
|
|
471
|
-
// line 10, opal-jquery/http, HTTP#method
|
472
433
|
HTTP_prototype.$method = function() {
|
473
434
|
|
474
435
|
return this.method
|
475
|
-
};
|
436
|
+
}, nil;
|
476
437
|
|
477
|
-
// line 11, opal-jquery/http, HTTP#status_code
|
478
438
|
HTTP_prototype.$status_code = function() {
|
479
439
|
|
480
440
|
return this.status_code
|
481
|
-
};
|
441
|
+
}, nil;
|
482
442
|
|
483
|
-
// line 12, opal-jquery/http, HTTP#url
|
484
443
|
HTTP_prototype.$url = function() {
|
485
444
|
|
486
445
|
return this.url
|
487
|
-
};
|
446
|
+
}, nil;
|
488
447
|
|
489
|
-
// line 14, opal-jquery/http, HTTP.get
|
490
448
|
HTTP.$get = TMP_1 = function(url, opts) {
|
491
449
|
var __context, block;
|
492
450
|
block = TMP_1._p || nil, __context = block._s, TMP_1._p = null;
|
493
451
|
if (opts == null) {
|
494
|
-
opts =
|
452
|
+
opts = __hash2([], {})
|
495
453
|
}
|
496
454
|
return this.$new(url, "GET", opts, block)['$send!']()
|
497
455
|
};
|
498
456
|
|
499
|
-
// line 18, opal-jquery/http, HTTP.post
|
500
457
|
HTTP.$post = TMP_2 = function(url, opts) {
|
501
458
|
var __context, block;
|
502
459
|
block = TMP_2._p || nil, __context = block._s, TMP_2._p = null;
|
503
460
|
if (opts == null) {
|
504
|
-
opts =
|
461
|
+
opts = __hash2([], {})
|
505
462
|
}
|
506
463
|
return this.$new(url, "POST", opts, block)['$send!']()
|
507
464
|
};
|
508
465
|
|
509
|
-
// line 22, opal-jquery/http, HTTP#initialize
|
510
466
|
HTTP_prototype.$initialize = function(url, method, options, handler) {
|
511
467
|
var http = nil, settings = nil;if (handler == null) {
|
512
468
|
handler = nil
|
@@ -541,7 +497,6 @@
|
|
541
497
|
return this.settings = settings;
|
542
498
|
};
|
543
499
|
|
544
|
-
// line 56, opal-jquery/http, HTTP#callback
|
545
500
|
HTTP_prototype.$callback = TMP_3 = function() {
|
546
501
|
var __context, block;
|
547
502
|
block = TMP_3._p || nil, __context = block._s, TMP_3._p = null;
|
@@ -550,7 +505,6 @@
|
|
550
505
|
return this;
|
551
506
|
};
|
552
507
|
|
553
|
-
// line 61, opal-jquery/http, HTTP#errback
|
554
508
|
HTTP_prototype.$errback = TMP_4 = function() {
|
555
509
|
var __context, block;
|
556
510
|
block = TMP_4._p || nil, __context = block._s, TMP_4._p = null;
|
@@ -559,7 +513,6 @@
|
|
559
513
|
return this;
|
560
514
|
};
|
561
515
|
|
562
|
-
// line 66, opal-jquery/http, HTTP#fail
|
563
516
|
HTTP_prototype.$fail = function() {
|
564
517
|
var __a;
|
565
518
|
this.ok = false;
|
@@ -570,26 +523,22 @@
|
|
570
523
|
};
|
571
524
|
};
|
572
525
|
|
573
|
-
// line 83, opal-jquery/http, HTTP#json
|
574
526
|
HTTP_prototype.$json = function() {
|
575
527
|
var __a;
|
576
528
|
return ((__a = this.json), __a !== false && __a !== nil ? __a : __scope.JSON.$parse(this.body));
|
577
529
|
};
|
578
530
|
|
579
|
-
// line 98, opal-jquery/http, HTTP#ok?
|
580
531
|
HTTP_prototype['$ok?'] = function() {
|
581
532
|
|
582
533
|
return this.ok;
|
583
534
|
};
|
584
535
|
|
585
|
-
// line 105, opal-jquery/http, HTTP#send!
|
586
536
|
HTTP_prototype['$send!'] = function() {
|
587
537
|
|
588
538
|
$.ajax(this.settings);
|
589
539
|
return this;
|
590
540
|
};
|
591
541
|
|
592
|
-
// line 110, opal-jquery/http, HTTP#succeed
|
593
542
|
HTTP_prototype.$succeed = function() {
|
594
543
|
var __a;
|
595
544
|
if ((__a = this.callback) !== false && __a !== nil) {
|
@@ -598,7 +547,8 @@
|
|
598
547
|
return nil
|
599
548
|
};
|
600
549
|
};
|
601
|
-
|
550
|
+
|
551
|
+
return nil;
|
602
552
|
})(self, null)
|
603
553
|
})();
|
604
554
|
// lib/opal-jquery/kernel.rb
|
@@ -606,12 +556,10 @@
|
|
606
556
|
var __opal = Opal, self = __opal.top, __scope = __opal, nil = __opal.nil, __breaker = __opal.breaker, __slice = __opal.slice, __module = __opal.module;
|
607
557
|
|
608
558
|
return (function(__base){
|
609
|
-
// line 1, opal-jquery/kernel, module Kernel
|
610
559
|
function Kernel() {};
|
611
560
|
Kernel = __module(__base, "Kernel", Kernel);
|
612
561
|
var Kernel_prototype = Kernel.prototype, __scope = Kernel._scope;
|
613
562
|
|
614
|
-
// line 2, opal-jquery/kernel, Kernel#alert
|
615
563
|
Kernel_prototype.$alert = function(msg) {
|
616
564
|
|
617
565
|
alert(msg);
|
@@ -625,12 +573,10 @@
|
|
625
573
|
var __opal = Opal, self = __opal.top, __scope = __opal, nil = __opal.nil, __breaker = __opal.breaker, __slice = __opal.slice, __module = __opal.module;
|
626
574
|
|
627
575
|
return (function(__base){
|
628
|
-
// line 1, opal-jquery/local_storage, module LocalStorage
|
629
576
|
function LocalStorage() {};
|
630
577
|
LocalStorage = __module(__base, "LocalStorage", LocalStorage);
|
631
578
|
var LocalStorage_prototype = LocalStorage.prototype, __scope = LocalStorage._scope;
|
632
579
|
|
633
|
-
// line 2, opal-jquery/local_storage, LocalStorage.[]
|
634
580
|
LocalStorage['$[]'] = function(key) {
|
635
581
|
|
636
582
|
|
@@ -639,20 +585,17 @@
|
|
639
585
|
|
640
586
|
};
|
641
587
|
|
642
|
-
// line 9, opal-jquery/local_storage, LocalStorage.[]=
|
643
588
|
LocalStorage['$[]='] = function(key, value) {
|
644
589
|
|
645
590
|
return localStorage.setItem(key, value);
|
646
591
|
};
|
647
592
|
|
648
|
-
// line 13, opal-jquery/local_storage, LocalStorage.clear
|
649
593
|
LocalStorage.$clear = function() {
|
650
594
|
|
651
595
|
localStorage.clear();
|
652
596
|
return this;
|
653
597
|
};
|
654
598
|
|
655
|
-
// line 18, opal-jquery/local_storage, LocalStorage.delete
|
656
599
|
LocalStorage.$delete = function(key) {
|
657
600
|
|
658
601
|
|