[Pkg-javascript-commits] [pdf.js] 45/157: Remove InteractiveAnnotation abstraction
David Prévot
taffit at moszumanska.debian.org
Tue Aug 11 06:46:32 UTC 2015
This is an automated email from the git hooks/post-receive script.
taffit pushed a commit to branch master
in repository pdf.js.
commit 5aa1d9fdfdd0427317bd78c50e11c900d9064576
Author: Tim van der Meij <timvandermeij at gmail.com>
Date: Mon Jul 6 11:58:26 2015 +0200
Remove InteractiveAnnotation abstraction
This became obsolete in https://github.com/mozilla/pdf.js/commit/bdeca30fbfe000c05643b4a8cdda692e2fd549a2. All it does is call the Annotation contructor and add hasHtml. This patch lets the Link and Text annotations directly extend the Annotation class and add hasHtml themselves.
This patch also removes an unused global.
---
src/core/annotation.js | 24 +++++++-----------------
1 file changed, 7 insertions(+), 17 deletions(-)
diff --git a/src/core/annotation.js b/src/core/annotation.js
index 6a4c610..efe47a1 100644
--- a/src/core/annotation.js
+++ b/src/core/annotation.js
@@ -15,7 +15,7 @@
* limitations under the License.
*/
/* globals PDFJS, Util, isDict, isName, stringToPDFString, warn, Dict, Stream,
- stringToBytes, assert, Promise, isArray, ObjectLoader, OperatorList,
+ stringToBytes, Promise, isArray, ObjectLoader, OperatorList,
isValidUrl, OPS, createPromiseCapability, AnnotationType,
stringToUTF8String, AnnotationBorderStyleType */
@@ -570,21 +570,9 @@ var TextWidgetAnnotation = (function TextWidgetAnnotationClosure() {
return TextWidgetAnnotation;
})();
-var InteractiveAnnotation = (function InteractiveAnnotationClosure() {
- function InteractiveAnnotation(params) {
- Annotation.call(this, params);
-
- this.data.hasHtml = true;
- }
-
- Util.inherit(InteractiveAnnotation, Annotation, { });
-
- return InteractiveAnnotation;
-})();
-
var TextAnnotation = (function TextAnnotationClosure() {
function TextAnnotation(params) {
- InteractiveAnnotation.call(this, params);
+ Annotation.call(this, params);
var dict = params.dict;
var data = this.data;
@@ -594,6 +582,7 @@ var TextAnnotation = (function TextAnnotationClosure() {
data.annotationType = AnnotationType.TEXT;
data.content = stringToPDFString(content || '');
data.title = stringToPDFString(title || '');
+ data.hasHtml = true;
if (data.hasAppearance) {
data.name = 'NoIcon';
@@ -608,18 +597,19 @@ var TextAnnotation = (function TextAnnotationClosure() {
}
}
- Util.inherit(TextAnnotation, InteractiveAnnotation, { });
+ Util.inherit(TextAnnotation, Annotation, { });
return TextAnnotation;
})();
var LinkAnnotation = (function LinkAnnotationClosure() {
function LinkAnnotation(params) {
- InteractiveAnnotation.call(this, params);
+ Annotation.call(this, params);
var dict = params.dict;
var data = this.data;
data.annotationType = AnnotationType.LINK;
+ data.hasHtml = true;
var action = dict.get('A');
if (action && isDict(action)) {
@@ -683,7 +673,7 @@ var LinkAnnotation = (function LinkAnnotationClosure() {
return url;
}
- Util.inherit(LinkAnnotation, InteractiveAnnotation, { });
+ Util.inherit(LinkAnnotation, Annotation, { });
return LinkAnnotation;
})();
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/pdf.js.git
More information about the Pkg-javascript-commits
mailing list