Rev 180 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 180 | Rev 181 | ||
|---|---|---|---|
| Line 123... | Line 123... | ||
| 123 | if (fullscreen.isSupportedBy(document.documentElement)) |
123 | if (fullscreen.isSupportedBy(document.documentElement)) |
| 124 | {
|
124 | {
|
| 125 | var fullscreenLI = jsx.dom.getElementById("cmd3");
|
125 | var fullscreenLI = jsx.dom.getElementById("cmd3");
|
| 126 | fullscreenLI.firstChild.style.cursor = ""; |
126 | fullscreenLI.firstChild.style.cursor = ""; |
| 127 | } |
127 | } |
| - | 128 | ||
| - | 129 | lcars.multiDisplay = new lcars.MultiDisplay(); |
|
| 128 | } |
130 | } |
| 129 | </script> |
131 | </script> |
| 130 | <?php /* <bgsound src="media/interface/sound/beginop.wav" loop="infinite"> */ ?> |
132 | <?php /* <bgsound src="media/interface/sound/beginop.wav" loop="infinite"> */ ?> |
| 131 | </head> |
133 | </head> |
| 132 | <body class="fade-in" onload="body_load()"> |
134 | <body class="fade-in" onload="body_load()"> |
| Line 499... | Line 501... | ||
| 499 | <tr> |
501 | <tr> |
| 500 | <th><?php echo tr('Features'); ?>:</th> |
502 | <th><?php echo tr('Features'); ?>:</th> |
| 501 | <td><script type="text/javascript"> |
503 | <td><script type="text/javascript"> |
| 502 | var fullscreen = jsx.dom.window.fullscreen; |
504 | var fullscreen = jsx.dom.window.fullscreen; |
| 503 | 505 | ||
| 504 | var map, circle; |
- | |
| 505 | - | ||
| 506 | function initGMap () |
- | |
| 507 | {
|
- | |
| 508 | var coords = jsx.dom.geolocation.position.coords; |
- | |
| 509 | //var title = document.getElementById("title");
|
- | |
| 510 | //title.firstChild.textContent = [coords.latitude.toFixed(), "° ", coords.longitude, "° (", coords.accuracy, "\xA0m)"].join("");
|
- | |
| 511 | var center = new google.maps.LatLng(coords.latitude, coords.longitude); |
- | |
| 512 | var zoom = 9; |
- | |
| 513 | - | ||
| 514 | var zoomAccuracy = [ |
- | |
| 515 | 1e7, 5e6, 2e6, 2e6, 1e6, 5e5, 2e5, 1e5, 5e4, |
- | |
| 516 | 2e4, 1e4, 5e3, 2000, 2000, 1000, 500, 200, |
- | |
| 517 | 100, 50, 20 |
- | |
| 518 | ]; |
- | |
| 519 | - | ||
| 520 | var accuracy = coords.accuracy; |
- | |
| 521 | if (!isNaN(accuracy)) |
- | |
| 522 | {
|
- | |
| 523 | for (var i = 0, len = zoomAccuracy.length; i < len; ++i) |
- | |
| 524 | {
|
- | |
| 525 | if (accuracy > zoomAccuracy[i]) |
- | |
| 526 | {
|
- | |
| 527 | zoom = i; |
- | |
| 528 | break; |
- | |
| 529 | } |
- | |
| 530 | } |
- | |
| 531 | } |
- | |
| 532 | - | ||
| 533 | if (!map) |
- | |
| 534 | {
|
- | |
| 535 | var mapOptions = {
|
- | |
| 536 | center: center, |
- | |
| 537 | zoom: zoom, |
- | |
| 538 | mapTypeId: google.maps.MapTypeId.HYBRID, |
- | |
| 539 | backgroundColor: "#000", |
- | |
| 540 | noClear: true, |
- | |
| 541 | scaleControl: true |
- | |
| 542 | }; |
- | |
| 543 | - | ||
| 544 | map = new google.maps.Map(document.getElementById("map-canvas"), mapOptions);
|
- | |
| 545 | } |
- | |
| 546 | else |
- | |
| 547 | {
|
- | |
| 548 | map.setCenter(center); |
- | |
| 549 | map.setZoom(zoom); |
- | |
| 550 | } |
- | |
| 551 | - | ||
| 552 | if (!circle) |
- | |
| 553 | {
|
- | |
| 554 | if (!isNaN(coords.accuracy)) |
- | |
| 555 | {
|
- | |
| 556 | circle = new google.maps.Circle({
|
- | |
| 557 | map: map, |
- | |
| 558 | center: center, |
- | |
| 559 | radius: coords.accuracy, |
- | |
| 560 | fillColor: "white", |
- | |
| 561 | fillOpacity: 0.125, |
- | |
| 562 | strokeColor: "white", |
- | |
| 563 | strokeOpacity: 0.5 |
- | |
| 564 | }); |
- | |
| 565 | circle.addListener("click", function () {
|
- | |
| 566 | window.alert("<?php echo tr('Your current coordinates on Terra'); ?>\n\n"
|
- | |
| 567 | + jsx.dom.geolocation.getText(jsx.dom.geolocation.position)); |
- | |
| 568 | }); |
- | |
| 569 | } |
- | |
| 570 | } |
- | |
| 571 | else |
- | |
| 572 | {
|
- | |
| 573 | if (!isNaN(coords.accuracy)) |
- | |
| 574 | {
|
- | |
| 575 | circle.setCenter(center); |
- | |
| 576 | circle.setRadius(coords.accuracy); |
- | |
| 577 | } |
- | |
| 578 | else |
- | |
| 579 | {
|
- | |
| 580 | circle.setMap(null); |
- | |
| 581 | } |
- | |
| 582 | } |
- | |
| 583 | - | ||
| 584 | /* Restore transition */ |
- | |
| 585 | document.getElementById("content").style.transition = "";
|
- | |
| 586 | } |
- | |
| 587 | - | ||
| 588 | jsx.dom.geolocation = {
|
506 | jsx.dom.geolocation = {
|
| 589 | getText: function (position) {
|
507 | getText: function (position) {
|
| 590 | var coords = position.coords; |
508 | var coords = position.coords; |
| 591 | var latitude = coords.latitude; |
509 | var latitude = coords.latitude; |
| 592 | var longitude = coords.longitude; |
510 | var longitude = coords.longitude; |
| Line 603... | Line 521... | ||
| 603 | "<?php echo tr('Alt. Accuracy:'); ?> " + (altitudeAccuracy != null ? altitudeAccuracy + " m": TEXT_NOT_AVAILABLE), |
521 | "<?php echo tr('Alt. Accuracy:'); ?> " + (altitudeAccuracy != null ? altitudeAccuracy + " m": TEXT_NOT_AVAILABLE), |
| 604 | "<?php echo tr('Speed:'); ?> " + (speed != null && !isNaN(speed) ? speed + " m∕s": TEXT_NOT_AVAILABLE), |
522 | "<?php echo tr('Speed:'); ?> " + (speed != null && !isNaN(speed) ? speed + " m∕s": TEXT_NOT_AVAILABLE), |
| 605 | "<?php echo tr('Heading:'); ?> " + (heading != null && !isNaN(heading) ? heading + "°" : TEXT_NOT_AVAILABLE) |
523 | "<?php echo tr('Heading:'); ?> " + (heading != null && !isNaN(heading) ? heading + "°" : TEXT_NOT_AVAILABLE) |
| 606 | ].join("\n");
|
524 | ].join("\n");
|
| 607 | }, |
525 | }, |
| 608 | - | ||
| 609 | show: function (position) {
|
- | |
| 610 | this.position = position; |
- | |
| 611 | //document.getElementById("content").innerHTML = "<?php echo tr('Your current coordinates on Terra'); ?>\n\n" + this.getText(position);
|
- | |
| 612 | var title = document.getElementById("title");
|
- | |
| 613 | title.firstChild.textContent = "<?php echo tr('Geolocation'); ?>"; |
- | |
| 614 | var content = document.getElementById("content");
|
- | |
| 615 | - | ||
| 616 | if (!map) |
- | |
| 617 | {
|
- | |
| 618 | /* Disable transition while map is loading */ |
- | |
| 619 | content.style.transition = "none"; |
- | |
| 620 | content.className = "fixed"; |
- | |
| 621 | content.innerHTML = |
- | |
| 622 | // '<select><option>Google Maps</option><option>OpenStreetMap</option></select>' |
- | |
| 623 | '<div id="map-canvas" style="position: absolute; width: 100%; height: 100%"></div>'; |
- | |
| 624 | } |
- | |
| 625 | - | ||
| 626 | var scriptId = "google-maps"; |
- | |
| 627 | var script = document.getElementById(scriptId); |
- | |
| 628 | if (!script) |
- | |
| 629 | {
|
- | |
| 630 | script = document.createElement("script");
|
- | |
| 631 | script.id = scriptId; |
- | |
| 632 | script.type = "text/javascript"; |
- | |
| 633 | script.src = "http://maps.googleapis.com/maps/api/js?key=AIzaSyCpW3bu57j4V7_vcK_cVpvFkXMmKkKgADI&sensor=true&callback=initGMap&language=<?php echo $language; ?>"; |
- | |
| 634 | document.body.appendChild(script); |
- | |
| 635 | } |
- | |
| 636 | else |
- | |
| 637 | {
|
- | |
| 638 | initGMap(); |
- | |
| 639 | } |
- | |
| 640 | } |
- | |
| 641 | }; |
526 | }; |
| 642 | 527 | ||
| 643 | (function () {
|
528 | (function () {
|
| 644 | function getFeatures () |
529 | function getFeatures () |
| 645 | {
|
530 | {
|
| Line 684... | Line 569... | ||
| 684 | } |
569 | } |
| 685 | 570 | ||
| 686 | if (navigator.geolocation) |
571 | if (navigator.geolocation) |
| 687 | {
|
572 | {
|
| 688 | features.push('<a href="#" title="<?php echo tr('Get location'); ?>"'
|
573 | features.push('<a href="#" title="<?php echo tr('Get location'); ?>"'
|
| 689 | + ' onclick="navigator.geolocation.getCurrentPosition('
|
- | |
| 690 | + 'function (position) { jsx.dom.geolocation.show(position); }); return false"'
|
574 | + ' onclick="return lcars.multiDisplay.geolocate(\'<?php echo tr('Geolocation'); ?>\', \'<?php echo $language; ?>\')"' |
| 691 | + '><?php echo tr('Geolocation'); ?><\/a>'); |
575 | + '><?php echo tr('Geolocation'); ?><\/a>'); |
| 692 | } |
576 | } |
| 693 | 577 | ||
| 694 | if (typeof navigator.javaEnabled != "undefined" && navigator.javaEnabled()) |
578 | if (typeof navigator.javaEnabled != "undefined" && navigator.javaEnabled()) |
| 695 | {
|
579 | {
|