Commit 30ffbe916d66f42ec31f64688a037bce37c04b95

Add inheritance support in models.js

  Previously BaseType was written to have inheritance, but derived classes were
not inheriting some properties, and the super classes constructor was also not
called. Appropriate fixes.
  
1111 });
1212
1313 var Text = BaseType.extend({
14 defaults: {
14 defaults: _.extend(BaseType.prototype.defaults, {
1515 data: "",
16 },
16 }),
1717 initialize: function() {
18 BaseType.prototype.initialize.call(this, arguments);
1819 }
1920 });
2021
2122 var Table = BaseType.extend({
22 defaults: {
23 defaults: _.extend(BaseType.prototype.defaults, {
2324 data : {
2425 th: [],
2526 tr:[]
2627 }
27 },
28 }),
2829 initialize: function() {
30 BaseType.prototype.initialize.call(this, arguments);
2931 }
3032 });
3133
3234 var Image = BaseType.extend({
33 defaults: {
35 defaults: _.extend(BaseType.prototype.defaults, {
3436 src: ""
35 },
37 }),
3638 initialize:function() {
39 BaseType.prototype.initialize.call(this, arguments);
3740 }
3841 });
3942
4043 var Video = BaseType.extend({
41 defaults: {
44 defaults: _.extend(BaseType.prototype.defaults, {
4245 src: ""
43 },
46 }),
4447 initialize:function() {
48 BaseType.prototype.initialize.call(this, arguments);
4549 }
4650 });
4751
4852 var RSS = BaseType.extend({
49 defaults: {
53 defaults: _.extend(BaseType.prototype.defaults, {
5054 src: ""
51 },
55 }),
5256 initialize:function() {
57 BaseType.prototype.initialize.call(this, arguments);
5358 }
5459 });
5560
6363 // Also the website can be styled by using external CSS files,
6464 // which can also be loaded via this plugin model.
6565 var Plugin = BaseType.extend({
66 defaults: {
66 defaults: _.extend(BaseType.prototype.defaults, {
6767 src: "",
6868 data: {},
6969 callback: ""
70 },
70 }),
7171 initialize: function() {
72 BaseType.prototype.initialize.call(this, arguments);
73
7274 if(this.get('src').match(/\.js/)) {
7375 var script = document.createElement('script');
7476 var callback = this.get('callback');