Commit 5140aaee9246d1f7bd026f3dd888da6f32065a7a

Authored by Fernando Brito
1 parent 3ed60ab8
Exists in master and in 2 other branches v2, wikilibras

Put some javascript code inside jQuery onDocumentLoad

app/views/v_libras/requests/_position_step.haml
@@ -4,18 +4,20 @@ @@ -4,18 +4,20 @@
4 = html5_video_tag(['/system/videos/workflow/localizacao.webm', '/system/videos/workflow/localizacao.mp4'], 'id-4', 'video-wizard') 4 = html5_video_tag(['/system/videos/workflow/localizacao.webm', '/system/videos/workflow/localizacao.mp4'], 'id-4', 'video-wizard')
5 5
6 :javascript 6 :javascript
7 - var optionsPosition = {  
8 - video: { width: 940, height: 530 },  
9 - buttons: [ { id: 'b_loc_1', path: '/system/images/loc/p_1.png', clickable: false, start: 7.6, end: 8.5, x: 670, y: 340, delay: 300, value: null },  
10 - { id: 'b_loc_2', path: '/system/images/loc/p_2.png', clickable: false, start: 10, end: 10.5, x: 160, y: 340, delay: 300, value: null },  
11 - { id: 'b_loc_3', path: '/system/images/loc/p_3.png', clickable: false, start: 12, end: 12.5, x: 210, y: 40, delay: 300, value: null },  
12 - { id: 'b_loc_4', path: '/system/images/loc/p_4.png', clickable: false, start: 14, end: 14.5, x: 650, y: 80, delay: 300, value: null },  
13 - { id: 'b_loc_5', path: '/system/images/loc/p_4.png', clickable: true, start: 19.1, end: null, x: 30, y: 30, delay: 300, value: "superior-esquerdo" },  
14 - { id: 'b_loc_6', path: '/system/images/loc/p_3.png', clickable: true, start: 19.1, end: null, x: 680, y: 30, delay: 300, value: "superior-direito" },  
15 - { id: 'b_loc_7', path: '/system/images/loc/p_1.png', clickable: true, start: 19.1, end: null, x: 568, y: 410, delay: 300, value: "inferior-direito" },  
16 - { id: 'b_loc_8', path: '/system/images/loc/p_2.png', clickable: true, start: 19.1, end: null, x: -310, y: 410, delay: 300, value: "inferior-esquerdo" }  
17 - ]  
18 - }; 7 + $(function () {
  8 + var optionsPosition = {
  9 + video: { width: 940, height: 530 },
  10 + buttons: [ { id: 'b_loc_1', path: '/system/images/loc/p_1.png', clickable: false, start: 7.6, end: 8.5, x: 670, y: 340, delay: 300, value: null },
  11 + { id: 'b_loc_2', path: '/system/images/loc/p_2.png', clickable: false, start: 10, end: 10.5, x: 160, y: 340, delay: 300, value: null },
  12 + { id: 'b_loc_3', path: '/system/images/loc/p_3.png', clickable: false, start: 12, end: 12.5, x: 210, y: 40, delay: 300, value: null },
  13 + { id: 'b_loc_4', path: '/system/images/loc/p_4.png', clickable: false, start: 14, end: 14.5, x: 650, y: 80, delay: 300, value: null },
  14 + { id: 'b_loc_5', path: '/system/images/loc/p_4.png', clickable: true, start: 19.1, end: null, x: 30, y: 30, delay: 300, value: "superior-esquerdo" },
  15 + { id: 'b_loc_6', path: '/system/images/loc/p_3.png', clickable: true, start: 19.1, end: null, x: 680, y: 30, delay: 300, value: "superior-direito" },
  16 + { id: 'b_loc_7', path: '/system/images/loc/p_1.png', clickable: true, start: 19.1, end: null, x: 568, y: 410, delay: 300, value: "inferior-direito" },
  17 + { id: 'b_loc_8', path: '/system/images/loc/p_2.png', clickable: true, start: 19.1, end: null, x: -310, y: 410, delay: 300, value: "inferior-esquerdo" }
  18 + ]
  19 + };
19 20
20 - var VLibrasPosition = new VLibrasLocalization();  
21 - VLibrasPosition.init("#position-step", optionsPosition);  
22 \ No newline at end of file 21 \ No newline at end of file
  22 + var VLibrasPosition = new VLibrasLocalization();
  23 + VLibrasPosition.init("#position-step", optionsPosition);
  24 + });
23 \ No newline at end of file 25 \ No newline at end of file
app/views/v_libras/requests/_service_step.haml
@@ -12,15 +12,17 @@ @@ -12,15 +12,17 @@
12 12
13 13
14 :javascript 14 :javascript
15 - var optionsService = {  
16 - video: { width: 940, height: 530 },  
17 - buttons: [ { id: 'b_aS_1', path: '/system/images/sub_audio/p_1.png', clickable: false, start: 20, end: 21, x: 700, y: 390, delay: 300, value: null },  
18 - { id: 'b_aS_2', path: '/system/images/sub_audio/p_2.png', clickable: false, start: 24.5, end: 25.5, x: 150, y: 410, delay: 300, value: null },  
19 - { id: 'btn-video-legenda', path: '/system/images/sub_audio/p_1.png', clickable: true, start: 26, end: null, x: 790, y: 410, delay: 300 },  
20 - { id: 'btn-video', path: '/system/images/sub_audio/p_2.png', clickable: true, start: 26, end: null, x: -80, y: 410, delay: 300 }  
21 - ]  
22 - }; 15 + $(function () {
  16 + var optionsService = {
  17 + video: { width: 940, height: 530 },
  18 + buttons: [ { id: 'b_aS_1', path: '/system/images/sub_audio/p_1.png', clickable: false, start: 20, end: 21, x: 700, y: 390, delay: 300, value: null },
  19 + { id: 'b_aS_2', path: '/system/images/sub_audio/p_2.png', clickable: false, start: 24.5, end: 25.5, x: 150, y: 410, delay: 300, value: null },
  20 + { id: 'btn-video-legenda', path: '/system/images/sub_audio/p_1.png', clickable: true, start: 26, end: null, x: 790, y: 410, delay: 300 },
  21 + { id: 'btn-video', path: '/system/images/sub_audio/p_2.png', clickable: true, start: 26, end: null, x: -80, y: 410, delay: 300 }
  22 + ]
  23 + };
23 24
24 - var VLibrasSubAudio = new VLibrasLocalization();  
25 - VLibrasSubAudio.init("#service-step", optionsService); 25 + var VLibrasSubAudio = new VLibrasLocalization();
  26 + VLibrasSubAudio.init("#service-step", optionsService);
  27 + });
26 28
app/views/v_libras/requests/_size_step.haml
@@ -4,17 +4,19 @@ @@ -4,17 +4,19 @@
4 = html5_video_tag(['/system/videos/workflow/tamanho.webm', '/system/videos/workflow/tamanho.mp4'], 'id-3', 'video-wizard') 4 = html5_video_tag(['/system/videos/workflow/tamanho.webm', '/system/videos/workflow/tamanho.mp4'], 'id-3', 'video-wizard')
5 5
6 :javascript 6 :javascript
7 - var optionsSize = {  
8 - video: { width: 940, height: 530 },  
9 - buttons: [ { id: 'b_size_1', path: '/system/images/size/p_1.png', clickable: false, start: 6.8, end: 7.8, x: 770, y: 400, delay: 300, value: null },  
10 - { id: 'b_size_2', path: '/system/images/size/p_2.png', clickable: false, start: 8.2, end: 9.2, x: 714, y: 355, delay: 300, value: null },  
11 - { id: 'b_size_3', path: '/system/images/size/p_3.png', clickable: false, start: 9.7, end: 10.7, x: 658, y: 310, delay: 300, value: null},  
12 - { id: 'b_size_4', path: '/system/images/size/p_1.png', clickable: true, start: 11.3, end: null, x: 780, y: 320, delay: 300, value: "pequeno" },  
13 - { id: 'b_size_5', path: '/system/images/size/p_2.png', clickable: true, start: 11.3, end: null, x: 610, y: 320, delay: 300, value: "medio" },  
14 - { id: 'b_size_6', path: '/system/images/size/p_3.png', clickable: true, start: 11.3, end: null, x: 384, y: 320, delay: 300, value: "grande" }  
15 - ]  
16 - }; 7 + $(function () {
  8 + var optionsSize = {
  9 + video: { width: 940, height: 530 },
  10 + buttons: [ { id: 'b_size_1', path: '/system/images/size/p_1.png', clickable: false, start: 6.8, end: 7.8, x: 770, y: 400, delay: 300, value: null },
  11 + { id: 'b_size_2', path: '/system/images/size/p_2.png', clickable: false, start: 8.2, end: 9.2, x: 714, y: 355, delay: 300, value: null },
  12 + { id: 'b_size_3', path: '/system/images/size/p_3.png', clickable: false, start: 9.7, end: 10.7, x: 658, y: 310, delay: 300, value: null},
  13 + { id: 'b_size_4', path: '/system/images/size/p_1.png', clickable: true, start: 11.3, end: null, x: 780, y: 320, delay: 300, value: "pequeno" },
  14 + { id: 'b_size_5', path: '/system/images/size/p_2.png', clickable: true, start: 11.3, end: null, x: 610, y: 320, delay: 300, value: "medio" },
  15 + { id: 'b_size_6', path: '/system/images/size/p_3.png', clickable: true, start: 11.3, end: null, x: 384, y: 320, delay: 300, value: "grande" }
  16 + ]
  17 + };
17 18
18 - var VLibrasSize = new VLibrasLocalization();  
19 - VLibrasSize.init("#size-step", optionsSize); 19 + var VLibrasSize = new VLibrasLocalization();
  20 + VLibrasSize.init("#size-step", optionsSize);
  21 + });
20 22
app/views/v_libras/requests/_video_step.haml
@@ -12,12 +12,14 @@ @@ -12,12 +12,14 @@
12 12
13 13
14 :javascript 14 :javascript
15 - var optionsVideo = {  
16 - video: { width: 940, height: 530 },  
17 - buttons: [ ]  
18 - }; 15 + $(function () {
  16 + var optionsVideo = {
  17 + video: { width: 940, height: 530 },
  18 + buttons: [ ]
  19 + };
19 20
20 - var VLibrasVideo = new VLibrasLocalization();  
21 - VLibrasVideo.init("#video-step", optionsVideo); 21 + var VLibrasVideo = new VLibrasLocalization();
  22 + VLibrasVideo.init("#video-step", optionsVideo);
22 23
23 - VLibrasVideo.play();  
24 \ No newline at end of file 24 \ No newline at end of file
  25 + VLibrasVideo.play();
  26 + });
25 \ No newline at end of file 27 \ No newline at end of file