all repos — litestore @ 11fee4a9e94a6aa915e4e3fbcf57dbf832b3d83f

A minimalist nosql document store.

src/admin/js/app.js

 1
 2
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
(function(){
  'use strict';
  var app = window.LS || (window.LS = {});

  app.flash = m.prop();
  app.system = {};
  m.route.mode = "hash";

  app.init = function(info){
    app.system = info;
    app.system.v = app.system.version.match(/(v.+)$/)[1];
    m.route(document.body, "/info", {
      "/info": app.info,
      "/html/:id...": app.htmldoc,
      "/document/:action/:id...": app.document,
      "/guide/:id": app.guide,
      "/new": app.create,
      "/tags/:id": app.tags,
      "/tags/:id/:page": app.tags,
      "/tags/:id/:page/:limit": app.tags,
      "/search/:q": app.search,
      "/search/:q/:page": app.search,
      "/search/:q/:page/:limit": app.search
    });
  };
  Info.get().then(app.init);

}());