From bdeca30fbfe000c05643b4a8cdda692e2fd549a2 Mon Sep 17 00:00:00 2001 From: Yury Delendik Date: Tue, 17 Jun 2014 17:43:33 -0500 Subject: [PATCH] Splits shared/annotation.js into core/ and display/ --- examples/acroforms/index.html | 2 +- examples/helloworld/index.html | 2 +- make.js | 4 +- src/{shared => core}/annotation.js | 314 +---------------------------- src/display/annotation_helper.js | 252 +++++++++++++++++++++++ src/shared/util.js | 6 + src/worker_loader.js | 4 +- test/font/font_test.html | 3 +- test/test_slave.html | 2 +- test/unit/unit_test.html | 3 +- web/page_view.js | 8 +- web/viewer.html | 2 +- 12 files changed, 284 insertions(+), 318 deletions(-) rename src/{shared => core}/annotation.js (62%) create mode 100644 src/display/annotation_helper.js diff --git a/examples/acroforms/index.html b/examples/acroforms/index.html index 5ac3fdc7f..85b60f369 100644 --- a/examples/acroforms/index.html +++ b/examples/acroforms/index.html @@ -5,13 +5,13 @@ - + - + - + @@ -37,6 +37,7 @@ + diff --git a/test/test_slave.html b/test/test_slave.html index 1e03be43c..1fa834500 100644 --- a/test/test_slave.html +++ b/test/test_slave.html @@ -20,13 +20,13 @@ limitations under the License. pdf.js test slave - + - + @@ -36,6 +36,7 @@ + diff --git a/web/page_view.js b/web/page_view.js index 636e4777e..066e2dccd 100644 --- a/web/page_view.js +++ b/web/page_view.js @@ -17,7 +17,7 @@ /* globals RenderingStates, PDFView, PDFHistory, PDFFindBar, PDFJS, mozL10n, CustomStyle, PresentationMode, scrollIntoView, SCROLLBAR_PADDING, CSS_UNITS, UNKNOWN_SCALE, DEFAULT_SCALE, getOutputScale, - TextLayerBuilder, cache, Stats */ + TextLayerBuilder, cache, Stats, AnnotationUtils */ 'use strict'; @@ -322,16 +322,14 @@ var PageView = function pageView(container, id, scale, } else { for (i = 0, ii = annotationsData.length; i < ii; i++) { data = annotationsData[i]; - var annotation = PDFJS.Annotation.fromData(data); - if (!annotation || !annotation.hasHtml()) { + if (!data || !data.hasHtml) { continue; } - element = annotation.getHtmlElement(pdfPage.commonObjs); + element = AnnotationUtils.getHtmlElement(data, pdfPage.commonObjs); element.setAttribute('data-annotation-id', data.id); mozL10n.translate(element); - data = annotation.getData(); var rect = data.rect; var view = pdfPage.view; rect = PDFJS.Util.normalizeRect([ diff --git a/web/viewer.html b/web/viewer.html index ee75ec2aa..f8145740d 100644 --- a/web/viewer.html +++ b/web/viewer.html @@ -48,13 +48,13 @@ http://sourceforge.net/adobe/cmap/wiki/License/ - +