Subversion Repositories Applications.papyrus

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2150 mathias 1
if(!dojo._hasResource["dojox.data.demos.widgets.PicasaView"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
2
dojo._hasResource["dojox.data.demos.widgets.PicasaView"] = true;
3
dojo.provide("dojox.data.demos.widgets.PicasaView");
4
dojo.require("dijit._Templated");
5
dojo.require("dijit._Widget");
6
 
7
dojo.declare("dojox.data.demos.widgets.PicasaView", [dijit._Widget, dijit._Templated], {
8
	//Simple demo widget for representing a view of a Picasa Item.
9
 
10
	templateString:"<table class=\"picasaView\">\n\t<tbody>\n\t\t<tr class=\"picasaTitle\">\n\t\t\t<td>\n\t\t\t\t<b>\n\t\t\t\t\tTitle:\n\t\t\t\t</b>\n\t\t\t</td>\n\t\t\t<td dojoAttachPoint=\"titleNode\">\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td>\n\t\t\t\t<b>\n\t\t\t\t\tAuthor:\n\t\t\t\t</b>\n\t\t\t</td>\n\t\t\t<td dojoAttachPoint=\"authorNode\">\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td colspan=\"2\">\n\t\t\t\t<b>\n\t\t\t\t\tSummary:\n\t\t\t\t</b>\n\t\t\t\t<span class=\"picasaSummary\" dojoAttachPoint=\"descriptionNode\"></span>\n\t\t\t</td>\n\t\t</tr>\n\t\t<tr>\n\t\t\t<td dojoAttachPoint=\"imageNode\" colspan=\"2\">\n\t\t\t</td>\n\t\t</tr>\n\t</tbody>\n</table>\n\n",
11
 
12
	//Attach points for reference.
13
	titleNode: null,
14
	descriptionNode: null,
15
	imageNode: null,
16
	authorNode: null,
17
 
18
	title: "",
19
	author: "",
20
	imageUrl: "",
21
	iconUrl: "",
22
 
23
	postCreate: function(){
24
		this.titleNode.appendChild(document.createTextNode(this.title));
25
		this.authorNode.appendChild(document.createTextNode(this.author));
26
		this.descriptionNode.appendChild(document.createTextNode(this.description));
27
		var href = document.createElement("a");
28
		href.setAttribute("href", this.imageUrl);
29
		href.setAttribute("target", "_blank");
30
        var imageTag = document.createElement("img");
31
		imageTag.setAttribute("src", this.iconUrl);
32
		href.appendChild(imageTag);
33
		this.imageNode.appendChild(href);
34
	}
35
});
36
 
37
}