Rev 143 | Rev 146 | Go to most recent revision | Show entire file | Ignore 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]; |
- | |
| 485 | if (test.call(null, base, name)) |
- | |
| 486 | {
|
- | |
| 487 | return name; |
500 | if (document.cookie) |
| 488 | } |
- | |
| 489 | } |
- | |
| 490 | - | ||
| 491 | return null; |
- | |
| 492 | }, |
- | |
| 493 | - | ||
| 494 | getSupportedCancel: (function () {
|
- | |
| 495 | var _supportedCancel; |
- | |
| 496 | - | ||
| 497 | return function () {
|
- | |
| 498 | if (typeof _supportedCancel == "undefined") |
- | |
| 499 | {
|
501 | {
|
| 500 | var properties = ["cancelFullScreen", "mozCancelFullScreen", |
- | |
| 501 | "webkitCancelFullScreen"]; |
502 | features.push(cookiesText); |
| 502 | - | ||
| 503 | _supportedCancel = this.getSupportedProperty(document, properties, _isHostMethod); |
- | |
| 504 | } |
503 | } |
| 505 | - | ||
| 506 | return _supportedCancel; |
- | |
| 507 | }; |
- | |
| 508 | }()), |
- | |
| 509 | - | ||
| 510 | getSupportedElement: (function () {
|
- | |
| 511 | var _supportedElement; |
- | |
| 512 | - | ||
| 513 | return function () {
|
- | |
| 514 | if (typeof _supportedElement == "undefined") |
- | |
| 515 | {
|
- | |
| 516 | var properties = ["fullscreenElement", "mozFullscreenElement", |
- | |
| 517 | "webkitFullscreenElement"]; |
- | |
| 518 | - | ||
| 519 | _supportedElement = this.getSupportedProperty(document, properties, |
- | |
| 520 | function (base, name) {
|
- | |
| 521 | return typeof base[name] != "undefined"; |
- | |
| 522 | }); |
- | |
| 523 | } |
- | |
| 524 | - | ||
| 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", |
- | |
| 537 | "webkitFullscreenElement"]; |
- | |
| 538 | var supportedProperty = this.getSupportedProperty( |
- | |
| 539 | document, properties, |
- | |
| 540 | function (base, name) {
|
- | |
| 541 | return typeof base[name] != "undefined"; |
- | |
| 542 | }); |
504 | else |
| 543 | - | ||
| 544 | return supportedProperty && document[supportedProperty] != null; |
- | |
| 545 | }, |
- | |
| 546 | - | ||
| 547 | cancel: function (target, oldHandler, textTarget) {
|
- | |
| 548 | var supportedCancel = this.getSupportedCancel(); |
- | |
| 549 | if (supportedCancel) |
- | |
| 550 | {
|
- | |
| 551 | document[supportedCancel](); |
- | |
| 552 | - | ||
| 553 | var supportedElement = this.getSupportedElement(); |
- | |
| 554 | if (supportedElement) |
- | |
| 555 | {
|
505 | {
|
| 556 | if (document[supportedElement] == null) |
506 | features.push('<span class="unavailable"'
|
| 557 | {
|
- | |
| 558 | if (textTarget) |
- | |
| 559 | {
|
- | |
| 560 | textTarget.textContent = "<?php echo _("Fullscreen"); ?>"; |
507 | +' title="Cookies supported, but no data for this site">' + cookiesText + '<\/span>'); |
| 561 | } |
- | |
| 562 | - | ||
| 563 | if (target) |
- | |
| 564 | {
|
- | |
| 565 | target.onclick = oldHandler; |
- | |
| 566 | } |
- | |
| 567 | } |
- | |
| 568 | } |
508 | } |
| 569 | } |
509 | } |
| 570 | }, |
510 | else |
| 571 | - | ||
| 572 | requestOn: function (elem, eventTarget, textTarget) {
|
- | |
| 573 | var requestMethodName; |
- | |
| 574 | - | ||
| 575 | if (elem && (requestMethodName = this.isSupportedBy(elem))) |
- | |
| 576 | {
|
511 | {
|
| 577 | elem[requestMethodName](); |
- | |
| 578 | if (textTarget && this.isFullscreen()) |
- | |
| 579 | {
|
- | |
| 580 | var oldText = textTarget.textContent; |
- | |
| 581 | var me = this; |
- | |
| 582 | var oldHandler = eventTarget.onclick; |
- | |
| 583 | eventTarget.onclick = function () {
|
- | |
| 584 | me.cancel(this, oldHandler, textTarget); |
- | |
| 585 | }; |
- | |
| 586 | textTarget.textContent = "<?php echo _("Window"); ?>"; |
512 | features.push('<span class="offline" title="Cookies supported, but disabled">' + cookiesText + '<\/span>');
|
| 587 | } |
- | |
| 588 | } |
513 | } |
| 589 | } |
514 | } |
| - | 515 | ||
| - | 516 | if (fullscreen.isSupportedBy(document.documentElement)) |
|
| 590 | }; |
517 | {
|
| - | 518 | features.push("<?php echo _('Fullscreen'); ?>");
|
|
| 591 | }()); |
519 | } |
| 592 | 520 | ||
| - | 521 | if (navigator.webkitGetGamepads && navigator.webkitGetGamepads().length) |
|
| 593 | (function () {
|
522 | {
|
| 594 | function getFeatures () |
523 | features.push("<?php echo _('Gamepad'); ?>");
|
| 595 | {
|
524 | } |
| - | 525 | ||
| 596 | var features = []; |
526 | if (navigator.geolocation) |
| - | 527 | {
|
|
| 597 | if (navigator.cookieEnabled) features.push("<?php echo _('Cookies'); ?>");
|
528 | features.push("<?php echo _('Geolocation'); ?>");
|
| 598 | if (fullscreen.isSupportedBy(document.documentElement)) features.push("<?php echo _('Fullscreen'); ?>");
|
529 | } |
| - | 530 | ||
| 599 | if (navigator.webkitGetGamepads && navigator.webkitGetGamepads().length) features.push("<?php echo _('Gamepad'); ?>");
|
531 | if (typeof navigator.javaEnabled != "undefined" && navigator.javaEnabled()) |
| - | 532 | {
|
|
| 600 | if (navigator.geolocation) features.push("<?php echo _('Geolocation'); ?>");
|
533 | features.push("Java");
|
| 601 | if (typeof navigator.javaEnabled != "undefined" && navigator.javaEnabled()) features.push("Java");
|
534 | } |
| - | 535 | ||
| 602 | var storage = jsx.dom.storage; |
536 | var storage = jsx.dom.storage; |
| 603 | if (storage.localStorage.isSupported()) features.push("Local Storage");
|
537 | if (storage.localStorage.isSupported()) features.push("Local Storage");
|
| - | 538 | ||
| - | 539 | if (navigator.plugins) |
|
| - | 540 | {
|
|
| 604 | if (navigator.plugins) features.push("Plugins");
|
541 | if (navigator.plugins.length > 0) |
| - | 542 | {
|
|
| - | 543 | features.push('<span title="'
|
|
| - | 544 | + navigator.plugins.length |
|
| - | 545 | + ' plugins installed">Plugins<\/span>'); |
|
| - | 546 | } |
|
| - | 547 | else |
|
| - | 548 | {
|
|
| - | 549 | features.push('<span class="unavailable" title="Plugins supported, but none detected">Plugins<\/span>');
|
|
| - | 550 | } |
|
| - | 551 | } |
|
| - | 552 | ||
| 605 | if (storage.sessionStorage.isSupported()) features.push("Session Storage");
|
553 | if (storage.sessionStorage.isSupported()) |
| - | 554 | {
|
|
| - | 555 | features.push("Session Storage");
|
|
| - | 556 | } |
|
| - | 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 | };
|