From 6b45a242d6c34de8d1c0937ad22a941254a533d5 Mon Sep 17 00:00:00 2001 From: shy Date: Sun, 26 Nov 2023 14:31:52 +0800 Subject: [PATCH] add some --- lib/page.js | 6 +++--- lib/user.js | 4 +--- panel/header.js | 3 ++- 3 files changed, 6 insertions(+), 7 deletions(-) diff --git a/lib/page.js b/lib/page.js index 2351dc17..14506186 100644 --- a/lib/page.js +++ b/lib/page.js @@ -378,9 +378,9 @@ Volcanos("page", { return can.base.isIn(name, mdb.CREATE, mdb.INSERT, cli.RESTART, cli.START, cli.BUILD, ctx.RUN, web.OPEN, "startall", "clone")? "notice": can.base.isIn(name, mdb.REMOVE, mdb.DELETE, mdb.PRUNES, mdb.PRUNE, nfs.TRASH, "drop", cli.STOP, "stopall")? "danger": "" }, - exportValue: function(can, msg) { - msg.OptionDefault(ice.MSG_BG, can.page.styleValue(can, "--plugin-bg-color", can._output)) - msg.OptionDefault(ice.MSG_FG, can.page.styleValue(can, "--plugin-fg-color", can._output)) + exportValue: function(can, msg, target) { target = target||can._output + msg.OptionDefault(ice.MSG_BG, can.page.styleValue(can, "--plugin-bg-color", target)) + msg.OptionDefault(ice.MSG_FG, can.page.styleValue(can, "--plugin-fg-color", target)) return msg }, styleValue: function(can, key, target) { const styles = getComputedStyle(target||document.body); return styles.getPropertyValue(key) }, diff --git a/lib/user.js b/lib/user.js index 0f2a8921..3b4e7bad 100644 --- a/lib/user.js +++ b/lib/user.js @@ -259,9 +259,7 @@ Volcanos("user", { if (can.misc.CookieSessid(can)) { can.page.ClassList.del(can, document.body, aaa.LOGIN) can.onmotion.clearFloat(can), can.onmotion.delay(can, function() { socket._close = true, socket.close() }) return can.base.isFunc(cb) && cb(), cb = null, true - } - can.core.Timer(1000, function() { check() }) - can.onimport.theme(can) + } can.core.Timer(1000, function() { check() }), can.onimport.theme(can) } if (cmd == cli.PWD) { if (check()) { return } can.page.ClassList.add(can, document.body, aaa.LOGIN) var list = {}; msg.Table(function(value) { if (value.order == "") {} else if (value.type == mdb.PLUGIN) { list[value.name] = function(target) { diff --git a/panel/header.js b/panel/header.js index 720d105a..9926e49e 100644 --- a/panel/header.js +++ b/panel/header.js @@ -78,7 +78,8 @@ Volcanos(chat.ONACTION, {_init: function(can) { can.run(can.request({}, {_method: http.GET}), [], function(msg) { lang(msg) can.onaction._menus[1] = [chat.THEME, ice.AUTO].concat(can.core.List(msg["theme.list"], function(item) { return can.base.trimSuffix(item, ".css") })) can.onaction._menus[2] = [aaa.LANGUAGE, ice.AUTO].concat(can.core.List(msg["language.list"], function(item) { return can.base.trimSuffix(item, ".js") })) - can.require(can.core.List(msg["theme.list"], function(item) { return nfs.SRC_TEMPLATE+web.CHAT_HEADER+"/theme/"+item }), function() { can.page.requireModules(can, [msg.Option("icon.lib")]) + can.require(can.core.List(msg["theme.list"], function(item) { return nfs.SRC_TEMPLATE+web.CHAT_HEADER+"/theme/"+item }), function() { + can.onimport.theme(can), can.page.requireModules(can, [msg.Option("icon.lib")]) if (can.base.beginWith(location.pathname, nfs.WIKI_PORTAL, web.CHAT_CMD+web.WIKI_PORTAL, web.CHAT_CMD+"web.chat.oauth.client", web.CHAT_POD+"20230511-golang-story/cmd/web.code.gitea.client")) { return show(msg) } if (location.pathname == nfs.PS && can.base.beginWith(msg.Option(ice.MAIN)||"", nfs.WIKI_PORTAL, web.CHAT_CMD+web.WIKI_PORTAL)) { return show(msg) } if (!can.Conf(aaa.USERNICK, (msg.Option(aaa.USERNICK)||msg.Option(ice.MSG_USERNICK)||msg.Option(ice.MSG_USERNAME)).slice(0, 8))) {