Subversion Repositories LCARS

Compare Revisions

Last modification

Ignore whitespace Rev 234 → Rev 235

/trunk/application/scripts/vulcan-media-script.js
15,7 → 15,7
U: "¶",
H: "ξ",
G: "^",
Ch: ")",
CH: ")",
I: "ƒ",
N: "(",
Z: "ε",
30,15 → 30,13
ZH: "ω",
TS: "θ",
DZH: "C",
J: "C",
KS: "φ",
X: "φ",
LL: "μ",
M: "&",
NG: "ρ",
NN: "þ",
SS: "β",
TCH: "M"
// LL: "μ",
// M: "&",
// NG: "ρ",
// NN: "þ",
// SS: "β",
// TCH: "M"
};
 
var rxVulcan = jsx.object.getKeys(media_map);
48,24 → 46,16
+ "|[" + 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);
//
// for (var i = 0, len = keys.length; i < len; ++i)
// {
// var key = keys[i];
// var value = obj[key];
// if (typeof value != "function")
// {
// flipped[value] = key;
// }
// }
//
// return flipped;
//};
function mediaTranscribe (s)
{
return s.toUpperCase().replace(
rxVulcan,
function (s) {
return jsx.object.getProperty(media_map, s.replace(/\s+/g, " "), s);
});
}
 
var media_script_used = false;
var LANG_VULCAN_MEDIA = "vuh-Media-Gol-modern";
 
function mediaScript (button)
{
79,6 → 69,13
return;
}
 
if (document.documentElement.lang == LANG_VULCAN)
{
var title = document.getElementsByTagName("title")[0];
title.setAttribute("data-text", document.title);
document.title = mediaTranscribe(document.title);
}
 
for (var i = 0, len = vulcan_texts.length; i < len; ++i)
{
var text = vulcan_texts[i];
92,6 → 89,11
{
text.title = text.textContent;
}
else
{
text.setAttribute("data-title", text.title);
text.title = mediaTranscribe(text.title);
}
}
 
var text_nodes = jsx.dom.xpath.evaluate(
102,40 → 104,66
{
var text_node = text_nodes[j];
 
text_node.nodeValue = text_node.nodeValue.replace(
rxVulcan,
function (s) {
return jsx.object.getProperty(media_map, s.replace(/\s+/g, " ").toUpperCase(), s);
});
text_node.nodeValue = mediaTranscribe(text_node.nodeValue);
}
 
text.parentNode.lang = "vuh-Media-Gol-modern";
if (text.lang == LANG_VULCAN)
{
text.lang = LANG_VULCAN_MEDIA;
}
else if (text.parentNode.lang == LANG_VULCAN)
{
text.parentNode.lang = LANG_VULCAN_MEDIA;
}
}
 
if (button && lcars.language == LANG_VULCAN)
if (button)
{
button.setAttribute("data-caption", button.firstChild.textContent);
button.firstChild.textContent = "Latin-Zukitan";
button.firstChild.lang = LANG_VULCAN;
}
 
media_script_used = true;
var html = document.documentElement;
if (html.lang == LANG_VULCAN)
{
html.lang = LANG_VULCAN_MEDIA;
}
}
 
function latinScript (button)
{
var title = document.getElementsByTagName("title")[0];
if (document.documentElement.lang == LANG_VULCAN_MEDIA)
{
document.title = title.getAttribute("data-text");
title.removeAttribute("data-text")
}
 
for (var i = 0, len = vulcan_texts.length; i < len; ++i)
{
var text = vulcan_texts[i];
 
text.style.textTransform = "";
text.innerHTML = text.getAttribute('data-html');
text.parentNode.lang = "vuh-Latn-Gol-modern";
text.innerHTML = text.getAttribute('data-html') || "";
text.title = text.getAttribute("data-title") || "";
 
if (text.lang == LANG_VULCAN_MEDIA)
{
text.lang = LANG_VULCAN;
}
else if (text.parentNode.lang == LANG_VULCAN_MEDIA)
{
text.parentNode.lang = LANG_VULCAN;
}
}
 
if (lcars.language == LANG_VULCAN)
if (button)
{
button.firstChild.textContent = button.getAttribute("data-caption");
button.firstChild.lang = LANG_VULCAN_MEDIA;
}
 
media_script_used = false;
var html = document.documentElement;
if (html.lang == LANG_VULCAN_MEDIA)
{
html.lang = LANG_VULCAN;
}
}
/trunk/application/scripts/klingon.js
13,6 → 13,10
"l": "\uF8D9",
"m": "\uF8DA",
"n": "\uF8DB",
 
/* prevents mistranscription of "n-gh" as "ng-h" (trailing garbage) */
"ngh": "\uF8DB\uF8D5",
 
"ng": "\uF8DC",
"o": "\uF8DD",
"p": "\uF8DE",
51,23 → 55,6
+ "|[" + rxKlingon.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);
//
// for (var i = 0, len = keys.length; i < len; ++i)
// {
// var key = keys[i];
// var value = obj[key];
// if (typeof value != "function")
// {
// flipped[value] = key;
// }
// }
//
// return flipped;
//};
 
function pIqaDize (s)
{
return s.replace(
91,6 → 78,13
return;
}
 
if (document.documentElement.lang == LANG_KLINGON)
{
var title = document.getElementsByTagName("title")[0];
title.setAttribute("data-text", document.title);
document.title = pIqaDize(document.title);
}
 
for (var i = 0, len = klingon_texts.length; i < len; ++i)
{
var text = klingon_texts[i];
120,7 → 114,7
{
text.lang = LANG_KLINGON_PIQAD;
}
else if (text.parentNode.lang == LANG_KLINGON)
else if (text.parentNode && text.parentNode.lang == LANG_KLINGON)
{
text.parentNode.lang = LANG_KLINGON_PIQAD;
}
132,12 → 126,22
}
 
var html = document.documentElement;
html.setAttribute("data-lang", html.lang);
html.lang = LANG_KLINGON_PIQAD;
if (html.lang == LANG_KLINGON)
{
html.setAttribute("data-lang", html.lang);
html.lang = LANG_KLINGON_PIQAD;
}
}
 
function klingonLatinScript (button)
{
var title = document.getElementsByTagName("title")[0];
if (document.documentElement.lang == LANG_KLINGON_PIQAD)
{
document.title = title.getAttribute("data-text");
title.removeAttribute("data-text")
}
 
for (var i = 0, len = klingon_texts.length; i < len; ++i)
{
var text = klingon_texts[i];
149,7 → 153,7
{
text.lang = LANG_KLINGON;
}
else if (text.parentNode.lang == LANG_KLINGON_PIQAD)
else if (text.parentNode && text.parentNode.lang == LANG_KLINGON_PIQAD)
{
text.parentNode.lang = LANG_KLINGON;
}
161,6 → 165,9
}
 
var html = document.documentElement;
html.lang = html.getAttribute("data-lang");
html.removeAttribute("data-lang");
if (html.lang == LANG_KLINGON_PIQAD)
{
html.lang = html.getAttribute("data-lang");
html.removeAttribute("data-lang");
}
}