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
009d7687
Commit
009d7687
authored
Oct 27, 2015
by
Robert Knight
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2682 from hypothesis/remove-pulse-remnants
Remove the remnants of a defunct annotation pulse feature
parents
f8442789
a0f94df6
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
2 additions
and
86 deletions
+2
-86
app.coffee
h/static/scripts/app.coffee
+0
-1
annotation.coffee
h/static/scripts/directive/annotation.coffee
+0
-5
annotation-test.coffee
h/static/scripts/directive/test/annotation-test.coffee
+0
-18
thread-test.coffee
h/static/scripts/directive/test/thread-test.coffee
+0
-31
thread.coffee
h/static/scripts/directive/thread.coffee
+2
-11
pulse.coffee
h/static/scripts/pulse.coffee
+0
-12
threads.scss
h/static/styles/threads.scss
+0
-8
No files found.
h/static/scripts/app.coffee
View file @
009d7687
...
...
@@ -147,7 +147,6 @@ module.exports = angular.module('h', [
.
service
(
'host'
,
require
(
'./host'
))
.
service
(
'localStorage'
,
require
(
'./local-storage'
))
.
service
(
'permissions'
,
require
(
'./permissions'
))
.
service
(
'pulse'
,
require
(
'./pulse'
))
.
service
(
'queryParser'
,
require
(
'./query-parser'
))
.
service
(
'render'
,
require
(
'./render'
))
.
service
(
'searchFilter'
,
require
(
'./search-filter'
))
...
...
h/static/scripts/directive/annotation.coffee
View file @
009d7687
...
...
@@ -361,11 +361,6 @@ AnnotationController = [
# Discard saved drafts
drafts.remove model
# Propagate an update event up the thread (to pulse changing threads),
# but only if this is someone else's annotation.
if model.user != session.state.userid
$scope.$emit('annotationUpdate')
# Save highlights once logged in.
if this.isHighlight() and highlight
if model.user and not model.id
...
...
h/static/scripts/directive/test/annotation-test.coffee
View file @
009d7687
...
...
@@ -382,24 +382,6 @@ describe 'annotation', ->
$document
.
click
()
assert
.
notOk
(
dialog
.
hasClass
(
'open'
))
describe
'annotationUpdate event'
,
->
beforeEach
->
createDirective
()
sandbox
.
spy
(
isolateScope
,
'$emit'
)
annotation
.
updated
=
'123'
$scope
.
$digest
()
it
"does not fire when this user's annotations are updated"
,
->
annotation
.
updated
=
'456'
$scope
.
$digest
()
assert
.
notCalled
(
isolateScope
.
$emit
)
it
"fires when another user's annotation is updated"
,
->
fakeSession
.
state
.
userid
=
'acct:jane@localhost'
annotation
.
updated
=
'456'
$scope
.
$digest
()
assert
.
calledWith
(
isolateScope
.
$emit
,
'annotationUpdate'
)
describe
"deleteAnnotation() method"
,
->
before
->
sinon
.
stub
(
window
,
"confirm"
)
...
...
h/static/scripts/directive/test/thread-test.coffee
View file @
009d7687
...
...
@@ -6,7 +6,6 @@ describe 'thread', ->
$scope
=
null
controller
=
null
fakeGroups
=
null
fakePulse
=
null
fakeRender
=
null
fakeAnnotationUI
=
null
sandbox
=
null
...
...
@@ -29,7 +28,6 @@ describe 'thread', ->
fakeGroups
=
{
focused
:
sandbox
.
stub
().
returns
({
id
:
'__world__'
})
}
fakePulse
=
sandbox
.
spy
()
fakeRender
=
sandbox
.
spy
()
fakeAnnotationUI
=
{
hasSelectedAnnotations
:
->
...
...
@@ -38,7 +36,6 @@ describe 'thread', ->
selectedAnnotations
.
indexOf
(
id
)
!=
-
1
}
$provide
.
value
'groups'
,
fakeGroups
$provide
.
value
'pulse'
,
fakePulse
$provide
.
value
'render'
,
fakeRender
$provide
.
value
'annotationUI'
,
fakeAnnotationUI
return
...
...
@@ -351,31 +348,3 @@ describe 'thread', ->
controller
.
container
=
{}
assert
.
isFalse
(
controller
.
matchesFilter
())
assert
.
calledWith
(
check
,
controller
.
container
)
describe
'directive'
,
->
beforeEach
->
createDirective
()
it
'pulses the current thread on an annotationUpdated event'
,
->
$element
.
scope
().
$emit
(
'annotationUpdate'
)
assert
.
called
(
fakePulse
)
it
'does not pulse the thread if it is hidden (parent collapsed)'
,
->
fakeParent
=
{
controller
:
->
{
collapsed
:
true
}
}
sandbox
.
stub
(
angular
.
element
.
prototype
,
'parent'
).
returns
(
fakeParent
)
$element
.
scope
().
$emit
(
'annotationUpdate'
)
assert
.
notCalled
(
fakePulse
)
it
'does not pulse the thread if it is hidden (grandparent collapsed)'
,
->
fakeGrandParent
=
{
controller
:
->
{
collapsed
:
true
}
}
fakeParent
=
{
controller
:
->
{
collapsed
:
false
}
parent
:
->
fakeGrandParent
}
sandbox
.
stub
(
angular
.
element
.
prototype
,
'parent'
).
returns
(
fakeParent
)
$element
.
scope
().
$emit
(
'annotationUpdate'
)
assert
.
notCalled
(
fakePulse
)
h/static/scripts/directive/thread.coffee
View file @
009d7687
...
...
@@ -219,8 +219,8 @@ isHiddenThread = (elem) ->
# Directive that instantiates {@link thread.ThreadController ThreadController}.
###
module
.
exports
=
[
'$parse'
,
'$window'
,
'$location'
,
'$anchorScroll'
,
'
pulse'
,
'
render'
,
(
$parse
,
$window
,
$location
,
$anchorScroll
,
pulse
,
render
)
->
'$parse'
,
'$window'
,
'$location'
,
'$anchorScroll'
,
'render'
,
(
$parse
,
$window
,
$location
,
$anchorScroll
,
render
)
->
linkFn
=
(
scope
,
elem
,
attrs
,
[
ctrl
,
counter
,
filter
])
->
# We would ideally use require for this, but searching parents only for a
...
...
@@ -239,15 +239,6 @@ module.exports = [
counter
.
count
'message'
,
1
scope
.
$on
'$destroy'
,
->
counter
.
count
'message'
,
-
1
# Flash the thread when any child annotations are updated.
scope
.
$on
'annotationUpdate'
,
(
event
)
->
# If we're hidden, we let the event propagate up to the parent thread.
if
isHiddenThread
(
elem
)
return
# Otherwise, stop the event from bubbling, and pulse this thread.
event
.
stopPropagation
()
pulse
(
elem
)
# The watch is necessary because the computed value of the attribute
# expression may change. This won't happen when we use the thread
# directive in a repeat, since the element will be torn down whenever the
...
...
h/static/scripts/pulse.coffee
deleted
100644 → 0
View file @
f8442789
###*
# @ngdoc service
# @name pulse
# @param {Element} elem Element to pulse.
# @description
# Pulses an element to indicate activity in that element.
###
module
.
exports
=
[
'$animate'
,
(
$animate
)
->
(
elem
)
->
$animate
.
addClass
elem
,
'pulse'
,
->
$animate
.
removeClass
(
elem
,
'pulse'
)
]
h/static/styles/threads.scss
View file @
009d7687
...
...
@@ -28,14 +28,6 @@ $thread-padding: 1em;
margin-left
:
-
$thread-padding
;
}
@keyframes
pulse
{
10
%
{
background-color
:
#ffc
;
}
}
&
.pulse
{
animation
:
pulse
1200ms
ease-in-out
;
}
.thread
{
border-left
:
1px
dotted
$gray-light
;
padding
:
0
;
...
...
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