-
Notifications
You must be signed in to change notification settings - Fork 1
/
converter.html
51 lines (42 loc) · 1.43 KB
/
converter.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
<!DOCTYPE html>
<html>
<head lang="ar">
<meta charset="UTF-8">
<title></title>
</head>
<body dir="rtl">
<textarea name="arabic" id="arabic" cols="30" rows="10"></textarea>
<div id="arabicNote"></div>
<textarea name="arabicB" id="arabicB" cols="30" rows="10"></textarea>
<div id="arabicBNote"></div>
<button id="toArabicB">حول إلى العربية المرئية</button>
<button id="toArabic">حول إلى العربية العادية</button>
<script type="text/javascript" src="converter.js"></script>
<script type="text/javascript">
var arabicText = document.getElementById('arabic');
var arabicNote = document.getElementById('arabicNote');
var arabicBText = document.getElementById('arabicB');
var arabicBNote = document.getElementById('arabicBNote');
document.getElementById('toArabicB').addEventListener('click', function(){
arabicBText.value = arabicConverter.convertArabic(arabicText.value);
updateNotes();
});
document.getElementById('toArabic').addEventListener('click', function(){
arabicText.value = arabicConverter.convertArabicBack(arabicBText.value);
updateNotes();
});
function updateNotes(){
var buffer = '';
for (var i in arabicText.value){
buffer += arabicText.value.charCodeAt(i) + ' ';
}
//arabicNote.innerText = buffer;
var bufferB = '';
for (var j in arabicBText.value){
bufferB += arabicBText.value.charCodeAt(j) + ' ';
}
//arabicBNote.innerText = bufferB;
}
</script>
</body>
</html>