@@ -10,7 +10,8 @@ import log from "./logging";
1010export const preferredColorPredicate : string = "https://intertextuality.org/annotation#preferredCssColor" ;
1111export const colorPriorityPredicate : string = "https://intertextuality.org/annotation#colorPriority" ;
1212
13- export const defaultColor : string = "yellow" ;
13+ export const visualCategory : string = "background-color" ;
14+ export const defaultCss : CSSDefinition = { "background-color" : "whitesmoke" } ;
1415
1516/*
1617 * A thunk for setting the CSS for all annotations. This will update
@@ -32,7 +33,7 @@ export const setCssAnnotationsThunk = () => {
3233 log . debug ( "setting CSS for annotation : " + annotId ) ;
3334 // get the annotation by ID
3435 const annotation = annots [ annotId ] ;
35- css [ annotId ] = { } ;
36+ css [ annotId ] = { 0 : defaultCss } ;
3637 // collect attributed RDF classes into the tags variable
3738 var tags : any = { }
3839 // an annotation may have multiple predicates with multiple objects
@@ -50,16 +51,13 @@ export const setCssAnnotationsThunk = () => {
5051 tags [ clasUri ] = ontology [ clasUri ] ;
5152 var tag : Predications = ontology [ clasUri ] ;
5253 // get the CSS properties: background color
53- if ( ! tag . hasOwnProperty ( preferredColorPredicate ) ) {
54- css [ annotId ] [ 0 ] = new CSSStyleDeclaration ( ) ;
55- css [ annotId ] [ 0 ] [ "background-color" ] = defaultColor ;
56- } else {
54+ if ( tag . hasOwnProperty ( preferredColorPredicate ) ) {
5755 var priority : number = 0 ;
5856 if ( tag . hasOwnProperty ( colorPriorityPredicate ) ) {
5957 priority = + tag [ colorPriorityPredicate ] [ 0 ] . value ;
6058 }
6159 css [ annotId ] [ priority ] = { } ;
62- css [ annotId ] [ priority ] [ "background-color" ] = tag [ preferredColorPredicate ] [ 0 ] . value ;
60+ css [ annotId ] [ priority ] [ visualCategory ] = tag [ preferredColorPredicate ] [ 0 ] . value ;
6361 }
6462 }
6563 }
0 commit comments