Subversion Repositories LCARS

Compare Revisions

Last modification

Ignore whitespace Rev 157 → Rev 158

/trunk/index.phtml
370,10 → 370,12
<tr>
<th><?php echo tr('Display'); ?>:</th>
<td><script type="text/javascript">
var runAsync = jsx.dom.timeout.runAsync;
var _addEventListener = jsx.dom.addEventListener;
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;
404,7 → 406,6
}());
(function () {
 
var screenDimText = dim.getScreenText();
var availDimText = dim.getAvailText();
var innerDimText = dim.getInnerText();
414,13 → 415,13
+ (availDimText ? ' (<span id="' + ID_AVAIL_DIM + '">' + availDimText + "<\/span>" : "")
+ (innerDimText ? '<span id="' + ID_INNER_DIM + '">' + innerDimText + "<\/span>)" : "")
+ (colorDepthText ? ' ×&nbsp;<span id="colorDepth">' + colorDepthText + "<\/span>" : "")
: "<?php echo tr('N/A'); ?>";
: TEXT_NOT_AVAILABLE;
/* FIXME: Convert HTML to text, update whole title text */
document.write('<span>' + displayInfo + '<\/span>');
 
var oColorDepth;
runAsync(function () {
var tColor = _runAsync(function () {
if (typeof oColorDepth == "undefined")
{
oColorDepth = document.getElementById("colorDepth");
429,7 → 430,7
if (oColorDepth)
{
var colorDepthText = dim.getColorDepthText();
/* FIXME: Also update title attribute value */
<?php /* FIXME: Also update title attribute value */ ?>
if (oColorDepth.innerHTML != colorDepthText)
{
oColorDepth.innerHTML = colorDepthText;
436,8 → 437,13
}
}
 
this.run();
tColor = this.run();
}, 1000);
 
_addEventListener(document, "unload", function () {
tColor.unset();
tColor = null;
});
}());
</script><noscript><?php echo tr('N/A'); ?></noscript></td>
</tr>
449,7 → 455,7
document.write('<span id="ua" title="' + ua + '">' + ua + '<\/span>');
 
var oUA;
runAsync(function () {
var tUA = _runAsync(function () {
if (typeof oUA == "undefined")
{
oUA = document.getElementById("ua");
464,7 → 470,7
oUA.innerHTML = ua;
}
 
/* Converts CREs */
<?php /* Converts CREs */ ?>
var oUAhtml = oUA.innerHTML
if (oUA.title != oUAhtml)
{
472,8 → 478,13
}
}
 
this.run();
tUA = this.run();
}, 1000);
 
_addEventListener(document, "unload", function () {
tUA.unset();
tUA = null;
});
}());
</script><noscript><?php echo tr('N/A'); ?></noscript></td>
</tr>
481,7 → 492,33
<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 ()
{
493,7 → 530,12
{
if (document.cookie)
{
features.push(cookiesText);
var cookies = document.cookie;
cookies = cookies.split(/\s*;\s*/);
features.push('<a href="#" title="'
+ cookies.join("&#13;&#10;")
+ '"'
+ ' onclick="window.alert(\'<?php echo tr('Cookies for'); ?> ' + document.domain + '\\n\\n' + cookies.join("\\n") + '\'); return false">' + cookiesText + '<\/a>');
}
else
{
522,7 → 564,10
if (navigator.geolocation)
{
features.push("<?php echo tr('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>');
}
 
if (typeof navigator.javaEnabled != "undefined" && navigator.javaEnabled())
560,17 → 605,15
 
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");
608,6 → 651,11
}, 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>
640,7 → 688,7
var cmd3;
if (fullscreen.isSupportedBy(document.documentElement))
{
jsx.dom.addEventListener(window, "load", function () {
_addEventListener(window, "load", function () {
if (typeof cmd3 == "undefined")
{
cmd3 = jsx.dom.getElementById("cmd3");
663,8 → 711,8
var previousIsFullscreen;
var oldHandler;
jsx.dom.addEventListener(window, "resize", function () {
/* FIXME: Also update title attribute value */
_addEventListener(window, "resize", function () {
<?php /* FIXME: Also update title attribute value */ ?>
if (typeof oScreenDim == "undefined") oScreenDim = _gEBI(ID_SCREEN_DIM);
if (oScreenDim) oScreenDim.innerHTML = dim.getScreenText();
 
736,4 → 784,4
</div>
</div>
</body>
</html>
</html>