Commit f4e7f711d595d1bfc23dfc35cc0f220e400bd4b5

Authored by Adabriand Furtado
1 parent bb7233b2
Exists in master and in 1 other branch dynamic

Ajustes na tela de configuração de ponto de articulação.

view/assets/css/articulation.css
1 .gray-background { 1 .gray-background {
2 background-repeat: no-repeat; 2 background-repeat: no-repeat;
3 - background-position: center 15px, 0 0;  
4 background-size: 67% 95%, 100% 100%; 3 background-size: 67% 95%, 100% 100%;
5 min-width: 285px; 4 min-width: 285px;
6 min-height: 361px 5 min-height: 361px
7 } 6 }
8 7
9 -.gray-front-avatar { 8 +.right-hand-gray-front-avatar {
10 background-image: url(../../img/pa/gray-front-avatar.png), url(../../img/pa/default-base.png); 9 background-image: url(../../img/pa/gray-front-avatar.png), url(../../img/pa/default-base.png);
  10 + background-position: 100px 15px, 0 0;
  11 +}
  12 +
  13 +.left-hand-gray-front-avatar {
  14 + background-image: url(../../img/pa/gray-front-avatar.png), url(../../img/pa/default-base.png);
  15 + background-position: 5px 15px, 0 0;
11 } 16 }
12 17
13 .gray-side-avatar { 18 .gray-side-avatar {
14 background-image: url(../../img/pa/gray-side-avatar.png), url(../../img/pa/default-base.png); 19 background-image: url(../../img/pa/gray-side-avatar.png), url(../../img/pa/default-base.png);
  20 + background-position: center 15px, 0 0;
15 } 21 }
16 22
17 .module-x-y { 23 .module-x-y {
view/assets/js/articulation.js
1 (function(articulation, $, undefined) { 1 (function(articulation, $, undefined) {
2 2
3 - function _updateASelector(container, ballSelector, serverhost) { 3 + var server_host = "";
  4 +
  5 + function _updateASelector(container, ballSelector) {
4 $(container + " .ball-selector.active").each(function() { 6 $(container + " .ball-selector.active").each(function() {
5 $(this).removeClass("active"), $(this).find(".point-a-selector").remove() 7 $(this).removeClass("active"), $(this).find(".point-a-selector").remove()
6 - }), ballSelector.addClass("active"), ballSelector.append('<div class="point-a-selector"><img src="' + serverhost + 8 + }), ballSelector.addClass("active"), ballSelector.append('<div class="point-a-selector"><img src="' + server_host +
7 '/img/pa/A-Seletor.png" class="point-a-selector" alt=""></div>') 9 '/img/pa/A-Seletor.png" class="point-a-selector" alt=""></div>')
8 } 10 }
9 11
@@ -12,27 +14,35 @@ @@ -12,27 +14,35 @@
12 var articulation_z = "#" + hand + "-articulation .module-z"; 14 var articulation_z = "#" + hand + "-articulation .module-z";
13 $(articulation_z + " .ball-selector").hide(); 15 $(articulation_z + " .ball-selector").hide();
14 $(articulation_z + " .row-number-" + y + " .ball-selector").show(); 16 $(articulation_z + " .row-number-" + y + " .ball-selector").show();
  17 +
  18 + var z = $(articulation_z).attr("data-z");
  19 + if (typeof z != "undefined") {
  20 + var ball_selector = $(articulation_z + " .row-number-" + y + " .ball-" + z);
  21 + _updateASelector(articulation_z, ball_selector);
  22 + }
15 } 23 }
16 24
17 - function _setupBallSelector(serverhost, hand) { 25 + function _setupBallSelector(hand) {
18 var articulation_x_y = "#" + hand + "-articulation .module-x-y"; 26 var articulation_x_y = "#" + hand + "-articulation .module-x-y";
19 $(articulation_x_y + " .ball-selector").on("click", function(a) { 27 $(articulation_x_y + " .ball-selector").on("click", function(a) {
20 - var b = $(a.target),  
21 - c = b.parent(".grid-row"), 28 + var b = $(a.target);
  29 + if (!b.hasClass("ball-selector")) return;
  30 + var c = b.parent(".grid-row"),
22 d = $(articulation_x_y), 31 d = $(articulation_x_y),
23 f = b.attr("data-x"), 32 f = b.attr("data-x"),
24 g = c.attr("data-y"); 33 g = c.attr("data-y");
25 - d.attr("data-x", f), d.attr("data-y", g), _updateASelector(articulation_x_y, b, serverhost) 34 + d.attr("data-x", f), d.attr("data-y", g), _updateASelector(articulation_x_y, b)
26 _setupModuleZ(hand, g); 35 _setupModuleZ(hand, g);
27 _updateParameterJSON(hand); 36 _updateParameterJSON(hand);
28 }); 37 });
29 var articulation_z = "#" + hand + "-articulation .module-z"; 38 var articulation_z = "#" + hand + "-articulation .module-z";
30 $(articulation_z + " .ball-selector").on("click", function(a) { 39 $(articulation_z + " .ball-selector").on("click", function(a) {
31 - var b = $(a.target),  
32 - c = b.parent(".grid-row"), 40 + var b = $(a.target);
  41 + if (!b.hasClass("ball-selector")) return;
  42 + var c = b.parent(".grid-row"),
33 e = $(articulation_z), 43 e = $(articulation_z),
34 h = b.attr("data-z"); 44 h = b.attr("data-z");
35 - b.attr("data-z") && e.attr("data-z", h), _updateASelector(articulation_z, b, serverhost); 45 + b.attr("data-z") && e.attr("data-z", h), _updateASelector(articulation_z, b);
36 _updateParameterJSON(hand); 46 _updateParameterJSON(hand);
37 }); 47 });
38 } 48 }
@@ -42,20 +52,29 @@ @@ -42,20 +52,29 @@
42 wikilibras.updateParameterJSON("articulacao", value); 52 wikilibras.updateParameterJSON("articulacao", value);
43 } 53 }
44 54
  55 + function _isRightHand(hand) {
  56 + return hand.indexOf("right-hand") != -1;
  57 + }
  58 +
45 function _readValue(hand) { 59 function _readValue(hand) {
46 var articulation_x_y = "#" + hand + "-articulation .module-x-y"; 60 var articulation_x_y = "#" + hand + "-articulation .module-x-y";
47 var articulation_z = "#" + hand + "-articulation .module-z"; 61 var articulation_z = "#" + hand + "-articulation .module-z";
48 var x = parseInt($(articulation_x_y).attr("data-x")); 62 var x = parseInt($(articulation_x_y).attr("data-x"));
49 var y = parseInt($(articulation_x_y).attr("data-y")); 63 var y = parseInt($(articulation_x_y).attr("data-y"));
50 var z = $(articulation_z).attr("data-z"); 64 var z = $(articulation_z).attr("data-z");
51 - z = z == ""? 1 : parseInt(z); 65 +
  66 + if (!_isRightHand(hand)) {
  67 + x = 10 - x + 1;
  68 + }
  69 + z = z == "" ? 1 : parseInt(z);
52 var value = (z-1)*10 + x + 30*(y-1); 70 var value = (z-1)*10 + x + 30*(y-1);
53 //console.log(value); 71 //console.log(value);
54 return value; 72 return value;
55 } 73 }
56 74
57 articulation.setup = function(serverhost) { 75 articulation.setup = function(serverhost) {
58 - _setupBallSelector(serverhost, "right-hand");  
59 - _setupBallSelector(serverhost, "left-hand"); 76 + server_host = serverhost;
  77 + _setupBallSelector("right-hand");
  78 + _setupBallSelector("left-hand");
60 }; 79 };
61 }(window.articulation = window.articulation || {}, jQuery)); 80 }(window.articulation = window.articulation || {}, jQuery));
62 \ No newline at end of file 81 \ No newline at end of file
view/assets/js/wikilibras.js
@@ -595,6 +595,10 @@ @@ -595,6 +595,10 @@
595 $("#configuration-screen").show(); 595 $("#configuration-screen").show();
596 }); 596 });
597 $("#ready-button").off("click").on("click", function() { 597 $("#ready-button").off("click").on("click", function() {
  598 + if ($(this).hasClass('disabled')) {
  599 + event.preventDefault();
  600 + return;
  601 + }
598 _setupRenderScreen(); 602 _setupRenderScreen();
599 }); 603 });
600 $("#render-edit").off("click").on("click", function() { 604 $("#render-edit").off("click").on("click", function() {
@@ -602,6 +606,10 @@ @@ -602,6 +606,10 @@
602 $("#configuration-screen").show(); 606 $("#configuration-screen").show();
603 }); 607 });
604 $("#finish-button").off("click").on("click", function() { 608 $("#finish-button").off("click").on("click", function() {
  609 + if ($(this).hasClass('disabled')) {
  610 + event.preventDefault();
  611 + return;
  612 + }
605 $("#render-screen").hide(); 613 $("#render-screen").hide();
606 $("#thanks-screen").show(); 614 $("#thanks-screen").show();
607 _saveAnswer(task, deferred) 615 _saveAnswer(task, deferred)
view/hand-configuration.html
@@ -10,12 +10,14 @@ else %} {% set fingers_position_dir = &quot;cme&quot; %} {% set orientation_dir = @@ -10,12 +10,14 @@ else %} {% set fingers_position_dir = &quot;cme&quot; %} {% set orientation_dir =
10 </div> 10 </div>
11 <div class="selection-panel-inner-body"> 11 <div class="selection-panel-inner-body">
12 <ul class="rig columns-2"> 12 <ul class="rig columns-2">
  13 + <li><img class="box-panel-option selection-panel-option"
  14 + src="{{ server }}/img/mov/CALAR.gif" value="pontual" />Pontual</li>
  15 + <!--
13 <li><video src="{{ server }}/img/mov/PONTUAL.webm" 16 <li><video src="{{ server }}/img/mov/PONTUAL.webm"
14 preload="metadata" value="pontual" 17 preload="metadata" value="pontual"
15 class="box-panel-option selection-panel-option" autoplay loop> 18 class="box-panel-option selection-panel-option" autoplay loop>
16 <source type="video/webm"> 19 <source type="video/webm">
17 </video> Pontual</li> 20 </video> Pontual</li>
18 - <!--  
19 <li><img class="box-panel-option selection-panel-option" 21 <li><img class="box-panel-option selection-panel-option"
20 src="{{ server }}/img/exf/0000.png" value="retilineo"/>Retilíneo</li> 22 src="{{ server }}/img/exf/0000.png" value="retilineo"/>Retilíneo</li>
21 <li><img class="box-panel-option selection-panel-option" 23 <li><img class="box-panel-option selection-panel-option"
@@ -41,7 +43,7 @@ else %} {% set fingers_position_dir = &quot;cme&quot; %} {% set orientation_dir = @@ -41,7 +43,7 @@ else %} {% set fingers_position_dir = &quot;cme&quot; %} {% set orientation_dir =
41 </div> 43 </div>
42 <div class="selection-panel-inner-body"> 44 <div class="selection-panel-inner-body">
43 <div data-x="" data-y="" 45 <div data-x="" data-y=""
44 - class="module-x-y grid gray-background gray-front-avatar active"> 46 + class="module-x-y grid gray-background {{ name }}-gray-front-avatar active">
45 <div class=grid-selectors> 47 <div class=grid-selectors>
46 <div class="grid-row row-number-1" data-y=1> 48 <div class="grid-row row-number-1" data-y=1>
47 <div class="ball-selector selection-panel-option ball-1" data-x=1></div> 49 <div class="ball-selector selection-panel-option ball-1" data-x=1></div>
@@ -122,12 +124,9 @@ else %} {% set fingers_position_dir = &quot;cme&quot; %} {% set orientation_dir = @@ -122,12 +124,9 @@ else %} {% set fingers_position_dir = &quot;cme&quot; %} {% set orientation_dir =
122 <div data-z="" class="module-z grid gray-background gray-side-avatar"> 124 <div data-z="" class="module-z grid gray-background gray-side-avatar">
123 <div class="grid-selectors pull-right"> 125 <div class="grid-selectors pull-right">
124 <div class="grid-row row-number-1"> 126 <div class="grid-row row-number-1">
125 - <div class="ball-selector selection-panel-option ball-number-1"  
126 - data-z=1></div>  
127 - <div class="ball-selector selection-panel-option ball-number-2"  
128 - data-z=2></div>  
129 - <div class="ball-selector selection-panel-option ball-number-3"  
130 - data-z=3></div> 127 + <div class="ball-selector selection-panel-option ball-1" data-z=1></div>
  128 + <div class="ball-selector selection-panel-option ball-2" data-z=2></div>
  129 + <div class="ball-selector selection-panel-option ball-3" data-z=3></div>
131 </div> 130 </div>
132 <div class="grid-row row-number-2"> 131 <div class="grid-row row-number-2">
133 <div class="ball-selector selection-panel-option ball-1" data-z=1></div> 132 <div class="ball-selector selection-panel-option ball-1" data-z=1></div>