diff --git a/test/data/include_js.php b/test/data/include_js.php index 23207a9d9..1e12588eb 100644 --- a/test/data/include_js.php +++ b/test/data/include_js.php @@ -1,106 +1,62 @@ -/* - */; -// extract vars from referrer to determine version -if(isset($_SERVER['HTTP_REFERER'])){ - $referrer = $_SERVER['HTTP_REFERER']; - $referrer_query_string = parse_url($_SERVER['HTTP_REFERER'], PHP_URL_QUERY ); - parse_str($referrer_query_string, $referrer_params); +if ( !window.top.jQueryIncludes ) { + + window.top.jQueryIncludes = (function() { + + var location = window.top.document.location.href, + baseURL = location.replace( /\/test\/.+/, "/"), + version = /(?:&|\?)jquery=([^&]+?)(?:$|&)/.exec( location ), + includes, i; - if(isset($referrer_params['jquery'])){ - $version = $referrer_params['jquery']; - } + if ( version ) { + version = version[ 1 ]; + if( version === "min" ) { + includes = [ baseURL + "dist/jquery.min.js" ]; + } else if( version === "dist" ) { + includes = [ baseURL + "dist/jquery.js" ]; + } else { + includes = [ "http://code.jquery.com/jquery-" + version + ".js" ]; + } + } else { + includes = [ + "core", + "callbacks", + "deferred", + "support", + "data", + "queue", + "attributes", + "event", + "sizzle/sizzle", + "sizzle-jquery", + "traversing", + "manipulation", + "css", + "ajax", + "ajax/jsonp", + "ajax/script", + "ajax/xhr", + "effects", + "offset", + "dimensions", + "exports" + ]; + for ( i = includes.length; i--; ) { + includes[ i ] = baseURL + "src/" + includes[ i ] + ".js"; + } + } + + for ( i = includes.length; i--; ) { + includes[ i ] = "