src/js/widgets.js
author hamidouk
Tue, 29 Nov 2011 11:09:08 +0100
branchpopcorn-port
changeset 345 8a088f7daa66
parent 287 5c7495102bd7
child 520 fe008e95a716
permissions -rw-r--r--
rollover over the interface buttons now works as expected. Also changed the width of the buttons to the correct size. Resized the width and height of the sprites to be the same as the boxes we display them in.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
66
13013b9452af Added a new file to the build, widgets.js, to contain widget classes.
hamidouk
parents:
diff changeset
     1
/* the widget classes and definitions */
13013b9452af Added a new file to the build, widgets.js, to contain widget classes.
hamidouk
parents:
diff changeset
     2
74
d7a7d7216371 lots of changes to the player widget...
hamidouk
parents: 66
diff changeset
     3
IriSP.Widget = function(Popcorn, config, Serializer) {
114
eda061f1aa75 added a .selector object to all the widgets.
hamidouk
parents: 98
diff changeset
     4
eda061f1aa75 added a .selector object to all the widgets.
hamidouk
parents: 98
diff changeset
     5
  if (config === undefined || config === null) {
eda061f1aa75 added a .selector object to all the widgets.
hamidouk
parents: 98
diff changeset
     6
    config = {}
eda061f1aa75 added a .selector object to all the widgets.
hamidouk
parents: 98
diff changeset
     7
  }
eda061f1aa75 added a .selector object to all the widgets.
hamidouk
parents: 98
diff changeset
     8
  
74
d7a7d7216371 lots of changes to the player widget...
hamidouk
parents: 66
diff changeset
     9
  this._Popcorn = Popcorn;
d7a7d7216371 lots of changes to the player widget...
hamidouk
parents: 66
diff changeset
    10
  this._config = config;  
d7a7d7216371 lots of changes to the player widget...
hamidouk
parents: 66
diff changeset
    11
  this._serializer = Serializer;
114
eda061f1aa75 added a .selector object to all the widgets.
hamidouk
parents: 98
diff changeset
    12
  
124
2758dfb208b2 changed widget.js to add some properties to the widget. Widgets now only get the
hamidouk
parents: 122
diff changeset
    13
  if (config.hasOwnProperty("container")) {
2758dfb208b2 changed widget.js to add some properties to the widget. Widgets now only get the
hamidouk
parents: 122
diff changeset
    14
     this._id = config.container;
114
eda061f1aa75 added a .selector object to all the widgets.
hamidouk
parents: 98
diff changeset
    15
     this.selector = IriSP.jQuery("#" + this._id);
124
2758dfb208b2 changed widget.js to add some properties to the widget. Widgets now only get the
hamidouk
parents: 122
diff changeset
    16
  }
2758dfb208b2 changed widget.js to add some properties to the widget. Widgets now only get the
hamidouk
parents: 122
diff changeset
    17
287
5c7495102bd7 added a spacer div to simplify some graphic animations.
hamidouk
parents: 170
diff changeset
    18
  if (config.hasOwnProperty("spacer")) {
5c7495102bd7 added a spacer div to simplify some graphic animations.
hamidouk
parents: 170
diff changeset
    19
     this._spacerId = config.spacer;
5c7495102bd7 added a spacer div to simplify some graphic animations.
hamidouk
parents: 170
diff changeset
    20
     this.spacer = IriSP.jQuery("#" + this._spacerId);
5c7495102bd7 added a spacer div to simplify some graphic animations.
hamidouk
parents: 170
diff changeset
    21
  }
5c7495102bd7 added a spacer div to simplify some graphic animations.
hamidouk
parents: 170
diff changeset
    22
5c7495102bd7 added a spacer div to simplify some graphic animations.
hamidouk
parents: 170
diff changeset
    23
124
2758dfb208b2 changed widget.js to add some properties to the widget. Widgets now only get the
hamidouk
parents: 122
diff changeset
    24
  if (config.hasOwnProperty("width")) {
2758dfb208b2 changed widget.js to add some properties to the widget. Widgets now only get the
hamidouk
parents: 122
diff changeset
    25
     // this.width and not this._width because we consider it public.
2758dfb208b2 changed widget.js to add some properties to the widget. Widgets now only get the
hamidouk
parents: 122
diff changeset
    26
     this.width = config.width;     
2758dfb208b2 changed widget.js to add some properties to the widget. Widgets now only get the
hamidouk
parents: 122
diff changeset
    27
  }
2758dfb208b2 changed widget.js to add some properties to the widget. Widgets now only get the
hamidouk
parents: 122
diff changeset
    28
  
170
5150ae56e0a6 added two new config values for a widget : heightmax and widthmax.
hamidouk
parents: 124
diff changeset
    29
  if (config.hasOwnProperty("height")) {    
124
2758dfb208b2 changed widget.js to add some properties to the widget. Widgets now only get the
hamidouk
parents: 122
diff changeset
    30
     this.height = config.height;     
2758dfb208b2 changed widget.js to add some properties to the widget. Widgets now only get the
hamidouk
parents: 122
diff changeset
    31
  }
2758dfb208b2 changed widget.js to add some properties to the widget. Widgets now only get the
hamidouk
parents: 122
diff changeset
    32
  
170
5150ae56e0a6 added two new config values for a widget : heightmax and widthmax.
hamidouk
parents: 124
diff changeset
    33
  if (config.hasOwnProperty("heightmax")) {
5150ae56e0a6 added two new config values for a widget : heightmax and widthmax.
hamidouk
parents: 124
diff changeset
    34
     this.heightmax = config.heightmax;     
5150ae56e0a6 added two new config values for a widget : heightmax and widthmax.
hamidouk
parents: 124
diff changeset
    35
  }
5150ae56e0a6 added two new config values for a widget : heightmax and widthmax.
hamidouk
parents: 124
diff changeset
    36
5150ae56e0a6 added two new config values for a widget : heightmax and widthmax.
hamidouk
parents: 124
diff changeset
    37
  if (config.hasOwnProperty("widthmax")) {
5150ae56e0a6 added two new config values for a widget : heightmax and widthmax.
hamidouk
parents: 124
diff changeset
    38
     this.widthmax = config.widthmax;     
5150ae56e0a6 added two new config values for a widget : heightmax and widthmax.
hamidouk
parents: 124
diff changeset
    39
  }
124
2758dfb208b2 changed widget.js to add some properties to the widget. Widgets now only get the
hamidouk
parents: 122
diff changeset
    40
  
66
13013b9452af Added a new file to the build, widgets.js, to contain widget classes.
hamidouk
parents:
diff changeset
    41
};
13013b9452af Added a new file to the build, widgets.js, to contain widget classes.
hamidouk
parents:
diff changeset
    42
13013b9452af Added a new file to the build, widgets.js, to contain widget classes.
hamidouk
parents:
diff changeset
    43
IriSP.Widget.prototype.draw = function() {
13013b9452af Added a new file to the build, widgets.js, to contain widget classes.
hamidouk
parents:
diff changeset
    44
  /* implemented by "sub-classes" */  
13013b9452af Added a new file to the build, widgets.js, to contain widget classes.
hamidouk
parents:
diff changeset
    45
};
74
d7a7d7216371 lots of changes to the player widget...
hamidouk
parents: 66
diff changeset
    46
d7a7d7216371 lots of changes to the player widget...
hamidouk
parents: 66
diff changeset
    47
IriSP.Widget.prototype.redraw = function() {
d7a7d7216371 lots of changes to the player widget...
hamidouk
parents: 66
diff changeset
    48
  /* implemented by "sub-classes" */  
d7a7d7216371 lots of changes to the player widget...
hamidouk
parents: 66
diff changeset
    49
};