This shows you the differences between two versions of the page.
Both sides previous revision Previous revision | Next revision Both sides next revision | ||
devel:hacking [2012/09/18 08:25] bredal [Python boilerplate headers] |
devel:hacking [2012/09/18 08:38] bredal [Headline] |
||
---|---|---|---|
Line 125: | Line 125: | ||
</code> | </code> | ||
- | ===== Headline ===== | + | ===== Javascript ===== |
+ | When writing javascript code try to focus on modules not pages. If the code is html-related, it should take selectors or objects as input and concern itself solely about those. This makes for much easier testing and reuse. And of course - write the tests first. | ||
+ | |||
+ | When the module is done you write a controller for the page that plugs the needed plugins to the page elements. This should fail gracefully if the needed elements are not present. | ||
+ | |||
+ | NAVs javascript uses [[http://requirejs.org/|require.js]] - use this to create modules and specify dependencies. | ||
====== Database ====== | ====== Database ====== | ||
NAV uses PostgreSQL as its database backend. Namespaces (schemas) are | NAV uses PostgreSQL as its database backend. Namespaces (schemas) are |