From e7577a721206325b4496f52c8d47c19c3ce95af9 Mon Sep 17 00:00:00 2001 From: Yury Delendik Date: Sat, 21 Nov 2015 10:32:47 -0600 Subject: [PATCH] Adds UMD headers to core, display and shared files. --- .jshintrc | 6 + examples/acroforms/index.html | 14 +- examples/helloworld/index.html | 13 +- examples/svgviewer/index.html | 9 +- make.js | 15 +- src/core/annotation.js | 48 ++- src/core/arithmetic_decoder.js | 13 + src/core/bidi.js | 16 +- src/core/charsets.js | 15 + src/core/chunked_stream.js | 24 +- src/core/cmap.js | 35 +- src/core/colorspace.js | 44 +- src/core/crypto.js | 40 +- src/core/{core.js => document.js} | 69 +++- src/core/evaluator.js | 90 ++++- src/core/font_renderer.js | 36 +- src/core/fonts.js | 86 +++- src/core/function.js | 30 +- src/core/glyphlist.js | 14 + src/core/image.js | 39 +- src/core/jbig2.js | 26 +- src/core/jpg.js | 17 +- src/core/jpx.js | 25 +- src/core/metrics.js | 13 + src/core/murmurhash3.js | 16 +- src/core/obj.js | 369 +++-------------- src/core/parser.js | 57 ++- src/core/pattern.js | 33 +- src/core/pdf_manager.js | 30 +- src/core/primitives.js | 378 ++++++++++++++++++ src/core/ps_parser.js | 21 +- src/core/stream.js | 70 +++- src/core/worker.js | 50 ++- src/display/annotation_helper.js | 26 +- src/display/api.js | 53 ++- src/display/canvas.js | 50 ++- src/display/dom_utils.js | 17 +- src/display/font_loader.js | 30 +- src/display/metadata.js | 17 +- src/display/pattern_helper.js | 34 +- src/display/svg.js | 25 +- src/display/text_layer.js | 18 +- src/display/webgl.js | 17 +- src/expose_to_global.js | 35 ++ src/shared/global.js | 47 +++ src/shared/util.js | 108 +++-- src/worker_loader.js | 44 +- test/driver.js | 7 +- test/font/font_test.html | 53 ++- test/test_slave.html | 13 +- test/unit/font_spec.js | 8 +- test/unit/{obj_spec.js => primitives_spec.js} | 2 +- test/unit/unit_test.html | 57 +-- web/viewer.html | 13 +- 54 files changed, 1870 insertions(+), 565 deletions(-) rename src/core/{core.js => document.js} (87%) create mode 100644 src/core/primitives.js create mode 100644 src/expose_to_global.js create mode 100644 src/shared/global.js rename test/unit/{obj_spec.js => primitives_spec.js} (99%) diff --git a/.jshintrc b/.jshintrc index b777537c4ff0bc..19c53a416e27d8 100644 --- a/.jshintrc +++ b/.jshintrc @@ -3,6 +3,12 @@ "browser": true, "devel": true, "worker": true, + "predef": [ + "Promise", + "require", + "define", + "exports" + ], // Enforcing "maxlen": 80, diff --git a/examples/acroforms/index.html b/examples/acroforms/index.html index d6c644f4457df1..cde25f5ccc6379 100644 --- a/examples/acroforms/index.html +++ b/examples/acroforms/index.html @@ -4,17 +4,17 @@ + + - + + - + - - - - - + + + - + + - + - - - - + + - - - + + + + + - - - + + + + + + + + - - + + + + + + + + + + + + + + + + - + + + - - + - - - - - - - - - - - + + + - - + diff --git a/test/test_slave.html b/test/test_slave.html index 7236914d5fc512..ed1be9c0a39e5a 100644 --- a/test/test_slave.html +++ b/test/test_slave.html @@ -18,16 +18,17 @@ PDF.js test slave + + - + + - + - - - - + + diff --git a/test/unit/font_spec.js b/test/unit/font_spec.js index 7f25ac0c098f36..1eff8a22df2784 100644 --- a/test/unit/font_spec.js +++ b/test/unit/font_spec.js @@ -109,7 +109,7 @@ describe('font', function() { it('parses a CharString endchar with 4 args w/seac enabled', function() { var seacAnalysisState = SEAC_ANALYSIS_ENABLED; try { - SEAC_ANALYSIS_ENABLED = true; + window.pdfjsCoreFonts._enableSeacAnalysis(true); var bytes = new Uint8Array([0, 1, // count 1, // offsetSize 0, // offset[0] @@ -125,14 +125,14 @@ describe('font', function() { expect(result.seacs[0][2]).toEqual(65); expect(result.seacs[0][3]).toEqual(194); } finally { - SEAC_ANALYSIS_ENABLED = seacAnalysisState; + window.pdfjsCoreFonts._enableSeacAnalysis(seacAnalysisState); } }); it('parses a CharString endchar with 4 args w/seac disabled', function() { var seacAnalysisState = SEAC_ANALYSIS_ENABLED; try { - SEAC_ANALYSIS_ENABLED = false; + window.pdfjsCoreFonts._enableSeacAnalysis(false); var bytes = new Uint8Array([0, 1, // count 1, // offsetSize 0, // offset[0] @@ -143,7 +143,7 @@ describe('font', function() { expect(result.charStrings.get(0).length).toEqual(9); expect(result.seacs.length).toEqual(0); } finally { - SEAC_ANALYSIS_ENABLED = seacAnalysisState; + window.pdfjsCoreFonts._enableSeacAnalysis(seacAnalysisState); } }); diff --git a/test/unit/obj_spec.js b/test/unit/primitives_spec.js similarity index 99% rename from test/unit/obj_spec.js rename to test/unit/primitives_spec.js index 7b91899e2033e3..20482ea4dbdf77 100644 --- a/test/unit/obj_spec.js +++ b/test/unit/primitives_spec.js @@ -3,7 +3,7 @@ 'use strict'; -describe('obj', function() { +describe('primitives', function() { describe('Name', function() { it('should retain the given name', function() { diff --git a/test/unit/unit_test.html b/test/unit/unit_test.html index fcce65d1961b5c..fe5178746a3271 100644 --- a/test/unit/unit_test.html +++ b/test/unit/unit_test.html @@ -12,42 +12,51 @@ - - - - - - - - - - + - - - - - - - + - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + - + diff --git a/web/viewer.html b/web/viewer.html index dbbaece086a8ec..9f6eab6e31a41a 100644 --- a/web/viewer.html +++ b/web/viewer.html @@ -53,16 +53,17 @@ + + - + + - + - - - - + +