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
1f7174f6
Commit
1f7174f6
authored
Sep 11, 2020
by
Robert Knight
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Convert Guest class to JS
parent
70693ddf
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
667 additions
and
528 deletions
+667
-528
guest.coffee
src/annotator/guest.coffee
+0
-519
guest.js
src/annotator/guest.js
+660
-0
host.js
src/annotator/host.js
+1
-3
index.js
src/annotator/index.js
+5
-5
guest-test.coffee
src/annotator/test/guest-test.coffee
+1
-1
No files found.
src/annotator/guest.coffee
deleted
100644 → 0
View file @
70693ddf
This diff is collapsed.
Click to expand it.
src/annotator/guest.js
0 → 100644
View file @
1f7174f6
This diff is collapsed.
Click to expand it.
src/annotator/host.js
View file @
1f7174f6
// TODO - Convert this to an ES import once the `Guest` class is converted to JS.
// @ts-expect-error
const
Guest
=
require
(
'./guest'
);
import
Guest
from
'./guest'
;
export
default
class
Host
extends
Guest
{
constructor
(
element
,
config
)
{
...
...
src/annotator/index.js
View file @
1f7174f6
...
...
@@ -20,19 +20,18 @@ import iconSet from './icons';
registerIcons
(
iconSet
);
import
configFrom
from
'./config/index'
;
import
PdfSidebar
from
'./pdf-sidebar
'
;
import
CrossFramePlugin
from
'./plugin/cross-frame
'
;
import
DocumentPlugin
from
'./plugin/document'
;
import
Guest
from
'./guest'
;
import
PdfSidebar
from
'./pdf-sidebar'
;
import
Sidebar
from
'./sidebar'
;
// Modules that are still written in CoffeeScript and need to be converted to
// JS.
// @ts-expect-error
import
Guest
from
'./guest'
;
// @ts-expect-error
import
BucketBarPlugin
from
'./plugin/bucket-bar'
;
import
CrossFramePlugin
from
'./plugin/cross-frame'
;
// @ts-expect-error
import
PDFPlugin
from
'./plugin/pdf'
;
import
Sidebar
from
'./sidebar'
;
const
pluginClasses
=
{
// UI plugins
...
...
@@ -59,6 +58,7 @@ const config = configFrom(window);
$
.
noConflict
(
true
)(
function
()
{
const
isPDF
=
typeof
window_
.
PDFViewerApplication
!==
'undefined'
;
/** @type {new (e: Element, config: any) => Guest} */
let
Klass
=
isPDF
?
PdfSidebar
:
Sidebar
;
if
(
config
.
subFrameIdentifier
)
{
...
...
src/annotator/test/guest-test.coffee
View file @
1f7174f6
...
...
@@ -5,7 +5,7 @@ Plugin = require('../plugin')
{
default
:
Delegator
}
=
require
(
'../delegator'
)
$
=
require
(
'jquery'
)
Guest
=
require
(
'../guest'
)
{
default
:
Guest
}
=
require
(
'../guest'
)
{
$imports
}
=
require
(
'../guest'
)
rangeUtil
=
null
selections
=
null
...
...
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