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
dde25e80
Commit
dde25e80
authored
Jan 19, 2015
by
Aron Carroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean up cross frame binding
parent
8b4b6876
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
16 additions
and
22 deletions
+16
-22
services.coffee
h/static/scripts/services.coffee
+1
-0
cross-frame-ui.coffee
h/static/scripts/services/cross-frame-ui.coffee
+15
-22
No files found.
h/static/scripts/services.coffee
View file @
dde25e80
...
@@ -47,6 +47,7 @@ class Hypothesis extends Annotator
...
@@ -47,6 +47,7 @@ class Hypothesis extends Annotator
this
.
$inject
=
[
'$document'
,
'$rootScope'
,
'$window'
,
'store'
]
this
.
$inject
=
[
'$document'
,
'$rootScope'
,
'$window'
,
'store'
]
constructor
:
(
$document
,
$rootScope
,
$window
,
store
)
->
constructor
:
(
$document
,
$rootScope
,
$window
,
store
)
->
super
(
$document
.
find
'body'
)
super
(
$document
.
find
'body'
)
return
@
providers
=
[]
@
providers
=
[]
@
store
=
store
@
store
=
store
...
...
h/static/scripts/services/cross-frame-ui.coffee
View file @
dde25e80
...
@@ -15,6 +15,9 @@ class CrossFrameUI
...
@@ -15,6 +15,9 @@ class CrossFrameUI
@
providers
=
[]
@
providers
=
[]
@
store
=
store
@
store
=
store
this
.
_emit
=
(
event
,
args
...)
->
$rootScope
.
$emit
(
event
,
args
...)
# Set up the bridge plugin, which bridges the main annotation methods
# Set up the bridge plugin, which bridges the main annotation methods
# between the host page and the panel widget.
# between the host page and the panel widget.
whitelist
=
[
'target'
,
'document'
,
'uri'
]
whitelist
=
[
'target'
,
'document'
,
'uri'
]
...
@@ -44,7 +47,7 @@ class CrossFrameUI
...
@@ -44,7 +47,7 @@ class CrossFrameUI
success
:
(
info
)
=>
success
:
(
info
)
=>
provider
.
entities
=
(
link
.
href
for
link
in
info
.
metadata
.
link
)
provider
.
entities
=
(
link
.
href
for
link
in
info
.
metadata
.
link
)
@
providers
.
push
(
provider
)
@
providers
.
push
(
provider
)
$rootScope
.
$
emit
(
'getDocumentInfo'
)
this
.
_
emit
(
'getDocumentInfo'
)
# Allow the host to define it's own state
# Allow the host to define it's own state
unless
source
is
$window
.
parent
unless
source
is
$window
.
parent
...
@@ -63,40 +66,30 @@ class CrossFrameUI
...
@@ -63,40 +66,30 @@ class CrossFrameUI
options
.
origin
=
'*'
options
.
origin
=
'*'
provider
=
Channel
.
build
options
provider
=
Channel
.
build
options
provider
.
bind
'back'
,
=>
.
bind
(
'back'
,
=>
# Navigate "back" out of the interface.
# Navigate "back" out of the interface.
this
.
hide
()
this
.
hide
()
)
provider
.
bind
'open'
,
=>
.
bind
(
'open'
,
=>
this
.
show
()
this
.
show
()
)
.
bind
(
'showEditor'
,
(
ctx
,
tag
)
=>
provider
.
bind
'showEditor'
,
(
ctx
,
tag
)
=>
this
.
show
()
this
.
show
()
)
.
bind
(
'showAnnotations'
,
(
ctx
,
tags
=
[])
=>
provider
.
bind
'showAnnotations'
,
(
ctx
,
tags
=
[])
=>
this
.
show
()
this
.
show
()
$rootScope
.
$emit
(
'showAnnotations'
,
tags
)
this
.
_emit
(
'showAnnotations'
,
tags
)
)
.
bind
(
'focusAnnotations'
,
(
ctx
,
tags
=
[])
=>
provider
.
bind
'focusAnnotations'
,
(
ctx
,
tags
=
[])
=>
$rootScope
.
$emit
(
'focusAnnotations'
,
tags
)
this
.
_emit
(
'focusAnnotations'
,
tags
)
)
.
bind
(
'toggleAnnotationSelection'
,
(
ctx
,
tags
=
[])
=>
provider
.
bind
'toggleAnnotationSelection'
,
(
ctx
,
tags
=
[])
=>
$rootScope
.
$emit
(
'toggleViewerSelection'
,
tags
)
this
.
_emit
(
'toggleViewerSelection'
,
tags
)
)
.
bind
(
'setTool'
,
(
ctx
,
name
)
=>
provider
.
bind
'setTool'
,
(
ctx
,
name
)
=>
this
.
setTool
(
name
)
this
.
setTool
(
name
)
)
.
bind
(
'setVisibleHighlights'
,
(
ctx
,
state
)
=>
provider
.
bind
'setVisibleHighlights'
,
(
ctx
,
state
)
=>
this
.
setVisibleHighlights
(
state
)
this
.
setVisibleHighlights
(
state
)
)
_setupDocumentEvents
:
->
_setupDocumentEvents
:
->
$document
.
addEventListener
'dragover'
,
(
event
)
=>
$document
.
addEventListener
'dragover'
,
(
event
)
=>
...
...
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