test_presentation.html 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162
  1. <html>
  2. <head>
  3. <title>dojox.presentation - Presentation Mechanism</title>
  4. <script type="text/javascript"> djConfig = { isDebug: true, parseOnLoad: true }; </script>
  5. <script type="text/javascript" src="../../../dojo/dojo.js"></script>
  6. <script type="text/javascript" src="../../../dijit/form/Button.js"></script>
  7. <script type="text/javascript">
  8. dojo.require("dojox.presentation");
  9. dojo.require("dijit._Calendar");
  10. dojo.require("dijit.TitlePane");
  11. dojo.require("dojo.parser");
  12. dojo.require("dojo.fx");
  13. dojo.require("dojo.dnd.move");
  14. </script>
  15. <style type="text/css">
  16. @import "../../../dojo/resources/dojo.css";
  17. @import "../../../dijit/themes/tundra/tundra.css";
  18. @import "../../../dijit/tests/css/dijitTests.css";
  19. @import "../resources/Show.css";
  20. </style>
  21. <script type="text/javascript">
  22. var externalAnimation = null;
  23. var titleCount=0;
  24. var titles = [
  25. "Just Kidding",
  26. "The Title Will keep changing",
  27. "but you can click to advance",
  28. "nonthing fancy",
  29. "just an example of",
  30. "an external function controlling a slide."
  31. ];
  32. function playIt() {
  33. var node = dijit.byId('animated').slideTitle;
  34. console.debug(node);
  35. // this is the fanciest animation chain i could thing of atm
  36. tmpTitle = titles[titleCount++] || titles[0];
  37. externalAnimation = dojo.fx.chain([
  38. dojo.fadeOut({ node: node,
  39. duration: 500,
  40. onEnd: dojo.hitch(this,function(){
  41. node.innerHTML = tmpTitle;
  42. })
  43. }),
  44. dojo.animateProperty({
  45. node: node,
  46. duration: 10,
  47. properties: { letterSpacing: {
  48. end:-26.3, unit: 'em', start:3.2
  49. }
  50. }
  51. }),
  52. dojo.fadeIn({ node: node,
  53. duration:300
  54. }),
  55. dojo.animateProperty({
  56. node: node,
  57. duration: 800,
  58. properties: { letterSpacing: {
  59. end:2.8, unit: 'em' , start:-26.0
  60. }
  61. }
  62. })
  63. ]);
  64. setTimeout("externalAnimation.play()",50);
  65. }
  66. function makeDraggable(node) {
  67. var tmp = new dojo.dnd.Moveable(node);
  68. }
  69. </script>
  70. </head>
  71. <body class="tundra">
  72. <div dojoType="dojox.presentation.Deck" id="testPresentation">
  73. <div dojoType="dojox.presentation.Slide" id="myFirstSlide" title="Introduction">
  74. <p>This is a brief overview of what this presentation widget is capable of.</p>
  75. <div dojoType="dojox.presentation.Part" as="one">... it's new, and completely different, so watch close</div>
  76. <input dojoType="dojox.presentation.Action" forSlide="one" toggle="fade" duration="3000">
  77. <input dojoType="dojox.presentation.Action" forSlide="one" toggle="wipe">
  78. </div>
  79. <div dojoType="dojox.presentation.Slide" title="Basic Actions">
  80. <p>Click, and more text will appear</p>
  81. <div dojoType="dojox.presentation.Part" as="one">
  82. <p>Lorem something something. I am text, hear me _roar_.</p>
  83. </div>
  84. <input dojoType="dojox.presentation.Action" forSlide="one" on="click" toggle="fade">
  85. <div dojoType="dojox.presentation.Part" as="me">
  86. I am here to make sure click-advancing is disabled on normal input type elements:
  87. <ul>
  88. <li><a href="javascript:;">href</a></li>
  89. <li>Input: <input type="text" name="foo"></li>
  90. </ul>
  91. </div>
  92. <input dojoType="dojox.presentation.Action" forslide="me" toggle="slide">
  93. </div>
  94. <div dojoType="dojox.presentation.Slide" title="Automatically Advance">
  95. <p dojoType="dojox.presentation.Part" as="one">First You See me ...</p>
  96. <p dojoType="dojox.presentation.Part" as="two">Then you see ME ...</p>
  97. <p dojoType="dojox.presentation.Part" as="three" style="padding:20px;">oh yeah!</p>
  98. <input dojoType="dojox.presentation.Action" forSlide="one" on="click" toggle="fade" delay="1500">
  99. <input dojoType="dojox.presentation.Action" forSlide="two" toggle="wipe" delay="1500">
  100. <input dojoType="dojox.presentation.Action" forSlide="three" toggle="wipe" delay="1500">
  101. </div>
  102. <!--
  103. <div dojoType="dojox.presentation.Slide" title="Remote Slide" href="_ext1.html"></div>
  104. -->
  105. <div dojoType="dojox.presentation.Slide" title="Click Blocking" id="animated">
  106. <p>You cannot click on this page</p>
  107. <p dojoType="dojox.presentation.Part" as="1">I told you that you can't click ...</p>
  108. <a href="javascript:;" onClick="playIt()">click here to move the title</a>
  109. <input dojoType="dojox.presentation.Action" forSlide="1" toggle="wipe">
  110. <input dojoType="dojox.presentation.Action" forSlide="2">
  111. <input dojoType="dojox.presentation.Action" forSlide="1" toggle="fade">
  112. </div>
  113. <div dojoType="dojox.presentation.Slide" title="Widgets in Slide" noClick="true" id="wdijit">
  114. <p>There is a widget in this page:</p>
  115. <p>clicking has been stopped on this page to demonstrate the usage ..</p>
  116. <div dojoType="dojox.presentation.Part" as="foo" startVisible="true">
  117. There _should_ be a _Calendar widget here<br>
  118. <div dojoType="dijit._Calendar"></div>
  119. </div>
  120. <div dojoType="dijit.TitlePane" title="foobar" id="newTitlePane"
  121. style="width:300px; position:absolute; right:40px; top:125px;">
  122. I am a titlepane, you can do cool things with me.
  123. <button onClick="makeDraggable('newTitlePane')">Make me Draggable!</button>
  124. </div>
  125. <div style="width:400px; position:absolute; right: 40px; bottom:40px;">
  126. <p>... so I'm providing a next button: <button dojoType="dijit.form.Button" value="Next" onClick="dijit.byId('testPresentation').nextSlide();">Next</button></p>
  127. </div>
  128. <input type="dojox.presentation.Action" forSlide="foo" toggle="slide">
  129. </div>
  130. <div dojoType="dojox.presentation.Slide" title="The End">
  131. <p>Thanks for watching!</p>
  132. </div>
  133. </div>
  134. </body>
  135. </html>