Commit f6e559e1 authored by Robert Knight's avatar Robert Knight

Convert src/annotator/plugin to ES modules

parent 37179c53
......@@ -10,16 +10,16 @@
** https://github.com/openannotation/annotator/blob/master/LICENSE
*/
const baseURI = require('document-base-uri');
import baseURI from 'document-base-uri';
const Plugin = require('../plugin');
const { normalizeURI } = require('../util/url');
import Plugin from '../plugin';
import { normalizeURI } from '../util/url';
/**
* DocumentMeta reads metadata/links from the current HTML document and
* populates the `document` property of new annotations.
*/
class DocumentMeta extends Plugin {
export default class DocumentMeta extends Plugin {
constructor(element, options) {
super(element, options);
......@@ -298,5 +298,3 @@ class DocumentMeta extends Plugin {
return href;
}
}
module.exports = DocumentMeta;
const { normalizeURI } = require('../util/url');
import { normalizeURI } from '../util/url';
/**
* @typedef Link
......@@ -25,7 +25,7 @@ const { normalizeURI } = require('../util/url');
* // Do something with the URL of the PDF.
* })
*/
class PDFMetadata {
export default class PDFMetadata {
/**
* Construct a `PDFMetadata` that returns URIs/metadata associated with a
* given PDF viewer.
......@@ -126,5 +126,3 @@ function getPDFURL(app) {
return null;
}
module.exports = PDFMetadata;
......@@ -10,10 +10,10 @@
** https://github.com/openannotation/annotator/blob/master/LICENSE
*/
const $ = require('jquery');
import $ from 'jquery';
const DocumentMeta = require('../document');
const { normalizeURI } = require('../../util/url');
import { normalizeURI } from '../../util/url';
import DocumentMeta from '../document';
describe('DocumentMeta', function() {
let fakeNormalizeURI;
......
const PDFMetadata = require('../pdf-metadata');
import PDFMetadata from '../pdf-metadata';
/**
* Fake implementation of PDF.js `window.PDFViewerApplication.metadata`.
......
const $ = require('jquery');
import $ from 'jquery';
const Toolbar = require('../toolbar');
import Toolbar from '../toolbar';
describe('Toolbar', () => {
let container;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment