f1684d1400ecd378f12bf08ad34548d7c9b512fb.svn-base 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
  2. "http://www.w3.org/TR/html4/strict.dtd">
  3. <html>
  4. <head>
  5. <title>dojox.layout.FloatPane - simplest extension on TitlePane ... ever.</title>
  6. <script type="text/javascript" src="../../../dojo/dojo.js" djConfig="isDebug:true, parseOnLoad: true" ></script>
  7. <script type="text/javascript" src="../../../dijit/tests/_testCommon.js"></script>
  8. <script type="text/javascript" src="../FloatingPane.js"></script>
  9. <script type="text/javascript">
  10. // dojo.require("dojox.layout.FloatingPane");
  11. dojo.require("dijit.form.ComboBox");
  12. dojo.require("dijit.form.Button");
  13. dojo.require("dojo.parser"); // scan page for widgets
  14. </script>
  15. <style type="text/css">
  16. @import "../../../dojo/resources/dojo.css";
  17. @import "../../../dijit/themes/dijit.css";
  18. @import "../../../dijit/themes/tundra/tundra.css";
  19. @import "../../../dijit/tests/css/dijitTests.css";
  20. @import "../resources/FloatingPane.css";
  21. @import "../resources/ResizeHandle.css";
  22. /* body { background:url('gridUnderlay.png') top left; } */
  23. .alternateDock {
  24. position:absolute;
  25. background-color:#ededed;
  26. right:0px; top:0px;
  27. border-left:1px solid #ccc;
  28. height:100%;
  29. }
  30. #alternateDock ul.dojoxDockList { display:block; }
  31. .testFixedSize {
  32. width:300px;
  33. height:200px;
  34. padding:7px;
  35. }
  36. </style>
  37. <script type="text/javascript">
  38. function makeFloater() {
  39. // programatically created FloatingPane with srcNode ref
  40. var tmp = new dojox.layout.FloatingPane({
  41. title: "dynamically created ...",
  42. id:"floater3",
  43. closeable:true,
  44. resizable:true,
  45. dockable: false
  46. },"nonFloater");
  47. tmp.startup();
  48. }
  49. var mi = 1;
  50. function brandNewFloater(){
  51. var node = document.createElement('div');
  52. node.innerHTML = dojo.byId('contentHolder').innerHTML;
  53. dojo.body().appendChild(node);
  54. dojo.addClass(node,"testFixedSize");
  55. var tmp = new dojox.layout.FloatingPane({
  56. title:" New Floater #"+(mi++),
  57. dockable: false,
  58. maxable: true,
  59. closable: true,
  60. resizable: false
  61. },node);
  62. tmp.startup();
  63. tmp.resize({ w:300, h:175 });
  64. }
  65. var vpx, vpy = null;
  66. dojo.addOnLoad(makeFloater);
  67. </script>
  68. </head>
  69. <body>
  70. <a href="javascript:dijit.byId('floater1').hide()">hide first pane</a> |
  71. <a href="javascript:dijit.byId('floater1').show()">show first pane</a> |
  72. <a href="javascript:dijit.byId('floater1').minimize()">minimize 'uncloseable, dockable' pane pane</a> |
  73. <a href="javascript:brandNewFloater()">new floater</a>
  74. <div dojoType="dojox.layout.FloatingPane" title="Floater test ... " resizable="true" id="floater1" style="width:200px;" duration="300">
  75. <p style="margin:0; padding:10px;">I am the content to be floated around</p>
  76. </div>
  77. <div dojoType="dojox.layout.FloatingPane" title="un-closable, dockable" style="width:200px; position:absolute; " closable="false" id="floater2">
  78. <p style="padding:8px; margin:0;">
  79. I am dockable, though I have no dockTo="" attribute. I will create or use an existing dock
  80. on the bottom of the screen.
  81. <br><br>
  82. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. In porta. Etiam mattis libero nec ante. Nam
  83. porta lacus eu ligula. Cras mauris. Suspendisse vel augue. Vivamus aliquam orci ut eros. Nunc
  84. eleifend sagittis turpis. purus purus in nibh. Phasellus in nunc.
  85. </p>
  86. </div>
  87. <div id="nonFloater" style="width:200px;" duration="750" >
  88. <p style="padding:8x; margin:2px;">
  89. I am made into a FloatingPane in dojo.addOnLoad();<br><br>
  90. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. In porta. Etiam mattis libero nec ante. Nam
  91. porta lacus eu ligula. Cras mauris. Suspendisse vel augue. Vivamus aliquam orci ut eros. Nunc eleifend
  92. sagittis turpis. purus purus in nibh. Phasellus in nunc.
  93. </p>
  94. </div>
  95. <div title="Alt Dock 1" style="width:100px; height:100px; float:left;"
  96. dojoType="dojox.layout.FloatingPane" duration="350" resizable="true"
  97. dockTo="alternateDock" executeScripts="true" href="_script.html">
  98. </div>
  99. <div title="Alt Dock 2" dojoType="dojox.layout.FloatingPane" resizable="true" style="width:200px; float:left;" duration="350" dockTo="alternateDock">
  100. <p style="color:#666; padding:8px; margin:0;">
  101. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. In porta. Etiam mattis libero nec ante. Nam
  102. porta lacus eu ligula. Cras mauris. Suspendisse vel augue. Vivamus aliquam orci ut eros. Nunc eleifend
  103. sagittis turpis. purus purus in nibh. Phasellus in nunc.
  104. </p>
  105. </div>
  106. <div dojoType="dojox.layout.FloatingPane"
  107. resizeable="false" style="width:200px; margin:0; background:#ccc; " title="foobar"
  108. closable="false" dockable="false"><p style="padding:12px;">
  109. This is just a pane. You cannot close me, you cannot resize me, you cannot minimize me.
  110. </p>
  111. </div>
  112. <div dojoType="dojox.layout.FloatingPane"
  113. title="remote pane" href="../../../dijit/tests/layout/doc0.html"
  114. style="width:250px; height:250px; background:#fff; margin:0; "
  115. ></div>
  116. <div dojoType="dojox.layout.Dock" id="alternateDock" class="alternateDock"></div>
  117. <div style="display:none;" id="contentHolder"><p style="padding:13px; margin:0;">
  118. I am content. I am hidden right now. This content is used to populate the newly created
  119. node being attached to the DOM to insert a new FloatingPane without a srcNodeRef. This
  120. node is not being manipulated, just having it's innerHTML read. For demonstration purposes.
  121. </p>
  122. </div>
  123. </body>
  124. </html>