Subversion Repositories Applications.papyrus

Rev

Rev 1318 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
1318 alexandre_ 1
/*
2
	Copyright (c) 2004-2006, The Dojo Foundation
3
	All Rights Reserved.
4
 
5
	Licensed under the Academic Free License version 2.1 or above OR the
6
	modified BSD license. For more information on Dojo licensing, see:
7
 
8
		http://dojotoolkit.org/community/licensing.shtml
9
*/
10
 
1422 alexandre_ 11
 
12
 
1318 alexandre_ 13
dojo.provide("dojo.widget.demoEngine.DemoItem");
14
dojo.require("dojo.widget.*");
15
dojo.require("dojo.widget.HtmlWidget");
16
dojo.widget.defineWidget("my.widget.demoEngine.DemoItem", dojo.widget.HtmlWidget, {templateString:"<div dojoAttachPoint=\"domNode\">\n\t<div dojoAttachPoint=\"summaryBoxNode\">\n\t\t<table width=\"100%\" cellspacing=\"0\" cellpadding=\"0\">\n\t\t\t<tbody>\n\t\t\t\t<tr>\n\t\t\t\t\t<td dojoAttachPoint=\"screenshotTdNode\" valign=\"top\" width=\"1%\">\n\t\t\t\t\t\t<img dojoAttachPoint=\"thumbnailImageNode\" dojoAttachEvent=\"onclick: onSelectDemo\" />\n\t\t\t\t\t</td>\n\t\t\t\t\t<td dojoAttachPoint=\"summaryContainerNode\" valign=\"top\">\n\t\t\t\t\t\t<h1 dojoAttachPoint=\"nameNode\">\n\t\t\t\t\t\t</h1>\n\t\t\t\t\t\t<div dojoAttachPoint=\"summaryNode\">\n\t\t\t\t\t\t\t<p dojoAttachPoint=\"descriptionNode\"></p>\n\t\t\t\t\t\t\t<div dojoAttachPoint=\"viewDemoLinkNode\"><img dojoAttachPoint=\"viewDemoImageNode\"/ dojoAttachEvent=\"onclick: onSelectDemo\"></div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</td>\n\t\t\t\t</tr>\n\t\t\t</tbody>\n\t\t</table>\n\t</div>\n</div>\n", templateCssString:".demoItemSummaryBox {\n\tbackground: #efefef;\n\tborder:1px solid #dae3ee;\n}\n\n.demoItemScreenshot {\n\tpadding:0.65em;\n\twidth:175px;\n\tborder-right:1px solid #fafafa;\n\ttext-align:center;\n\tcursor: pointer;\n}\n\n.demoItemWrapper{\n\tmargin-bottom:1em;\n}\n\n.demoItemWrapper a:link, .demoItemWrapper a:visited {\n\tcolor:#a6238f;\n\ttext-decoration:none;\n}\n\n.demoItemSummaryContainer {\n\tborder-left:1px solid #ddd;\n}\n\n.demoItemSummaryContainer h1 {\n\tbackground-color:#e8e8e8;\n\tborder-bottom: 1px solid #e6e6e6;\n\tcolor:#738fb9;\n\tmargin:1px;\n\tpadding:0.5em;\n\tfont-family:\"Lucida Grande\", \"Tahoma\", serif;\n\tfont-size:1.25em;\n\tfont-weight:normal;\n}\n\n.demoItemSummaryContainer h1 .packageSummary {\n\tdisplay:block;\n\tcolor:#000;\n\tfont-size:10px;\n\tmargin-top:2px;\n}\n\n.demoItemSummaryContainer .demoItemSummary{\n\tpadding:1em;\n}\n\n.demoItemSummaryContainer .demoItemSummary p {\n\tfont-size:0.85em;\n\tpadding:0;\n\tmargin:0;\n}\n\n.demoItemView {\n\ttext-align:right;\n\tcursor: pointer;\n}\n", templateCssPath:dojo.uri.moduleUri("dojo.widget", "demoEngine/templates/DemoItem.css"), postCreate:function () {
17
	dojo.html.addClass(this.domNode, this.domNodeClass);
18
	dojo.html.addClass(this.summaryBoxNode, this.summaryBoxClass);
19
	dojo.html.addClass(this.screenshotTdNode, this.screenshotTdClass);
20
	dojo.html.addClass(this.summaryContainerNode, this.summaryContainerClass);
21
	dojo.html.addClass(this.summaryNode, this.summaryClass);
22
	dojo.html.addClass(this.viewDemoLinkNode, this.viewDemoLinkClass);
23
	this.nameNode.appendChild(document.createTextNode(this.name));
24
	this.descriptionNode.appendChild(document.createTextNode(this.description));
25
	this.thumbnailImageNode.src = this.thumbnail;
26
	this.thumbnailImageNode.name = this.name;
27
	this.viewDemoImageNode.src = this.viewDemoImage;
28
	this.viewDemoImageNode.name = this.name;
29
}, onSelectDemo:function () {
30
}}, "", function () {
31
	this.demo = "";
32
	this.domNodeClass = "demoItemWrapper";
33
	this.summaryBoxNode = "";
34
	this.summaryBoxClass = "demoItemSummaryBox";
35
	this.nameNode = "";
36
	this.thumbnailImageNode = "";
37
	this.viewDemoImageNode = "";
38
	this.screenshotTdNode = "";
39
	this.screenshotTdClass = "demoItemScreenshot";
40
	this.summaryContainerNode = "";
41
	this.summaryContainerClass = "demoItemSummaryContainer";
42
	this.summaryNode = "";
43
	this.summaryClass = "demoItemSummary";
44
	this.viewDemoLinkNode = "";
45
	this.viewDemoLinkClass = "demoItemView";
46
	this.descriptionNode = "";
47
	this.name = "Some Demo";
48
	this.description = "This is the description of this demo.";
49
	this.thumbnail = "images/test_thumb.gif";
50
	this.viewDemoImage = "images/viewDemo.png";
51
});
52