-
Notifications
You must be signed in to change notification settings - Fork 87
/
extendeddataschemas.html
58 lines (51 loc) · 1.74 KB
/
extendeddataschemas.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
<div class="extendeddataschemas">
<div class="well well-sm">
<button class="btn btn-default addExtendedDataSchemaButton">Add new</button>
<button class="btn btn-default addRepoExtendedDataSchemaButton">Add from repository</button>
</div>
<div class="well well-sm noextendeddataschemas">
No extended data schemas
</div>
<table class="table initialhide table-striped table-hover">
<thead>
<tr>
<th>Name</th>
<th>Content Type</th>
<th>Used</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
<script>
function ExtendedDataSchemas(main, serversettings) {
var othis = this;
this.show = function(){};
this.close = function(){
};
this.addExtendedDataSchema = function(extendedDataSchema) {
$(".extendeddataschemas .noextendeddataschemas").hide();
$(".extendeddataschemas table").show();
var tr = $("<tr>");
tr.data("extendeddataschema", extendedDataSchema);
tr.click(function(){
main.showExtendedDataSchema($(this).data("extendeddataschema").oid);
});
tr.append("<td>" + extendedDataSchema.name + "</td>");
tr.append("<td>" + extendedDataSchema.contentType + "</td>");
tr.append("<td>" + extendedDataSchema.extendedData.length + "</td>");
$(".extendeddataschemas table tbody").append(tr);
};
this.loadExtendedDataSchemas = function() {
Global.bimServerApi.call("ServiceInterface", "getAllExtendedDataSchemas", {}, function(data){
data.forEach(function(extendedDataSchema){
othis.addExtendedDataSchema(extendedDataSchema);
});
});
};
othis.loadExtendedDataSchemas();
$(".extendeddataschemas .addExtendedDataSchemaButton").click(serversettings.showAddExtendedDataSchema);
$(".extendeddataschemas .addRepoExtendedDataSchemaButton").click(serversettings.showAddRepoExtendedDataSchema);
}
</script>