From 092235a56fc6a754dfc4bcacfb66be864cb9c190 Mon Sep 17 00:00:00 2001 From: Kalervo Kujala Date: Thu, 25 Aug 2011 20:20:19 +0300 Subject: [PATCH] Fix lint errors. --- fonts.js | 4 ++-- glyphlist.js | 8 +++----- pdf.js | 10 +++++----- utils/fonts_utils.js | 14 ++++++-------- web/viewer.js | 22 +++++++++++----------- 5 files changed, 27 insertions(+), 31 deletions(-) diff --git a/fonts.js b/fonts.js index b81f4a2ed..31522d7a4 100755 --- a/fonts.js +++ b/fonts.js @@ -1309,7 +1309,7 @@ var Font = (function Font() { return constructor; })(); -/** +/* * Type1Parser encapsulate the needed code for parsing a Type1 font * program. Some of its logic depends on the Type2 charstrings * structure. @@ -1534,7 +1534,7 @@ var Type1Parser = function() { return { charstring: charstring, width: width, lsb: lsb }; }; - /** + /* * Returns an object containing a Subrs array and a CharStrings * array extracted from and eexec encrypted block of data */ diff --git a/glyphlist.js b/glyphlist.js index 3551e6173..9be0e8d5a 100644 --- a/glyphlist.js +++ b/glyphlist.js @@ -1087,6 +1087,8 @@ var GlyphsUnicode = { amsquare: 0x33C2, anbopomofo: 0x3122, angbopomofo: 0x3124, + angbracketleft: 0x3008, // This glyph is missing from Adobe's original list. + angbracketright: 0x3009, // This glyph is missing from Adobe's original list. angkhankhuthai: 0x0E5A, angle: 0x2220, anglebracketleft: 0x3008, @@ -1385,6 +1387,7 @@ var GlyphsUnicode = { cieucparenkorean: 0x3208, cieucuparenkorean: 0x321C, circle: 0x25CB, + circlecopyrt: 0x00A9, // This glyph is missing from Adobe's original list. circlemultiply: 0x2297, circleot: 0x2299, circleplus: 0x2295, @@ -4287,8 +4290,3 @@ var GlyphsUnicode = { zukatakana: 0x30BA }; -// Add missing glyphs from the Adobe's original list -GlyphsUnicode.angbracketleft = 0x3008; -GlyphsUnicode.angbracketright = 0x3009; -GlyphsUnicode.circlecopyrt = 0x00A9; - diff --git a/pdf.js b/pdf.js index e4ef1b63e..a62973ac3 100644 --- a/pdf.js +++ b/pdf.js @@ -3545,7 +3545,7 @@ var Catalog = (function() { var obj = this.catDict.get('Names'); if (obj) nameTreeRef = xref.fetchIfRef(obj).get('Dests'); - else if(this.catDict.has('Dests')) + else if (this.catDict.has('Dests')) nameDictionaryRef = this.catDict.get('Dests'); if (nameDictionaryRef) { @@ -3923,7 +3923,7 @@ var Encodings = { 'arrowdbldown', 'lozenge', 'angleleft', 'registersans', 'copyrightsans', 'trademarksans', 'summation', 'parenlefttp', 'parenleftex', 'parenleftbt', 'bracketlefttp', 'bracketleftex', 'bracketleftbt', - 'bracelefttp', 'braceleftmid', 'braceleftbt', 'braceex', ,'angleright', + 'bracelefttp', 'braceleftmid', 'braceleftbt', 'braceex',, 'angleright', 'integral', 'integraltp', 'integralex', 'integralbt', 'parenrighttp', 'parenrightex', 'parenrightbt', 'bracketrighttp', 'bracketrightex', 'bracketrightbt', 'bracerighttp', 'bracerightmid', 'bracerightbt' @@ -4278,8 +4278,8 @@ var PartialEvaluator = (function() { } // merge in the differences - var length = baseEncoding.length > diffEncoding.length ? - baseEncoding.length : diffEncoding.length; + var length = baseEncoding.length > diffEncoding.length ? + baseEncoding.length : diffEncoding.length; for (var i = 0, ii = length; i < ii; ++i) { var diffGlyph = diffEncoding[i]; var baseGlyph = baseEncoding[i]; @@ -4306,7 +4306,7 @@ var PartialEvaluator = (function() { var cmap = cmapObj.getBytes(cmapObj.length); for (var i = 0; i < cmap.length; i++) { var byte = cmap[i]; - if (byte == 0x20 || byte == 0x0A || byte == 0x3C || + if (byte == 0x20 || byte == 0x0A || byte == 0x3C || byte == 0x3E) { switch (token) { case 'useCMap': diff --git a/utils/fonts_utils.js b/utils/fonts_utils.js index edfc22186..7665906a1 100644 --- a/utils/fonts_utils.js +++ b/utils/fonts_utils.js @@ -3,7 +3,7 @@ 'use strict'; -/** +/* * The Type2 reader code below is only used for debugging purpose since Type2 * is only a CharString format and is never used directly as a Font file. * @@ -12,7 +12,7 @@ * CharString or to understand the structure of the CFF format. */ -/** +/* * Build a charset by assigning the glyph name and the human readable form * of the glyph data. */ @@ -38,7 +38,7 @@ function readCharset(aStream, aCharstrings) { return charset; } -/** +/* * Take a Type2 binary charstring as input and transform it to a human * readable representation as specified by the 'The Type 2 Charstring Format', * chapter 3.1. @@ -86,7 +86,7 @@ function readCharstringEncoding(aString) { } -/** +/* * Take a binary DICT Data as input and transform it into a human readable * form as specified by 'The Compact Font Format Specification', chapter 5. */ @@ -159,8 +159,7 @@ function readFontDictData(aString, aMap) { return fontDictDataTokens; } - -/** +/* * Take a stream as input and return an array of objects. * In CFF an INDEX is a structure with the following format: * { @@ -371,8 +370,7 @@ var Type2Parser = function(aFilePath) { * */ - -/** +/* * Write to a file to the disk (works only on Firefox in privilege mode) * but this is useful for dumping a font file to the disk and check with * fontforge or the ots program what's wrong with the file. diff --git a/web/viewer.js b/web/viewer.js index abeaff276..a16cd76b1 100644 --- a/web/viewer.js +++ b/web/viewer.js @@ -27,15 +27,15 @@ var PDFView = { var cssUnits = 96.0 / 72.0; for (var i = 0; i < pages.length; i++) pages[i].update(val / 100 * cssUnits); - - if(document.location.hash == '#' + this.page) - this.pages[this.page-1].draw(); + + if (document.location.hash == '#' + this.page) + this.pages[this.page - 1].draw(); else // Jump the scroll position to the correct page. document.location.hash = this.page; - var event = document.createEvent("UIEvents"); - event.initUIEvent("scalechange", false, false, window, val); + var event = document.createEvent('UIEvents'); + event.initUIEvent('scalechange', false, false, window, val); window.dispatchEvent(event); }, @@ -142,7 +142,7 @@ var PDFView = { var outlineScrollView = document.getElementById('outlineScrollView'); var thumbsSwitchButton = document.getElementById('thumbsSwitch'); var outlineSwitchButton = document.getElementById('outlineSwitch'); - switch(view) { + switch (view) { case 'thumbs': thumbsScrollView.style.display = 'block'; outlineScrollView.style.display = 'none'; @@ -436,7 +436,7 @@ window.addEventListener('transitionend', function(evt) { }, true); -window.addEventListener("scalechange", function(evt) { +window.addEventListener('scalechange', function(evt) { var options = document.getElementById('scaleSelect').options; for (var i = 0; i < options.length; i++) { var option = options[i]; @@ -444,10 +444,10 @@ window.addEventListener("scalechange", function(evt) { } }, true); -window.addEventListener("pagechange", function(evt) { +window.addEventListener('pagechange', function(evt) { var page = evt.detail; document.location.hash = page; - document.getElementById("pageNumber").value = page; - document.getElementById("previous").disabled = (page == 1); - document.getElementById("next").disabled = (page == PDFView.pages.length); + document.getElementById('pageNumber').value = page; + document.getElementById('previous').disabled = (page == 1); + document.getElementById('next').disabled = (page == PDFView.pages.length); }, true);