mirror of
https://shylinux.com/x/icebergs
synced 2025-04-26 09:34:05 +08:00
opt wiki
This commit is contained in:
parent
8f273b15c0
commit
9463b2a845
@ -38,11 +38,9 @@ func _field_show(m *ice.Message, name, text string, arg ...string) {
|
||||
if len(meta) == 0 || !aaa.Right(m.Spawn(), cmds[0]) {
|
||||
return
|
||||
}
|
||||
|
||||
name = strings.ReplaceAll(name, ice.SP, "_")
|
||||
meta[mdb.NAME], meta[mdb.INDEX] = name, text
|
||||
msg := m.Spawn()
|
||||
|
||||
for i := 0; i < len(arg)-1; i += 2 {
|
||||
if strings.HasPrefix(arg[i], ARGS) {
|
||||
kit.Value(meta, arg[i], m.Optionv(arg[i], kit.Split(strings.TrimSuffix(strings.TrimPrefix(arg[i+1], "["), "]"))))
|
||||
|
@ -25,7 +25,6 @@ func init() {
|
||||
if len(arg) < 2 {
|
||||
return
|
||||
}
|
||||
|
||||
if arg[1] = strings.TrimSpace(arg[1]); arg[0] == ice.AUTO {
|
||||
if strings.HasPrefix(arg[1], "{") || strings.HasPrefix(arg[1], "[") {
|
||||
arg[0] = nfs.JSON
|
||||
@ -39,7 +38,6 @@ func init() {
|
||||
arg[0] = mdb.LIST
|
||||
}
|
||||
}
|
||||
|
||||
switch m.OptionFields(mdb.DETAIL); arg[0] {
|
||||
case "base64":
|
||||
if buf, err := base64.StdEncoding.DecodeString(arg[1]); err == nil {
|
||||
|
@ -13,15 +13,12 @@ func _spark_show(m *ice.Message, name, text string, arg ...string) *ice.Message
|
||||
if _option(m, m.CommandKey(), name, text, arg...); name == "" {
|
||||
return _wiki_template(m, name, text, arg...)
|
||||
}
|
||||
|
||||
m.Echo(`<div class="story" data-type="spark" data-name="%s" style="%s">`, name, m.Option("style"))
|
||||
defer m.Echo("</div>")
|
||||
|
||||
switch name {
|
||||
case "inner", FIELD:
|
||||
return m.Echo(text)
|
||||
}
|
||||
|
||||
prompt := kit.Select(name+"> ", m.Config(kit.Keys(ssh.PROMPT, name)))
|
||||
for _, l := range kit.SplitLine(text) {
|
||||
m.Echo(Format("div", Format("label", prompt), Format("span", l)))
|
||||
|
Loading…
x
Reference in New Issue
Block a user