src/widgets/HelloWorld.js
changeset 1013 392ddcd212d7
parent 875 43629caa77bc
child 1020 198c2b79f5e1
child 1072 ac1eacb3aa33
equal deleted inserted replaced
1012:7e18d953a1f8 1013:392ddcd212d7
     5  */
     5  */
     6 
     6 
     7 IriSP.Widgets.HelloWorld = function(player, config) {
     7 IriSP.Widgets.HelloWorld = function(player, config) {
     8     console.log("Calling IriSP.Widget's constructor from IriSP.HelloWorldWidget");
     8     console.log("Calling IriSP.Widget's constructor from IriSP.HelloWorldWidget");
     9     IriSP.Widgets.Widget.call(this, player, config);
     9     IriSP.Widgets.Widget.call(this, player, config);
    10 }
    10 };
    11 
    11 
    12 IriSP.Widgets.HelloWorld.prototype = new IriSP.Widgets.Widget();
    12 IriSP.Widgets.HelloWorld.prototype = new IriSP.Widgets.Widget();
    13 
    13 
    14 IriSP.Widgets.HelloWorld.prototype.defaults = {
    14 IriSP.Widgets.HelloWorld.prototype.defaults = {
    15     text: "world"
    15     text: "world"
    16 }
    16 };
    17 
    17 
    18 IriSP.Widgets.HelloWorld.prototype.template =
    18 IriSP.Widgets.HelloWorld.prototype.template =
    19     '<div class="Ldt-HelloWorld"><p>{{l10n.Hello}} {{text}}</p><p>Looks like we have {{source.contents.annotation.length}} annotations in this feed</p></div>';
    19     '<div class="Ldt-HelloWorld"><p>{{l10n.Hello}} {{text}}</p><p>Looks like we have {{source.contents.annotation.length}} annotations in this feed</p></div>';
    20 
    20 
    21 IriSP.Widgets.HelloWorld.prototype.messages = {
    21 IriSP.Widgets.HelloWorld.prototype.messages = {
    23         "Hello" : "Bonjour,"
    23         "Hello" : "Bonjour,"
    24     },
    24     },
    25     "en" : {
    25     "en" : {
    26         "Hello" : "Hello,"
    26         "Hello" : "Hello,"
    27     }
    27     }
    28 }
    28 };
    29 
    29 
    30 IriSP.Widgets.HelloWorld.prototype.draw = function() {
    30 IriSP.Widgets.HelloWorld.prototype.draw = function() {
    31     this.renderTemplate();
    31     this.renderTemplate();
    32     console.log("HelloWorldWidget was drawn");
    32     console.log("HelloWorldWidget was drawn");
    33 }
    33 };