Commit e4f5950c9f2fe3a3bbfd1b2c3dcea8e122d33f1f

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

[Workflow] Remove "next" button and make things automatic

app/assets/javascripts/v_libras/requests/new.js
@@ -7,6 +7,8 @@ $(function () { @@ -7,6 +7,8 @@ $(function () {
7 enablePagination: true, 7 enablePagination: true,
8 forceMoveForward: true, 8 forceMoveForward: true,
9 9
  10 + // startIndex: 1,
  11 +
10 onStepChanged: stepChanged, 12 onStepChanged: stepChanged,
11 onFinished: finished, 13 onFinished: finished,
12 14
@@ -110,12 +112,13 @@ $(function () { @@ -110,12 +112,13 @@ $(function () {
110 console.debug("Serviço: video-legenda"); 112 console.debug("Serviço: video-legenda");
111 113
112 $("#vlibras-form").addHidden('service', 'video-legenda'); 114 $("#vlibras-form").addHidden('service', 'video-legenda');
113 - $("#subtitle-upload").parent().parent().show();  
114 - $("#menu").show(); 115 + // $("#subtitle-upload-container").show();
  116 + $("#subtitle-upload").click();
  117 + // $("#menu").show();
115 118
116 - $('html, body').animate({  
117 - scrollTop: $("#subtitle-upload").offset().top  
118 - }, 600); 119 + // $('html, body').animate({
  120 + // scrollTop: $("#subtitle-upload").offset().top
  121 + // }, 600);
119 122
120 return false; 123 return false;
121 }); 124 });
@@ -129,6 +132,12 @@ $(function () { @@ -129,6 +132,12 @@ $(function () {
129 return false; 132 return false;
130 }); 133 });
131 134
  135 + $("#vlibras-wizard").on("click", "#btn-video-upload", function() {
  136 + $("#video-upload").click();
  137 +
  138 + return false;
  139 + });
  140 +
132 141
133 142
134 /* 143 /*
@@ -150,9 +159,8 @@ $(function () { @@ -150,9 +159,8 @@ $(function () {
150 var isValidFile = checkType(input, acceptedFileTypes); 159 var isValidFile = checkType(input, acceptedFileTypes);
151 160
152 if (isValidFile) { 161 if (isValidFile) {
153 - activateNextButton(); 162 + $("#vlibras-wizard").steps('next');
154 } else { 163 } else {
155 - deactivateNextButton();  
156 input.val(null); 164 input.val(null);
157 alert("Apenas os formatos abaixo são aceitos:\n\n" + acceptedFileTypes.join(", ")); 165 alert("Apenas os formatos abaixo são aceitos:\n\n" + acceptedFileTypes.join(", "));
158 } 166 }
app/helpers/application_helper.rb
@@ -46,14 +46,14 @@ module ApplicationHelper @@ -46,14 +46,14 @@ module ApplicationHelper
46 :data => { 'toggle' => "tooltip" }, :title => request.response) 46 :data => { 'toggle' => "tooltip" }, :title => request.response)
47 end 47 end
48 48
49 - def html5_video_tag(url, id, classes, data_options, *args) 49 + def html5_video_tag(url, id, classes, data_options = nil, *args)
50 options = args.first || {} 50 options = args.first || {}
51 51
52 options[:id] = id 52 options[:id] = id
53 options[:class] = "video-js vjs-default-skin vjs-big-play-centered #{classes}" 53 options[:class] = "video-js vjs-default-skin vjs-big-play-centered #{classes}"
54 options[:width] = 'auto' 54 options[:width] = 'auto'
55 options[:height] = 'auto' 55 options[:height] = 'auto'
56 - options['data-setup'] = data_options 56 + options['data-setup'] = data_options if data_options != nil
57 57
58 content_tag(:video, options) do 58 content_tag(:video, options) do
59 if url.class == String 59 if url.class == String
app/views/v_libras/requests/_position_step.haml
@@ -2,15 +2,15 @@ @@ -2,15 +2,15 @@
2 .video_wrapper 2 .video_wrapper
3 3
4 = html5_video_tag(['/system/videos/workflow/localizacao.webm', '/system/videos/workflow/localizacao.mp4'], 4 = html5_video_tag(['/system/videos/workflow/localizacao.webm', '/system/videos/workflow/localizacao.mp4'],
5 - 'id-4', 'video-wizard', '{ "preload": true, "controls": false }') 5 + 'id-4', 'video-wizard', '{ "preload": "none", "controls": false }')
6 6
7 - content_for :javascript_code do 7 - content_for :javascript_code do
8 :javascript 8 :javascript
9 $(function () { 9 $(function () {
10 var optionsPosition = { 10 var optionsPosition = {
11 video: { width: 940, height: 530 }, 11 video: { width: 940, height: 530 },
12 - buttons: [ { id: 'btn-red-light3', path: '/system/images/video/red-button.png', clickable: false, start: 0.1, end: 19.5, x: 440, y: 510, delay: 300, value: null },  
13 - { id: 'btn-green-light3', path: '/system/images/video/green-button.png', clickable: false, start: 19.5, end: 999, x: 440, y: 510, delay: 300, value: null }, 12 + buttons: [ { id: 'btn-red-light3', path: '/system/images/video/red-button.png', clickable: false, start: 0.1, end: 19.1, x: 440, y: 510, delay: 300, value: null },
  13 + { id: 'btn-green-light3', path: '/system/images/video/green-button.png', clickable: false, start: 19.1, end: 999, x: 440, y: 510, delay: 300, value: null },
14 { 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 }, 14 { 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 },
15 { 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 }, 15 { 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 },
16 { 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 }, 16 { 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 },
app/views/v_libras/requests/_service_step.haml
@@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
2 .video_wrapper 2 .video_wrapper
3 3
4 = html5_video_tag(['/system/videos/workflow/sub_audio.webm', '/system/videos/workflow/sub_audio.mp4'], 4 = html5_video_tag(['/system/videos/workflow/sub_audio.webm', '/system/videos/workflow/sub_audio.mp4'],
5 - 'id-2', 'video-wizard', '{ "preload": true, "controls": false }') 5 + 'id-2', 'video-wizard', '{ "preload": "none", "controls": false }')
6 6
7 .row-fluid.hide 7 .row-fluid.hide
8 .span1.offset3 8 .span1.offset3
@@ -17,8 +17,8 @@ @@ -17,8 +17,8 @@
17 $(function () { 17 $(function () {
18 var optionsService = { 18 var optionsService = {
19 video: { width: 940, height: 530 }, 19 video: { width: 940, height: 530 },
20 - buttons: [ { id: 'btn-red-light2', path: '/system/images/video/red-button.png', clickable: false, start: 0.1, end: 26.5, x: 440, y: 510, delay: 300, value: null },  
21 - { id: 'btn-green-light2', path: '/system/images/video/green-button.png', clickable: false, start: 26.5, end: 999, x: 440, y: 510, delay: 300, value: null }, 20 + buttons: [ { id: 'btn-red-light2', path: '/system/images/video/red-button.png', clickable: false, start: 0.1, end: 26, x: 440, y: 510, delay: 300, value: null },
  21 + { id: 'btn-green-light2', path: '/system/images/video/green-button.png', clickable: false, start: 26, end: 999, x: 440, y: 510, delay: 300, value: null },
22 { 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 }, 22 { 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 },
23 { 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 }, 23 { 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 },
24 { id: 'btn-video-legenda', path: '/system/images/sub_audio/p_1.png', clickable: true, start: 26, end: 9999, x: 790, y: 410, delay: 300 }, 24 { id: 'btn-video-legenda', path: '/system/images/sub_audio/p_1.png', clickable: true, start: 26, end: 9999, x: 790, y: 410, delay: 300 },
app/views/v_libras/requests/_size_step.haml
@@ -2,7 +2,7 @@ @@ -2,7 +2,7 @@
2 .video_wrapper 2 .video_wrapper
3 3
4 = html5_video_tag(['/system/videos/workflow/tamanho.webm', '/system/videos/workflow/tamanho.mp4'], 4 = html5_video_tag(['/system/videos/workflow/tamanho.webm', '/system/videos/workflow/tamanho.mp4'],
5 - 'id-3', 'video-wizard', '{ "preload": true, "controls": false }') 5 + 'id-3', 'video-wizard', '{ "preload": "none", "controls": false }')
6 6
7 7
8 - content_for :javascript_code do 8 - content_for :javascript_code do
@@ -10,8 +10,8 @@ @@ -10,8 +10,8 @@
10 $(function () { 10 $(function () {
11 var optionsSize = { 11 var optionsSize = {
12 video: { width: 940, height: 530 }, 12 video: { width: 940, height: 530 },
13 - buttons: [ { id: 'btn-red-light4', path: '/system/images/video/red-button.png', clickable: false, start: 0.1, end: 11.5, x: 440, y: 510, delay: 300, value: null },  
14 - { id: 'btn-green-light4', path: '/system/images/video/green-button.png', clickable: false, start: 11.5, end: 999, x: 440, y: 510, delay: 300, value: null }, 13 + buttons: [ { id: 'btn-red-light4', path: '/system/images/video/red-button.png', clickable: false, start: 0.1, end: 11.3, x: 440, y: 510, delay: 300, value: null },
  14 + { id: 'btn-green-light4', path: '/system/images/video/green-button.png', clickable: false, start: 11.3, end: 999, x: 440, y: 510, delay: 300, value: null },
15 { id: 'b1_size_small', path: '/system/images/size/p_1.png', clickable: false, start: 6.8, end: 7.8, x: 688, y: 338, delay: 300, value: null }, 15 { id: 'b1_size_small', path: '/system/images/size/p_1.png', clickable: false, start: 6.8, end: 7.8, x: 688, y: 338, delay: 300, value: null },
16 { id: 'b1_size_med', path: '/system/images/size/p_2.png', clickable: false, start: 8.2, end: 9.2, x: 628, y: 292, delay: 300, value: null }, 16 { id: 'b1_size_med', path: '/system/images/size/p_2.png', clickable: false, start: 8.2, end: 9.2, x: 628, y: 292, delay: 300, value: null },
17 { id: 'b1_size_big', path: '/system/images/size/p_3.png', clickable: false, start: 9.7, end: 10.7, x: 560, y: 240, delay: 300, value: null}, 17 { id: 'b1_size_big', path: '/system/images/size/p_3.png', clickable: false, start: 9.7, end: 10.7, x: 560, y: 240, delay: 300, value: null},
app/views/v_libras/requests/_video_step.haml
@@ -2,9 +2,9 @@ @@ -2,9 +2,9 @@
2 .video_wrapper 2 .video_wrapper
3 3
4 = html5_video_tag(['/system/videos/workflow/video.webm', '/system/videos/workflow/video.mp4'], 4 = html5_video_tag(['/system/videos/workflow/video.webm', '/system/videos/workflow/video.mp4'],
5 - 'id-1', 'video-wizard', '{ "autoplay": true, "controls": false }') 5 + 'video-video', 'video-wizard', '{ "autoplay": true, "controls": false } ')
6 6
7 - .row-fluid 7 + .row-fluid.hide
8 .span1.offset3 8 .span1.offset3
9 = label_tag :video, t('videos.url'), :class => "bold" 9 = label_tag :video, t('videos.url'), :class => "bold"
10 10
@@ -21,7 +21,8 @@ @@ -21,7 +21,8 @@
21 var optionsVideo = { 21 var optionsVideo = {
22 video: { width: 940, height: 530 }, 22 video: { width: 940, height: 530 },
23 buttons: [ { id: 'btn-red-light1', path: '/system/images/video/red-button.png', clickable: false, start: 0.1, end: 25, x: 440, y: 510, delay: 300, value: null }, 23 buttons: [ { id: 'btn-red-light1', path: '/system/images/video/red-button.png', clickable: false, start: 0.1, end: 25, x: 440, y: 510, delay: 300, value: null },
24 - { id: 'btn-green-light1', path: '/system/images/video/green-button.png', clickable: false, start: 25, end: 999, x: 440, y: 510, delay: 300, value: null } 24 + { id: 'btn-green-light1', path: '/system/images/video/green-button.png', clickable: false, start: 25, end: 999, x: 440, y: 510, delay: 300, value: null },
  25 + { id: 'btn-video-upload', path: '/system/images/sub_audio/p_2.png', clickable: true, start: 25, end: 9999, x: 415, y: 410, delay: 300 }
25 ] 26 ]
26 }; 27 };
27 28
app/views/v_libras/requests/new.haml
@@ -32,7 +32,7 @@ @@ -32,7 +32,7 @@
32 %section 32 %section
33 = render :partial => 'size_step' 33 = render :partial => 'size_step'
34 34
35 - #menu.center 35 + #menu.center.hide
36 = button_tag 'Próximo', :class => "btn btn-large btn-success", :id => 'btn-next', :disabled => true 36 = button_tag 'Próximo', :class => "btn btn-large btn-success", :id => 'btn-next', :disabled => true
37 37
38 .row-fluid 38 .row-fluid
vendor/assets/stylesheets/jquery.steps.css
@@ -142,7 +142,7 @@ @@ -142,7 +142,7 @@
142 background: #eee; 142 background: #eee;
143 display: block; 143 display: block;
144 margin: 0.5em; 144 margin: 0.5em;
145 - min-height: 45em; 145 + min-height: 41.5em;
146 overflow: hidden; 146 overflow: hidden;
147 position: relative; 147 position: relative;
148 width: auto; 148 width: auto;