diff --git a/base/cli/qrcode.go b/base/cli/qrcode.go index 118dcbfa..1002f972 100644 --- a/base/cli/qrcode.go +++ b/base/cli/qrcode.go @@ -126,8 +126,8 @@ func init() { } }}, }, Hand: func(m *ice.Message, arg ...string) { - m.Option(FG, kit.Select(kit.Select(BLACK, WHITE, m.Option(ice.TOPIC) == BLACK || m.Option(ice.TOPIC) == "dark"), arg, 1)) - m.Option(BG, kit.Select(kit.Select(WHITE, BLACK, m.Option(ice.TOPIC) == BLACK || m.Option(ice.TOPIC) == "dark"), arg, 2)) + m.Option(FG, kit.Select(kit.Select(BLACK, WHITE, m.Option(ice.THEME) == BLACK || m.Option(ice.THEME) == "dark"), arg, 1)) + m.Option(BG, kit.Select(kit.Select(WHITE, BLACK, m.Option(ice.THEME) == BLACK || m.Option(ice.THEME) == "dark"), arg, 2)) if m.IsCliUA() { _qrcode_cli(m, kit.Select(kit.Select(ice.Info.Make.Domain, ice.Info.Domain), arg, 0)) } else { diff --git a/base/web/share.go b/base/web/share.go index 5161209b..f9b9b46d 100644 --- a/base/web/share.go +++ b/base/web/share.go @@ -81,7 +81,7 @@ func _share_proxy(m *ice.Message) { } const ( - TOPIC = "topic" + THEME = "tospic" LOGIN = "login" RIVER = "river" STORM = "storm" diff --git a/conf.go b/conf.go index be5b99c9..2280a26a 100644 --- a/conf.go +++ b/conf.go @@ -195,7 +195,7 @@ const ( // MSG MSG_MODE = "sess.mode" MSG_TITLE = "sess.title" - MSG_TOPIC = "sess.topic" + MSG_THEME = "sess.theme" MSG_RIVER = "sess.river" MSG_STORM = "sess.storm" MSG_WIDTH = "sess.width" @@ -293,7 +293,7 @@ const ( // web SERVE = "serve" SPACE = "space" - TOPIC = "topic" + THEME = "theme" TITLE = "title" ) const ( // nfs diff --git a/core/chat/action.go b/core/chat/action.go index 00f3335e..b70ac3e9 100644 --- a/core/chat/action.go +++ b/core/chat/action.go @@ -45,7 +45,7 @@ func _action_share(m *ice.Message, arg ...string) { case web.STORM: if len(arg) == 1 { m.Push(TITLE, msg.Append(TITLE)) - m.Push(TOPIC, msg.Append(TOPIC)) + m.Push(THEME, msg.Append(THEME)) _action_list(m, msg.Append(web.RIVER), msg.Append(web.STORM)) break } @@ -53,7 +53,7 @@ func _action_share(m *ice.Message, arg ...string) { case web.FIELD: if len(arg) == 1 { m.Push(TITLE, msg.Append(TITLE)) - m.Push(TOPIC, msg.Append(TOPIC)) + m.Push(THEME, msg.Append(THEME)) m.Push(ctx.ARGS, msg.Append(mdb.TEXT)) m.Cmdy(ctx.COMMAND, msg.Append(mdb.NAME)) break diff --git a/core/chat/chat.shy b/core/chat/chat.shy index bbe13772..549ef0df 100644 --- a/core/chat/chat.shy +++ b/core/chat/chat.shy @@ -18,7 +18,7 @@ location.go location.shy div.go -topic.go +theme.go website.go template.go trans.go diff --git a/core/chat/topic.go b/core/chat/theme.go similarity index 60% rename from core/chat/topic.go rename to core/chat/theme.go index 7462d0a1..e30134dd 100644 --- a/core/chat/topic.go +++ b/core/chat/theme.go @@ -12,7 +12,7 @@ import ( kit "shylinux.com/x/toolkits" ) -const TOPIC = "topic" +const THEME = "theme" func init() { form := ice.Map{ @@ -20,7 +20,7 @@ func init() { "header.height": ice.Map{"tags": "panel.Header,panel.Header>div.output", mdb.TYPE: "text", mdb.NAME: "height", mdb.VALUE: "31"}, } Index.MergeCommands(ice.Commands{ - TOPIC: {Name: "topic zone id auto create insert", Help: "主题", Actions: ice.MergeActions(ice.Actions{ + THEME: {Name: "theme zone id auto create insert", Help: "主题", Actions: ice.MergeActions(ice.Actions{ mdb.INPUTS: {Hand: func(m *ice.Message, arg ...string) { switch arg[0] { case "tags": @@ -51,8 +51,8 @@ func init() { } m.Cmdy(mdb.INPUTS, m.PrefixKey(), "", mdb.ZONE, arg) }}, - "create": {Name: "create topic=demo hover=gray float=lightgray color=black background=white", Hand: func(m *ice.Message, arg ...string) { - m.Cmd(nfs.SAVE, path.Join("src/website/topic/"+m.Option("topic")+".css"), kit.Renders(_topic_template, m)) + "create": {Name: "create theme=demo hover=gray float=lightgray color=black background=white", Hand: func(m *ice.Message, arg ...string) { + m.Cmd(nfs.SAVE, path.Join("src/website/theme/"+m.Option("theme")+".css"), kit.Renders(_theme_template, m)) }}, "form": {Name: "form", Help: "表单", Hand: func(m *ice.Message, arg ...string) { m.Cmd(m.CommandKey(), m.Option(mdb.ZONE), func(value ice.Maps) { @@ -72,16 +72,16 @@ func init() { m.Echo("done") }}, "choose": {Name: "choose", Help: "切换", Hand: func(m *ice.Message, arg ...string) { - m.ProcessLocation(web.MergeURL2(m, "", "topic", kit.TrimExt(m.Option(mdb.ZONE), nfs.CSS))) + m.ProcessLocation(web.MergeURL2(m, "", "theme", kit.TrimExt(m.Option(mdb.ZONE), nfs.CSS))) }}, }, mdb.ZoneAction(mdb.FIELD, "time,id,tags,type,name,value"), aaa.WhiteAction()), Hand: func(m *ice.Message, arg ...string) { if mdb.ZoneSelect(m, arg...); len(arg) == 0 { - m.Cmd(nfs.DIR, nfs.PWD, ice.OptionFields(), kit.Dict(nfs.DIR_ROOT, "src/website/topic/")).RenameAppend(nfs.PATH, mdb.ZONE, nfs.SIZE, mdb.COUNT).Tables(func(values ice.Maps) { + m.Cmd(nfs.DIR, nfs.PWD, ice.OptionFields(), kit.Dict(nfs.DIR_ROOT, "src/website/theme/")).RenameAppend(nfs.PATH, mdb.ZONE, nfs.SIZE, mdb.COUNT).Tables(func(values ice.Maps) { m.Push("", values) }) m.PushAction("choose", "form", mdb.REMOVE) } else { - if p := "src/website/topic/" + arg[0]; nfs.ExistsFile(m, p) { + if p := "src/website/theme/" + arg[0]; nfs.ExistsFile(m, p) { m.Cmdy(nfs.CAT, p) } else { m.Tables(func(value ice.Maps) { @@ -90,8 +90,8 @@ func init() { } } }}, - web.PP(TOPIC): {Name: "/topic/", Help: "主题", Hand: func(m *ice.Message, arg ...string) { - if p := "src/website/topic/" + arg[0]; nfs.ExistsFile(m, p) { + web.PP(THEME): {Name: "/theme/", Help: "主题", Hand: func(m *ice.Message, arg ...string) { + if p := "src/website/theme/" + arg[0]; nfs.ExistsFile(m, p) { m.RenderDownload(p) return } @@ -100,45 +100,45 @@ func init() { }) } -var _topic_template = ` -body.{{.Option "topic"}} { background-color:{{.Option "background" }}; color:{{.Option "color" }}; } -body.{{.Option "topic"}} legend { background-color:{{.Option "hover" }}; color:{{.Option "color" }}; } -body.{{.Option "topic"}} select { background-color:{{.Option "background" }}; color:{{.Option "color" }}; } -body.{{.Option "topic"}} textarea { background-color:{{.Option "background" }}; } -body.{{.Option "topic"}} input[type=text] { background-color:{{.Option "background" }}; } -body.{{.Option "topic"}} input[type=button] { background-color:{{.Option "float" }}; color:{{.Option "color" }}; } +var _theme_template = ` +body.{{.Option "theme"}} { background-color:{{.Option "background" }}; color:{{.Option "color" }}; } +body.{{.Option "theme"}} legend { background-color:{{.Option "hover" }}; color:{{.Option "color" }}; } +body.{{.Option "theme"}} select { background-color:{{.Option "background" }}; color:{{.Option "color" }}; } +body.{{.Option "theme"}} textarea { background-color:{{.Option "background" }}; } +body.{{.Option "theme"}} input[type=text] { background-color:{{.Option "background" }}; } +body.{{.Option "theme"}} input[type=button] { background-color:{{.Option "float" }}; color:{{.Option "color" }}; } legend, select, textarea, input[type=text], div.code, div.story[data-type=spark] { box-shadow:4px 4px 20px 4px {{.Option "float" }}; } -body.{{.Option "topic"}} div.carte { background-color:{{.Option "float" }}; } -body.{{.Option "topic"}} div.input { background-color:{{.Option "float" }}; } -body.{{.Option "topic"}} div.story[data-type=spark] { background:{{.Option "float" }}; } -body.{{.Option "topic"}} fieldset.input { background-color:{{.Option "float" }}; } +body.{{.Option "theme"}} div.carte { background-color:{{.Option "float" }}; } +body.{{.Option "theme"}} div.input { background-color:{{.Option "float" }}; } +body.{{.Option "theme"}} div.story[data-type=spark] { background:{{.Option "float" }}; } +body.{{.Option "theme"}} fieldset.input { background-color:{{.Option "float" }}; } -body.{{.Option "topic"}} table.content tr { background-color:{{.Option "background" }}; } -body.{{.Option "topic"}} table.content th { background-color:{{.Option "float" }}; } -body.{{.Option "topic"}} table.content.action th:last-child { background-color:{{.Option "float" }}; } -body.{{.Option "topic"}} table.content.action td:last-child { background-color:{{.Option "float" }}; } +body.{{.Option "theme"}} table.content tr { background-color:{{.Option "background" }}; } +body.{{.Option "theme"}} table.content th { background-color:{{.Option "float" }}; } +body.{{.Option "theme"}} table.content.action th:last-child { background-color:{{.Option "float" }}; } +body.{{.Option "theme"}} table.content.action td:last-child { background-color:{{.Option "float" }}; } -body.{{.Option "topic"}} fieldset.panel.Action { background-color:{{.Option "background" }}; } -body.{{.Option "topic"}} fieldset.panel.Footer>div.output div.toast { background-color:{{.Option "float" }}; } -body.{{.Option "topic"}} fieldset.plugin { background-color:{{.Option "background" }}; } -body.{{.Option "topic"}} fieldset.plugin { box-shadow:2px 2px 10px 4px {{.Option "float" }}; } -body.{{.Option "topic"}} fieldset.story { box-shadow:4px 4px 10px 1px {{.Option "float" }}; } -body.{{.Option "topic"}} fieldset.draw div.output { background:{{.Option "background" }}; } -body.{{.Option "topic"}} fieldset.draw div.output div.content svg { background:{{.Option "float" }}; } +body.{{.Option "theme"}} fieldset.panel.Action { background-color:{{.Option "background" }}; } +body.{{.Option "theme"}} fieldset.panel.Footer>div.output div.toast { background-color:{{.Option "float" }}; } +body.{{.Option "theme"}} fieldset.plugin { background-color:{{.Option "background" }}; } +body.{{.Option "theme"}} fieldset.plugin { box-shadow:2px 2px 10px 4px {{.Option "float" }}; } +body.{{.Option "theme"}} fieldset.story { box-shadow:4px 4px 10px 1px {{.Option "float" }}; } +body.{{.Option "theme"}} fieldset.draw div.output { background:{{.Option "background" }}; } +body.{{.Option "theme"}} fieldset.draw div.output div.content svg { background:{{.Option "float" }}; } -body.{{.Option "topic"}} input[type=text]:hover { background-color:{{.Option "float" }}; } -body.{{.Option "topic"}} input[type=button]:hover { background-color:{{.Option "hover" }}; } -body.{{.Option "topic"}} div.item:hover { background-color:{{.Option "float" }}; } -body.{{.Option "topic"}} div.item.select { background-color:{{.Option "float" }}; } -body.{{.Option "topic"}} div.list div.item:hover { background-color:{{.Option "hover" }}; } -body.{{.Option "topic"}} div.list div.item.select { background-color:{{.Option "hover" }}; } -body.{{.Option "topic"}} div.carte div.item:hover { background-color:{{.Option "hover" }}; } -body.{{.Option "topic"}} table.content tr:hover { background-color:{{.Option "float" }}; } -body.{{.Option "topic"}} table.content th:hover { background-color:{{.Option "hover" }}; } -body.{{.Option "topic"}} table.content td:hover { background-color:{{.Option "hover" }}; } -body.{{.Option "topic"}} table.content td.select { background-color:{{.Option "hover" }}; } -body.{{.Option "topic"}} fieldset.plugin:hover { box-shadow:12px 12px 12px 6px {{.Option "float" }}; } -body.{{.Option "topic"}} fieldset.story:hover { box-shadow:12px 12px 12px 6px {{.Option "float" }}; } -body.{{.Option "topic"}} fieldset.panel.Header>div.output div:hover { background-color:{{.Option "float" }}; } +body.{{.Option "theme"}} input[type=text]:hover { background-color:{{.Option "float" }}; } +body.{{.Option "theme"}} input[type=button]:hover { background-color:{{.Option "hover" }}; } +body.{{.Option "theme"}} div.item:hover { background-color:{{.Option "float" }}; } +body.{{.Option "theme"}} div.item.select { background-color:{{.Option "float" }}; } +body.{{.Option "theme"}} div.list div.item:hover { background-color:{{.Option "hover" }}; } +body.{{.Option "theme"}} div.list div.item.select { background-color:{{.Option "hover" }}; } +body.{{.Option "theme"}} div.carte div.item:hover { background-color:{{.Option "hover" }}; } +body.{{.Option "theme"}} table.content tr:hover { background-color:{{.Option "float" }}; } +body.{{.Option "theme"}} table.content th:hover { background-color:{{.Option "hover" }}; } +body.{{.Option "theme"}} table.content td:hover { background-color:{{.Option "hover" }}; } +body.{{.Option "theme"}} table.content td.select { background-color:{{.Option "hover" }}; } +body.{{.Option "theme"}} fieldset.plugin:hover { box-shadow:12px 12px 12px 6px {{.Option "float" }}; } +body.{{.Option "theme"}} fieldset.story:hover { box-shadow:12px 12px 12px 6px {{.Option "float" }}; } +body.{{.Option "theme"}} fieldset.panel.Header>div.output div:hover { background-color:{{.Option "float" }}; } ` diff --git a/core/code/xterm.go b/core/code/xterm.go index 8a0e907a..970f94a2 100644 --- a/core/code/xterm.go +++ b/core/code/xterm.go @@ -84,8 +84,8 @@ func init() { m.Push(arg[0], ice.Info.Hostname, path.Base(m.Option(mdb.TYPE))) } }}, - mdb.CREATE: {Name: "create type=sh name text", Hand: func(m *ice.Message, arg ...string) { - mdb.HashCreate(m, mdb.NAME, kit.Split(m.Option(mdb.TYPE))[0], m.OptionSimple(mdb.TYPE, mdb.NAME, mdb.TEXT)) + mdb.CREATE: {Name: "create type=sh name text theme:textarea", Hand: func(m *ice.Message, arg ...string) { + mdb.HashCreate(m, mdb.NAME, kit.Split(m.Option(mdb.TYPE))[0], m.OptionSimple(mdb.TYPE, mdb.NAME, mdb.TEXT, "theme")) }}, "resize": {Hand: func(m *ice.Message, arg ...string) { _xterm_get(m, "").Setsize(m.OptionDefault("rows", "24"), m.OptionDefault("cols", "80")) @@ -108,7 +108,7 @@ func init() { ctx.ProcessHold(m) }}, web.WEBSITE: {Help: "网页", Hand: func(m *ice.Message, arg ...string) { web.ProcessWebsite(m, "", "", m.OptionSimple(mdb.HASH)) }}, - }, mdb.HashAction(mdb.FIELD, "time,hash,type,name,text,view", mdb.TOOLS, FAVOR), ctx.CmdAction(), ctx.ProcessAction()), Hand: func(m *ice.Message, arg ...string) { + }, mdb.HashAction(mdb.FIELD, "time,hash,type,name,text,view,theme", mdb.TOOLS, FAVOR), ctx.CmdAction(), ctx.ProcessAction()), Hand: func(m *ice.Message, arg ...string) { if mdb.HashSelect(m, arg...); len(arg) == 0 { m.PushAction(web.WEBSITE, mdb.REMOVE).Action(mdb.CREATE, mdb.PRUNES) } else {