-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
94 lines (79 loc) · 3.26 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
<html>
<head>
<title>Pa'O ASCII to Unicode</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="./style.css"/>
<script src="./app.js"></script>
</head>
<body>
<div id="container">
<header>
<h2>Pa'O ASCII to Unicode</h2>
</header>
<br />
<div id="textContainer">
<section id="From">
<h3>ASCII (Am2, NyiHtooYam, etc...)</h3>
<textarea id="from" onfocus="handleOnFocus(this)" onblur="handleOnBlur()"></textarea>
<button onclick="copy('from')">Copy text</button>
</section>
<section id="To">
<h3>Unicode</h3>
<textarea id="to" onfocus="handleOnFocus(this)" onblur="handleOnBlur()"></textarea>
<button onclick="copy('to')">Copy text</button>
</section>
</div>
<div id="textContainer">
<section id="buttons">
<input type="button" value="Clear Text" onclick="clearText()">
</section>
</div>
<footer>
<p>Note: စမ်းသပ်အဆင့်သာရှိသေးသည်။<br>
ပြီးပြည့်စုံသော Converter ဖြစ်လာစေရန် မိမိမှာရှိတဲ့ Am2 ဖောင့်ဖြင့်ရေးထားသောစာများကို ထည့်သွင်း၍စမ်းပေးပါ။<br>
အဆင်မပြေသည့်စကားလုံးများတွေ့ပါကပြင်ဆင်ဖြည့်စွက်နိုင်အောင် <a href="https://m.me/iamHtetz">@iamHtetz</a> ကိုအကြောင်းကြားပေးပါ။</p>
</footer>
<p>
</div>
<script>
function copy(id) {
var copyText = document.getElementById(id);
copyText.select();
document.execCommand("copy");
alert("Copied the text: " + copyText.value);
}
var textFieldInFocus;
function handleOnFocus(form_element) {
textFieldInFocus = form_element;
}
function handleOnBlur() {
textFieldInFocus = null;
}
var from = document.getElementById("from");
var to = document.getElementById("to");
onchangeHandler(from, to, "to");
function clearText() {
from.value = "";
to.value = "";
}
function converter(textField, tochangeField) {
if (tochangeField != textFieldInFocus) {
tochangeField.value = convert(textField.value);
}
}
function onchangeHandler(textField, tochangeField) {
if (textField.addEventListener) {
textField.addEventListener('input', function () {
converter(textField, tochangeField);
}, false);
} else if (textField.attachEvent) {
textField.attachEvent('onpropertychange', function () {
// IE
converter(textField, tochangeField);
});
}
}
</script>
</body>
</html>