This repository was archived by the owner on Aug 24, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 77
Expand file tree
/
Copy pathtest120.html
More file actions
85 lines (80 loc) · 3.21 KB
/
test120.html
File metadata and controls
85 lines (80 loc) · 3.21 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html lang="en">
<head>
<title>Hyphenator.js – Test 120</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%;
}
h2 + p {
background-color: #ffd6d6;
}
h2 + p + p {
background-color: #d6ffd6;
}
</style>
<script src="../Hyphenator.js" type="text/javascript"></script>
<script type="text/javascript">
if (parent != window) {
Hyphenator.config({
'onhyphenationdonecallback': function () {
var i, last = 4, t1, t2, r = true,
desc = document.getElementById('desc').firstChild.data,
msg = {
desc: desc,
index: 120
};
for (i = 1; i <= last; i++) {
t1 = document.getElementById('test' + i).innerText;
t2 = document.getElementById('ref' + i).innerText;
r = r && (t1 == t2);
}
if (r) {
msg.result = 'passed';
} else {
msg.result = 'failed';
}
parent.postMessage(JSON.stringify(msg), window.location.href);
}
});
}
Hyphenator.config({
hyphenchar: '|',
safecopy: false,
selectorfunction: function () {
var classNames = ["text", "content", "blocktext"],
elements2hyphenate = [];
classNames.forEach(function (c) {
var elementsOfClass = document.getElementsByClassName(c);
Array.prototype.forEach.call(elementsOfClass, function (e) {
elements2hyphenate.push(e);
});
});
return elements2hyphenate;
}
});
Hyphenator.run();
</script>
</head>
<body>
<p><a href="index.html"><<- index</a> | <a href="test119.html"><- Prev</a> | <a href="test121.html">Next -></a></p>
<h1>Test 120</h1>
<p id="desc">Use multiple class names</p>
<h2>Class "text"</h2>
<p id="test1" class="text">Hyphenation</p>
<p id="ref1">Hy|phen|ation</p>
<h2>Class "content"</h2>
<p id="test2" class="content">Hyphenation</p>
<p id="ref2">Hy|phen|ation</p>
<h2>Class "blocktext"</h2>
<p id="test3" class="blocktext">Hyphenation</p>
<p id="ref3">Hy|phen|ation</p>
<h2>Nested classes</h2>
<p id="test4" class="content">Hyphenation <span class="text">Example</span></p>
<p id="ref4">Hy|phen|ation <span>Ex|am|ple</span></p>
</body>
</html>