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
78d8a980
Commit
78d8a980
authored
Apr 19, 2013
by
Randall Leeds
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
prototype first publisher API: annotator.addToken
proof of concept only. for localwiki.
parent
5f129777
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
0 deletions
+21
-0
host.coffee
h/js/host.coffee
+11
-0
services.coffee
h/js/services.coffee
+10
-0
No files found.
h/js/host.coffee
View file @
78d8a980
...
...
@@ -65,6 +65,12 @@ class Annotator.Host extends Annotator
parsed
[
k
]
=
v
parsed
# Build a channel for the publish API
@
api
=
Channel
.
build
origin
:
'*'
scope
:
'annotator:api'
window
:
@
frame
[
0
].
contentWindow
# Build a channel for the panel UI
@
panel
=
Channel
.
build
origin
:
'*'
...
...
@@ -257,3 +263,8 @@ class Annotator.Host extends Annotator
# is needed for preventing the panel from closing while annotating.
unless
event
and
this
.
isAnnotator
(
event
.
target
)
@
mouseIsDown
=
true
addToken
:
(
token
)
=>
@
api
.
notify
method
:
'addToken'
params
:
token
\ No newline at end of file
h/js/services.coffee
View file @
78d8a980
...
...
@@ -127,6 +127,16 @@ class Hypothesis extends Annotator
parsed
[
k
]
=
v
parsed
@
api
=
Channel
.
build
origin
:
$location
.
search
().
xdm
scope
:
'annotator:api'
window
:
$window
.
parent
.
bind
(
'addToken'
,
(
ctx
,
token
)
=>
@
element
.
scope
().
token
=
token
@
element
.
scope
().
$digest
()
)
@
provider
=
Channel
.
build
origin
:
$location
.
search
().
xdm
scope
:
'annotator:panel'
...
...
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