74 lines
		
	
	
		
			2.5 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
			
		
		
	
	
			74 lines
		
	
	
		
			2.5 KiB
		
	
	
	
		
			HTML
		
	
	
	
	
	
| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
 | |
|     "http://www.w3.org/TR/html4/strict.dtd">
 | |
| <html lang="de">
 | |
|     <head>
 | |
|         <title>Hyphenator.js – Test 56</title>
 | |
|         <meta http-equiv="content-type" content="text/html; charset=UTF-8">
 | |
|         <style type="text/css">
 | |
|             body {
 | |
|                 width:50%;
 | |
|                 margin-left:25%;
 | |
|                 margin-right:25%;
 | |
|             }
 | |
|             #test {
 | |
|             	background-color: #ffd6d6;
 | |
|             }
 | |
|             #ref {
 | |
|             	background-color: #d6ffd6;
 | |
|             }
 | |
|             div {
 | |
|                 text-align:justify;
 | |
|             }
 | |
|         </style>
 | |
|         <script type="text/javascript">
 | |
|         	//do nothing
 | |
|         </script>
 | |
|         <script src="files/jquery.js" type="text/javascript"></script>
 | |
|         <script src="../Hyphenator.js" type="text/javascript"></script>
 | |
|         <script src="../patterns/de.js" type="text/javascript"></script>
 | |
|         <script src="../patterns/en-us.js" type="text/javascript"></script>
 | |
|         <script type="text/javascript">
 | |
|         	if (window != parent) {
 | |
| 				Hyphenator.config({
 | |
| 					'onhyphenationdonecallback': function () {
 | |
| 						document.getElementById('btn').onclick();
 | |
| 					}
 | |
| 				});     	
 | |
|         	}
 | |
|         	Hyphenator.config({
 | |
|         		hyphenchar:'|'
 | |
|         	});
 | |
|         	Hyphenator.run();
 | |
|             
 | |
|             function insert()  {
 | |
|  			    $("#test").load("files/test44inc.html", cb);
 | |
| 			}
 | |
| 			function cb () {
 | |
| 				Hyphenator.hyphenate($("#test").get(0), 'de');
 | |
| 				if (window != parent) {
 | |
| 					var msg = {
 | |
| 						desc: document.getElementById('desc').innerHTML,
 | |
| 						index: 56
 | |
| 						};
 | |
| 					if ($('#test').get(0).innerHTML === $('#ref').get(0).innerHTML) {
 | |
| 						msg.result = 'passed';
 | |
| 					} else {
 | |
| 						msg.result = 'failed';
 | |
| 					}
 | |
| 					parent.postMessage(JSON.stringify(msg), window.location.href);
 | |
| 				}
 | |
| 			}
 | |
|         </script>
 | |
|     </head>
 | |
|     <body>
 | |
| 		<p><a href="index.html"><<- index</a> | <a href="test55.html"><- Prev</a> | <a href="test57.html">Next -></a></p>
 | |
|         <h1>Test 56</h1>
 | |
|         <p id="desc">Hyphenating content that has been loaded by AJAX with Hyphenator.hyphenate().</p>
 | |
| 		<form method="post" action="#">
 | |
| 			<p><input id="btn" type="button" value="load text…" onclick="insert()"></p>
 | |
| 		</form>
 | |
| 		<p class="hyphenate">Silbentrennung</p>
 | |
|         <p id="test"></p>
 | |
|         <p id="ref">Das eng|li|sche Wort <span lang="en">“Hy|phen|ation”</span> lässt sich nicht un|be|dingt wört|lich mit «Sil|ben|tren|nung» über|set|zen.</p>
 | |
|     </body>
 | |
| </html> |