-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathmain.js
149 lines (124 loc) · 4.02 KB
/
main.js
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
/******************************************
Changes resource strings
Coded by : S M Mahbub Murshed
Date: November 18, 2006
******************************************/
function SetResourceStrings()
{
for (var resid in resource)
{
var resbyid = document.getElementById(resid);
if(resbyid.type=="button")
resbyid.value = resource[resid];
else
resbyid.innerHTML = resource[resid];
}
}
/******************************************
Toggle resource
Coded by : S M Mahbub Murshed
Date: November 18, 2006
******************************************/
function ToggleLanguage(lang)
{
var resbyid;
if(lang==1)
{
resource = en_resource;
resbyid = document.getElementById("english_res");
resbyid.innerHTML = "English";
resbyid = document.getElementById("bangla_res");
resbyid.innerHTML = "<a href=\"javascript:ToggleLanguage(2);\">বাংলা</a>";
}
else if(lang==2)
{
resource = bn_resource;
resbyid = document.getElementById("english_res");
resbyid.innerHTML = "<a href=\"javascript:ToggleLanguage(1);\">English</a>";
resbyid = document.getElementById("bangla_res");
resbyid.innerHTML = "বাংলা";
}
SetResourceStrings();
}
/******************************************
Changes keyboard layout status
\param ev the event
Coded by : S M Mahbub Murshed
Date: August 30, 2006
******************************************/
function ChangeKeyboarLayoutStatus()
{
// var keyboard_ley = document.getElementById("keyboard");
var field = document.getElementsByName('KeyboardLayoutOption');
if(KeyBoardLayout==1 || EnglishKeyboard==true)
{ // keyboard_ley.innerHTML = "বর্তমান লেখন পদ্ধতি: <b>ইংরেজী</b>";
field[0].checked = true; }
else if(KeyBoardLayout==2)
{ // keyboard_ley.innerHTML = "বর্তমান লেখন পদ্ধতি: <b>বিজয় বাংলা</b>";
field[KeyBoardLayout-1].checked = true; }
else if(KeyBoardLayout==3)
{ // keyboard_ley.innerHTML = "বর্তমান লেখন পদ্ধতি: <b>সামহোয়্যার-ইন ফোনেটিক বাংলা</b>";
field[KeyBoardLayout-1].checked = true; }
else if(KeyBoardLayout==4)
{ // keyboard_ley.innerHTML = "বর্তমান লেখন পদ্ধতি: <b>অভ্র ফোনেটিক বাংলা</b>";
field[KeyBoardLayout-1].checked = true; }
else if(KeyBoardLayout==5)
{ // keyboard_ley.innerHTML = "বর্তমান লেখন পদ্ধতি: <b>ইউনিজয় বাংলা</b>";
field[KeyBoardLayout-1].checked = true; }
}
/******************************************
Handles keyboard option button click
\param event the event
Coded by : S M Mahbub Murshed
Date: August 30, 2006
******************************************/
function KeyboardLayoutOptionClick(event)
{
var field = document.getElementsByName('KeyboardLayoutOption');
for (var counter = 0; counter < field.length; counter++)
{
if (field[counter].checked)
{
KeyBoardLayout = counter+1;
ChangeKeyboarLayoutStatus();
var myFld = document.getElementById(ID);
myFld.focus();
break;
}
}
} // end function KeyboardLayoutOptionClick
/******************************************
Clears text area
\param id the id of the html element
Coded by : S M Mahbub Murshed
Date: September 05, 2006
******************************************/
function ClearTextArea(idtxt)
{
var elem = document.getElementById(idtxt);
elem.value = "";
elem.focus();
} // end function ClearTextArea
/******************************************
On page load
Coded by : S M Mahbub Murshed
Date: September 12, 2006
******************************************/
function OnPageLoad()
{
SetResourceStrings();
ChangeKeyboarLayoutStatus();
var myFld = document.getElementById(ID);
var unicodefontLabel = document.getElementById("unicodefont");
if(IE)
{
unicodefontLabel.innerHTML = ""
myFld.style.fontFamily = "SutonnyBanglaOMJ";
}
else
{
unicodefontLabel.innerHTML = ""
myFld.style.fontFamily = "SolaimanLipi";
}
myFld.style.width = 250;
}