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
3127119d
Commit
3127119d
authored
Jan 19, 2015
by
csillag
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Create the fragment selector
parent
d816525e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
8 deletions
+9
-8
fragmentselector.coffee
h/static/scripts/annotator/plugin/fragmentselector.coffee
+3
-6
guest.coffee
h/static/scripts/guest.coffee
+6
-2
No files found.
h/static/scripts/annotator/plugin/fragmentselector.coffee
View file @
3127119d
...
...
@@ -14,12 +14,9 @@ class Annotator.Plugin.FragmentSelector extends Annotator.Plugin
# Create a FragmentSelector around a range
_getFragmentSelector
:
(
annotation
,
target
)
=>
console
.
log
"Should create a fragment selector"
return
[]
fragment
=
(
new
URL
(
@
annotator
.
getRawHref
())).
hash
[
type
:
"TextPositionSelector"
start
:
startOffset
end
:
endOffset
type
:
"FragmentSelector"
value
:
fragment
]
h/static/scripts/guest.coffee
View file @
3127119d
...
...
@@ -127,12 +127,16 @@ class Annotator.Guest extends Annotator
url
.
toString
()
# Utility function to get the decoded form of the document URI
get
Href
:
=
>
get
RawHref
:
-
>
if
@
plugins
.
PDF
@
plugins
.
PDF
.
uri
()
else
@
_removeHash
@
plugins
.
Document
.
uri
()
@
plugins
.
Document
.
uri
()
# Utility function to get a de-hashed form of the document URI
getHref
:
->
@
_removeHash
@
getRawHref
()
# Utility function to filter metadata and de-hash the URIs
getMetadata
:
=>
metadata
=
@
plugins
.
Document
?
.
metadata
metadata
.
link
?
.
forEach
(
link
)
=>
link
.
href
=
@
_removeHash
link
.
href
...
...
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