1
0
mirror of https://shylinux.com/x/icebergs synced 2025-04-25 17:18:05 +08:00

add chat.script

This commit is contained in:
IT 老营长 @云轩领航-创始人 2024-01-21 21:18:17 +08:00
parent 73731c898a
commit c6791d78dc
3 changed files with 9 additions and 9 deletions

View File

@ -37,7 +37,6 @@ func _mdb_select(m *ice.Message, cb Any, key string, value Map, fields []string,
if m.FieldsIsDetail() {
m.Push(ice.FIELDS_DETAIL, value)
} else {
m.Debug("what %v %v", value, val)
m.Push(key, value, fields, val)
}
default:

View File

@ -12,8 +12,7 @@ func init() {
Index.MergeCommands(ice.Commands{
SCRIPT: {Name: "script zone id auto", Help: "脚本化", Icon: "script.png", Actions: ice.MergeActions(ice.Actions{
mdb.INSERT: {Name: "insert zone space index"},
}, mdb.ImportantZoneAction(mdb.FIELDS, "time,id,space,index,play,status"),
), Hand: func(m *ice.Message, arg ...string) {
}, mdb.ImportantZoneAction(mdb.FIELDS, "time,id,space,index,play,status,style")), Hand: func(m *ice.Message, arg ...string) {
if mdb.ZoneSelect(m.Options(mdb.CACHE_LIMIT, "30"), arg...).Display(""); len(arg) == 0 {
m.PushAction(cli.RECORD, mdb.REMOVE).Action(mdb.CREATE, cli.STOP)
} else {

View File

@ -12,19 +12,21 @@ Volcanos(chat.ONACTION, {
enable: function(event, can, msg) { can.runAction(event, mdb.MODIFY, [mdb.STATUS, mdb.ENABLE]) },
disable: function(event, can, msg) { can.runAction(event, mdb.MODIFY, [mdb.STATUS, mdb.DISABLE]) },
stop: function(event, can, msg) { can.misc.sessionStorage(can, SCRIPT_ZONE, ""), can.Update(event) },
play: function(event, can) { can.core.Next(can._msg.Table(), function(value, next, index) {
can.Status(cli.STEP, index), can.user.toastProcess(can, `${value.index} ${value.play} ${index} / ${can._msg.Length()}`)
play: function(event, can) { var begin = new Date().getTime(); can.core.Next(can._msg.Table(), function(value, next, index, list) {
can.Status(cli.STEP, index), can.Status(cli.COST, can.base.Duration((new Date().getTime()-begin)))
can.user.toastProcess(can, `${can.core.Keys(value.space, value.index)} ${value.play} ${index}/${can._msg.Length()}`, "", index*100/list.length)
var tr = can.page.Select(can, can._output, html.TR)[1]; can.onmotion.select(can, tr.parentNode, html.TR, index)
value.status == mdb.DISABLE? next(): can.onaction.preview({}, can, can.request({}, value), next)
}, function() { can.user.toastSuccess(can) }) },
}, function(list) { can.Status(cli.STEP, list.length), can.Status(cli.COST, can.base.Duration((new Date().getTime()-begin))), can.user.toastSuccess(can) }) },
preview: function(event, can, msg, next) {
can.onappend.plugin(can, {space: msg.Option(web.SPACE), index: msg.Option(ctx.INDEX)}, function(sub) { var done = false
can.onappend.plugin(can, {space: msg.Option(web.SPACE), index: msg.Option(ctx.INDEX), style: msg.Option(ctx.STYLE)}, function(sub) { var done = false
function action(skip) { sub.Update(sub.request({}, {_handle: ice.TRUE}), [ctx.ACTION, msg.Option(cli.PLAY)], function(msg) {
sub.onimport._process(sub, msg) || msg.Length() == 0 && msg.Result() == "" || can.onappend._output(sub, msg), next && next() }) }
sub.onimport._process(sub, msg) || msg.Length() == 0 && msg.Result() == "" || can.onappend._output(sub, msg), next && next()
}) }
can.onmotion.delay(can, function() { if (done || sub._auto) { return } done = true, action() }, 300)
sub.onexport.output = function() { if (done) { return } done = true, action(true)
can.page.style(can, sub._output, html.HEIGHT, "", html.MAX_HEIGHT, "")
}, can.onmotion.scrollIntoView(can, sub._target)
}, can.onmotion.delay(can, function() { can.onmotion.scrollIntoView(can, sub._target) }, 300)
})
},
})