summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTimotej Lazar <timotej.lazar@fri.uni-lj.si>2016-03-01 15:30:27 +0100
committerTimotej Lazar <timotej.lazar@fri.uni-lj.si>2016-03-01 15:30:27 +0100
commit8123099f8655981e3f7984830fe8ca0154b7278e (patch)
tree0d5f9b874480e76e249852100931fc3df9bc6e51
parent982522b5b9dfc39c10d08129b873aadf77b7293f (diff)
Clear hints immediately when pressing Plan or Test
-rw-r--r--js/codeq/hint.js6
-rw-r--r--js/codeq/prolog.js2
-rw-r--r--js/codeq/python.js2
-rw-r--r--js/codeq/robot.js2
-rw-r--r--js/codeq/upgrade_to_aai.js1
5 files changed, 8 insertions, 5 deletions
diff --git a/js/codeq/hint.js b/js/codeq/hint.js
index 0550a41..641c710 100644
--- a/js/codeq/hint.js
+++ b/js/codeq/hint.js
@@ -386,7 +386,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
if (planIdx < planDef.length) {
var jqHintBox = $('<div class="feedback"></div>');
activityHandler.queueTrace({'typ': 'plan', 'index': planIdx});
- clearHints();
typeHandlers['static'](planDef[planIdx], {'id': 'plan'}, jqHintBox);
jqHints.prepend(jqHintBox);
jqHintsContainer.scrollTop(0);
@@ -411,9 +410,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
jqHintBox = $('<div class="feedback"></div>'),
jqHintBtn;
- // clear any existing hints
- clearHints();
-
// display the test_results hint first if found
for (i = 0; i < hints.length; i++) {
hint = hints[i];
@@ -450,6 +446,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
jqHintsContainer.scrollTop(0);
},
+ 'clear': clearHints,
+
'destroy': function () {
editor.off('update', onEditorUpdate);
clearHints();
diff --git a/js/codeq/prolog.js b/js/codeq/prolog.js
index 6e07784..0ae8206 100644
--- a/js/codeq/prolog.js
+++ b/js/codeq/prolog.js
@@ -220,6 +220,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
});
jqBtnPlan.on('click', function () {
+ hinter.clear();
if (!hinter.planNext()) {
jqBtnPlan.hide();
}
@@ -230,6 +231,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
// maintain the illusion
var timeout = 500 + Math.random() * 1000;
+ hinter.clear();
$(editor.getWrapperElement()).addClass('disabled');
editor.setOption('readOnly', 'nocursor');
terminal.inputDisable();
diff --git a/js/codeq/python.js b/js/codeq/python.js
index 112d7ff..edf0f46 100644
--- a/js/codeq/python.js
+++ b/js/codeq/python.js
@@ -155,6 +155,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
});
jqBtnPlan.on('click', function () {
+ hinter.clear();
if (!hinter.planNext()) {
jqBtnPlan.prop('disabled', true).blur();
}
@@ -164,6 +165,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
// maintain the illusion
var timeout = 500 + Math.random() * 1000;
+ hinter.clear();
$(editor.getWrapperElement()).addClass('disabled');
editor.setOption('readOnly', 'nocursor');
terminal.inputDisable();
diff --git a/js/codeq/robot.js b/js/codeq/robot.js
index 3e561a1..7bda8ec 100644
--- a/js/codeq/robot.js
+++ b/js/codeq/robot.js
@@ -161,11 +161,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
});
jqBtnPlan.on('click', function () {
+ hinter.clear();
if (!hinter.planNext()) {
jqBtnPlan.prop('disabled', true).blur();
}
});
jqBtnHint.on('click', function () {
+ hinter.clear();
$(editor.getWrapperElement()).addClass('disabled');
editor.setOption('readOnly', 'nocursor');
jqBtnHint.ladda('start');
diff --git a/js/codeq/upgrade_to_aai.js b/js/codeq/upgrade_to_aai.js
index a75be22..867c9ea 100644
--- a/js/codeq/upgrade_to_aai.js
+++ b/js/codeq/upgrade_to_aai.js
@@ -82,5 +82,4 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */
jqPassword.val('');
}
});
-
})();