User:Teb728/editpage specialchars.js
Appearance
Code that you insert on this page could contain malicious content capable of compromising your account. If you import a script from another page with "importScript", "mw.loader.load", "iusc", or "lusc", take note that this causes you to dynamically load a remote script, which could be changed by others. Editors are responsible for all edits and actions they perform, including by scripts. User scripts are not centrally supported and may malfunction or become inoperable due to software changes. A guide to help you find broken scripts is available. If you are unsure whether code you are adding to this page is safe, you can ask at the appropriate village pump. This code will be executed when previewing this page. |
Documentation for this user script can be added at User:Teb728/editpage specialchars. |
// <pre>
function editpage_specialchars_escape(str)
{
return str.replace(/\\/g, "\\\\").replace(/'/g, "\\'");
}
function editpage_specialchars_insert(box, char)
{
box.appendChild(document.createTextNode(" "));
// box.appendChild(document.createTextNode(char.length));
var a = document.createElement("a");
if (char.length == 1) {
a.href = "javascript:insertTags('"
+ editpage_specialchars_escape(char) + "','','')";
a.appendChild(document.createTextNode(char));}
else {
a.href = "javascript:insertTags('"
+ editpage_specialchars_escape(char[0]) + "','"
+ editpage_specialchars_escape(char[1]) + "','"
+ editpage_specialchars_escape(char[2]) + "')";
a.appendChild(document.createTextNode(char[0] + char[1]));}
box.appendChild(a);
}
function editpage_specialchars_group(box, group)
{
box.appendChild(document.createElement("p"));
var box1 = box.lastChild;
box1.className = group[1];
box1.appendChild(document.createTextNode(group[0]));
for (var c = 2; c < group.length; c++)
editpage_specialchars_insert(box1, group[c]);
}
function editpage_specialchars_onload()
{
var box = document.getElementById("editpage-specialchars");
if (box === null)
return;
// Empty the edittools box
while (box.firstChild !== null)
box.removeChild(box.firstChild);
// Insert the new contents
editpage_specialchars_group(box, editpage_specialchars_symbols);
editpage_specialchars_group(box, editpage_specialchars_latin);
editpage_specialchars_group(box, editpage_specialchars_greek);
editpage_specialchars_group(box, editpage_specialchars_ipa);
editpage_specialchars_group(box, editpage_specialchars_cyrilic);
}
$(editpage_specialchars_onload);
editpage_specialchars_latin = [ 'Latin:', 'latinx',
'Á', 'À', 'Â', 'Ä', 'Ã', 'Ǎ', 'Ā', 'Ă', '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', 'ũ', 'ů', 'ǔ', 'ū', 'ǖ', 'ǘ', 'ǚ', 'ǜ', 'ŭ', 'ų', 'ű',
'ŵ', 'ý', 'ŷ', 'ÿ', 'ỹ', 'ȳ', 'ź', 'ž', 'ż',
'ǣ', 'æ', 'œ', 'ø', 'ð', 'þ', 'ə',
['{{latinx|', '}}', '']];
editpage_specialchars_greek= [ 'Greek:', 'polytonic',
'Α', 'Β', 'Γ', 'Δ', 'Ε', 'Ζ', 'Η', 'Θ', 'Ι', 'Κ', 'Λ', 'Μ', 'Ν', 'Ξ', 'Ο', 'Π', 'Ρ', 'Σ', 'Τ', 'Υ', 'Φ', 'Χ', 'Ψ', 'Ω',
'α', 'β', 'γ', 'δ', 'ε', 'ζ', 'η', 'θ', 'ι', 'κ', 'λ', 'μ', 'ν', 'ξ', 'ο', 'π', 'ρ', 'σ', 'ς', 'τ', 'υ', 'φ', 'χ', 'ψ', 'ω',
'Ά', 'Ὰ', 'Ἀ', 'Ἁ', 'Ἄ', 'Ἂ', 'Ἆ', 'Ἅ', 'Ἃ', 'Ἇ', 'ᾈ', 'ᾉ', 'ᾌ', 'ᾊ', 'ᾎ', 'ᾍ', 'ᾋ', 'ᾏ', 'Έ', 'Ὲ', 'Ἐ', 'Ἑ', 'Ἔ', 'Ἒ', 'Ἕ', 'Ἓ', 'Ή', 'Ὴ', 'Ἠ', 'Ἡ', 'Ἤ', 'Ἢ', 'Ἦ', 'Ἥ', 'Ἣ', 'Ἧ', 'ᾘ', 'ᾙ', 'ᾜ', 'ᾚ', 'ᾞ', 'ᾝ', 'ᾛ', 'ᾟ', 'Ί', 'Ὶ', 'Ἰ', 'Ἱ', 'Ἴ', 'Ἲ', 'Ἶ', 'Ἵ', 'Ἳ', 'Ἷ', 'Ό', 'Ὸ', 'Ὀ', 'Ὁ', 'Ὄ', 'Ὂ', 'Ὅ', 'Ὃ', 'Ῥ', 'Ύ', 'Ὺ', 'Ὑ', 'Ὕ', 'Ὓ', 'Ὗ', 'Ώ', 'Ὼ', 'Ὠ', 'Ὡ', 'Ὤ', 'Ὢ', 'Ὦ', 'Ὥ', 'Ὣ', 'Ὧ', 'ᾨ', 'ᾩ', 'ᾬ', 'ᾪ', 'ᾮ', 'ᾭ', 'ᾫ',
'ά', 'ὰ', 'ᾶ', 'ἀ', 'ἁ', 'ἄ', 'ἂ', 'ἆ', 'ἅ', 'ἃ', 'ἇ', 'ᾴ', 'ᾲ', 'ᾷ', 'ᾀ', 'ᾁ', 'ᾄ', 'ᾂ', 'ᾆ', 'ᾅ', 'ᾃ', 'ᾇ', 'έ', 'ὲ', 'ἐ', 'ἑ', 'ἔ', 'ἒ', 'ἕ', 'ἓ', 'ή', 'ὴ', 'ῆ', 'ἠ', 'ἡ', 'ἤ', 'ἢ', 'ἦ', 'ἥ', 'ἣ', 'ἧ', 'ῄ', 'ῂ', 'ῇ', 'ᾐ', 'ᾑ', 'ᾔ', 'ᾒ', 'ᾖ', 'ᾕ', 'ᾓ', 'ᾗ', 'ί', 'ὶ', 'ῖ', 'ἰ', 'ἱ', 'ἴ', 'ἲ', 'ἶ', 'ἵ', 'ἳ', 'ἷ', 'ό', 'ὸ', 'ὀ', 'ὁ', 'ὄ', 'ὂ', 'ὅ', 'ὃ', 'ῤ', 'ῥ', 'ύ', 'ὺ', 'ῦ', 'ὐ', 'ὑ', 'ὔ', 'ὒ', 'ὖ', 'ὕ', 'ὓ', 'ὗ', 'ώ', 'ὼ', 'ῶ', 'ὠ', 'ὡ', 'ὤ', 'ὢ', 'ὦ', 'ὥ', 'ὣ', 'ὧ', 'ῴ', 'ῲ', 'ῷ', 'ᾠ', 'ᾡ', 'ᾤ', 'ᾢ', 'ᾦ', 'ᾥ', 'ᾣ', 'ᾧ', ['{{Polytonic|', '}}', '']];
editpage_specialchars_ipa = [ 'IPA:', 'IPA',
'ʈ', 'ɖ', 'ɟ', 'ɡ', 'ɢ', 'ʡ', 'ʔ', 'ɸ', 'ʃ', 'ʒ', 'ɕ', 'ʑ', 'ʂ', 'ʐ', 'ʝ', 'ɣ', 'ʁ', 'ʕ', 'ʜ', 'ʢ', 'ɦ', 'ɱ', 'ɳ', 'ɲ', 'ŋ', 'ɴ', 'ʋ', 'ɹ', 'ɻ', 'ɰ', 'ʙ', 'ʀ', 'ɾ', 'ɽ', 'ɫ', 'ɬ', 'ɮ', 'ɺ', 'ɭ', 'ʎ', 'ʟ', 'ɥ', 'ʍ', 'ɧ', 'ɓ', 'ɗ', 'ʄ', 'ɠ', 'ʛ', 'ʘ', 'ǀ', 'ǃ', 'ǂ', 'ǁ', 'ɨ', 'ʉ', 'ɯ', 'ɪ', 'ʏ', 'ʊ', 'ɘ', 'ɵ', 'ɤ', 'ɚ', 'ɛ', 'ɜ', 'ɝ', 'ɞ', 'ʌ', 'ɔ', 'ɐ', 'ɶ', 'ɑ', 'ɒ', 'ʰ', 'ʷ', 'ʲ', 'ˠ', 'ˤ', 'ⁿ', 'ˡ', 'ˈ', 'ˌ', 'ː', 'ˑ', ['{{IPA|', '}}', '']];
editpage_specialchars_symbols = [ 'Symbols:', '',
'–', '—', '…', '°', '§', '→', '←', '≈', '±', '−', '×', '¹', '²', '³', ['‘', '’', ''], ['“', '”', ''], '¢', '£', '€', '¥'];
editpage_specialchars_cyrilic = [ 'Cyrilic:', '',
'А', 'Б', 'В', 'Г', 'Ґ', 'Ѓ', 'Д', 'Ђ', 'Е', 'Ё', 'Є', 'Ж', 'З', 'Ѕ', 'И', 'Й', 'І', 'Ї', 'Ј', 'К', 'Л', 'Љ', 'М', 'Н', 'Њ', 'О', 'П', 'Р', 'С', 'Т', 'Ћ', 'Ќ', 'У', 'Ў', 'Ф', 'Х', 'Ц', 'Ч', 'Џ', 'Ш', 'Щ', 'Ъ', 'Ы', 'Ь', 'Э', 'Ю', 'Я', 'а', 'б', 'в', 'г', 'ґ', 'ѓ', 'д', 'ђ', 'е', 'є', 'ё', 'ж', 'з', 'ѕ', 'и', 'й', 'і', 'ї', 'ј', 'к', 'л', 'љ', 'м', 'н', 'њ', 'о', 'п', 'р', 'с', 'т', 'ћ', 'ќ', 'у', 'ў', 'ф', 'х', 'ц', 'ч', 'џ', 'ш', 'щ', 'ъ', 'ы', 'ь', 'э', 'ю', 'я'];
// </pre>