Subversion Repositories Applications.papyrus

Rev

Go to most recent revision | Details | 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
 
11
dojo.provide("dojo.widget.demoEngine.DemoItem");
12
dojo.require("dojo.widget.*");
13
dojo.require("dojo.widget.HtmlWidget");
14
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 () {
15
	dojo.html.addClass(this.domNode, this.domNodeClass);
16
	dojo.html.addClass(this.summaryBoxNode, this.summaryBoxClass);
17
	dojo.html.addClass(this.screenshotTdNode, this.screenshotTdClass);
18
	dojo.html.addClass(this.summaryContainerNode, this.summaryContainerClass);
19
	dojo.html.addClass(this.summaryNode, this.summaryClass);
20
	dojo.html.addClass(this.viewDemoLinkNode, this.viewDemoLinkClass);
21
	this.nameNode.appendChild(document.createTextNode(this.name));
22
	this.descriptionNode.appendChild(document.createTextNode(this.description));
23
	this.thumbnailImageNode.src = this.thumbnail;
24
	this.thumbnailImageNode.name = this.name;
25
	this.viewDemoImageNode.src = this.viewDemoImage;
26
	this.viewDemoImageNode.name = this.name;
27
}, onSelectDemo:function () {
28
}}, "", function () {
29
	this.demo = "";
30
	this.domNodeClass = "demoItemWrapper";
31
	this.summaryBoxNode = "";
32
	this.summaryBoxClass = "demoItemSummaryBox";
33
	this.nameNode = "";
34
	this.thumbnailImageNode = "";
35
	this.viewDemoImageNode = "";
36
	this.screenshotTdNode = "";
37
	this.screenshotTdClass = "demoItemScreenshot";
38
	this.summaryContainerNode = "";
39
	this.summaryContainerClass = "demoItemSummaryContainer";
40
	this.summaryNode = "";
41
	this.summaryClass = "demoItemSummary";
42
	this.viewDemoLinkNode = "";
43
	this.viewDemoLinkClass = "demoItemView";
44
	this.descriptionNode = "";
45
	this.name = "Some Demo";
46
	this.description = "This is the description of this demo.";
47
	this.thumbnail = "images/test_thumb.gif";
48
	this.viewDemoImage = "images/viewDemo.png";
49
});
50