]> source.dussan.org Git - jquery-ui.git/commitdiff
tests: new side-by-side comparison of static and visual tests
authorRichard Worth <rdworth@gmail.com>
Sun, 25 Jan 2009 12:06:25 +0000 (12:06 +0000)
committerRichard Worth <rdworth@gmail.com>
Sun, 25 Jan 2009 12:06:25 +0000 (12:06 +0000)
tests/index.html [new file with mode: 0644]
tests/static/accordion/default.html
tests/static/dialog/default.html
tests/static/selectable/default.html
tests/static/sortable/default.html
tests/visual/accordion/default.html
tests/visual/dialog/default.html
tests/visual/draggable/default.html
tests/visual/droppable/default.html
tests/visual/selectable/default.html
tests/visual/sortable/default.html

diff --git a/tests/index.html b/tests/index.html
new file mode 100644 (file)
index 0000000..6b1ce73
--- /dev/null
@@ -0,0 +1,96 @@
+<!doctype html>\r
+<html lang="en">\r
+<head>\r
+       <title>jQuery UI Tests</title>\r
+       <link rel="stylesheet" href="../themes/base/ui.all.css" type="text/css" />\r
+       <script type="text/javascript" src="../jquery-1.3.1.js"></script>\r
+       <script type="text/javascript" src="../ui/ui.core.js"></script>\r
+       <script type="text/javascript" src="../ui/ui.draggable.js"></script>\r
+       <style type="text/css">\r
+               body { font-size: 62.5%; }\r
+               dd.plugin { margin-top: 0.3em; margin-bottom: 1em; }\r
+               iframe { border: 0; width: 200px; 150px; }\r
+               td { border: 1px solid silver; padding: 10px; }\r
+       </style>\r
+</head>\r
+\r
+<body>\r
+\r
+<table id="matrix">\r
+<thead>\r
+       <tr>\r
+               <th>Interaction</th>\r
+               <th style="width:220px;">Static</th>\r
+               <th style="width:220px;">Visual</th>\r
+       </tr>\r
+</thead>\r
+<tbody>\r
+       <tr class="test-draggable-default"><th>Draggable</th><td></td><td></td></tr>\r
+       <tr class="test-droppable-default"><th>Droppable</th><td></td><td></td></tr>\r
+       <tr class="test-resizable-default"><th>Resizable</th><td></td><td></td></tr>\r
+       <tr class="test-selectabe-default"><th>Selectable</th><td></td><td></td></tr>\r
+       <tr class="test-sortable-default"><th>Sortable</th><td></td><td></td></tr>\r
+</tbody>\r
+<thead>\r
+       <tr>\r
+               <th>Widget</th>\r
+               <th style="width:220px;">Static</th>\r
+               <th style="width:220px;">Visual</th>\r
+       </tr>\r
+</thead>\r
+<tbody>\r
+       <tr class="test-accordion-default"><th>Accordion</th><td></td><td></td></tr>\r
+       <tr class="test-datepicker-default"><th>Datepicker</th><td></td><td></td></tr>\r
+       <tr class="test-dialog-default"><th>Dialog</th><td></td><td></td></tr>\r
+       <tr class="test-progressbar-default"><th>Progressbar</th><td></td><td></td></tr>\r
+       <tr class="test-slider-default"><th>slider</th><td></td><td></td></tr>\r
+       <tr class="test-tabs-default"><th>Tabs</th><td></td><td></td></tr>\r
+</tbody>\r
+</table>\r
+\r
+<dl id="plugins">\r
+\r
+</dl>\r
+\r
+<script type="text/javascript">\r
+\r
+var matrix = $("#matrix");\r
+\r
+matrix.children("tbody").children("tr").each(function() {\r
+\r
+       var tr = $(this), th = tr.find("th"), pluginName = th.text().toLowerCase(), staticTd = th.next(), visualTd = staticTd.next();\r
+\r
+       var staticUrl = 'static/' + pluginName + '/default.html';\r
+       var visualUrl = 'visual/' + pluginName + '/default.html';\r
+\r
+       $.get(staticUrl, function(data) {\r
+               data = data.replace(/<script.*>.*<\/script>/ig,""); // Remove script tags\r
+               data = data.replace(/<\/?link.*>/ig,""); //Remove link tags\r
+               data = data.replace(/<\/?html.*>/ig,""); //Remove html tag\r
+               data = data.replace(/<\/?body.*>/ig,""); //Remove body tag\r
+               data = data.replace(/<\/?head.*>/ig,""); //Remove head tag\r
+               data = data.replace(/<title.*>.*<\/title>/ig,""); // Remove title tags\r
+               data = data.replace(/\s*<\/?!doctype.*>\s*/ig,""); //Remove doctype\r
+               var staticHtml = $("<div></div>").html(data).html();\r
+               staticTd.html(staticHtml);\r
+       });\r
+\r
+       visualTd.append('<iframe src="' + visualUrl + '"></iframe>');\r
+\r
+       var iframe = visualTd.find("iframe");\r
+\r
+       iframe.load(function() {\r
+               //alert($("body", this.contentDocument).html());\r
+               $(this).after($("body", this.contentDocument).html()).remove();\r
+               (pluginName == 'dialog') && $("#dialog").parents(".ui-dialog").css({\r
+                       position: "relative",\r
+                       top: null, left: null\r
+               });\r
+       });\r
+\r
+});\r
+\r
+</script>\r
+\r
+</body>\r
+</html>\r
index aba29dcec55bcb1383ac689cd90cdd8b711f9465..78a766a1cc36a864c4cbe863dbfe1295955d7bf2 100644 (file)
 
 <div class="ui-accordion ui-widget ui-helper-reset">
        <div class="ui-accordion-group ui-accordion-selected">
-               <h3 class="ui-accordion-header ui-helper-reset ui-state-active ui-corner-top" tabindex="0"><span class="ui-icon ui-icon-triangle-1-s"></span><a href="#">First</a></h3>
+               <h3 class="ui-accordion-header ui-helper-reset ui-state-active ui-corner-top" tabindex="0">
+                       <span class="ui-icon ui-icon-triangle-1-s"></span>
+                       <a href="#">Accordion Header 1</a>
+               </h3>
                <div>
                        <div class="ui-accordion-content-wrap ui-helper-reset ui-widget-content ui-corner-bottom">
                                <div class="ui-accordion-content">
-                                       <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.</p>
+                                       Accordion Content 1
                                </div>
                        </div>
                </div>
        </div>
        <div class="ui-accordion-group">
-               <h3 class="ui-accordion-header ui-helper-reset ui-state-default ui-corner-all" tabindex="0"><span class="ui-icon ui-icon-triangle-1-e"></span><a href="#">Second</a></h3>
+               <h3 class="ui-accordion-header ui-helper-reset ui-state-default ui-corner-all" tabindex="0">
+                       <span class="ui-icon ui-icon-triangle-1-e"></span>
+                       <a href="#">Accordion Header 2</a>
+               </h3>
                <div>
                        <div class="ui-accordion-content-wrap ui-helper-reset ui-widget-content ui-corner-bottom" style="height: 95px; display: none;">
                                <div class="ui-accordion-content">
-                                       <p>Phasellus mattis tincidunt nibh. Cras orci urna, blandit id, pretium vel, aliquet ornare, felis. Maecenas scelerisque sem non nisl. Fusce sed lorem in enim dictum bibendum.</p>
+                                       Accordion Content 2
                                </div>
                        </div>
                </div>
        </div>
        <div class="ui-accordion-group">
-               <h3 class="ui-accordion-header ui-helper-reset ui-state-default ui-corner-all" tabindex="0"><span class="ui-icon ui-icon-triangle-1-e"></span><a href="#">Third</a></h3>
+               <h3 class="ui-accordion-header ui-helper-reset ui-state-default ui-corner-all" tabindex="0">
+                       <span class="ui-icon ui-icon-triangle-1-e"></span>
+                       <a href="#">Accordion Header 3</a>
+               </h3>
                <div>
                        <div class="ui-accordion-content-wrap ui-helper-reset ui-widget-content ui-corner-bottom" style="height: 95px; display: none;">
                                <div class="ui-accordion-content">
-                                       <p>Nam dui erat, auctor a, dignissim quis, sollicitudin eu, felis. Pellentesque nisi urna, interdum eget, sagittis et, consequat vestibulum, lacus. Mauris porttitor ullamcorper augue.</p>
+                                       Accordion Content 2
                                </div>
                        </div>
                </div>
index 71006b4fa52ca89ac9585b532725d14a73cd6e44..8be691d1560f500a07df8e2bfadadbec2b2ee59c 100644 (file)
                <a href="#" class="ui-dialog-titlebar-close ui-corner-all" role="button" title="Close"><span class="ui-icon ui-icon-closethick">Close</span></a>
        </div>
        <div class="ui-dialog-content ui-widget-content" style="height: 13em;">
-               <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.</p>
-       </div>
-       <div class="ui-dialog-buttonpane ui-widget-content ui-helper-clearfix">
-               <button class="ui-state-default ui-priority-primary ui-corner-all">Primary</button>
-               <button class="ui-state-default ui-priority-secondary ui-corner-all">Secondary</button>
-               <button class="ui-state-default ui-state-disabled ui-corner-all">Disabled</button>
+               <p> Dialog Content </p>
        </div>
        <div class="ui-resizable-n ui-resizable-handle"></div>
        <div class="ui-resizable-s ui-resizable-handle"></div>
index 3fb75be423cabd82ab3fbcf49e245ad91f41220e..45fd5a9b721f8f436d5d3be638c93f4080ea4a2b 100644 (file)
 <body>
 
 <div class="ui-selectable">
-       <p>
-               Selectable
-       </p>
-       <div class="ui-selectee">First</div>
-       <div class="ui-selectee">Second</div>
-       <div class="ui-selectee">Third</div>
+       <div class="ui-selectee">Selectable 1</div>
+       <div class="ui-selectee">Selectable 2</div>
+       <div class="ui-selectee">Selectable 3</div>
 </div>
 
 </body>
index 4a779d634de9af25119d15a06e0467671e506a31..dfbdd0cb6edb42e6742996bf52db060ff5228784 100644 (file)
 <body>
 
 <div class="ui-sortable">
-       <p>
-               Sortable
-       </p>
-       <div>First</div>
-       <div>Second</div>
-       <div>Third</div>
+       <div>Sortable 1</div>
+       <div>Sortable 2</div>
+       <div>Sortable 3</div>
 </div>
 
 </body>
index 6c8372f54da3919a4b451d63e2d5f1d582b1fa54..d8b94dc63bcec4f3cee093700f15f7e639ae4ed7 100644 (file)
 
 <div id="accordion">
        <div>
-               <h3><a href="#">First</a></h3>
+               <h3><a href="#">Accordion Header 1</a></h3>
                <div>
-                       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.
+                       Accordion Content 1
                </div>
        </div>
        <div>
-               <h3><a href="#">Second</a></h3>
+               <h3><a href="#">Accordion Header 2</a></h3>
                <div>
-                       Phasellus mattis tincidunt nibh. Cras orci urna, blandit id, pretium vel, aliquet ornare, felis. Maecenas scelerisque sem non nisl. Fusce sed lorem in enim dictum bibendum.
+                       Accordion Content 2
                </div>
        </div>
        <div>
-               <h3><a href="#">Third</a></h3>
+               <h3><a href="#">Accordion Header 3</a></h3>
                <div>
-                       Nam dui erat, auctor a, dignissim quis, sollicitudin eu, felis. Pellentesque nisi urna, interdum eget, sagittis et, consequat vestibulum, lacus. Mauris porttitor ullamcorper augue.
+                       Accordion Content 3
                </div>
        </div>
 </div>
index e3165d7598b62be096d39d4ad82a9442b1256647..290463f48657442a949c4a8adecec27b826a7fff 100644 (file)
@@ -17,7 +17,9 @@
 </head>
 <body>
 
-<div id="dialog"></div>
+<div id="dialog" title="Dialog Title">
+       <p> Dialog Content </p>
+</div>
 
 </body>
 </html>
index 4d868b756feb238e384b18b6d2d136dc1a8c123d..1b77e551fc92d065e0309622f1a2aea657ad38bf 100644 (file)
@@ -14,8 +14,8 @@
        </script>
 </head>
 <body>
-
-<div id="draggable">Draggable</div>
-
+<div id="draggable">
+       <p> Draggable </p>
+</div>
 </body>
 </html>
index 3f12c3571700db6808926a0b0ae326be94c54d6f..2a03da7167c12e6d4699d16599d93edf9e0468d8 100644 (file)
        <script type="text/javascript" src="../../../ui/ui.droppable.js"></script>
        <script type="text/javascript">
        $(function() {
-               $("#draggable").draggable();
                $("#droppable").droppable();
        });
        </script>
 </head>
 <body>
-
-<div id="draggable">Draggable</div>
-
-<div id="droppable">Droppable</div>
-
+<div id="droppable">
+       <p> Droppable </p>
+</div>
 </body>
 </html>
index 69f145933ea47dfbad5a87889d3cda3baaef955c..ffcfe43d3173482742a0fed2bba7bc4363fbcbfc 100644 (file)
@@ -17,9 +17,9 @@
 <body>
 
 <div id="selectable">
-       <div>First</div>
-       <div>Second</div>
-       <div>Third</div>
+       <div>Selectable 1</div>
+       <div>Selectable 2</div>
+       <div>Selectable 3</div>
 </div>
 
 </body>
index 8747e0b646a36b28a6ef822c2811f91783816057..0dc4b3dbfeef07ae29de064a24d43b4bb48bed56 100644 (file)
@@ -17,9 +17,9 @@
 <body>
 
 <div id="sortable">
-       <div>First</div>
-       <div>Second</div>
-       <div>Third</div>
+       <div>Sortable 1</div>
+       <div>Sortable 2</div>
+       <div>Sortable 3</div>
 </div>
 
 </body>