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
1ed655fd
Commit
1ed655fd
authored
Dec 05, 2014
by
Randall Leeds
Committed by
Aron Carroll
Dec 05, 2014
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove unused dynamic bucket code
parent
94a56244
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
37 deletions
+2
-37
guest.coffee
h/static/scripts/guest.coffee
+0
-10
bucket-bar.coffee
h/static/scripts/plugin/bucket-bar.coffee
+2
-27
No files found.
h/static/scripts/guest.coffee
View file @
1ed655fd
...
...
@@ -140,13 +140,6 @@ class Annotator.Guest extends Annotator
.
bind
(
'onEditorHide'
,
this
.
onEditorHide
)
.
bind
(
'onEditorSubmit'
,
this
.
onEditorSubmit
)
.
bind
(
'setDynamicBucketMode'
,
(
ctx
,
value
)
=>
return
unless
@
plugins
.
BucketBar
return
if
@
plugins
.
BucketBar
.
dynamicBucket
is
value
@
plugins
.
BucketBar
.
dynamicBucket
=
value
if
value
then
@
plugins
.
BucketBar
.
_update
()
)
.
bind
(
'focusAnnotations'
,
(
ctx
,
tags
=
[])
=>
for
hl
in
@
getHighlights
()
if
hl
.
annotation
.
$
$tag
in
tags
...
...
@@ -285,9 +278,6 @@ class Annotator.Guest extends Annotator
#
# toggle: should this toggle membership in an existing selection?
selectAnnotations
:
(
annotations
,
toggle
)
=>
# Switch off dynamic mode; we are going to "Selection" scope
@
plugins
.
BucketBar
.
dynamicBucket
=
false
if
toggle
# Tell sidebar to add these annotations to the sidebar
this
.
toggleAnnotationSelection
annotations
...
...
h/static/scripts/plugin/bucket-bar.coffee
View file @
1ed655fd
...
...
@@ -27,9 +27,6 @@ class Annotator.Plugin.BucketBar extends Annotator.Plugin
# tab elements
tabs
:
null
# whether to update the viewer as the window is scrolled
dynamicBucket
:
true
constructor
:
(
element
,
options
)
->
super
$
(
@
html
),
options
...
...
@@ -336,11 +333,9 @@ class Annotator.Plugin.BucketBar extends Annotator.Plugin
# If it's the upper tab, scroll to next anchor above
if
(
@
isUpper
bucket
)
@
dynamicBucket
=
true
@
_jumpMinMax
@
buckets
[
bucket
],
"up"
# If it's the lower tab, scroll to next anchor below
else
if
(
@
isLower
bucket
)
@
dynamicBucket
=
true
@
_jumpMinMax
@
buckets
[
bucket
],
"down"
else
annotations
=
@
buckets
[
bucket
].
slice
()
...
...
@@ -349,9 +344,6 @@ class Annotator.Plugin.BucketBar extends Annotator.Plugin
this
.
_buildTabs
(
@
tabs
,
@
buckets
)
if
@
dynamicBucket
@
annotator
.
updateAnnotations
this
.
_getDynamicBucket
()
_buildTabs
:
->
@
tabs
.
each
(
d
,
el
)
=>
el
=
$
(
el
)
...
...
@@ -376,22 +368,5 @@ class Annotator.Plugin.BucketBar extends Annotator.Plugin
if
bucket
el
.
html
(
"<div class='label'>
#{
bucketLength
}
</div>"
)
_getDynamicBucket
:
->
top
=
window
.
pageYOffset
bottom
=
top
+
$
(
window
).
innerHeight
()
anchors
=
@
annotator
.
getHighlights
()
visible
=
anchors
.
reduce
(
acc
,
hl
)
=>
if
top
<=
hl
.
getTop
()
<=
bottom
if
hl
.
annotation
not
in
acc
acc
.
push
hl
.
annotation
acc
,
[]
isUpper
:
(
i
)
=>
i
==
1
isLower
:
(
i
)
=>
i
==
@
index
.
length
-
2
isComment
:
(
i
)
=>
i
is
@
_getCommentBucket
()
# Simulate clicking on the comments tab
commentClick
:
=>
@
dynamicBucket
=
false
annotator
.
showAnnotations
@
buckets
[
@
_getCommentBucket
()]
isUpper
:
(
i
)
->
i
==
1
isLower
:
(
i
)
->
i
==
@
index
.
length
-
2
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