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
f725add7
Commit
f725add7
authored
Aug 01, 2013
by
Ed Summers
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'develop' of
https://github.com/hypothesis/h
into 455-testing
parents
bbe9827a
0e1901ec
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
30 additions
and
11 deletions
+30
-11
common.scss
h/css/common.scss
+3
-10
controllers.coffee
h/js/controllers.coffee
+8
-0
directives.coffee
h/js/directives.coffee
+2
-0
dom_text_mapper.coffee
h/lib/dom_text_mapper.coffee
+1
-1
tag-it.js
h/lib/tag-it.js
+16
-0
No files found.
h/css/common.scss
View file @
f725add7
...
...
@@ -1077,10 +1077,12 @@ pre {outline: 1px solid #ccc; padding: 5px; margin: 5px; }
&
+
li
{
margin-left
:
.1em
;
}
}
li
.tagit-choice
{
margin-top
:
.33em
;
}
&
[
readonly
]
{
input
,
.tagit-close
{
display
:
none
;
}
.tagit-new
,
.tagit-close
{
display
:
none
;
}
li
{
padding-right
:
.3em
;
}
li
.tagit-choice
{
margin-top
:
.1em
;
}
}
}
...
...
@@ -1090,15 +1092,6 @@ pre {outline: 1px solid #ccc; padding: 5px; margin: 5px; }
overflow
:
hidden
;
}
// Specific rules for tags on the displayer page
.gray-tags
.tags
{
// Make tags white (on gray bg)
li
{
background
:
white
;
}
// Don't show the stub of the editor
li
.tagit-new
{
display
:
none
;
}
}
h3
.tagstream
,
h3
.userstream
{
letter-spacing
:
normal
;
word-spacing
:
normal
;
...
...
h/js/controllers.coffee
View file @
f725add7
...
...
@@ -213,6 +213,14 @@ class App
$i
.
triggerHandler
(
'input'
)
,
200
# We hope this is long enough
$scope
.
toggleAlwaysOnHighlights
=
->
console
.
log
"Should toggle always-on highlights"
$scope
.
toggleHighlightingMode
=
->
console
.
log
"Should toggle highlighting mode"
$scope
.
createUnattachedAnnotation
=
->
console
.
log
"Should create unattached annotation"
class
Annotation
this
.
$inject
=
[
'$element'
,
'$location'
,
'$scope'
,
'annotator'
,
'drafts'
,
'$timeout'
]
...
...
h/js/directives.coffee
View file @
f725add7
...
...
@@ -271,6 +271,8 @@ tags = ['$window', ($window) ->
caseSensitive
:
false
placeholderText
:
attr
.
placeholder
keepPlaceholder
:
true
propagateTagClicks
:
false
propagateRemoveClicks
:
false
preprocessTag
:
(
val
)
->
val
.
toLowerCase
().
replace
/[^a-z0-9\-\_\s]/g
,
''
afterTagAdded
:
(
evt
,
ui
)
->
...
...
h/lib/dom_text_mapper.coffee
View file @
f725add7
...
...
@@ -2,7 +2,7 @@ class window.DomTextMapper
USE_TABLE_TEXT_WORKAROUND
=
true
USE_EMPTY_TEXT_WORKAROUND
=
true
SELECT_CHILDREN_INSTEAD
=
[
"thead"
,
"tbody"
,
"ol"
,
"a"
,
"caption"
,
"p"
,
"span"
]
SELECT_CHILDREN_INSTEAD
=
[
"thead"
,
"tbody"
,
"ol"
,
"a"
,
"caption"
,
"p"
,
"span"
,
"div"
,
"h1"
,
"h2"
,
"h3"
,
"h4"
,
"h5"
,
"h6"
,
"li"
]
CONTEXT_LEN
=
32
@
instances
:
[]
...
...
h/lib/tag-it.js
View file @
f725add7
...
...
@@ -81,6 +81,12 @@
// Whether to animate tag removals or not.
animate
:
true
,
// Whether to propagete the click events when removing tags
propagateRemoveClicks
:
true
,
// Whether to propagete the click events on tabs
propagateTagClicks
:
true
,
// Optionally set a tabindex attribute on the input that gets
// created for tag-it.
tabIndex
:
null
,
...
...
@@ -180,6 +186,11 @@
.
click
(
function
(
e
)
{
var
target
=
$
(
e
.
target
);
if
(
target
.
hasClass
(
'tagit-label'
))
{
// Don't propagate this even, unless configured to
if
(
!
that
.
options
.
propagateTagClicks
)
{
e
.
stopPropagation
()
}
var
tag
=
target
.
closest
(
'.tagit-choice'
);
if
(
!
tag
.
hasClass
(
'removed'
))
{
that
.
_trigger
(
'onTagClicked'
,
e
,
{
tag
:
tag
,
tagLabel
:
that
.
tagLabel
(
tag
)});
...
...
@@ -439,6 +450,11 @@
.
click
(
function
(
e
)
{
// Removes a tag when the little 'x' is clicked.
that
.
removeTag
(
tag
);
// Don't propagate this even, unless configured to
if
(
!
that
.
options
.
propagateRemoveClicks
)
{
e
.
stopPropagation
()
}
});
tag
.
append
(
removeTag
);
}
...
...
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