more migration to common docs (#370)

* more migration to common docs

* refactoring js

* removed duplicate docs

* migrating more docs

* more refactoring

* migrated browsers page

* updated summary
This commit is contained in:
Peli de Halleux
2017-03-14 12:07:17 -07:00
committed by GitHub
parent 1acad5195e
commit fb5bb396e1
51 changed files with 34 additions and 1656 deletions

View File

@ -1,11 +1,6 @@
# On Start
# @extends
An event that runs when the program starts.
The ``on start`` is a special event that runs when the program starts, before any other event.
Use this event to initialize your program.
## Example
## #exstart
In this example, ``on start`` sets a dimmer brightness on the screen and the button handler shows a string.
@ -15,14 +10,3 @@ input.onButtonPressed(Button.A, () => {
})
led.setBrightness(50)
```
## What about JavaScript?
``on-start`` only exists in the block editor. In JavaScript, all code executes sequentially from the first line.
## Hey, my events moved!
When we transform the blocks into JavaScript, we always place all the event registrations (buttons, shake, ...)
before launching the ``on start`` code.
If a block from ``on start`` pauses, other registered events will have the opportunity to run as well.