diff --git a/javascript/jquery-ondemand/jquery.ondemand.js b/javascript/jquery-ondemand/jquery.ondemand.js index 29a891bed..674a58da8 100644 --- a/javascript/jquery-ondemand/jquery.ondemand.js +++ b/javascript/jquery-ondemand/jquery.ondemand.js @@ -15,6 +15,10 @@ */ (function($){ + var decodePath = function(str) { + return str.replace(/%2C/g,',').replace(/\&/g, '&'); + }; + $.extend({ // loaded files list - to protect against loading existed file again (by PGA) @@ -50,7 +54,7 @@ }); } - return (this._ondemand_loaded_list[scriptUrl] != undefined); + return (this._ondemand_loaded_list[decodePath(scriptUrl)] != undefined); }, requireCss : function(styleUrl, media){ @@ -89,10 +93,10 @@ for(var i=0;ijavascript, $this->blocked) as $file => $dummy) { $path = $this->path_for_file($file); - if($path) $jsRequirements[] = $path; + if($path) { + $jsRequirements[] = str_replace(',', '%2C', $path); + } } $response->addHeader('X-Include-JS', implode(',', $jsRequirements)); foreach(array_diff_key($this->css,$this->blocked) as $file => $params) { $path = $this->path_for_file($file); - if($path) $cssRequirements[] = isset($params['media']) ? "$path:##:$params[media]" : $path; + if($path) { + $path = str_replace(',', '%2C', $path); + $cssRequirements[] = isset($params['media']) ? "$path:##:$params[media]" : $path; + } } $response->addHeader('X-Include-CSS', implode(',', $cssRequirements));