test runner: adding a new test page called 'polluted'. Where one can choose to pre...
[jquery.git] / test / polluted.php
diff --git a/test/polluted.php b/test/polluted.php
new file mode 100644 (file)
index 0000000..94f63d7
--- /dev/null
@@ -0,0 +1,51 @@
+<?php\r
+       if( count($_POST) ){ // second call\r
+               $includes = array();\r
+               foreach( $_POST as $lib=>$ver ){\r
+                       if( !$ver )\r
+                               continue;\r
+                       $include = "<script type='text/javascript' src='otherlibs/$lib/$ver/$lib.js'></script>\n";\r
+                       if( $lib == 'prototype' ) // prototype must be included first\r
+                               array_unshift( $includes, $include );\r
+                       else\r
+                               array_push( $includes, $include );\r
+               }\r
+\r
+               $includes = implode( "\n", $includes );\r
+               $suite = file_get_contents('index.html');\r
+               echo str_replace( '<!-- Includes -->', $includes, $suite );\r
+               exit;\r
+       }       \r
+?>\r
+\r
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\r
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr" id="html">\r
+<head>\r
+       <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />\r
+       <title>jQuery Test Suite</title>\r
+       <link rel="Stylesheet" media="screen" href="data/testsuite.css" />\r
+</head>\r
+\r
+<body id="body">\r
+       <h1 id="header">jQuery Test Suite</h1>\r
+       <h2 id="banner" class="fail"></h2>\r
+       <h2 id="userAgent">Choose other libraries to include</h2>\r
+       \r
+       <form class="otherlibs" action="" method="post">\r
+               <?php\r
+                       $libs = scandir('otherlibs');\r
+                       foreach( $libs as $lib ){\r
+                               if( $lib[0] == '.' )\r
+                                       continue;\r
+                               echo "<h3>$lib</h3>";\r
+                               $vers = scandir( "otherlibs/$lib");\r
+                               foreach( $vers as $ver ){\r
+                                       if( $ver[0] != '.' )\r
+                                               echo "<label><input type='checkbox' name='$lib' value='$ver'>$ver</label>";\r
+                               }\r
+                       }\r
+               ?>\r
+               <input type="submit" value="Run" class="submit" />\r
+       </form>\r
+</body>\r
+</html>\r