-
Notifications
You must be signed in to change notification settings - Fork 87
/
Copy pathsettings.js
77 lines (76 loc) · 2.04 KB
/
settings.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
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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
var Settings = {
createStartPage: function(container, main){
pushHistory({page: "Projects"}, "Projects");
main.pageChanger.changePage($(".serverinfoLink"), "projects.html", function(){
return new Projects($(this), main);
});
},
getPlugins: function(){
return {
relatics: {
enabled: false
}
};
},
getTitle: function(){
return "BIMvie.ws";
},
useBimSurfer: function(){
return true;
},
getMenuItems: function(){
return [
"dashboardLink",
"userLink",
"projectLink",
"usersettingsLink",
"serversettingsLink",
"gettingStartedLink",
"userDivider",
"btnAddUser",
"btnListUsers"
];
},
getVersion: function(successCallback){
// Sends back the version to the successCallback, default case would be to assume BIMserver to be running on the same webserver (hence asking for the plugin.version resource)
// When running BIMvie.ws on a different server, replace this with a callback with a fixed version
// This version is usually used for the invalidation of the caching of BIMvie.ws resources
var myRequest = new XMLHttpRequest();
myRequest.onreadystatechange = function() {
if (myRequest.readyState != 4) {
// We are waiting for a readyState 4 here
return;
}
if (myRequest.status != 200) {
successCallback(new Date().getTime());
return;
} else {
successCallback(JSON.parse(myRequest.responseText).version);
}
};
myRequest.open("GET", Global.baseDir + "plugin.version", true);
myRequest.send();
},
getStaticServerAddress: function(callback){
$.getJSON("x.getbimserveraddress", function(data){
callback(data.address);
}).fail(function(){
callback(null);
});
},
useCompressedResources: function(){
return true;
},
allowBimServerAddress: function() {
return false;
},
getBimServerApiAddress: function(){
return "deps/bimserverjsapi";
},
getBimSurferApiAddress: function(){
return "deps/bimsurfer-v1";
},
getDefaultHiddenTypes: function() {
return {"IfcOpeningElement": true, "IfcSpace": true};
}
}