scriptList in metadata

This commit is contained in:
yuri
2018-12-26 11:35:05 +02:00
parent 3ee28f8d48
commit 54ac4b5308
4 changed files with 41 additions and 31 deletions

View File

@@ -378,7 +378,8 @@ class Container
{
return new \Espo\Core\Utils\ClientManager(
$this->get('config'),
$this->get('themeManager')
$this->get('themeManager'),
$this->get('metadata')
);
}

View File

@@ -35,42 +35,19 @@ class ClientManager
private $config;
private $metadata;
protected $mainHtmlFilePath = 'html/main.html';
protected $runScript = "app.start();";
protected $basePath = '';
protected $jsFileList = [
'client/espo.min.js'
];
protected $developerModeJsFileList = [
'client/lib/jquery-2.1.4.min.js',
'client/lib/underscore-min.js',
'client/lib/es6-promise.min.js',
'client/lib/backbone-min.js',
'client/lib/handlebars.js',
'client/lib/base64.js',
'client/lib/jquery-ui.min.js',
'client/lib/jquery.ui.touch-punch.min.js',
'client/lib/moment.min.js',
'client/lib/moment-timezone-with-data.min.js',
'client/lib/jquery.timepicker.min.js',
'client/lib/jquery.autocomplete.js',
'client/lib/bootstrap.min.js',
'client/lib/bootstrap-datepicker.js',
'client/lib/bull.js',
'client/lib/marked.min.js',
'client/src/loader.js',
'client/src/utils.js',
'client/src/exceptions.js',
];
public function __construct(Config $config, ThemeManager $themeManager)
public function __construct(Config $config, ThemeManager $themeManager, Metadata $metadata)
{
$this->config = $config;
$this->themeManager = $themeManager;
$this->metadata = $metadata;
}
protected function getThemeManager()
@@ -83,6 +60,11 @@ class ClientManager
return $this->config;
}
protected function getMetadata()
{
return $this->metadata;
}
public function setBasePath($basePath)
{
$this->basePath = $basePath;
@@ -116,11 +98,11 @@ class ClientManager
if ($isDeveloperMode) {
$useCache = $this->getConfig()->get('useCacheInDeveloperMode');
$jsFileList = $this->developerModeJsFileList;
$jsFileList = $this->getMetadata()->get(['app', 'client', 'developerModeScriptList']);
$loaderCacheTimestamp = 'null';
} else {
$useCache = $this->getConfig()->get('useCache');
$jsFileList = $this->jsFileList;
$jsFileList = $this->getMetadata()->get(['app', 'client', 'scriptList']);
$loaderCacheTimestamp = $cacheTimestamp;
}

View File

@@ -66,7 +66,8 @@ class Metadata
protected $frontendHiddenPathList = [
['app', 'formula', 'functionClassNameMap'],
['app', 'fileStorage', 'implementationClassNameMap'],
['app', 'emailNotifications', 'handlerClassNameMap']
['app', 'emailNotifications', 'handlerClassNameMap'],
['app', 'client'],
];
/**

View File

@@ -0,0 +1,26 @@
{
"scriptList": [
"client/espo.min.js"
],
"developerModeScriptList": [
"client/lib/jquery-2.1.4.min.js",
"client/lib/underscore-min.js",
"client/lib/es6-promise.min.js",
"client/lib/backbone-min.js",
"client/lib/handlebars.js",
"client/lib/base64.js",
"client/lib/jquery-ui.min.js",
"client/lib/jquery.ui.touch-punch.min.js",
"client/lib/moment.min.js",
"client/lib/moment-timezone-with-data.min.js",
"client/lib/jquery.timepicker.min.js",
"client/lib/jquery.autocomplete.js",
"client/lib/bootstrap.min.js",
"client/lib/bootstrap-datepicker.js",
"client/lib/bull.js",
"client/lib/marked.min.js",
"client/src/loader.js",
"client/src/utils.js",
"client/src/exceptions.js"
]
}