diff options
author | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2017-01-10 10:39:52 +0100 |
---|---|---|
committer | John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com> | 2017-01-10 11:06:03 +0100 |
commit | 67467873c25b8b1e7b51e336d48b05f567150a93 (patch) | |
tree | 7f589b47f05426124b241c39ce42df05761c4548 /lib | |
parent | 307d45e3bdf32c50e46a47b746282ecfbb43b384 (diff) | |
download | nextcloud-server-67467873c25b8b1e7b51e336d48b05f567150a93.tar.gz nextcloud-server-67467873c25b8b1e7b51e336d48b05f567150a93.zip |
Removed jquery scss
- Switched to setup.css
- Disable scss when displaying the update page
- Improved setup css
- Fixed loading failure of other styles on setup & update page
- Improved scss compiler with an ignore scss compilation option
Signed-off-by: John Molakvoæ (skjnldsv) <skjnldsv@protonmail.com>
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Template/CSSResourceLocator.php | 17 | ||||
-rw-r--r-- | lib/private/TemplateLayout.php | 27 |
2 files changed, 25 insertions, 19 deletions
diff --git a/lib/private/Template/CSSResourceLocator.php b/lib/private/Template/CSSResourceLocator.php index 351e6d1366f..6af4e319e36 100644 --- a/lib/private/Template/CSSResourceLocator.php +++ b/lib/private/Template/CSSResourceLocator.php @@ -39,7 +39,7 @@ class CSSResourceLocator extends ResourceLocator { * @param array $party_map * @param SCSSCacher $scssCacher */ - public function __construct(ILogger $logger, $theme, $core_map, $party_map, SCSSCacher $scssCacher) { + public function __construct(ILogger $logger, $theme, $core_map, $party_map, $scssCacher) { $this->scssCacher = $scssCacher; parent::__construct($logger, $theme, $core_map, $party_map); @@ -85,12 +85,17 @@ class CSSResourceLocator extends ResourceLocator { */ protected function cacheAndAppendScssIfExist($root, $file, $webRoot = null) { if (is_file($root.'/'.$file)) { - if($this->scssCacher->process($root, $file)) { - $this->append($root, $this->scssCacher->getCachedSCSS('core', $file), $webRoot, false); - return true; + if($this->scssCacher !== null) { + if($this->scssCacher->process($root, $file)) { + $this->append($root, $this->scssCacher->getCachedSCSS('core', $file), $webRoot, false); + return true; + } else { + $this->logger->error('Failed to compile and/or save '.$root.'/'.$file, ['app' => 'core']); + return false; + } } else { - $this->logger->error('Failed to compile and/or save '.$root.'/'.$file, ['app' => 'core']); - return false; + $this->logger->error('Scss is disabled for '.$root.'/'.$file.', ignoring', ['app' => 'core']); + return true; } } return false; diff --git a/lib/private/TemplateLayout.php b/lib/private/TemplateLayout.php index bc6a485ad43..c3197b00282 100644 --- a/lib/private/TemplateLayout.php +++ b/lib/private/TemplateLayout.php @@ -162,14 +162,11 @@ class TemplateLayout extends \OC_Template { // Add the css files and check if server is already installed to prevent // appdata initialisation before database configuration - if(\OC::$server->getSystemConfig()->getValue('installed', false)) { + // Prevent scss initialisation if an update is needed + if(\OC::$server->getSystemConfig()->getValue('installed', false) && !\OCP\Util::needUpgrade()) { $cssFiles = self::findStylesheetFiles(\OC_Util::$styles); } else { - $cssFiles = array( - [\OC::$SERVERROOT, \OC::$WEBROOT, 'core/css/global.css'], - [\OC::$SERVERROOT, \OC::$WEBROOT, 'core/css/fonts.css'], - [\OC::$SERVERROOT, \OC::$WEBROOT, 'core/css/installation.css'] - ); + $cssFiles = self::findStylesheetFiles(\OC_Util::$styles, false); } $this->assign('cssfiles', array()); $this->assign('printcssfiles', []); @@ -190,16 +187,20 @@ class TemplateLayout extends \OC_Template { * @param array $styles * @return array */ - static public function findStylesheetFiles($styles) { + static public function findStylesheetFiles($styles, $compileScss = true) { // Read the selected theme from the config file $theme = \OC_Util::getTheme(); - $SCSSCacher = new SCSSCacher( - \OC::$server->getLogger(), - \OC::$server->getAppDataDir('css'), - \OC::$server->getURLGenerator(), - \OC::$server->getSystemConfig() - ); + if($compileScss) { + $SCSSCacher = new SCSSCacher( + \OC::$server->getLogger(), + \OC::$server->getAppDataDir('css'), + \OC::$server->getURLGenerator(), + \OC::$server->getSystemConfig() + ); + } else { + $SCSSCacher = null; + } $locator = new \OC\Template\CSSResourceLocator( \OC::$server->getLogger(), |