diff options
author | Lukas Reschke <lukas@statuscode.ch> | 2017-03-09 23:25:17 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-09 23:25:17 +0100 |
commit | 6fd0e7e93995facfe75b26699ea462bb94fd03b9 (patch) | |
tree | 2584a8e55ceabcdc182df849d0c292041ab2c113 | |
parent | db5fc4d3cbff68055d338f91bef44572b6c44fa6 (diff) | |
parent | 0c22a6696703225baabd6a4afaad5759745da8c5 (diff) | |
download | nextcloud-server-6fd0e7e93995facfe75b26699ea462bb94fd03b9.tar.gz nextcloud-server-6fd0e7e93995facfe75b26699ea462bb94fd03b9.zip |
Merge pull request #3791 from nextcloud/combine_sass
Combine sass
-rw-r--r-- | core/css/fixes.scss (renamed from core/css/fixes.css) | 0 | ||||
-rw-r--r-- | core/css/fonts.scss (renamed from core/css/fonts.css) | 0 | ||||
-rw-r--r-- | core/css/global.scss (renamed from core/css/global.css) | 0 | ||||
-rw-r--r-- | core/css/mobile.scss (renamed from core/css/mobile.css) | 0 | ||||
-rw-r--r-- | core/css/server.scss | 11 | ||||
-rw-r--r-- | lib/private/Template/SCSSCacher.php | 21 | ||||
-rw-r--r-- | lib/private/legacy/template.php | 12 |
7 files changed, 30 insertions, 14 deletions
diff --git a/core/css/fixes.css b/core/css/fixes.scss index 3cb89c6599f..3cb89c6599f 100644 --- a/core/css/fixes.css +++ b/core/css/fixes.scss diff --git a/core/css/fonts.css b/core/css/fonts.scss index f72aa2930cf..f72aa2930cf 100644 --- a/core/css/fonts.css +++ b/core/css/fonts.scss diff --git a/core/css/global.css b/core/css/global.scss index 9511d4324fa..9511d4324fa 100644 --- a/core/css/global.css +++ b/core/css/global.scss diff --git a/core/css/mobile.css b/core/css/mobile.scss index b0f8421345c..b0f8421345c 100644 --- a/core/css/mobile.css +++ b/core/css/mobile.scss diff --git a/core/css/server.scss b/core/css/server.scss new file mode 100644 index 00000000000..516220f2ad5 --- /dev/null +++ b/core/css/server.scss @@ -0,0 +1,11 @@ +@import 'styles.scss'; +@import 'inputs.scss'; +@import 'header.scss'; +@import 'icons.scss'; +@import 'fonts.scss'; +@import 'apps.scss'; +@import 'global.scss'; +@import 'fixes.scss'; +@import 'multiselect.scss'; +@import 'mobile.scss'; +@import 'tooltip.scss'; diff --git a/lib/private/Template/SCSSCacher.php b/lib/private/Template/SCSSCacher.php index d6f5a2c6fd3..744ea80761e 100644 --- a/lib/private/Template/SCSSCacher.php +++ b/lib/private/Template/SCSSCacher.php @@ -103,10 +103,17 @@ class SCSSCacher { private function isCached($fileNameCSS, $fileNameSCSS, ISimpleFolder $folder, $path) { try{ $cachedFile = $folder->getFile($fileNameCSS); - if( $cachedFile->getMTime() > filemtime($path.'/'.$fileNameSCSS) - && $cachedFile->getSize() > 0 ) { - return true; + if ($cachedFile->getSize() > 0) { + $depFile = $folder->getFile($fileNameCSS . '.deps'); + $deps = json_decode($depFile->getContent(), true); + + foreach ($deps as $file=>$mtime) { + if (!file_exists($file) || filemtime($file) > $mtime) { + return false; + } + } } + return true; } catch(NotFoundException $e) { return false; } @@ -140,6 +147,13 @@ class SCSSCacher { $cachedfile = $folder->newFile($fileNameCSS); } + $depFileName = $fileNameCSS . '.deps'; + try { + $depFile = $folder->getFile($depFileName); + } catch (NotFoundException $e) { + $depFile = $folder->newFile($depFileName); + } + // Compile try { $compiledScss = $scss->compile('@import "'.$fileNameSCSS.'";'); @@ -150,6 +164,7 @@ class SCSSCacher { try { $cachedfile->putContent($this->rebaseUrls($compiledScss, $webDir)); + $depFile->putContent(json_encode($scss->getParsedFiles())); $this->logger->debug($webDir.'/'.$fileNameSCSS.' compiled and successfully cached', ['app' => 'core']); return true; } catch(NotFoundException $e) { diff --git a/lib/private/legacy/template.php b/lib/private/legacy/template.php index 09e3d130f49..8535e018879 100644 --- a/lib/private/legacy/template.php +++ b/lib/private/legacy/template.php @@ -106,19 +106,9 @@ class OC_Template extends \OC\Template\Base { } } - OC_Util::addStyle("tooltip",null,true); OC_Util::addStyle('jquery-ui-fixes',null,true); OC_Util::addVendorStyle('jquery-ui/themes/base/jquery-ui',null,true); - OC_Util::addStyle("mobile",null,true); - OC_Util::addStyle("multiselect",null,true); - OC_Util::addStyle("fixes",null,true); - OC_Util::addStyle("global",null,true); - OC_Util::addStyle("apps",null,true); - OC_Util::addStyle("fonts",null,true); - OC_Util::addStyle("icons",null,true); - OC_Util::addStyle("header",null,true); - OC_Util::addStyle("inputs"); - OC_Util::addStyle("styles",null,true); + OC_Util::addStyle('server', null, true); // avatars \OC_Util::addScript('jquery.avatar', null, true); |