src/js/widgets/helloWorldWidget.js
branchnew-model
changeset 875 43629caa77bc
parent 874 38b65761a7d5
child 876 03967b6ada7c
equal deleted inserted replaced
874:38b65761a7d5 875:43629caa77bc
     1 IriSP.i18n.addMessages({
       
     2     "fr": {
       
     3         "Hello" : "Bonjour,"
       
     4     },
       
     5     "en" : {
       
     6         "Hello" : "Hello,"
       
     7     }
       
     8 })
       
     9 
       
    10 IriSP.HelloWorldWidget = function(player, config) {
       
    11     console.log("Calling IriSP.Widget's constructor from IriSP.HelloWorldWidget");
       
    12     IriSP.Widget.call(this, player, config);
       
    13     if (typeof this.text == "undefined") {
       
    14         this.text = 'world'
       
    15     }
       
    16 }
       
    17 
       
    18 IriSP.HelloWorldWidget.prototype = new IriSP.Widget();
       
    19 
       
    20 IriSP.HelloWorldWidget.prototype.draw = function() {
       
    21     var _tmpl = '<p>{{l10n.Hello}} {{text}}</p><p>Looks like we have {{source.contents.annotation.length}} annotations in this feed</p>'
       
    22         _html = IriSP.templToHTML(_tmpl, this);
       
    23     this.$.append(_html);
       
    24     this.$.find('p').css({
       
    25         "text-align" : "center",
       
    26         "margin": "10px 0",
       
    27         "font-size" : "14px"
       
    28     });
       
    29     console.log("HelloWorldWidget was drawn");
       
    30 }