-
Notifications
You must be signed in to change notification settings - Fork 87
/
addnewmodelchecker.html
83 lines (75 loc) · 2.83 KB
/
addnewmodelchecker.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
<div class="addnewmodelchecker">
<form class="form-horizontal" role="form">
<legend>Add model checker</legend>
<div class="form-group">
<label class="control-label" for="inputName">Name</label>
<div class="controls">
<input type="text" class="inputName form-control" id="inputName" placeholder="Name">
</div>
</div>
<div class="form-group">
<label class="control-label" for="inputDescription">Description</label>
<div class="controls">
<textarea class="inputDescription form-control" rows="6" id="inputDescription" placeholder="Description"></textarea>
</div>
</div>
<div class="form-group">
<label class="control-label" for="inputCode">Code</label>
<div class="controls">
<textarea class="inputCode form-control" id="inputCode" rows="16" placeholder="Code"></textarea>
</div>
</div>
<div class="form-group">
<label class="control-label" for="inputCode">Plugin</label>
<div class="controls">
<select class="form-control inputPlugin"></select>
</div>
</div>
<div class="form-actions">
<button type="submit" class="btn btn-primary addButton">Add</button>
<button type="button" class="btn btn-default cancelButton">Cancel</button>
</div>
</form>
</div>
<script>
function AddNewModelChecker(main, serversettings, modelChecker) {
var othis = this;
this.close = function() {
};
this.show = function() {
};
if (modelChecker != null) {
$(".addnewmodelchecker .inputName").val(modelChecker.name);
$(".addnewmodelchecker .inputDescription").val(modelChecker.description);
$(".addnewmodelchecker .inputCode").val(modelChecker.code);
$(".addnewmodelchecker .inputPlugin").val(modelChecker.modelCheckerPluginClassName);
}
Global.bimServerApi.call("PluginInterface", "getAllModelCheckerPluginDescriptors", {}, function(modelCheckerPluginDescriptors){
modelCheckerPluginDescriptors.forEach(function(modelCheckerPluginDescriptor){
var option = $("<option>" + modelCheckerPluginDescriptor.pluginClassName + "</option>");
$(".inputPlugin").append(option);
});
});
$(".addnewmodelchecker .cancelButton").click(function(event){
event.preventDefault();
serversettings.showExtendedDataSchemas();
});
this.createObject = function() {
var modelChecker = {
__type: "SModelCheckerInstance",
name: $(".addnewmodelchecker .inputName").val(),
description: $(".addnewmodelchecker .inputDescription").val(),
code: $(".addnewmodelchecker .inputCode").val(),
modelCheckerPluginClassName: $(".addnewmodelchecker .inputPlugin").val()
};
return modelChecker;
}
$(".addnewmodelchecker .addButton").click(function(event){
event.preventDefault();
Global.bimServerApi.call("ServiceInterface", "addModelChecker", {modelCheckerInstance: othis.createObject()}, function(data){
serversettings.showModelCheckers();
});
});
$(".addnewmodelchecker .inputName").focus();
}
</script>