-
Notifications
You must be signed in to change notification settings - Fork 87
/
genericaddpluginsettings1.html
58 lines (55 loc) · 1.78 KB
/
genericaddpluginsettings1.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="genericaddpluginsettings1">
<h3 class="title"></h3>
<div class="well well-small ih noPlugins">No plugins found that provide this functionality</div>
<table class="table">
<thead>
<tr>
<th>Organization</th>
<th>Bundle name</th>
<th>Plugin name</th>
<th>Plugin description</th>
<th></th>
</tr>
</thead>
<tbody></tbody>
</table>
</div>
<script>
function GenericAddPluginSettings1(cd, main, usersettings, configuration) {
var othis = this;
this.close = function() {
};
this.show = function() {
Global.bimServerApi.call("PluginInterface", configuration.getAllDescriptorsFunction, {}, function(descriptors){
if (descriptors.length == 0) {
cd.find(".noPlugins").show();
cd.find(".table").hide();
} else {
cd.find(".noPlugins").hide();
cd.find(".table").show();
}
descriptors.forEach(function(descriptor){
var tr = $("<tr>");
Global.bimServerApi.call("PluginInterface", "getInstalledPluginBundle", {oid: descriptor.pluginBundleVersionId}, function(pluginBundleVersion){
console.log(pluginBundleVersion);
tr.prepend("<td>" + pluginBundleVersion.name + "</td>");
tr.prepend("<td>" + pluginBundleVersion.organization + "</td>");
});
tr.append("<td>" + descriptor.name + "</td>");
tr.append("<td>" + descriptor.description + "</td>");
var td = $("<td>");
var btn = $("<button class=\"btn btn-primary\">Add</button>");
btn.click(function(){
cd.load("genericaddpluginsettings2.html", function(){
new GenericAddPluginSettings2($(this), main, usersettings, configuration, descriptor);
});
});
td.append(btn);
tr.append(td);
cd.find("table tbody").append(tr);
});
});
};
cd.find("h3.title").html(configuration.addTitle);
}
</script>