-
Notifications
You must be signed in to change notification settings - Fork 0
How it works
BitASM takes all care about the routing and “memory” manipulations if you use a basic structure.
All data in bitASM app divided in parts:
- Screen and ROM – your HTML document.
- Code – bitASM JS and your app’s scripts
- Data – asmDB
And, separately, your and bitASM css files.
BitASM has a basic routing engine: window.location.hash is automatically mapped on screens. For this feature every screen should have a “scr-%url%”
class. For example, url “/#/hello/screen”
will be mapped to screen with a class “scr-hello-screen”
. Slashes turn to dashes when searching for a screen element and vice versa.
In its turn HTML is divided to the screen and ROM. The screen div contains data visible to user right now. ROM – memory div, where all the screens and other elements are stored. Each element should have necessary attribute “id” type of “addr0xXXXXXXXX”. Screen div always has address 0x00000000 and correspondingly, its id is “addr0x00000000”.
- Screens – 0x00000001 - 0x09999999
- Shared Elements – 0x10000000 - 0x19999999
- Templates – 0x20000000 - 0x29999999
- Sounds – 0x30000000 - 0x39999999
- Custom Errors – 0x90000000 - 0x99999999
Addresses 0x40000000 – 0x89999999 are reserved for future. If you need this addresses – use them with caution.