Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
D
douban-api-proxy
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
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
captainwong
douban-api-proxy
Commits
5b9b36f9
Commit
5b9b36f9
authored
Sep 17, 2017
by
OzzieIsaacs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Code cosmetics
parent
85068d75
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1125 additions
and
1139 deletions
+1125
-1139
kthoom.js
cps/static/js/kthoom.js
+480
-486
unrar.js
cps/static/js/unrar.js
+645
-653
No files found.
cps/static/js/kthoom.js
View file @
5b9b36f9
...
...
@@ -5,7 +5,7 @@
*
* Copyright(c) 2011 Google Inc.
* Copyright(c) 2011 antimatter15
*/
*/
/* Reference Documentation:
...
...
@@ -227,8 +227,6 @@ kthoom.setProgressMeter = function(pct, opt_label) {
labelText
=
opt_label
+
' '
+
labelText
;
}
title
.
appendChild
(
document
.
createTextNode
(
labelText
));
// fade it out as it approaches finish
//title.setAttribute('fill-opacity', (pct > 90) ? ((100-pct)*5)/100 : 1);
getElem
(
'meter2'
).
setAttribute
(
'width'
,
100
*
(
totalImages
==
0
?
0
:
((
currentImage
+
1
)
/
totalImages
))
+
'%'
);
...
...
@@ -276,7 +274,6 @@ function loadFromArrayBuffer(ab) {
imageFiles
.
push
(
new
kthoom
.
ImageFile
(
f
));
}
}
// display first page if we haven't yet
if
(
imageFiles
.
length
==
currentImage
+
1
)
{
updatePage
();
...
...
@@ -286,7 +283,7 @@ function loadFromArrayBuffer(ab) {
function
(
e
)
{
var
diff
=
((
new
Date
).
getTime
()
-
start
)
/
1000
;
console
.
log
(
'Unarchiving done in '
+
diff
+
's'
);
})
});
unarchiver
.
start
();
}
else
{
alert
(
'Some error'
);
...
...
@@ -417,7 +414,7 @@ function setImage(url) {
x
.
restore
();
};
img
.
src
=
url
;
};
}
}
function
showPrevPage
()
{
...
...
@@ -434,7 +431,6 @@ function showPrevPage() {
return
;
}
}
updatePage
();
}
...
...
@@ -452,7 +448,6 @@ function showNextPage() {
return
;
}
}
updatePage
();
}
...
...
@@ -559,7 +554,6 @@ function init(filename) {
request
.
send
();
kthoom
.
initProgressMeter
();
document
.
body
.
className
+=
/AppleWebKit/
.
test
(
navigator
.
userAgent
)
?
' webkit'
:
''
;
//kthoom.resetFileUploader();
kthoom
.
loadSettings
();
$
(
document
).
keydown
(
keyHandler
);
...
...
cps/static/js/unrar.js
View file @
5b9b36f9
...
...
@@ -113,12 +113,12 @@ var RarVolumeHeader = function(bstream) {
break
;
default
:
bstream
.
readBits
(
16
);
}
}
// byte 6,7
this
.
headSize
=
bstream
.
readBits
(
16
);
info
(
" headSize="
+
this
.
headSize
);
switch
(
this
.
headType
)
{
// byte 6,7
this
.
headSize
=
bstream
.
readBits
(
16
);
info
(
" headSize="
+
this
.
headSize
);
switch
(
this
.
headType
)
{
case
MAIN_HEAD
:
this
.
highPosAv
=
bstream
.
readBits
(
16
);
this
.
posAv
=
bstream
.
readBits
(
32
);
...
...
@@ -367,7 +367,6 @@ function RarDecodeNumber(bstream, dec) {
}
function
RarMakeDecodeTables
(
BitLength
,
offset
,
dec
,
size
)
{
var
DecodeLen
=
dec
.
DecodeLen
,
DecodePos
=
dec
.
DecodePos
,
DecodeNum
=
dec
.
DecodeNum
;
var
LenCount
=
[
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
,
0
],
...
...
@@ -394,7 +393,6 @@ function RarMakeDecodeTables(BitLength, offset, dec, size) {
for
(
I
=
0
;
I
<
size
;
++
I
)
if
(
BitLength
[
I
+
offset
]
!=
0
)
DecodeNum
[
TmpPos
[
BitLength
[
offset
+
I
]
&
0xF
]
++
]
=
I
;
}
// TODO: implement
...
...
@@ -473,7 +471,6 @@ function Unpack20(bstream, Solid) {
RarCopyString
(
2
,
Distance
);
continue
;
}
}
RarUpdateProgress
()
}
...
...
@@ -620,7 +617,6 @@ function Unpack29(bstream, Solid) {
}
if
(
num
==
256
)
{
if
(
!
RarReadEndOfBlock
(
bstream
))
break
;
continue
;
}
if
(
num
==
257
)
{
...
...
@@ -662,7 +658,6 @@ function Unpack29(bstream, Solid) {
RarCopyString
(
2
,
Distance
);
continue
;
}
}
RarUpdateProgress
()
}
...
...
@@ -671,7 +666,6 @@ function RarReadEndOfBlock(bstream) {
RarUpdateProgress
()
var
NewTable
=
false
,
NewFile
=
false
;
if
(
bstream
.
readBits
(
1
))
{
NewTable
=
true
;
...
...
@@ -728,14 +722,12 @@ function RarCopyString(length, distance) {
}
//TODO: lets hope that it never needs to read beyond file boundaries
while
(
length
--
)
rBuffer
.
insertByte
(
rOldBuffers
[
l
].
data
[
destPtr
++
]);
}
if
(
length
>
distance
)
{
while
(
length
--
)
rBuffer
.
insertByte
(
rBuffer
.
data
[
destPtr
++
]);
}
else
{
rBuffer
.
insertBytes
(
rBuffer
.
data
.
subarray
(
destPtr
,
destPtr
+
length
));
}
}
var
rOldBuffers
=
[]
...
...
@@ -828,14 +820,14 @@ var unrar = function(arrayBuffer) {
if
(
header
.
crc
==
0x6152
&&
header
.
headType
==
0x72
&&
header
.
flags
.
value
==
0x1A21
&&
header
.
headSize
==
7
)
{
header
.
headSize
==
7
)
{
info
(
"Found RAR signature"
);
var
mhead
=
new
RarVolumeHeader
(
bstream
);
if
(
mhead
.
headType
!=
MAIN_HEAD
)
{
info
(
"Error! RAR did not include a MAIN_HEAD header"
);
}
else
{
}
else
{
var
localFiles
=
[],
localFile
=
null
;
do
{
...
...
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