src/js/widgets/segmentsWidget.js
branchpopcorn-port
changeset 473 1a09ab7e7163
parent 464 dd543fb9d38a
child 474 c1998d5d552e
equal deleted inserted replaced
472:1da76db24aa8 473:1a09ab7e7163
    71 
    71 
    72       endPourcent -= onePxPercent;
    72       endPourcent -= onePxPercent;
    73     }
    73     }
    74     
    74     
    75     var divTitle = annotation.content.title.substr(0,55);
    75     var divTitle = annotation.content.title.substr(0,55);
    76     var color = annotation.content.color
       
    77 
    76 
    78 
    77     if (typeof(annotation.content.color) !== "undefined")
       
    78       var color = annotation.content.color;
       
    79     else
       
    80       var color = annotation.color;
       
    81     
       
    82     var hexa_color = IriSP.DEC_HEXA_COLOR(color);
       
    83     console.log(hexa_color);
       
    84     if (hexa_color === "FFCC00")
       
    85       hexa_color = "333";
       
    86     
    79     var annotationTemplate = Mustache.to_html(IriSP.annotation_template,
    87     var annotationTemplate = Mustache.to_html(IriSP.annotation_template,
    80         {"divTitle" : divTitle, "id" : id, "startPourcent" : startPourcent,
    88         {"divTitle" : divTitle, "id" : id, "startPourcent" : startPourcent,
    81         "endPourcent" : endPourcent, "hexa_color" : IriSP.DEC_HEXA_COLOR(color),
    89         "endPourcent" : endPourcent, "hexa_color" : hexa_color,
    82         "seekPlace" : Math.round(begin/1000)});
    90         "seekPlace" : Math.round(begin/1000)});
    83 
    91 
    84 
    92 
    85     this.selector.append(annotationTemplate);
    93     this.selector.append(annotationTemplate);
    86 
    94