Convert the files in the /web folder to ES6 modules

Note that as discussed on IRC, this makes the viewer slightly slower to load *only* in `gulp server` mode, however the difference seem slight enough that I think it will be fine.
This commit is contained in:
Jonas Jenwald 2017-03-28 01:07:27 +02:00
parent 313060aff5
commit 3b35c15d42
32 changed files with 1585 additions and 2045 deletions

View file

@ -13,19 +13,8 @@
* limitations under the License.
*/
'use strict';
(function (root, factory) {
if (typeof define === 'function' && define.amd) {
define('pdfjs-web/text_layer_builder', ['exports', 'pdfjs-web/dom_events',
'pdfjs-web/pdfjs'], factory);
} else if (typeof exports !== 'undefined') {
factory(exports, require('./dom_events.js'), require('./pdfjs.js'));
} else {
factory((root.pdfjsWebTextLayerBuilder = {}), root.pdfjsWebDOMEvents,
root.pdfjsWebPDFJS);
}
}(this, function (exports, domEvents, pdfjsLib) {
import * as pdfjsLib from 'pdfjs-web/pdfjs';
import { domEvents } from 'pdfjs-web/dom_events';
var EXPAND_DIVS_TIMEOUT = 300; // ms
@ -419,6 +408,7 @@ DefaultTextLayerFactory.prototype = {
}
};
exports.TextLayerBuilder = TextLayerBuilder;
exports.DefaultTextLayerFactory = DefaultTextLayerFactory;
}));
export {
TextLayerBuilder,
DefaultTextLayerFactory,
};