diff options
author | Timotej Lazar <timotej.lazar@fri.uni-lj.si> | 2016-03-01 19:12:17 +0100 |
---|---|---|
committer | Timotej Lazar <timotej.lazar@fri.uni-lj.si> | 2016-03-01 19:12:47 +0100 |
commit | 868733bb9f0721fbaebc51dfa766d329ed7ce840 (patch) | |
tree | b10ef860f7f5c927140e730b0e806ba0187d1a72 /js/codeq/robot.js | |
parent | cd612c54926ea3b0d2400a3ca9e4e9e8babcfaff (diff) |
Simplify {prolog,python,robot}.js
Diffstat (limited to 'js/codeq/robot.js')
-rw-r--r-- | js/codeq/robot.js | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/js/codeq/robot.js b/js/codeq/robot.js index 7bda8ec..f64e4a0 100644 --- a/js/codeq/robot.js +++ b/js/codeq/robot.js @@ -17,19 +17,13 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ (function() { "use strict"; var jqScreen = $('#screen-robot'), // the screen container element - // quadrants - jqCode = jqScreen.find('.block2'), jqConsole = jqScreen.find('.block3'), - jqInfo = jqScreen.find('.block-left'), - jqAllQuadrants = jqCode.add(jqConsole).add(jqInfo), // all the quadrants - // buttons jqBtnPlan = jqScreen.find('.btn-plan'), jqBtnHint = jqScreen.find('.btn-hint').ladda(), jqBtnRun = jqScreen.find('.btn-run'), jqBtnStop = jqScreen.find('.btn-stop'), - jqInfoButtons = jqBtnPlan.add(jqBtnHint), // all info-focusing buttons - jqAllButtons = jqInfoButtons.add(jqBtnRun).add(jqBtnStop), // all buttons - robotHandler; + jqAllButtons = jqBtnPlan.add(jqBtnHint).add(jqBtnRun).add(jqBtnStop), // all buttons + robotHandler; // created when we enter the robot state and destroyed once we leave it var enterFun = function(problemDef, commonDef, currentSolution) { $('#navigation-problem-list').css('display', ''); @@ -41,7 +35,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ robotHandler = createRobotHandler(problemDef, commonDef, currentSolution); }; - var robotHandler; //created when we enter the robot state and destroyed once we leave it codeq.globalStateMachine.register('robot', { 'jqScreen': jqScreen, @@ -59,8 +52,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ .done(); }, 'exit': function () { - jqAllButtons.off(); // unregister all event handlers - jqAllQuadrants.off(); jqScreen.css('display', 'none'); robotHandler.destroy(); robotHandler = null; @@ -88,10 +79,10 @@ along with this program. If not, see <http://www.gnu.org/licenses/>. */ }); var createRobotHandler = function (problemDef, commonDef, currentSolution) { - var jqEditor = jqCode.find('.code_editor'), - jqTerminal = jqConsole.find('.console'), - jqHints = jqInfo.find('.hints'), + var jqEditor = jqScreen.find('.code_editor'), + jqHints = jqScreen.find('.hints'), jqStatus = jqConsole.find('.status'), + jqTerminal = jqConsole.find('.console'), editor = codeq.makeEditor(jqEditor[0], { mode: 'python', |