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 $url = $libraries[ $name ][ "url" ];
46 if( $name == "YUI" && $ver[0] == "2" ) {
47 $url = str_replace( "/yui", "/yuiloader", $url, $count = 2 );
49 $include = "<script src='$baseURL".str_replace("XYZ", $ver, $url, $count = 1)."'></script>\n";
50 if( $lib == "prototype" ) { // prototype must be included first
51 array_unshift( $includes, $include );
53 array_push( $includes, $include );
57 $includes = implode( "\n", $includes );
58 $suite = file_get_contents( "index.html" );
59 echo str_replace( "<!-- Includes -->", $includes, $suite );
66 <meta http
-equiv
="content-type" content
="text/html; charset=UTF-8">
67 <title
>Run jQuery Test Suite Polluted
</title
>
68 <style type
="text/css">
73 margin
: 5px
0px
5px
20px
;
79 <h1 id
="header">jQuery Test Suite
</h1
>
80 <h2 id
="banner" class="fail"></h2
>
81 <h2 id
="userAgent">Choose other libraries to
include</h2
>
83 <form
class="otherlibs" action
="./polluted.php" method
="POST">
85 foreach( $libraries as $name => $data ) {
86 echo "<fieldset><legend>$name</legend>";
88 foreach( $data[ "versions" ] as $ver ) {
90 echo "<label><input type='radio' name='$name' value='$ver' />$ver</label>";
91 if( !($i %
4) ) echo "<br />";
96 <input type
="submit" value
=" Run " class="submit" />