Replace pdfjsLib with module that represents pdf.js.
This commit is contained in:
parent
006e8fb59d
commit
4165cedc9f
@ -12,22 +12,22 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
/*globals pdfjsLib */
|
||||
|
||||
'use strict';
|
||||
|
||||
(function (root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
define('pdfjs-web/annotation_layer_builder', ['exports',
|
||||
'pdfjs-web/ui_utils', 'pdfjs-web/pdf_link_service'], factory);
|
||||
'pdfjs-web/ui_utils', 'pdfjs-web/pdf_link_service',
|
||||
'pdfjs-web/pdfjs'], factory);
|
||||
} else if (typeof exports !== 'undefined') {
|
||||
factory(exports, require('./ui_utils.js'),
|
||||
require('./pdf_link_service.js'));
|
||||
require('./pdf_link_service.js'), require('./pdfjs.js'));
|
||||
} else {
|
||||
factory((root.pdfjsWebAnnotationLayerBuilder = {}), root.pdfjsWebUIUtils,
|
||||
root.pdfjsWebPDFLinkService);
|
||||
root.pdfjsWebPDFLinkService, root.pdfjsWebPDFJS);
|
||||
}
|
||||
}(this, function (exports, uiUtils, pdfLinkService) {
|
||||
}(this, function (exports, uiUtils, pdfLinkService, pdfjsLib) {
|
||||
|
||||
var mozL10n = uiUtils.mozL10n;
|
||||
var SimpleLinkService = pdfLinkService.SimpleLinkService;
|
||||
|
13
web/app.js
13
web/app.js
@ -12,7 +12,7 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
/* globals DEFAULT_URL, pdfjsLib, PDFBug, Stats */
|
||||
/* globals DEFAULT_URL, PDFBug, Stats */
|
||||
|
||||
'use strict';
|
||||
|
||||
@ -28,7 +28,8 @@
|
||||
'pdfjs-web/pdf_rendering_queue', 'pdfjs-web/pdf_link_service',
|
||||
'pdfjs-web/pdf_outline_viewer', 'pdfjs-web/overlay_manager',
|
||||
'pdfjs-web/pdf_attachment_viewer', 'pdfjs-web/pdf_find_controller',
|
||||
'pdfjs-web/pdf_find_bar', 'pdfjs-web/mozPrintCallback_polyfill'],
|
||||
'pdfjs-web/pdf_find_bar', 'pdfjs-web/mozPrintCallback_polyfill',
|
||||
'pdfjs-web/pdfjs'],
|
||||
factory);
|
||||
} else if (typeof exports !== 'undefined') {
|
||||
factory(exports, require('./ui_utils.js'), require('./firefoxcom.js'),
|
||||
@ -42,7 +43,7 @@
|
||||
require('./pdf_link_service.js'), require('./pdf_outline_viewer.js'),
|
||||
require('./overlay_manager.js'), require('./pdf_attachment_viewer.js'),
|
||||
require('./pdf_find_controller.js'), require('./pdf_find_bar.js'),
|
||||
require('./mozPrintCallback_polyfill.js'));
|
||||
require('./mozPrintCallback_polyfill.js'), require('./pdfjs.js'));
|
||||
} else {
|
||||
factory((root.pdfjsWebApp = {}), root.pdfjsWebUIUtils,
|
||||
root.pdfjsWebFirefoxCom, root.pdfjsWebDownloadManager,
|
||||
@ -55,7 +56,7 @@
|
||||
root.pdfjsWebPDFLinkService, root.pdfjsWebPDFOutlineViewer,
|
||||
root.pdfjsWebOverlayManager, root.pdfjsWebPDFAttachmentViewer,
|
||||
root.pdfjsWebPDFFindController, root.pdfjsWebPDFFindBar,
|
||||
root.pdfjsWebMozPrintCallbackPolyfill);
|
||||
root.pdfjsWebMozPrintCallbackPolyfill, root.pdfjsWebPDFJS);
|
||||
}
|
||||
}(this, function (exports, uiUtilsLib, firefoxComLib, downloadManagerLib,
|
||||
pdfHistoryLib, preferencesLib, pdfSidebarLib, viewHistoryLib,
|
||||
@ -64,7 +65,7 @@
|
||||
pdfViewerLib, pdfRenderingQueueLib, pdfLinkServiceLib,
|
||||
pdfOutlineViewerLib, overlayManagerLib,
|
||||
pdfAttachmentViewerLib, pdfFindControllerLib, pdfFindBarLib,
|
||||
mozPrintCallbackPolyfillLib) {
|
||||
mozPrintCallbackPolyfillLib, pdfjsLib) {
|
||||
|
||||
var FirefoxCom = firefoxComLib.FirefoxCom;
|
||||
var UNKNOWN_SCALE = uiUtilsLib.UNKNOWN_SCALE;
|
||||
@ -1423,7 +1424,7 @@ function webViewerInitialized() {
|
||||
var pdfBug = hashParams['pdfbug'];
|
||||
var enabled = pdfBug.split(',');
|
||||
PDFBug.enable(enabled);
|
||||
PDFBug.init();
|
||||
PDFBug.init(pdfjsLib);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -13,20 +13,21 @@
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
/* globals chrome, pdfjsLib */
|
||||
/* globals chrome */
|
||||
'use strict';
|
||||
|
||||
(function (root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
define('pdfjs-web/chromecom', ['exports', 'pdfjs-web/app',
|
||||
'pdfjs-web/overlay_manager'], factory);
|
||||
'pdfjs-web/overlay_manager', 'pdfjs-web/pdfjs'], factory);
|
||||
} else if (typeof exports !== 'undefined') {
|
||||
factory(exports, require('./app.js'), require('./overlay_manager.js'));
|
||||
factory(exports, require('./app.js'), require('./overlay_manager.js'),
|
||||
require('./pdfjs.js'));
|
||||
} else {
|
||||
factory((root.pdfjsWebChromeCom = {}), root.pdfjsWebApp,
|
||||
root.pdfjsWebOverlayManager);
|
||||
root.pdfjsWebOverlayManager, root.pdfjsWebPDFJS);
|
||||
}
|
||||
}(this, function (exports, app, overlayManager) {
|
||||
}(this, function (exports, app, overlayManager, pdfjsLib) {
|
||||
//#if CHROME
|
||||
//#if !CHROME
|
||||
if (true) { return; } // TODO ensure nothing depends on this module.
|
||||
|
@ -12,7 +12,6 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
/* globals pdfjsLib */
|
||||
|
||||
'use strict';
|
||||
|
||||
@ -65,7 +64,7 @@ var FontInspector = (function FontInspectorClosure() {
|
||||
name: 'Font Inspector',
|
||||
panel: null,
|
||||
manager: null,
|
||||
init: function init() {
|
||||
init: function init(pdfjsLib) {
|
||||
var panel = this.panel;
|
||||
panel.setAttribute('style', 'padding: 5px;');
|
||||
var tmp = document.createElement('button');
|
||||
@ -291,7 +290,7 @@ var Stepper = (function StepperClosure() {
|
||||
this.operatorListIdx = 0;
|
||||
}
|
||||
Stepper.prototype = {
|
||||
init: function init() {
|
||||
init: function init(pdfjsLib) {
|
||||
var panel = this.panel;
|
||||
var content = c('div', 'c=continue, s=step');
|
||||
var table = c('table');
|
||||
@ -458,7 +457,7 @@ var Stats = (function Stats() {
|
||||
name: 'Stats',
|
||||
panel: null,
|
||||
manager: null,
|
||||
init: function init() {
|
||||
init: function init(pdfjsLib) {
|
||||
this.panel.setAttribute('style', 'padding: 5px;');
|
||||
pdfjsLib.PDFJS.enableStats = true;
|
||||
},
|
||||
@ -532,7 +531,7 @@ var PDFBug = (function PDFBugClosure() {
|
||||
});
|
||||
}
|
||||
},
|
||||
init: function init() {
|
||||
init: function init(pdfjsLib) {
|
||||
/*
|
||||
* Basic Layout:
|
||||
* PDFBug
|
||||
@ -576,7 +575,7 @@ var PDFBug = (function PDFBugClosure() {
|
||||
tool.panel = panel;
|
||||
tool.manager = this;
|
||||
if (tool.enabled) {
|
||||
tool.init();
|
||||
tool.init(pdfjsLib);
|
||||
} else {
|
||||
panel.textContent = tool.name + ' is disabled. To enable add ' +
|
||||
' "' + tool.id + '" to the pdfBug parameter ' +
|
||||
|
@ -12,19 +12,19 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
/* globals pdfjsLib */
|
||||
|
||||
'use strict';
|
||||
|
||||
(function (root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
define('pdfjs-web/download_manager', ['exports'], factory);
|
||||
define('pdfjs-web/download_manager', ['exports', 'pdfjs-web/pdfjs'],
|
||||
factory);
|
||||
} else if (typeof exports !== 'undefined') {
|
||||
factory(exports);
|
||||
factory(exports, require('./pdfjs.js'));
|
||||
} else {
|
||||
factory((root.pdfjsWebDownloadManager = {}));
|
||||
factory((root.pdfjsWebDownloadManager = {}), root.pdfjsWebPDFJS);
|
||||
}
|
||||
}(this, function (exports) {
|
||||
}(this, function (exports, pdfjsLib) {
|
||||
//#if GENERIC || CHROME
|
||||
function download(blobUrl, filename) {
|
||||
var a = document.createElement('a');
|
||||
|
@ -12,20 +12,20 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
/* globals pdfjsLib */
|
||||
|
||||
'use strict';
|
||||
|
||||
(function (root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
define('pdfjs-web/firefoxcom', ['exports', 'pdfjs-web/preferences'],
|
||||
factory);
|
||||
define('pdfjs-web/firefoxcom', ['exports', 'pdfjs-web/preferences',
|
||||
'pdfjs-web/pdfjs'], factory);
|
||||
} else if (typeof exports !== 'undefined') {
|
||||
factory(exports, require('./preferences.js'));
|
||||
factory(exports, require('./preferences.js'), require('./pdfjs.js'));
|
||||
} else {
|
||||
factory((root.pdfjsWebFirefoxCom = {}), root.pdfjsWebPreferences);
|
||||
factory((root.pdfjsWebFirefoxCom = {}), root.pdfjsWebPreferences,
|
||||
root.pdfjsWebPDFJS);
|
||||
}
|
||||
}(this, function (exports, preferences) {
|
||||
}(this, function (exports, preferences, pdfjsLib) {
|
||||
//#if FIREFOX || MOZCENTRAL
|
||||
//#if !(FIREFOX || MOZCENTRAL)
|
||||
if (true) { return; } // TODO ensure nothing depends on this module.
|
||||
|
@ -12,21 +12,22 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
/* globals pdfjsLib */
|
||||
|
||||
'use strict';
|
||||
|
||||
(function (root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
define('pdfjs-web/password_prompt', ['exports',
|
||||
'pdfjs-web/ui_utils', 'pdfjs-web/overlay_manager'], factory);
|
||||
'pdfjs-web/ui_utils', 'pdfjs-web/overlay_manager', 'pdfjs-web/pdfjs'],
|
||||
factory);
|
||||
} else if (typeof exports !== 'undefined') {
|
||||
factory(exports, require('./ui_utils.js'), require('./overlay_manager.js'));
|
||||
factory(exports, require('./ui_utils.js'), require('./overlay_manager.js'),
|
||||
require('./pdfjs.js'));
|
||||
} else {
|
||||
factory((root.pdfjsWebPasswordPrompt = {}), root.pdfjsWebUIUtils,
|
||||
root.pdfjsWebOverlayManager);
|
||||
root.pdfjsWebOverlayManager, root.pdfjsWebPDFJS);
|
||||
}
|
||||
}(this, function (exports, uiUtils, overlayManager) {
|
||||
}(this, function (exports, uiUtils, overlayManager, pdfjsLib) {
|
||||
|
||||
var mozL10n = uiUtils.mozL10n;
|
||||
var OverlayManager = overlayManager.OverlayManager;
|
||||
|
@ -12,19 +12,19 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
/* globals pdfjsLib */
|
||||
|
||||
'use strict';
|
||||
|
||||
(function (root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
define('pdfjs-web/pdf_attachment_viewer', ['exports'], factory);
|
||||
define('pdfjs-web/pdf_attachment_viewer', ['exports', 'pdfjs-web/pdfjs'],
|
||||
factory);
|
||||
} else if (typeof exports !== 'undefined') {
|
||||
factory(exports);
|
||||
factory(exports, require('./pdfjs.js'));
|
||||
} else {
|
||||
factory((root.pdfjsWebPDFAttachmentViewer = {}));
|
||||
factory((root.pdfjsWebPDFAttachmentViewer = {}), root.pdfjsWebPDFJS);
|
||||
}
|
||||
}(this, function (exports) {
|
||||
}(this, function (exports, pdfjsLib) {
|
||||
|
||||
/**
|
||||
* @typedef {Object} PDFAttachmentViewerOptions
|
||||
|
@ -12,19 +12,19 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
/* globals pdfjsLib */
|
||||
|
||||
'use strict';
|
||||
|
||||
(function (root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
define('pdfjs-web/pdf_outline_viewer', ['exports'], factory);
|
||||
define('pdfjs-web/pdf_outline_viewer', ['exports', 'pdfjs-web/pdfjs'],
|
||||
factory);
|
||||
} else if (typeof exports !== 'undefined') {
|
||||
factory(exports);
|
||||
factory(exports, require('./pdfjs.js'));
|
||||
} else {
|
||||
factory((root.pdfjsWebPDFOutlineViewer = {}));
|
||||
factory((root.pdfjsWebPDFOutlineViewer = {}), root.pdfjsWebPDFJS);
|
||||
}
|
||||
}(this, function (exports) {
|
||||
}(this, function (exports, pdfjsLib) {
|
||||
|
||||
var DEFAULT_TITLE = '\u2013';
|
||||
|
||||
|
@ -12,22 +12,22 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
/* globals pdfjsLib */
|
||||
|
||||
'use strict';
|
||||
|
||||
(function (root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
define('pdfjs-web/pdf_page_view', ['exports',
|
||||
'pdfjs-web/ui_utils', 'pdfjs-web/pdf_rendering_queue'], factory);
|
||||
'pdfjs-web/ui_utils', 'pdfjs-web/pdf_rendering_queue',
|
||||
'pdfjs-web/pdfjs'], factory);
|
||||
} else if (typeof exports !== 'undefined') {
|
||||
factory(exports, require('./ui_utils.js'),
|
||||
require('./pdf_rendering_queue.js'));
|
||||
require('./pdf_rendering_queue.js'), require('./pdfjs.js'));
|
||||
} else {
|
||||
factory((root.pdfjsWebPDFPageView = {}), root.pdfjsWebUIUtils,
|
||||
root.pdfjsWebPDFRenderingQueue);
|
||||
root.pdfjsWebPDFRenderingQueue, root.pdfjsWebPDFJS);
|
||||
}
|
||||
}(this, function (exports, uiUtils, pdfRenderingQueue) {
|
||||
}(this, function (exports, uiUtils, pdfRenderingQueue, pdfjsLib) {
|
||||
|
||||
var CSS_UNITS = uiUtils.CSS_UNITS;
|
||||
var DEFAULT_SCALE = uiUtils.DEFAULT_SCALE;
|
||||
|
@ -12,29 +12,31 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
/*jshint globalstrict: false */
|
||||
/* jshint globalstrict: false */
|
||||
/* umdutils ignore */
|
||||
|
||||
(function pdfViewerWrapper() {
|
||||
(function (root, factory) {
|
||||
'use strict';
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
define('pdfjs-dist/web/pdf.components', ['exports', 'pdfjs-dist/build/pdf'],
|
||||
factory);
|
||||
} else if (typeof exports !== 'undefined') {
|
||||
factory(exports, require('../build/pdf.js'));
|
||||
} else {
|
||||
factory((root.pdfjsDistWebPDFComponents = {}), root.pdfjsDistBuildPdf);
|
||||
}
|
||||
}(this, function (exports, pdfjsLib) {
|
||||
'use strict';
|
||||
|
||||
var root = this;
|
||||
if (!root.pdfjsLib) {
|
||||
Object.defineProperty(root, 'pdfjsLib', {
|
||||
get: function () {
|
||||
return root.pdfjsDistBuildPdf || root.pdfjsDistBuildPdfCombined ||
|
||||
root.pdfjsMainLoader;
|
||||
},
|
||||
enumerable: true,
|
||||
configurable: true
|
||||
});
|
||||
}
|
||||
var pdfViewerLibs = {
|
||||
pdfjsWebPDFJS: pdfjsLib
|
||||
};
|
||||
|
||||
var pdfViewerLibs = {};
|
||||
(function () {
|
||||
//#expand __BUNDLE__
|
||||
}).call(pdfViewerLibs);
|
||||
|
||||
var PDFJS = window.PDFJS || (window.PDFJS = {});
|
||||
var PDFJS = pdfjsLib.PDFJS;
|
||||
|
||||
PDFJS.PDFViewer = pdfViewerLibs.pdfjsWebPDFViewer.PDFViewer;
|
||||
PDFJS.PDFPageView = pdfViewerLibs.pdfjsWebPDFPageView.PDFPageView;
|
||||
@ -51,4 +53,6 @@
|
||||
|
||||
PDFJS.DownloadManager = pdfViewerLibs.pdfjsWebDownloadManager.DownloadManager;
|
||||
PDFJS.ProgressBar = pdfViewerLibs.pdfjsWebUIUtils.ProgressBar;
|
||||
}).call((typeof window === 'undefined') ? this : window);
|
||||
|
||||
exports.PDFJS = PDFJS;
|
||||
}));
|
||||
|
@ -12,7 +12,6 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
/* globals pdfjsLib */
|
||||
|
||||
'use strict';
|
||||
|
||||
@ -21,20 +20,21 @@
|
||||
define('pdfjs-web/pdf_viewer', ['exports', 'pdfjs-web/ui_utils',
|
||||
'pdfjs-web/pdf_page_view', 'pdfjs-web/pdf_rendering_queue',
|
||||
'pdfjs-web/text_layer_builder', 'pdfjs-web/annotation_layer_builder',
|
||||
'pdfjs-web/pdf_link_service'], factory);
|
||||
'pdfjs-web/pdf_link_service', 'pdfjs-web/pdfjs'], factory);
|
||||
} else if (typeof exports !== 'undefined') {
|
||||
factory(exports, require('./ui_utils.js'), require('./pdf_page_view.js'),
|
||||
require('./pdf_rendering_queue.js'), require('./text_layer_builder.js'),
|
||||
require('./annotation_layer_builder.js'),
|
||||
require('./pdf_link_service.js'));
|
||||
require('./pdf_link_service.js'), require('./pdfjs.js'));
|
||||
} else {
|
||||
factory((root.pdfjsWebPDFViewer = {}), root.pdfjsWebUIUtils,
|
||||
root.pdfjsWebPDFPageView, root.pdfjsWebPDFRenderingQueue,
|
||||
root.pdfjsWebTextLayerBuilder, root.pdfjsWebAnnotationLayerBuilder,
|
||||
root.pdfjsWebPDFLinkService);
|
||||
root.pdfjsWebPDFLinkService, root.pdfjsWebPDFJS);
|
||||
}
|
||||
}(this, function (exports, uiUtils, pdfPageView, pdfRenderingQueue,
|
||||
textLayerBuilder, annotationLayerBuilder, pdfLinkService) {
|
||||
textLayerBuilder, annotationLayerBuilder, pdfLinkService,
|
||||
pdfjsLib) {
|
||||
|
||||
var UNKNOWN_SCALE = uiUtils.UNKNOWN_SCALE;
|
||||
var SCROLLBAR_PADDING = uiUtils.SCROLLBAR_PADDING;
|
||||
|
34
web/pdfjs.js
Normal file
34
web/pdfjs.js
Normal file
@ -0,0 +1,34 @@
|
||||
/* Copyright 2016 Mozilla Foundation
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
*
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
/* umdutils ignore */
|
||||
|
||||
'use strict';
|
||||
|
||||
(function (root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
define('pdfjs-web/pdfjs', ['exports', 'pdfjs/main_loader'], factory);
|
||||
} else if (typeof exports !== 'undefined') {
|
||||
factory(exports, require('../src/main_loader.js'));
|
||||
} else {
|
||||
factory((root.pdfjsWebPDFJS = {}), root.pdfjsMainLoader);
|
||||
}
|
||||
}(this, function (exports, mainLoader) {
|
||||
// Re-export all mainLoader members.
|
||||
for (var i in mainLoader) {
|
||||
if (Object.prototype.hasOwnProperty.call(mainLoader, i)) {
|
||||
exports[i] = mainLoader[i];
|
||||
}
|
||||
}
|
||||
}));
|
@ -12,19 +12,19 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
/* globals pdfjsLib */
|
||||
|
||||
'use strict';
|
||||
|
||||
(function (root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
define('pdfjs-web/text_layer_builder', ['exports'], factory);
|
||||
define('pdfjs-web/text_layer_builder', ['exports', 'pdfjs-web/pdfjs'],
|
||||
factory);
|
||||
} else if (typeof exports !== 'undefined') {
|
||||
factory(exports);
|
||||
factory(exports, require('./pdfjs.js'));
|
||||
} else {
|
||||
factory((root.pdfjsWebTextLayerBuilder = {}));
|
||||
factory((root.pdfjsWebTextLayerBuilder = {}), root.pdfjsWebPDFJS);
|
||||
}
|
||||
}(this, function (exports) {
|
||||
}(this, function (exports, pdfjsLib) {
|
||||
|
||||
/**
|
||||
* @typedef {Object} TextLayerBuilderOptions
|
||||
|
@ -12,19 +12,18 @@
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
/* globals PDFJS */
|
||||
|
||||
'use strict';
|
||||
|
||||
(function (root, factory) {
|
||||
if (typeof define === 'function' && define.amd) {
|
||||
define('pdfjs-web/ui_utils', ['exports'], factory);
|
||||
define('pdfjs-web/ui_utils', ['exports', 'pdfjs-web/pdfjs'], factory);
|
||||
} else if (typeof exports !== 'undefined') {
|
||||
factory(exports);
|
||||
factory(exports, require('./pdfjs.js'));
|
||||
} else {
|
||||
factory((root.pdfjsWebUIUtils = {}));
|
||||
factory((root.pdfjsWebUIUtils = {}), root.pdfjsWebPDFJS);
|
||||
}
|
||||
}(this, function (exports) {
|
||||
}(this, function (exports, pdfjsLib) {
|
||||
|
||||
var CSS_UNITS = 96.0 / 72.0;
|
||||
var DEFAULT_SCALE_VALUE = 'auto';
|
||||
@ -36,9 +35,7 @@ var VERTICAL_PADDING = 5;
|
||||
|
||||
var mozL10n = document.mozL10n || document.webL10n;
|
||||
|
||||
if (typeof PDFJS === 'undefined') {
|
||||
(typeof window !== 'undefined' ? window : this).PDFJS = {};
|
||||
}
|
||||
var PDFJS = pdfjsLib.PDFJS;
|
||||
|
||||
/**
|
||||
* Disables fullscreen support, and by extension Presentation Mode,
|
||||
|
@ -18,10 +18,15 @@
|
||||
|
||||
var DEFAULT_URL = 'compressed.tracemonkey-pldi-09.pdf';
|
||||
|
||||
var pdfjsWebLibs = {};
|
||||
(function () {
|
||||
//#if PRODUCTION
|
||||
//var pdfjsWebLibs = {
|
||||
// pdfjsWebPDFJS: window.pdfjsDistBuildPdf
|
||||
//};
|
||||
//
|
||||
//(function () {
|
||||
//#expand __BUNDLE__
|
||||
}).call(pdfjsWebLibs);
|
||||
//}).call(pdfjsWebLibs);
|
||||
//#endif
|
||||
|
||||
//#if FIREFOX || MOZCENTRAL
|
||||
//// FIXME the l10n.js file in the Firefox extension needs global FirefoxCom.
|
||||
@ -48,13 +53,11 @@ var pdfjsWebLibs = {};
|
||||
function webViewerLoad() {
|
||||
//#if !PRODUCTION
|
||||
require.config({paths: {'pdfjs': '../src', 'pdfjs-web': '.'}});
|
||||
require(['pdfjs/main_loader', 'pdfjs-web/app'], function (loader, web) {
|
||||
window.pdfjsLib = loader;
|
||||
require(['pdfjs-web/app'], function (web) {
|
||||
window.PDFViewerApplication = web.PDFViewerApplication;
|
||||
web.PDFViewerApplication.run();
|
||||
});
|
||||
//#else
|
||||
//window.pdfjsLib = window.pdfjsDistBuildPdf;
|
||||
//window.PDFViewerApplication = pdfjsWebLibs.pdfjsWebApp.PDFViewerApplication;
|
||||
//pdfjsWebLibs.pdfjsWebApp.PDFViewerApplication.run();
|
||||
//#endif
|
||||
|
Loading…
Reference in New Issue
Block a user