Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/AIOM-3.2-dev' into AIOM+
Browse files Browse the repository at this point in the history
Conflicts:
	AllInOneMinify.module
	README.md
  • Loading branch information
marvinscharle committed Feb 9, 2015
2 parents 5d2c0ff + 5ea2035 commit e3a2e7d
Show file tree
Hide file tree
Showing 4 changed files with 802 additions and 379 deletions.
28 changes: 18 additions & 10 deletions AllInOneMinify.module
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class AllInOneMinify extends WireData implements Module, ConfigurableModule {
// ------------------------------------------------------------------------
// Version: major, minor, revision, i.e. 100 = 1.1.0
// ------------------------------------------------------------------------
'version' => 315,
'version' => 320,

'author' => 'David Karich & Conclurer GbR',

Expand Down Expand Up @@ -417,6 +417,10 @@ class AllInOneMinify extends WireData implements Module, ConfigurableModule {
// ------------------------------------------------------------------------
if(empty($javascripts)) throw new WireException('There were no files specified to minimize.');

// Support passing of $config->scripts as argument which is of type FilenameArray
if(($javascripts instanceof FilenameArray))
$stylesheets = (array) $javascripts->getIterator(); // Convert to array

// ------------------------------------------------------------------------
// Check if files exist and generating the cache file name based
// on the last editing of the file.
Expand Down Expand Up @@ -505,7 +509,11 @@ class AllInOneMinify extends WireData implements Module, ConfigurableModule {
// Check if at least one file was passed.
// ------------------------------------------------------------------------
if(empty($stylesheets)) throw new WireException('There were no files specified to minimize.');


// Support passing of $config->styles as argument which is of type FilenameArray
if(($stylesheets instanceof FilenameArray))
$stylesheets = (array) $stylesheets->getIterator(); // Convert to array

// ------------------------------------------------------------------------
// Check if files exist and generating the cache file name based
// on the last editing of the file.
Expand All @@ -524,14 +532,13 @@ class AllInOneMinify extends WireData implements Module, ConfigurableModule {
// ------------------------------------------------------------------------
// Load the css minimization Library
// ------------------------------------------------------------------------
// @version 1.1.2
// @license MIT License (MIT)
// @description CssMin is a css minfier. It minifies css by
// removing unneeded whitespace character, comments, empty
// blocks and empty declarations. In addition declaration
// values can get rewritten to shorter notation if available.
// @version 2.4.8-4
// @docs https://github.com/tubalmartin/YUI-CSS-compressor-PHP-port
// @license BSD (revised)
// @description PHP port of the CSS minification tool distributed with
// YUICompressor.
//------------------------------------------------------------------------
require_once(wire('config')->paths->AllInOneMinify.'lib'.DIRECTORY_SEPARATOR.'CSSMin-v1.1.2.php');
require_once(wire('config')->paths->AllInOneMinify.'lib'.DIRECTORY_SEPARATOR.'cssmin.php');

// ------------------------------------------------------------------------
// Load the URL Rewriting Library
Expand Down Expand Up @@ -606,7 +613,8 @@ class AllInOneMinify extends WireData implements Module, ConfigurableModule {
// ------------------------------------------------------------------------
// Minimize generated css
// ------------------------------------------------------------------------
$_css_src = (!empty($_css_src) AND self::$developmentMode !== true AND !self::_isMinimized($stylesheet['absolute_path'])) ? CssMin::minify($_css_src) : $_css_src;
$cssMin = new CSSmin();
$_css_src = (!empty($_css_src) AND self::$developmentMode !== true AND !self::_isMinimized($stylesheet['absolute_path'])) ? $cssMin->run($_css_src) : $_css_src;
$_css .= $_css_src;
}

Expand Down
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,13 @@ If you are currently in development of the site, caching can be a problem. For t

##Changelog##

3.2

* New CSS Compressor: AIOM now uses YUI Compressor (thanks to hwmaier)
* You can now use $config->scripts and $config->styles in AIOM (#31)
* Bugfix: Empty {} brackets will only be partly removed (#23)
* Bugfix: CSS pseudo classes will be compressed incorrectly (#33)

3.1.5

* Bugfix: Links to images, which are embedded in CSS, are broken if the DOCUMENT_ROOT is not equal to ProcessWire root.
Expand Down
Loading

0 comments on commit e3a2e7d

Please sign in to comment.