client/annotviz/app/js/annotsroll.js
changeset 109 8546e2181a73
parent 106 9b20ddf1fc70
child 112 3e075a48e19e
equal deleted inserted replaced
108:082b64a5c699 109:8546e2181a73
    45 
    45 
    46     var yInit = opts.yInit;
    46     var yInit = opts.yInit;
    47     var annotStyles = _(opts.annotStyles).defaults(defaultAnnotStyles).value();
    47     var annotStyles = _(opts.annotStyles).defaults(defaultAnnotStyles).value();
    48     for(var style in annotStyles) {
    48     for(var style in annotStyles) {
    49     	if (annotStyles[style].wordWrap === true){
    49     	if (annotStyles[style].wordWrap === true){
    50     		annotStyles[style].wordWrapWidth = this.widthRoll; 
    50     		annotStyles[style].wordWrapWidth = this.widthRoll;
    51     	}
    51     	}
    52     }
    52     }
    53     console.log(annotStyles);
       
    54     var started = false;
    53     var started = false;
    55     var ws = opts.ws;
    54     var ws = opts.ws;
    56     var externalRefresh = opts.externalRefresh;
    55     var externalRefresh = opts.externalRefresh;
    57     var stageView = opts.stageView;
    56     var stageView = opts.stageView;
    58     
    57 
    59     stageView.registerComponent(this);
    58     stageView.registerComponent(this);
    60 
    59 
    61     var isHidden = function(child) {
    60     var isHidden = function(child) {
    62         // TODO: the origin point is an approximation. Should refine this
    61         // TODO: the origin point is an approximation. Should refine this
    63         var globalPos = child.toGlobal(new PIXI.Point(0,0));
    62         var globalPos = child.toGlobal(new PIXI.Point(0,0));
    72         //var colorAnnot = 0x65A954;
    71         //var colorAnnot = 0x65A954;
    73         var category = data.content.category.label,
    72         var category = data.content.category.label,
    74             text     = data.content.text,
    73             text     = data.content.text,
    75             user     = data.content.user,
    74             user     = data.content.user,
    76             ts       = Date.parse(data.ts),
    75             ts       = Date.parse(data.ts),
    77             color    = this.getColor(ts, data.content.category.code);
    76             color    = data.content.color || this.getColor(ts, data.content.category.code);
    78 
    77 
    79         this.addAnnot(category, text, user, color, ts);
    78         this.addAnnot(category, text, user, color, ts);
    80     };
    79     };
    81 
    80 
    82     this.getColor = function(ts, code) {
    81     this.getColor = function(ts, code) {