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
e3c14593
Commit
e3c14593
authored
Apr 21, 2021
by
Eduardo Sanz García
Committed by
Eduardo
Apr 27, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplification of code
A few lines have been removed as a result of the code simplification.
parent
a5c587c8
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
12 deletions
+3
-12
cross-frame.js
src/annotator/cross-frame.js
+1
-2
discovery.js
src/shared/discovery.js
+2
-10
No files found.
src/annotator/cross-frame.js
View file @
e3c14593
...
...
@@ -42,8 +42,6 @@ export class CrossFrame {
return
;
}
const
{
clientUrl
}
=
config
;
frameUtil
.
isLoaded
(
frame
,
()
=>
{
const
subFrameIdentifier
=
discovery
.
generateToken
();
frameIdentifiers
.
set
(
frame
,
subFrameIdentifier
);
...
...
@@ -52,6 +50,7 @@ export class CrossFrame {
subFrameIdentifier
,
};
const
{
clientUrl
}
=
config
;
frameUtil
.
injectHypothesis
(
frame
,
clientUrl
,
injectedConfig
);
});
};
...
...
src/shared/discovery.js
View file @
e3c14593
...
...
@@ -47,10 +47,10 @@ export default class Discovery {
* Set whether this frame acts as a server (fetches annotations from the
* API) or a client (contains annotatable content and displays highlights).
*/
this
.
server
=
false
;
this
.
server
=
options
.
server
??
false
;
/** Origins allowed to communicate with this frame. */
this
.
origin
=
'*'
;
this
.
origin
=
options
.
origin
??
'*'
;
/**
* Flag set in client frames to indicate when they are waiting for a
...
...
@@ -60,14 +60,6 @@ export default class Discovery {
this
.
onDiscovery
=
null
;
if
(
typeof
options
.
server
!==
'undefined'
)
{
this
.
server
=
options
.
server
;
}
if
(
typeof
options
.
origin
!==
'undefined'
)
{
this
.
origin
=
options
.
origin
;
}
this
.
_onMessage
=
this
.
_onMessage
.
bind
(
this
);
this
.
_listeners
=
new
ListenerCollection
();
}
...
...
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