Subversion Repositories LCARS

Compare Revisions

Last modification

Ignore whitespace Rev 227 → Rev 226

/trunk/application/scripts/klingon.js
File deleted
/trunk/application/scripts/vulcan-media-script.js
38,16 → 38,23
NG: "ρ",
NN: "þ",
SS: "β",
TCH: "M"
TCH: "M",
", ": " - ",
":": " – ",
" – ": " – ",
" — ": " – ",
"…": "—",
"~": "=",
"!": "..",
"!!!": "...",
"(": "|",
")": "|",
"[": "||",
"]": "||",
"&": "•",
"°": "¯"
};
 
var rxVulcan = jsx.object.getKeys(media_map);
rxVulcan.sort(function (a, b) { return b.length - a.length; });
rxVulcan = new RegExp(
rxVulcan.filter(function (e) { return e.length > 1; }).join("|")
+ "|[" + rxVulcan.filter(function (e) { return e.length === 1; }). join("") + "]",
"ig");
 
//jsx.object.flip = function (obj) {
// var flipped = jsx.object.inheritFrom(obj);
// var keys = jsx.object.getKeys(obj);
67,8 → 74,6
 
var media_caption;
 
var media_script_used = false;
 
function mediaScript (button)
{
vulcan_texts = jsx.dom.xpath.evaluate(
108,9 → 113,9
if (text_node.parentNode.lang != LANG_VULCAN)
{
text_node.nodeValue = text_node.nodeValue.replace(
rxVulcan,
/Tch|Ch|Sh|Th|Kh|Zh|Ts|Dzh|Ks|Ll|Ng|Nn|Ss| [–—] |, |!!!|[!STPKRLADOEVUHGINZMYFWBJX:()[\]&°…~]/gi,
function (s) {
return jsx.object.getProperty(media_map, s.replace(/\s+/g, " ").toUpperCase(), s);
return jsx.object.getProperty(media_map, s.toUpperCase(), s);
});
}
}
122,9 → 127,10
{
media_caption = button.firstChild.textContent;
button.firstChild.textContent = "Latin-Zukitan";
button.onclick = function () {
latinScript(this);
};
}
 
media_script_used = true;
}
 
function latinScript (button)
139,6 → 145,7
}
 
button.firstChild.textContent = media_caption;
 
media_script_used = false;
button.onclick = function () {
mediaScript(this);
};
}