aboutsummaryrefslogtreecommitdiff
path: root/includes/js/dijit/bench
diff options
context:
space:
mode:
authormensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f>2008-11-13 09:49:11 +0000
committermensonge <mensonge@b3834d28-1941-0410-a4f8-b48e95affb8f>2008-11-13 09:49:11 +0000
commite44a7e37b6c7b5961adaffc62b9042b8d442938e (patch)
tree95b67c356e93163467db2451f2b8cce84ed5d582 /includes/js/dijit/bench
parenta62b9742ee5e28bcec6872d88f50f25b820914f6 (diff)
downloadsemanticscuttle-e44a7e37b6c7b5961adaffc62b9042b8d442938e.tar.gz
semanticscuttle-e44a7e37b6c7b5961adaffc62b9042b8d442938e.tar.bz2
New feature: basic Ajax suggestion for tags and implementation of Dojo toolkit
git-svn-id: https://semanticscuttle.svn.sourceforge.net/svnroot/semanticscuttle/trunk@151 b3834d28-1941-0410-a4f8-b48e95affb8f
Diffstat (limited to 'includes/js/dijit/bench')
-rw-r--r--includes/js/dijit/bench/benchReceive.php129
-rw-r--r--includes/js/dijit/bench/benchTool.html189
-rw-r--r--includes/js/dijit/bench/create_widgets.html73
-rw-r--r--includes/js/dijit/bench/test_Button-programmatic.html75
-rw-r--r--includes/js/dijit/bench/test_button-results.html66
-rw-r--r--includes/js/dijit/bench/widget_construction_test.php186
6 files changed, 718 insertions, 0 deletions
diff --git a/includes/js/dijit/bench/benchReceive.php b/includes/js/dijit/bench/benchReceive.php
new file mode 100644
index 0000000..6330077
--- /dev/null
+++ b/includes/js/dijit/bench/benchReceive.php
@@ -0,0 +1,129 @@
+<?php
+/*
+
+ benchReceive.php - example way to handle incoming benchmark data,
+ or how to use JSON php class to mangle data. No benchmark data
+ is stored currently.
+
+--
+-- Table structure for table `benchmarks`
+--
+
+CREATE TABLE `benchmarks` (
+ `id` int(11) NOT NULL auto_increment,
+ `useragent` varchar(242) NOT NULL default '',
+ `dojover` varchar(96) NOT NULL default '',
+ `testNum` int(11) NOT NULL default '0',
+ `dijit` varchar(64) NOT NULL default '',
+ `testCount` int(11) NOT NULL default '0',
+ `testAverage` float NOT NULL default '0',
+ `testMethod` varchar(10) NOT NULL default '',
+ `testTime` bigint(20) NOT NULL default '0',
+ `dataSet` varchar(64) NOT NULL default '',
+ PRIMARY KEY (`id`),
+ KEY `dijit` (`dijit`,`testAverage`),
+ KEY `dataSet` (`dataSet`)
+) TYPE=MyISAM;
+
+--
+-- [end table struct] --
+
+*/
+
+if (is_array($_POST)) {
+
+ $username = '';
+ $password = '';
+ $dataBase = '';
+ $table = '';
+
+ mysql_connect("localhost",$username,$password);
+ mysql_select_db($dataBase);
+
+ require("../../dojo/tests/resources/JSON.php");
+ $json = new Services_JSON();
+
+ // see "escape()" call in benchTest.html
+ $string = $json->decode(urldecode($_POST['key']));
+ // $string = $json->decode($_POST['key']);
+
+ print "<h1>Thank YOU!</h1>";
+ print "
+ <p>Your results have been added to our database. No
+ personal information outside of what you see here
+ has been stored.
+ </p>
+
+ <p>You can <a href= \"javascript:history.back()\">go back</a>
+ and run more tests, or even better, load up another browser
+ and the submit your tests again!
+ </p>
+
+ <p>again ... thanks for your time.</p>
+
+ ";
+
+ print "<h3>Results Submitted:</h3>";
+ print "<pre style=\"font:6pt Terminal,sans-serif; border:1px solid #cecece; background-color:#ededed; padding:20px; \">";
+
+ $ua = $string->clientNavigator;
+ $dojov = $string->dojoVersion;
+
+ print "Client: ".$ua."\n";
+ print "Dojo v".$dojov."\n";
+
+ if (is_array($string->dataSet)) {
+ print "\nTest Results:";
+ // should client serialize a key, or is this safer?
+ $dataSet = md5(serialize($string));
+ foreach ($string->dataSet as $test) {
+ $data = array(
+ 'dataSet' => $dataSet,
+ 'useragent' => $ua,
+ 'dojover' => $dojov,
+ 'testNum' => $test->testNum,
+ 'testMethod' => $test->testMethod,
+ 'testTime' => $test->testTime,
+ 'testAverage' => $test->testAverage,
+ 'testCount' => $test->testCount,
+ 'dijit' => $test->dijit
+ );
+ print_r($data);
+ add_rec($table,$data);
+ }
+ }
+
+ if (is_array($string->errors)) {
+ // not saving errors at this point
+ print "\nErrors:";
+ foreach ($string->errors as $error) {
+ print_r($error);
+ }
+ }
+ print "</pre>";
+}
+
+function add_rec($table, $data) {
+
+ if (!is_array($data)) { return FALSE; }
+
+ $keys = array_keys($data);
+ $values = array_values($data);
+ $field=0;
+
+ for ($field;$field<sizeof($data);$field++) {
+ if (!ereg("^[0-9].*$",$keys[$field])) {
+ $sqlfields = $sqlfields.$keys[$field]."=\"".$values[$field]."\", ";
+ }
+ }
+ $sqlfields = (substr($sqlfields,0,(strlen($sqlfields)-2)));
+
+ if ($query = mysql_query("insert into $table set $sqlfields")) {
+ $id = mysql_insert_id();
+ return ($id);
+ }else{
+ return FALSE;
+ }
+}
+
+?>
diff --git a/includes/js/dijit/bench/benchTool.html b/includes/js/dijit/bench/benchTool.html
new file mode 100644
index 0000000..b8a9041
--- /dev/null
+++ b/includes/js/dijit/bench/benchTool.html
@@ -0,0 +1,189 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+ <title>Dojo interactive benchmark tool</title>
+ <script type="text/javascript" src="../../dojo/dojo.js"></script>
+ <script type="text/javascript">
+ // FIXME:
+ // the url below points to dojo.inpdx.net/benchResults.php
+ // need to setup DB on dtk.org and change URL here to store
+ // results elsewhere ... work db structure in accompanying
+ // .php file
+ // basic stats are located at http://dojo.inpdx.net/benchmarks.html
+
+ dojo.require("dojo.fx");
+ // FIXME: this seems an excessive fix for IE6 issue ...
+ dojo.require("dijit.dijit");
+ // dojo.require("dijit.form.Button");
+ dojo.require("dijit.dijit-all");
+ dojo.require("dojo.parser");
+
+
+ // setup global variables
+ var masterResults = { clientNavigator: navigator.userAgent, dataSet: [], errors: [] }
+ var isRunning = false;
+ var theCount, theClass, runner = null;
+ var testCount = 0;
+ dojo.addOnLoad(function(){
+ theCount = dojo.byId('countNode');
+ theClass = dojo.byId('classNode');
+ runner = dojo.byId('runner');
+ masterResults.dojoVersion = dojo.version.toString();
+ });
+
+
+ function _toggleRunMsg(){
+ var newMsg = (isRunning) ? " Run Test " : " Running ..."
+ dojo.fx.chain([
+ dojo.fadeOut({
+ node:runner,
+ duration:200,
+ onEnd: function(){
+ runner.innerHTML = newMsg;
+ isRunning=!isRunning;
+ }
+ }),
+ dojo.fadeIn({ node:runner, duration: 200 })
+ ]).play();
+ }
+
+ function runTest(){
+ if(isRunning){ return; }
+ _toggleRunMsg();
+ setTimeout(function(){_runRealTest();},1000);
+ }
+
+ function _runRealTest(){
+
+ var _error = false;
+ var count = theCount.value;
+ var aclass = theClass.value.toString();
+ var theMethod = (dojo.byId('parse').checked) ? "parse" : "create";
+
+ var tmpNode = document.createElement('div');
+
+ switch(theMethod){
+ case "parse" :
+ var tmpString = [];
+ for(var i=0; i<count; i++){
+ tmpString.push('<div dojoType="', aclass, '"></div>');
+ }
+ tmpNode.innerHTML = tmpString.join("");
+ var tmpTimer = new Date().getTime();
+ dojo.parser.parse(tmpNode);
+ var endTime = new Date().getTime() - tmpTimer;
+ break;
+ case "create" :
+ var construction = dojo.getObject(aclass);
+ var tmpTimer = new Date().getTime();
+ for(var i=0; i<count; i++){
+ var tmp = new construction({});
+ tmpNode.appendChild(tmp.domNode);
+ }
+ var endTime = new Date().getTime() - tmpTimer;
+ break;
+ }
+
+ var average = (endTime / count);
+ var msg = "It took: "+endTime+"ms to "+theMethod+" "+count+" "+aclass+" widgets"+
+ "<br>(average: "+average+" ms/widget)<br><br>";
+
+ masterResults.dataSet.push({
+ testNum: ++testCount,
+ dijit: aclass,
+ testCount: count,
+ testAverage: average,
+ testMethod: theMethod,
+ testTime: endTime
+ });
+
+ dojo.byId("results").innerHTML += msg;
+ setTimeout(function(){_toggleRunMsg();},250);
+
+ // Nodes have to be in the document for IE7 to GC them.
+ // Do this after generating the widgets to dispel
+ // notion that widget parents have to be in document
+ // a-priori.
+ dojo.byId("limbo").appendChild(tmpNode);
+ }
+
+ function doDebug(){
+ var key = escape(dojo.toJson(masterResults));
+ dojo.byId('hiddenHolder').value = key;
+ return true;
+ }
+
+ </script>
+ <style>
+ @import "../../dijit/themes/tundra/tundra.css";
+ @import "../../dijit/themes/dijit.css";
+ @import "../../dojo/resources/dojo.css";
+ @import "../../dijit/tests/css/dijitTests.css";
+
+ #limbo {
+ display: none;
+ }
+ #theContainer {
+ float:left;
+ display: block; padding:12px; padding-top:0;
+ width:420px; margin-left:20px;
+ background-color:#fff; -moz-border-radius:8pt 8pt;
+ border:2px solid #ededed;
+ }
+ #leftControl { float:left; width:300px; }
+ #testControl, #submitControl { border:2px solid #ededed; padding:12px; -moz-border-radius:8pt 8pt; background-color:#fff; }
+ #results { overflow:auto; height:300px; border:1px solid #ccc; color:darkred; padding:8px; }
+ #results li { list-style-type: none; }
+ #results ul { margin:0; padding:0; }
+ .runHolder, .submitButton {
+ border:1px solid #ccc; padding:3px; -moz-border-radius:8pt 8pt; text-align:center;
+ cursor:pointer; background-color:#ededed; display:block; width:125px;
+ }
+
+ </style>
+</head>
+<body class="tundra">
+ <div id="limbo"></div>
+ <h1 class="testTitle">Dojo Benchmark Tool</h1>
+
+ <div id="leftControl">
+ <div id="testControl">
+
+ Class: <input type="text" name="dijit" id="classNode" value="dijit.form.Button"><br><br>
+ Count: <input type="text" name="count" id="countNode" value="100" size="4" ><br><br>
+
+ Method: <label for="parse">
+ <input type="radio" name="theMethod" value="parse" id="parse" checked="on"> Parse
+ </label>
+ <label for="create">
+ <input type="radio" name="theMethod" value="create" id="create"> Create
+ </label>
+
+ <br><br>
+ <span onclick="runTest()" class="runHolder"><span id="runner"> Run Test </span></span>
+
+ </div>
+
+ <br>
+
+ <div id="submitControl">
+ <p>
+ * The results of these tests are important to us. Please feel free to submit your dataSet
+ to Dojotoolkit.org. Your privacy will be respected.
+
+ </p>
+ <div id="hiddenResults">
+ <form id="resultForm" action="http://dojo.inpdx.net/benchResults.php"
+ method="POST" onsubmit="doDebug()">
+ <input type="hidden" id="hiddenHolder" value="" name="key">
+ <input type="submit" value=" Submit Data " class="submitButton">
+ </form>
+ </div>
+ </div>
+ </div>
+
+ <div id="theContainer"><h3>Results:</h3><div id="results"></div></div>
+
+</body>
+</html>
diff --git a/includes/js/dijit/bench/create_widgets.html b/includes/js/dijit/bench/create_widgets.html
new file mode 100644
index 0000000..9a6f78a
--- /dev/null
+++ b/includes/js/dijit/bench/create_widgets.html
@@ -0,0 +1,73 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+ <head>
+ <title>PROGRAMMATIC - Dojo Widget Creation Test</title>
+ <script type="text/javascript" src="../../dojo/dojo.js"></script>
+ <script type="text/javascript" src="../dijit.js"></script>
+ <script type="text/javascript">
+ var queryCount = location.search.match(/count=(\d*)/);
+ var count = (queryCount ? parseInt(queryCount[1]) : 100);
+ var queryClass = location.search.match(/class=([a-zA-z.]*)/);
+ var className = (queryClass ? queryClass[1] : "form.Button");
+
+ dojo.require("dijit." + className);
+ dojo.require("dojo.parser");
+ logMessage = window.alert;
+ </script>
+ <style type="text/css">
+ @import "../themes/tundra/tundra.css";
+ /* group multiple buttons in a row */
+ .box {
+ display: block;
+ text-align: center;
+ }
+ .box .dojoButton {
+ width: 80px;
+ margin-right: 10px;
+ }
+ .dojoButtonContents {
+ font-size: 1.6em;
+ }
+
+ #buttonContainer {
+ border: 1px solid black;
+ width: 100%;
+ }
+
+ #results {
+ color: darkred;
+ }
+ </style>
+ </head>
+ <body class=tundra>
+ <script language='javascript'>
+ document.write("<h2>Currently Creating "+count+" "+className+" instances</h2>");
+ </script>
+ Pass <code>?count=<i><b>100</b></i></code> in the query string to change the number of widgets.<br>
+ Pass <code>?class=<i><b>form.Button</b></i></code> in the query string to change the widget class.
+ <h3 id="results"></h3>
+
+ <div id="buttonContainer" class='box'></div>
+ <br>
+ <script type="text/javascript">
+ // See if we can make a widget in script and attach it to the DOM ourselves.
+ var constructor = dojo.getObject("dijit."+className);
+ function makeEm(){
+ var container = dojo.byId("buttonContainer");
+ var t0 = new Date().getTime();
+ for (var i = 1; i <= count; i++) {
+ var it =
+ new constructor(
+ {label:"Button "+i, onclick:'logMessage("clicked simple")'}
+ );
+ container.appendChild(it.domNode);
+ it.domNode.style.display = '';
+ }
+ var t1 = new Date().getTime();
+ dojo.byId("results").innerHTML = "It took " + (t1 - t0) + " msec to create " + count + " "+className+" instances programmatically.";
+ }
+ dojo.addOnLoad(makeEm);
+ </script>
+ </body>
+</html>
diff --git a/includes/js/dijit/bench/test_Button-programmatic.html b/includes/js/dijit/bench/test_Button-programmatic.html
new file mode 100644
index 0000000..a9d0cd1
--- /dev/null
+++ b/includes/js/dijit/bench/test_Button-programmatic.html
@@ -0,0 +1,75 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+ <head>
+ <title>PROGRAMMATIC - Dojo Button 100 Test</title>
+ <script type="text/javascript" src="../../dojo/dojo.js" XdjConfig='isDebug: true, debugAtAllCosts: true'></script>
+ <script type="text/javascript">
+ dojo.require("dijit.form.Button");
+ dojo.require("dojo.parser");
+ logMessage = window.alert;
+ </script>
+
+<style>
+
+ @import "../themes/tundra/tundra.css";
+
+ /* group multiple buttons in a row */
+ .box {
+ display: block;
+ text-align: center;
+ }
+ .box .dojoButton {
+ width:80px;
+ margin-right: 10px;
+ }
+ .dojoButtonContents {
+ font-size: 1.6em;
+ }
+
+ #buttonContainer {
+ border:1px solid black;
+ width:100%;
+ }
+
+ #results {
+ color:darkred;
+ }
+
+</style>
+ </head>
+<body class=tundra>
+<h2>Creating dojot.form.buttons programmatically</h2>
+<h3 id="results"></h3>
+
+<div id="buttonContainer" class='box'></div>
+
+<br>
+Pass "?count=<i><b>n</b></i>" in the query string to change the number of buttons.
+
+<script type="text/javascript">
+// See if we can make a widget in script and attach it to the DOM ourselves.
+
+function makeEm() {
+ var queryCount = location.search.match(/count=(\d*)/);
+ var count = (queryCount ? parseInt(queryCount[1]) : 100);
+ var container = dojo.byId("buttonContainer");
+ var t0 = new Date().getTime();
+ for (var i = 1; i <= count; i++) {
+ var it =
+ new dijit.form.Button(
+ {label:"Button "+i, onclick:'logMessage("clicked simple")'}
+ );
+ container.appendChild(it.domNode);
+ it.domNode.style.display = '';
+ }
+ var t1 = new Date().getTime();
+ dojo.byId("results").innerHTML = "It took " + (t1 - t0) + " msec to create " + count + " Buttons programmatically.";
+}
+dojo.addOnLoad(makeEm);
+
+
+</script>
+
+</body>
+</html>
diff --git a/includes/js/dijit/bench/test_button-results.html b/includes/js/dijit/bench/test_button-results.html
new file mode 100644
index 0000000..c9fa520
--- /dev/null
+++ b/includes/js/dijit/bench/test_button-results.html
@@ -0,0 +1,66 @@
+<html>
+<style>
+ th { vertical-align:bottom; }
+ td {
+ padding:10px;
+ text-align:right;
+ }
+ .computer { vertical-align:top; }
+</style>
+<body>
+<h3>Widget instantiation timing test results</h3>
+
+<table>
+
+<tr><th rowspan=2>Computer/OS</th><th rowspan=2>Browser</th><th colspan=3>Parsing</th><th colspan=3>Programmatic</th></tr>
+<tr> <th>100</th><th>500</th><th>1000</th><th>100</th><th>500</th><th>1000</th></tr>
+<tr><td class='computer' rowspan=3>MacBook Pro 2.16<br> OS 10.4 2GB RAM</td>
+ <td>FF (2.0.0.3)</td>
+ <td>303</td><td>1724</td><td>3505</td>
+ <td>195</td><td>1006</td><td>2266</td>
+</tr>
+<tr><td>Safari (2.04)</td>
+ <td>192</td><td>1460</td><td>4463</td>
+ <td>142</td><td>895</td><td>2403</td>
+</tr>
+<tr><td>WebKit Nightly (21223)</td>
+ <td>110</td><td>540</td><td>1096</td>
+ <td>85</td><td>458</td><td>940</td>
+</tr>
+
+
+<tr><td class='computer' rowspan=2>Dell Precision 2.13 PPro<br> XP SP 2 - 2GB RAM</td>
+ <td>FF (2.0.0.3)</td>
+ <td>282</td><td>1266</td><td>2484</td>
+ <td>250</td><td>890</td><td>1766</td>
+</tr>
+
+<tr>
+ <td>IE7 (7.0.5730.11)</td>
+ <td>303</td><td>2079</td><td>5172</td>
+ <td>203</td><td>1140</td><td>2422</td>
+</tr>
+
+<tr><td><!--browser--></td>
+ <td><!--100 parse--></td><td><!--500 parse--></td><td><!--1000 parse--></td>
+ <td><!--100 code--></td><td><!--500 code--></td><td><!--1000 code--></td>
+</tr>
+</table>
+
+
+<H3>If you want to play:</H3>
+<p></p>
+<ol>
+ <li> Run the following tests:
+ <ul>
+ <li><a href='http://dojotoolkit.org/~owen/bench/dojo/dijit/bench/test_Button-parse.php?count=100'>http://dojotoolkit.org/~owen/bench/dojo/dijit/bench/test_Button-parse.php?count=100</a></li>
+ <li><a href='http://dojotoolkit.org/~owen/bench/dojo/dijit/bench/test_Button-programmatic.html?count=100'>http://dojotoolkit.org/~owen/bench/dojo/dijit/bench/test_Button-programmatic.html?count=100</a></li>
+ </ul>
+ <br>
+ Change the "count=" to 100, 500, 1000 for each.
+ <br><br>
+ Restart the browser between each test/count. Run each test 3 times and record the smallest number.
+ </li>
+ <li>Record your tests in the copy of this file in SVN: <code>dijit/bench/test_Button-results.html</code> and check it in. Reference ticket #2968.</li>
+</ol>
+</body>
diff --git a/includes/js/dijit/bench/widget_construction_test.php b/includes/js/dijit/bench/widget_construction_test.php
new file mode 100644
index 0000000..4718c9c
--- /dev/null
+++ b/includes/js/dijit/bench/widget_construction_test.php
@@ -0,0 +1,186 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
+ "http://www.w3.org/TR/html4/strict.dtd">
+
+<html>
+ <head>
+ <title>test of various synchronous page searching methods</title>
+ <style type="text/css">
+ @import "../../dojo/resources/dojo.css";
+ @import "../themes/tundra/tundra.css";
+ </style>
+ <script type="text/javascript" src="../../dojo/dojo.js"
+ djConfig="parseOnLoad: true, isDebug: true"></script>
+ <script type="text/javascript">
+ dojo.require("dojo.parser"); // scan page for widgets and instantiate them
+ dojo.require("dijit._Widget");
+ dojo.require("dijit._Templated");
+
+ /* dummy widget for benchmarking purposes */
+ dojo.declare(
+ "SimpleButton",
+ [ dijit._Widget, dijit._Templated ],
+ function(){ },
+ {
+ label: "",
+
+ templateString: "<button dojoAttachEvent='onclick:onClick'>${label}</button>",
+
+ onClick: function(){
+ this.domNode.style.backgroundColor="green";
+ },
+ postCreate: function(){
+ }
+ }
+ );
+ </script>
+ </head>
+ <body>
+ <h1 style="font-size: 40px; line-height: 50px;">This page contains a huge number of nodes, most of which are "chaff".</h1>
+ <h3>Here's the relative timings for this page</h3>
+ <div id="profileOutputTable"></div>
+ <!--
+ <h3>And some comparison data</h3>
+ <table border=1>
+ <thead>
+ <tr>
+ <th>IE
+ <th>Safari
+ <th>Gecko (on PC)
+ <th>Gecko (on intel mac)
+ </tr>
+ </thead>
+ <tbody>
+ <tr>
+ <td>4890
+ <td>3242
+ <td>3094
+ <td>3782
+ </tr>
+ </tbody>
+ </table>
+ -->
+
+
+<?
+ $containerDepth = 30;
+ $leadingChaff = 100;
+ $trailingChaff = 100;
+ $items = 100;
+?>
+<?
+ function generateChaff($iters){
+ for($i=0;$i<$iters;$i++){ ?>
+ <pre class="highlighted"><code><span class="hl-reserved">var </span><span class="hl-identifier">dlg</span><span class="hl-default"> = </span><span class="hl-reserved">new </span><span class="hl-identifier">blah</span><span class="hl-default">.</span><span class="hl-identifier">ext</span><span class="hl-default">.</span><span class="hl-identifier">LayoutDialog</span><span class="hl-brackets">(</span><span class="hl-identifier">config</span><span class="hl-code">.</span><span class="hl-identifier">id</span><span class="hl-code"> || </span><span class="hl-identifier">blah</span><span class="hl-code">.</span><span class="hl-identifier">util</span><span class="hl-code">.</span><span class="hl-identifier">Dom</span><span class="hl-code">.</span><span class="hl-identifier">generateId</span><span class="hl-brackets">()</span><span class="hl-code">, </span><span class="hl-brackets">{
+ </span><span title="autoCreate" class="hl-identifier">autoCreate</span><span class="hl-code"> : </span><span class="hl-reserved">true</span><span class="hl-code">,
+ </span><span title="minWidth" class="hl-identifier">minWidth</span><span class="hl-code">:</span><span class="hl-number">400</span><span class="hl-code">,
+ </span><span title="minHeight" class="hl-identifier">minHeight</span><span class="hl-code">:</span><span class="hl-number">300</span><span class="hl-code">,
+ </span>
+ <span title="syncHeightBeforeShow" class="hl-identifier">syncHeightBeforeShow</span><span class="hl-code">: </span><span class="hl-reserved">true</span><span class="hl-code">,
+ </span><span title="shadow" class="hl-identifier">shadow</span><span class="hl-code">:</span><span class="hl-reserved">true</span><span class="hl-code">,
+ </span><span title="fixedcenter" class="hl-identifier">fixedcenter</span><span class="hl-code">: </span><span class="hl-reserved">true</span><span class="hl-code">,
+ </span><span title="center" class="hl-identifier">center</span><span class="hl-code">:</span><span class="hl-brackets">{</span><span class="hl-identifier">autoScroll</span><span class="hl-code">:</span><span class="hl-reserved">false</span><span class="hl-brackets">}</span><span class="hl-code">,
+ </span><span title="east" class="hl-identifier">east</span><span class="hl-code">:</span><span class="hl-brackets">{</span><span class="hl-identifier">split</span><span class="hl-code">:</span><span class="hl-reserved">true</span><span class="hl-code">,</span><span class="hl-identifier">initialSize</span><span class="hl-code">:</span><span class="hl-number">150</span><span class="hl-code">,</span><span class="hl-identifier">minSize</span><span class="hl-code">:</span><span class="hl-number">150</span><span class="hl-code">,</span><span class="hl-identifier">maxSize</span><span class="hl-code">:</span><span class="hl-number">250</span><span class="hl-brackets">}
+ })</span><span class="hl-default">;
+ </span><span class="hl-identifier">dlg</span><span class="hl-default">.</span><span class="hl-identifier">setTitle</span><span class="hl-brackets">(</span><span class="hl-quotes">'</span><span class="hl-string">Choose an Image</span><span class="hl-quotes">'</span><span class="hl-brackets">)</span><span class="hl-default">;
+ </span><span class="hl-identifier">dlg</span><span class="hl-default">.</span><span class="hl-identifier">getEl</span><span class="hl-brackets">()</span><span class="hl-default">.</span><span class="hl-identifier">addClass</span><span class="hl-brackets">(</span><span class="hl-quotes">'</span><span class="hl-string">ychooser-dlg</span><span class="hl-quotes">'</span><span class="hl-brackets">)</span><span class="hl-default">;</span></code></pre><br />
+ <pre class="highlighted"><code><span class="hl-reserved">var </span><span class="hl-identifier">animated</span><span class="hl-default"> = </span><span class="hl-reserved">new </span><span class="hl-identifier">blah</span><span class="hl-default">.</span><span class="hl-identifier">ext</span><span class="hl-default">.</span><span class="hl-identifier">Resizable</span><span class="hl-brackets">(</span><span class="hl-quotes">'</span><span class="hl-string">animated</span><span class="hl-quotes">'</span><span class="hl-code">, </span><span class="hl-brackets">{
+ </span><span title="east" class="hl-identifier">width</span><span class="hl-code">: </span><span class="hl-number">200</span><span class="hl-code">,
+ </span><span title="east" class="hl-identifier">height</span><span class="hl-code">: </span><span class="hl-number">100</span><span class="hl-code">,
+ </span><span title="east" class="hl-identifier">minWidth</span><span class="hl-code">:</span><span class="hl-number">100</span><span class="hl-code">,
+ </span><span class="hl-identifier">minHeight</span><span class="hl-code">:</span><span class="hl-number">50</span><span class="hl-code">,
+ </span><span class="hl-identifier">animate</span><span class="hl-code">:</span><span class="hl-reserved">true</span><span class="hl-code">,
+ </span><span class="hl-identifier">easing</span><span class="hl-code">: </span><span class="hl-identifier">YAHOO</span><span class="hl-code">.</span><span class="hl-identifier">util</span><span class="hl-code">.</span><span class="hl-identifier">Easing</span><span class="hl-code">.</span><span class="hl-identifier">backIn</span><span class="hl-code">,
+ </span><span class="hl-identifier">duration</span><span class="hl-code">:</span><span class="hl-number">.6
+ </span><span class="hl-brackets">})</span><span class="hl-default">;</span></code></pre>
+ <h4>The standard Lorem Ipsum passage, used since the 1500s</h4>
+ <p>
+ "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do
+ eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim
+ ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut
+ aliquip ex ea commodo consequat. Duis aute irure dolor in
+ reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla
+ pariatur. Excepteur sint occaecat cupidatat non proident, sunt in
+ culpa qui officia deserunt mollit anim id est laborum."
+ </p>
+
+ <h4>Section 1.10.32 of "de Finibus Bonorum et Malorum", written by Cicero in 45 BC</h4>
+
+ <p>
+ "Sed ut perspiciatis unde omnis iste natus error sit voluptatem
+ accusantium doloremque laudantium, totam rem aperiam, eaque ipsa
+ quae ab illo inventore veritatis et quasi architecto beatae vitae
+ dicta sunt explicabo. Nemo enim ipsam voluptatem quia voluptas sit
+ aspernatur aut odit aut fugit, sed quia consequuntur magni dolores
+ eos qui ratione voluptatem sequi nesciunt. Neque porro quisquam
+ est, qui dolorem ipsum quia dolor sit amet, consectetur, adipisci
+ velit, sed quia non numquam eius modi tempora incidunt ut labore et
+ dolore magnam aliquam quaerat voluptatem. Ut enim ad minima veniam,
+ quis nostrum exercitationem ullam corporis suscipit laboriosam,
+ nisi ut aliquid ex ea commodi consequatur? Quis autem vel eum iure
+ reprehenderit qui in ea voluptate velit esse quam nihil molestiae
+ consequatur, vel illum qui dolorem eum fugiat quo voluptas nulla
+ pariatur?"
+ </p>
+
+ <h4>1914 translation by H. Rackham</h4>
+
+ <p>
+ "But I must explain to you how all this mistaken idea of denouncing
+ pleasure and praising pain was born and I will give you a complete
+ account of the system, and expound the actual teachings of the
+ great explorer of the truth, the master-builder of human happiness.
+ No one rejects, dislikes, or avoids pleasure itself, because it is
+ pleasure, but because those who do not know how to pursue pleasure
+ rationally encounter consequences that are extremely painful. Nor
+ again is there anyone who loves or pursues or desires to obtain
+ pain of itself, because it is pain, but because occasionally
+ circumstances occur in which toil and pain can procure him some
+ great pleasure. To take a trivial example, which of us ever
+ undertakes laborious physical exercise, except to obtain some
+ advantage from it? But who has any right to find fault with a man
+ who chooses to enjoy a pleasure that has no annoying consequences,
+ or one who avoids a pain that produces no resultant pleasure?"
+ </p>
+ <? }
+ } // end generateChaff
+ $widgetName = "SimpleButton";
+?>
+<? generateChaff($leadingChaff); ?>
+<hr>
+<? for($i=0;$i<$containerDepth;$i++){ ?>
+ <table border="1" cellpadding="0" cellspacing="0" width="100%">
+ <!--
+ <table>
+ -->
+ <tr>
+ <td>
+ <br>
+ chaff!
+ <br>
+<? } ?>
+<? for($i=0;$i<$items;$i++){ ?>
+ <div dojoType="<?= $widgetName ?>" label="item2 <?= $i ?>">item2 <?= $i ?></div>
+<? } ?>
+<? for($i=0;$i<$containerDepth;$i++){ ?>
+ </td>
+ </tr>
+ </table>
+<? } ?>
+<? generateChaff($trailingChaff); ?>
+<? for($i=0;$i<$items;$i++){ ?>
+ <div dojoType="<?= $widgetName ?>" label="item2 <?= $i ?>"><span>item <?= $i ?></span></div>
+<? } ?>
+
+<script type="text/javascript">
+
+ oldTime = new Date();
+ dojo.addOnLoad(function(){
+ var time = new Date().getTime() - oldTime;
+ var p = document.createElement("p");
+ alert("Widgets loaded in " + time + "ms");
+ });
+
+</script>
+
+ </body>
+</html>