From df2958c76eb2105afd97b404ca9f776aae98df82 Mon Sep 17 00:00:00 2001 From: shy Date: Sun, 26 Nov 2023 21:08:51 +0800 Subject: [PATCH] add main.css --- base/web/render.go | 9 ++++----- conf.go | 5 ++++- core/chat/location/amap.js | 6 +++++- core/chat/macos/desktop.css | 11 ++++++++++- 4 files changed, 23 insertions(+), 8 deletions(-) diff --git a/base/web/render.go b/base/web/render.go index 891519d0..4639c4db 100644 --- a/base/web/render.go +++ b/base/web/render.go @@ -124,12 +124,11 @@ func RenderMain(m *ice.Message) *ice.Message { if m.IsCliUA() { return m.RenderDownload(path.Join(ice.USR_INTSHELL, ice.INDEX_SH)) } - m.Option(nfs.VERSION, RenderVersion(m)+kit.Select("", "&pod="+m.Option(ice.MSG_USERPOD), m.Option(ice.MSG_USERPOD) != "")) - return RenderTemplate(m, "main.html") + m.Options(nfs.SCRIPT, ice.SRC_MAIN_JS, nfs.VERSION, RenderVersion(m)+kit.Select("", "&pod="+m.Option(ice.MSG_USERPOD), m.Option(ice.MSG_USERPOD) != "")) + return m.RenderResult(kit.Renders(m.Cmdx(nfs.CAT, ice.SRC_MAIN_HTML), m)) } -func RenderCmds(m *ice.Message, list ...ice.Any) { - m.Option(nfs.VERSION, RenderVersion(m)+kit.Select("", "&pod="+m.Option(ice.MSG_USERPOD), m.Option(ice.MSG_USERPOD) != "")) - RenderTemplate(m.Options(mdb.LIST, kit.Format(list)), "cmds.html") +func RenderCmds(m *ice.Message, cmds ...ice.Any) { + RenderMain(m.Options(ctx.CMDS, kit.Format(cmds))) } func RenderPodCmd(m *ice.Message, pod, cmd string, arg ...ice.Any) { msg := m.Cmd(Space(m, pod), ctx.COMMAND, kit.Select(m.PrefixKey(), cmd)) diff --git a/conf.go b/conf.go index acfb5f7c..4e4fbc72 100644 --- a/conf.go +++ b/conf.go @@ -161,8 +161,11 @@ const ( // DIR ETC_EXIT_SHY = "etc/exit.shy" ETC_MISS_SH = "etc/miss.sh" ETC_PATH = "etc/path" - SRC_MAIN_SHY = "src/main.shy" SRC_MAIN_SH = "src/main.sh" + SRC_MAIN_SHY = "src/main.shy" + SRC_MAIN_HTML = "src/main.html" + SRC_MAIN_ICO = "src/main.ico" + SRC_MAIN_CSS = "src/main.css" SRC_MAIN_JS = "src/main.js" SRC_MAIN_GO = "src/main.go" SRC_WEBVIEW_GO = "src/webview.go" diff --git a/core/chat/location/amap.js b/core/chat/location/amap.js index e44ee18e..efd210af 100644 --- a/core/chat/location/amap.js +++ b/core/chat/location/amap.js @@ -70,6 +70,10 @@ Volcanos(chat.ONACTION, { Volcanos(chat.ONEXPORT, { status: function(can, p) { p = p||can.ui.map.getCenter(), can.ui.marker.setPosition(p), can.ui.circle.setCenter(p) can.Status({longitude: p.getLng().toFixed(6), latitude: p.getLat().toFixed(6)}), can.ui.map.getCity(function(result) { can.Status(result) }) - can.ui.geocoder.getAddress(p, function(status, result) { can.Status(result.regeocode.addressComponent), can.Status({text: result.regeocode.formattedAddress}) }) + can.ui.geocoder.getAddress(p, function(status, result) { + var info = result.regeocode.addressComponent, text = result.regeocode.formattedAddress + text = can.base.trimPrefix(text, info.province, info.city, info.district, info.township) + can.Status(info), can.Status({text: text}) + }) }, }) diff --git a/core/chat/macos/desktop.css b/core/chat/macos/desktop.css index 9028a583..4cb63421 100644 --- a/core/chat/macos/desktop.css +++ b/core/chat/macos/desktop.css @@ -52,7 +52,10 @@ fieldset.macos.desktop>div.output>div.desktop>fieldset>div.output>table.content fieldset.macos.desktop>div.output>div.desktop>fieldset.web.wiki.feel>div.status { display:none; } fieldset.macos.desktop>div.output>div.desktop>fieldset.web.code.xterm>div.status { display:none; } fieldset.macos.desktop>div.output>div.desktop>fieldset.web.chat.iframe>div.status { display:none; } -fieldset.macos.desktop>div.output>div.desktop>fieldset.web.chat.location>div.action>div.item.text input { width:48px; } +fieldset.macos.desktop>div.output>div.desktop>fieldset.web.chat.location>form.option>div.item:last-child { margin-right:unset; } +fieldset.macos.desktop>div.output>div.desktop>fieldset.web.chat.location>div.action>div.item.text { display:none; } +fieldset.macos.desktop>div.output>div.desktop>fieldset.web.chat.location>div.action>div.item.style select { width:80px; } +fieldset.macos.desktop>div.output>div.desktop>fieldset.web.chat.location>div.action>div.item.feature select { width:60px; } fieldset.macos.desktop>div.output>div.desktop>fieldset.web.chat.iframe>form.option>div.item.hash>input { width:var(--river-width); } fieldset.macos.desktop>div.output>div.desktop>fieldset.web.chat.macos.finder>div.status { display:none; } fieldset.macos.menu>div.output>div.item { padding:0 var(--input-padding); height:var(--desktop-menu-height); float:right; } @@ -71,6 +74,12 @@ fieldset.macos.finder>div.output div.content>div.item div.name { font-size:var(- body.dark fieldset.macos.desktop>div.output>fieldset.macos { background-color:#08234ad1; } body.dark fieldset.macos.desktop>div.output>div.desktop fieldset table.content tbody tr:nth-child(odd) { background-color:#282B2F; } body.dark fieldset.macos.desktop>div.output>div.desktop fieldset table.content tbody tr:nth-child(even) { background-color:#1a1d1e; } +/* body.dark.macos.desktop { background-color:#08234ad1; } */ +/* body.light.cmd.macos.desktop { background-color:#daefff99; } */ +body.cmd.dark.web.chat.macos.desktop { background-color:#0c3267; } +body.cmd.light.web.chat.macos.desktop { background-color:#8ebff2; } +body.cmd.white.web.chat.macos.desktop { background-color:#cadef7; } +body.cmd.black.web.chat.macos.desktop { background-color:#0d3e7d; } body.light fieldset.macos.desktop>div.output>fieldset.macos { background-color:#daefff99; } body.light fieldset.macos.desktop>div.output>div.desktop fieldset table.content tbody tr:nth-child(odd) { background-color:white; } body.light fieldset.macos.desktop>div.output>div.desktop fieldset table.content tbody tr:nth-child(even) { background-color:#f4f5f5; }