11< div >
2- < script src ="
https://cdn.jsdelivr.net/npm/[email protected] /dist/jquery.min.js "
> </ script > 3- < link href ="
https://cdn.jsdelivr.net/npm/[email protected] /dist/css/select2.min.css "
rel ="
stylesheet "
/> 4- < script src ="
https://cdn.jsdelivr.net/npm/[email protected] /dist/js/select2.min.js "
> </ script > 2+ < script src ="
https://cdn.jsdelivr.net/npm/[email protected] /dist/jquery.min.js "
> </ script > 3+ < link href ="
https://cdn.jsdelivr.net/npm/[email protected] /dist/css/select2.min.css "
rel ="
stylesheet "
/> 4+ < script src ="
https://cdn.jsdelivr.net/npm/[email protected] /dist/js/select2.min.js "
> </ script > 55
6- < script >
7- function callAlert ( name ) {
8- alert ( "hello, " + name ) ;
9- }
6+ < script >
7+ function callAlert ( name ) {
8+ alert ( "hello, " + name ) ;
9+ }
1010
11- var HelloJs = ( function ( ) {
12- var self = { } ;
11+ var HelloJs = ( function ( ) {
12+ var self = { } ;
1313
14- self . hello = function ( name ) {
15- alert ( "Hello " + name )
16- }
14+ self . hello = function ( name ) {
15+ alert ( "Hello " + name )
16+ }
1717
18- return self ;
19- } ( ) ) ;
20- </ script >
18+ return self ;
19+ } ( ) ) ;
20+ </ script >
2121
22+ < h2 >
23+ < button unicorn:click ="call_javascript "> Component view calls JavaScript</ button >
24+ < button unicorn:click ="call_javascript_module "> Component view calls JavaScript module</ button >
25+ </ h2 >
26+
27+ < div >
2228 < h2 >
23- < button unicorn:click ="call_javascript "> Component view calls JavaScript</ button >
24- < button unicorn:click ="call_javascript_module "> Component view calls JavaScript module</ button >
29+ < code > javascript_exclude states</ code >
2530 </ h2 >
31+ {% for state in states %}
32+ {{ state }}
33+ {% endfor %}
34+ </ div >
2635
27- < div >
28- < h2 >
29- < code > javascript_exclude states</ code >
30- </ h2 >
31- {% for state in states %}
32- {{ state }}
33- {% endfor %}
34- </ div >
36+ < h2 > Select2</ h2 >
3537
36- < h2 > Select2</ h2 >
38+ < div u:ignore >
39+ < select unicorn:model ="selected_state " class ="form-control " id ="select2-example " required
40+ onchange ="Unicorn.call('js', 'select_state', this.value, this.selectedIndex); ">
41+ {% for state in states %}
42+ < option value ="{{ state }} "> {{ state }}</ option >
43+ {% endfor %}
44+ </ select >
3745
38- < div u:ignore >
39- < select unicorn:model ="selected_state " class ="form-control " id ="select2-example " required onchange ="Unicorn.call('js', 'select_state', this.value, this.selectedIndex); ">
40- {% for state in states %}
41- < option value ="{{ state }} "> {{ state }}</ option >
42- {% endfor %}
43- </ select >
46+ States (in ignored div): {{ states }}
47+ </ div >
4448
45- States (in ignored div): {{ states }}
46- </ div >
49+ selected_state: {{ selected_state }}
4750
48- selected_state: {{ selected_state }}
51+ < script >
52+ $ ( document ) . ready ( function ( ) {
53+ $ ( '#select2-example' ) . select2 ( ) ;
54+ } ) ;
55+ </ script >
4956
50- < script >
51- $ ( document ) . ready ( function ( ) {
52- $ ( '#select2-example' ) . select2 ( ) ;
53- } ) ;
54- </ script >
57+ < div >
58+ States (not in ignored div): {{ states }}< br />
59+ < button type ="submit " u:click ="change_states "> Change states</ button >
60+ </ div >
5561
62+ < div >
63+ < input type ="text " u:model ="select2_datetime " />
64+ < button type ="submit " u:click ="get_now "> Get now</ button >
5665 < div >
57- States (not in ignored div): {{ states }}< br />
58- < button type ="submit " u:click ="change_states "> Change states</ button >
66+ select2_datetime: {{ select2_datetime }}
5967 </ div >
68+ </ div >
6069
61- < div >
62- < input type ="text " u:model ="select2_datetime " />
63- < button type ="submit " u:click ="get_now "> Get now</ button >
64- < div >
65- select2_datetime: {{ select2_datetime }}
66- </ div >
67- </ div >
70+ < div unicorn:key ="visibility ">
71+ < span unicorn:visible.threshold-25.debounce-1000 ="increase_counter " unicorn:partial ="visibility ">
72+ Number of times this span was scrolled into view: {{ scroll_counter }}
73+ </ span >
74+ </ div >
6875</ div >
0 commit comments