* zin: add zin config to global config file and support to import extra css file.
This commit is contained in:
@@ -231,3 +231,8 @@ else
|
||||
unset($config->maxVersion);
|
||||
unset($config->ipdVersion);
|
||||
}
|
||||
|
||||
/* Set zin config. */
|
||||
$config->zin = new stdClass();
|
||||
$config->zin->mode = 'compatible'; // 启用兼容 18.x 模式。
|
||||
$config->zin->extraCSS = 'compatible.css'; // 额外的 CSS 样式文件。
|
||||
|
||||
+1
-1
@@ -16,7 +16,7 @@ function loadConfig()
|
||||
{
|
||||
global $app, $config;
|
||||
|
||||
$config->zin = new \stdClass();
|
||||
if(!isset($config->zin)) $config->zin = new \stdClass();
|
||||
|
||||
$config->zin->lang = $app->getClientLang();
|
||||
$config->zin->wgVer = isset($config->wgVer) ? $config->wgVer : '1';
|
||||
|
||||
@@ -64,7 +64,7 @@ class pageBase extends wg
|
||||
$themeName = $app->cookie->theme;
|
||||
$zuiPath = $config->zin->zuiPath;
|
||||
|
||||
$jsConfig->zin = true;
|
||||
$jsConfig->zin = (isset($config->zin->mode) && $config->zin->mode) ? $config->zin->mode : true;
|
||||
|
||||
$headImports = array();
|
||||
if($zui)
|
||||
@@ -73,6 +73,8 @@ class pageBase extends wg
|
||||
$headImports[] = h::importCss($zuiPath . 'themes/' . $themeName . '.css', setID('zuiTheme'));
|
||||
$headImports[] = h::importJs($zuiPath . 'zui.zentao.umd.cjs', setID('zuiJS'));
|
||||
$headImports[] = h::jsCall('$.setLibRoot', $zuiPath);
|
||||
|
||||
if(isset($config->zin->extraCSS) && $config->zin->extraCSS) $headImports[] = h::importCss($webRoot . 'js/zui3/' . $config->zin->extraCSS);
|
||||
}
|
||||
$headImports[] = h::jsVar('window.config', $jsConfig, setID('configJS'));
|
||||
if($zui) $headImports[] = h::importJs($webRoot . 'js/zui3/zin.js', setID('zinJS'));
|
||||
|
||||
+2
-2
@@ -7,7 +7,7 @@
|
||||
const currentMethod = config.currentMethod;
|
||||
const isIndexPage = currentModule === 'index' && currentMethod === 'index';
|
||||
const isInAppTab = parent.window !== window;
|
||||
const is18version = true;
|
||||
const is18version = config.zin === 'compatible';
|
||||
|
||||
const selfOpenList = new Set('index|tutorial|install|upgrade|sso|cron|misc|user-login|user-deny|user-logout|user-reset|user-forgetpassword|user-resetpassword|my-changepassword|my-preference|file-read|file-download|file-uploadimages|report-annualdata|misc-captcha|execution-printkanban|traincourse-playvideo'.split('|'));
|
||||
const isAllowSelfOpen = isIndexPage
|
||||
@@ -46,7 +46,7 @@
|
||||
if(isIndexPage) return;
|
||||
|
||||
const DEBUG = config.debug;
|
||||
const is18version = true;
|
||||
const is18version = config.zin === 'compatible';
|
||||
const currentCode = window.name.substring(4);
|
||||
const isInAppTab = parent.window !== window;
|
||||
const fetchTasks = new Map();
|
||||
|
||||
Reference in New Issue
Block a user