/* http://unicode.org/charts/collation/chart_Latin.html */ $(function() { var $body = $("body"), latin = []; $.each("ABCDEFGHIJKLMNOPQRSTUVWXYZ", function(i, v) { latin.push(v); }); $.each(["AE", "DZ", "NJ", "OE", "SZ"], function(i, v) { latin.push(v); }); var unicode = {}; $.each(latin, function(i, v) { unicode[v] = []; }); $.each(latin, function(i, v) { unicode[v.toLowerCase()] = []; }); $.get("chart_Latin.html", function(data) { data = "" + data.split("
")[1].split("
")[0] + ""; $("body").append(data); $("td").each(function() { var $this = $(this); var title = $this.attr('title').split(":")[0].replace("SHARP S", "SZ"); var words = title.split(" "); if (title.substr(-2, 1) != " " && words[0] == "LATIN" && $.inArray(words[1], ["CAPITAL", "SMALL"]) > -1 && $.inArray(words[2], ["LETTER", "LIGATURE"]) > -1 && $.inArray(words[3], latin) > -1) { var character = words[1] == "CAPITAL" ? words[3] : words[3].toLowerCase(); unicode[character].push({ character: "\\u" + $(this).children().eq(1).html(), comment: title.replace("SZ", "SHARP S") }); } }); $body.empty(); $.each(unicode, function(k, v) { unicode[k].sort(function(a, b) { a = a.character.substr(2); b = b.character.substr(2); return (a < b) * -1 + (a > b); }); }); $div = $("
") .css({ fontFamily: "Consolas", fontSize: "12px" }) .html( $.map(Ox.keys(unicode), function(v) { return v + ": [
" + Ox.repeat(" ", 4) + $.map(unicode[v], function(v_, i) { return '"' + v_.character + '"' + (i < unicode[v].length - 1 ? "," : " ") + " // " + v_.comment; }).join("
" + Ox.repeat(" ", 4)); }).join("
],
") + "
]" ) .appendTo($body); /* $.each(unicode, function(k, v) { $div.append(k + ": [
"); var length = v.length; $.each(v, function(i, v_) { $div.append("    \"" + v_.character + "\"" + (i < v.length - 1 ? "," : " ") + " // " + v_.comment + "
") }); $div.append("]" + (k != 'sz' ? "," : "") + "
"); }); */ $div = $("
").css({ fontFamily: "Lucida Grande", fontSize: "24px" }).appendTo($body); $.each(unicode, function(k, v) { $div.append(k + ": "); $.each(v, function(i, v_) { console.log(v_) $div.append("&#x" + v_.character.substr(2) + ";"); }); $div.append("
"); }); }); });