mirror of
https://shylinux.com/x/icebergs
synced 2025-04-26 01:24:05 +08:00
opt some
This commit is contained in:
parent
119661a12e
commit
3a994cf287
@ -1,6 +1,9 @@
|
||||
package mdb
|
||||
|
||||
import ice "shylinux.com/x/icebergs"
|
||||
import (
|
||||
ice "shylinux.com/x/icebergs"
|
||||
kit "shylinux.com/x/toolkits"
|
||||
)
|
||||
|
||||
const SEARCH = "search"
|
||||
|
||||
@ -13,3 +16,11 @@ func init() {
|
||||
return nil
|
||||
})
|
||||
}
|
||||
func IsSearchForEach(m *ice.Message, arg []string, cb func() []string) bool {
|
||||
if arg[0] == FOREACH && arg[1] == "" {
|
||||
args := cb()
|
||||
m.PushSearch(TYPE, kit.Select("", args, 0), NAME, kit.Select("", args, 1), TEXT, kit.Select("", args, 2))
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
|
@ -152,10 +152,11 @@ const (
|
||||
VIEW = "view"
|
||||
CHAT = "chat"
|
||||
|
||||
CODE_VIMER = "web.code.vimer"
|
||||
WIKI_WORD = "web.wiki.word"
|
||||
WIKI_DRAW = "web.wiki.draw"
|
||||
CODE_INNER = "web.code.inner"
|
||||
CODE_VIMER = "web.code.vimer"
|
||||
CODE_XTERM = "web.code.xterm"
|
||||
CHAT_FAVOR = "web.chat.favor"
|
||||
CHAT_IFRAME = "web.chat.iframe"
|
||||
WIKI_WORD = "web.wiki.word"
|
||||
)
|
||||
|
@ -13,19 +13,29 @@ const IFRAME = "iframe"
|
||||
func init() {
|
||||
Index.MergeCommands(ice.Commands{
|
||||
IFRAME: {Name: "iframe hash auto", Help: "浏览器", Actions: ice.MergeActions(ice.Actions{
|
||||
mdb.INPUTS: {Hand: func(m *ice.Message, arg ...string) {
|
||||
switch mdb.HashInputs(m, arg); arg[0] {
|
||||
case mdb.NAME:
|
||||
m.Push(arg[0], web.UserWeb(m).Host)
|
||||
case mdb.LINK:
|
||||
m.Push(arg[0], m.Option(ice.MSG_USERWEB))
|
||||
m.Copy(m.Cmd(web.SPIDE).CutTo("client.url", arg[0]))
|
||||
}
|
||||
}},
|
||||
FAVOR_INPUTS: {Hand: func(m *ice.Message, arg ...string) {
|
||||
switch arg[0] {
|
||||
case mdb.TYPE:
|
||||
m.Push(arg[0], web.LINK)
|
||||
default:
|
||||
if m.Option(mdb.TYPE) != web.LINK {
|
||||
if m.Option(mdb.TYPE) != "" && m.Option(mdb.TYPE) != web.LINK {
|
||||
return
|
||||
}
|
||||
switch arg[0] {
|
||||
case mdb.NAME:
|
||||
m.Push(arg[0], web.UserWeb(m).Host)
|
||||
case mdb.TEXT:
|
||||
case mdb.LINK:
|
||||
m.Push(arg[0], m.Option(ice.MSG_USERWEB))
|
||||
m.Copy(m.Cmd(web.SPIDE).CutTo("client.url", arg[0]))
|
||||
}
|
||||
}
|
||||
}},
|
||||
|
Loading…
x
Reference in New Issue
Block a user