Stairs/web/static/assets/dist/index.js

1 line
853 B
JavaScript
Raw Normal View History

define(["require","exports","knockout","hasher","crossroads","nprogress","stairs"],function(e,n,t,r,o,a,i){"use strict";n.__esModule=!0;var s=function(){function e(){this.Page=t.observable({pattern:"",component:""}),o.normalizeFn=o.NORM_AS_OBJECT,this.addPage(":rest*:","mode",-1/0),this.addPage("settings","settings"),this.addPage("firmware","firmware"),r.initialized.add(function(e){return o.parse(e)}),r.changed.add(function(e){return o.parse(e)}),r.init(),a.configure({parent:"#progress"});var e=i.Stairs.instance(),n=!0;this.progress=t.computed(function(){e.Saving()?a.start():n&&e.Loading()?a.start():(a.done(),n=!1)})}return e.prototype.addPage=function(e,n,r){var a=this,i={pattern:e,component:"page-"+n};t.components.register(i.component,{require:"components/"+i.component}),o.addRoute(e,function(){a.Page(i)},r)},e}();t.applyBindings(new s)});