Changeset 1018266
- Timestamp:
- 11/02/2014 09:31:27 AM (11 years ago)
- Location:
- assetsminify/trunk
- Files:
-
- 4 edited
-
AssetsMinifyInit.php (modified) (3 diffs)
-
lib/CssMin.php (modified) (5 diffs)
-
plugin.php (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
assetsminify/trunk/AssetsMinifyInit.php
r833449 r1018266 129 129 130 130 $file_path = false; 131 $wp_plugin_url = plugins_url(); 132 $wp_content_url = content_url(); 131 133 132 134 // Script is enqueued from a plugin 133 if( strpos($file_url, WP_PLUGIN_URL) !== false ) 134 $file_path = WP_PLUGIN_DIR . str_replace(WP_PLUGIN_URL, '', $file_url); 135 136 $url_regex = $this->getUrlRegex($wp_plugin_url); 137 if( preg_match($url_regex, $file_url) > 0 ) 138 $file_path = WP_PLUGIN_DIR . preg_replace($url_regex, '', $file_url); 135 139 136 140 // Script is enqueued from a theme 137 if( strpos($file_url, WP_CONTENT_URL) !== false ) 138 $file_path = WP_CONTENT_DIR . str_replace(WP_CONTENT_URL, '', $file_url); 141 $url_regex = $this->getUrlRegex($wp_content_url); 142 if( preg_match($url_regex, $file_url) > 0 ) 143 $file_path = WP_CONTENT_DIR . preg_replace($url_regex, '', $file_url); 139 144 140 145 // Script is enqueued from wordpress … … 144 149 return $file_path; 145 150 } 151 152 /** 153 * Returns Regular Expression string to match an URL. 154 * 155 * @param string $url The URL to be matched. 156 * @return string The regular expression matching the URL. 157 */ 158 protected function getUrlRegex( $url ) { 159 $regex = '@^' . str_replace( 'http\://','https?\:\/\/', preg_quote( $url )) . '@'; 160 return $regex; 161 } 162 146 163 147 164 /** … … 185 202 //Unfortunately not every WP plugin developer is a JS ninja 186 203 //So... let's put it in the header. 187 if ( empty($wp_scripts->registered[$handle]->extra) )204 if ( empty($wp_scripts->registered[$handle]->extra) && empty($wp_scripts->registered[$handle]->args) ) 188 205 $where = 'header'; 189 206 -
assetsminify/trunk/lib/CssMin.php
r683393 r1018266 466 466 elseif ($class === "CssAtKeyframesStartToken") 467 467 { 468 $r[] = $indent . "@keyframes \"" . $token->Name . "\"";468 $r[] = $indent . "@keyframes " . $token->Name . ""; 469 469 $r[] = $this->indent . $indent . "{"; 470 470 $level++; … … 1841 1841 elseif ($class === "CssAtKeyframesStartToken") 1842 1842 { 1843 $r[] = $indent . "@keyframes \"" . $token->Name . "\" {";1843 $r[] = $indent . "@keyframes " . $token->Name . " {"; 1844 1844 $level++; 1845 1845 } … … 3326 3326 { 3327 3327 $r = 0; 3328 $transformations = array("-moz-keyframes", "-webkit-keyframes" );3328 $transformations = array("-moz-keyframes", "-webkit-keyframes", "-o-keyframes", "-ms-keyframes"); 3329 3329 for ($i = 0, $l = count($tokens); $i < $l; $i++) 3330 3330 { … … 4436 4436 public function __toString() 4437 4437 { 4438 return "@" . $this->AtRuleName . " \"" . $this->Name . "\"{";4438 return "@" . $this->AtRuleName . " " . $this->Name . "{"; 4439 4439 } 4440 4440 } … … 4575 4575 return $index + 15; 4576 4576 } 4577 // Start of @keyframes at-rule block (@-ms-keyframes) 4578 else if ($char === "@" && $state === "T_DOCUMENT" && strtolower(substr($this->parser->getSource(), $index, 14)) === "@-ms-keyframes") 4579 { 4580 $this->atRuleName = "-ms-keyframes"; 4581 $this->parser->pushState("T_AT_KEYFRAMES::NAME"); 4582 $this->parser->clearBuffer(); 4583 return $index + 14; 4584 } 4585 // Start of @keyframes at-rule block (@-o-keyframes) 4586 else if ($char === "@" && $state === "T_DOCUMENT" && strtolower(substr($this->parser->getSource(), $index, 13)) === "@-o-keyframes") 4587 { 4588 $this->atRuleName = "-o-keyframes"; 4589 $this->parser->pushState("T_AT_KEYFRAMES::NAME"); 4590 $this->parser->clearBuffer(); 4591 return $index + 13; 4592 } 4577 4593 // Start of @keyframes at-rule block (@-webkit-keyframes) 4578 4594 elseif ($char === "@" && $state === "T_DOCUMENT" && strtolower(substr($this->parser->getSource(), $index, 18)) === "@-webkit-keyframes") -
assetsminify/trunk/plugin.php
r833449 r1018266 5 5 Description: WordPress plugin to minify JS and CSS assets. 6 6 Author: Alessandro Carbone 7 Version: 1.2. 27 Version: 1.2.3 8 8 Author URI: http://www.artera.it 9 9 */ -
assetsminify/trunk/readme.txt
r833449 r1018266 4 4 Tags: assets, minify, css, js, less, sass, compass, coffeescript 5 5 Requires at least: 3.3 6 Tested up to: 3.86 Tested up to: 4.0 7 7 License: GPLv2 or later 8 8 License URI: http://www.gnu.org/licenses/gpl-2.0.html 9 Stable tag: 1.2. 29 Stable tag: 1.2.3 10 10 11 11 Use Compass, SASS, LESS and CoffeeScript (NEW) to develop your themes and minify your stylesheets and JavaScript simply by installing AssetsMinify. … … 61 61 == Changelog == 62 62 63 = 1.2.3 = 64 65 * SSL and keyframes bugfix thanks @pepe - http://mundschenk.at/ 66 63 67 = 1.2.2 = 64 68
Note: See TracChangeset
for help on using the changeset viewer.