浏览代码

PDF.js version 1.3.144 - See mozilla/pdf.js@d956177482a7b0fc3bf901d348423a21e67fe2bb

Pdf Bot 9 年之前
父节点
当前提交
d61a46981b
共有 6 个文件被更改,包括 110 次插入8 次删除
  1. 1 1
      bower.json
  2. 51 2
      build/pdf.combined.js
  3. 32 2
      build/pdf.js
  4. 21 2
      build/pdf.worker.js
  5. 1 1
      package.json
  6. 4 0
      web/pdf_viewer.css

+ 1 - 1
bower.json

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

+ 51 - 2
build/pdf.combined.js

@@ -21,8 +21,8 @@ if (typeof PDFJS === 'undefined') {
    typeof global !== 'undefined' ? global : this).PDFJS = {};
 }
 
-PDFJS.version = '1.3.142';
-PDFJS.build = 'e8db825';
+PDFJS.version = '1.3.144';
+PDFJS.build = 'd956177';
 
 (function pdfjsWrapper() {
   // Use strict in our context only - users might not want it
@@ -15569,6 +15569,9 @@ AnnotationElementFactory.prototype =
       case AnnotationType.UNDERLINE:
         return new UnderlineAnnotationElement(parameters);
 
+      case AnnotationType.STRIKEOUT:
+        return new StrikeOutAnnotationElement(parameters);
+
       default:
         throw new Error('Unimplemented annotation type "' + subtype + '"');
     }
@@ -16124,6 +16127,33 @@ var UnderlineAnnotationElement = (
   return UnderlineAnnotationElement;
 })();
 
+/**
+ * @class
+ * @alias StrikeOutAnnotationElement
+ */
+var StrikeOutAnnotationElement = (
+    function StrikeOutAnnotationElementClosure() {
+  function StrikeOutAnnotationElement(parameters) {
+    AnnotationElement.call(this, parameters);
+  }
+
+  Util.inherit(StrikeOutAnnotationElement, AnnotationElement, {
+    /**
+     * Render the strikeout annotation's HTML element in the empty container.
+     *
+     * @public
+     * @memberof StrikeOutAnnotationElement
+     * @returns {HTMLSectionElement}
+     */
+    render: function StrikeOutAnnotationElement_render() {
+      this.container.className = 'strikeoutAnnotation';
+      return this.container;
+    }
+  });
+
+  return StrikeOutAnnotationElement;
+})();
+
 /**
  * @typedef {Object} AnnotationLayerParameters
  * @property {PageViewport} viewport
@@ -46608,6 +46638,9 @@ AnnotationFactory.prototype = /** @lends AnnotationFactory.prototype */ {
       case 'Underline':
         return new UnderlineAnnotation(parameters);
 
+      case 'StrikeOut':
+        return new StrikeOutAnnotation(parameters);
+
       default:
         warn('Unimplemented annotation type "' + subtype + '", ' +
              'falling back to base annotation');
@@ -47314,6 +47347,22 @@ var UnderlineAnnotation = (function UnderlineAnnotationClosure() {
   return UnderlineAnnotation;
 })();
 
+var StrikeOutAnnotation = (function StrikeOutAnnotationClosure() {
+  function StrikeOutAnnotation(parameters) {
+    Annotation.call(this, parameters);
+
+    this.data.annotationType = AnnotationType.STRIKEOUT;
+    this.data.hasHtml = true;
+
+    // PDF viewers completely ignore any border styles.
+    this.data.borderStyle.setWidth(0);
+  }
+
+  Util.inherit(StrikeOutAnnotation, Annotation, {});
+
+  return StrikeOutAnnotation;
+})();
+
 exports.Annotation = Annotation;
 exports.AnnotationBorderStyle = AnnotationBorderStyle;
 exports.AnnotationFactory = AnnotationFactory;

+ 32 - 2
build/pdf.js

@@ -21,8 +21,8 @@ if (typeof PDFJS === 'undefined') {
    typeof global !== 'undefined' ? global : this).PDFJS = {};
 }
 
-PDFJS.version = '1.3.142';
-PDFJS.build = 'e8db825';
+PDFJS.version = '1.3.144';
+PDFJS.build = 'd956177';
 
 (function pdfjsWrapper() {
   // Use strict in our context only - users might not want it
@@ -1849,6 +1849,9 @@ AnnotationElementFactory.prototype =
       case AnnotationType.UNDERLINE:
         return new UnderlineAnnotationElement(parameters);
 
+      case AnnotationType.STRIKEOUT:
+        return new StrikeOutAnnotationElement(parameters);
+
       default:
         throw new Error('Unimplemented annotation type "' + subtype + '"');
     }
@@ -2404,6 +2407,33 @@ var UnderlineAnnotationElement = (
   return UnderlineAnnotationElement;
 })();
 
+/**
+ * @class
+ * @alias StrikeOutAnnotationElement
+ */
+var StrikeOutAnnotationElement = (
+    function StrikeOutAnnotationElementClosure() {
+  function StrikeOutAnnotationElement(parameters) {
+    AnnotationElement.call(this, parameters);
+  }
+
+  Util.inherit(StrikeOutAnnotationElement, AnnotationElement, {
+    /**
+     * Render the strikeout annotation's HTML element in the empty container.
+     *
+     * @public
+     * @memberof StrikeOutAnnotationElement
+     * @returns {HTMLSectionElement}
+     */
+    render: function StrikeOutAnnotationElement_render() {
+      this.container.className = 'strikeoutAnnotation';
+      return this.container;
+    }
+  });
+
+  return StrikeOutAnnotationElement;
+})();
+
 /**
  * @typedef {Object} AnnotationLayerParameters
  * @property {PageViewport} viewport

+ 21 - 2
build/pdf.worker.js

@@ -21,8 +21,8 @@ if (typeof PDFJS === 'undefined') {
    typeof global !== 'undefined' ? global : this).PDFJS = {};
 }
 
-PDFJS.version = '1.3.142';
-PDFJS.build = 'e8db825';
+PDFJS.version = '1.3.144';
+PDFJS.build = 'd956177';
 
 (function pdfjsWrapper() {
   // Use strict in our context only - users might not want it
@@ -38885,6 +38885,9 @@ AnnotationFactory.prototype = /** @lends AnnotationFactory.prototype */ {
       case 'Underline':
         return new UnderlineAnnotation(parameters);
 
+      case 'StrikeOut':
+        return new StrikeOutAnnotation(parameters);
+
       default:
         warn('Unimplemented annotation type "' + subtype + '", ' +
              'falling back to base annotation');
@@ -39591,6 +39594,22 @@ var UnderlineAnnotation = (function UnderlineAnnotationClosure() {
   return UnderlineAnnotation;
 })();
 
+var StrikeOutAnnotation = (function StrikeOutAnnotationClosure() {
+  function StrikeOutAnnotation(parameters) {
+    Annotation.call(this, parameters);
+
+    this.data.annotationType = AnnotationType.STRIKEOUT;
+    this.data.hasHtml = true;
+
+    // PDF viewers completely ignore any border styles.
+    this.data.borderStyle.setWidth(0);
+  }
+
+  Util.inherit(StrikeOutAnnotation, Annotation, {});
+
+  return StrikeOutAnnotation;
+})();
+
 exports.Annotation = Annotation;
 exports.AnnotationBorderStyle = AnnotationBorderStyle;
 exports.AnnotationFactory = AnnotationFactory;

+ 1 - 1
package.json

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

+ 4 - 0
web/pdf_viewer.css

@@ -142,6 +142,10 @@
   cursor: pointer;
 }
 
+.annotationLayer .strikeoutAnnotation {
+  cursor: pointer;
+}
+
 .pdfViewer .canvasWrapper {
   overflow: hidden;
 }