Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
N
noVNC
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
rasky
noVNC
Commits
db504ade
Commit
db504ade
authored
May 11, 2010
by
Joel Martin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Isolate DOM references in load() and connect().
- Other misc cleanups.
parent
ded9dfae
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
36 additions
and
24 deletions
+36
-24
base64.js
include/base64.js
+2
-1
des.js
include/des.js
+0
-1
vnc.js
vnc.js
+34
-22
No files found.
include/base64.js
View file @
db504ade
...
...
@@ -131,7 +131,8 @@ decode: function (data, offset) {
// If there are any bits left, the base64 string was corrupted
if
(
leftbits
)
throw
Components
.
Exception
(
'Corrupted base64 string'
);
throw
{
name
:
'Base64-Error'
,
message
:
'Corrupted base64 string'
};
return
result
;
}
...
...
include/des.js
View file @
db504ade
...
...
@@ -233,7 +233,6 @@ DES = {
DES
.
deskey
(
key
,
true
,
DES
.
encryptKeys
);
DES
.
deskey
(
key
,
false
,
DES
.
decryptKeys
);
console
.
log
(
"DES.encryptKeys: "
+
DES
.
encryptKeys
);
},
// Turn an 8-byte key into internal keys.
...
...
vnc.js
View file @
db504ade
...
...
@@ -122,10 +122,14 @@ SQ = ""; // Send Queue
RFB
=
{
ws
:
null
,
// Web Socket object
scheme
:
"ws://"
,
sendID
:
null
,
use_seq
:
false
,
// DOM objects
statusLine
:
null
,
connectBtn
:
null
,
clipboard
:
null
,
max_version
:
3.8
,
version
:
0
,
auth_scheme
:
''
,
...
...
@@ -942,26 +946,26 @@ mouseMove: function(e) {
clipboardCopyTo
:
function
(
text
)
{
console
.
log
(
">> clipboardCopyTo: "
+
text
.
substr
(
0
,
40
)
+
"..."
);
$
(
'VNC_clipboard_text'
)
.
value
=
text
;
RFB
.
clipboard
.
value
=
text
;
console
.
log
(
"<< clipboardCopyTo"
);
},
clipboardPasteFrom
:
function
()
{
if
(
RFB
.
state
!=
"normal"
)
return
;
var
text
=
$
(
'VNC_clipboard_text'
)
.
value
;
var
text
=
RFB
.
clipboard
.
value
;
console
.
log
(
">> clipboardPasteFrom: "
+
text
.
substr
(
0
,
40
)
+
"..."
);
RFB
.
send_array
(
RFB
.
clientCutText
(
text
));
console
.
log
(
"<< clipboardPasteFrom"
);
},
clipboardClear
:
function
()
{
$
(
'VNC_clipboard_text'
)
.
value
=
''
;
RFB
.
clipboard
.
value
=
''
;
RFB
.
clipboardPasteFrom
();
},
updateState
:
function
(
state
,
statusMsg
)
{
var
s
=
$
(
'VNC_status'
)
;
var
c
=
$
(
'VNC_connect_button'
)
;
var
s
=
RFB
.
statusLine
;
var
c
=
RFB
.
connectBtn
;
var
func
=
function
(
msg
)
{
console
.
log
(
msg
)
};
switch
(
state
)
{
case
'failed'
:
...
...
@@ -977,7 +981,8 @@ updateState: function(state, statusMsg) {
break
;
case
'disconnected'
:
c
.
value
=
"Connect"
;
c
.
onclick
=
RFB
.
connect
;
c
.
onclick
=
function
()
{
RFB
.
connect
();
},
c
.
disabled
=
false
;
s
.
style
.
fontColor
=
"#000000"
;
break
;
...
...
@@ -1003,7 +1008,13 @@ updateState: function(state, statusMsg) {
init_ws
:
function
()
{
console
.
log
(
">> init_ws"
);
var
uri
=
RFB
.
scheme
+
RFB
.
host
+
":"
+
RFB
.
port
+
"/?b64encode"
;
var
uri
=
""
;
if
(
RFB
.
encrypt
)
{
uri
=
"wss://"
;
}
else
{
uri
=
"ws://"
;
}
uri
+=
RFB
.
host
+
":"
+
RFB
.
port
+
"/?b64encode"
;
if
(
RFB
.
use_seq
)
{
uri
+=
"&seq_num"
;
}
...
...
@@ -1071,18 +1082,15 @@ init_vars: function () {
},
connect
:
function
()
{
connect
:
function
(
host
,
port
,
password
,
encrypt
)
{
console
.
log
(
">> connect"
);
RFB
.
host
=
$
(
'VNC_host'
).
value
;
RFB
.
port
=
$
(
'VNC_port'
).
value
;
RFB
.
password
=
$
(
'VNC_password'
).
value
;
if
(
$
(
'VNC_encrypt'
).
checked
)
{
RFB
.
scheme
=
"wss://"
;
}
else
{
RFB
.
scheme
=
"ws://"
;
}
RFB
.
host
=
(
host
!==
undefined
)
?
host
:
$
(
'VNC_host'
).
value
;
console
.
log
(
"RFB.host: "
+
RFB
.
host
);
RFB
.
port
=
(
port
!==
undefined
)
?
port
:
$
(
'VNC_port'
).
value
;
RFB
.
password
=
(
password
!==
undefined
)
?
password
:
$
(
'VNC_password'
).
value
;
RFB
.
encrypt
=
(
encrypt
!==
undefined
)
?
encrypt
:
$
(
'VNC_encrypt'
).
checked
;
if
((
!
RFB
.
host
)
||
(
!
RFB
.
port
))
{
console
.
log
(
"m
ust set host and port"
);
alert
(
"M
ust set host and port"
);
return
;
}
...
...
@@ -1168,12 +1176,16 @@ load: function (target) {
}
$
(
'VNC_screen'
).
innerHTML
+=
html
;
/* DOM object references */
RFB
.
statusLine
=
$
(
'VNC_status'
);
RFB
.
connectBtn
=
$
(
'VNC_connect_button'
);
RFB
.
clipboard
=
$
(
'VNC_clipboard_text'
);
/* Add handlers */
$
(
'VNC_clipboard_clear_button'
).
onclick
=
RFB
.
clipboardClear
;
var
clipt
=
$
(
'VNC_clipboard_text'
)
clipt
.
onchange
=
RFB
.
clipboardPasteFrom
;
clipt
.
onfocus
=
function
()
{
RFB
.
clipboardFocus
=
true
;
};
clipt
.
onblur
=
function
()
{
RFB
.
clipboardFocus
=
false
;
};
RFB
.
clipboard
.
onchange
=
RFB
.
clipboardPasteFrom
;
RFB
.
clipboard
.
onfocus
=
function
()
{
RFB
.
clipboardFocus
=
true
;
};
RFB
.
clipboard
.
onblur
=
function
()
{
RFB
.
clipboardFocus
=
false
;
};
/* Load web-socket-js if no builtin WebSocket support */
if
(
VNC_native_ws
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment