summaryrefslogtreecommitdiff
path: root/www/index.html
blob: ef3db73def3450f79f6874775741860da02c22f4 (plain)
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
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
		<title>Portal RDP</title>
		<meta name="robots" content="nofollow" />
		<meta name="description" content="A HTML5 based RDP client">
		<meta name="viewport" content="width=device-width height=device-height user-scalable=no">
		<meta name="cursor-event-mode" content="native">
		<meta name="touch-event-mode" content="pure-with-mouse-conversion">
		<link rel="stylesheet" href="css/style-debug.css">
		<link rel="stylesheet" href="css/vkb-debug.css">
		<link rel="icon" href="favicon.ico" type="image/x-icon" />
		<script src="js/modernizr-debug.js"></script>
		<!-- <script src="js/mootools-debug.js"></script> -->
		<script src="js/mootools-1.6.0.js"></script>
		<script src="js/webrdp-ext.js"></script>
		<script src="js/simpletabs-debug.js"></script>
		<script src="js/webrdp-debug.js"></script>
		<script src="js/webrdp-log.js"></script>
		<script src="js/file-transfer.js"></script>
		<script src="js/vkb-debug.js"></script>
		<script src="js/popupdeck.js"></script>
		<script src="js/rdp-start.js"></script>
		<script src="js/clipboard.js"></script>
		<!--<script language="javascript" type="text/javascript" src="js/rdpevents%JSDEBUG%.js"></script>-->
		<script language="javascript" type="text/javascript">
			var wsBase;
			var rdp;

			if(window.location.protocol.indexOf("https") != -1)
				wsBase = "wss://";
			else
				wsBase = "ws://";
			wsBase += window.location.hostname + ":" + window.location.port + "/wrdp";
 
			var RIMtablet = navigator.appVersion && (-1 != navigator.appVersion.indexOf('RIM Tablet'));
			var mhx = 100;
			var mhy = 100;
			var dragX = 0;
			var dragY = 0;
			var inDrag = false;
			var rdp = null;
			var vkbd = null;
			var embedded = (location.search.substring(1).length > 1);

			var externalConnection = false;

			function initBody(){
				initPopUpDeck();
			}

			window.addEventListener("beforeunload", function() {
				if ($('maindialog').hasClass('invisible')){
					var ans = confirm("Закончить сессию?");
					if (ans) {
						rdp.Disconnect();
					}
				}
			}, false);
			var lables = {
				"cbd_empty": "Пусто",
				"cbd_raw": "Текст",
				"cbd_text": "Текст",
				"cbd_file": "Файл",
				"cpd_select_file": "Загрузить",
				"cpd_failed_set_text": "Недостаточно прав для установки локального буфера обмена, пожалуйста скопируйте текст вручную под сначком буфера обмена.",
				"file_lager_then_2g": "Файл больше двух гигабайт",
				"file_read_failed": "Не удалось прочитать файл",
				"files_in_transfer": "Один или несколько файлов находятся в процессе передачи",
				"drop_here": "Положить файлы в буфер обмена\nПоддерживаются файлы до 2Гб\n(<a href='https://support.microsoft.com/en-us/help/2258090/copying-files-larger-than-2-gb-over-a-remote-desktop-services-or-termi'>See microsoft support</a>)",
				"size_names": ['Bytes', 'KB', 'MB', 'GB', 'TB', 'PB', 'EB', 'ZB', 'YB']
			};
			// $.getJSON("/static/lables.json", function(json) {
			// 	lables = json;
			// });
			window.addEvent('domready', function() {

					var querystring = window.location.href.slice(window.location.href.indexOf('?'))

					$('dtsize').addEvent('change', OnDesktopSize);
					var tabs = new SimpleTabs('rdpdialog',{selector:'h4'});
					OnDesktopSize();
					if (RIMtablet) {
						// Set default performance flags to modem
						$('perf').value = '2';
					}
					window.addEvent('resize', OnDesktopSize);
					// Special handling of webkit nightly builds
					var webkitOK = false;
					var wkVA = RegExp("( AppleWebKit/)([^ ]+)").exec(navigator.userAgent);
					if (wkVA && (wkVA.length > 2)) {
						if (wkVA[2].indexOf('+') != -1) {
							webkitOK = true;
						}
					}
					var wsOK = RIMtablet || webkitOK ||
						(Browser.name == "firefox" && (Browser.version >= 11.0)) ||
						(Browser.name == "chrome" && (Browser.version >= 17)) ||
						(Browser.name == "safari" && (Browser.version >= 6))
					if(externalConnection == true)
					{
						RDPStart();
						vkbd = new webrdp.vkbd({
							version:false,
							sizeswitch:false,
							numpadtoggle:false
						});
					}
					if (wsOK) {
						if(querystring.length > 2)
						{
							showDialog(false);
							if (embedded){
								$('disconnect').setStyles({'visibility':'hidden'});
							}
							var urlParams;
							(window.onpopstate = function () {
								var match,
									pl	 = /\+/g,  // Regex for replacing addition symbol with a space
									search = /([^&=]+)=?([^&]*)/g,
									decode = function (s) { return decodeURIComponent(s.replace(pl, " ")); },
									query  = window.location.search.substring(1);

								urlParams = {};
								while (match = search.exec(query))
								   urlParams[decode(match[1])] = decode(match[2]);
							})();
							RDPStart(wsBase + querystring, urlParams["title"]);
						}
						else
						{
							$('rdpconnect').addEvent('click', function(){RDPStart();});
							showDialog(true);
						}
						vkbd = new webrdp.vkbd({
							version:false,
							sizeswitch:false,
							numpadtoggle:false
						});
					} else {
						alert('Sorry!\nYour Browser (' + Browser.name + ' ' + Browser.version
								+ ') does not yet\nprovide the required HTML5 features '
								+ 'for this application.\n');
					}
			});
		</script>
	</head>
	<body id="wrapper" onload="initBody()">
		<div id="extracommands" style="height:28px; background-color:#f1f1f1; padding-left:10px; cursor:default; visibility:hidden;">
<!-- 			<input id="config" style="display: none;" onchange="rdp.cbd.ClipoboardSendFilelist(this.files);" type="file">
			<input type="submit" onclick="document.getElementById('config').click()" value="Загрузить"> -->

			<div id="cbdcontent" class="tab-menu"></div>
			<div id="clipboardin" style="float:left;margin-right:10px;height:28px;font-size:medium;">
				<img style="height:100%;width:auto;" src="images/cbd_empty.png" title="In">
			</div>
			<div id="clipboardout" style="float:left;margin-right:10px;height:28px;font-size:medium;">
				<img style="height:100%;width:auto;" src="images/cbd_empty.png" title="Out">
			</div>
			Комбинация клавиш:
			<ul>

				<li id="ctrlaltdelete">
					Ctrl+Alt+Delete
				</li>
				<li id="alttab">
					Alt+Tab
				</li>
				<li id="keyboardlanguage">
					Multilanguage keyboard
				</li>
				<li>

				</li>
			</ul>
			<button id="disconnect" type="button" style="float:right; margin-right:40px; margin-top:2px">Выход</button>
		</div>
		<div id="IMEhelper" style="z-index:1111;visibility:hidden;height:auto;width:auto;display:inline;position:absolute;background-color:#ffffff;"></div>
		<canvas id="screen">
			<p class="error">Браузер не поддерживает canvas tag.</p>
		</canvas>
		<div id="dvLoading" style="position:fixed; left:45%; top:45%; visibility:hidden;"><img src="images/loading.gif"></div>
		<noscript><p class="error">Включите JavaScript.</p></noscript>
		<table width="400px" id="maindialog" class="invisible">
		<tr><td>
		<div style="margin-left:auto; margin-right:auto; width:60%; position:relative;">
		</a></div></img>
			</td></tr>
			<tr class="rdp_connect_dialog">
				<td>
					<div id="rdpdialog" class="dialog">
						<h4 title="Main connection settings">General</h4>
						<div>
							<form onkeypress="if (event.keyCode == 13) { document.getElementById('rdpconnect').focus();document.getElementById('rdpconnect').click(); return event.preventDefault();}">
								<fieldset>
									<legend>Session parameters</legend>
									<table>
										<tr>
											<td class="key"><label for="host">Hostname:</label></td>
											<td><input id="rdphost" type="text" name="host" value="192.168.14.8"/></td>
										</tr>
										<tr>
											<td class="key"><label for="user">User:</label></td>
											<td><input id="rdpuser" type="text" name="user" value="admin"/></td>
										</tr>
										<tr>
											<td class="key"><label for="password">Password:</label></td>
											<td><input id="rdppass" type="password" name="password" value="Xx123456" autocomplete="off"/></td>
										</tr>
										<tr>
											<td class="key"><label for="dtsize">Desktop size:</label></td>
											<td>
												<select id="dtsize" name="dtsize">
													<option>640x480</option>
													<option>800x600</option>
													<option>1024x768</option>
													<option>1280x960</option>
													<option>1280x1024</option>
													<option value="auto" selected>Available Area</option>
												</select>
											</td>
										</tr>
										<tr>
											<td class="buttons" colspan="2"><input id="rdpconnect" type="button" value="Connect" /></td>
										</tr>
									</table>
								</fieldset>
							</form>
						</div>
						<h4 title="Advanced session parameters">Advanced</h4>
						<div>
							<form onsubmit="event.preventDefault(); return false;">
								<fieldset>
									<legend>Advanced session parameters</legend>
									<table>
										<tr>
											<td class="key"><label for="port">Port:</label></td>
											<td><input id="rdpport" name="port" type="text" size="6" maxlen="5" value="3389" /></td>
										</tr>
					<tr>
						<td class="key"><label for="pcb">PCB (vmID):</label></td>
						<td><input id="rdppcb" type="text" name="pcb" value=""/></td>
					</tr>
										<tr>
											<td class="key"><label for="perf">Performance:</label></td>
											<td>
												<select id="perf" name="perf">
													<option value="0" selected>LAN</option>
													<option value="1">Broadband</option>
													<option value="2">Modem</option>
												</select>
											</td>
										</tr>
										<tr>
											<td class="key"><label for="nowallp">Disable wallpaper:</label></td>
											<td><input id="nowallp" name="nowallp" type="checkbox"/></td>
										</tr>
										<tr>
											<td class="key"><label for="nowdrag">Disable full window drag:</label></td>
											<td><input id="nowdrag" name="nowdrag" type="checkbox"/></td>
										</tr>
										<tr>
											<td class="key"><label for="nomani">Disable menu animation:</label></td>
											<td><input id="nomani" name="nomani" type="checkbox"/></td>
										</tr>
										<tr>
											<td class="key"><label for="notheme">Disable theming:</label></td>
											<td><input id="notheme" name="notheme" type="checkbox"/></td>
										</tr>
										<tr>
											<td class="key"><label for="nonla">Disable network level authentication:</label></td>
											<td><input id="nonla" name="nonla" type="checkbox"/></td>
										</tr>
										<tr>
											<td class="key"><label for="notls">Disable TLS:</label></td>
											<td><input id="notls" name="notls" type="checkbox"/></td>
										</tr>
										<tr>
											<td class="key"><label for="fntlm">Force NTLM auth:</label></td>
											<td>
												<select id="fntlm" name="fntlm">
													<option value="0" selected>disabled</option>
													<option value="1">NTLM v1</option>
													<option value="2">NTLM v2</option>
												</select>
											</td>
										</tr>
									</table>
								</fieldset>
							</form>
							<br />
						</div>
						<h4 title="Show version info">About</h4>
						<div class="about">
							<h2>Portal WebRDP</h2>
						</div>
					</div>
				</td>
			</tr>
		</table>
		<table width="240px" id="mousehelper" class="invisible">
			<tr>
				<td>
					<div id="mousedialog" class="dialog">
						<form>
							<fieldset>
								<legend>Click properties</legend>
								<table>
									<tr>
										<td class="key"><label class="big" for="rclick">Right</label></td>
										<td><input id="rclick" name="rclick" type="checkbox" /></td>
									</tr>
									<tr>
										<td class="key"><label class="big" for="mclick">Middle</label></td>
										<td><input id="mclick" name="mclick" type="checkbox" /></td>
									</tr>
									<tr>
										<td class="key"><label class="big" for="aclick">Alt</label></td>
										<td><input id="aclick" name="aclick" type="checkbox" /></td>
									</tr>
									<tr>
										<td class="key"><label class="big" for="sclick">Shift</label></td>
										<td><input id="sclick" name="sclick" type="checkbox" /></td>
									</tr>
									<tr>
										<td class="key"><label class="big" for="cclick">Control</label></td>
										<td><input id="cclick" name="cclick" type="checkbox" /></td>
									</tr>
								</table>
							</fieldset>
						</form>
					</div>
				</td>
			</tr>
		</table>
	</body>
</html>