Introduces UMD headers to the web/ folder.

This commit is contained in:
Yury Delendik 2016-04-08 12:34:27 -05:00
parent 1c253e6e1d
commit 006e8fb59d
39 changed files with 836 additions and 281 deletions

View file

@ -13,10 +13,27 @@
* limitations under the License.
*/
/* globals chrome, pdfjsLib, PDFViewerApplication, OverlayManager */
/* globals chrome, pdfjsLib */
'use strict';
var ChromeCom = (function ChromeComClosure() {
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define('pdfjs-web/chromecom', ['exports', 'pdfjs-web/app',
'pdfjs-web/overlay_manager'], factory);
} else if (typeof exports !== 'undefined') {
factory(exports, require('./app.js'), require('./overlay_manager.js'));
} else {
factory((root.pdfjsWebChromeCom = {}), root.pdfjsWebApp,
root.pdfjsWebOverlayManager);
}
}(this, function (exports, app, overlayManager) {
//#if CHROME
//#if !CHROME
if (true) { return; } // TODO ensure nothing depends on this module.
//#endif
var PDFViewerApplication = app.PDFViewerApplication;
var OverlayManager = overlayManager.OverlayManager;
var ChromeCom = {};
/**
* Creates an event that the extension is listening for and will
@ -205,7 +222,7 @@ var ChromeCom = (function ChromeComClosure() {
// because the shown string should match the UI at chrome://extensions.
// These strings are from chrome/app/resources/generated_resources_*.xtb.
var i18nFileAccessLabel =
//#include chrome-i18n-allow-access-to-file-urls.json
//#include $ROOT/web/chrome-i18n-allow-access-to-file-urls.json
[chrome.i18n.getUILanguage && chrome.i18n.getUILanguage()];
if (i18nFileAccessLabel) {
@ -304,5 +321,6 @@ var ChromeCom = (function ChromeComClosure() {
}
}
return ChromeCom;
})();
exports.ChromeCom = ChromeCom;
//#endif
}));