diff --git a/view/assets/js/dynamic-loading-engine.js b/view/assets/js/dynamic-loading-engine.js index b57cb51..b60ca9c 100644 --- a/view/assets/js/dynamic-loading-engine.js +++ b/view/assets/js/dynamic-loading-engine.js @@ -2,9 +2,9 @@ var setup = undefined; _preprocessHtml = function(data, url) { - var matchMainConfig = data.match(/main(?:C|c)onfig="(.*?)"/); var matchSubConfig = data.match(/sub(?:C|c)onfig="(.*?)"/); var goodData = data; + var isRightHand = function(hand) { return hand === 'right-hand'; }; @@ -13,19 +13,20 @@ // There is no specific(right or left hand dependent) assets for: articulacao, duracao, expressao, movimento, transicao // Specific configurations: configuracao, orientacao // possible values on the side as comment - var mainConfig = matchMainConfig[1]; // right-hand or left-hand + var hand = dynworkflow.getMainConfig(); // right-hand or left-hand var subConfig = matchSubConfig[1]; // articulacao | configuracao | duracao | expressao | movimento | orientacao | transicao + // possible subconfigs that need changing switch (subConfig) { case 'configuracao': - if (isRightHand(mainConfig)) { + if (isRightHand(hand)) { goodData = data.replace(/{{ configuracao }}/g, 'cmd'); } else { goodData = data.replace(/{{ configuracao }}/g, 'cme'); } break; case 'orientacao': - if (isRightHand(mainConfig)) { + if (isRightHand(hand)) { goodData = data.replace(/{{ orientacao }}/g, 'ord'); } else { goodData = data.replace(/{{ orientacao }}/g, 'ore'); @@ -34,6 +35,9 @@ default: console.log('No subConfig found'); } + + // change {{ hand }} + goodData = data.replace(/{{ hand }}/g, hand); } return goodData.replace(/{{ server }}/g, url); }; diff --git a/view/assets/js/dynamic-selection-workflow.js b/view/assets/js/dynamic-selection-workflow.js index 5309bd9..a7fca38 100644 --- a/view/assets/js/dynamic-selection-workflow.js +++ b/view/assets/js/dynamic-selection-workflow.js @@ -268,6 +268,10 @@ return _getAttributes(jsonWF['hand']['movimento'][movementName]); }; + dynworkflow.getMainConfig = function() { + return mainConfig; + }; + dynworkflow.load = function() { baseUrl = $('#server-url').data('url'); $.get(baseUrl + '/conf/selection-workflow-json', function(result) { diff --git a/view/hand/articulacao/passo-1.html b/view/hand/articulacao/passo-1.html index 25e8460..edcb1a4 100644 --- a/view/hand/articulacao/passo-1.html +++ b/view/hand/articulacao/passo-1.html @@ -1,75 +1,75 @@ -