2 if( count($_POST) ){ // second call
4 foreach( $_POST as $lib=>$ver ){
7 $include = "<script type='text/javascript' src='otherlibs/$lib/$ver/$lib.js'></script>\n";
8 if( $lib == 'prototype' ) // prototype must be included first
9 array_unshift( $includes, $include );
11 array_push( $includes, $include );
14 $includes = implode( "\n", $includes );
15 $suite = file_get_contents('index.html');
16 echo str_replace( '<!-- Includes -->', $includes, $suite );
21 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
22 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en" dir="ltr" id="html">
24 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
25 <title>jQuery Test Suite</title>
26 <link rel="Stylesheet" media="screen" href="qunit/testsuite.css" />
27 <link rel="Stylesheet" media="screen" href="data/otherlibs.css" />
28 <style type="text/css">
30 margin: 20px 0 0 30px;
34 margin: 5px 0 5px 30px;
36 form.otherlibs input.submit{
43 <h1 id="header">jQuery Test Suite</h1>
44 <h2 id="banner" class="fail"></h2>
45 <h2 id="userAgent">Choose other libraries to include</h2>
47 <form class="otherlibs" action="" method="post">
49 $libs = scandir('otherlibs');
50 foreach( $libs as $lib ){
54 $vers = scandir( "otherlibs/$lib");
55 foreach( $vers as $ver ){
57 echo "<label><input type='checkbox' name='$lib' value='$ver'>$ver</label>";
61 <input type="submit" value="Run" class="submit" />