Commit 05704252bc3774f21bf13e72aa256177ac3eb279

Authored by gtaaas
2 parents add6b809 0b651ac7
Exists in master and in 1 other branch devel

Merge branch 'devel' of git.lavid.ufpb.br:vlibras-web into devel

@@ -12,7 +12,6 @@ GEM @@ -12,7 +12,6 @@ GEM
12 remote: https://rubygems.org/ 12 remote: https://rubygems.org/
13 specs: 13 specs:
14 Ascii85 (1.0.1) 14 Ascii85 (1.0.1)
15 - ZenTest (4.6.2)  
16 actionmailer (3.2.0) 15 actionmailer (3.2.0)
17 actionpack (= 3.2.0) 16 actionpack (= 3.2.0)
18 mail (~> 2.4.0) 17 mail (~> 2.4.0)
@@ -47,13 +46,6 @@ GEM @@ -47,13 +46,6 @@ GEM
47 awesome_print (1.0.2) 46 awesome_print (1.0.2)
48 bcrypt-ruby (3.0.1) 47 bcrypt-ruby (3.0.1)
49 builder (3.0.0) 48 builder (3.0.0)
50 - capybara (1.1.2)  
51 - mime-types (>= 1.16)  
52 - nokogiri (>= 1.3.3)  
53 - rack (>= 1.0.0)  
54 - rack-test (>= 0.5.4)  
55 - selenium-webdriver (~> 2.0)  
56 - xpath (~> 0.1.4)  
57 carrierwave (0.5.8) 49 carrierwave (0.5.8)
58 activesupport (~> 3.0) 50 activesupport (~> 3.0)
59 childprocess (0.3.1) 51 childprocess (0.3.1)
@@ -117,7 +109,7 @@ GEM @@ -117,7 +109,7 @@ GEM
117 mini_magick (3.4) 109 mini_magick (3.4)
118 subexec (~> 0.2.1) 110 subexec (~> 0.2.1)
119 multi_json (1.1.0) 111 multi_json (1.1.0)
120 - mysql2 (0.3.11) 112 + mysql2 (0.3.15)
121 nokogiri (1.5.2) 113 nokogiri (1.5.2)
122 oj (2.1.4) 114 oj (2.1.4)
123 orm_adapter (0.0.6) 115 orm_adapter (0.0.6)
1 --------------------------------- Libras WEB -------------------------------- 1 +--------------------------------- Libras WEB --------------------------------
2 2
3 # Configuração 3 # Configuração
4 4
app/assets/javascripts/site/videos.js
1 // 1 //
2 // Author Igor Amorim - www.igoramorim.com 2 // Author Igor Amorim - www.igoramorim.com
3 // 3 //
  4 +
  5 +function check_subtitle(file) {
  6 + var accepted_file_types = ["srt"];
  7 + return check_type(file, accepted_file_types)
  8 +};
  9 +
  10 +function check_video(file) {
  11 + var accepted_file_types = ["avi", "mp4", "mov", "webm", "wmv", "mkv",];
  12 + return check_type(file, accepted_file_types)
  13 +};
  14 +
  15 +function check_type(file, accepted_file_types) {
  16 +
  17 + var ext = file.value.substring(file.value.lastIndexOf('.') + 1).toLowerCase();
  18 + var isValidFile = false;
  19 +
  20 + for (var i = 0; i < accepted_file_types.length; i++) {
  21 + if (ext == accepted_file_types[i]) {
  22 + isValidFile = true;
  23 + break;
  24 + }
  25 + }
  26 +
  27 + if (!isValidFile) {
  28 + file.value = null;
  29 + alert("Apenas os formatos abaixo são aceitos:\n\n" + accepted_file_types.join(", "));
  30 + }
  31 +
  32 + return isValidFile;
  33 +};
  34 +
4 $(function(){ 35 $(function(){
5 36
6 $("#url").hide(); 37 $("#url").hide();
app/controllers/wikilibras/wikivideos_controller.rb
@@ -9,9 +9,10 @@ class Wikilibras::WikivideosController &lt; Wikilibras::BaseController @@ -9,9 +9,10 @@ class Wikilibras::WikivideosController &lt; Wikilibras::BaseController
9 def dicionario 9 def dicionario
10 # @q = Wikivideo.search(params[:q]) 10 # @q = Wikivideo.search(params[:q])
11 # @wikivideos = @q.result(:distinct => true) 11 # @wikivideos = @q.result(:distinct => true)
12 - @wikivideo = Wikivideo.new  
13 - @wikivideos = Wikivideo.all  
14 - @wikivideos = Wikivideo.where("signal_name like ?","%#{params[:signal_name]}%") if params[:signal_name] 12 +# @wikivideo = Wikivideo.new
  13 +# @wikivideos = Wikivideo.all
  14 +# @wikivideos = Wikivideo.where("signal_name like ?","%#{params[:signal_name]}%") if params[:signal_name]
  15 + @wikivideos = Dir.glob('public/dictionary/*.flv')
15 end 16 end
16 17
17 def search 18 def search
app/helpers/application_helper.rb
@@ -25,8 +25,13 @@ module ApplicationHelper @@ -25,8 +25,13 @@ module ApplicationHelper
25 end 25 end
26 26
27 def format_signal_name(name) 27 def format_signal_name(name)
28 - final = name.split(/\s*(\d+)\s*/,-1)  
29 - return final[0] 28 + final = name.split("/").last.split(".").first
  29 + return final
  30 + end
  31 +
  32 + def format_signal_path(name)
  33 + final = name.split("/")[1..-1].join("/")
  34 + return final
30 end 35 end
31 36
32 def show_month(month) 37 def show_month(month)
app/views/static/subtitle.html.haml
@@ -6,6 +6,6 @@ @@ -6,6 +6,6 @@
6 = form_for(@presenter.subtitle, :html => {:multipart => true, :class => "horizontal-form"}) do |f| 6 = form_for(@presenter.subtitle, :html => {:multipart => true, :class => "horizontal-form"}) do |f|
7 %fieldset 7 %fieldset
8 %label Coloque a Legenda 8 %label Coloque a Legenda
9 - = f.file_field :legend, :prompt => "LEGENDA", :id => "link_cc" 9 + = f.file_field :legend, :prompt => "LEGENDA", :id => "link_cc", :onchange => "return check_subtitle(this)"
10 #url 10 #url
11 = f.submit "CONTINUAR", :class => "btn btn-success btn-large" 11 = f.submit "CONTINUAR", :class => "btn btn-success btn-large"
12 \ No newline at end of file 12 \ No newline at end of file
app/views/static/upload.html.haml
@@ -6,7 +6,7 @@ @@ -6,7 +6,7 @@
6 = form_for(@presenter.upload, :html => {:multipart => true, :class => "horizontal-form"}) do |f| 6 = form_for(@presenter.upload, :html => {:multipart => true, :class => "horizontal-form"}) do |f|
7 %fieldset 7 %fieldset
8 %label Coloque o Vídeo 8 %label Coloque o Vídeo
9 - = f.file_field :url, :id => "link_cc" 9 + = f.file_field :url, :id => "link_cc", :onchange => "return check_video(this)"
10 #url 10 #url
11 = f.submit "CONTINUAR", :class => "btn btn-success btn-large" 11 = f.submit "CONTINUAR", :class => "btn btn-success btn-large"
12 -- content_for :menu, render(:partial => 'shared/menu')  
13 \ No newline at end of file 12 \ No newline at end of file
  13 +- content_for :menu, render(:partial => 'shared/menu')
app/views/videos/_form.html.haml
@@ -23,10 +23,10 @@ @@ -23,10 +23,10 @@
23 Legenda (.SRT) 23 Legenda (.SRT)
24 #url 24 #url
25 = f.label :url, t('videos.url'), :class => "bold" 25 = f.label :url, t('videos.url'), :class => "bold"
26 - = f.file_field :url 26 + = f.file_field :url, :onchange => "return check_video(this)"
27 #legend 27 #legend
28 = f.label :legend, t('videos.subtitle'), :class => "bold" 28 = f.label :legend, t('videos.subtitle'), :class => "bold"
29 - = f.file_field :legend, :prompt => "LEGENDA" 29 + = f.file_field :legend, :prompt => "LEGENDA", :onchange => "return check_subtitle(this)"
30 .field 30 .field
31 = f.label :window_size, t('videos.window_size'), :class => "bold" 31 = f.label :window_size, t('videos.window_size'), :class => "bold"
32 = f.select :window_size, [['Pequena', '1'], ['Média', '2'], ['Grande', '3']] 32 = f.select :window_size, [['Pequena', '1'], ['Média', '2'], ['Grande', '3']]
app/views/wikilibras/wikivideos/_sinal.html.haml
1 / Author Igor Portela - www.igorportela.com 1 / Author Igor Portela - www.igorportela.com
2 :javascript 2 :javascript
3 $(function(){ 3 $(function(){
4 - flowplayer("player#{wikivideo.id}", "/player/flowplayer-3.2.9.swf",{ 4 + flowplayer("player_#{format_signal_name(wikivideo)}", "/player/flowplayer-3.2.9.swf",{
5 onFinish: function(){ this.getPlugin("play").hide(); }, 5 onFinish: function(){ this.getPlugin("play").hide(); },
6 canvas: { backgroundColor: "#FFFFFF" } 6 canvas: { backgroundColor: "#FFFFFF" }
7 }); 7 });
8 }); 8 });
9 -.modal.hide.fade{"aria-hidden" => "true", "aria-labelledby" => "myModalLabel", :id => "signal_#{wikivideo.id}", :role => "dialog", :tabindex => "-1"} 9 +.modal.hide.fade{"aria-hidden" => "true", "aria-labelledby" => "myModalLabel", :id => "signal_#{format_signal_name(wikivideo)}", :role => "dialog", :tabindex => "-1"}
10 .modal-header 10 .modal-header
11 %button.close{"aria-hidden" => "true", "data-dismiss" => "modal", :type => "button"} × 11 %button.close{"aria-hidden" => "true", "data-dismiss" => "modal", :type => "button"} ×
12 %h3#myModalLabel 12 %h3#myModalLabel
13 - Sinal: #{format_signal_name(wikivideo.signal_name)} 13 + Sinal: #{format_signal_name(wikivideo)}
14 .modal-body 14 .modal-body
15 %div{:style => "height:350px"} 15 %div{:style => "height:350px"}
16 - = link_to '', wikivideo.path_signal, id: "player#{wikivideo.id}" 16 + = link_to '', "/" + format_signal_path(wikivideo), id: "player_#{format_signal_name(wikivideo)}"
17 .modal-footer 17 .modal-footer
18 %button.btn.btn-primary{"aria-hidden" => "true", "data-dismiss" => "modal"} OK 18 %button.btn.btn-primary{"aria-hidden" => "true", "data-dismiss" => "modal"} OK
19 %button.btn.btn-danger Denunciar Erro 19 %button.btn.btn-danger Denunciar Erro
20 \ No newline at end of file 20 \ No newline at end of file
app/views/wikilibras/wikivideos/dicionario.html.haml
@@ -13,7 +13,7 @@ @@ -13,7 +13,7 @@
13 - @wikivideos.each do |wikivideo| 13 - @wikivideos.each do |wikivideo|
14 %tbody 14 %tbody
15 %tr 15 %tr
16 - %td= link_to format_signal_name(wikivideo.signal_name), "#signal_#{wikivideo.id}", "data-toggle" => "modal" 16 + %td= link_to format_signal_name(wikivideo), "#signal_#{format_signal_name(wikivideo)}", "data-toggle" => "modal"
17 = render "wikilibras/wikivideos/sinal", wikivideo: wikivideo 17 = render "wikilibras/wikivideos/sinal", wikivideo: wikivideo
18 - else 18 - else
19 .alert 19 .alert
public/dictionary/.gitempty 0 → 100644