Rev 227 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
| Rev 227 | Rev 228 | ||
|---|---|---|---|
| Line 63... | Line 63... | ||
| 63 | // }
|
63 | // }
|
| 64 | //
|
64 | //
|
| 65 | // return flipped;
|
65 | // return flipped;
|
| 66 | //};
|
66 | //};
|
| 67 | 67 | ||
| 68 | var media_caption; |
- | |
| 69 | - | ||
| 70 | var media_script_used = false; |
68 | var media_script_used = false; |
| 71 | 69 | ||
| 72 | function mediaScript (button) |
70 | function mediaScript (button) |
| 73 | {
|
71 | {
|
| 74 | vulcan_texts = jsx.dom.xpath.evaluate( |
72 | vulcan_texts = jsx.dom.xpath.evaluate( |
| - | 73 | './/*[@class = "text" and (@lang = "' + LANG_VULCAN |
|
| 75 | './/*[@lang = "' + LANG_VULCAN + '"]//*[(not(@lang) or (@lang = "' + LANG_VULCAN + '")) and (@class = "text")]', |
74 | + '" or parent::*[@lang = "' + LANG_VULCAN + '"])]', |
| 76 | document.body); |
75 | document.body); |
| 77 | 76 | ||
| 78 | if (!vulcan_texts) |
77 | if (!vulcan_texts) |
| 79 | {
|
78 | {
|
| 80 | return; |
79 | return; |
| 81 | }
|
80 | }
|
| 82 | 81 | ||
| 83 | var previous_parent = null; |
- | |
| 84 | - | ||
| 85 | for (var i = 0, len = vulcan_texts.length; i < len; ++i) |
82 | for (var i = 0, len = vulcan_texts.length; i < len; ++i) |
| 86 | {
|
83 | {
|
| 87 | var text = vulcan_texts[i]; |
84 | var text = vulcan_texts[i]; |
| 88 | 85 | ||
| 89 | text.style.textTransform = "none"; |
86 | text.style.textTransform = "none"; |
| Line 103... | Line 100... | ||
| 103 | 100 | ||
| 104 | for (var j = 0, len2 = text_nodes.length; j < len2; ++j) |
101 | for (var j = 0, len2 = text_nodes.length; j < len2; ++j) |
| 105 | {
|
102 | {
|
| 106 | var text_node = text_nodes[j]; |
103 | var text_node = text_nodes[j]; |
| 107 | 104 | ||
| 108 | if (text_node.parentNode.lang != LANG_VULCAN) |
- | |
| 109 | {
|
- | |
| 110 | text_node.nodeValue = text_node.nodeValue.replace( |
105 | text_node.nodeValue = text_node.nodeValue.replace( |
| 111 | rxVulcan,
|
106 | rxVulcan,
|
| 112 | function (s) { |
107 | function (s) { |
| 113 | return jsx.object.getProperty(media_map, s.replace(/\s+/g, " ").toUpperCase(), s); |
108 | return jsx.object.getProperty(media_map, s.replace(/\s+/g, " ").toUpperCase(), s); |
| 114 | }); |
109 | }); |
| 115 | }
|
- | |
| 116 | }
|
110 | }
|
| 117 | 111 | ||
| 118 | text.parentNode.lang = "vuh-Media-Gol-modern"; |
112 | text.parentNode.lang = "vuh-Media-Gol-modern"; |
| 119 | }
|
113 | }
|
| 120 | 114 | ||
| 121 | if (button) |
115 | if (button && lcars.language == LANG_VULCAN) |
| 122 | {
|
116 | {
|
| 123 | media_caption = button.firstChild.textContent; |
117 | button.setAttribute("data-caption", button.firstChild.textContent); |
| 124 | button.firstChild.textContent = "Latin-Zukitan"; |
118 | button.firstChild.textContent = "Latin-Zukitan"; |
| 125 | }
|
119 | }
|
| 126 | 120 | ||
| 127 | media_script_used = true; |
121 | media_script_used = true; |
| 128 | }
|
122 | }
|
| Line 136... | Line 130... | ||
| 136 | text.style.textTransform = ""; |
130 | text.style.textTransform = ""; |
| 137 | text.innerHTML = text.getAttribute('data-html'); |
131 | text.innerHTML = text.getAttribute('data-html'); |
| 138 | text.parentNode.lang = "vuh-Latn-Gol-modern"; |
132 | text.parentNode.lang = "vuh-Latn-Gol-modern"; |
| 139 | }
|
133 | }
|
| 140 | 134 | ||
| - | 135 | if (lcars.language == LANG_VULCAN) |
|
| - | 136 | {
|
|
| 141 | button.firstChild.textContent = media_caption; |
137 | button.firstChild.textContent = button.getAttribute("data-caption"); |
| - | 138 | }
|
|
| 142 | 139 | ||
| 143 | media_script_used = false; |
140 | media_script_used = false; |
| 144 | }
|
141 | }
|