| 1 |
<?xml version="1.0" encoding="UTF-8"?> |
| 2 |
|
| 3 |
<!-- A stylesheet to turn IVOA datalink documents |
| 4 |
(http://www.ivoa.net/documents/DataLink) into HTML pages. |
| 5 |
|
| 6 |
Assumptions on document content beyond conforming datalink content: |
| 7 |
|
| 8 |
(1) null value of content_length is -1 |
| 9 |
(2) VOTable namespace is 1.3 (as long as you know what version you're handing |
| 10 |
out, just fix xmlns:vot below) |
| 11 |
|
| 12 |
|
| 13 |
This stylesheet is made available under CC-0 by the GAVO project, |
| 14 |
http://www.g-vo.org. |
| 15 |
See http://creativecommons.org/publicdomain/zero/1.0/ for details. |
| 16 |
--> |
| 17 |
|
| 18 |
|
| 19 |
<xsl:stylesheet |
| 20 |
xmlns:vot="http://www.ivoa.net/xml/VOTable/v1.3" |
| 21 |
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
| 22 |
xmlns="http://www.w3.org/1999/xhtml" |
| 23 |
version="1.0"> |
| 24 |
|
| 25 |
<!-- ############################################## Global behaviour --> |
| 26 |
|
| 27 |
<xsl:output method="xml" |
| 28 |
doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" |
| 29 |
doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"/> |
| 30 |
|
| 31 |
<!-- Don't spill the content of unknown elements. --> |
| 32 |
<xsl:template match="text()"/> |
| 33 |
|
| 34 |
<xsl:key |
| 35 |
name="fields" |
| 36 |
match="vot:RESOURCE[@type='results']/vot:TABLE/vot:FIELD" |
| 37 |
use="count(preceding::vot:FIELD)+1"/> |
| 38 |
|
| 39 |
<xsl:variable |
| 40 |
name="id_index" |
| 41 |
select="count(vot:VOTABLE/vot:RESOURCE[@type='results']/vot:TABLE/ |
| 42 |
vot:FIELD[@name='ID']/preceding::vot:FIELD)+1"/> |
| 43 |
<xsl:variable |
| 44 |
name="access_url_index" |
| 45 |
select="count(vot:VOTABLE/vot:RESOURCE[@type='results']/vot:TABLE/ |
| 46 |
vot:FIELD[@name='access_url']/preceding::vot:FIELD)+1"/> |
| 47 |
<xsl:variable |
| 48 |
name="service_def_index" |
| 49 |
select="count(vot:VOTABLE/vot:RESOURCE[@type='results']/vot:TABLE/ |
| 50 |
vot:FIELD[@name='service_def']/preceding::vot:FIELD)+1"/> |
| 51 |
<xsl:variable |
| 52 |
name="error_message_index" |
| 53 |
select="count(vot:VOTABLE/vot:RESOURCE[@type='results']/vot:TABLE/ |
| 54 |
vot:FIELD[@name='error_message']/preceding::vot:FIELD)+1"/> |
| 55 |
<xsl:variable |
| 56 |
name="description_index" |
| 57 |
select="count(vot:VOTABLE/vot:RESOURCE[@type='results']/vot:TABLE/ |
| 58 |
vot:FIELD[@name='description']/preceding::vot:FIELD)+1"/> |
| 59 |
<xsl:variable |
| 60 |
name="semantics_index" |
| 61 |
select="count(vot:VOTABLE/vot:RESOURCE[@type='results']/vot:TABLE/ |
| 62 |
vot:FIELD[@name='semantics']/preceding::vot:FIELD)+1"/> |
| 63 |
<xsl:variable |
| 64 |
name="content_type_index" |
| 65 |
select="count(vot:VOTABLE/vot:RESOURCE[@type='results']/vot:TABLE/ |
| 66 |
vot:FIELD[@name='content_type']/preceding::vot:FIELD)+1"/> |
| 67 |
<xsl:variable |
| 68 |
name="content_length_index" |
| 69 |
select="count(vot:VOTABLE/vot:RESOURCE[@type='results']/vot:TABLE/ |
| 70 |
vot:FIELD[@name='content_length']/preceding::vot:FIELD)+1"/> |
| 71 |
<xsl:variable |
| 72 |
name="content_qualifier_index" |
| 73 |
select="count(vot:VOTABLE/vot:RESOURCE[@type='results']/vot:TABLE/ |
| 74 |
vot:FIELD[@name='content_qualifier']/preceding::vot:FIELD)+1"/> |
| 75 |
|
| 76 |
<!-- ################################### links table --> |
| 77 |
|
| 78 |
<xsl:template match="vot:RESOURCE[@type='results']"> |
| 79 |
<xsl:call-template name="fetch_preview"/> |
| 80 |
<xsl:call-template name="determine_type"/> |
| 81 |
<xsl:apply-templates/> |
| 82 |
</xsl:template> |
| 83 |
|
| 84 |
<xsl:template match="vot:TABLEDATA"> |
| 85 |
<table class="links"> |
| 86 |
<thead> |
| 87 |
<tr><th>Where?</th><th>Description</th><th>What?</th></tr> |
| 88 |
</thead> |
| 89 |
<tbody> |
| 90 |
<xsl:apply-templates/> |
| 91 |
</tbody> |
| 92 |
</table> |
| 93 |
</xsl:template> |
| 94 |
|
| 95 |
<xsl:template name="normal_row"> |
| 96 |
<!-- a datalink table row not requiring extra processing --> |
| 97 |
<tr> |
| 98 |
<xsl:attribute name="class"> |
| 99 |
<xsl:value-of select="substring(vot:TD[$semantics_index], 2)"/> |
| 100 |
</xsl:attribute> |
| 101 |
<td> |
| 102 |
<xsl:apply-templates select="vot:TD[$access_url_index]" |
| 103 |
mode="access_url"/> |
| 104 |
<xsl:apply-templates select="vot:TD[$content_length_index]" |
| 105 |
mode="content_length"/> |
| 106 |
<xsl:apply-templates select="vot:TD[$error_message_index]" |
| 107 |
mode="error_message"/> |
| 108 |
<xsl:apply-templates select="vot:TD[$service_def_index]" |
| 109 |
mode="proc_ref"/> |
| 110 |
</td> |
| 111 |
<td> |
| 112 |
<xsl:apply-templates select="vot:TD[$description_index]" |
| 113 |
mode="description"/> |
| 114 |
</td> |
| 115 |
<td> |
| 116 |
<xsl:apply-templates select="vot:TD[$semantics_index]" |
| 117 |
mode="semantics"/><br/> |
| 118 |
<xsl:apply-templates select="vot:TD[$id_index]" |
| 119 |
mode="id"/> |
| 120 |
</td> |
| 121 |
|
| 122 |
</tr> |
| 123 |
</xsl:template> |
| 124 |
|
| 125 |
<xsl:template match="vot:TR"> |
| 126 |
<!-- this intermediate template is for when we want to switch |
| 127 |
to different templates for errors and services --> |
| 128 |
<xsl:call-template name="normal_row"/> |
| 129 |
</xsl:template> |
| 130 |
|
| 131 |
<xsl:template match="vot:TD" mode="id"> |
| 132 |
<span class="ivoid-container"> |
| 133 |
<span class="ivoid"> |
| 134 |
<xsl:value-of select="."/> |
| 135 |
</span> |
| 136 |
</span> |
| 137 |
</xsl:template> |
| 138 |
|
| 139 |
<xsl:template match="vot:TD" mode="semantics"> |
| 140 |
<span class="semantics"><xsl:value-of select="."/></span> |
| 141 |
</xsl:template> |
| 142 |
|
| 143 |
<xsl:template match="vot:TD" mode="access_url"> |
| 144 |
<xsl:if test="string(.)"> |
| 145 |
<a class="datalink"> |
| 146 |
<xsl:attribute name="href"> |
| 147 |
<xsl:value-of select="."/> |
| 148 |
</xsl:attribute>Link</a> |
| 149 |
</xsl:if> |
| 150 |
</xsl:template> |
| 151 |
|
| 152 |
<xsl:template name="format-file-size"> |
| 153 |
<xsl:param name="file-size"/> |
| 154 |
<xsl:choose> |
| 155 |
<xsl:when test="$file-size<2000"> |
| 156 |
<xsl:value-of select="$file-size"/> Bytes</xsl:when> |
| 157 |
<xsl:when test="$file-size<1500000"> |
| 158 |
<xsl:value-of select="round($file-size div 1024)" |
| 159 |
/> kiB</xsl:when> |
| 160 |
<xsl:when test="$file-size<1500000000"> |
| 161 |
<xsl:value-of select="round($file-size div 1048576)" |
| 162 |
/> MiB</xsl:when> |
| 163 |
<xsl:when test="$file-size<20000000000"> |
| 164 |
<xsl:value-of select="round($file-size div 1073741824)" |
| 165 |
/> GiB</xsl:when> |
| 166 |
<xsl:otherwise> |
| 167 |
<xsl:value-of select="$file-size"/> Bytes</xsl:otherwise> |
| 168 |
</xsl:choose> |
| 169 |
</xsl:template> |
| 170 |
|
| 171 |
<xsl:template match="vot:TD" mode="content_length"> |
| 172 |
<xsl:if test=". and number(.)!=-1"> |
| 173 |
<span class="size"> |
| 174 |
(<xsl:call-template name="format-file-size"> |
| 175 |
<xsl:with-param name="file-size" select="number(.)"/> |
| 176 |
</xsl:call-template>) |
| 177 |
</span> |
| 178 |
</xsl:if> |
| 179 |
</xsl:template> |
| 180 |
|
| 181 |
<xsl:template match="vot:TD" mode="error_message"> |
| 182 |
<xsl:if test="string(.)"> |
| 183 |
<span class="errmsg"> |
| 184 |
<xsl:value-of select="."/> |
| 185 |
</span> |
| 186 |
</xsl:if> |
| 187 |
</xsl:template> |
| 188 |
|
| 189 |
<xsl:template match="vot:TD" mode="proc_ref"> |
| 190 |
<xsl:if test="string(.)"> |
| 191 |
<a class="procref"> |
| 192 |
<xsl:attribute name="href" |
| 193 |
>#<xsl:value-of select="."/></xsl:attribute> |
| 194 |
(Form)</a> |
| 195 |
</xsl:if> |
| 196 |
</xsl:template> |
| 197 |
|
| 198 |
<xsl:template match="vot:TD" mode="description"> |
| 199 |
<p class="description"> |
| 200 |
<xsl:value-of select="."/> |
| 201 |
</p> |
| 202 |
</xsl:template> |
| 203 |
|
| 204 |
<!-- ################################### service interface --> |
| 205 |
|
| 206 |
<xsl:template name="add-default"> |
| 207 |
<!-- called on PARAM-s to fiddle out DaCHS-custom LINK #pre-set |
| 208 |
defaults and set them on the current node. --> |
| 209 |
<xsl:if test="vot:LINK[@action='rdf' and @content-role='#pre-set']"> |
| 210 |
<xsl:attribute name="value"> |
| 211 |
<xsl:value-of select="vot:LINK/@value"/> |
| 212 |
</xsl:attribute> |
| 213 |
</xsl:if> |
| 214 |
</xsl:template> |
| 215 |
|
| 216 |
<xsl:template match="vot:RESOURCE[@utype='adhoc:service']"> |
| 217 |
<xsl:if test="vot:PARAM[@name='standardID']/@value= |
| 218 |
'ivo://ivoa.net/std/soda#sync-1.0'"> |
| 219 |
<form class="service-interface" method="GET"> |
| 220 |
<xsl:attribute name="action"> |
| 221 |
<xsl:value-of select="vot:PARAM[@name='accessURL']/@value"/> |
| 222 |
</xsl:attribute> |
| 223 |
<xsl:attribute name="id"> |
| 224 |
<xsl:value-of select="@ID"/> |
| 225 |
</xsl:attribute> |
| 226 |
<h2> |
| 227 |
<xsl:value-of select="vot:INFO[@name='title']/@value"/> |
| 228 |
</h2> |
| 229 |
<p class="soda_description"> |
| 230 |
<xsl:value-of select="vot:DESCRIPTION"/> |
| 231 |
</p> |
| 232 |
<div style="text-align:right"> |
| 233 |
<input type="submit" value="Retrieve data" |
| 234 |
style="width:14em;height:8ex"/> |
| 235 |
</div> |
| 236 |
<div class="inputpars"> |
| 237 |
<xsl:apply-templates select="vot:GROUP[@name='inputParams']" |
| 238 |
mode="build-inputs"/> |
| 239 |
</div> |
| 240 |
</form> |
| 241 |
</xsl:if> |
| 242 |
</xsl:template> |
| 243 |
|
| 244 |
<!-- **vot:PARAM -> html:input translation**: we match with various |
| 245 |
templates and control conflicts through priority. Please |
| 246 |
sort rules by descending priority. |
| 247 |
|
| 248 |
Priorities >=200 are for protocol-specified cases. |
| 249 |
Priorities ]100, 200[ are for 3-factor semantics |
| 250 |
Priorities <=100 are for heuristics. |
| 251 |
|
| 252 |
Also, there's a common template for assembling the tree fragments |
| 253 |
that should be used for consistency if at all possible. |
| 254 |
|
| 255 |
Regrettably, XSLT1 apparently cannot meaningfully pass tree fragments |
| 256 |
in template parameters (11.1: "An operation is permitted on a result |
| 257 |
tree fragment only if that operation would be permitted on a string"). |
| 258 |
Hence, we have this incredibly clumsy interface to the |
| 259 |
format-an-input-key template. If anyone knows a hack to work around |
| 260 |
this, you're most welcome. |
| 261 |
--> |
| 262 |
|
| 263 |
<xsl:template name="format-an-input-key"> |
| 264 |
<xsl:param name="typedesc"/> |
| 265 |
<xsl:param name="widget"/> |
| 266 |
<div> |
| 267 |
<xsl:attribute name="class"> |
| 268 |
<xsl:value-of select="concat('input ', @name, '-', |
| 269 |
@unit, '-', translate(@ucd, '.;', '__'))"/> |
| 270 |
</xsl:attribute> |
| 271 |
<p class="input-header"> |
| 272 |
<span class="param-name"><xsl:value-of select="@name"/></span> |
| 273 |
<xsl:text> </xsl:text> |
| 274 |
<span class="typedesc"><xsl:copy-of select="$typedesc"/></span> |
| 275 |
</p> |
| 276 |
<p class="widget"> |
| 277 |
<xsl:copy-of select="$widget" |
| 278 |
/> <span class="unit"> |
| 279 |
<xsl:value-of select="@unit"/></span></p> |
| 280 |
<p class="param-description"> |
| 281 |
<xsl:copy-of select="vot:DESCRIPTION"/> |
| 282 |
</p> |
| 283 |
</div> |
| 284 |
</xsl:template> |
| 285 |
|
| 286 |
<!-- circles and polygons get seeded with the max values --> |
| 287 |
|
| 288 |
<xsl:template match="vot:PARAM[@xtype='polygon' or @xtype='circle']" |
| 289 |
mode="build-inputs" priority="250"> |
| 290 |
<xsl:call-template name="format-an-input-key"> |
| 291 |
<xsl:with-param name="typedesc">A shape on the sky |
| 292 |
(space-separated numbers in degrees). Maximum extent: |
| 293 |
<span class="high-limit"> |
| 294 |
<xsl:value-of select="vot:VALUES/vot:MAX/@value"/> |
| 295 |
</span> |
| 296 |
</xsl:with-param> |
| 297 |
<xsl:with-param name="widget"> |
| 298 |
<input type="text" class="soda dw-input"> |
| 299 |
<xsl:attribute name="name"> |
| 300 |
<xsl:value-of select="@name"/> |
| 301 |
</xsl:attribute> |
| 302 |
<xsl:attribute name="placeholder"> |
| 303 |
<xsl:value-of select="vot:VALUES/vot:MAX/@value"/> |
| 304 |
</xsl:attribute> |
| 305 |
</input> |
| 306 |
</xsl:with-param> |
| 307 |
</xsl:call-template> |
| 308 |
</xsl:template> |
| 309 |
|
| 310 |
<!-- params with a value always become hidden |
| 311 |
(TODO: but we should make them editable if there's VALUES on them) --> |
| 312 |
<xsl:template match="vot:PARAM[@value!='']" mode="build-inputs" |
| 313 |
priority="200"> |
| 314 |
<input type="hidden" class="soda"> |
| 315 |
<xsl:attribute name="name"> |
| 316 |
<xsl:value-of select="@name"/> |
| 317 |
</xsl:attribute> |
| 318 |
<xsl:attribute name="value"> |
| 319 |
<xsl:value-of select="@value"/> |
| 320 |
</xsl:attribute> |
| 321 |
</input> |
| 322 |
</xsl:template> |
| 323 |
|
| 324 |
<!-- interval-valued params get an interval-valued placeholder --> |
| 325 |
|
| 326 |
<xsl:template match="vot:PARAM[@xtype='interval']" mode="build-inputs" |
| 327 |
priority="100"> |
| 328 |
<xsl:call-template name="format-an-input-key"> |
| 329 |
<xsl:with-param name="typedesc">An interval |
| 330 |
(space-separated pair of numbers), |
| 331 |
where the limits have to be between |
| 332 |
<span class="low-limit"> |
| 333 |
<xsl:value-of select="vot:VALUES/vot:MIN/@value"/> |
| 334 |
</span> |
| 335 |
and |
| 336 |
<span class="high-limit"> |
| 337 |
<xsl:value-of select="vot:VALUES/vot:MAX/@value"/> |
| 338 |
</span> |
| 339 |
</xsl:with-param> |
| 340 |
<xsl:with-param name="widget"> |
| 341 |
<input type="text" class="soda interval-input"> |
| 342 |
<xsl:attribute name="name"> |
| 343 |
<xsl:value-of select="@name"/> |
| 344 |
</xsl:attribute> |
| 345 |
<xsl:attribute name="placeholder"> |
| 346 |
<xsl:value-of select="vot:VALUES/vot:MIN/@value"/> |
| 347 |
<xsl:text> </xsl:text> |
| 348 |
<xsl:value-of select="vot:VALUES/vot:MAX/@value"/> |
| 349 |
</xsl:attribute> |
| 350 |
<xsl:call-template name="add-default"/> |
| 351 |
</input> |
| 352 |
</xsl:with-param> |
| 353 |
</xsl:call-template> |
| 354 |
</xsl:template> |
| 355 |
|
| 356 |
<!-- ... params with options become a select box. Yes, this |
| 357 |
collides with the interval priority. We'll resolve this when |
| 358 |
we see an interval-valued enumerated parameter. --> |
| 359 |
|
| 360 |
<xsl:template match="vot:PARAM[vot:VALUES/vot:OPTION]" mode="build-inputs" |
| 361 |
priority="100"> |
| 362 |
<xsl:call-template name="format-an-input-key"> |
| 363 |
<xsl:with-param name="typedesc" |
| 364 |
>Select zero, one, or possibly more options</xsl:with-param> |
| 365 |
<xsl:with-param name="widget"> |
| 366 |
<select class="soda" multiple="multiple"> |
| 367 |
<xsl:attribute name="name"> |
| 368 |
<xsl:value-of select="@name"/> |
| 369 |
</xsl:attribute> |
| 370 |
<xsl:apply-templates select="vot:VALUES" |
| 371 |
mode="build-inputs"/> |
| 372 |
</select> |
| 373 |
</xsl:with-param> |
| 374 |
</xsl:call-template> |
| 375 |
</xsl:template> |
| 376 |
|
| 377 |
<xsl:template match="vot:OPTION" mode="build-inputs"> |
| 378 |
<option> |
| 379 |
<xsl:attribute name="value"> |
| 380 |
<xsl:value-of select="@value"/> |
| 381 |
</xsl:attribute> |
| 382 |
<xsl:choose> |
| 383 |
<xsl:when test="@name"> |
| 384 |
<xsl:value-of select="@name"/> |
| 385 |
</xsl:when> |
| 386 |
<xsl:otherwise> |
| 387 |
<xsl:value-of select="."/> |
| 388 |
</xsl:otherwise> |
| 389 |
</xsl:choose> |
| 390 |
</option> |
| 391 |
</xsl:template> |
| 392 |
|
| 393 |
<!-- ...non-interval params having min and max get pre-filled with the |
| 394 |
min --> |
| 395 |
|
| 396 |
<xsl:template match="vot:PARAM[vot:VALUES/vot:MIN]" mode="build-inputs" |
| 397 |
priority="50"> |
| 398 |
<xsl:call-template name="format-an-input-key"> |
| 399 |
<xsl:with-param name="typedesc" |
| 400 |
>A value between |
| 401 |
<span class="limit"> |
| 402 |
<xsl:value-of select="vot:VALUES/vot:MIN/@value"/> |
| 403 |
</span> |
| 404 |
and |
| 405 |
<span class="limit"> |
| 406 |
<xsl:value-of select="vot:VALUES/vot:MAX/@value"/> |
| 407 |
</span></xsl:with-param> |
| 408 |
<xsl:with-param name="widget"> |
| 409 |
<input type="text" class="soda"> |
| 410 |
<xsl:attribute name="name"> |
| 411 |
<xsl:value-of select="@name"/> |
| 412 |
</xsl:attribute> |
| 413 |
<xsl:attribute name="placeholder"> |
| 414 |
<xsl:value-of select="vot:VALUES/vot:MIN/@value"/> |
| 415 |
</xsl:attribute> |
| 416 |
<xsl:call-template name="add-default"/> |
| 417 |
</input> |
| 418 |
</xsl:with-param> |
| 419 |
</xsl:call-template> |
| 420 |
</xsl:template> |
| 421 |
|
| 422 |
<!-- ...everything else is just a text input --> |
| 423 |
|
| 424 |
<xsl:template match="vot:PARAM" mode="build-inputs" priority="0"> |
| 425 |
<xsl:call-template name="format-an-input-key"> |
| 426 |
<xsl:with-param name="typedesc"/> |
| 427 |
<xsl:with-param name="widget"> |
| 428 |
<input type="text" class="soda generic-input"> |
| 429 |
<xsl:attribute name="name"> |
| 430 |
<xsl:value-of select="@name"/> |
| 431 |
</xsl:attribute> |
| 432 |
<xsl:call-template name="add-default"/> |
| 433 |
</input> |
| 434 |
</xsl:with-param> |
| 435 |
</xsl:call-template> |
| 436 |
</xsl:template> |
| 437 |
|
| 438 |
|
| 439 |
<!-- ################################### utility, top-level --> |
| 440 |
|
| 441 |
<xsl:template name="fetch_preview"> |
| 442 |
<xsl:variable name="preview_url" |
| 443 |
select="//vot:TR[vot:TD[$semantics_index]='#preview']/vot:TD[$access_url_index]"/> |
| 444 |
<xsl:if test="$preview_url"> |
| 445 |
<p><img alt="[PREVIEW]"> |
| 446 |
<xsl:attribute name="src"> |
| 447 |
<xsl:value-of select="$preview_url"/> |
| 448 |
</xsl:attribute> |
| 449 |
</img></p> |
| 450 |
</xsl:if> |
| 451 |
</xsl:template> |
| 452 |
|
| 453 |
<xsl:template name="determine_type"> |
| 454 |
<xsl:variable |
| 455 |
name="content_qualifier" |
| 456 |
select="//vot:TR[vot:TD[$semantics_index]='#this']/vot:TD[$content_qualifier_index]"/> |
| 457 |
<xsl:if test="string-length($content_qualifier)"> |
| 458 |
<p id="content-statement">(A <span id="content_qualifier"> |
| 459 |
<xsl:value-of select="$content_qualifier"/></span>)</p> |
| 460 |
</xsl:if> |
| 461 |
</xsl:template> |
| 462 |
|
| 463 |
<xsl:template match="/"> |
| 464 |
<html> |
| 465 |
<head> |
| 466 |
<title>Datalink response</title> |
| 467 |
<style type="text/css"><![CDATA[ |
| 468 |
table { |
| 469 |
border-spacing: 0pt; |
| 470 |
border-collapse: collapse; |
| 471 |
} |
| 472 |
|
| 473 |
td { |
| 474 |
padding: 8pt; |
| 475 |
border-left: 2pt solid grey; |
| 476 |
border-right: 2pt solid grey; |
| 477 |
} |
| 478 |
|
| 479 |
span.ivoid-container { |
| 480 |
display:inline-block; |
| 481 |
width: 20em; |
| 482 |
overflow: hidden; |
| 483 |
} |
| 484 |
|
| 485 |
span.ivoid { |
| 486 |
padding: 2pt; |
| 487 |
white-space: nowrap; |
| 488 |
background-color: white; |
| 489 |
} |
| 490 |
|
| 491 |
.errmsg { |
| 492 |
border: 2pt solid red; |
| 493 |
padding: 1ex; |
| 494 |
} |
| 495 |
|
| 496 |
span.ivoid-container:hover { |
| 497 |
overflow: visible; |
| 498 |
} |
| 499 |
|
| 500 |
p.description { |
| 501 |
max-width: 20em; |
| 502 |
} |
| 503 |
|
| 504 |
tr.science { |
| 505 |
background: #AAFFAA; |
| 506 |
} |
| 507 |
|
| 508 |
tr.calib { |
| 509 |
background: #FFFFAA; |
| 510 |
} |
| 511 |
|
| 512 |
tr.unknown{ |
| 513 |
color: #777777; |
| 514 |
} |
| 515 |
|
| 516 |
tr.calibration{ |
| 517 |
background: #DDDDDD; |
| 518 |
} |
| 519 |
|
| 520 |
tr.this{ |
| 521 |
font-weight: bold; |
| 522 |
background-color: #FFAAAA; |
| 523 |
} |
| 524 |
|
| 525 |
tr.preview, tr.preview-image { |
| 526 |
background: #FFDDDD; |
| 527 |
} |
| 528 |
|
| 529 |
tr.access { |
| 530 |
color: #999999; |
| 531 |
} |
| 532 |
|
| 533 |
form.service-interface { |
| 534 |
margin-top: 3ex; |
| 535 |
max-width: 50em; |
| 536 |
background: #EEEE99; |
| 537 |
border: 2pt solid #DDDD88; |
| 538 |
margin-left:auto; |
| 539 |
margin-right:auto; |
| 540 |
padding-left: 0.5ex; |
| 541 |
} |
| 542 |
|
| 543 |
div.inputpars div.input { |
| 544 |
border-top: 1pt solid #DDDD88; |
| 545 |
margin-left: 1em; |
| 546 |
} |
| 547 |
|
| 548 |
.param-name { |
| 549 |
font-weight: bold; |
| 550 |
font-size: 130%; |
| 551 |
margin-left: -1em; |
| 552 |
margin-right: 0.5em; |
| 553 |
} |
| 554 |
|
| 555 |
.typedesc { |
| 556 |
font-size: 70%; |
| 557 |
} |
| 558 |
|
| 559 |
.typedesc .low-limit { |
| 560 |
font-size: 100%; |
| 561 |
font-weight: bold; |
| 562 |
} |
| 563 |
|
| 564 |
.typedesc .high-limit { |
| 565 |
font-size: 100%; |
| 566 |
font-weight: bold; |
| 567 |
} |
| 568 |
|
| 569 |
.pos-canvas { |
| 570 |
position: absolute; |
| 571 |
background-color: none; |
| 572 |
top:0px; |
| 573 |
left: 0px; |
| 574 |
z-index: 10; |
| 575 |
} |
| 576 |
|
| 577 |
.pos-image { |
| 578 |
position: absolute; |
| 579 |
top: 0px; |
| 580 |
left: 0px; |
| 581 |
z-index: 0; |
| 582 |
} |
| 583 |
|
| 584 |
.custom-POS { |
| 585 |
position: relative; |
| 586 |
} |
| 587 |
|
| 588 |
input.generic-input { |
| 589 |
width:20em; |
| 590 |
} |
| 591 |
|
| 592 |
input.interval-input { |
| 593 |
width:20em; |
| 594 |
} |
| 595 |
|
| 596 |
/* formatting the javascript-morphed result tree */ |
| 597 |
h2.voc-label { |
| 598 |
margin-bottom: 2pt; |
| 599 |
margin-top: 1ex; |
| 600 |
font-size: 120%; |
| 601 |
position: relative; |
| 602 |
} |
| 603 |
p.voc-description { |
| 604 |
margin-top: 0pt; |
| 605 |
margin-top: 0.5ex; |
| 606 |
padding-left: 2em; |
| 607 |
font-style: italic; |
| 608 |
} |
| 609 |
button.toggler { |
| 610 |
position:relative; |
| 611 |
border: 0px solid white; |
| 612 |
padding: 0pt; |
| 613 |
margin-right: 4pt; |
| 614 |
font-size: 140%; |
| 615 |
background-color: #fde; |
| 616 |
} |
| 617 |
.foldable header { |
| 618 |
padding: 3pt; |
| 619 |
} |
| 620 |
.folded { |
| 621 |
border-bottom: 2pt dotted #dab; |
| 622 |
} |
| 623 |
section.foldable { |
| 624 |
background-color: #fde; |
| 625 |
margin-top:0pt; |
| 626 |
padding-bottom:8pt; |
| 627 |
} |
| 628 |
section.foldable ul { |
| 629 |
margin-left: 2em; |
| 630 |
margin-bottom: 0pt; |
| 631 |
list-style-type: none; |
| 632 |
} |
| 633 |
section.foldable ul li { |
| 634 |
background-color: #fef; |
| 635 |
margin-bottom: 8pt; |
| 636 |
margin-right: 8pt; |
| 637 |
padding: 1ex; |
| 638 |
} |
| 639 |
div.child-terms { |
| 640 |
margin-left: 2em; |
| 641 |
} |
| 642 |
|
| 643 |
li.dl-error { |
| 644 |
border-left: 4pt dotted #f00; |
| 645 |
border-right: 4pt dotted #f00; |
| 646 |
padding: 0pt 4pt; |
| 647 |
} |
| 648 |
|
| 649 |
#content-statement { |
| 650 |
display: block; |
| 651 |
position: fixed; |
| 652 |
margin: 0px; |
| 653 |
right: 0.5rem; |
| 654 |
top: 0.5rem; |
| 655 |
} |
| 656 |
]]> |
| 657 |
</style> |
| 658 |
<script type="text/javascript" |
| 659 |
src="/static/js/jquery-gavo.js"/> |
| 660 |
<script type="text/javascript" |
| 661 |
src="/static/js/samp.js"/> |
| 662 |
<script type="text/javascript" |
| 663 |
src="/static/js/sodapars.js"/> |
| 664 |
</head> |
| 665 |
<body> |
| 666 |
|
| 667 |
<div id="aladin-lite-div" |
| 668 |
style="width: 100%; height:10cm; display:none"> |
| 669 |
</div> |
| 670 |
|
| 671 |
<xsl:apply-templates/> |
| 672 |
|
| 673 |
<script type="text/html" id="fancy-band-widget"> |
| 674 |
<div class="input custom-BAND"> |
| 675 |
<p class="input-header"> |
| 676 |
<span class="param-name">Spectral range</span> |
| 677 |
<span class="typedesc">Enter the spectral range you want |
| 678 |
to cut out in your preferred units</span> |
| 679 |
</p> |
| 680 |
<p class="widget"> |
| 681 |
<input type="text" name="BAND-low" |
| 682 |
onchange="update_SODA_widget(this, 'BAND', FROM_SPECTRAL_CONVERSIONS)"/> |
| 683 |
<span class="low-limit">$low_limit</span> |
| 684 |
<input type="text" name="BAND-high" |
| 685 |
onchange="update_SODA_widget(this, 'BAND', FROM_SPECTRAL_CONVERSIONS)"/> |
| 686 |
<span class="high-limit">$high_limit</span> |
| 687 |
<select name="BAND-unit" |
| 688 |
onchange="convert_spectral_units( |
| 689 |
this, $low_limit, $high_limit); |
| 690 |
update_SODA_widget(this, 'BAND', FROM_SPECTRAL_CONVERSIONS)"> |
| 691 |
<option>m</option> |
| 692 |
<option>µm</option> |
| 693 |
<option>Ångström</option> |
| 694 |
<option>MHz</option> |
| 695 |
<option>keV</option> |
| 696 |
</select> |
| 697 |
</p> |
| 698 |
</div> |
| 699 |
</script> |
| 700 |
|
| 701 |
<!-- a template is for the js-based links browser |
| 702 |
(see _morph_table) --> |
| 703 |
<script type="text/html" id="links-for-ds"> |
| 704 |
<section class="morphed-links"> |
| 705 |
<h1>Links for <span class="ivoid">$ivoid</span></h1> |
| 706 |
</section> |
| 707 |
</script> |
| 708 |
|
| 709 |
<!-- a template for a single term in the js-created links --> |
| 710 |
<script type="text/html" id="term-section"> |
| 711 |
<section class="foldable $term"> |
| 712 |
<header> |
| 713 |
<h2 class="voc-label">$label</h2> |
| 714 |
<p class="voc-description">$description</p> |
| 715 |
</header> |
| 716 |
</section> |
| 717 |
</script> |
| 718 |
|
| 719 |
<!-- a template for a single datalink row --> |
| 720 |
<script type="text/html" id="js-datalink"> |
| 721 |
<li><a href="$link">$description</a> |
| 722 |
<span class="linksize">$size</span> |
| 723 |
</li> |
| 724 |
</script> |
| 725 |
|
| 726 |
<!-- a template for a datalink error --> |
| 727 |
<script type="text/html" id="js-datalinkerror"> |
| 728 |
<li class="dl-error">$errmsg</li> |
| 729 |
</script> |
| 730 |
|
| 731 |
<!-- I have no idea why this is, but when I do the following with |
| 732 |
a text/html template, I can't attach event handlers to it. |
| 733 |
Cross browser. Sigh. --> |
| 734 |
|
| 735 |
<button id="samp-template" title="Broadcasts the result as a FITS image |
| 736 |
to all connected clients (if you have a WebSAMP-enabled |
| 737 |
hub running" style="display:none">Broadcast dataset via SAMP</button> |
| 738 |
|
| 739 |
</body> |
| 740 |
</html> |
| 741 |
</xsl:template> |
| 742 |
|
| 743 |
</xsl:stylesheet> |
| 744 |
|
| 745 |
|
| 746 |
<!-- vim:et:sw=2:sta |
| 747 |
--> |