| 370,12 → 370,10 |
| <tr> |
| <th><?php echo tr('Display'); ?>:</th> |
| <td><script type="text/javascript"> |
| var _addEventListener = jsx.dom.addEventListener; |
| var _runAsync = jsx.dom.timeout.runAsync; |
| var runAsync = jsx.dom.timeout.runAsync; |
| var ID_SCREEN_DIM = 'screenDim'; |
| var ID_AVAIL_DIM = 'availDim'; |
| var ID_INNER_DIM = 'innerDim'; |
| var TEXT_NOT_AVAILABLE = "<?php echo tr('N/A'); ?>"; |
| |
| var dim = (function () { |
| var screenInfo = jsx.dom.window.screenInfo; |
| 406,6 → 404,7 |
| }()); |
| |
| (function () { |
| |
| var screenDimText = dim.getScreenText(); |
| var availDimText = dim.getAvailText(); |
| var innerDimText = dim.getInnerText(); |
| 415,13 → 414,13 |
| + (availDimText ? ' (<span id="' + ID_AVAIL_DIM + '">' + availDimText + "<\/span>" : "") |
| + (innerDimText ? '<span id="' + ID_INNER_DIM + '">' + innerDimText + "<\/span>)" : "") |
| + (colorDepthText ? ' × <span id="colorDepth">' + colorDepthText + "<\/span>" : "") |
| : TEXT_NOT_AVAILABLE; |
| : "<?php echo tr('N/A'); ?>"; |
| |
| /* FIXME: Convert HTML to text, update whole title text */ |
| document.write('<span>' + displayInfo + '<\/span>'); |
| |
| var oColorDepth; |
| var tColor = _runAsync(function () { |
| runAsync(function () { |
| if (typeof oColorDepth == "undefined") |
| { |
| oColorDepth = document.getElementById("colorDepth"); |
| 430,7 → 429,7 |
| if (oColorDepth) |
| { |
| var colorDepthText = dim.getColorDepthText(); |
| <?php /* FIXME: Also update title attribute value */ ?> |
| /* FIXME: Also update title attribute value */ |
| if (oColorDepth.innerHTML != colorDepthText) |
| { |
| oColorDepth.innerHTML = colorDepthText; |
| 437,13 → 436,8 |
| } |
| } |
| |
| tColor = this.run(); |
| this.run(); |
| }, 1000); |
| |
| _addEventListener(document, "unload", function () { |
| tColor.unset(); |
| tColor = null; |
| }); |
| }()); |
| </script><noscript><?php echo tr('N/A'); ?></noscript></td> |
| </tr> |
| 455,7 → 449,7 |
| document.write('<span id="ua" title="' + ua + '">' + ua + '<\/span>'); |
| |
| var oUA; |
| var tUA = _runAsync(function () { |
| runAsync(function () { |
| if (typeof oUA == "undefined") |
| { |
| oUA = document.getElementById("ua"); |
| 470,7 → 464,7 |
| oUA.innerHTML = ua; |
| } |
| |
| <?php /* Converts CREs */ ?> |
| /* Converts CREs */ |
| var oUAhtml = oUA.innerHTML |
| if (oUA.title != oUAhtml) |
| { |
| 478,13 → 472,8 |
| } |
| } |
| |
| tUA = this.run(); |
| this.run(); |
| }, 1000); |
| |
| _addEventListener(document, "unload", function () { |
| tUA.unset(); |
| tUA = null; |
| }); |
| }()); |
| </script><noscript><?php echo tr('N/A'); ?></noscript></td> |
| </tr> |
| 492,33 → 481,7 |
| <th><?php echo tr('Features'); ?>:</th> |
| <td><script type="text/javascript"> |
| var fullscreen = jsx.dom.window.fullscreen; |
| |
| jsx.dom.geolocation = { |
| getText: function (position) { |
| var coords = position.coords; |
| var latitude = coords.latitude; |
| var longitude = coords.longitude; |
| var altitude = coords.altitude; |
| var altitudeAccuracy = coords.altitudeAccuracy; |
| var speed = coords.speed; |
| var heading = coords.heading; |
| |
| return [ |
| "<?php echo tr('Latitude:'); ?> " + (latitude != null ? latitude + "°" : TEXT_NOT_AVAILABLE), |
| "<?php echo tr('Longitude:'); ?> " + (longitude != null ? longitude + "°" : TEXT_NOT_AVAILABLE), |
| "<?php echo tr('Lat/Lng Accuracy:'); ?> " + coords.accuracy + " m", |
| "<?php echo tr('Altitude:'); ?> " + (altitude != null ? altitude + " m": TEXT_NOT_AVAILABLE), |
| "<?php echo tr('Alt. Accuracy:'); ?> " + (altitudeAccuracy != null ? altitudeAccuracy + " m": TEXT_NOT_AVAILABLE), |
| "<?php echo tr('Speed:'); ?> " + (speed != null && !isNaN(speed) ? speed + " m∕s": TEXT_NOT_AVAILABLE), |
| "<?php echo tr('Heading:'); ?> " + (heading != null && !isNaN(heading) ? heading + "°" : TEXT_NOT_AVAILABLE) |
| ].join("\n"); |
| }, |
| |
| show: function (position) { |
| window.alert("<?php echo tr('Your current coordinates on Terra'); ?>\n\n" + this.getText(position)); |
| } |
| }; |
| |
| |
| (function () { |
| function getFeatures () |
| { |
| 530,12 → 493,7 |
| { |
| if (document.cookie) |
| { |
| var cookies = document.cookie; |
| cookies = cookies.split(/\s*;\s*/); |
| features.push('<a href="#" title="' |
| + cookies.join(" ") |
| + '"' |
| + ' onclick="window.alert(\'<?php echo tr('Cookies for'); ?> ' + document.domain + '\\n\\n' + cookies.join("\\n") + '\'); return false">' + cookiesText + '<\/a>'); |
| features.push(cookiesText); |
| } |
| else |
| { |
| 564,10 → 522,7 |
| |
| if (navigator.geolocation) |
| { |
| features.push('<a href="#" title="<?php echo tr('Get location'); ?>"' |
| + ' onclick="navigator.geolocation.getCurrentPosition(' |
| + 'function (position) { jsx.dom.geolocation.show(position); }); return false"' |
| + '><?php echo tr('Geolocation'); ?><\/a>'); |
| features.push("<?php echo tr('Geolocation'); ?>"); |
| } |
| |
| if (typeof navigator.javaEnabled != "undefined" && navigator.javaEnabled()) |
| 605,15 → 560,17 |
| |
| function stripTags (s) |
| { |
| return s.replace(/<[^>]+>/g, ""); |
| return s.replace(/<[^>]+>/g, "") |
| } |
| |
| var sFeatures = getFeatures(); |
| document.write('<span id="features" title="' + stripTags(sFeatures) + '">' + sFeatures + '<\/span>'); |
| document.write('<span id="features" title="' |
| + stripTags(sFeatures) + '">' + sFeatures |
| + '<\/span>'); |
| |
| var oFeatures; |
| var oFeaturesHtml; |
| var tFeatures = _runAsync(function () { |
| var tFeatures = runAsync(function () { |
| if (typeof oFeatures == "undefined") |
| { |
| oFeatures = document.getElementById("features"); |
| 651,11 → 608,6 |
| }, 1000); |
| }()); |
| |
| _addEventListener(document, "unload", function () { |
| tFeatures.unset(); |
| tFeatures = null; |
| }); |
| |
| var windowText = "<?php echo tr("Window"); ?>"; |
| </script><noscript><?php echo tr('N/A'); ?></noscript></td> |
| </tr> |
| 688,7 → 640,7 |
| var cmd3; |
| if (fullscreen.isSupportedBy(document.documentElement)) |
| { |
| _addEventListener(window, "load", function () { |
| jsx.dom.addEventListener(window, "load", function () { |
| if (typeof cmd3 == "undefined") |
| { |
| cmd3 = jsx.dom.getElementById("cmd3"); |
| 711,8 → 663,8 |
| var previousIsFullscreen; |
| var oldHandler; |
| |
| _addEventListener(window, "resize", function () { |
| <?php /* FIXME: Also update title attribute value */ ?> |
| jsx.dom.addEventListener(window, "resize", function () { |
| /* FIXME: Also update title attribute value */ |
| if (typeof oScreenDim == "undefined") oScreenDim = _gEBI(ID_SCREEN_DIM); |
| if (oScreenDim) oScreenDim.innerHTML = dim.getScreenText(); |
| |
| 784,4 → 736,4 |
| </div> |
| </div> |
| </body> |
| </html> |
| </html> |