-
-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Enhance documentation (serve minified hyphenopoly in [https://mnate…
…r.github.io/Hyphenopoly/min/](https://mnater.github.io/Hyphenopoly/min/) and move examples to examples directory) (issue #104) * exclude .DS_Store from npm package * bumpDevDependencies Fixes #104
- Loading branch information
Showing
131 changed files
with
5,931 additions
and
741 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
File renamed without changes.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
<!DOCTYPE HTML> | ||
<html> | ||
<head> | ||
<title>Hyphenopoly.js – Testsuite</title> | ||
<meta http-equiv="content-type" content="text/html; charset=UTF-8"> | ||
<style type="text/css"> | ||
body { | ||
width:80%; | ||
margin-left:10%; | ||
margin-right:10%; | ||
font: normal 11px Verdana; | ||
line-height: 18px; | ||
} | ||
#template { | ||
display: none; | ||
} | ||
#testframe { | ||
visibility: hidden; | ||
} | ||
.passed { | ||
color: green; | ||
background-color: lime; | ||
} | ||
.failed { | ||
color: maroon; | ||
background-color: red; | ||
} | ||
.obsolete { | ||
color: black; | ||
background-color: silver; | ||
} | ||
.visual { | ||
color: olive; | ||
background-color: yellow; | ||
} | ||
.omitted { | ||
color: grey; | ||
background-color: black; | ||
} | ||
.testname { | ||
display: inline-block; | ||
width: 6em; | ||
} | ||
.result { | ||
display: inline-block; | ||
width: 5em; | ||
} | ||
ul { | ||
list-style-type: none; | ||
padding-left: 0px; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<h1>The Hyphenopoly Testsuite</h1> | ||
<ul id="template"> | ||
<li> | ||
<span class="testname"><a href="@file@">@file@</a></span> | ||
<span class="result @result@">[@result@]</span> | ||
<span class="desc">@desc@</span> | ||
</li> | ||
</ul> | ||
<ul id="testresults"> | ||
</ul> | ||
<iframe id="testframe" src=""></iframe> | ||
<script src="testdriver.js"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,93 @@ | ||
<!DOCTYPE html> | ||
<html> | ||
<head> | ||
<meta http-equiv="content-type" content="text/html; charset=UTF-8"> | ||
<title>Test 001</title> | ||
<script> | ||
var Hyphenopoly = { | ||
require: { | ||
"en-us": "supercalifragilisticexpialidocious", | ||
"hy": "ձայնավորձայնավոր" | ||
}, | ||
handleEvent: { | ||
hyphenopolyEnd: function (e) { | ||
assert(); | ||
} | ||
} | ||
}; | ||
function assert() { | ||
var tests = 2; | ||
var i = 1; | ||
var test = ""; | ||
var ref = ""; | ||
var result = true; | ||
var lang = ""; | ||
while (i <= tests) { | ||
lang = document.getElementById("test" + i).lang; | ||
if (Hyphenopoly.cf.langs[lang] === "CSS") { | ||
document.getElementById("result").innerHTML += "<p style=\"background-color: #d6ffd6\">" + i + " passed (CSS)</p>"; | ||
result = result && true; | ||
} else { | ||
test = document.getElementById("test" + i).innerHTML; | ||
ref = document.getElementById("ref" + i).innerHTML; | ||
if (test === ref) { | ||
document.getElementById("result").innerHTML += "<p style=\"background-color: #d6ffd6\">" + i + " passed</p>"; | ||
result = result && true; | ||
} else { | ||
document.getElementById("result").innerHTML += "<p style=\"background-color: #ffd6d6\">" + i + " failed</p>"; | ||
result = false; | ||
} | ||
} | ||
i += 1; | ||
} | ||
if (parent != window) { | ||
parent.postMessage(JSON.stringify({ | ||
desc: document.getElementById("desc").innerHTML, | ||
index: 1, | ||
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="index.html">← Prev</a> | <a href="test2.html">Next →</a></div> | ||
|
||
<h1>Test 001</h1> | ||
<p id="desc">Hyphenate two texts – en-us (where CSS-hyphenation is mostly supported) and hy (where CSS-hyphenation is unsupported).</p> | ||
<div id="result"></div> | ||
<hr> | ||
<h2>1: en-us</h2> | ||
<p id="test1" class="test hyphenate" lang="en-us">A hyphenation algorithm is a set of rules that decides at which points a word can be broken over two lines with a hyphen.</p> | ||
<p id="ref1" class="ref" lang="en-us">A hy­phen­ation al­go­rithm is a set of rules that de­cides at which points a word can be bro­ken over two lines with a hy­phen.</p> | ||
|
||
<h2>2: hy (Armenian)</h2> | ||
<p id="test2" class="test hyphenate" lang="hy">Հայերենն ունի վեց ձայնավոր, մեկ կիսաձայն և երեսուն բաղաձայն հնչյուններ</p> | ||
<p id="ref2" class="ref" lang="hy">Հա­յե­րենն ունի վեց ձայնա­վոր, մեկ կի­սա­ձայն և ե­րե­սուն բա­ղա­ձայն հնչյուններ</p> | ||
<hr> | ||
<div><span class="test">Test</span> <span class="ref">Ref</span></div> | ||
|
||
</body> | ||
</html> |
Oops, something went wrong.