-
Notifications
You must be signed in to change notification settings - Fork 87
/
addproject.html
102 lines (97 loc) · 3.23 KB
/
addproject.html
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
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
<div class="addproject">
<form class="form-horizontal" role="form">
<div class="form-group">
<label class="col-lg-3 control-label" for="inputName">Name</label>
<div class="col-lg-5">
<input type="text" id="inputName" class="form-control inputName" placeholder="Name">
</div>
</div>
<div class="form-group">
<label class="col-lg-3 control-label" for="descriptionInput">Description</label>
<div class="col-lg-5">
<textarea class="descriptionInput form-control span6" id="descriptionInput" placeholder="Description" cols="60" rows="7"></textarea>
</div>
</div>
<div class="form-group">
<label class="col-lg-3 control-label" for="lengthMeasureInput">Uniform length measure for combined download</label>
<div class="col-lg-5">
<select class="lengthMeasureInput form-control span6" id="lengthMeasureInput">
<option>meter</option>
<option>attometer</option>
<option>femtometer</option>
<option>picometer</option>
<option>nanometer</option>
<option>micrometer</option>
<option>millimeter</option>
<option>centimeter</option>
<option>decimeter</option>
<option>decameter</option>
<option>hectometer</option>
<option>kilometer</option>
<option>megameter</option>
<option>gigameter</option>
<option>terameter</option>
<option>petameter</option>
<option>exameter</option>
</select>
</div>
</div>
<div class="form-group schemaGroup">
<label class="col-lg-3 control-label" for="schema">Schema</label>
<div class="col-lg-5">
<select class="schemaInput form-control span6" id="schema">
<option value="ifc2x3tc1">Ifc2x3tc1</option>
<option value="ifc4">Ifc4</option>
</select>
</div>
</div>
<div class="well well-small buttonBar">
<button type="button" class="btn btn-primary addButton">Add</button>
</div>
</form>
</div>
<script>
function AddProject(containerDiv, main, parentProject) {
var othis = this;
this.show = function(){
if (parentProject != null && parentProject.schema == "ifc4") {
containerDiv.find(".schemaInput").val("ifc4");
}
};
this.close = function(){
};
this.updateProject = function(project) {
project.description = $(".descriptionInput").val();
project.exportLengthMeasurePrefix = $(".lengthMeasureInput").val();
Global.bimServerApi.call("ServiceInterface", "updateProject", {sProject: project}, function(){
main.showProject(project.oid, null, true);
});
};
this.addProject = function() {
if (parentProject != null) {
Global.bimServerApi.callWithFullIndication("ServiceInterface", "addProjectAsSubProject", {
schema: $(".schemaInput").val(),
parentPoid: parentProject.oid,
projectName: $(".addproject .inputName").val()
}, function(data){
othis.updateProject(data);
});
} else {
Global.bimServerApi.callWithFullIndication("ServiceInterface", "addProject", {
schema: $(".schemaInput").val(),
projectName: $(".addproject .inputName").val()
}, function(data){
othis.updateProject(data);
});
}
};
$(".addproject .addButton").click(othis.addProject);
$(".addproject .inputName").keypress(function(event){
if (event.which == 13) {
event.preventDefault();
othis.addProject();
}
});
$(".addproject .inputName").focus();
}
</script>