src/js/widgets.js
author hamidouk
Wed, 26 Oct 2011 11:32:21 +0200
branchpopcorn-port
changeset 147 955119f901b4
parent 124 2758dfb208b2
child 170 5150ae56e0a6
permissions -rw-r--r--
added a function to search annotations to the json serializer.

/* the widget classes and definitions */

IriSP.Widget = function(Popcorn, config, Serializer) {

  if (config === undefined || config === null) {
    config = {}
  }
  
  this._Popcorn = Popcorn;
  this._config = config;  
  this._serializer = Serializer;
  
  if (config.hasOwnProperty("container")) {
     this._id = config.container;
     this.selector = IriSP.jQuery("#" + this._id);
  }

  if (config.hasOwnProperty("width")) {
     // this.width and not this._width because we consider it public.
     this.width = config.width;     
  }
  
  if (config.hasOwnProperty("height")) {
     // this.width and not this._width because we consider it public.
     this.height = config.height;     
  }
  
  
};

IriSP.Widget.prototype.draw = function() {
  /* implemented by "sub-classes" */  
};

IriSP.Widget.prototype.redraw = function() {
  /* implemented by "sub-classes" */  
};