Skip to content

Commit

Permalink
drop -uncompresesd
Browse files Browse the repository at this point in the history
  • Loading branch information
dgrammatiko committed Mar 15, 2018
1 parent e3fb27e commit f5ce2aa
Show file tree
Hide file tree
Showing 2 changed files with 64 additions and 56 deletions.
26 changes: 17 additions & 9 deletions libraries/src/HTML/HTMLHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -424,14 +424,22 @@ protected static function includeRelativeFiles($folder, $file, $relative, $detec
$browser = $navigator->getBrowser();
$major = $navigator->getMajor();
$minor = $navigator->getMinor();
$minExt = '';

if (strlen($strip) > 4 && preg_match('#\.min$#', $strip))
{
$minExt = '.min';
$strip = preg_replace('#\.min$#', '', $strip);

}

// Try to include files named filename.ext, filename_browser.ext, filename_browser_major.ext, filename_browser_major_minor.ext
// where major and minor are the browser version names
$potential = array(
$strip,
$strip . '_' . $browser,
$strip . '_' . $browser . '_' . $major,
$strip . '_' . $browser . '_' . $major . '_' . $minor,
$strip . $minExt,
$strip . '_' . $browser . $minExt,
$strip . '_' . $browser . '_' . $major . $minExt,
$strip . '_' . $browser . '_' . $major . '_' . $minor . $minExt,
);
}
else
Expand Down Expand Up @@ -699,14 +707,14 @@ public static function stylesheet($file, $options = array(), $attribs = array())
$attribs = $argList[1] ?? array();
$options['relative'] = $argList[2] ?? false;
$options['pathOnly'] = $argList[3] ?? false;
$options['detectBrowser'] = $argList[4] ?? true;
$options['detectBrowser'] = $argList[4] ?? false;
$options['detectDebug'] = $argList[5] ?? true;
}
else
{
$options['relative'] = $options['relative'] ?? false;
$options['pathOnly'] = $options['pathOnly'] ?? false;
$options['detectBrowser'] = $options['detectBrowser'] ?? true;
$options['detectBrowser'] = $options['detectBrowser'] ?? false;
$options['detectDebug'] = $options['detectDebug'] ?? true;
}

Expand Down Expand Up @@ -772,15 +780,15 @@ public static function script($file, $options = array(), $attribs = array())
$options['framework'] = $argList[1] ?? false;
$options['relative'] = $argList[2] ?? false;
$options['pathOnly'] = $argList[3] ?? false;
$options['detectBrowser'] = $argList[4] ?? true;
$options['detectBrowser'] = $argList[4] ?? false;
$options['detectDebug'] = $argList[5] ?? true;
}
else
{
$options['framework'] = $options['framework'] ?? false;
$options['relative'] = $options['relative'] ?? false;
$options['pathOnly'] = $options['pathOnly'] ?? false;
$options['detectBrowser'] = $options['detectBrowser'] ?? true;
$options['detectBrowser'] = $options['detectBrowser'] ?? false;
$options['detectDebug'] = $options['detectDebug'] ?? true;
}

Expand Down Expand Up @@ -830,7 +838,7 @@ public static function script($file, $options = array(), $attribs = array())
* Also passing a key = fullPolyfill and value= true we force the whole polyfill instead
* of just the custom element. (Polyfills loaded as needed, no force load)
* @param array $options The relative, version, detect browser and detect debug options for the custom element
* or web component. Files need to have a -es5(.min).js (or -es5(.min).html) for the non ES6
* or web component. Files need to have a -es5(.min).js for the non ES6
* Browsers.
*
* @since 4.0.0
Expand Down

0 comments on commit f5ce2aa

Please sign in to comment.