mirror of
https://github.com/nextcloud/server.git
synced 2026-06-10 09:13:19 -04:00
Merge pull request #3075 from nils/debug-no-versionhash
Do not add version hash in debug mode
This commit is contained in:
commit
ce973929e8
1 changed files with 12 additions and 3 deletions
|
|
@ -157,7 +157,7 @@ class TemplateLayout extends \OC_Template {
|
|||
foreach($jsFiles as $info) {
|
||||
$web = $info[1];
|
||||
$file = $info[2];
|
||||
$this->append( 'jsfiles', $web.'/'.$file . '?v=' . self::$versionHash);
|
||||
$this->append( 'jsfiles', $web.'/'.$file . $this->getVersionHashSuffix() );
|
||||
}
|
||||
|
||||
// Add the css files and check if server is already installed to prevent
|
||||
|
|
@ -179,13 +179,22 @@ class TemplateLayout extends \OC_Template {
|
|||
$file = $info[2];
|
||||
|
||||
if (substr($file, -strlen('print.css')) === 'print.css') {
|
||||
$this->append( 'printcssfiles', $web.'/'.$file . '?v=' . self::$versionHash);
|
||||
$this->append( 'printcssfiles', $web.'/'.$file . $this->getVersionHashSuffix() );
|
||||
} else {
|
||||
$this->append( 'cssfiles', $web.'/'.$file . '?v=' . self::$versionHash);
|
||||
$this->append( 'cssfiles', $web.'/'.$file . $this->getVersionHashSuffix() );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected function getVersionHashSuffix() {
|
||||
if(\OC::$server->getConfig()->getSystemValue('debug', false)) {
|
||||
// allows chrome workspace mapping in debug mode
|
||||
return "";
|
||||
}
|
||||
|
||||
return '?v=' . self::$versionHash;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param array $styles
|
||||
* @return array
|
||||
|
|
|
|||
Loading…
Reference in a new issue