-
Notifications
You must be signed in to change notification settings - Fork 87
/
addextendeddataschema.html
70 lines (63 loc) · 2.32 KB
/
addextendeddataschema.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
<div class="addextendeddataschema">
<form class="form-horizontal">
<legend>Add extended data schema</legend>
<div class="form-group">
<label class="control-label" for="inputName">Name</label>
<div class="controls">
<input type="text" class="form-control inputName input-xxlarge" id="inputName" placeholder="Name">
</div>
</div>
<div class="form-group">
<label class="control-label" for="inputContentType">Content Type</label>
<div class="controls">
<input type="text" class="form-control inputContentType input-xxlarge" id="inputContentType" placeholder="Content-Type">
</div>
</div>
<div class="form-group">
<label class="control-label" for="inputUrl">URL/Data</label>
<div class="controls">
<input type="text" class="form-control inputUrl input-xxlarge" id="inputUrl" placeholder="URL"><br/>
- OR -<br/>
<input type="file" class="file inputData" id="inputData">
</div>
</div>
<div class="form-actions">
<button type="submit" class="btn addButton btn-primary">Add</button>
<button type="button" class="btn btn-default cancelButton">Cancel</button>
</div>
</form>
</div>
<script>
function AddExtendedDataSchema(main, serversettings, extendedDataSchema) {
var othis = this;
this.close = function() {
};
this.show = function() {
};
if (extendedDataSchema != null) {
$(".addextendeddataschema .inputName").val(extendedDataSchema.name);
$(".addextendeddataschema .inputContentType").val(extendedDataSchema.contentType);
$(".addextendeddataschema .inputUrl").val(extendedDataSchema.url);
}
$(".addextendeddataschema .cancelButton").click(function(event){
event.preventDefault();
serversettings.showExtendedDataSchemas();
});
this.createObject = function() {
var extendedDataSchema = {
__type: "SExtendedDataSchema",
name: $(".addextendeddataschema .inputName").val(),
contentType: $(".addextendeddataschema .inputContentType").val(),
url: $(".addextendeddataschema .inputUrl").val(),
};
return extendedDataSchema;
}
$(".addextendeddataschema .addButton").click(function(event){
event.preventDefault();
Global.bimServerApi.call("ServiceInterface", "addExtendedDataSchema", {extendedDataSchema: othis.createObject()}, function(data){
serversettings.showExtendedDataSchemas();
});
});
$(".addextendeddataschema .inputName").focus();
}
</script>