[annotator-dev] changing the annotator-hl class or id
ewald at siyavula.com
Thu Sep 1 13:37:30 UTC 2011
I am trying to assign different colours for different 'categories' of
annotations but the mechanics behind the highlighting is a bit over my head.
in annotator.coffee I have changed the following code to check whether an
annotation has a category attribute and to assign the highlighting
annotation.quote = 
annotation.ranges = 
annotation.highlights = 
for normed in normedRanges
highlight = null
# check what kind of annotation are loaded.
if annotation.category is null
highlight = '.annotator-hl'
when 'errata' then highlight = '.annotator-hl-errata'
when 'comment' then highlight = '.annotator-hl-comment'
when 'suggestion' then highlight = '.annotator-hl-suggestion'
annotation.ranges.push normed.serialize(@wrapper, highlight)
$.merge annotation.highlights, this.highlightRange(normed)
I've also added the following to annotator.css
background: rgba(213, 112, 112, 0.3)
background: rgba(142, 213, 112, 0.3)
background: rgba(112, 146, 213, 0.3)
this does nothing to the way my annotations are highlighted, even if they
have categories assigned to them. I'm missing something somewhere. A nudge
in the right direction will be much appreciated.
The Open Innovation Studio, 27 Buitenkant Street, Cape Town, 8001
A Shuttleworth Foundation Seeded Project
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the annotator-dev