dhxmvp
Version:
A complete boilerplate for building online, offline and syncable MVP Single Page Applications using DHTMLX.
1 lines • 796 B
JavaScript
!function(t){"use strict"}(window.$dhx=window.$dhx||{}),function(t){"use strict"}($dhx.ui=$dhx.ui||{}),$dhx.ui.router=function(){var t=crossroads.create();t.normalizeFn=crossroads.NORM_AS_OBJECT,t.routed.add(function(t,e){$dhx.ui.mvp.loadModule(t,e)}),crossroads.bypassed.add(function(t){throw"Route "+t+" not declared"});var e={router:t,request_url:!1,addRoute:function(e,i){var d=t.addRoute(e,i);d.matched.add(function(t){}),d.switched.add(function(t){})},routeTo:function(t){hasher.setHash(t)},init:function(){function e(e,i){t.parse(e)}this.request_url=(window.location.hash||"").replace(/#/,"").replace(/\//,""),0===this.request_url.length&&(this.request_url=!1),window.location.hash="",hasher.initialized.add(e),hasher.changed.add(e),hasher.isActive()||hasher.init()}};return e.init(),e}();