diff options
author | Robert Zorko <robertz@gurucue.com> | 2015-09-16 17:57:10 +0200 |
---|---|---|
committer | Robert Zorko <robertz@gurucue.com> | 2015-09-16 17:57:10 +0200 |
commit | d7d03438ad84376c516a7bd7b2ae28b746637c1c (patch) | |
tree | 161408c1f89b7c9688791fd9051c15de83d12f44 | |
parent | 3a08bd2a99f73e72d14fb43a33b7483f2fa865b4 (diff) |
Enabled the state machine and the UI improvments and removed some debug loging
-rw-r--r-- | index.html | 10 | ||||
-rw-r--r-- | js/codeq/startup.js | 6 | ||||
-rw-r--r-- | js/codeq/stateMachine.js | 41 |
3 files changed, 9 insertions, 48 deletions
@@ -82,11 +82,11 @@ <div class="container-fluid" id="screen_prolog" style="display: none;"> <div class="row"> - <div class="col-lg-3 col-md-6 col-sm-12 block"> + <div class="col-lg-3 col-md-6 col-sm-12 block transition"> <div id="description"></div> <div class="block-label">Instructions</div> </div> - <div class="col-lg-3 col-md-6 col-sm-12 block"> + <div class="col-lg-3 col-md-6 col-sm-12 block transition"> <nav class="navbar navbar-default" id="block-toolbar"> <div class="container-fluid"> <button type="button" class="btn btn-default navbar-btn" id="btn_code_hint">Hint</button> @@ -96,11 +96,11 @@ <div id="code_editor"></div> <div class="block-label">Code</div> </div> - <div class="col-lg-3 col-md-6 col-sm-12 block"> + <div class="col-lg-3 col-md-6 col-sm-12 block transition"> <div id="console"></div> <div class="block-label">Console</div> </div> - <div class="col-lg-3 col-md-6 col-sm-12 block"> + <div class="col-lg-3 col-md-6 col-sm-12 block transition"> <div id="info"></div> <div class="block-label">Hints</div> </div> @@ -134,7 +134,7 @@ <script src="js/def_parser.js"></script> <script src="js/prolog.js"></script> <script src="js/python.js"></script> - <!-- <script src="js/codeq/stateMachine.js"></script> --> + <script src="js/codeq/stateMachine.js"></script> <script src="js/codeq/startup.js"></script> </body> </html> diff --git a/js/codeq/startup.js b/js/codeq/startup.js index 9a0473c..2f7df97 100644 --- a/js/codeq/startup.js +++ b/js/codeq/startup.js @@ -1,5 +1,5 @@ $(document).ready(function () { - codeq.comms.connect().then(function () { + /*codeq.comms.connect().then(function () { return codeq.comms.send({'action': 'list_problems'}); }).then( function success(data) { @@ -93,7 +93,7 @@ $(document).ready(function () { $('#disabled').css('cursor', ''); alert('Request to obtain list of problems failed: ' + reason); } - ).done(); + ).done();*/ - //codeq.globalStateMachine.transition('login'); + codeq.globalStateMachine.transition('login'); });
\ No newline at end of file diff --git a/js/codeq/stateMachine.js b/js/codeq/stateMachine.js index 720400d..229c8ff 100644 --- a/js/codeq/stateMachine.js +++ b/js/codeq/stateMachine.js @@ -45,22 +45,6 @@ var loginFun = function(){ //$('#screen_prolog').css('display', ''); codeq.globalStateMachine.transition('prolog'); window.phandler = codeq.createPrologHandler(data.data); - - var jq = $('#console textarea').on('focus',function(){ - codeq.log.debug('focus'); - }).on('blur',function(){ - codeq.log.debug('blur'); - }); - - var c = $('#console').on('focus',function(){ - codeq.log.debug('console focus'); - }).on('blur',function(){ - codeq.log.debug('console blur'); - }); - - codeq.log.debug("textareas: "+jq.length ); - codeq.log.debug("consols: "+c.length ); - break; case 'python': // TODO: assignment to window for debug only @@ -68,13 +52,6 @@ var loginFun = function(){ //$('#screen_prolog').css('display', ''); codeq.globalStateMachine.transition('prolog'); window.phandler = codeq.createPythonHandler(data.data); - $('#console textarea').on('focus',function(){ - codeq.log.debug('focus'); - }); - $('#console textarea').on('blur',function(){ - codeq.log.debug('blur'); - }); - break; default: alert('Unknown language: ' + identifier[0]); @@ -87,7 +64,7 @@ var loginFun = function(){ }) .done(); } -} +}; codeq.globalStateMachine = codeq.makeStateMachine({ 'login':{ @@ -213,19 +190,6 @@ var problems,//this will the actual state machine if(current !== code)code.on( eventName,mouseDownEventFunctionCode); if(current !== info)info.on( eventName,mouseDownEventFunctionInfo); if(current !== consoleDiv)consoleDiv.on( eventName,mouseDownEventFunctionConsole); - - /*if(current !== description)description.on( eventName,function(){ - problems.transition('instructions'); - }); - if(current !== info)info.on( eventName,function(){ - problems.transition('info'); - }); - if(current !== code)code.on( eventName,function(){ - problems.transition('code'); - }); - if(current !== consoleDiv)consoleDiv.on( eventName,function(){ - problems.transition('console'); - });*/ }, removeFocusFromElements = function(){ @@ -279,7 +243,6 @@ var problems,//this will the actual state machine setTransitionsBetweenDivs(info); }, 'exit': function(){ - //$('div.col-lg-3.col-md-6.col-sm-12').addClass('block'); removeFocusFromElements(); removeChangedClassesFromDivs(); removeListenersFromDivs(); @@ -297,8 +260,6 @@ var problems,//this will the actual state machine setTransitionsBetweenDivs(consoleDiv); }, 'exit': function(){ - //$('span.cursor.blink').removeClass('blink'); - removeFocusFromElements(); removeChangedClassesFromDivs(); removeListenersFromDivs(); |