Line | |
---|
1 | dojo.provide("dojox.data.demos.widgets.PicasaView"); |
---|
2 | dojo.require("dijit._Templated"); |
---|
3 | dojo.require("dijit._Widget"); |
---|
4 | |
---|
5 | dojo.declare("dojox.data.demos.widgets.PicasaView", [dijit._Widget, dijit._Templated], { |
---|
6 | //Simple demo widget for representing a view of a Picasa Item. |
---|
7 | |
---|
8 | templateString: dojo.cache("dojox", "data/demos/widgets/templates/PicasaView.html"), |
---|
9 | |
---|
10 | //Attach points for reference. |
---|
11 | titleNode: null, |
---|
12 | descriptionNode: null, |
---|
13 | imageNode: null, |
---|
14 | authorNode: null, |
---|
15 | |
---|
16 | title: "", |
---|
17 | author: "", |
---|
18 | imageUrl: "", |
---|
19 | iconUrl: "", |
---|
20 | |
---|
21 | postCreate: function(){ |
---|
22 | this.titleNode.appendChild(document.createTextNode(this.title)); |
---|
23 | this.authorNode.appendChild(document.createTextNode(this.author)); |
---|
24 | this.descriptionNode.appendChild(document.createTextNode(this.description)); |
---|
25 | var href = document.createElement("a"); |
---|
26 | href.setAttribute("href", this.imageUrl); |
---|
27 | href.setAttribute("target", "_blank"); |
---|
28 | var imageTag = document.createElement("img"); |
---|
29 | imageTag.setAttribute("src", this.iconUrl); |
---|
30 | href.appendChild(imageTag); |
---|
31 | this.imageNode.appendChild(href); |
---|
32 | } |
---|
33 | }); |
---|
Note: See
TracBrowser
for help on using the repository browser.