1
0
mirror of https://shylinux.com/x/volcanos synced 2025-04-26 01:04:06 +08:00
This commit is contained in:
harveyshao 2022-03-12 19:13:20 +08:00
parent 6189e00f04
commit f995ec046d
2 changed files with 8 additions and 5 deletions

View File

@ -206,7 +206,7 @@ Volcanos("onappend", {help: "渲染引擎", list: [], _init: function(can, meta,
_output0: function(can, meta, event, cmds, cb, silent) { var msg = can.request(event); if (msg.RunAction(event, can, cmds)) { return } _output0: function(can, meta, event, cmds, cb, silent) { var msg = can.request(event); if (msg.RunAction(event, can, cmds)) { return }
if (msg.Option(ice.MSG_HANDLE) != ice.TRUE && cmds && cmds[0] == ctx.ACTION && meta.feature[cmds[1]]) { can.request(event, {action: cmds[1]}) if (msg.Option(ice.MSG_HANDLE) != ice.TRUE && cmds && cmds[0] == ctx.ACTION && meta.feature[cmds[1]]) { can.request(event, {action: cmds[1]})
return can.user.input(event, can, meta.feature[cmds[1]], function(ev, button, data, list, args) { var msg = can.request(event, {_handle: ice.TRUE}, can.Option()) return can.user.input(event, can, meta.feature[cmds[1]], function(ev, button, data, list, args) { var msg = can.request(event, {_handle: ice.TRUE}, can.Option())
can.Update(event, cmds.slice(0, 2).concat(args), function(msg) { can.Update({}, can.Input(), cb) }, true) can.Update(event, cmds.slice(0, 2).concat(args), cb, true)
}) })
} }
@ -308,6 +308,7 @@ Volcanos("onappend", {help: "渲染引擎", list: [], _init: function(can, meta,
node[name] || (node[name] = can.page.Append(can, node[last], [{view: [html.ITEM, html.DIV, value+(index==array.length-1?"":split)], onclick: function(event) { node[name] || (node[name] = can.page.Append(can, node[last], [{view: [html.ITEM, html.DIV, value+(index==array.length-1?"":split)], onclick: function(event) {
index < array.length - 1? can.onmotion.toggle(can, node[name]): can.base.isFunc(cb) && cb(event, item) index < array.length - 1? can.onmotion.toggle(can, node[name]): can.base.isFunc(cb) && cb(event, item)
if (node[name].childElementCount == 2) { node[name].firstChild.click() }
}}, {view: html.LIST, style: {display: html.NONE}, _init: function(list) { item.expand && can.page.style(can, list, html.DISPLAY, html.BLOCK) }}]).last) }}, {view: html.LIST, style: {display: html.NONE}, _init: function(list) { item.expand && can.page.style(can, list, html.DISPLAY, html.BLOCK) }}]).last)
}) })
}); return node }); return node
@ -349,7 +350,7 @@ Volcanos("onappend", {help: "渲染引擎", list: [], _init: function(can, meta,
} }
function run(cmds) { var msg = can.sup.request(event, line, can.Option()) function run(cmds) { var msg = can.sup.request(event, line, can.Option())
return can.run(event, cmds, function(msg) { can.run() }, true) return can.run(event, cmds, null, true)
} }
return {text: [value, html.TD], onclick: function(event) { var target = event.target return {text: [value, html.TD], onclick: function(event) { var target = event.target

View File

@ -41,7 +41,7 @@ Volcanos("onimport", {help: "导入数据", _init: function(can, msg, cb, target
cli.SHOW, function(event) { can.onaction["展示"](event, can) }, cli.SHOW, function(event) { can.onaction["展示"](event, can) },
"加载", function(event) { can.onaction["加载"](event, can), can.user.toastSuccess(can) }, "加载", function(event) { can.onaction["加载"](event, can), can.user.toastSuccess(can) },
mdb.PLUGIN, function(event) { mdb.PLUGIN, function(event) {
can.user.input(event, can, [ctx.INDEX], function(event, button, data) { can.user.input(event, can, [ctx.INDEX, ctx.ARGS], function(event, button, data) {
can.onimport.plugin(can, data, ui.output) can.onimport.plugin(can, data, ui.output)
}) })
}, },
@ -62,7 +62,7 @@ Volcanos("onimport", {help: "导入数据", _init: function(can, msg, cb, target
cli.CLEAR, function(event) { can.onmotion.clear(can, ui.output) }, cli.CLEAR, function(event) { can.onmotion.clear(can, ui.output) },
cli.EXEC, function(event) { can.onaction["执行"](event, can) }, cli.EXEC, function(event) { can.onaction["执行"](event, can) },
mdb.PLUGIN, function(event) { mdb.PLUGIN, function(event) {
can.user.input(event, can, [ctx.INDEX], function(event, button, data) { can.user.input(event, can, [ctx.INDEX, ctx.ARGS], function(event, button, data) {
can.onimport.plugin(can, data, ui.output) can.onimport.plugin(can, data, ui.output)
}) })
}, },
@ -465,7 +465,9 @@ Volcanos("onaction", {help: "控件交互", list: ["搜索", "打开", "添加",
selectLine: function(event, can, line) { if (!line) { return parseInt(can.core.Value(can.page.Select(can, can.ui.content, [[[html.TR, html.SELECT], [html.TD, "line"]]])[0], "innerText")) } selectLine: function(event, can, line) { if (!line) { return parseInt(can.core.Value(can.page.Select(can, can.ui.content, [[[html.TR, html.SELECT], [html.TD, "line"]]])[0], "innerText")) }
can.page.Select(can, can.ui.content, html.TR, function(item, index, array) { if (line < 0 || line > array.length) { return } can.page.Select(can, can.ui.content, html.TR, function(item, index, array) { if (line < 0 || line > array.length) { return }
if (!can.page.ClassList.set(can, item, html.SELECT, item == line || index+1 == line)) { return } if (!can.page.ClassList.set(can, item, html.SELECT, item == line || index+1 == line)) { return }
line = item, can.Status(kit.Dict("文件名", can.file, "解析器", can.parse, "当前行", can.onexport.position(can, can.Option(nfs.LINE, index+1)))) var ls = can.file.split(ice.PS)
if (ls.length > 4) { ls = [ls.slice(0, 2).join(ice.PS)+"/.../"+ls.slice(-2).join(ice.PS)] }
line = item, can.Status(kit.Dict("文件名", ls.join(ice.PS), "解析器", can.parse, "当前行", can.onexport.position(can, can.Option(nfs.LINE, index+1))))
}) })
can.base.isObject(line) && can.page.Select(can, line, "td.text", function(item) { can.base.isObject(line) && can.page.Select(can, line, "td.text", function(item) {