1
0
mirror of https://github.com/janeczku/calibre-web synced 2025-12-05 15:58:05 +00:00

Merge branch 'Develop'

# Conflicts:
#	MANIFEST.in
#	README.md
#	cps/helper.py
#	cps/static/js/archive/archive.js
#	cps/translations/nl/LC_MESSAGES/messages.mo
#	cps/translations/nl/LC_MESSAGES/messages.po
#	cps/ub.py
#	cps/updater.py
#	cps/web.py
#	cps/worker.py
#	optional-requirements.txt
This commit is contained in:
Ozzieisaacs
2019-07-13 20:45:48 +02:00
parent 37736e11d5
commit 4708347c16
189 changed files with 33354 additions and 17681 deletions

0
cps/static/js/io/bitstream.js Executable file → Normal file
View File

View File

@@ -101,6 +101,35 @@ bitjs.io = bitjs.io || {};
};
/**
* ToDo: Returns the next n bytes as a signed number and advances the stream pointer.
* @param {number} n The number of bytes to read.
* @return {number} The bytes interpreted as a signed number.
*/
bitjs.io.ByteStream.prototype.movePointer = function(n) {
this.ptr += n;
// end of buffer reached
if ((this.bytes.byteLength - this.ptr) < 0 ) {
this.ptr = this.bytes.byteLength;
}
}
/**
* ToDo: Returns the next n bytes as a signed number and advances the stream pointer.
* @param {number} n The number of bytes to read.
* @return {number} The bytes interpreted as a signed number.
*/
bitjs.io.ByteStream.prototype.moveTo = function(n) {
if ( n < 0 ) {
n = 0;
}
this.ptr = n;
// end of buffer reached
if ((this.bytes.byteLength - this.ptr) < 0 ) {
this.ptr = this.bytes.byteLength;
}
}
/**
* This returns n bytes as a sub-array, advancing the pointer if movePointers
* is true.