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
90b7a523
Commit
90b7a523
authored
Jul 28, 2021
by
Eduardo Sanz García
Committed by
Eduardo
Aug 05, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Prepend all internal fields with underscore
parent
c8316748
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
13 deletions
+13
-13
cross-frame.js
src/annotator/cross-frame.js
+13
-13
No files found.
src/annotator/cross-frame.js
View file @
90b7a523
...
@@ -28,9 +28,9 @@ export class CrossFrame {
...
@@ -28,9 +28,9 @@ export class CrossFrame {
* @param {Record<string, any>} config
* @param {Record<string, any>} config
*/
*/
constructor
(
element
,
eventBus
,
config
)
{
constructor
(
element
,
eventBus
,
config
)
{
this
.
bridge
=
new
Bridge
();
this
.
_
bridge
=
new
Bridge
();
this
.
annotationSync
=
new
AnnotationSync
(
eventBus
,
this
.
bridge
);
this
.
_annotationSync
=
new
AnnotationSync
(
eventBus
,
this
.
_
bridge
);
this
.
frameObserver
=
new
FrameObserver
(
element
);
this
.
_
frameObserver
=
new
FrameObserver
(
element
);
const
frameIdentifiers
=
new
Map
();
const
frameIdentifiers
=
new
Map
();
/**
/**
...
@@ -56,11 +56,11 @@ export class CrossFrame {
...
@@ -56,11 +56,11 @@ export class CrossFrame {
};
};
const
iframeUnloaded
=
frame
=>
{
const
iframeUnloaded
=
frame
=>
{
this
.
bridge
.
call
(
'destroyFrame'
,
frameIdentifiers
.
get
(
frame
));
this
.
_
bridge
.
call
(
'destroyFrame'
,
frameIdentifiers
.
get
(
frame
));
frameIdentifiers
.
delete
(
frame
);
frameIdentifiers
.
delete
(
frame
);
};
};
this
.
frameObserver
.
observe
(
injectIntoFrame
,
iframeUnloaded
);
this
.
_
frameObserver
.
observe
(
injectIntoFrame
,
iframeUnloaded
);
}
}
/**
/**
...
@@ -80,16 +80,16 @@ export class CrossFrame {
...
@@ -80,16 +80,16 @@ export class CrossFrame {
origin
,
origin
,
[
channel
.
port2
]
[
channel
.
port2
]
);
);
this
.
bridge
.
createChannel
(
channel
.
port1
);
this
.
_
bridge
.
createChannel
(
channel
.
port1
);
}
}
/**
/**
* Remove the connection between the sidebar and annotator.
* Remove the connection between the sidebar and annotator.
*/
*/
destroy
()
{
destroy
()
{
this
.
bridge
.
destroy
();
this
.
_
bridge
.
destroy
();
this
.
annotationSync
.
destroy
();
this
.
_
annotationSync
.
destroy
();
this
.
frameObserver
.
disconnect
();
this
.
_
frameObserver
.
disconnect
();
}
}
/**
/**
...
@@ -98,7 +98,7 @@ export class CrossFrame {
...
@@ -98,7 +98,7 @@ export class CrossFrame {
* @param {AnnotationData[]} annotations
* @param {AnnotationData[]} annotations
*/
*/
sync
(
annotations
)
{
sync
(
annotations
)
{
this
.
annotationSync
.
sync
(
annotations
);
this
.
_
annotationSync
.
sync
(
annotations
);
}
}
/**
/**
...
@@ -113,7 +113,7 @@ export class CrossFrame {
...
@@ -113,7 +113,7 @@ export class CrossFrame {
* @throws {Error} If trying to register a callback with the same name multiple times
* @throws {Error} If trying to register a callback with the same name multiple times
*/
*/
on
(
method
,
listener
)
{
on
(
method
,
listener
)
{
this
.
bridge
.
on
(
method
,
listener
);
this
.
_
bridge
.
on
(
method
,
listener
);
}
}
/**
/**
...
@@ -127,7 +127,7 @@ export class CrossFrame {
...
@@ -127,7 +127,7 @@ export class CrossFrame {
* it means successful execution of the whole remote procedure call.
* it means successful execution of the whole remote procedure call.
*/
*/
call
(
method
,
...
args
)
{
call
(
method
,
...
args
)
{
this
.
bridge
.
call
(
method
,
...
args
);
this
.
_
bridge
.
call
(
method
,
...
args
);
}
}
/**
/**
...
@@ -137,6 +137,6 @@ export class CrossFrame {
...
@@ -137,6 +137,6 @@ export class CrossFrame {
* @param {(channel: RPC) => void} callback
* @param {(channel: RPC) => void} callback
*/
*/
onConnect
(
callback
)
{
onConnect
(
callback
)
{
this
.
bridge
.
onConnect
(
callback
);
this
.
_
bridge
.
onConnect
(
callback
);
}
}
}
}
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