Export to GitHub

extendedclientscript - issue #1

Allow relative paths and imports


Posted on Oct 6, 2011 by Grumpy Kangaroo

I've updated source and now links in css files not brokes. I've applied patch to cssmin from here http://code.google.com/p/cssmin/issues/detail?id=30 with some modifications. Then i some modified code of extendedclientscript (ability ImportImports works too) and here we go - links not brokes. All source in attach.

PS sorry for my bad english.

Attachments

Comment #1

Posted on Oct 8, 2011 by Quick Monkey

Hi, thanks! Will test it and release it ASAP.

Comment #2

Posted on Oct 8, 2011 by Happy Rabbit

Undefined index: BasePath

C:\Webserver\apache\htdocs\public_html\develop.f-rc.ru\protected\extensions\ExtendedClientScript\cssmin\cssmin.php(2346)

2334 / 2335 private $imported = array(); 2336 /* 2337 * Implements {@link aCssMinifierFilter::filter()}. 2338 * 2339 * @param array $tokens Array of objects of type aCssToken 2340 * @return integer Count of added, changed or removed tokens; a return value large than 0 will rebuild the array 2341 */ 2342 public function apply(array &$tokens) 2343 { 2344 if (!isset($this->configuration["BasePath"]) || !is_dir($this->configuration["BasePath"])) 2345 { 2346 CssMin::triggerError(new CssError(FILE, LINE, METHOD . ": Base path " . ($this->configuration["BasePath"] ? $this->configuration["BasePath"] : "null"). " is not a directory")); 2347 return 0; 2348 } 2349 for ($i = 0, $l = count($tokens); $i < $l; $i++) 2350 { 2351 if (get_class($tokens[$i]) === "CssAtImportToken") 2352 { 2353 $import = $this->configuration["BasePath"] . "/" . $tokens[$i]->Import; 2354 // Import file was not found/is not a file 2355 if (!is_file($import)) 2356 { 2357 CssMin::triggerError(new CssError(FILE, LINE, METHOD . ": Import file " . $import. " was not found.", (string) $tokens[$i])); 2358 }

if (!isset($this->configuration["BasePath"]) || !is_dir($this->configuration["BasePath"]))

replace:

if (isset($this->configuration["BasePath"]))

Comment #3

Posted on Nov 16, 2011 by Happy Kangaroo

Comment deleted

Comment #4

Posted on Nov 16, 2011 by Quick Monkey

Update to latest

Status: Fixed

Labels:
Type-Defect Priority-Medium