Browse Source

Use lowercase properly in function names.

Kalervo Kujala 14 years ago
parent
commit
9b14e80fd5
  1. 8
      crypto.js
  2. 6
      fonts.js
  3. 60
      pdf.js

8
crypto.js

@ -3,7 +3,7 @@
'use strict'; 'use strict';
var ARCFourCipher = (function aRCFourCipher() { var ARCFourCipher = (function arcFourCipher() {
function constructor(key) { function constructor(key) {
this.a = 0; this.a = 0;
this.b = 0; this.b = 0;
@ -21,7 +21,7 @@ var ARCFourCipher = (function aRCFourCipher() {
} }
constructor.prototype = { constructor.prototype = {
encryptBlock: function aRCFourCipherEncryptBlock(data) { encryptBlock: function arcFourCipherEncryptBlock(data) {
var i, n = data.length, tmp, tmp2; var i, n = data.length, tmp, tmp2;
var a = this.a, b = this.b, s = this.s; var a = this.a, b = this.b, s = this.s;
var output = new Uint8Array(n); var output = new Uint8Array(n);
@ -142,7 +142,7 @@ var NullCipher = (function nullCipher() {
return constructor; return constructor;
})(); })();
var AES128Cipher = (function aES128Cipher() { var AES128Cipher = (function aes128Cipher() {
var rcon = new Uint8Array([ var rcon = new Uint8Array([
0x8d, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c, 0x8d, 0x01, 0x02, 0x04, 0x08, 0x10, 0x20, 0x40, 0x80, 0x1b, 0x36, 0x6c,
0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a, 0xd8, 0xab, 0x4d, 0x9a, 0x2f, 0x5e, 0xbc, 0x63, 0xc6, 0x97, 0x35, 0x6a,
@ -372,7 +372,7 @@ var AES128Cipher = (function aES128Cipher() {
} }
constructor.prototype = { constructor.prototype = {
decryptBlock: function aES128CipherDecryptBlock(data) { decryptBlock: function aes128CipherDecryptBlock(data) {
var i, sourceLength = data.length; var i, sourceLength = data.length;
var buffer = this.buffer, bufferLength = this.bufferPosition; var buffer = this.buffer, bufferLength = this.bufferPosition;
// waiting for IV values -- they are at the start of the stream // waiting for IV values -- they are at the start of the stream

6
fonts.js

@ -2034,7 +2034,7 @@ var CFFStrings = [
var type1Parser = new Type1Parser(); var type1Parser = new Type1Parser();
var CFF = function cFF(name, file, properties) { var CFF = function cffCFF(name, file, properties) {
// Get the data block containing glyphs and subrs informations // Get the data block containing glyphs and subrs informations
var headerBlock = file.getBytes(properties.length1); var headerBlock = file.getBytes(properties.length1);
type1Parser.extractFontHeader(headerBlock, properties); type1Parser.extractFontHeader(headerBlock, properties);
@ -2234,7 +2234,7 @@ CFF.prototype = {
'names': this.createCFFIndexHeader([name]), 'names': this.createCFFIndexHeader([name]),
'topDict': (function topDict(self) { 'topDict': (function topDict(self) {
return function cFFWrapTopDict() { return function cffWrapTopDict() {
var header = '\x00\x01\x01\x01'; var header = '\x00\x01\x01\x01';
var dict = var dict =
'\xf8\x1b\x00' + // version '\xf8\x1b\x00' + // version
@ -2311,7 +2311,7 @@ CFF.prototype = {
'charstrings': this.createCFFIndexHeader([[0x8B, 0x0E]].concat(glyphs), 'charstrings': this.createCFFIndexHeader([[0x8B, 0x0E]].concat(glyphs),
true), true),
'private': (function cFFWrapPrivate(self) { 'private': (function cffWrapPrivate(self) {
var data = var data =
'\x8b\x14' + // defaultWidth '\x8b\x14' + // defaultWidth
'\x8b\x15'; // nominalWidth '\x8b\x15'; // nominalWidth

60
pdf.js

@ -1134,7 +1134,7 @@ var AsciiHexStream = (function asciiHexStream() {
return constructor; return constructor;
})(); })();
var CCITTFaxStream = (function cCITTFaxStream() { var CCITTFaxStream = (function ccittFaxStream() {
var ccittEOL = -2; var ccittEOL = -2;
var twoDimPass = 0; var twoDimPass = 0;
@ -1609,7 +1609,7 @@ var CCITTFaxStream = (function cCITTFaxStream() {
constructor.prototype = Object.create(DecodeStream.prototype); constructor.prototype = Object.create(DecodeStream.prototype);
constructor.prototype.readBlock = function cCITTFaxStreamReadBlock() { constructor.prototype.readBlock = function ccittFaxStreamReadBlock() {
while (!this.eof) { while (!this.eof) {
var c = this.lookChar(); var c = this.lookChar();
this.buf = EOF; this.buf = EOF;
@ -1619,7 +1619,7 @@ var CCITTFaxStream = (function cCITTFaxStream() {
}; };
constructor.prototype.addPixels = constructor.prototype.addPixels =
function cCITTFaxStreamAddPixels(a1, blackPixels) { function ccittFaxStreamAddPixels(a1, blackPixels) {
var codingLine = this.codingLine; var codingLine = this.codingLine;
var codingPos = this.codingPos; var codingPos = this.codingPos;
@ -1639,7 +1639,7 @@ var CCITTFaxStream = (function cCITTFaxStream() {
}; };
constructor.prototype.addPixelsNeg = constructor.prototype.addPixelsNeg =
function cCITTFaxStreamAddPixelsNeg(a1, blackPixels) { function ccittFaxStreamAddPixelsNeg(a1, blackPixels) {
var codingLine = this.codingLine; var codingLine = this.codingLine;
var codingPos = this.codingPos; var codingPos = this.codingPos;
@ -1667,7 +1667,7 @@ var CCITTFaxStream = (function cCITTFaxStream() {
this.codingPos = codingPos; this.codingPos = codingPos;
}; };
constructor.prototype.lookChar = function cCITTFaxStreamLookChar() { constructor.prototype.lookChar = function ccittFaxStreamLookChar() {
if (this.buf != EOF) if (this.buf != EOF)
return this.buf; return this.buf;
@ -1959,7 +1959,7 @@ var CCITTFaxStream = (function cCITTFaxStream() {
return this.buf; return this.buf;
}; };
constructor.prototype.getTwoDimCode = function cCITTFaxStreamGetTwoDimCode() { constructor.prototype.getTwoDimCode = function ccittFaxStreamGetTwoDimCode() {
var code = 0; var code = 0;
var p; var p;
if (this.eoblock) { if (this.eoblock) {
@ -1986,7 +1986,7 @@ var CCITTFaxStream = (function cCITTFaxStream() {
return EOF; return EOF;
}; };
constructor.prototype.getWhiteCode = function cCITTFaxStreamGetWhiteCode() { constructor.prototype.getWhiteCode = function ccittFaxStreamGetWhiteCode() {
var code = 0; var code = 0;
var p; var p;
var n; var n;
@ -2036,7 +2036,7 @@ var CCITTFaxStream = (function cCITTFaxStream() {
return 1; return 1;
}; };
constructor.prototype.getBlackCode = function cCITTFaxStreamGetBlackCode() { constructor.prototype.getBlackCode = function ccittFaxStreamGetBlackCode() {
var code, p; var code, p;
if (this.eoblock) { if (this.eoblock) {
code = this.lookBits(13); code = this.lookBits(13);
@ -2099,7 +2099,7 @@ var CCITTFaxStream = (function cCITTFaxStream() {
return 1; return 1;
}; };
constructor.prototype.lookBits = function cCITTFaxStreamLookBits(n) { constructor.prototype.lookBits = function ccittFaxStreamLookBits(n) {
var c; var c;
while (this.inputBits < n) { while (this.inputBits < n) {
if ((c = this.str.getByte()) == null) { if ((c = this.str.getByte()) == null) {
@ -2114,7 +2114,7 @@ var CCITTFaxStream = (function cCITTFaxStream() {
return (this.inputBuf >> (this.inputBits - n)) & (0xFFFF >> (16 - n)); return (this.inputBuf >> (this.inputBits - n)) & (0xFFFF >> (16 - n));
}; };
constructor.prototype.eatBits = function cCITTFaxStreamEatBits(n) { constructor.prototype.eatBits = function ccittFaxStreamEatBits(n) {
if ((this.inputBits -= n) < 0) if ((this.inputBits -= n) < 0)
this.inputBits = 0; this.inputBits = 0;
}; };
@ -2122,7 +2122,7 @@ var CCITTFaxStream = (function cCITTFaxStream() {
return constructor; return constructor;
})(); })();
var LZWStream = (function lZWStream() { var LZWStream = (function lzwStream() {
function constructor(str, earlyChange) { function constructor(str, earlyChange) {
this.str = str; this.str = str;
this.dict = str.dict; this.dict = str.dict;
@ -2151,7 +2151,7 @@ var LZWStream = (function lZWStream() {
constructor.prototype = Object.create(DecodeStream.prototype); constructor.prototype = Object.create(DecodeStream.prototype);
constructor.prototype.readBits = function lZWStreamReadBits(n) { constructor.prototype.readBits = function lzwStreamReadBits(n) {
var bitsCached = this.bitsCached; var bitsCached = this.bitsCached;
var cachedData = this.cachedData; var cachedData = this.cachedData;
while (bitsCached < n) { while (bitsCached < n) {
@ -2169,7 +2169,7 @@ var LZWStream = (function lZWStream() {
return (cachedData >>> bitsCached) & ((1 << n) - 1); return (cachedData >>> bitsCached) & ((1 << n) - 1);
}; };
constructor.prototype.readBlock = function lZWStreamReadBlock() { constructor.prototype.readBlock = function lzwStreamReadBlock() {
var blockSize = 512; var blockSize = 512;
var estimatedDecodedSize = blockSize * 2, decodedSizeDelta = blockSize; var estimatedDecodedSize = blockSize * 2, decodedSizeDelta = blockSize;
var i, j, q; var i, j, q;
@ -3689,7 +3689,7 @@ var Catalog = (function catalogCatalog() {
return constructor; return constructor;
})(); })();
var PDFDoc = (function pDFDoc() { var PDFDoc = (function pdfDoc() {
function constructor(stream) { function constructor(stream) {
assertWellFormed(stream.length > 0, 'stream must have data'); assertWellFormed(stream.length > 0, 'stream must have data');
this.stream = stream; this.stream = stream;
@ -3768,7 +3768,7 @@ var PDFDoc = (function pDFDoc() {
}, },
// Find the header, remove leading garbage and setup the stream // Find the header, remove leading garbage and setup the stream
// starting from the header. // starting from the header.
checkHeader: function pDFDocCheckHeader() { checkHeader: function pdfDocCheckHeader() {
var stream = this.stream; var stream = this.stream;
stream.reset(); stream.reset();
if (find(stream, '%PDF-', 1024)) { if (find(stream, '%PDF-', 1024)) {
@ -3778,7 +3778,7 @@ var PDFDoc = (function pDFDoc() {
} }
// May not be a PDF file, continue anyway. // May not be a PDF file, continue anyway.
}, },
setup: function pDFDocSetup(ownerPassword, userPassword) { setup: function pdfDocSetup(ownerPassword, userPassword) {
this.checkHeader(); this.checkHeader();
this.xref = new XRef(this.stream, this.xref = new XRef(this.stream,
this.startXRef, this.startXRef,
@ -3791,7 +3791,7 @@ var PDFDoc = (function pDFDoc() {
// shadow the prototype getter // shadow the prototype getter
return shadow(this, 'numPages', num); return shadow(this, 'numPages', num);
}, },
getPage: function pDFDocGetPage(n) { getPage: function pdfDocGetPage(n) {
return this.catalog.getPage(n); return this.catalog.getPage(n);
} }
}; };
@ -6158,7 +6158,7 @@ var TilingPattern = (function tilingPattern() {
})(); })();
var PDFImage = (function pDFImage() { var PDFImage = (function pdfImage() {
function constructor(xref, res, image, inline) { function constructor(xref, res, image, inline) {
this.image = image; this.image = image;
if (image.getParams) { if (image.getParams) {
@ -6369,7 +6369,7 @@ var PDFImage = (function pDFImage() {
return constructor; return constructor;
})(); })();
var PDFFunction = (function pDFFunction() { var PDFFunction = (function pdfFunction() {
function constructor(xref, fn) { function constructor(xref, fn) {
var dict = fn.dict; var dict = fn.dict;
if (!dict) if (!dict)
@ -6390,7 +6390,7 @@ var PDFFunction = (function pDFFunction() {
} }
constructor.prototype = { constructor.prototype = {
constructSampled: function pDFFunctionConstructSampled(str, dict) { constructSampled: function pdfFunctionConstructSampled(str, dict) {
var domain = dict.get('Domain'); var domain = dict.get('Domain');
var range = dict.get('Range'); var range = dict.get('Range');
@ -6426,8 +6426,8 @@ var PDFFunction = (function pDFFunction() {
var samples = this.getSampleArray(size, outputSize, bps, str); var samples = this.getSampleArray(size, outputSize, bps, str);
this.func = function pDFFunctionFunc(args) { this.func = function pdfFunctionFunc(args) {
var clip = function pDFFunctionClip(v, min, max) { var clip = function pdfFunctionClip(v, min, max) {
if (v > max) if (v > max)
v = max; v = max;
else if (v < min) else if (v < min)
@ -6485,7 +6485,7 @@ var PDFFunction = (function pDFFunction() {
return output; return output;
}; };
}, },
getSampleArray: function pDFFunctionGetSampleArray(size, outputSize, bps, getSampleArray: function pdfFunctionGetSampleArray(size, outputSize, bps,
str) { str) {
var length = 1; var length = 1;
for (var i = 0; i < size.length; i++) for (var i = 0; i < size.length; i++)
@ -6511,7 +6511,7 @@ var PDFFunction = (function pDFFunction() {
} }
return array; return array;
}, },
constructInterpolated: function pDFFunctionConstructInterpolated(str, constructInterpolated: function pdfFunctionConstructInterpolated(str,
dict) { dict) {
var c0 = dict.get('C0') || [0]; var c0 = dict.get('C0') || [0];
var c1 = dict.get('C1') || [1]; var c1 = dict.get('C1') || [1];
@ -6525,7 +6525,7 @@ var PDFFunction = (function pDFFunction() {
for (var i = 0; i < length; ++i) for (var i = 0; i < length; ++i)
diff.push(c1[i] - c0[i]); diff.push(c1[i] - c0[i]);
this.func = function pDFFunctionConstructInterpolatedFunc(args) { this.func = function pdfFunctionConstructInterpolatedFunc(args) {
var x = args[0]; var x = args[0];
var out = []; var out = [];
@ -6535,7 +6535,7 @@ var PDFFunction = (function pDFFunction() {
return out; return out;
}; };
}, },
constructStiched: function pDFFunctionConstructStiched(fn, dict, xref) { constructStiched: function pdfFunctionConstructStiched(fn, dict, xref) {
var domain = dict.get('Domain'); var domain = dict.get('Domain');
var range = dict.get('Range'); var range = dict.get('Range');
@ -6554,8 +6554,8 @@ var PDFFunction = (function pDFFunction() {
var bounds = dict.get('Bounds'); var bounds = dict.get('Bounds');
var encode = dict.get('Encode'); var encode = dict.get('Encode');
this.func = function pDFFunctionConstructStichedFunc(args) { this.func = function pdfFunctionConstructStichedFunc(args) {
var clip = function pDFFunctionConstructStichedFuncClip(v, min, max) { var clip = function pdfFunctionConstructStichedFuncClip(v, min, max) {
if (v > max) if (v > max)
v = max; v = max;
else if (v < min) else if (v < min)
@ -6588,9 +6588,9 @@ var PDFFunction = (function pDFFunction() {
return fns[i].func([v2]); return fns[i].func([v2]);
}; };
}, },
constructPostScript: function pDFFunctionConstructPostScript() { constructPostScript: function pdfFunctionConstructPostScript() {
TODO('unhandled type of function'); TODO('unhandled type of function');
this.func = function pDFFunctionConstructPostScriptFunc() { this.func = function pdfFunctionConstructPostScriptFunc() {
return [255, 105, 180]; return [255, 105, 180];
}; };
} }

Loading…
Cancel
Save