Rev 143 | Rev 146 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 143 | Rev 145 | ||
---|---|---|---|
Line 432... | Line 432... | ||
432 | oColorDepth = document.getElementById("colorDepth"); |
432 | oColorDepth = document.getElementById("colorDepth"); |
433 | } |
433 | } |
434 | 434 | ||
435 | if (oColorDepth) |
435 | if (oColorDepth) |
436 | { |
436 | { |
- | 437 | var colorDepthText = dim.getColorDepthText(); |
|
437 | /* FIXME: Also update title attribute value */ |
438 | /* FIXME: Also update title attribute value */ |
- | 439 | if (oColorDepth.innerHTML != colorDepthText) |
|
- | 440 | { |
|
438 | oColorDepth.innerHTML = dim.getColorDepthText(); |
441 | oColorDepth.innerHTML = colorDepthText; |
- | 442 | } |
|
439 | } |
443 | } |
440 | 444 | ||
441 | this.run(); |
445 | this.run(); |
442 | }, 1000); |
446 | }, 1000); |
443 | }()); |
447 | }()); |
Line 457... | Line 461... | ||
457 | oUA = document.getElementById("ua"); |
461 | oUA = document.getElementById("ua"); |
458 | } |
462 | } |
459 | 463 | ||
460 | if (oUA) |
464 | if (oUA) |
461 | { |
465 | { |
462 | oUA.innerHTML = navigator.userAgent; |
466 | var ua = navigator.userAgent; |
- | 467 | ||
- | 468 | if (oUA.innerHTML != ua) |
|
- | 469 | { |
|
- | 470 | oUA.innerHTML = ua; |
|
- | 471 | } |
|
463 | 472 | ||
464 | /* Converts CREs */ |
473 | /* Converts CREs */ |
465 | oUA.title = oUA.innerHTML; |
474 | var oUAhtml = oUA.innerHTML |
- | 475 | if (oUA.title != oUAhtml) |
|
- | 476 | { |
|
- | 477 | oUA.title = oUAhtml; |
|
- | 478 | } |
|
466 | } |
479 | } |
467 | 480 | ||
468 | this.run(); |
481 | this.run(); |
469 | }, 1000); |
482 | }, 1000); |
470 | }()); |
483 | }()); |
471 | </script><noscript><?php echo _('N/A'); ?></noscript></td> |
484 | </script><noscript><?php echo _('N/A'); ?></noscript></td> |
472 | </tr> |
485 | </tr> |
473 | <tr> |
486 | <tr> |
474 | <th><?php echo _('Features'); ?>:</th> |
487 | <th><?php echo _('Features'); ?>:</th> |
475 | <td><script type="text/javascript"> |
488 | <td><script type="text/javascript"> |
476 | <?php /* FIXME: Move to window.js, keep i18n */ ?> |
- | |
477 | var fullscreen = jsx.dom.window.fullscreen = (function () { |
489 | var fullscreen = jsx.dom.window.fullscreen; |
478 | var _isHostMethod = jsx.object.isHostMethod; |
- | |
479 | 490 | ||
- | 491 | (function () { |
|
- | 492 | function getFeatures () |
|
480 | return { |
493 | { |
- | 494 | var features = []; |
|
481 | getSupportedProperty: function (base, names, test) { |
495 | if (typeof document.cookie != "undefined") |
- | 496 | { |
|
482 | for (var i = 0, len = names.length; i < len; ++i) |
497 | var cookiesText = "<?php echo _('Cookies'); ?>" |
- | 498 | if (navigator.cookieEnabled) |
|
483 | { |
499 | { |
484 | var name = names[i]; |
500 | if (document.cookie) |
485 | if (test.call(null, base, name)) |
- | |
486 | { |
501 | { |
487 | return name; |
502 | features.push(cookiesText); |
488 | } |
503 | } |
- | 504 | else |
|
- | 505 | { |
|
- | 506 | features.push('<span class="unavailable"' |
|
- | 507 | +' title="Cookies supported, but no data for this site">' + cookiesText + '<\/span>'); |
|
489 | } |
508 | } |
490 | - | ||
491 | return null; |
509 | } |
492 | }, |
510 | else |
493 | - | ||
494 | getSupportedCancel: (function () { |
- | |
495 | var _supportedCancel; |
- | |
496 | - | ||
497 | return function () { |
- | |
498 | if (typeof _supportedCancel == "undefined") |
- | |
499 | { |
511 | { |
500 | var properties = ["cancelFullScreen", "mozCancelFullScreen", |
512 | features.push('<span class="offline" title="Cookies supported, but disabled">' + cookiesText + '<\/span>'); |
501 | "webkitCancelFullScreen"]; |
513 | } |
502 | - | ||
503 | _supportedCancel = this.getSupportedProperty(document, properties, _isHostMethod); |
- | |
504 | } |
514 | } |
505 | 515 | ||
506 | return _supportedCancel; |
- | |
507 | }; |
- | |
508 | }()), |
- | |
509 | - | ||
510 | getSupportedElement: (function () { |
- | |
511 | var _supportedElement; |
- | |
512 | - | ||
513 | return function () { |
- | |
514 | if (typeof _supportedElement == "undefined") |
516 | if (fullscreen.isSupportedBy(document.documentElement)) |
515 | { |
517 | { |
516 | var properties = ["fullscreenElement", "mozFullscreenElement", |
- | |
517 | "webkitFullscreenElement"]; |
518 | features.push("<?php echo _('Fullscreen'); ?>"); |
518 | - | ||
519 | _supportedElement = this.getSupportedProperty(document, properties, |
- | |
520 | function (base, name) { |
- | |
521 | return typeof base[name] != "undefined"; |
- | |
522 | }); |
- | |
523 | } |
519 | } |
524 | 520 | ||
525 | return _supportedElement; |
- | |
526 | }; |
- | |
527 | }()), |
- | |
528 | - | ||
529 | isSupportedBy: function (elem) { |
- | |
530 | var methods = ["requestFullscreen", "mozRequestFullscreen", |
- | |
531 | "webkitRequestFullscreen"]; |
- | |
532 | return this.getSupportedProperty(elem, methods, _isHostMethod); |
- | |
533 | }, |
- | |
534 | - | ||
535 | isFullscreen: function () { |
- | |
536 | var properties = ["fullscreenElement", "mozFullscreenElement", |
521 | if (navigator.webkitGetGamepads && navigator.webkitGetGamepads().length) |
537 | "webkitFullscreenElement"]; |
- | |
538 | var supportedProperty = this.getSupportedProperty( |
- | |
539 | document, properties, |
- | |
540 | function (base, name) { |
- | |
541 | return typeof base[name] != "undefined"; |
- | |
542 | }); |
- | |
543 | - | ||
544 | return supportedProperty && document[supportedProperty] != null; |
- | |
545 | }, |
- | |
546 | - | ||
547 | cancel: function (target, oldHandler, textTarget) { |
- | |
548 | var supportedCancel = this.getSupportedCancel(); |
- | |
549 | if (supportedCancel) |
- | |
550 | { |
522 | { |
551 | document[supportedCancel](); |
523 | features.push("<?php echo _('Gamepad'); ?>"); |
- | 524 | } |
|
552 | 525 | ||
553 | var supportedElement = this.getSupportedElement(); |
- | |
554 | if (supportedElement) |
526 | if (navigator.geolocation) |
555 | { |
- | |
556 | if (document[supportedElement] == null) |
- | |
557 | { |
527 | { |
558 | if (textTarget) |
- | |
559 | { |
- | |
560 | textTarget.textContent = "<?php echo _("Fullscreen"); ?>"; |
528 | features.push("<?php echo _('Geolocation'); ?>"); |
561 | } |
529 | } |
562 | 530 | ||
563 | if (target) |
531 | if (typeof navigator.javaEnabled != "undefined" && navigator.javaEnabled()) |
564 | { |
532 | { |
565 | target.onclick = oldHandler; |
- | |
566 | } |
533 | features.push("Java"); |
567 | } |
- | |
568 | } |
534 | } |
569 | } |
- | |
570 | }, |
- | |
571 | 535 | ||
572 | requestOn: function (elem, eventTarget, textTarget) { |
536 | var storage = jsx.dom.storage; |
573 | var requestMethodName; |
537 | if (storage.localStorage.isSupported()) features.push("Local Storage"); |
574 | 538 | ||
575 | if (elem && (requestMethodName = this.isSupportedBy(elem))) |
539 | if (navigator.plugins) |
576 | { |
540 | { |
577 | elem[requestMethodName](); |
- | |
578 | if (textTarget && this.isFullscreen()) |
541 | if (navigator.plugins.length > 0) |
579 | { |
542 | { |
580 | var oldText = textTarget.textContent; |
- | |
581 | var me = this; |
543 | features.push('<span title="' |
582 | var oldHandler = eventTarget.onclick; |
- | |
583 | eventTarget.onclick = function () { |
544 | + navigator.plugins.length |
584 | me.cancel(this, oldHandler, textTarget); |
545 | + ' plugins installed">Plugins<\/span>'); |
585 | }; |
- | |
586 | textTarget.textContent = "<?php echo _("Window"); ?>"; |
- | |
587 | } |
546 | } |
- | 547 | else |
|
- | 548 | { |
|
- | 549 | features.push('<span class="unavailable" title="Plugins supported, but none detected">Plugins<\/span>'); |
|
588 | } |
550 | } |
589 | } |
551 | } |
590 | }; |
- | |
591 | }()); |
- | |
592 | 552 | ||
593 | (function () { |
- | |
594 | function getFeatures () |
553 | if (storage.sessionStorage.isSupported()) |
595 | { |
554 | { |
596 | var features = []; |
555 | features.push("Session Storage"); |
597 | if (navigator.cookieEnabled) features.push("<?php echo _('Cookies'); ?>"); |
- | |
598 | if (fullscreen.isSupportedBy(document.documentElement)) features.push("<?php echo _('Fullscreen'); ?>"); |
- | |
599 | if (navigator.webkitGetGamepads && navigator.webkitGetGamepads().length) features.push("<?php echo _('Gamepad'); ?>"); |
- | |
600 | if (navigator.geolocation) features.push("<?php echo _('Geolocation'); ?>"); |
- | |
601 | if (typeof navigator.javaEnabled != "undefined" && navigator.javaEnabled()) features.push("Java"); |
- | |
602 | var storage = jsx.dom.storage; |
556 | } |
603 | if (storage.localStorage.isSupported()) features.push("Local Storage"); |
- | |
604 | if (navigator.plugins) features.push("Plugins"); |
- | |
605 | if (storage.sessionStorage.isSupported()) features.push("Session Storage"); |
- | |
- | 557 | ||
606 | if (typeof window.ontouchstart != "undefined") features.push("Touch"); |
558 | if (typeof window.ontouchstart != "undefined") features.push("Touch"); |
607 | return features.join(" • "); |
559 | return features.join(" • "); |
608 | } |
560 | } |
609 | 561 | ||
- | 562 | function stripTags (s) |
|
- | 563 | { |
|
- | 564 | return s.replace(/<[^>]+>/g, "") |
|
- | 565 | } |
|
- | 566 | ||
610 | var sFeatures = getFeatures(); |
567 | var sFeatures = getFeatures(); |
611 | document.write('<span id="features" title="' + sFeatures + '">' + sFeatures + '<\/span>'); |
568 | document.write('<span id="features" title="' + stripTags(sFeatures) + '">' + sFeatures + '<\/span>'); |
612 | 569 | ||
613 | var oFeatures; |
570 | var oFeatures; |
- | 571 | var oFeaturesHtml; |
|
614 | var tFeatures = runAsync(function () { |
572 | var tFeatures = runAsync(function () { |
615 | if (typeof oFeatures == "undefined") |
573 | if (typeof oFeatures == "undefined") |
616 | { |
574 | { |
617 | oFeatures = document.getElementById("features"); |
575 | oFeatures = document.getElementById("features"); |
618 | } |
576 | } |
619 | 577 | ||
620 | if (oFeatures) |
578 | if (oFeatures) |
621 | { |
579 | { |
- | 580 | var sNewFeatures = getFeatures(); |
|
- | 581 | ||
- | 582 | if (!oFeaturesHtml) |
|
- | 583 | { |
|
- | 584 | oFeaturesHtml = document.createElement("span"); |
|
- | 585 | } |
|
- | 586 | ||
- | 587 | if (oFeaturesHtml) |
|
- | 588 | { |
|
- | 589 | oFeaturesHtml.innerHTML = sNewFeatures; |
|
- | 590 | sNewFeatures = oFeaturesHtml.innerHTML; |
|
- | 591 | } |
|
- | 592 | ||
- | 593 | if (oFeatures.innerHTML != sNewFeatures) |
|
- | 594 | { |
|
622 | oFeatures.innerHTML = getFeatures(); |
595 | oFeatures.innerHTML = sNewFeatures; |
- | 596 | } |
|
623 | 597 | ||
624 | /* Converts CREs */ |
598 | /* Converts CREs */ |
625 | oFeatures.title = oFeatures.innerHTML; |
599 | var newTitle = stripTags(oFeatures.innerHTML) |
- | 600 | if (oFeatures.title != newTitle) |
|
- | 601 | { |
|
- | 602 | oFeatures.title = newTitle; |
|
- | 603 | } |
|
626 | } |
604 | } |
627 | 605 | ||
628 | tFeatures = this.run(); |
606 | tFeatures = this.run(); |
629 | }, 1000); |
607 | }, 1000); |
630 | }()); |
608 | }()); |
- | 609 | ||
- | 610 | var windowText = "<?php echo _("Window"); ?>"; |
|
631 | </script><noscript><?php echo _('N/A'); ?></noscript></td> |
611 | </script><noscript><?php echo _('N/A'); ?></noscript></td> |
632 | </tr> |
612 | </tr> |
633 | </table> |
613 | </table> |
634 | </div> |
614 | </div> |
635 | <ul class="commands"> |
615 | <ul class="commands"> |
Line 651... | Line 631... | ||
651 | onfocus="return this.onmouseover()" |
631 | onfocus="return this.onmouseover()" |
652 | onblur="return this.onmouseout()" |
632 | onblur="return this.onmouseout()" |
653 | ><span class="text"><?php echo _("Printable"); ?></span></a></li> |
633 | ><span class="text"><?php echo _("Printable"); ?></span></a></li> |
654 | <li id="cmd3"><div class="button left right" |
634 | <li id="cmd3"><div class="button left right" |
655 | style="cursor: not-allowed !important" |
635 | style="cursor: not-allowed !important" |
656 | onclick="fullscreen.requestOn(document.documentElement, this, this.firstChild)" |
636 | onclick="fullscreen.requestOn(document.documentElement, this, this.firstChild, windowText)" |
657 | onkeyup="if (event.keyCode == 13) { this.onclick(); }" |
637 | onkeyup="if (event.keyCode == 13) { this.onclick(); }" |
658 | ><span class="text"><script type="text/javascript"> |
638 | ><span class="text"><script type="text/javascript"> |
659 | if (fullscreen.isSupportedBy(document.documentElement)) |
639 | if (fullscreen.isSupportedBy(document.documentElement)) |
660 | { |
640 | { |
661 | <?php /* |
641 | <?php /* |
Line 669... | Line 649... | ||
669 | var target = cmd3.firstChild;
|
649 | var target = cmd3.firstChild;
|
670 | var textTarget = target.firstChild;
|
650 | var textTarget = target.firstChild;
|
671 | if (nowIsFullscreen)
|
651 | if (nowIsFullscreen)
|
672 | {
|
652 | {
|
673 | oldHandler = target.onclick;
|
653 | oldHandler = target.onclick;
|
674 | // fullscreen.requestOn(document.documentElement, cmd3.firstElementChild, cmd3.firstElementChild.firstElementChild);
|
654 | // fullscreen.requestOn(document.documentElement, cmd3.firstElementChild, cmd3.firstElementChild.firstElementChild, windowText);
|
675 | }
|
655 | }
|
676 | else
|
656 | else
|
677 | {
|
657 | {
|
678 | fullscreen.cancel(target, oldHandler, textTarget);
|
658 | fullscreen.cancel(target, oldHandler, textTarget, "<?php echo _("Fullscreen"); ?>");
|
679 | }
|
659 | }
|
680 |
|
660 |
|
681 | previousIsFullscreen = nowIsFullscreen;
|
661 | previousIsFullscreen = nowIsFullscreen;
|
682 | }
|
662 | }
|
683 | };
|
663 | };
|