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