Browse Source

PDF.js version 1.5.488 - See mozilla/pdf.js@6c263c19946af23b723f148d9f05118971e18b36

master v1.5.488
Pdf Bot 9 years ago
parent
commit
089b0f018f
  1. 2
      bower.json
  2. 62
      build/pdf.combined.js
  3. 50
      build/pdf.js
  4. 54
      build/pdf.worker.js
  5. 2
      package.json
  6. 16
      web/pdf_viewer.css

2
bower.json

@ -1,6 +1,6 @@
{ {
"name": "pdfjs-dist", "name": "pdfjs-dist",
"version": "1.5.485", "version": "1.5.488",
"main": [ "main": [
"build/pdf.js", "build/pdf.js",
"build/pdf.worker.js" "build/pdf.worker.js"

62
build/pdf.combined.js

@ -28,8 +28,8 @@ factory((root.pdfjsDistBuildPdfCombined = {}));
// Use strict in our context only - users might not want it // Use strict in our context only - users might not want it
'use strict'; 'use strict';
var pdfjsVersion = '1.5.485'; var pdfjsVersion = '1.5.488';
var pdfjsBuild = '7820f58'; var pdfjsBuild = '6c263c1';
var pdfjsFilePath = var pdfjsFilePath =
typeof document !== 'undefined' && document.currentScript ? typeof document !== 'undefined' && document.currentScript ?
@ -1101,25 +1101,25 @@ var AnnotationFlag = {
}; };
var AnnotationFieldFlag = { var AnnotationFieldFlag = {
READONLY: 1, READONLY: 0x0000001,
REQUIRED: 2, REQUIRED: 0x0000002,
NOEXPORT: 3, NOEXPORT: 0x0000004,
MULTILINE: 13, MULTILINE: 0x0001000,
PASSWORD: 14, PASSWORD: 0x0002000,
NOTOGGLETOOFF: 15, NOTOGGLETOOFF: 0x0004000,
RADIO: 16, RADIO: 0x0008000,
PUSHBUTTON: 17, PUSHBUTTON: 0x0010000,
COMBO: 18, COMBO: 0x0020000,
EDIT: 19, EDIT: 0x0040000,
SORT: 20, SORT: 0x0080000,
FILESELECT: 21, FILESELECT: 0x0100000,
MULTISELECT: 22, MULTISELECT: 0x0200000,
DONOTSPELLCHECK: 23, DONOTSPELLCHECK: 0x0400000,
DONOTSCROLL: 24, DONOTSCROLL: 0x0800000,
COMB: 25, COMB: 0x1000000,
RICHTEXT: 26, RICHTEXT: 0x2000000,
RADIOSINUNISON: 26, RADIOSINUNISON: 0x2000000,
COMMITONSELCHANGE: 27, COMMITONSELCHANGE: 0x4000000,
}; };
var AnnotationBorderStyleType = { var AnnotationBorderStyleType = {
@ -24589,6 +24589,14 @@ var TextWidgetAnnotationElement = (
if (this.data.maxLen !== null) { if (this.data.maxLen !== null) {
element.maxLength = this.data.maxLen; element.maxLength = this.data.maxLen;
} }
if (this.data.comb) {
var fieldWidth = this.data.rect[2] - this.data.rect[0];
var combWidth = fieldWidth / this.data.maxLen;
element.classList.add('comb');
element.style.letterSpacing = 'calc(' + combWidth + 'px - 1ch)';
}
} else { } else {
element = document.createElement('div'); element = document.createElement('div');
element.textContent = this.data.fieldValue; element.textContent = this.data.fieldValue;
@ -49751,14 +49759,13 @@ var WidgetAnnotation = (function WidgetAnnotationClosure() {
* *
* @public * @public
* @memberof WidgetAnnotation * @memberof WidgetAnnotation
* @param {number} flag - Bit position, numbered from one instead of * @param {number} flag - Hexadecimal representation for an annotation
* zero, to check * field characteristic
* @return {boolean} * @return {boolean}
* @see {@link shared/util.js} * @see {@link shared/util.js}
*/ */
hasFieldFlag: function WidgetAnnotation_hasFieldFlag(flag) { hasFieldFlag: function WidgetAnnotation_hasFieldFlag(flag) {
var mask = 1 << (flag - 1); return !!(this.data.fieldFlags & flag);
return !!(this.data.fieldFlags & mask);
}, },
}); });
@ -49786,6 +49793,11 @@ var TextWidgetAnnotation = (function TextWidgetAnnotationClosure() {
// Process field flags for the display layer. // Process field flags for the display layer.
this.data.readOnly = this.hasFieldFlag(AnnotationFieldFlag.READONLY); this.data.readOnly = this.hasFieldFlag(AnnotationFieldFlag.READONLY);
this.data.multiLine = this.hasFieldFlag(AnnotationFieldFlag.MULTILINE); this.data.multiLine = this.hasFieldFlag(AnnotationFieldFlag.MULTILINE);
this.data.comb = this.hasFieldFlag(AnnotationFieldFlag.COMB) &&
!this.hasFieldFlag(AnnotationFieldFlag.MULTILINE) &&
!this.hasFieldFlag(AnnotationFieldFlag.PASSWORD) &&
!this.hasFieldFlag(AnnotationFieldFlag.FILESELECT) &&
this.data.maxLen !== null;
} }
Util.inherit(TextWidgetAnnotation, WidgetAnnotation, { Util.inherit(TextWidgetAnnotation, WidgetAnnotation, {

50
build/pdf.js

@ -28,8 +28,8 @@ factory((root.pdfjsDistBuildPdf = {}));
// Use strict in our context only - users might not want it // Use strict in our context only - users might not want it
'use strict'; 'use strict';
var pdfjsVersion = '1.5.485'; var pdfjsVersion = '1.5.488';
var pdfjsBuild = '7820f58'; var pdfjsBuild = '6c263c1';
var pdfjsFilePath = var pdfjsFilePath =
typeof document !== 'undefined' && document.currentScript ? typeof document !== 'undefined' && document.currentScript ?
@ -115,25 +115,25 @@ var AnnotationFlag = {
}; };
var AnnotationFieldFlag = { var AnnotationFieldFlag = {
READONLY: 1, READONLY: 0x0000001,
REQUIRED: 2, REQUIRED: 0x0000002,
NOEXPORT: 3, NOEXPORT: 0x0000004,
MULTILINE: 13, MULTILINE: 0x0001000,
PASSWORD: 14, PASSWORD: 0x0002000,
NOTOGGLETOOFF: 15, NOTOGGLETOOFF: 0x0004000,
RADIO: 16, RADIO: 0x0008000,
PUSHBUTTON: 17, PUSHBUTTON: 0x0010000,
COMBO: 18, COMBO: 0x0020000,
EDIT: 19, EDIT: 0x0040000,
SORT: 20, SORT: 0x0080000,
FILESELECT: 21, FILESELECT: 0x0100000,
MULTISELECT: 22, MULTISELECT: 0x0200000,
DONOTSPELLCHECK: 23, DONOTSPELLCHECK: 0x0400000,
DONOTSCROLL: 24, DONOTSCROLL: 0x0800000,
COMB: 25, COMB: 0x1000000,
RICHTEXT: 26, RICHTEXT: 0x2000000,
RADIOSINUNISON: 26, RADIOSINUNISON: 0x2000000,
COMMITONSELCHANGE: 27, COMMITONSELCHANGE: 0x4000000,
}; };
var AnnotationBorderStyleType = { var AnnotationBorderStyleType = {
@ -4784,6 +4784,14 @@ var TextWidgetAnnotationElement = (
if (this.data.maxLen !== null) { if (this.data.maxLen !== null) {
element.maxLength = this.data.maxLen; element.maxLength = this.data.maxLen;
} }
if (this.data.comb) {
var fieldWidth = this.data.rect[2] - this.data.rect[0];
var combWidth = fieldWidth / this.data.maxLen;
element.classList.add('comb');
element.style.letterSpacing = 'calc(' + combWidth + 'px - 1ch)';
}
} else { } else {
element = document.createElement('div'); element = document.createElement('div');
element.textContent = this.data.fieldValue; element.textContent = this.data.fieldValue;

54
build/pdf.worker.js vendored

@ -28,8 +28,8 @@ factory((root.pdfjsDistBuildPdfWorker = {}));
// Use strict in our context only - users might not want it // Use strict in our context only - users might not want it
'use strict'; 'use strict';
var pdfjsVersion = '1.5.485'; var pdfjsVersion = '1.5.488';
var pdfjsBuild = '7820f58'; var pdfjsBuild = '6c263c1';
var pdfjsFilePath = var pdfjsFilePath =
typeof document !== 'undefined' && document.currentScript ? typeof document !== 'undefined' && document.currentScript ?
@ -1101,25 +1101,25 @@ var AnnotationFlag = {
}; };
var AnnotationFieldFlag = { var AnnotationFieldFlag = {
READONLY: 1, READONLY: 0x0000001,
REQUIRED: 2, REQUIRED: 0x0000002,
NOEXPORT: 3, NOEXPORT: 0x0000004,
MULTILINE: 13, MULTILINE: 0x0001000,
PASSWORD: 14, PASSWORD: 0x0002000,
NOTOGGLETOOFF: 15, NOTOGGLETOOFF: 0x0004000,
RADIO: 16, RADIO: 0x0008000,
PUSHBUTTON: 17, PUSHBUTTON: 0x0010000,
COMBO: 18, COMBO: 0x0020000,
EDIT: 19, EDIT: 0x0040000,
SORT: 20, SORT: 0x0080000,
FILESELECT: 21, FILESELECT: 0x0100000,
MULTISELECT: 22, MULTISELECT: 0x0200000,
DONOTSPELLCHECK: 23, DONOTSPELLCHECK: 0x0400000,
DONOTSCROLL: 24, DONOTSCROLL: 0x0800000,
COMB: 25, COMB: 0x1000000,
RICHTEXT: 26, RICHTEXT: 0x2000000,
RADIOSINUNISON: 26, RADIOSINUNISON: 0x2000000,
COMMITONSELCHANGE: 27, COMMITONSELCHANGE: 0x4000000,
}; };
var AnnotationBorderStyleType = { var AnnotationBorderStyleType = {
@ -40877,14 +40877,13 @@ var WidgetAnnotation = (function WidgetAnnotationClosure() {
* *
* @public * @public
* @memberof WidgetAnnotation * @memberof WidgetAnnotation
* @param {number} flag - Bit position, numbered from one instead of * @param {number} flag - Hexadecimal representation for an annotation
* zero, to check * field characteristic
* @return {boolean} * @return {boolean}
* @see {@link shared/util.js} * @see {@link shared/util.js}
*/ */
hasFieldFlag: function WidgetAnnotation_hasFieldFlag(flag) { hasFieldFlag: function WidgetAnnotation_hasFieldFlag(flag) {
var mask = 1 << (flag - 1); return !!(this.data.fieldFlags & flag);
return !!(this.data.fieldFlags & mask);
}, },
}); });
@ -40912,6 +40911,11 @@ var TextWidgetAnnotation = (function TextWidgetAnnotationClosure() {
// Process field flags for the display layer. // Process field flags for the display layer.
this.data.readOnly = this.hasFieldFlag(AnnotationFieldFlag.READONLY); this.data.readOnly = this.hasFieldFlag(AnnotationFieldFlag.READONLY);
this.data.multiLine = this.hasFieldFlag(AnnotationFieldFlag.MULTILINE); this.data.multiLine = this.hasFieldFlag(AnnotationFieldFlag.MULTILINE);
this.data.comb = this.hasFieldFlag(AnnotationFieldFlag.COMB) &&
!this.hasFieldFlag(AnnotationFieldFlag.MULTILINE) &&
!this.hasFieldFlag(AnnotationFieldFlag.PASSWORD) &&
!this.hasFieldFlag(AnnotationFieldFlag.FILESELECT) &&
this.data.maxLen !== null;
} }
Util.inherit(TextWidgetAnnotation, WidgetAnnotation, { Util.inherit(TextWidgetAnnotation, WidgetAnnotation, {

2
package.json

@ -1,6 +1,6 @@
{ {
"name": "pdfjs-dist", "name": "pdfjs-dist",
"version": "1.5.485", "version": "1.5.488",
"main": "build/pdf.js", "main": "build/pdf.js",
"description": "Generic build of Mozilla's PDF.js library.", "description": "Generic build of Mozilla's PDF.js library.",
"keywords": [ "keywords": [

16
web/pdf_viewer.css

@ -146,6 +146,22 @@
border: 1px solid transparent; border: 1px solid transparent;
} }
.annotationLayer .textWidgetAnnotation input.comb {
font-family: monospace;
padding-left: 2px;
padding-right: 0;
}
.annotationLayer .textWidgetAnnotation input.comb:focus {
/*
* Letter spacing is placed on the right side of each character. Hence, the
* letter spacing of the last character may be placed outside the visible
* area, causing horizontal scrolling. We avoid this by extending the width
* when the element has focus and revert this when it loses focus.
*/
width: 115%;
}
.annotationLayer .popupWrapper { .annotationLayer .popupWrapper {
position: absolute; position: absolute;
width: 20em; width: 20em;

Loading…
Cancel
Save