mirror of
https://github.com/quiple/galmuri.git
synced 2024-10-26 22:30:12 +03:00
12 lines
627 B
JavaScript
12 lines
627 B
JavaScript
onmessage = function (text) {
|
|
var glphsCnt = text.data.match(/CHARS .*/g)[0].split(' ');
|
|
var glphsArr = text.data.match(/STARTCHAR U\+.*/g);
|
|
var first = String.fromCodePoint(parseInt(glphsArr[0].split('+')[1], 16));
|
|
if (first == ' ') var first = ' ';
|
|
var glphs = '<a class="item" title="' + glphsArr[0].split(' ')[1] + '" onclick="copyGlyph(this)">' + first + '</a>';
|
|
for (let i = 1; i < glphsCnt[1]; i++) {
|
|
glphs += '<a class="item" title="' + glphsArr[i].split(' ')[1] + '" onclick="copyGlyph(this)">' + String.fromCodePoint(parseInt(glphsArr[i].split('+')[1], 16)) + '</a>';
|
|
}
|
|
postMessage(glphs);
|
|
}
|