Subversion Repositories LCARS

Compare Revisions

Last modification

Ignore whitespace Rev 144 → Rev 145

/trunk/index.phtml/index.phtml
434,8 → 434,12
if (oColorDepth)
{
var colorDepthText = dim.getColorDepthText();
/* FIXME: Also update title attribute value */
oColorDepth.innerHTML = dim.getColorDepthText();
if (oColorDepth.innerHTML != colorDepthText)
{
oColorDepth.innerHTML = colorDepthText;
}
}
 
this.run();
459,10 → 463,19
if (oUA)
{
oUA.innerHTML = navigator.userAgent;
var ua = navigator.userAgent;
 
if (oUA.innerHTML != ua)
{
oUA.innerHTML = ua;
}
 
/* Converts CREs */
oUA.title = oUA.innerHTML;
var oUAhtml = oUA.innerHTML
if (oUA.title != oUAhtml)
{
oUA.title = oUAhtml;
}
}
 
this.run();
473,144 → 486,89
<tr>
<th><?php echo _('Features'); ?>:</th>
<td><script type="text/javascript">
<?php /* FIXME: Move to window.js, keep i18n */ ?>
var fullscreen = jsx.dom.window.fullscreen = (function () {
var _isHostMethod = jsx.object.isHostMethod;
return {
getSupportedProperty: function (base, names, test) {
for (var i = 0, len = names.length; i < len; ++i)
var fullscreen = jsx.dom.window.fullscreen;
(function () {
function getFeatures ()
{
var features = [];
if (typeof document.cookie != "undefined")
{
var cookiesText = "<?php echo _('Cookies'); ?>"
if (navigator.cookieEnabled)
{
var name = names[i];
if (test.call(null, base, name))
if (document.cookie)
{
return name;
features.push(cookiesText);
}
}
return null;
},
getSupportedCancel: (function () {
var _supportedCancel;
return function () {
if (typeof _supportedCancel == "undefined")
else
{
var properties = ["cancelFullScreen", "mozCancelFullScreen",
"webkitCancelFullScreen"];
_supportedCancel = this.getSupportedProperty(document, properties, _isHostMethod);
features.push('<span class="unavailable"'
+' title="Cookies supported, but no data for this site">' + cookiesText + '<\/span>');
}
return _supportedCancel;
};
}()),
}
else
{
features.push('<span class="offline" title="Cookies supported, but disabled">' + cookiesText + '<\/span>');
}
}
 
if (fullscreen.isSupportedBy(document.documentElement))
{
features.push("<?php echo _('Fullscreen'); ?>");
}
getSupportedElement: (function () {
var _supportedElement;
return function () {
if (typeof _supportedElement == "undefined")
{
var properties = ["fullscreenElement", "mozFullscreenElement",
"webkitFullscreenElement"];
_supportedElement = this.getSupportedProperty(document, properties,
function (base, name) {
return typeof base[name] != "undefined";
});
}
return _supportedElement;
};
}()),
if (navigator.webkitGetGamepads && navigator.webkitGetGamepads().length)
{
features.push("<?php echo _('Gamepad'); ?>");
}
isSupportedBy: function (elem) {
var methods = ["requestFullscreen", "mozRequestFullscreen",
"webkitRequestFullscreen"];
return this.getSupportedProperty(elem, methods, _isHostMethod);
},
isFullscreen: function () {
var properties = ["fullscreenElement", "mozFullscreenElement",
"webkitFullscreenElement"];
var supportedProperty = this.getSupportedProperty(
document, properties,
function (base, name) {
return typeof base[name] != "undefined";
});
return supportedProperty && document[supportedProperty] != null;
},
cancel: function (target, oldHandler, textTarget) {
var supportedCancel = this.getSupportedCancel();
if (supportedCancel)
if (navigator.geolocation)
{
features.push("<?php echo _('Geolocation'); ?>");
}
 
if (typeof navigator.javaEnabled != "undefined" && navigator.javaEnabled())
{
features.push("Java");
}
var storage = jsx.dom.storage;
if (storage.localStorage.isSupported()) features.push("Local Storage");
 
if (navigator.plugins)
{
if (navigator.plugins.length > 0)
{
document[supportedCancel]();
var supportedElement = this.getSupportedElement();
if (supportedElement)
{
if (document[supportedElement] == null)
{
if (textTarget)
{
textTarget.textContent = "<?php echo _("Fullscreen"); ?>";
}
if (target)
{
target.onclick = oldHandler;
}
}
}
features.push('<span title="'
+ navigator.plugins.length
+ ' plugins installed">Plugins<\/span>');
}
},
requestOn: function (elem, eventTarget, textTarget) {
var requestMethodName;
if (elem && (requestMethodName = this.isSupportedBy(elem)))
else
{
elem[requestMethodName]();
if (textTarget && this.isFullscreen())
{
var oldText = textTarget.textContent;
var me = this;
var oldHandler = eventTarget.onclick;
eventTarget.onclick = function () {
me.cancel(this, oldHandler, textTarget);
};
textTarget.textContent = "<?php echo _("Window"); ?>";
}
features.push('<span class="unavailable" title="Plugins supported, but none detected">Plugins<\/span>');
}
}
};
}());
(function () {
function getFeatures ()
{
var features = [];
if (navigator.cookieEnabled) features.push("<?php echo _('Cookies'); ?>");
if (fullscreen.isSupportedBy(document.documentElement)) features.push("<?php echo _('Fullscreen'); ?>");
if (navigator.webkitGetGamepads && navigator.webkitGetGamepads().length) features.push("<?php echo _('Gamepad'); ?>");
if (navigator.geolocation) features.push("<?php echo _('Geolocation'); ?>");
if (typeof navigator.javaEnabled != "undefined" && navigator.javaEnabled()) features.push("Java");
var storage = jsx.dom.storage;
if (storage.localStorage.isSupported()) features.push("Local Storage");
if (navigator.plugins) features.push("Plugins");
if (storage.sessionStorage.isSupported()) features.push("Session Storage");
 
if (storage.sessionStorage.isSupported())
{
features.push("Session Storage");
}
 
if (typeof window.ontouchstart != "undefined") features.push("Touch");
return features.join(" &#8226; ");
}
 
function stripTags (s)
{
return s.replace(/<[^>]+>/g, "")
}
var sFeatures = getFeatures();
document.write('<span id="features" title="' + sFeatures + '">' + sFeatures + '<\/span>');
document.write('<span id="features" title="' + stripTags(sFeatures) + '">' + sFeatures + '<\/span>');
 
var oFeatures;
var oFeaturesHtml;
var tFeatures = runAsync(function () {
if (typeof oFeatures == "undefined")
{
619,15 → 577,37
 
if (oFeatures)
{
oFeatures.innerHTML = getFeatures();
var sNewFeatures = getFeatures();
 
if (!oFeaturesHtml)
{
oFeaturesHtml = document.createElement("span");
}
if (oFeaturesHtml)
{
oFeaturesHtml.innerHTML = sNewFeatures;
sNewFeatures = oFeaturesHtml.innerHTML;
}
if (oFeatures.innerHTML != sNewFeatures)
{
oFeatures.innerHTML = sNewFeatures;
}
 
/* Converts CREs */
oFeatures.title = oFeatures.innerHTML;
var newTitle = stripTags(oFeatures.innerHTML)
if (oFeatures.title != newTitle)
{
oFeatures.title = newTitle;
}
}
 
tFeatures = this.run();
}, 1000);
}());
 
var windowText = "<?php echo _("Window"); ?>";
</script><noscript><?php echo _('N/A'); ?></noscript></td>
</tr>
</table>
653,7 → 633,7
><span class="text"><?php echo _("Printable"); ?></span></a></li>
<li id="cmd3"><div class="button left right"
style="cursor: not-allowed !important"
onclick="fullscreen.requestOn(document.documentElement, this, this.firstChild)"
onclick="fullscreen.requestOn(document.documentElement, this, this.firstChild, windowText)"
onkeyup="if (event.keyCode == 13) { this.onclick(); }"
><span class="text"><script type="text/javascript">
if (fullscreen.isSupportedBy(document.documentElement))
671,11 → 651,11
if (nowIsFullscreen)
{
oldHandler = target.onclick;
// fullscreen.requestOn(document.documentElement, cmd3.firstElementChild, cmd3.firstElementChild.firstElementChild);
// fullscreen.requestOn(document.documentElement, cmd3.firstElementChild, cmd3.firstElementChild.firstElementChild, windowText);
}
else
{
fullscreen.cancel(target, oldHandler, textTarget);
fullscreen.cancel(target, oldHandler, textTarget, "<?php echo _("Fullscreen"); ?>");
}
previousIsFullscreen = nowIsFullscreen;