src/widgets/SpelSyncHtml.js
changeset 1013 392ddcd212d7
parent 1008 81243f1c7cff
child 1072 ac1eacb3aa33
equal deleted inserted replaced
1012:7e18d953a1f8 1013:392ddcd212d7
     1 IriSP.Widgets.SpelSyncHtml = function(player, config) {
     1 IriSP.Widgets.SpelSyncHtml = function(player, config) {
     2     console.log("Calling IriSP.Widget's constructor from IriSP.HelloWorldWidget");
     2     console.log("Calling IriSP.Widget's constructor from IriSP.HelloWorldWidget");
     3     IriSP.Widgets.Widget.call(this, player, config);
     3     IriSP.Widgets.Widget.call(this, player, config);
     4 }
     4 };
     5 
     5 
     6 IriSP.Widgets.SpelSyncHtml.prototype = new IriSP.Widgets.Widget();
     6 IriSP.Widgets.SpelSyncHtml.prototype = new IriSP.Widgets.Widget();
     7 
     7 
     8 IriSP.Widgets.SpelSyncHtml.prototype.defaults = {
     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 IriSP.Widgets.SpelSyncHtml.prototype.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 IriSP.Widgets.SpelSyncHtml.prototype.draw = function() {
    19     this.getWidgetAnnotations().forEach(function(a) {
    19     this.getWidgetAnnotations().forEach(function(a) {
    20         a.on("enter", function() {
    20         a.on("enter", function() {
    21             if (a.content && a.content.data && a.content.data.ref_text) {
    21             if (a.content && a.content.data && a.content.data.ref_text) {
    22                 frame.src = basesrc + '#' + a.content.data.ref_text;
    22                 frame.src = basesrc + '#' + a.content.data.ref_text;
    23             }
    23             }
    24         })
    24         });
    25     })
    25     });
    26 }
    26 };