code-dot-org/blockly — pull request #795 by Bjvanminnen (2014-08-07 20:51:01+00:00)
Title: [Finishes #75389304] Add when run block to all levels

This ended up being a much larger work item than I expected. Here are the major changes I made. I'm also going to make a couple line item comments.

(1) Added a run block to all levels. If you specify start blocks without a when run block, we'll insert one. This ended up being more difficult to do than I expected, in particular getting it to work both in the browser and in node (for unit tests). I made this run block be the same color as the run button. This means there are some other blocks that are now close in color (https://www.pivotaltracker.com/story/show/76555132). Screenshots of the when run block in different contexts:
K1:
![image](https://cloud.githubusercontent.com/assets/1767466/3848867/e90f3adc-1e73-11e4-9d5e-fe4f8188cc61.png)

artist:
![image](https://cloud.githubusercontent.com/assets/1767466/3848877/00855192-1e74-11e4-92b6-ce731c632f24.png)

studio:
![image](https://cloud.githubusercontent.com/assets/1767466/3848886/1573bb52-1e74-11e4-880e-81abc6b6088d.png)
(just noticed we should get rid of when run from toolbox. https://www.pivotaltracker.com/story/show/76558840)

flappy:
note, here I flipped the ordering of when run/when click so that when run is always in the top left for all apps
![image](https://cloud.githubusercontent.com/assets/1767466/3848908/5ae19772-1e74-11e4-8c68-7dc22938fa9e.png)

(2)
We should no longer ever have empty top level blocks. Instead of running through the code and then giving you an error, we'll now alert immediately and not animate/draw.

(3)
This threw off the block numbering for UI tests. I'll have a separate dashboard PR fixing those.