test19.html 3.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  5. <title>Test 019</title>
  6. <script>
  7. var Hyphenopoly = {
  8. require: {
  9. "la": "FORCEHYPHENOPOLY"
  10. },
  11. setup: {
  12. selectors: {
  13. ".hyphenate": {
  14. hyphen: "•"
  15. }
  16. }
  17. },
  18. handleEvent: {
  19. hyphenopolyEnd: function (e) {
  20. assert();
  21. }
  22. }
  23. };
  24. function assert() {
  25. var tests = 1;
  26. var i = 1;
  27. var test = "";
  28. var ref = "";
  29. var result = false;
  30. while (i <= tests) {
  31. test = document.getElementById("test" + i).innerHTML;
  32. ref = document.getElementById("ref" + i).innerHTML;
  33. if (test === ref) {
  34. document.getElementById("result").innerHTML += "<p style=\"background-color: #d6ffd6\">" + i + " passed</p>";
  35. result = result || true;
  36. } else {
  37. document.getElementById("result").innerHTML += "<p style=\"background-color: #ffd6d6\">" + i + " failed</p>";
  38. result = result || false;
  39. }
  40. i += 1;
  41. }
  42. if (parent != window) {
  43. parent.postMessage(JSON.stringify({
  44. desc: document.getElementById("desc").innerHTML,
  45. index: 19,
  46. result: (result ? "passed" : "failed")
  47. }), window.location.href);
  48. }
  49. }
  50. </script>
  51. <script src="../Hyphenopoly_Loader.js"></script>
  52. <style type="text/css">
  53. body {
  54. width:50%;
  55. margin-left:25%;
  56. margin-right:25%;
  57. }
  58. .test {
  59. background-color: #D8E2F9;
  60. }
  61. .ref {
  62. background-color: #FEEFC0;
  63. }
  64. .hyphenate {
  65. hyphens: auto;
  66. -ms-hyphens: auto;
  67. -moz-hyphens: auto;
  68. -webkit-hyphens: auto;
  69. }
  70. </style>
  71. </head>
  72. <body>
  73. <div id="navigate"><a href="index.html">&Larr;&nbsp;Index</a>&nbsp;|&nbsp;<a href="test18.html">&larr;&nbsp;Prev</a>&nbsp;|&nbsp;<a href="test20.html">Next&nbsp;&rarr;</a></div>
  74. <h1>Test 019</h1>
  75. <p id="desc">Check latin (letter "v" is not in classic alphabet)</p>
  76. <div id="result"></div>
  77. <hr>
  78. <p id="test1" class="test hyphenate" lang="la">Qua de causa Helvetii quoque reliquos Gallos virtute praecedunt, quod fere cotidianis proeliis cum Germanis contendunt, cum aut suis finibus eos prohibent aut ipsi in eorum finibus bellum gerunt.</p>
  79. <p id="ref1" class="ref" lang="la">Qua de causa Helvetii quo•que re•li•quos Gal•los virtute prae•ce•dunt, quod fere co•ti•dia•nis proe•li•is cum Ger•ma•nis con•ten•dunt, cum aut suis fi•ni•bus eos pro•hi•bent aut ipsi in eorum fi•ni•bus bel•lum ge•runt.</p>
  80. <hr>
  81. <div><span class="test">Test</span> <span class="ref">Ref</span></div>
  82. </body>
  83. </html>