2 $baseURL = "http://ajax.googleapis.com/ajax/libs/";
5 "versions" => array( "1.1.1", "1.2.0", "1.2.3", "1.3.0", "1.3.1", "1.3.2", "1.4.0", "1.4.1", "1.4.3", "1.5.0" ),
6 "url" => "dojo/XYZ/dojo/dojo.xd.js"
9 "versions" => array( "3.0.0", "3.1.0" ),
10 "url" => "ext-core/XYZ/ext-core.js"
13 "versions" => array( "1.2.3", "1.2.6", "1.3.0", "1.3.1", "1.3.2", "1.4.0", "1.4.1", "1.4.2", "1.4.3", "1.4.4", "1.5.0" ),
14 "url" => "jquery/XYZ/jquery.min.js"
17 "versions" => array( "1.5.2", "1.5.3", "1.6.0", "1.7.0", "1.7.1", "1.7.2", "1.7.3", "1.8.0", "1.8.1", "1.8.2", "1.8.4", "1.8.5", "1.8.6", "1.8.7", "1.8.8", "1.8.9" ),
18 "url" => "jqueryui/XYZ/jquery-ui.min.js"
21 "versions" => array( "1.1.1", "1.1.2", "1.2.1", "1.2.2", "1.2.3", "1.2.4", "1.2.5", "1.3.0" ),
22 "url" => "mootools/XYZ/mootools-yui-compressed.js"
25 "versions" => array( "1.6.0.2", "1.6.0.3", "1.6.1.0", "1.7.0.0" ),
26 "url" => "prototype/XYZ/prototype.js"
28 "scriptaculous" => array(
29 "versions" => array( "1.8.1", "1.8.2", "1.8.3" ),
30 "url" => "scriptaculous/XYZ/scriptaculous.js"
33 "versions" => array( "2.1", "2.2" ),
34 "url" => "swfobject/XYZ/swfobject.js"
37 "versions" => array( "2.6.0", "2.7.0", "2.8.0r4", "2.8.1", "2.8.2", "3.3.0" ),
38 "url" => "yui/XYZ/build/yui/yui-min.js"
44 foreach( $_POST as $name => $ver ){
45 if ( empty( $libraries[ $name ] )) {
46 echo "unsupported library ". $name;
50 $url = $libraries[ $name ][ "url" ];
51 if( $name == "YUI" && $ver[0] == "2" ) {
52 $url = str_replace( "/yui", "/yuiloader", $url);
55 if ( empty( $libraries[ $name ][ "versions" ][ $ver ] )) {
56 echo "library ". $name ." not supported in version ". $ver;
60 $include = "<script src='$baseURL".str_replace("XYZ", $ver, $url)."'></script>\n";
61 if( $lib == "prototype" ) { // prototype must be included first
62 array_unshift( $includes, $include );
64 array_push( $includes, $include );
68 $includes = implode( "\n", $includes );
69 $suite = file_get_contents( "index.html" );
70 echo str_replace( "<!-- Includes -->", $includes, $suite );
77 <meta http
-equiv
="content-type" content
="text/html; charset=UTF-8">
78 <title
>Run jQuery Test Suite Polluted
</title
>
79 <style type
="text/css">
84 margin
: 5px
0px
5px
20px
;
90 <h1 id
="header">jQuery Test Suite
</h1
>
91 <h2 id
="banner" class="fail"></h2
>
92 <h2 id
="userAgent">Choose other libraries to
include</h2
>
94 <form
class="otherlibs" action
="./polluted.php" method
="POST">
96 foreach( $libraries as $name => $data ) {
97 echo "<fieldset><legend>$name</legend>";
99 foreach( $data[ "versions" ] as $ver ) {
101 echo "<label><input type='radio' name='$name' value='$ver' />$ver</label>";
102 if( !($i %
4) ) echo "<br />";
107 <input type
="submit" value
=" Run " class="submit" />