-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathswagger-event.js
More file actions
120 lines (119 loc) · 3.75 KB
/
swagger-event.js
File metadata and controls
120 lines (119 loc) · 3.75 KB
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
$(function() {
var swaggerBuilder = new irisSwaggerBuilder.Builder({
swaggerURL: "swagger-event.json",
labelClass: "col-xs-4",
fieldClass: "col-xs-8",
targetSelector: "#output",
parameters: {
starttime: {
label: "Start Time"
},
endtime: {
label: "End Time"
},
minmag: {
label: "Min Magnitude"
},
maxmag: {
label: "Max Magnitude"
},
magtype: {
label: "Magnitude Type"
},
catalog: {
},
contributor: {
},
includeallorigins: {
label: "Include All Origins"
},
includeallmagnitudes: {
label: "Include All Magnitudes"
},
includearrivals: {
label: "Include Arrivals"
},
minlat: {
label: "Min Lat",
},
maxlat: {
label: "Max Lat"
},
minlon: {
label: "Min Lon"
},
maxlon: {
label: "Max Lon"
},
lat: {
label: "Center Lat"
},
lon: {
label: "Center Lon"
},
minradius: {
label: "Min Radius"
},
maxradius: {
label: "Max Radius"
},
orderby: {
label: "Order By"
},
eventid: {
label: "Event ID",
checkbox: true
},
updatedafter: {
label: "Updated After"
},
format: {
enumLabels: {
xml: "XML (QuakeML)",
text: "Text (CSV)"
}
}
},
layout: [
new irisSwaggerBuilder.Columns(
[
"starttime", "endtime",
"minmag", "maxmag", "magtype",
"mindepth", "maxdepth",
"catalog", "contributor",
"includeallorigins", "includeallmagnitudes", "includearrivals",
"orderby", "format",
"limit", "offset",
new irisSwaggerBuilder.Fieldset("Advanced search",
"eventid", "updatedafter"
)
],
[
new irisSwaggerBuilder.Fieldset("Location",
new irisSwaggerBuilder.OptGroup(
'_location_type',
['All'],
['Lat/Lon Box',
new irisSwaggerBuilder.CoordinateBox('maxlat', 'minlat', 'maxlon', 'minlon')
],
['Lat/Lon Radius',
new irisSwaggerBuilder.CoordinateRadius('lat', 'lon', 'maxradius'),
'minradius'
]
)
)
]
)
]
});
swaggerBuilder.run().then(function() {
// URLBuilder functions
// Disable all query-oriented rows if the event id control is enabled
$('div[id$="-row"]')
.not('#includeallorigins-row, #includeallmagnitudes-row, #includearrivals-row, #eventid-row, #format-row')
.irisBuilder('dependsOnNot', $("#eventid-check"));
// Uncheck location radios if an event id is chosen
$('input:radio[name="_location_type"]')
.irisBuilder('dependsOnNot', $("#eventid-check"));
});
});