var BlueprintView = View.extend({ el: "#blueprintView", action: "/api/blueprint/show/", events: { }, initialize: function(){ // this.colorControl = new ColorControl ({ parent: this }) // this.cursor = new HelpCursor({ parent: this }) this.map = this.buildMap() this.editor = new BlueprintEditor ({ parent: this }) this.toolbar = new BlueprintToolbar ({ parent: this }) this.uploader = new BlueprintUploader ({ parent: this }) this.scaler = new BlueprintScaler ({ parent: this }) this.info = new BlueprintInfo ({ parent: this }) this.settings = new BlueprintSettings ({ parent: this }) this.notice = new BlueprintNotice ({ parent: this }) }, load: function(name){ name = sanitize(name) || "new" this.uploader.load(name) // name = sanitize(name) // $.get(this.action + name, this.ready.bind(this)) }, orbiting: true, buildMap: function(){ // i forget if this has to be global map = new Map ({ type: "ortho", el: document.querySelector("#orthographic"), width: window.innerWidth/2, height: window.innerHeight, zoom: -2, zoom_min: -6.2, zoom_max: 1, }) map.ui.add_tool("arrow", new ArrowTool) map.ui.add_tool("polyline", new PolylineTool) map.ui.add_tool("ortho-polyline", new OrthoPolylineTool) map.ui.add_tool("eraser", new EraserTool) map.ui.add_tool("position", new PositionTool) map.ui.placing = false return map }, ready: function(data){ this.data = data this.info.load(data) this.settings.load(data) this.editor.loadFloorplan(data) if (! data.isNew) { this.notice.showCreateProjectNotice() } }, hideExtras: function(){ }, pickWall: function(wall, pos){ }, })