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
6ec8baae
Commit
6ec8baae
authored
Mar 21, 2014
by
Randall Leeds
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #1084 from RawKStar77/viewandsort
Add V1 viewsort feature
parents
35c97132
1349d235
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
62 additions
and
4 deletions
+62
-4
common.scss
h/css/common.scss
+23
-0
controllers.coffee
h/js/controllers.coffee
+37
-0
services.coffee
h/js/services.coffee
+2
-4
No files found.
h/css/common.scss
View file @
6ec8baae
...
...
@@ -1230,3 +1230,26 @@ h3.stream {
.fadeOut-setup.fadeOut-start
{
opacity
:
0
;
}
// View and Sort tabs ////////////////////
.viewsort
{
width
:
100%
;
text-align
:
center
;
position
:
absolute
;
top
:
29px
;
right
:
0
;
}
.viewsort
>
.dropdown
{
@include
smallshadow
(
0
);
border-bottom-right-radius
:
24px
72px
;
border-bottom-left-radius
:
24px
72px
;
font-family
:
$sansFontFamily
;
background
:
$white
;
border
:
solid
1px
$grayLighter
;
padding
:
0
4px
;
margin
:
0
3px
;
display
:
inline-block
;
z-index
:
4
;
}
\ No newline at end of file
h/js/controllers.coffee
View file @
6ec8baae
...
...
@@ -755,6 +755,17 @@ class Viewer
annotator
)
->
{
providers
,
threading
}
=
annotator
$scope
.
view
=
'Screen'
$scope
.
sort
=
'Newest'
$scope
.
views
=
[
{
view
:
'Screen'
}
{
view
:
'Document'
}]
$scope
.
sorts
=
[
{
sort
:
'Newest'
}
{
sort
:
'Oldest'
}
{
sort
:
'Location'
}]
$scope
.
predicate
=
'updated'
$scope
.
reverse
=
true
$scope
.
focus
=
(
annotation
)
->
if
angular
.
isArray
annotation
...
...
@@ -774,6 +785,32 @@ class Viewer
method
:
'scrollTo'
params
:
annotation
.
$
$tag
$scope
.
applyview
=
(
view
)
->
$scope
.
view
=
view
if
$scope
.
view
==
'Screen'
annotator
.
updateViewer
(
$rootScope
.
annotations
)
if
$scope
.
view
==
'Document'
annotator
.
updateViewer
(
annotator
.
plugins
.
Store
.
annotations
)
for
p
in
providers
p
.
channel
.
notify
method
:
'setDynamicBucketMode'
params
:
$scope
.
view
==
'Screen'
$scope
.
applysort
=
(
sort
)
->
$scope
.
sort
=
sort
if
$scope
.
sort
==
'Newest'
$scope
.
predicate
=
'updated'
$scope
.
reverse
=
true
if
$scope
.
sort
==
'Oldest'
$scope
.
predicate
=
'updated'
$scope
.
reverse
=
false
if
$scope
.
sort
==
'Location'
$scope
.
predicate
=
'target[0].selector[2].start'
$scope
.
reverse
=
false
class
Search
this
.
$inject
=
[
'$filter'
,
'$location'
,
'$rootScope'
,
'$routeParams'
,
'$sce'
,
'$scope'
,
'annotator'
]
constructor
:
(
$filter
,
$location
,
$rootScope
,
$routeParams
,
$sce
,
$scope
,
annotator
)
->
...
...
h/js/services.coffee
View file @
6ec8baae
...
...
@@ -218,11 +218,11 @@ class Hypothesis extends Annotator
.
bind
(
'showViewer'
,
(
ctx
,
ids
=
[])
=>
return
unless
this
.
discardDrafts
()
this
.
showViewer
this
.
_getAnnotationsFromIDs
ids
$rootScope
.
$apply
=>
this
.
showViewer
this
.
_getAnnotationsFromIDs
ids
)
.
bind
(
'updateViewer'
,
(
ctx
,
ids
=
[])
=>
this
.
updateViewer
this
.
_getAnnotationsFromIDs
ids
$rootScope
.
$apply
=>
this
.
updateViewer
this
.
_getAnnotationsFromIDs
ids
)
.
bind
(
'setTool'
,
(
ctx
,
name
)
=>
...
...
@@ -320,7 +320,6 @@ class Hypothesis extends Annotator
(
$location
,
$rootScope
)
=>
@
buildReplyList
annotations
$rootScope
.
annotations
=
annotations
$rootScope
.
$digest
()
]
this
...
...
@@ -333,7 +332,6 @@ class Hypothesis extends Annotator
@
buildReplyList
annotations
$rootScope
.
annotations
=
annotations
$location
.
path
(
'/viewer'
).
replace
()
$rootScope
.
$digest
()
]
this
...
...
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