diff options
author | Timotej Lazar <timotej.lazar@fri.uni-lj.si> | 2016-02-25 18:43:00 +0100 |
---|---|---|
committer | Timotej Lazar <timotej.lazar@fri.uni-lj.si> | 2016-02-25 18:43:00 +0100 |
commit | 3ae1aeaefa875153e4abbe7a54c06b89ac1f875e (patch) | |
tree | 211135e0fe6fd646b439d5136a035ced68bea2b6 | |
parent | b874b22e5b6816ab52012094671dda68d1b2b33c (diff) |
Gray-out the editor while waiting for test results
-rw-r--r-- | css/codeq.css | 4 | ||||
-rw-r--r-- | js/codeq/prolog.js | 4 | ||||
-rw-r--r-- | js/codeq/python.js | 4 | ||||
-rw-r--r-- | js/codeq/robot.js | 4 |
4 files changed, 13 insertions, 3 deletions
diff --git a/css/codeq.css b/css/codeq.css index 9e4bd2e..f7bab6c 100644 --- a/css/codeq.css +++ b/css/codeq.css @@ -269,6 +269,10 @@ h2.group-title a.view-solutions { min-height: 6em; } +.CodeMirror.disabled { + opacity: 0.75; +} + .block > .scrollable-content-container { padding-left: 1em; padding-right: 1em; diff --git a/js/codeq/prolog.js b/js/codeq/prolog.js index 11958ce..a4a916f 100644 --- a/js/codeq/prolog.js +++ b/js/codeq/prolog.js @@ -224,7 +224,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ // maintain the illusion var timeout = 500 + Math.random() * 1000; - editor.setOption('readOnly', true); + $(editor.getWrapperElement()).addClass('disabled'); + editor.setOption('readOnly', 'nocursor'); terminal.inputDisable(); jqBtnTest.ladda('start'); @@ -245,6 +246,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ .fail(commError) .fin(function () { editor.setOption('readOnly', false); + $(editor.getWrapperElement()).removeClass('disabled'); terminal.inputEnable(); jqBtnTest.ladda('stop'); }) diff --git a/js/codeq/python.js b/js/codeq/python.js index 4109b62..302a0fb 100644 --- a/js/codeq/python.js +++ b/js/codeq/python.js @@ -167,7 +167,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ // maintain the illusion var timeout = 500 + Math.random() * 1000; - editor.setOption('readOnly', true); + $(editor.getWrapperElement()).addClass('disabled'); + editor.setOption('readOnly', 'nocursor'); terminal.inputDisable(); jqBtnTest.ladda('start'); @@ -188,6 +189,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ .fail(commError) .fin(function () { editor.setOption('readOnly', false); + $(editor.getWrapperElement()).removeClass('disabled'); terminal.inputEnable(); jqBtnTest.ladda('stop'); }) diff --git a/js/codeq/robot.js b/js/codeq/robot.js index 8754c82..338abe7 100644 --- a/js/codeq/robot.js +++ b/js/codeq/robot.js @@ -169,7 +169,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ } }); jqBtnHint.on('click', function () { - editor.setOption('readOnly', true); + $(editor.getWrapperElement()).addClass('disabled'); + editor.setOption('readOnly', 'nocursor'); jqBtnHint.ladda('start'); codeq.comms.sendHint({ 'program': editor.getDoc().getValue(), @@ -186,6 +187,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ .fail(commError) .fin(function () { editor.setOption('readOnly', false); + $(editor.getWrapperElement()).removeClass('disabled'); jqBtnHint.ladda('stop'); }) .done(); |