DemoItem.js
上传用户:kimgenplus
上传日期:2016-06-05
资源大小:20877k
文件大小:4k
源码类别:

OA系统

开发平台:

Java

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