mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-04-13 15:32:15 +09:00
Prevent templates from duplicating common CSS and JS scripts
This commit is contained in:
parent
e61bc66373
commit
4e8f048c1d
2 changed files with 23 additions and 12 deletions
|
|
@ -93,7 +93,16 @@ class FrontEndFileHandler extends Handler
|
|||
{
|
||||
$args = array($args);
|
||||
}
|
||||
if($args[3] > -1500000 && preg_match(HTMLDisplayHandler::$reservedCSS, $args[0]))
|
||||
{
|
||||
return;
|
||||
}
|
||||
if($args[3] > -1500000 && preg_match(HTMLDisplayHandler::$reservedJS, $args[0]))
|
||||
{
|
||||
return;
|
||||
}
|
||||
$file = $this->getFileInfo($args[0], $args[2], $args[1]);
|
||||
$file->index = (int)$args[3];
|
||||
|
||||
$availableExtension = array('css' => 1, 'js' => 1);
|
||||
if(!isset($availableExtension[$file->fileExtension]))
|
||||
|
|
@ -101,8 +110,6 @@ class FrontEndFileHandler extends Handler
|
|||
return;
|
||||
}
|
||||
|
||||
$file->index = (int) $args[3];
|
||||
|
||||
if($file->fileExtension == 'css')
|
||||
{
|
||||
$map = &$this->cssMap;
|
||||
|
|
@ -124,7 +131,6 @@ class FrontEndFileHandler extends Handler
|
|||
}
|
||||
}
|
||||
|
||||
(is_null($file->index)) ? $file->index = 0 : $file->index = $file->index;
|
||||
if(!isset($mapIndex[$file->key]) || $mapIndex[$file->key] > $file->index)
|
||||
{
|
||||
$this->unloadFile($args[0], $args[2], $args[1]);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue