1 IriSP.Widgets.SpelSyncHtml = function(player, config) { |
1 const SpelSyncHtml = function(ns) { |
|
2 return class extends ns.Widgets.Widget { |
|
3 constructor(player, config) { |
|
4 super(player, config); |
2 console.log("Calling IriSP.Widget's constructor from IriSP.HelloWorldWidget"); |
5 console.log("Calling IriSP.Widget's constructor from IriSP.HelloWorldWidget"); |
3 IriSP.Widgets.Widget.call(this, player, config); |
|
4 }; |
6 }; |
5 |
7 |
6 IriSP.Widgets.SpelSyncHtml.prototype = new IriSP.Widgets.Widget(); |
8 static defaults = { |
7 |
|
8 IriSP.Widgets.SpelSyncHtml.prototype.defaults = { |
|
9 src: "about:blank" |
9 src: "about:blank" |
10 }; |
10 }; |
11 |
11 |
12 IriSP.Widgets.SpelSyncHtml.prototype.template = |
12 static template = |
13 '<div class="Ldt-SpelSyncHtml"><iframe src="{{src}}" {{#width}}width="{{width}}"{{/width}} {{#height}}height="{{height}}"{{/height}}</div>'; |
13 '<div class="Ldt-SpelSyncHtml"><iframe src="{{src}}" {{#width}}width="{{width}}"{{/width}} {{#height}}height="{{height}}"{{/height}}</div>'; |
14 |
14 |
15 IriSP.Widgets.SpelSyncHtml.prototype.draw = function() { |
15 draw() { |
16 this.renderTemplate(); |
16 this.renderTemplate(); |
17 var frame = this.$.find("iframe")[0], |
17 var frame = this.$.find("iframe")[0], |
18 basesrc = this.src.replace(/#.*$/,''); |
18 basesrc = this.src.replace(/#.*$/,''); |
19 this.getWidgetAnnotations().forEach(function(a) { |
19 this.getWidgetAnnotations().forEach(function(a) { |
20 a.on("enter", function() { |
20 a.on("enter", function() { |