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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
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 })
},
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.settings.load(data)
this.info.load(data)
this.editor.loadFloorplan(data)
},
hideExtras: function(){
},
pickWall: function(wall, pos){
},
})
|