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
62557943
Commit
62557943
authored
Feb 25, 2021
by
Eduardo Sanz García
Committed by
Eduardo
Feb 25, 2021
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removed references to 'plugin.BucketBar'
BucketBar is not used anymore as a plugin.
parent
4677e16f
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
14 deletions
+16
-14
guest.js
src/annotator/guest.js
+5
-2
sidebar.js
src/annotator/sidebar.js
+1
-1
guest-test.js
src/annotator/test/guest-test.js
+4
-4
sidebar-test.js
src/annotator/test/sidebar-test.js
+6
-7
No files found.
src/annotator/guest.js
View file @
62557943
...
...
@@ -152,6 +152,9 @@ export default class Guest extends Delegator {
this
.
plugins
=
{};
/** @typedef {import('./bucket-bar').default|null} */
this
.
bucketBar
=
null
;
/** @type {Anchor[]} */
this
.
anchors
=
[];
...
...
@@ -483,7 +486,7 @@ export default class Guest extends Delegator {
this
.
anchors
=
this
.
anchors
.
concat
(
anchors
);
// Let plugins know about the new information.
this
.
plugins
.
B
ucketBar
?.
update
();
this
.
b
ucketBar
?.
update
();
this
.
plugins
.
CrossFrame
?.
sync
([
annotation
]);
return
anchors
;
...
...
@@ -543,7 +546,7 @@ export default class Guest extends Delegator {
this
.
anchors
=
anchors
;
removeHighlights
(
unhighlight
);
this
.
plugins
.
B
ucketBar
?.
update
();
this
.
b
ucketBar
?.
update
();
}
/**
...
...
src/annotator/sidebar.js
View file @
62557943
...
...
@@ -78,7 +78,7 @@ export default class Sidebar extends Guest {
if
(
config
.
theme
===
'clean'
)
{
frame
.
classList
.
add
(
'annotator-frame--theme-clean'
);
}
else
{
this
.
plugins
.
BucketB
ar
=
new
BucketBar
(
frame
,
this
,
config
.
BucketBar
);
this
.
bucketb
ar
=
new
BucketBar
(
frame
,
this
,
config
.
BucketBar
);
}
// Undocumented switch to enable/disable the wrapping of the sidebar inside a shadow DOM
...
...
src/annotator/test/guest-test.js
View file @
62557943
...
...
@@ -770,10 +770,10 @@ describe('Guest', () => {
it
(
'updates the cross frame and bucket bar plugins'
,
()
=>
{
const
guest
=
createGuest
();
guest
.
plugins
.
CrossFrame
=
{
sync
:
sinon
.
stub
()
};
guest
.
plugins
.
B
ucketBar
=
{
update
:
sinon
.
stub
()
};
guest
.
b
ucketBar
=
{
update
:
sinon
.
stub
()
};
const
annotation
=
{};
return
guest
.
anchor
(
annotation
).
then
(()
=>
{
assert
.
called
(
guest
.
plugins
.
B
ucketBar
.
update
);
assert
.
called
(
guest
.
b
ucketBar
.
update
);
assert
.
called
(
guest
.
plugins
.
CrossFrame
.
sync
);
});
});
...
...
@@ -852,13 +852,13 @@ describe('Guest', () => {
it
(
'updates the bucket bar plugin'
,
()
=>
{
const
guest
=
createGuest
();
guest
.
plugins
.
B
ucketBar
=
{
update
:
sinon
.
stub
()
};
guest
.
b
ucketBar
=
{
update
:
sinon
.
stub
()
};
const
annotation
=
{};
guest
.
anchors
.
push
({
annotation
});
guest
.
detach
(
annotation
);
assert
.
calledOnce
(
guest
.
plugins
.
B
ucketBar
.
update
);
assert
.
calledOnce
(
guest
.
b
ucketBar
.
update
);
});
it
(
'removes any highlights associated with the annotation'
,
()
=>
{
...
...
src/annotator/test/sidebar-test.js
View file @
62557943
...
...
@@ -81,15 +81,13 @@ describe('Sidebar', () => {
const
fakeBucketBar
=
{};
fakeBucketBar
.
element
=
document
.
createElement
(
'div'
);
fakeBucketBar
.
destroy
=
sandbox
.
stub
();
const
BucketBar
=
sandbox
.
stub
();
BucketBar
.
returns
(
fakeBucketBar
);
CrossFrame
=
sandbox
.
stub
();
CrossFrame
.
returns
(
fakeCrossFrame
);
const
BucketBar
=
sandbox
.
stub
();
BucketBar
.
returns
(
fakeBucketBar
);
sidebarConfig
.
pluginClasses
.
CrossFrame
=
CrossFrame
;
sidebarConfig
.
pluginClasses
.
BucketBar
=
BucketBar
;
sidebars
=
[];
...
...
@@ -97,6 +95,7 @@ describe('Sidebar', () => {
'./toolbar'
:
{
ToolbarController
:
FakeToolbarController
,
},
'./bucket-bar'
:
{
default
:
BucketBar
},
});
});
...
...
@@ -788,16 +787,16 @@ describe('Sidebar', () => {
});
describe
(
'config'
,
()
=>
{
it
(
'does not have the BucketBar
plugin
if the clean theme is enabled'
,
()
=>
{
it
(
'does not have the BucketBar if the clean theme is enabled'
,
()
=>
{
const
sidebar
=
createSidebar
({
theme
:
'clean'
});
assert
.
is
Undefined
(
sidebar
.
plugins
.
B
ucketBar
);
assert
.
is
Null
(
sidebar
.
b
ucketBar
);
});
it
(
'does not have the BucketBar if an external container is provided'
,
()
=>
{
const
sidebar
=
createSidebar
({
externalContainerSelector
:
`.
${
EXTERNAL_CONTAINER_SELECTOR
}
`
,
});
assert
.
is
Undefined
(
sidebar
.
plugins
.
B
ucketBar
);
assert
.
is
Null
(
sidebar
.
b
ucketBar
);
});
it
(
'disables shadow DOM if `disableShadowSidebar` flag is set'
,
()
=>
{
...
...
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