2150 |
mathias |
1 |
if(!dojo._hasResource["dojox.data.demos.widgets.FlickrView"]){ //_hasResource checks added by build. Do not use _hasResource directly in your code.
|
|
|
2 |
dojo._hasResource["dojox.data.demos.widgets.FlickrView"] = true;
|
|
|
3 |
dojo.provide("dojox.data.demos.widgets.FlickrView");
|
|
|
4 |
dojo.require("dijit._Templated");
|
|
|
5 |
dojo.require("dijit._Widget");
|
|
|
6 |
|
|
|
7 |
dojo.declare("dojox.data.demos.widgets.FlickrView", [dijit._Widget, dijit._Templated], {
|
|
|
8 |
//Simple demo widget for representing a view of a Flickr Item.
|
|
|
9 |
|
|
|
10 |
templateString:"<table class=\"flickrView\">\n\t<tbody>\n\t\t<tr class=\"flickrTitle\">\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\tImage:\n\t\t\t\t</b>\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 |
var href = document.createElement("a");
|
|
|
27 |
href.setAttribute("href", this.imageUrl);
|
|
|
28 |
href.setAttribute("target", "_blank");
|
|
|
29 |
var imageTag = document.createElement("img");
|
|
|
30 |
imageTag.setAttribute("src", this.iconUrl);
|
|
|
31 |
href.appendChild(imageTag);
|
|
|
32 |
this.imageNode.appendChild(href);
|
|
|
33 |
}
|
|
|
34 |
});
|
|
|
35 |
|
|
|
36 |
}
|