test23.html 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  5. <title>Test 023</title>
  6. <script>
  7. var reloaded = !!sessionStorage.getItem("Hyphenopoly_Loader");
  8. var Hyphenopoly = {
  9. cacheFeatureTests: true,
  10. require: {
  11. "fur": "probabilmentri"
  12. },
  13. setup: {
  14. selectors: {
  15. ".hyphenate": {
  16. hyphen: "|",
  17. minWordLength: 4
  18. }
  19. }
  20. },
  21. handleEvent: {
  22. hyphenopolyEnd: function (e) {
  23. if (!reloaded) {
  24. reloaded = true;
  25. window.location.reload();
  26. } else {
  27. assert();
  28. sessionStorage.clear();
  29. }
  30. }
  31. }
  32. };
  33. function assert() {
  34. var tests = 1;
  35. var i = 1;
  36. var test = "";
  37. var ref = "";
  38. var result = false;
  39. while (i <= tests) {
  40. test = document.getElementById("test" + i).innerHTML;
  41. ref = document.getElementById("ref" + i).innerHTML;
  42. if (test === ref) {
  43. document.getElementById("result").innerHTML += "<span style=\"background-color: #d6ffd6\">" + (function (i) {
  44. return (i < 10) ? "0" + i : i;
  45. }(i)) + "</span> ";
  46. result = result || true;
  47. } else {
  48. document.getElementById("result").innerHTML += "<span style=\"background-color: #ffd6d6\">" + i + "</span> ";
  49. result = result || false;
  50. }
  51. i += 1;
  52. }
  53. if (parent != window) {
  54. parent.postMessage(JSON.stringify({
  55. desc: document.getElementById("desc").innerHTML,
  56. index: 23,
  57. result: (result ? "passed" : "failed")
  58. }), window.location.href);
  59. }
  60. }
  61. </script>
  62. <script src="../Hyphenopoly_Loader.js"></script>
  63. <style type="text/css">
  64. body {
  65. width:50%;
  66. margin-left:25%;
  67. margin-right:25%;
  68. }
  69. .test {
  70. background-color: #D8E2F9;
  71. hyphens: auto;
  72. }
  73. .ref {
  74. background-color: #FEEFC0;
  75. }
  76. </style>
  77. </head>
  78. <body>
  79. <div id="navigate"><a href="index.html">&Larr;&nbsp;Index</a>&nbsp;|&nbsp;<a href="test22.html">&larr;&nbsp;Prev</a>&nbsp;|&nbsp;<a href="test24.html">Next&nbsp;&rarr;</a></div>
  80. <h1>Test 023</h1>
  81. <p id="desc">Hyphenate Furlan (not native in current UAs) and use sessionStorage for clientFeatures.</p>
  82. <div id="result"></div>
  83. <hr>
  84. <h2>fur</h2>
  85. <p id="test1" lang="fur" class="test hyphenate">Il furlan e je une lenghe romanze de famee des lenghis retichis, che e je fevelade soredut intal Friûl, ma ancje vie pal mont. Cualchi volte al ven clamât Ladin orientâl, parcè che al à diviers ponts in comun cul ladin, ma si è svilupât in un altri mût cul passâ dal timp, sot de influence des lenghis ator dal Friûl</p>
  86. <p id="ref1" lang="fur" class="ref">Il fur|lan e je une len|ghe ro|man|ze de fa|mee des len|ghis re|ti|chis, che e je fe|ve|la|de so|re|dut in|tal Friûl, ma an|cje vie pal mont. Cual|chi vol|te al ven clamât La|din orientâl, parcè che al à di|viers ponts in co|mun cul la|din, ma si è svi|lupât in un al|tri mût cul pa|ssâ dal timp, sot de in|fluen|ce des len|ghis ator dal Friûl</p>
  87. <hr>
  88. <div><span class="test">Test</span> <span class="ref">Ref</span></div>
  89. </body>
  90. </html>