Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
coopwire-hypothesis
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
孙灵跃 Leon Sun
coopwire-hypothesis
Commits
f6e559e1
Commit
f6e559e1
authored
Jan 15, 2020
by
Robert Knight
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Convert src/annotator/plugin to ES modules
parent
37179c53
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
16 deletions
+12
-16
document.js
src/annotator/plugin/document.js
+4
-6
pdf-metadata.js
src/annotator/plugin/pdf-metadata.js
+2
-4
document-test.js
src/annotator/plugin/test/document-test.js
+3
-3
pdf-metadata-test.js
src/annotator/plugin/test/pdf-metadata-test.js
+1
-1
toolbar-test.js
src/annotator/plugin/test/toolbar-test.js
+2
-2
No files found.
src/annotator/plugin/document.js
View file @
f6e559e1
...
...
@@ -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
;
src/annotator/plugin/pdf-metadata.js
View file @
f6e559e1
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
;
src/annotator/plugin/test/document-test.js
View file @
f6e559e1
...
...
@@ -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
;
...
...
src/annotator/plugin/test/pdf-metadata-test.js
View file @
f6e559e1
const
PDFMetadata
=
require
(
'../pdf-metadata'
)
;
import
PDFMetadata
from
'../pdf-metadata'
;
/**
* Fake implementation of PDF.js `window.PDFViewerApplication.metadata`.
...
...
src/annotator/plugin/test/toolbar-test.js
View file @
f6e559e1
const
$
=
require
(
'jquery'
)
;
import
$
from
'jquery'
;
const
Toolbar
=
require
(
'../toolbar'
)
;
import
Toolbar
from
'../toolbar'
;
describe
(
'Toolbar'
,
()
=>
{
let
container
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment