source: Dev/trunk/src/client/qed-client/index.js @ 519

Last change on this file since 519 was 519, checked in by hendrikvanantwerpen, 11 years ago
  • Support different environments with QED_ENV. If dev, run against qed-dev database, if production, run against qed database. The UI indicates if we are running in anything but production mode.
  • Return undefined if we allow page leaves, because null is treated as a value.
  • Changed format of design docs, so it can work for different databases.
  • Use correct design documents in configCouch, so server now actually updates them when it starts.
File size: 741 bytes
Line 
1define([
2    "./app/Router",
3    "./routes",
4    "./session",
5    "./ui/MainMenu",
6    "dojo/_base/array",
7    "dojo/_base/xhr",
8    "dojo/dom",
9    "dojo/parser",
10    "./stddeps",
11    "dojo/domReady!"
12], function(Router, routes, session, MainMenu, array, xhr, dom, parser) {
13
14    parser.parse();
15
16    new MainMenu({},"menu").startup();
17
18    xhr("GET", {
19        url: 'api/mode',
20        handleAs: 'json'
21    }).then(function(result){
22        var node = dom.byId('qedModeNode');
23        if ( result.mode !== 'production' ) {
24            node.innerHTML = "Running in "+result.mode+" mode";
25        }
26    });
27
28    array.forEach(routes,function(route){
29        Router.register(route);
30    });
31    Router.startup();
32
33    session.restore();
34
35});
Note: See TracBrowser for help on using the repository browser.