From 0f26c3be35b7b4d43bf189f8b2b9347ca2a99f0f Mon Sep 17 00:00:00 2001 From: Cassio Cabral Date: Mon, 25 Jan 2016 12:13:41 -0300 Subject: [PATCH] innital dynamic engine --- settings_local.py | 5 +++++ view/assets/js/dynamic-loading-engine.js | 72 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ view/assets/js/string | 1 + view/assets/js/wikilibras.js | 70 +++++++++++++++++++++++++++++++++++----------------------------------- view/hand-configuration.html | 431 +++-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- view/right-hand-pontual-template.html | 1 + view/right-hand/movements.html | 31 +++++++++++++++++++++++++++++++ view/right-hand/pontual/passo-1.html | 115 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ view/right-hand/pontual/passo-2.html | 242 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ view/right-hand/pontual/passo-3.html | 34 ++++++++++++++++++++++++++++++++++ view/right-hand/pontual/timeline.html | 33 +++++++++++++++++++++++++++++++++ view/template-backup.html | 202 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ view/template.html | 20 +++++++++++--------- 13 files changed, 785 insertions(+), 472 deletions(-) create mode 100644 view/assets/js/dynamic-loading-engine.js create mode 100644 view/assets/js/string create mode 100644 view/right-hand-pontual-template.html create mode 100644 view/right-hand/movements.html create mode 100644 view/right-hand/pontual/passo-1.html create mode 100644 view/right-hand/pontual/passo-2.html create mode 100644 view/right-hand/pontual/passo-3.html create mode 100644 view/right-hand/pontual/timeline.html create mode 100644 view/template-backup.html diff --git a/settings_local.py b/settings_local.py index 8894871..818e83d 100644 --- a/settings_local.py +++ b/settings_local.py @@ -5,6 +5,11 @@ SERVER_PORT = 8003 AGREEMENT_NUMBER = 2 API_HOST = "http://0.0.0.0:5001" +# Apache Configuration +APACHE_HOST = False +APACHE_HOST_ENDPOINT = "/wikilibras-backend" +APACHE_STATIC_FILES_ENDPOINT = "/wikilibras" + # PyBossa Configuration PYBOSSA_APP_NAME = "WikiLibras" PYBOSSA_APP_SHORT_NAME = "wikilibras" diff --git a/view/assets/js/dynamic-loading-engine.js b/view/assets/js/dynamic-loading-engine.js new file mode 100644 index 0000000..6a453eb --- /dev/null +++ b/view/assets/js/dynamic-loading-engine.js @@ -0,0 +1,72 @@ +(function(dynengine, $, undefined) { + var setup = undefined; + + function _setup() { + setup = { + 'mao_direita': { + 'movimentos': { + 'pontual': { + 'timeline': [ + { + 'ordem': 1, + 'timeline_icon': 'a', + 'templates': [ + { + 'url': 'http://url.com', + 'ordem': 1 + }, + { + 'url': 'http://url2.com', + 'ordem': 2 + } + ] + } + ] + }, + 'circular': {} + } + } + }; + }; + + _preprocessHtml = function(data, url) { + return data.replace(/{{ server }}/g, url); + }; + + dynengine.render = function(serverUrl, templatePath, target) { + var url = serverUrl + templatePath; + $.get(url, function(data) { + // TODO replace or append boolean + $(target).append(_preprocessHtml(data, serverUrl)); + }); + }, + + dynengine.clean = function(target) { + $(target).html(''); + }, + + dynengine.load = function() { + var url = $('#server-url').data('url'); + $('.config-panel-option[name=right-hand]').bind('click', function() { + console.log('click right hand on panel'); + }); + + $('#avatar-body-right-hand').bind('click', function() { + console.log('click avatar hand'); + $('#selection-panel').load(url + '/' + 'right-hand/movements.html', function () { + $('.movimento-pontual').bind('click', function() { + console.log('movimento pontual'); + dynengine.clean('#selection-panel'); + dynengine.render(url, '/right-hand/pontual/timeline.html', '#selection-panel'); + dynengine.render(url, '/right-hand/pontual/passo-1.html', '#selection-panel'); + dynengine.render(url, '/right-hand/pontual/passo-2.html', '#selection-panel'); + dynengine.render(url, '/right-hand/pontual/passo-3.html', '#selection-panel'); + + }); + }); + }); + + + }; + +}(window.dynengine = window.wikilibras || {}, jQuery)); diff --git a/view/assets/js/string b/view/assets/js/string new file mode 100644 index 0000000..4b0a21d --- /dev/null +++ b/view/assets/js/string @@ -0,0 +1 @@ +testtest \ No newline at end of file diff --git a/view/assets/js/wikilibras.js b/view/assets/js/wikilibras.js index 0f4e92a..00c283e 100644 --- a/view/assets/js/wikilibras.js +++ b/view/assets/js/wikilibras.js @@ -158,7 +158,7 @@ $(".selection-panel-body").hide(); $(".subconfiguration-options").hide(); $(".subconfiguration-panel").hide(); - + if (_isSelectingState()) { var current_option = _getCurrentMainConfiguration(); _selectIcon(current_option, false); @@ -269,7 +269,7 @@ function _hasMultipleConfigurations(config) { return $("#" + config).is("[multiple-config]"); } - + function _handleFingersPositionSubConfiguration(main_config) { var finger_group = $( "#" @@ -353,7 +353,7 @@ if (next_config != "end") { _selectSubConfigurationIcon(next_config, true); $("#" + next_config).show(); - + var main_config = _getCurrentMainConfiguration(); if (_isHandMovimentComplete(main_config)) { $(".subconfiguration-panel").fadeIn(300); @@ -390,7 +390,7 @@ return $("#" + main_config + "-subconfiguration-options .icon_container[complete=true][name=hand-moviment]").length > 0; } - + function _setupHandSelectionPanel(option) { var previous_select = $("#" + option + "-subconfiguration-options .icon_container[select=true]").length > 0; @@ -409,7 +409,7 @@ _selectIcon("hand-moviment", true, option + "-moviment"); $("#" + option + "-moviment").fadeIn(300); } - + $("#" + option + "-subconfiguration-options").fadeIn(300); if (_isHandMovimentComplete(option)) { $(".subconfiguration-panel").fadeIn(300); @@ -486,10 +486,10 @@ moviment_parameter_json[current_main_config][config] = value; } } - + function _readConfigValue(el, config_name) { if (typeof config_name == "undefined" || config_name == "articulacao") return; - + return $(el).attr("value"); } @@ -500,34 +500,34 @@ $("#" + current_config_id + " .selection-panel-option[select=true]") .removeAttr("select"); $(el).attr("select", true); - + var config_value = _readConfigValue(el, current_config_name); _updateParameterJSON(current_config_name, config_value); } function _setupSelectionPanel() { - $("#selection-panel .x").off("click").on("click", function() { - _hideSelectionPanel(); - }); - $(".selection-panel-body .selection-panel-option").off("click").on( - "click", function() { - _selectConfig(this); - var next = _getNextSubConfiguration(); - _showSubConfiguration(next, true); - }); - $(".subconfiguration-options .icon_container").off("click").on("click", - function() { - var subconfig = $(this).attr("panel"); - _showSubConfiguration(subconfig, false); - }); - $(".arrow[name=right-arrow]").off("click").on("click", function() { - var next = _getNextSubConfiguration(); - _showSubConfiguration(next, false); - }); - $(".arrow[name=left-arrow]").off("click").on("click", function() { - var previous = _getPreviousSubConfiguration(); - _showSubConfiguration(previous, false); - }); + // $("#selection-panel .x").off("click").on("click", function() { + // _hideSelectionPanel(); + // }); + // $(".selection-panel-body .selection-panel-option").off("click").on( + // "click", function() { + // _selectConfig(this); + // var next = _getNextSubConfiguration(); + // _showSubConfiguration(next, true); + // }); + // $(".subconfiguration-options .icon_container").off("click").on("click", + // function() { + // var subconfig = $(this).attr("panel"); + // _showSubConfiguration(subconfig, false); + // }); + // $(".arrow[name=right-arrow]").off("click").on("click", function() { + // var next = _getNextSubConfiguration(); + // _showSubConfiguration(next, false); + // }); + // $(".arrow[name=left-arrow]").off("click").on("click", function() { + // var previous = _getPreviousSubConfiguration(); + // _showSubConfiguration(previous, false); + // }); } // Render Screen @@ -587,7 +587,7 @@ "panel")); }); } - + function _setupMainScreen(task, deferred) { $("#initial-screen").fadeIn(300); $("#start-button").off("click").on("click", function() { @@ -621,7 +621,7 @@ _setupConfigurationPanel(); _setupSelectionPanel(); _setupMainScreen(task, deferred); - + articulation.setup(base_url); } @@ -636,7 +636,7 @@ deferred.resolve(); }, 2500); });*/ - + setTimeout(function() { $("#thanks-screen").hide(); deferred.resolve(); @@ -672,9 +672,9 @@ api_url = apihost; _run(projectname); }; - + wikilibras.updateParameterJSON = function(config, value) { _updateParameterJSON(config, value); } -}(window.wikilibras = window.wikilibras || {}, jQuery)); \ No newline at end of file +}(window.wikilibras = window.wikilibras || {}, jQuery)); diff --git a/view/hand-configuration.html b/view/hand-configuration.html index b422f4c..8baf3da 100644 --- a/view/hand-configuration.html +++ b/view/hand-configuration.html @@ -1,18 +1,13 @@ -{% macro selectionPanel(name) -%} {% if name == 'right-hand' %} {% set -fingers_position_dir = "cmd" %} {% set orientation_dir = "ord" %} {% -else %} {% set fingers_position_dir = "cme" %} {% set orientation_dir = -"ore" %} {% endif %} - -
Escolha o movimento mais parecido
    -
  • Pontual
  • - +
+
+
diff --git a/view/right-hand/pontual/passo-1.html b/view/right-hand/pontual/passo-1.html new file mode 100644 index 0000000..58e0d6c --- /dev/null +++ b/view/right-hand/pontual/passo-1.html @@ -0,0 +1,115 @@ +
+ + +
diff --git a/view/right-hand/pontual/passo-2.html b/view/right-hand/pontual/passo-2.html new file mode 100644 index 0000000..af68760 --- /dev/null +++ b/view/right-hand/pontual/passo-2.html @@ -0,0 +1,242 @@ +
+ + +
diff --git a/view/right-hand/pontual/passo-3.html b/view/right-hand/pontual/passo-3.html new file mode 100644 index 0000000..2eafb02 --- /dev/null +++ b/view/right-hand/pontual/passo-3.html @@ -0,0 +1,34 @@ +
+
+ Palma da mão +
+
+
    +
  • 1.
  • +
  • 2.
  • +
  • 3.
  • +
  • 4.
  • +
  • 5.
  • +
  • 6.
  • +
  • 7.
  • +
  • 8.
  • +
  • 9.
  • +
  • 10.
  • +
  • 11.
  • +
  • 12.
  • +
+
+
diff --git a/view/right-hand/pontual/timeline.html b/view/right-hand/pontual/timeline.html new file mode 100644 index 0000000..a26c04f --- /dev/null +++ b/view/right-hand/pontual/timeline.html @@ -0,0 +1,33 @@ +
+
+ +
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+
+ +
+ +
+
diff --git a/view/template-backup.html b/view/template-backup.html new file mode 100644 index 0000000..7aa531f --- /dev/null +++ b/view/template-backup.html @@ -0,0 +1,202 @@ + + +{% import 'hand-configuration.html' as handConfig with context %} {% +import 'facial-configuration.html' as facialConfig with context %} + +
+
+
+
+ +
+
+ Ajude a criar o sinal . +
+
+
OK
+
+
+
+
+
+
+ Vídeo de referência "" +
+
+ +
+
+ +
+
+ +
+
+
+
+ Expressão +
+
+ Mão direita +
+
+ Mão esquerda +
+
+
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ +
+
+ +
+
+ +
+ +
+ +
+
+
+
+ + {{ facialConfig.selectionPanel() }} {{ + handConfig.selectionPanel('right-hand') }} {{ + handConfig.selectionPanel('left-hand') }} + +
+
+ +
+ + {{ facialConfig.subconfigPanel() }} {{ + handConfig.subconfigPanel('right-hand') }} {{ + handConfig.subconfigPanel('left-hand') }} + +
+ +
+
+
+
+
+
+
GERAR + SINAL
+
+
+
+
+
+
Vídeo de referência
+
+ +
+
+
+
+
+ Sinal "" construído +
+ +
+ +
+
+
+
+ Gerando o sinal "" +
+
+ +
+
+
+
+
+
ENVIAR + SINAL
+
+
+
+
+
+

Obrigado,

+
você configurou o sinal com sucesso!
+
+
+

Parabéns,

+
você configurou todos os sinais + disponíveis!
+
+
+ +
+
+
+
+ + + + + + diff --git a/view/template.html b/view/template.html index 93fead9..6cbe44e 100755 --- a/view/template.html +++ b/view/template.html @@ -1,7 +1,8 @@ -{% import 'hand-configuration.html' as handConfig with context %} {% -import 'facial-configuration.html' as facialConfig with context %} +{% import 'facial-configuration.html' as facialConfig with context %} + +
@@ -111,18 +112,15 @@ import 'facial-configuration.html' as facialConfig with context %}
- {{ facialConfig.selectionPanel() }} {{ - handConfig.selectionPanel('right-hand') }} {{ - handConfig.selectionPanel('left-hand') }} + {{ facialConfig.selectionPanel() }} + {% include 'hand-configuration.html' %}
- {{ facialConfig.subconfigPanel() }} {{ - handConfig.subconfigPanel('right-hand') }} {{ - handConfig.subconfigPanel('left-hand') }} + {{ facialConfig.subconfigPanel() }}
@@ -196,7 +194,11 @@ import 'facial-configuration.html' as facialConfig with context %} + \ No newline at end of file + $( document ).ready(function() { + dynengine.load(); + }); + -- libgit2 0.21.2