From adda3f9afd1ab642ed3b9ba3a3c4362ff9af482a Mon Sep 17 00:00:00 2001 From: Adabriand Furtado Date: Tue, 15 Mar 2016 21:26:18 -0300 Subject: [PATCH] Adicionado o movimento semicircular. --- view/assets/css/main.css | 4 +--- view/assets/js/articulation.js | 11 ++++++++--- view/assets/js/configuration.js | 3 +++ view/assets/js/defaultConfigurationHandler.js | 14 ++++++++++++++ view/assets/js/dynamic-loading-engine.js | 10 +++++++++- view/assets/js/dynamic-selection-workflow.js | 41 +++++++++++++++++++++++++++++++++++++++-- view/assets/js/tmpJSONParser.js | 22 ++++++++++++++++++---- view/assets/js/wikilibras.js | 4 +--- view/conf/selection-workflow-json | 17 +++++++++++++---- view/hand/movimento/passo-1.html | 5 +++++ view/hand/plano/passo-1.html | 36 +++++++++++++++++++++++++++++------- view/hand/raio/passo-1.html | 6 +++--- view/hand/sentido_inverso/passo-1.html | 8 ++++---- view/hand/velocidade/passo-1.html | 6 +++--- view/img/circular/md/plano-direita-cima.webm | Bin 0 -> 47939 bytes view/img/circular/md/plano-esquerda-cima.webm | Bin 47939 -> 0 bytes view/img/circular/md/plano-tras-cima.webm | Bin 0 -> 47739 bytes view/img/circular/md/plano-tras-esquerda.webm | Bin 0 -> 47391 bytes view/img/circular/md/sentido-anti-horario.webm | Bin 47197 -> 0 bytes view/img/circular/md/sentido-horario.webm | Bin 47939 -> 0 bytes view/img/circular/me/sentido-anti-horario.webm | Bin 47528 -> 0 bytes view/img/circular/me/sentido-horario.webm | Bin 47443 -> 0 bytes view/img/semicircular/md/plano-direita-cima.webm | Bin 0 -> 28070 bytes view/img/semicircular/md/plano-esquerda-cima.webm | Bin 0 -> 27120 bytes view/img/semicircular/md/plano-frente-cima.webm | Bin 0 -> 27768 bytes view/img/semicircular/md/plano-frente-esquerda.webm | Bin 0 -> 27890 bytes view/img/semicircular/md/plano-tras-cima.webm | Bin 0 -> 27347 bytes view/img/semicircular/md/plano-tras-esquerda.webm | Bin 0 -> 27225 bytes view/img/semicircular/md/raio-grande.webm | Bin 0 -> 28070 bytes view/img/semicircular/md/raio-normal.webm | Bin 0 -> 25628 bytes view/img/semicircular/md/raio-pequeno.webm | Bin 0 -> 21196 bytes view/img/semicircular/md/sentido-anti-horario.webm | Bin 0 -> 28070 bytes view/img/semicircular/md/sentido-horario.webm | Bin 0 -> 27134 bytes view/img/semicircular/md/velocidade-lento.webm | Bin 0 -> 30069 bytes view/img/semicircular/md/velocidade-normal.webm | Bin 0 -> 28070 bytes view/img/semicircular/md/velocidade-rapido.webm | Bin 0 -> 25743 bytes view/img/semicircular/me/plano-direita-cima.webm | Bin 0 -> 27834 bytes view/img/semicircular/me/plano-esquerda-cima.webm | Bin 0 -> 27731 bytes view/img/semicircular/me/plano-frente-cima.webm | Bin 0 -> 28059 bytes view/img/semicircular/me/plano-frente-esquerda.webm | Bin 0 -> 27845 bytes view/img/semicircular/me/plano-tras-cima.webm | Bin 0 -> 27737 bytes view/img/semicircular/me/plano-tras-esquerda.webm | Bin 0 -> 27636 bytes view/img/semicircular/me/raio-grande.webm | Bin 0 -> 27834 bytes view/img/semicircular/me/raio-normal.webm | Bin 0 -> 24854 bytes view/img/semicircular/me/raio-pequeno.webm | Bin 0 -> 21635 bytes view/img/semicircular/me/sentido-anti-horario.webm | Bin 0 -> 27834 bytes view/img/semicircular/me/sentido-horario.webm | Bin 0 -> 26646 bytes view/img/semicircular/me/velocidade-lento.webm | Bin 0 -> 29561 bytes view/img/semicircular/me/velocidade-normal.webm | Bin 0 -> 27834 bytes view/img/semicircular/me/velocidade-rapido.webm | Bin 0 -> 26006 bytes 50 files changed, 150 insertions(+), 37 deletions(-) create mode 100644 view/img/circular/md/plano-direita-cima.webm create mode 100644 view/img/circular/md/plano-tras-cima.webm create mode 100644 view/img/circular/md/plano-tras-esquerda.webm create mode 100644 view/img/semicircular/md/plano-direita-cima.webm create mode 100644 view/img/semicircular/md/plano-esquerda-cima.webm create mode 100644 view/img/semicircular/md/plano-frente-cima.webm create mode 100644 view/img/semicircular/md/plano-frente-esquerda.webm create mode 100644 view/img/semicircular/md/plano-tras-cima.webm create mode 100644 view/img/semicircular/md/plano-tras-esquerda.webm create mode 100644 view/img/semicircular/md/raio-grande.webm create mode 100644 view/img/semicircular/md/raio-normal.webm create mode 100644 view/img/semicircular/md/raio-pequeno.webm create mode 100644 view/img/semicircular/md/sentido-anti-horario.webm create mode 100644 view/img/semicircular/md/sentido-horario.webm create mode 100644 view/img/semicircular/md/velocidade-lento.webm create mode 100644 view/img/semicircular/md/velocidade-normal.webm create mode 100644 view/img/semicircular/md/velocidade-rapido.webm create mode 100644 view/img/semicircular/me/plano-direita-cima.webm create mode 100644 view/img/semicircular/me/plano-esquerda-cima.webm create mode 100644 view/img/semicircular/me/plano-frente-cima.webm create mode 100644 view/img/semicircular/me/plano-frente-esquerda.webm create mode 100644 view/img/semicircular/me/plano-tras-cima.webm create mode 100644 view/img/semicircular/me/plano-tras-esquerda.webm create mode 100644 view/img/semicircular/me/raio-grande.webm create mode 100644 view/img/semicircular/me/raio-normal.webm create mode 100644 view/img/semicircular/me/raio-pequeno.webm create mode 100644 view/img/semicircular/me/sentido-anti-horario.webm create mode 100644 view/img/semicircular/me/sentido-horario.webm create mode 100644 view/img/semicircular/me/velocidade-lento.webm create mode 100644 view/img/semicircular/me/velocidade-normal.webm create mode 100644 view/img/semicircular/me/velocidade-rapido.webm diff --git a/view/assets/css/main.css b/view/assets/css/main.css index 5eaf02c..477a84a 100644 --- a/view/assets/css/main.css +++ b/view/assets/css/main.css @@ -307,6 +307,7 @@ ul.rig li { ul.rig.columns-2 li { width: 45%; + font-size: 17px; } ul.rig.columns-3 li { @@ -467,6 +468,3 @@ ul.rig.columns-4 li { #completed-all-task-msg { display: none; } - - - diff --git a/view/assets/js/articulation.js b/view/assets/js/articulation.js index 57caaa7..589397c 100644 --- a/view/assets/js/articulation.js +++ b/view/assets/js/articulation.js @@ -6,9 +6,14 @@ function _updateASelector(container, ballSelector, step) { var pointSelector = parseInt(step) == 2 ? "A" : "B"; $(container + ' .ball-selector.active').each(function() { - $(this).removeClass('active'), $(this).find('.point-selector').remove(); - }), ballSelector.addClass('active'), ballSelector.append('
'); + $(this).removeClass('active'); + $(this).find('.point-selector').remove(); + }); + ballSelector.addClass('active'); + ballSelector.append('
'); + $(container + ' .selection-panel-option[select=true]').attr('select', false); + $(ballSelector).attr('select', true); } function _getSelectedY(hand, subConfig, step) { diff --git a/view/assets/js/configuration.js b/view/assets/js/configuration.js index 350c25b..b342ab4 100644 --- a/view/assets/js/configuration.js +++ b/view/assets/js/configuration.js @@ -21,6 +21,9 @@ var finger_group = $(stepOneBaseId + ' .selection-panel-option[select=true]').attr('value'); finger_group = typeof finger_group == 'undefined' ? '0' : finger_group; + + // clean next step + dynworkflow.cleanStep(hand, subConfig, nextStep); $(stepTwoBaseId + ' .finger-group').hide(); $(stepTwoBaseId + ' .finger-group[group=' + finger_group + ']').show(); } diff --git a/view/assets/js/defaultConfigurationHandler.js b/view/assets/js/defaultConfigurationHandler.js index 04b4e05..ee6a21c 100644 --- a/view/assets/js/defaultConfigurationHandler.js +++ b/view/assets/js/defaultConfigurationHandler.js @@ -9,5 +9,19 @@ dynworkflow.userSelectedAnOption(); }); }; + + function _startVideoLoop(hand, subConfig, step, timeBetweenLoops) { + setTimeout(function(){ + $('.selection-panel-body[mainConfig=' + hand + '][subConfig=' + + subConfig + '][step=' + step + '] video').each(function(){ + $(this).get(0).play(); + }); + _startVideoLoop(hand, subConfig, step, timeBetweenLoops); + }, timeBetweenLoops); + } + + defaultConfigurationHandler.startVideoLoop = function(hand, subConfig, step, timeBetweenLoops) { + _startVideoLoop(hand, subConfig, step, timeBetweenLoops); + } }(window.defaultConfigurationHandler = window.defaultConfigurationHandler || {}, jQuery)); diff --git a/view/assets/js/dynamic-loading-engine.js b/view/assets/js/dynamic-loading-engine.js index 8120b8e..7cdd402 100644 --- a/view/assets/js/dynamic-loading-engine.js +++ b/view/assets/js/dynamic-loading-engine.js @@ -34,6 +34,14 @@ } } + var replaceMovementNameTag = function(data, mainConfig) { + var selectedMovement = movement.getPreviousSelectedMovement(mainConfig); + if (typeof selectedMovement != "undefined") { + return data.replace(/{{ movement-name }}/g, selectedMovement); + } + return data + } + if (matchSubConfig) { // case defined // There is no specific(right or left hand dependent) assets for: articulacao, duracao, expressao, movimento, transicao // Specific configurations: configuracao, orientacao @@ -59,6 +67,7 @@ } } goodData = replaceHandFolderTag(goodData, currentMainConfig); + goodData = replaceMovementNameTag(goodData, currentMainConfig); goodData = goodData.replace(/{{ hand }}/g, currentMainConfig); return goodData.replace(/{{ server }}/g, url); }; @@ -66,7 +75,6 @@ dynengine.render = function(serverUrl, templatePath, target, prepend, callback) { var url = serverUrl + templatePath; $.get(url, function(data) { - // TODO replace or append boolean console.log('got: ' + url); var processedHtml = _preprocessHtml(data, serverUrl); diff --git a/view/assets/js/dynamic-selection-workflow.js b/view/assets/js/dynamic-selection-workflow.js index 8f413ad..742d41e 100644 --- a/view/assets/js/dynamic-selection-workflow.js +++ b/view/assets/js/dynamic-selection-workflow.js @@ -103,6 +103,8 @@ function _selectSubConfig(subConfig) { if (subConfig == 'movimento') { _updateAndGetMovementConfig(); + } else if (currentSubConfigName == 'movimento') { + _updateAndGetFirstMovementSubConfig(); } currentSubConfigName = subConfig; currentSubconfig = currentSubconfigParent[currentSubConfigName]; @@ -133,14 +135,30 @@ } } } + + function _checkIfFinished(mainConfig, currentSubConfigName) { + var numberOfSteps = currentSubconfig.length; + var completedSteps = $('.selection-panel-body[mainConfig=' + mainConfig + + '][subConfig=' + currentSubConfigName + '] .selection-panel-option[select=true]').length; + return completedSteps != 0 && completedSteps == numberOfSteps; + } // A callback function to be called when the user selects a option on a panel function _userSelectedAnOption() { - if (currentStep == currentSubconfig.length - 1) { + if (_checkIfFinished(mainConfig, currentSubConfigName)) { _setupCheckIcon(mainConfig, currentSubConfigName); } _showNextSubConfig(); } + + function _cleanStep(mainConfig, subConfig, step) { + var baseId = '.selection-panel-body[mainConfig=' + mainConfig + '][subConfig=' + + subConfig + '][step=' + step + ']'; + $(baseId + ' .selection-panel-option').removeAttr('select'); + var icon_id = '.subconfiguration-panel[mainConfig=' + mainConfig + + '] .icon_container[json_name=' + subConfig + ']'; + $(icon_id).removeAttr('complete'); + } // Timeline functions function _selectTimelineIcon(mainConfig, subConfig) { @@ -251,6 +269,20 @@ } }; + function _cleanPreviousLoadedPanel() { + $('.selection-panel-body[mainConfig=' + mainConfig + ']').each(function() { + var subConfigName = $(this).attr("subConfig"); + if (subConfigName.indexOf("articulacao") != -1 || + subConfigName.indexOf("configuracao") != -1 || + subConfigName.indexOf("orientacao") != -1 || + subConfigName.indexOf("movimento") != -1) { + return; + } + $('.selection-panel-body[mainConfig=' + mainConfig + '][subConfig=' + + subConfigName + ']').remove(); + }); + } + dynworkflow.selectMovement = function(movement) { var subconfigJSON = currentSubconfig[movement]; currentSubConfigName = _getFirstKey(subconfigJSON); @@ -258,6 +290,7 @@ currentSubconfig = subconfigJSON[currentSubConfigName]; currentStep = 0; + _cleanPreviousLoadedPanel(); _showCurrentSubconfig(); _setupTimeline(true); }; @@ -269,7 +302,11 @@ dynworkflow.userSelectedAnOption = function() { _userSelectedAnOption(); }; - + + dynworkflow.cleanStep = function(mainConfig, subConfig, step) { + _cleanStep(mainConfig, subConfig, step); + }; + dynworkflow.getFacialParameters = function() { return _getAttributes(jsonWF['facial']); }; diff --git a/view/assets/js/tmpJSONParser.js b/view/assets/js/tmpJSONParser.js index 7efde07..70312c3 100644 --- a/view/assets/js/tmpJSONParser.js +++ b/view/assets/js/tmpJSONParser.js @@ -24,9 +24,9 @@ } function _parseParameterValue(value) { - if (typeof value == "string" && value.toLowerCase() == 'true') { + if (typeof value == 'string' && value.toLowerCase() == 'true') { return true; - } else if (typeof value == "string" && value.toLowerCase() == 'false') { + } else if (typeof value == 'string' && value.toLowerCase() == 'false') { return false; } else { return !isNaN(value) ? parseInt(value) : value; @@ -102,7 +102,20 @@ function _circularMovementParser(tmpJSON, movementName, hand) { var parsedHand = _parseHand(hand); _defaultMovementParser(tmpJSON, movementName, hand); - movement_parameter_json[parsedHand][movementName]['lado_oposto'] = false; + var movPlane = movement_parameter_json[parsedHand][movementName]['plano']; + if (movPlane.indexOf('direita') != -1 || movPlane.indexOf('tras') != -1) { + movPlane = movPlane.replace('direita', 'esquerda'); + movPlane = movPlane.replace('tras', 'frente'); + movement_parameter_json[parsedHand][movementName]['plano'] = movPlane; + movement_parameter_json[parsedHand][movementName]['lado_oposto'] = true; + } else { + movement_parameter_json[parsedHand][movementName]['lado_oposto'] = false; + } + + if (movPlane == 'frente-cima' || movPlane == 'tras-cima') { + movement_parameter_json[parsedHand][movementName]['sentido_inverso'] = + !movement_parameter_json[parsedHand][movementName]['sentido_inverso']; + } } function _parseTempMovementParameterJSON(tmpJSON, hand) { @@ -115,7 +128,8 @@ if (movementName == 'retilineo') { _retilinearMovementParser(tmpJSON, movementName, hand); - } else if (movementName == 'circular') { + } else if (movementName == 'circular' || + movementName == 'semicircular') { _circularMovementParser(tmpJSON, movementName, hand); } else { _defaultMovementParser(tmpJSON, movementName, hand); diff --git a/view/assets/js/wikilibras.js b/view/assets/js/wikilibras.js index e3cb2a4..8e28dfb 100644 --- a/view/assets/js/wikilibras.js +++ b/view/assets/js/wikilibras.js @@ -256,14 +256,12 @@ function _updateTempParameterJSON(mainConfig, subConfig, step, value) { var subConfigJSON = tmpParameterJSON[mainConfig][subConfig]; - if (typeof subConfigJSON == 'undefined') { tmpParameterJSON[mainConfig][subConfig] = []; subConfigJSON = tmpParameterJSON[mainConfig][subConfig]; } - + subConfigJSON[parseInt(step) - 1] = value; - //console.log(tmpParameterJSON); } function _selectAnOption(parentId, el) { diff --git a/view/conf/selection-workflow-json b/view/conf/selection-workflow-json index 9e860dd..4754d70 100644 --- a/view/conf/selection-workflow-json +++ b/view/conf/selection-workflow-json @@ -11,6 +11,11 @@ "configuracao" : ["passo-1", "passo-2"], "orientacao" : ["passo-1"] }, + "retilineo" : { + "articulacao-retilineo": ["passo-1", "passo-2", "passo-3", "passo-4"], + "configuracao-retilineo": ["passo-1", "passo-2", "passo-3", "passo-4"], + "orientacao-retilineo": ["passo-1", "passo-2"] + }, "circular" : { "articulacao" : ["passo-1", "passo-2"], "configuracao" : ["passo-1", "passo-2"], @@ -20,10 +25,14 @@ "velocidade" : ["passo-1"], "sentido_inverso" : ["passo-1"] }, - "retilineo" : { - "articulacao-retilineo": ["passo-1", "passo-2", "passo-3", "passo-4"], - "configuracao-retilineo": ["passo-1", "passo-2", "passo-3", "passo-4"], - "orientacao-retilineo": ["passo-1", "passo-2"] + "semicircular" : { + "articulacao" : ["passo-1", "passo-2"], + "configuracao" : ["passo-1", "passo-2"], + "orientacao" : ["passo-1"], + "plano": ["passo-1"], + "raio" : ["passo-1"], + "velocidade" : ["passo-1"], + "sentido_inverso" : ["passo-1"] } } } diff --git a/view/hand/movimento/passo-1.html b/view/hand/movimento/passo-1.html index c3107ff..ecad309 100644 --- a/view/hand/movimento/passo-1.html +++ b/view/hand/movimento/passo-1.html @@ -20,6 +20,11 @@ class="box-panel-option selection-panel-option" autoplay loop> Circular +
  • Semi-Circular