* zin: add zin config to global config file and support to import extra css file.

This commit is contained in:
sunhao
2023-08-30 17:12:53 +08:00
parent 201ea4320f
commit 3cb96f18bb
5 changed files with 11 additions and 4 deletions
+5
View File
@@ -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
View File
@@ -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';
+3 -1
View File
@@ -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'));
View File
+2 -2
View File
@@ -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();