-
Notifications
You must be signed in to change notification settings - Fork 1
/
main-dock.js
78 lines (74 loc) · 2.95 KB
/
main-dock.js
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
$(function () {
$.widget("dock.mainDock", $.earthserver.dock, {
options: {
position: "left",
toggleIcon: "glyphicon glyphicon-menu-hamburger",
projections: true,
coverages: true,
queryTerminal: true
},
/* Initializes the main dock and by default creates
the projections, the coverages and the query terminal panels */
_create: function () {
this._super();
this.dockToggleIconWrapper
.append(
$("<span>", {class: this.options.toggleIcon + " dock-toggle-icon"})
);
if(this.options.projections) {
this.addProjectionSelectPanel();
}
if(this.options.coverages) {
this.addAvailableCoveragesPanel();
}
if(this.options.queryTerminal) {
this.addQueryTerminalPanel();
}
},
addProjectionSelectPanel: function () {
this.projectionSelectPanel = $("<div>").selectPanel({
dock: this.dock,
panelId: "projection-selector",
panelTitle: "projections",
dropdownId: "projectionDropdown"
}).selectPanel("instance");
var self = this;
$.each(projectionNames, function (index, projection) {
if (index == 0) {
self.projectionSelectPanel.setButtonContent(projection);
}
self.projectionSelectPanel.addSelectOption(projection.replace(/ /g, '').toLowerCase(), projection);
});
return this;
},
getProjectionSelectPanel: function() {
return this.projectionSelectPanel;
},
addAvailableCoveragesPanel: function() {
this.coverageSelectPanel = $("<div>").selectPanel({
dock: this.dock,
panelId: "coverage-selector",
panelTitle: "available coverages",
buttonId: "coverageDropdown",
defaultOption: "Select coverage"
}).selectPanel("instance");
var self = this;
$.each(coverageNames, function (index, coverage) {
self.coverageSelectPanel.addSelectOption(coverage.replace(/ /g, '').toLowerCase(), coverage);
});
this.coverageSelectPanel.addButton("retrieve-coverage", "Retrieve");
return this;
},
getAvailableCoveragesPanel: function() {
return this.coverageSelectPanel;
},
addQueryTerminalPanel: function() {
this.queryTerminalPanel = $("<div>").queryTerminalPanel({
dock: this.dock,
panelId: "query-terminal",
panelTitle: "wcps query"
}).queryTerminalPanel("instance");
return this;
}
})
});