| author | hamidouk |
| Wed, 02 Nov 2011 10:58:34 +0100 | |
| branch | popcorn-port |
| changeset 170 | 5150ae56e0a6 |
| parent 124 | 2758dfb208b2 |
| child 238 | 6008172a0592 |
| child 287 | 5c7495102bd7 |
| permissions | -rw-r--r-- |
|
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 | 3 |
IriSP.Widget = function(Popcorn, config, Serializer) { |
| 114 | 4 |
|
5 |
if (config === undefined || config === null) { |
|
6 |
config = {} |
|
7 |
} |
|
8 |
|
|
| 74 | 9 |
this._Popcorn = Popcorn; |
10 |
this._config = config; |
|
11 |
this._serializer = Serializer; |
|
| 114 | 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 | 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 |
|
|
2758dfb208b2
changed widget.js to add some properties to the widget. Widgets now only get the
hamidouk
parents:
122
diff
changeset
|
18 |
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
|
19 |
// 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
|
20 |
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
|
21 |
} |
|
2758dfb208b2
changed widget.js to add some properties to the widget. Widgets now only get the
hamidouk
parents:
122
diff
changeset
|
22 |
|
|
170
5150ae56e0a6
added two new config values for a widget : heightmax and widthmax.
hamidouk
parents:
124
diff
changeset
|
23 |
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
|
24 |
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
|
25 |
} |
|
2758dfb208b2
changed widget.js to add some properties to the widget. Widgets now only get the
hamidouk
parents:
122
diff
changeset
|
26 |
|
|
170
5150ae56e0a6
added two new config values for a widget : heightmax and widthmax.
hamidouk
parents:
124
diff
changeset
|
27 |
if (config.hasOwnProperty("heightmax")) { |
|
5150ae56e0a6
added two new config values for a widget : heightmax and widthmax.
hamidouk
parents:
124
diff
changeset
|
28 |
this.heightmax = config.heightmax; |
|
5150ae56e0a6
added two new config values for a widget : heightmax and widthmax.
hamidouk
parents:
124
diff
changeset
|
29 |
} |
|
5150ae56e0a6
added two new config values for a widget : heightmax and widthmax.
hamidouk
parents:
124
diff
changeset
|
30 |
|
|
5150ae56e0a6
added two new config values for a widget : heightmax and widthmax.
hamidouk
parents:
124
diff
changeset
|
31 |
if (config.hasOwnProperty("widthmax")) { |
|
5150ae56e0a6
added two new config values for a widget : heightmax and widthmax.
hamidouk
parents:
124
diff
changeset
|
32 |
this.widthmax = config.widthmax; |
|
5150ae56e0a6
added two new config values for a widget : heightmax and widthmax.
hamidouk
parents:
124
diff
changeset
|
33 |
} |
|
124
2758dfb208b2
changed widget.js to add some properties to the widget. Widgets now only get the
hamidouk
parents:
122
diff
changeset
|
34 |
|
|
66
13013b9452af
Added a new file to the build, widgets.js, to contain widget classes.
hamidouk
parents:
diff
changeset
|
35 |
}; |
|
13013b9452af
Added a new file to the build, widgets.js, to contain widget classes.
hamidouk
parents:
diff
changeset
|
36 |
|
|
13013b9452af
Added a new file to the build, widgets.js, to contain widget classes.
hamidouk
parents:
diff
changeset
|
37 |
IriSP.Widget.prototype.draw = function() { |
|
13013b9452af
Added a new file to the build, widgets.js, to contain widget classes.
hamidouk
parents:
diff
changeset
|
38 |
/* implemented by "sub-classes" */ |
|
13013b9452af
Added a new file to the build, widgets.js, to contain widget classes.
hamidouk
parents:
diff
changeset
|
39 |
}; |
| 74 | 40 |
|
41 |
IriSP.Widget.prototype.redraw = function() { |
|
42 |
/* implemented by "sub-classes" */ |
|
43 |
}; |