Method Summary
Method Attributes Method Name and Description
 
$e_loadURLParams(urlParams)
Parses the parameters in the URL
 
Returns the user's code
 
Runs the code in the console
 
Gets the output from I/O
 
Returns the image binary of the whiteboard
 
API_setAxis(value, action)
Chooses the predefined axis to use for the grid
 
API_setGridStep(value, action)
Sets the separation of the lines in the grid
 
API_setInput(value, action)
Sets the input in I/O
 
API_setInstructions(value, action)
Sets the instruction blocks to make available to the user
 
API_setTimeout(value, action)
Sets the execution time limit
 
API_showFilemenu(value, action)
Shows/Hides the filemenu
 
API_showGrid(value, action)
Shows/Hides the grid
 
API_showGuide(value, action)
Shows/Hides the guide
 
API_switchLanguage(value, action)
Switches to the specified language
 
API_switchView(value, action)
Switches to the specified view
 
API_uploadCode(code, run)
Loads code into the console
 
API_uploadPrecode(code, run)
Loads precode into the console
Method Detail
$e_loadURLParams(urlParams)
Parses the parameters in the URL
Defined in: </home/ubuntu/workspace/js/api.js>.
$e_loadURLParams()
Parameters:
{String} urlParams Optional
URL to parse. If unset use browser's location

{String} API_downloadCode()
Returns the user's code
Defined in: </home/ubuntu/workspace/js/api.js>.
API_downloadCode()
Returns:
{String} User code

API_execute()
Runs the code in the console
Defined in: </home/ubuntu/workspace/js/api.js>.
API_execute()
Since:
2.3

{String} API_getOuput()
Gets the output from I/O
Defined in: </home/ubuntu/workspace/js/api.js>.
API_getOuput("1 1 2 3 5 8")
Since:
2.3
Returns:
{String} Output in the I/O

{*} API_getWhiteboard()
Returns the image binary of the whiteboard
Defined in: </home/ubuntu/workspace/js/api.js>.
API_getWhiteboard()
Since:
2.3
Returns:
{*} Image binary of the whiteboard

API_setAxis(value, action)
Chooses the predefined axis to use for the grid
Defined in: </home/ubuntu/workspace/js/api.js>.
API_setAxis(0)
Parameters:
{Number|String} value
Index of the predefined axis to use
{Boolean} action Optional, Default: true
Whether to run the actions to apply the changes (true) or just set the variables (false)
Since:
2.3

API_setGridStep(value, action)
Sets the separation of the lines in the grid
Defined in: </home/ubuntu/workspace/js/api.js>.
API_setGridStep(50)
Parameters:
{Number|String} value
Pixels between each line in the grid
{Boolean} action Optional, Default: true
Whether to run the actions to apply the changes (true) or just set the variables (false)
Since:
2.3

API_setInput(value, action)
Sets the input in I/O
Defined in: </home/ubuntu/workspace/js/api.js>.
API_setInput("1 1 2 3 5 8")
Parameters:
{String} value
Input to use
{Boolean} action Optional, Default: true
Whether to run the actions to apply the changes (true) or just set the variables (false)
Since:
2.3

API_setInstructions(value, action)
Sets the instruction blocks to make available to the user
Defined in: </home/ubuntu/workspace/js/api.js>.
API_setInstructions("turnLeft;90;forward")
Parameters:
{String} value
Instructions to makwe available (spearated with semi-colon, parameters can be postfixed to each instruction also separated with semi-colons)
{Boolean} action Optional, Default: true
Whether to run the actions to apply the changes (true) or just set the variables (false)
Since:
2.3

API_setTimeout(value, action)
Sets the execution time limit
Defined in: </home/ubuntu/workspace/js/api.js>.
API_setTimeout(20)
Parameters:
{Number|String} value
Seconds to wait for the execution to finish
{Boolean} action Optional, Default: true
Whether to run the actions to apply the changes (true) or just set the variables (false)
Since:
2.3

API_showFilemenu(value, action)
Shows/Hides the filemenu
Defined in: </home/ubuntu/workspace/js/api.js>.
API_showFilemenu(false)
Parameters:
{Boolean|String} value
Whether to show it (true) or hide it (false)
{Boolean} action Optional, Default: true
Whether to run the actions to apply the changes (true) or just set the variables (false)
Since:
2.3

API_showGrid(value, action)
Shows/Hides the grid
Defined in: </home/ubuntu/workspace/js/api.js>.
API_showGrid(false)
Parameters:
{Boolean|String} value
Whether to show it (true) or hide it (false)
{Boolean} action Optional, Default: true
Whether to run the actions to apply the changes (true) or just set the variables (false)
Since:
2.3

API_showGuide(value, action)
Shows/Hides the guide
Defined in: </home/ubuntu/workspace/js/api.js>.
API_showGuide(false)
Parameters:
{Boolean|String} value
Whether to show it (true) or hide it (false)
{Boolean} action Optional, Default: true
Whether to run the actions to apply the changes (true) or just set the variables (false)
Since:
2.3

API_switchLanguage(value, action)
Switches to the specified language
Defined in: </home/ubuntu/workspace/js/api.js>.
API_switchLanguage("ca")
Parameters:
{String} value
Language to switch to
{Boolean} action Optional, Default: true
Whether to run the actions to apply the changes (true) or just set the variables (false)
Since:
2.3

API_switchView(value, action)
Switches to the specified view
Defined in: </home/ubuntu/workspace/js/api.js>.
API_switchView("build")
Parameters:
{String} value
View to switch to
{Boolean} action Optional, Default: true
Whether to run the actions to apply the changes (true) or just set the variables (false)
Since:
2.3

API_uploadCode(code, run)
Loads code into the console
Defined in: </home/ubuntu/workspace/js/api.js>.
API_uploadCode("repeat(4){forward(100)}",true)
Parameters:
{String} code
Code to upload
{Boolean} run Optional, Default: false
If true, it runs the code immediately

API_uploadPrecode(code, run)
Loads precode into the console
Defined in: </home/ubuntu/workspace/js/api.js>.
API_uploadPrecode("repeat(4){forward(100)}")
Parameters:
{String} code
Code to set as precode
{Boolean} run Optional, Default: true
If false, it doesn't run the code immediately, only when the user executes user code
Since:
2.2