-
Notifications
You must be signed in to change notification settings - Fork 1
/
VirtualKeyboard.xhtml
197 lines (178 loc) · 8.36 KB
/
VirtualKeyboard.xhtml
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
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:widget="http://www.netvibes.com/ns/">
<head>
<!-- Application Infos -->
<title>Virtual Keyboard</title>
<meta name="description" content="Virtual Keyboard demo" />
<meta name="author" content="Arul Rajendiran" />
<meta name="version" content="1.0" />
<meta name="apiVersion" content="1.3" />
<meta name="debugMode" content="true" />
<meta name="strictMode" content="false" />
<!-- UWA Environment -->
<link rel="stylesheet" type="text/css" href="http://uwa.netvibes.com/lib/c/UWA/assets/css/standalone.css" />
<script type="text/javascript" src="http://uwa.netvibes.com/lib/c/UWA/js/UWA_Standalone_Alone.js"></script>
<!-- Application Preferences -->
<widget:preferences>
<widget:preference name="defLang" type="list" label="Default Language" defaultValue="fr">
<widget:option value="fr" label="French" />
</widget:preference>
</widget:preferences>
<!-- Application Styles -->
<style type="text/css">
.VirtualKBD {
}
.VirtualKBD div#main {
padding:10px;
}
.VirtualKBD div.clear {
clear:both;
height:0px;
}
.VirtualKBD div button {
width: 30px;
height: 30px;
cursor: pointer;
cursor: hand;
}
</style>
<!-- Application Source -->
<script type="text/javascript">
//<![CDATA[
/*
We create the global MyWidget object (it could be any other name).
This object will be used to store variables and function.
*/
var VirtualKBD = {
/*
The onLoad() function is the first one, triggered by widget.onLoad.
Its use is to display a "Loading" message, then call the next method.
*/
createButton : function ( btn_id , sClass, symbol , clickHandler) {
var btn = UWA.createElement('button',{
class : sClass ,
id: btn_id,
//events : {click : SciCalc.onBtnClick}
});
btn.setHTML(symbol)
return btn;
},
addSpace : function ( ele ) {
var tDiv = UWA.createElement('div',{class: 'clear'});
ele.addContent(tDiv);
},
onLoad: function() {
widget.body.setContent('Loading...');
var start = UWA.createElement('div',
{
class: 'VirtualKBD',
id: 'VirtualKBD',
html : [
{
tag : 'div',
id : 'keyboard'
}
]
});
var keyboard = start.getElements('#keyboard')[0];
var key_btnKey1 = VirtualKBD.createButton('key_btnKey1','key_btnNormal','`');
var key_btnKey2 = VirtualKBD.createButton('key_btnKey2','key_btnNormal','1');
var key_btnKey3 = VirtualKBD.createButton('key_btnKey3','key_btnNormal','2');
var key_btnKey4 = VirtualKBD.createButton('key_btnKey4','key_btnNormal','3');
var key_btnKey5 = VirtualKBD.createButton('key_btnKey5','key_btnNormal','4');
var key_btnKey6 = VirtualKBD.createButton('key_btnKey6','key_btnNormal','5');
var key_btnKey7 = VirtualKBD.createButton('key_btnKey7','key_btnNormal','6');
var key_btnKey8 = VirtualKBD.createButton('key_btnKey8','key_btnNormal','7');
var key_btnKey9 = VirtualKBD.createButton('key_btnKey9','key_btnNormal','8');
var key_btnKey10 = VirtualKBD.createButton('key_btnKey0','key_btnNormal','9');
var key_btnKey11 = VirtualKBD.createButton('key_btnKey11','key_btnNormal','0');
var key_btnKey12 = VirtualKBD.createButton('key_btnKey12','key_btnNormal','-');
var key_btnKey13 = VirtualKBD.createButton('key_btnKey13','key_btnNormal','=');
var key_btnKey14 = VirtualKBD.createButton('key_btnKey14','key_btnNormal','⇦');
var key_btnKey15 = VirtualKBD.createButton('key_btnKey15','key_btnNormal','↹');
var key_btnKey16 = VirtualKBD.createButton('key_btnKey16','key_btnNormal','a');
var key_btnKey17 = VirtualKBD.createButton('key_btnKey17','key_btnNormal','z');
var key_btnKey18 = VirtualKBD.createButton('key_btnKey18','key_btnNormal','e');
var key_btnKey19 = VirtualKBD.createButton('key_btnKey19','key_btnNormal','r');
var key_btnKey20 = VirtualKBD.createButton('key_btnKey20','key_btnNormal','t');
var key_btnKey21 = VirtualKBD.createButton('key_btnKey21','key_btnNormal','y');
var key_btnKey22 = VirtualKBD.createButton('key_btnKey22','key_btnNormal','u');
var key_btnKey23 = VirtualKBD.createButton('key_btnKey23','key_btnNormal','i');
var key_btnKey24 = VirtualKBD.createButton('key_btnKey24','key_btnNormal','o');
var key_btnKey25 = VirtualKBD.createButton('key_btnKey25','key_btnNormal','p');
var key_btnKey26 = VirtualKBD.createButton('key_btnKey26','key_btnNormal','^');
var key_btnKey27 = VirtualKBD.createButton('key_btnKey27','key_btnNormal','$');
var key_btnKey28 = VirtualKBD.createButton('key_btnKey28','key_btnNormal','↵');
var key_btnKey29 = VirtualKBD.createButton('key_btnKey29','key_btnNormal','⇪');
var key_btnKey30 = VirtualKBD.createButton('key_btnKey29','key_btnNormal','q');
var key_btnKey31 = VirtualKBD.createButton('key_btnKey29','key_btnNormal','s');
var key_btnKey32 = VirtualKBD.createButton('key_btnKey29','key_btnNormal','d');
var key_btnKey33 = VirtualKBD.createButton('key_btnKey29','key_btnNormal','f');
var key_btnKey34 = VirtualKBD.createButton('key_btnKey29','key_btnNormal','g');
var key_btnKey35 = VirtualKBD.createButton('key_btnKey29','key_btnNormal','h');
var key_btnKey36 = VirtualKBD.createButton('key_btnKey29','key_btnNormal','j');
var key_btnKey37 = VirtualKBD.createButton('key_btnKey29','key_btnNormal','k');
var key_btnKey38 = VirtualKBD.createButton('key_btnKey29','key_btnNormal','l');
var key_btnKey39 = VirtualKBD.createButton('key_btnKey29','key_btnNormal','u');
var key_btnKey40 = VirtualKBD.createButton('key_btnKey29','key_btnNormal','m');
var key_btnKey41 = VirtualKBD.createButton('key_btnKey29','key_btnNormal','ù');
keyboard.addContent(key_btnKey1);
keyboard.addContent(key_btnKey2);
keyboard.addContent(key_btnKey3);
keyboard.addContent(key_btnKey4);
keyboard.addContent(key_btnKey5);
keyboard.addContent(key_btnKey6);
keyboard.addContent(key_btnKey7);
keyboard.addContent(key_btnKey8);
keyboard.addContent(key_btnKey9);
keyboard.addContent(key_btnKey10);
keyboard.addContent(key_btnKey11);
keyboard.addContent(key_btnKey12);
keyboard.addContent(key_btnKey13);
keyboard.addContent(key_btnKey14);
VirtualKBD.addSpace(keyboard);
keyboard.addContent(key_btnKey15);
keyboard.addContent(key_btnKey16);
keyboard.addContent(key_btnKey17);
keyboard.addContent(key_btnKey18);
keyboard.addContent(key_btnKey19);
keyboard.addContent(key_btnKey20);
keyboard.addContent(key_btnKey21);
keyboard.addContent(key_btnKey22);
keyboard.addContent(key_btnKey23);
keyboard.addContent(key_btnKey24);
keyboard.addContent(key_btnKey25);
keyboard.addContent(key_btnKey26);
keyboard.addContent(key_btnKey27);
keyboard.addContent(key_btnKey28);
VirtualKBD.addSpace(keyboard);
keyboard.addContent(key_btnKey29);
keyboard.addContent(key_btnKey30);
keyboard.addContent(key_btnKey31);
keyboard.addContent(key_btnKey32);
keyboard.addContent(key_btnKey33);
keyboard.addContent(key_btnKey34);
keyboard.addContent(key_btnKey35);
keyboard.addContent(key_btnKey36);
keyboard.addContent(key_btnKey37);
keyboard.addContent(key_btnKey39);
keyboard.addContent(key_btnKey40);
keyboard.addContent(key_btnKey41);
start.inject(widget.body.empty());
}
};
/*
The "onLoad" event is the very first event triggered when
the widget is fully loaded or when the preferences are validated.
Here, we add MyWidget.onLoad() function as "onLoad" event
listener on the widget.
*/
widget.addEvent('onLoad', VirtualKBD.onLoad);
//]]>
</script>
</head>
<body>
<p>Loading ...</p>
</body>
</html>