mirror of
https://shylinux.com/x/volcanos
synced 2025-04-25 16:58:06 +08:00
opt some
This commit is contained in:
parent
40eba0d9ad
commit
2bf0381d86
18
frame.js
18
frame.js
@ -1,4 +1,4 @@
|
|||||||
Volcanos(chat.ONENGINE, {help: "搜索引擎", _init: function(can, meta, list, cb, target) {
|
Volcanos(chat.ONENGINE, {_init: function(can, meta, list, cb, target) {
|
||||||
if (can.misc.Search(can, ice.MSG_SESSID)) { can.misc.CookieSessid(can, can.misc.Search(can, ice.MSG_SESSID))
|
if (can.misc.Search(can, ice.MSG_SESSID)) { can.misc.CookieSessid(can, can.misc.Search(can, ice.MSG_SESSID))
|
||||||
return can.misc.Search(can, ice.MSG_SESSID, "")
|
return can.misc.Search(can, ice.MSG_SESSID, "")
|
||||||
}
|
}
|
||||||
@ -23,21 +23,9 @@ Volcanos(chat.ONENGINE, {help: "搜索引擎", _init: function(can, meta, list,
|
|||||||
}, target)
|
}, target)
|
||||||
}, function() { can.misc.Log(can.user.title(), ice.RUN, can)
|
}, function() { can.misc.Log(can.user.title(), ice.RUN, can)
|
||||||
can.onmotion._init(can, target), can.onkeymap._init(can)
|
can.onmotion._init(can, target), can.onkeymap._init(can)
|
||||||
|
can.onengine.listen(can, chat.ONSEARCH, function(msg, word) { word[0] == ctx.COMMAND && can.run(msg._event, ["can.command"]) })
|
||||||
can.onengine.signal(can, chat.ONMAIN, can.request()), can.base.isFunc(cb) && cb()
|
can.onengine.signal(can, chat.ONMAIN, can.request()), can.base.isFunc(cb) && cb()
|
||||||
})
|
})
|
||||||
|
|
||||||
can.onengine.listen(can, chat.ONSEARCH, function(msg, word) { if (word[0] == ctx.COMMAND || word[1] != "") { var meta = can.onengine.plugin.meta
|
|
||||||
var list = word[1] == ""? meta: meta[word[1]]? kit.Dict(word[1], meta[word[1]]): {}
|
|
||||||
can.core.Item(list, function(name, command) { name = can.base.trimPrefix(name, "can.")
|
|
||||||
can.core.List(msg.Option(ice.MSG_FIELDS).split(ice.FS), function(item) {
|
|
||||||
msg.Push(item, kit.Dict(ice.CTX, chat.ONENGINE, ice.CMD, ctx.COMMAND,
|
|
||||||
mdb.TYPE, ice.CAN, mdb.NAME, name, mdb.TEXT, command.help,
|
|
||||||
ctx.CONTEXT, ice.CAN, ctx.COMMAND, name,
|
|
||||||
ctx.INDEX, can.core.Keys(ice.CAN, name),
|
|
||||||
)[item]||"")
|
|
||||||
})
|
|
||||||
})
|
|
||||||
} })
|
|
||||||
},
|
},
|
||||||
_search: function(event, can, msg, panel, cmds, cb) {
|
_search: function(event, can, msg, panel, cmds, cb) {
|
||||||
var sub, mod = can, fun = can, key = ""; can.core.List(cmds[1].split(ice.PT), function(value) {
|
var sub, mod = can, fun = can, key = ""; can.core.List(cmds[1].split(ice.PT), function(value) {
|
||||||
@ -98,7 +86,7 @@ Volcanos(chat.ONENGINE, {help: "搜索引擎", _init: function(can, meta, list,
|
|||||||
return can.core.List(can.onengine.listen.meta[name], function(cb) { can.core.CallFunc(cb, {event: msg._event, msg: msg}) }).length
|
return can.core.List(can.onengine.listen.meta[name], function(cb) { can.core.CallFunc(cb, {event: msg._event, msg: msg}) }).length
|
||||||
}),
|
}),
|
||||||
})
|
})
|
||||||
Volcanos(chat.ONDAEMON, {help: "推荐引擎", _init: function(can, name) { if (can.user.isLocalFile) { return }
|
Volcanos(chat.ONDAEMON, {_init: function(can, name) { if (can.user.isLocalFile) { return }
|
||||||
can.misc.WSS(can, {type: html.CHROME, name: can.misc.Search(can, cli.DAEMON)||name||"", text: can.user.title()}, function(event, msg, cmd, arg) { if (!msg) { return }
|
can.misc.WSS(can, {type: html.CHROME, name: can.misc.Search(can, cli.DAEMON)||name||"", text: can.user.title()}, function(event, msg, cmd, arg) { if (!msg) { return }
|
||||||
var sub = can.ondaemon._list[msg.Option(ice.MSG_TARGET)]
|
var sub = can.ondaemon._list[msg.Option(ice.MSG_TARGET)]
|
||||||
can.base.isFunc(can.ondaemon[cmd])? can.core.CallFunc(can.ondaemon[cmd], {
|
can.base.isFunc(can.ondaemon[cmd])? can.core.CallFunc(can.ondaemon[cmd], {
|
||||||
|
@ -230,6 +230,15 @@ Volcanos(chat.ONENGINE, {_engine: function(event, sup, msg, can, cmds, cb) {
|
|||||||
}), can.base.isFunc(cb) && cb(msg) } return true
|
}), can.base.isFunc(cb) && cb(msg) } return true
|
||||||
}})
|
}})
|
||||||
Volcanos(chat.ONPLUGIN, {
|
Volcanos(chat.ONPLUGIN, {
|
||||||
|
"command": shy("插件列表", {}, [], function(can, msg, arg) {
|
||||||
|
var meta = can.onengine.plugin.meta
|
||||||
|
can.core.Item(word[1] == ""? meta: meta[word[1]]? kit.Dict(word[1], meta[word[1]]): {}, function(name, command) {
|
||||||
|
msg.Push(kit.Dict(ice.CTX, ice.CAN, ice.CMD, ctx.COMMAND,
|
||||||
|
mdb.TYPE, ice.CAN, mdb.NAME, name, mdb.TEXT, command.help,
|
||||||
|
ctx.CONTEXT, ice.CAN, ctx.COMMAND, name, ctx.INDEX, can.core.Keys(ice.CAN, name),
|
||||||
|
), msg.Option(ice.MSG_FIELDS).split(ice.FS))
|
||||||
|
})
|
||||||
|
}),
|
||||||
"plugin": shy("默认插件", {}, ["name", "list", "back"]),
|
"plugin": shy("默认插件", {}, ["name", "list", "back"]),
|
||||||
"parse": shy("生成网页", {
|
"parse": shy("生成网页", {
|
||||||
"show": function(can, msg, cmds) { var name = cmds[1]||"can"; can.isCmdMode() && can.user.title(name)
|
"show": function(can, msg, cmds) { var name = cmds[1]||"can"; can.isCmdMode() && can.user.title(name)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user