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
2bcb2d5b
Commit
2bcb2d5b
authored
Apr 13, 2010
by
Joel Martin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove event handlers on disconnect.
parent
b7ec5487
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
4 deletions
+13
-4
canvas.js
canvas.js
+12
-3
vnc.html
vnc.html
+1
-1
No files found.
canvas.js
View file @
2bcb2d5b
...
@@ -52,8 +52,6 @@ init: function (id, width, height, keyDown, keyUp, mouseDown, mouseUp) {
...
@@ -52,8 +52,6 @@ init: function (id, width, height, keyDown, keyUp, mouseDown, mouseUp) {
if
(
!
mouseUp
)
mouseUp
=
Canvas
.
mouseUp
;
if
(
!
mouseUp
)
mouseUp
=
Canvas
.
mouseUp
;
var
c
=
$
(
Canvas
.
id
);
var
c
=
$
(
Canvas
.
id
);
c
.
width
=
width
;
c
.
height
=
height
;
document
.
addEvent
(
'keydown'
,
keyDown
);
document
.
addEvent
(
'keydown'
,
keyDown
);
document
.
addEvent
(
'keyup'
,
keyUp
);
document
.
addEvent
(
'keyup'
,
keyUp
);
c
.
addEvent
(
'mousedown'
,
mouseDown
);
c
.
addEvent
(
'mousedown'
,
mouseDown
);
...
@@ -63,6 +61,8 @@ init: function (id, width, height, keyDown, keyUp, mouseDown, mouseUp) {
...
@@ -63,6 +61,8 @@ init: function (id, width, height, keyDown, keyUp, mouseDown, mouseUp) {
document
.
addEvent
(
'click'
,
Canvas
.
ctxDisable
);
document
.
addEvent
(
'click'
,
Canvas
.
ctxDisable
);
document
.
body
.
addEvent
(
'contextmenu'
,
Canvas
.
ctxDisable
);
document
.
body
.
addEvent
(
'contextmenu'
,
Canvas
.
ctxDisable
);
c
.
width
=
width
;
c
.
height
=
height
;
Canvas
.
c_x
=
c
.
getPosition
().
x
;
Canvas
.
c_x
=
c
.
getPosition
().
x
;
Canvas
.
c_y
=
c
.
getPosition
().
y
;
Canvas
.
c_y
=
c
.
getPosition
().
y
;
Canvas
.
c_wx
=
c
.
getSize
().
x
;
Canvas
.
c_wx
=
c
.
getSize
().
x
;
...
@@ -77,8 +77,17 @@ init: function (id, width, height, keyDown, keyUp, mouseDown, mouseUp) {
...
@@ -77,8 +77,17 @@ init: function (id, width, height, keyDown, keyUp, mouseDown, mouseUp) {
clear
:
function
()
{
clear
:
function
()
{
Canvas
.
ctx
.
clearRect
(
0
,
0
,
Canvas
.
c_wx
,
Canvas
.
c_wy
);
Canvas
.
ctx
.
clearRect
(
0
,
0
,
Canvas
.
c_wx
,
Canvas
.
c_wy
);
var
c
=
$
(
Canvas
.
id
);
var
c
=
$
(
Canvas
.
id
);
document
.
removeEvents
(
'keydown'
);
document
.
removeEvents
(
'keyup'
);
c
.
removeEvents
(
'mousedown'
);
c
.
removeEvents
(
'mouseup'
);
/* Work around right and middle click browser behaviors */
document
.
removeEvents
(
'click'
);
document
.
body
.
removeEvents
(
'contextmenu'
);
c
.
width
=
640
;
c
.
width
=
640
;
c
.
height
=
10
0
;
c
.
height
=
2
0
;
},
},
draw
:
function
()
{
draw
:
function
()
{
...
...
vnc.html
View file @
2bcb2d5b
...
@@ -12,7 +12,7 @@
...
@@ -12,7 +12,7 @@
<br><br>
<br><br>
<div
id=
'status'
>
Disconnected
</div>
<div
id=
'status'
>
Disconnected
</div>
<canvas
id=
"vnc"
width=
"640"
height=
"
10
0"
<canvas
id=
"vnc"
width=
"640"
height=
"
2
0"
style=
"border-style: dotted; border-width: 1px;"
>
style=
"border-style: dotted; border-width: 1px;"
>
Canvas not supported.
Canvas not supported.
</canvas>
</canvas>
...
...
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