forked from 0x2620/oxjs
init
This commit is contained in:
commit
5b8b31271c
87 changed files with 73788 additions and 0 deletions
34740
tools/unicode2/NamesList.txt
Normal file
34740
tools/unicode2/NamesList.txt
Normal file
File diff suppressed because it is too large
Load diff
16
tools/unicode2/index.html
Normal file
16
tools/unicode2/index.html
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
<html>
|
||||
<head>
|
||||
<title>Oxjs Tools - Unicode</title>
|
||||
<meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
|
||||
<style>
|
||||
body {
|
||||
font-family: Consolas;
|
||||
font-size: 12px;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript" src="../../build/js/jquery-1.3.2.js"></script>
|
||||
<script type="text/javascript" src="../../build/js/ox.js"></script>
|
||||
<script type="text/javascript" src="unicode.js"></script>
|
||||
</head>
|
||||
<body></body>
|
||||
</html>
|
||||
38
tools/unicode2/unicode.js
Normal file
38
tools/unicode2/unicode.js
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
getNames();
|
||||
|
||||
function getNames() {
|
||||
var //url = "http://unicode.org/Public/UNIDATA/NamesList.txt",
|
||||
url = "NamesList.txt";
|
||||
$.get(url, function(data) {
|
||||
data = data.replace(/<control>\n\t=/g, "<control>");
|
||||
var names = {}, json = "", split = [];
|
||||
$.each(data.replace(/\n/g, "\n\n").match(/\n[0-9A-F]{4}\t.+\n/g), function(i, v) {
|
||||
names["0x" + v.substr(1, 4)] = v.substr(6, v.length - 7);
|
||||
});
|
||||
json = JSON.stringify(names, null, 4)
|
||||
$.each(data.match(/\n@@\t[0-9A-F]{4}\t.+\n/g), function(i, v) {
|
||||
split = v.split("\t");
|
||||
split[1] = "0x" + split[1];
|
||||
xx = 0
|
||||
while (split[1] in names == false && xx < 10) {
|
||||
console.log(split[2],split[1])
|
||||
split[1] = inc(split[1]);
|
||||
xx++;
|
||||
}
|
||||
json = json.replace("\"" + split[1], "// " + split[2] + "\n \"" + split[1])
|
||||
});
|
||||
json = json
|
||||
.replace(/ /g, " ")
|
||||
.replace(/\"0x/g, "0x")
|
||||
.replace(/\":/g, ":")
|
||||
.replace(/</g, "<")
|
||||
.replace(/>/g, ">")
|
||||
.replace(/\n/g, "<br/>");
|
||||
$("body").html(json);
|
||||
});
|
||||
}
|
||||
|
||||
function inc(str) {
|
||||
str = (parseInt(str, 16) + 1).toString(16).toUpperCase();
|
||||
return "0x" + new Array(5 - str.length).join("0") + str;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue