equal
deleted
inserted
replaced
|
1 /* Shows an example of a widget, with : |
|
2 * - Use of source data |
|
3 * - Use of templating |
|
4 * - Use of internationalization |
|
5 */ |
|
6 |
|
7 IriSP.Widgets.HelloWorld = function(player, config) { |
|
8 console.log("Calling IriSP.Widget's constructor from IriSP.HelloWorldWidget"); |
|
9 IriSP.Widgets.Widget.call(this, player, config); |
|
10 } |
|
11 |
|
12 IriSP.Widgets.HelloWorld.prototype = new IriSP.Widgets.Widget(); |
|
13 |
|
14 IriSP.Widgets.HelloWorld.prototype.defaults = { |
|
15 text: "world" |
|
16 } |
|
17 |
|
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>'; |
|
20 |
|
21 IriSP.Widgets.HelloWorld.prototype.messages = { |
|
22 "fr": { |
|
23 "Hello" : "Bonjour," |
|
24 }, |
|
25 "en" : { |
|
26 "Hello" : "Hello," |
|
27 } |
|
28 } |
|
29 |
|
30 IriSP.Widgets.HelloWorld.prototype.draw = function() { |
|
31 this.renderTemplate(); |
|
32 console.log("HelloWorldWidget was drawn"); |
|
33 } |