NaranJaa / blockly

Automatically exported from code.google.com/p/blockly
0 stars 0 forks source link

Don't use alert for printing values #246

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Currently the JavaScript "alert" function is being used to display text when 
using the Blockly "print" function.  If text is being displayed in a loop that 
was written incorrectly as an infinite loop, the browser will display alert 
dialog boxes infinitely which locks the browser and prevents the user from 
correcting their mistake.  If the user blocks the alerts from appearing, 
Blockly will no longer be able to display output.

I would suggest displaying the output text in a rectangular portion of the 
window instead.  That way the user can see the results of previous output 
statements.

Original issue reported on code.google.com by fmcc...@harding.edu on 20 Aug 2014 at 7:41

GoogleCodeExporter commented 9 years ago
Agreed that alert (and prompt) are horrible UI.  But those default blocks are 
just intended to be minimal demo blocks for developers.  End-user applications 
are expected to provide their own API blocks.

The nice thing about alert and prompt is that they don't have dependencies on 
external HTML.  So developers can use them to get Blockly working quickly, 
before making their UI more friendly and more complex.  If you see a Blockly 
app (for end users) that uses alert or prompt, definitely send them a note.

Original comment by neil.fra...@gmail.com on 9 Mar 2015 at 2:39