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
ff81f156
Commit
ff81f156
authored
Mar 14, 2015
by
Jake Hartnell
Committed by
Randall Leeds
Mar 17, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Simplify code, tweak class names.
parent
f9f6c771
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
13 deletions
+9
-13
guest.coffee
h/static/scripts/guest.coffee
+8
-12
inject.scss
h/static/styles/inject.scss
+1
-1
No files found.
h/static/scripts/guest.coffee
View file @
ff81f156
...
...
@@ -17,7 +17,6 @@ module.exports = class Annotator.Guest extends Annotator
".annotator-adder button click"
:
"onAdderClick"
".annotator-adder button mousedown"
:
"onAdderMousedown"
".annotator-adder button mouseup"
:
"onAdderMouseup"
".annotator-highlighter button click"
:
"onHighlighterClick"
"setVisibleHighlights"
:
"setVisibleHighlights"
# Plugin configuration
...
...
@@ -36,7 +35,7 @@ module.exports = class Annotator.Guest extends Annotator
visibleHighlights
:
false
html
:
jQuery
.
extend
{},
Annotator
::
html
,
adder
:
'<div class="a
dder-group"><span class="annotator-adder"><button class="h-icon-mode-comment"></button></span><span class="annotator-highlighter"><button class="h-icon-border-color"></button></span
>'
adder
:
'<div class="a
nnotator-adder"><button class="h-icon-mode-comment"></button><button class="h-icon-border-color annotator-highlighter"></button></div
>'
constructor
:
(
element
,
options
,
config
=
{})
->
options
.
noScan
=
true
...
...
@@ -393,14 +392,11 @@ module.exports = class Annotator.Guest extends Annotator
event
.
preventDefault
()
event
.
stopPropagation
()
@
adder
.
hide
()
annotation
=
this
.
setupAnnotation
(
this
.
createAnnotation
())
Annotator
.
Util
.
getGlobal
().
getSelection
().
removeAllRanges
()
this
.
showEditor
(
annotation
)
onHighlighterClick
:
(
event
)
=>
event
.
preventDefault
()
event
.
stopPropagation
()
@
adder
.
hide
()
this
.
setVisibleHighlights
true
annotation
=
this
.
setupAnnotation
(
this
.
createHighlight
())
# Check to see if the highlight or note button was pushed.
if
event
.
target
.
className
==
"h-icon-border-color annotator-highlighter"
this
.
setVisibleHighlights
true
annotation
=
this
.
setupAnnotation
(
this
.
createHighlight
())
else
annotation
=
this
.
setupAnnotation
(
this
.
createAnnotation
())
this
.
showEditor
(
annotation
)
Annotator
.
Util
.
getGlobal
().
getSelection
().
removeAllRanges
()
h/static/styles/inject.scss
View file @
ff81f156
...
...
@@ -7,7 +7,7 @@
$base-font-size
:
14px
;
//ADDER////////////////////////////////
.a
dder-group
{
.a
nnotator-adder
{
$border
:
$gray
;
$hoverborder
:
$gray-dark
;
@include
box-sizing
(
border-box
);
...
...
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