Loading html/images/is_waiting.png 0 → 100644 +2.8 KiB Loading image diff... html/index.html +3 −0 Original line number Diff line number Diff line Loading @@ -12,6 +12,9 @@ <h1 id="app-name">Pepper Word Craft</h1> <button type="button" id="button-exit">Click Me!</button> <h3 id="element_result"></h3> <div style="position: absolute; top: 0px; right: 0px;" id="is_waiting"> <img src="images/is_waiting.png" alt="Waiting on response..."> </div> </header> <main> <section id="elements"> Loading html/script.js +13 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ var element_element_result = document.getElementById("element_result"); var element_exit_button = document.getElementById("button-exit"); var element_app_name = document.getElementById("app-name"); var element_element_list_name = document.getElementById("element-list-name"); var element_is_waiting = document.getElementById("is_waiting"); var detected_word_extracted = null; var combine_words_memory_subscription = null; Loading Loading @@ -91,6 +92,14 @@ function robot_set_voice_speed(speed) { } robot_set_voice_speed(89); function show_response_state(is_waiting) { if (is_waiting) { element_is_waiting.style.display = null; } else { element_is_waiting.style.display = "none"; } } function onWordRecognized(value) { detected_word_extracted = value[0].substr(6, value[0].length - 12); if (WORD_CONFIDENCE_THRESHOLD[LANG] > value[1]) return; Loading Loading @@ -143,7 +152,9 @@ function add_to_combination(word) { } is_last_word_asigned = false; element_element_result.innerText = last_word + " + " + word + " ="; show_response_state(true); fetch(PREFIX + "api?method=combine&word1=" + encodeURIComponent(last_word) + "&word2=" + encodeURIComponent(word) + "&lang=" + LANG).then(function(response) { show_response_state(false); return response.json(); }).then(function(j) { add_to_combination_lock = false; Loading Loading @@ -205,7 +216,9 @@ function robot_get_language() { element_app_name.innerText = dialogs[LANG]["app-name"]; element_element_list_name.innerText = dialogs[LANG]["element-list-name"]; element_exit_button.innerText = dialogs[LANG]["quit"]; show_response_state(true); fetch(PREFIX + `api?method=starting_words&lang=${encodeURIComponent(LANG)}`).then(function(response) { show_response_state(false); return response.json(); }).then(function(j) { if ("error" in j) { Loading manifest.xml +1 −1 Original line number Diff line number Diff line <package uuid="pepper-infinite-craft-pkg" version="0.7.31"> <package uuid="pepper-infinite-craft-pkg" version="0.7.34"> <names> <name lang="en_US">pepper-infinite-craft-pkg</name> <name lang="cs_CZ">pepper-infinite-craft-pkg</name> Loading pepper-infinite-craft-pkg.pml +1 −0 Original line number Diff line number Diff line Loading @@ -11,6 +11,7 @@ <File name="icon" src="icon.png" /> <File name="jquery-1.11.0.min" src="html/js/jquery-1.11.0.min.js" /> <File name="main" src="html/script.js" /> <File name="is_waiting_image" src="html/images/is_waiting.png" /> <File name="robotutils" src="html/js/robotutils.js" /> </Resources> <Topics> Loading Loading
html/index.html +3 −0 Original line number Diff line number Diff line Loading @@ -12,6 +12,9 @@ <h1 id="app-name">Pepper Word Craft</h1> <button type="button" id="button-exit">Click Me!</button> <h3 id="element_result"></h3> <div style="position: absolute; top: 0px; right: 0px;" id="is_waiting"> <img src="images/is_waiting.png" alt="Waiting on response..."> </div> </header> <main> <section id="elements"> Loading
html/script.js +13 −0 Original line number Diff line number Diff line Loading @@ -17,6 +17,7 @@ var element_element_result = document.getElementById("element_result"); var element_exit_button = document.getElementById("button-exit"); var element_app_name = document.getElementById("app-name"); var element_element_list_name = document.getElementById("element-list-name"); var element_is_waiting = document.getElementById("is_waiting"); var detected_word_extracted = null; var combine_words_memory_subscription = null; Loading Loading @@ -91,6 +92,14 @@ function robot_set_voice_speed(speed) { } robot_set_voice_speed(89); function show_response_state(is_waiting) { if (is_waiting) { element_is_waiting.style.display = null; } else { element_is_waiting.style.display = "none"; } } function onWordRecognized(value) { detected_word_extracted = value[0].substr(6, value[0].length - 12); if (WORD_CONFIDENCE_THRESHOLD[LANG] > value[1]) return; Loading Loading @@ -143,7 +152,9 @@ function add_to_combination(word) { } is_last_word_asigned = false; element_element_result.innerText = last_word + " + " + word + " ="; show_response_state(true); fetch(PREFIX + "api?method=combine&word1=" + encodeURIComponent(last_word) + "&word2=" + encodeURIComponent(word) + "&lang=" + LANG).then(function(response) { show_response_state(false); return response.json(); }).then(function(j) { add_to_combination_lock = false; Loading Loading @@ -205,7 +216,9 @@ function robot_get_language() { element_app_name.innerText = dialogs[LANG]["app-name"]; element_element_list_name.innerText = dialogs[LANG]["element-list-name"]; element_exit_button.innerText = dialogs[LANG]["quit"]; show_response_state(true); fetch(PREFIX + `api?method=starting_words&lang=${encodeURIComponent(LANG)}`).then(function(response) { show_response_state(false); return response.json(); }).then(function(j) { if ("error" in j) { Loading
manifest.xml +1 −1 Original line number Diff line number Diff line <package uuid="pepper-infinite-craft-pkg" version="0.7.31"> <package uuid="pepper-infinite-craft-pkg" version="0.7.34"> <names> <name lang="en_US">pepper-infinite-craft-pkg</name> <name lang="cs_CZ">pepper-infinite-craft-pkg</name> Loading
pepper-infinite-craft-pkg.pml +1 −0 Original line number Diff line number Diff line Loading @@ -11,6 +11,7 @@ <File name="icon" src="icon.png" /> <File name="jquery-1.11.0.min" src="html/js/jquery-1.11.0.min.js" /> <File name="main" src="html/script.js" /> <File name="is_waiting_image" src="html/images/is_waiting.png" /> <File name="robotutils" src="html/js/robotutils.js" /> </Resources> <Topics> Loading