test runner: adding a new test page called 'polluted'. Where one can choose to pre...
[jquery.git] / test / polluted.php
1 <?php\r
2         if( count($_POST) ){ // second call\r
3                 $includes = array();\r
4                 foreach( $_POST as $lib=>$ver ){\r
5                         if( !$ver )\r
6                                 continue;\r
7                         $include = "<script type='text/javascript' src='otherlibs/$lib/$ver/$lib.js'></script>\n";\r
8                         if( $lib == 'prototype' ) // prototype must be included first\r
9                                 array_unshift( $includes, $include );\r
10                         else\r
11                                 array_push( $includes, $include );\r
12                 }\r
13 \r
14                 $includes = implode( "\n", $includes );\r
15                 $suite = file_get_contents('index.html');\r
16                 echo str_replace( '<!-- Includes -->', $includes, $suite );\r
17                 exit;\r
18         }       \r
19 ?>\r
20 \r
21 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">\r
22 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr" id="html">\r
23 <head>\r
24         <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />\r
25         <title>jQuery Test Suite</title>\r
26         <link rel="Stylesheet" media="screen" href="data/testsuite.css" />\r
27 </head>\r
28 \r
29 <body id="body">\r
30         <h1 id="header">jQuery Test Suite</h1>\r
31         <h2 id="banner" class="fail"></h2>\r
32         <h2 id="userAgent">Choose other libraries to include</h2>\r
33         \r
34         <form class="otherlibs" action="" method="post">\r
35                 <?php\r
36                         $libs = scandir('otherlibs');\r
37                         foreach( $libs as $lib ){\r
38                                 if( $lib[0] == '.' )\r
39                                         continue;\r
40                                 echo "<h3>$lib</h3>";\r
41                                 $vers = scandir( "otherlibs/$lib");\r
42                                 foreach( $vers as $ver ){\r
43                                         if( $ver[0] != '.' )\r
44                                                 echo "<label><input type='checkbox' name='$lib' value='$ver'>$ver</label>";\r
45                                 }\r
46                         }\r
47                 ?>\r
48                 <input type="submit" value="Run" class="submit" />\r
49         </form>\r
50 </body>\r
51 </html>\r