Subversion Repositories LCARS

Compare Revisions

Last modification

Regard whitespace Rev 234 → Rev 263

/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;
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;
if (html.lang == LANG_KLINGON_PIQAD)
{
html.lang = html.getAttribute("data-lang");
html.removeAttribute("data-lang");
}
}