85 lines
2.9 KiB
HTML
85 lines
2.9 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
|
|
<title>Test 016</title>
|
|
<script>
|
|
var Hyphenopoly = {
|
|
require: {
|
|
"en-us": "FORCEHYPHENOPOLY"
|
|
},
|
|
setup: {
|
|
selectors: {
|
|
".hyphenate": {
|
|
hyphen: "•"
|
|
}
|
|
}
|
|
},
|
|
handleEvent: {
|
|
myFantasyEvent: function (e) {
|
|
console.log(e);
|
|
},
|
|
error: function (e) {
|
|
e.preventDefault();
|
|
assert(e);
|
|
}
|
|
}
|
|
};
|
|
|
|
function assert(e) {
|
|
var test = "unknown Event \"myFantasyEvent\" discarded";
|
|
var ref = e.msg;
|
|
var result = false;
|
|
if (test === ref) {
|
|
document.getElementById("result").innerHTML += "<span style=\"background-color: #d6ffd6\">passed</span> ";
|
|
result = result || true;
|
|
} else {
|
|
document.getElementById("result").innerHTML += "<span style=\"background-color: #ffd6d6\">failed</span> ";
|
|
result = result || false;
|
|
}
|
|
if (parent != window) {
|
|
parent.postMessage(JSON.stringify({
|
|
desc: document.getElementById("desc").innerHTML,
|
|
index: 16,
|
|
result: (result ? "passed" : "failed")
|
|
}), window.location.href);
|
|
}
|
|
}
|
|
</script>
|
|
<script src="../Hyphenopoly_Loader.js"></script>
|
|
<style type="text/css">
|
|
body {
|
|
width:50%;
|
|
margin-left:25%;
|
|
margin-right:25%;
|
|
}
|
|
|
|
.test {
|
|
background-color: #D8E2F9;
|
|
}
|
|
.ref {
|
|
background-color: #FEEFC0;
|
|
}
|
|
|
|
.hyphenate {
|
|
hyphens: auto;
|
|
-ms-hyphens: auto;
|
|
-moz-hyphens: auto;
|
|
-webkit-hyphens: auto;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<div id="navigate"><a href="index.html">↞ Index</a> | <a href="test15.html">← Prev</a> | <a href="test17.html">Next →</a></div>
|
|
|
|
<h1>Test 016</h1>
|
|
<p id="desc">Discard unknown Events</p>
|
|
<div id="result"></div>
|
|
<hr>
|
|
<p id="test1" class="test hyphenate" lang="en-us">unknown Event "myFantasyEvent" discarded</p>
|
|
<p id="ref1" class="ref" lang="en">unknown Event "myFantasyEvent" discarded</p>
|
|
<hr>
|
|
<div><span class="test">Test</span> <span class="ref">Ref</span></div>
|
|
|
|
</body>
|
|
</html> |