Skip to content
This repository has been archived by the owner on Oct 3, 2022. It is now read-only.

How it works

Artem Flo edited this page Nov 1, 2015 · 5 revisions

BitASM takes all care about the routing and “memory” manipulations if you use a basic structure.

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.

Screens and routing

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.

Addresses

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”.

Types of elements and its memory mapping:

  • 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.

Clone this wiki locally