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
56ec48be
Commit
56ec48be
authored
May 15, 2010
by
Joel Martin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move vars into RFB namespace. Extend array in util.js.
parent
c4164bda
Changes
2
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
157 additions
and
151 deletions
+157
-151
util.js
include/util.js
+58
-0
vnc.js
vnc.js
+99
-151
No files found.
include/util.js
View file @
56ec48be
...
...
@@ -27,3 +27,61 @@ function dirObj(obj, depth, parent) {
}
return
msg
;
}
/*
* Make arrays quack
*/
Array
.
prototype
.
shift8
=
function
()
{
return
this
.
shift
();
};
Array
.
prototype
.
push8
=
function
(
num
)
{
this
.
push
(
num
&
0xFF
);
};
Array
.
prototype
.
shift16
=
function
()
{
return
(
this
.
shift
()
<<
8
)
+
(
this
.
shift
()
);
};
Array
.
prototype
.
push16
=
function
(
num
)
{
this
.
push
((
num
>>
8
)
&
0xFF
,
(
num
)
&
0xFF
);
};
Array
.
prototype
.
shift32
=
function
()
{
return
(
this
.
shift
()
<<
24
)
+
(
this
.
shift
()
<<
16
)
+
(
this
.
shift
()
<<
8
)
+
(
this
.
shift
()
);
};
Array
.
prototype
.
get32
=
function
(
off
)
{
return
(
this
[
off
]
<<
24
)
+
(
this
[
off
+
1
]
<<
16
)
+
(
this
[
off
+
2
]
<<
8
)
+
(
this
[
off
+
3
]
);
};
Array
.
prototype
.
push32
=
function
(
num
)
{
this
.
push
((
num
>>
24
)
&
0xFF
,
(
num
>>
16
)
&
0xFF
,
(
num
>>
8
)
&
0xFF
,
(
num
)
&
0xFF
);
};
Array
.
prototype
.
shiftStr
=
function
(
len
)
{
var
arr
=
this
.
splice
(
0
,
len
);
return
arr
.
map
(
function
(
num
)
{
return
String
.
fromCharCode
(
num
);
}
).
join
(
''
);
};
Array
.
prototype
.
pushStr
=
function
(
str
)
{
var
i
,
n
=
str
.
length
;
for
(
i
=
0
;
i
<
n
;
i
++
)
{
this
.
push
(
str
.
charCodeAt
(
i
));
}
};
Array
.
prototype
.
shiftBytes
=
function
(
len
)
{
return
this
.
splice
(
0
,
len
);
};
vnc.js
View file @
56ec48be
This diff is collapsed.
Click to expand it.
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