src/js/widgets/sparklineWidget.js
branchpopcorn-port
changeset 840 ac66e2240e1e
parent 835 a8af9da7c622
child 842 4ae2247a59f4
equal deleted inserted replaced
839:4357aac4eb19 840:ac66e2240e1e
    18   this.selector.css("height", this.height + "px");
    18   this.selector.css("height", this.height + "px");
    19   if (this._config.background) {
    19   if (this._config.background) {
    20       this.selector.css("background", this._config.background);
    20       this.selector.css("background", this._config.background);
    21   }
    21   }
    22   this.checkOption('cinecast_version');
    22   this.checkOption('cinecast_version');
    23   console.log('Cinecast', this.cinecast_version);
       
    24 };
    23 };
    25 
    24 
    26 
    25 
    27 IriSP.SparklineWidget.prototype = new IriSP.Widget();
    26 IriSP.SparklineWidget.prototype = new IriSP.Widget();
    28 
    27 
    50   
    49   
    51     var _ = IriSP.underscore;
    50     var _ = IriSP.underscore;
    52   // If we've found the correct view, feed the directly the data from the view
    51   // If we've found the correct view, feed the directly the data from the view
    53   // to jquery sparkline. Otherwise, compute it ourselves.
    52   // to jquery sparkline. Otherwise, compute it ourselves.
    54     if (!IriSP.null_or_undefined(stat_view)) {
    53     if (!IriSP.null_or_undefined(stat_view)) {
    55         console.log("sparklinewidget : using stats embedded in the json");
    54         //console.log("sparklinewidget : using stats embedded in the json");
    56         var _results = stat_view.meta.stat.split(",");      
    55         var _results = stat_view.meta.stat.split(",");      
    57     } else {
    56     } else {
    58         var _annotations = this._serializer._data.annotations,
    57         var _annotations = this._serializer._data.annotations,
    59             _sliceDuration = Math.floor( this.duration / this.slices),
    58             _sliceDuration = Math.floor( this.duration / this.slices),
    60             _results = _(_.range(this.slices)).map(function(_i) {
    59             _results = _(_.range(this.slices)).map(function(_i) {