1
0
mirror of https://shylinux.com/x/volcanos synced 2025-04-25 16:58:06 +08:00

opt action

This commit is contained in:
harveyshao 2022-03-27 15:32:09 +08:00
parent ce214722c7
commit fbfac0fe6c
7 changed files with 23 additions and 9 deletions

View File

@ -257,7 +257,7 @@ Volcanos("onappend", {help: "渲染引擎", list: [], _init: function(can, meta,
!silent && can.onappend._output(can, msg, msg.Option(ice.MSG_DISPLAY)||meta.display||meta.feature.display) !silent && can.onappend._output(can, msg, msg.Option(ice.MSG_DISPLAY)||meta.display||meta.feature.display)
}) })
}, },
_output: function(can, msg, display, output, action) { display = display||chat.PLUGIN_TABLE_JS, output = output||can._output _output: function(can, msg, display, output, action, cb) { display = display||chat.PLUGIN_TABLE_JS, output = output||can._output
Volcanos(display, {_follow: can.core.Keys(can._follow, display), _display: display, _target: output, _fields: can._target, Volcanos(display, {_follow: can.core.Keys(can._follow, display), _display: display, _target: output, _fields: can._target,
_option: can._option, _action: can._action, _output: can._output, _status: can._status, _legend: can._legend, _inputs: {}, _option: can._option, _action: can._action, _output: can._output, _status: can._status, _legend: can._legend, _inputs: {},
Update: can.Update, Option: can.Option, Action: can.Action, Status: can.Status, Update: can.Update, Option: can.Option, Action: can.Action, Status: can.Status,
@ -275,7 +275,8 @@ Volcanos("onappend", {help: "渲染引擎", list: [], _init: function(can, meta,
can.core.CallFunc([table, chat.ONIMPORT, "_init"], {can: table, msg: msg, list: msg.result||msg.append||[], cb: function(msg) { can.core.CallFunc([table, chat.ONIMPORT, "_init"], {can: table, msg: msg, list: msg.result||msg.append||[], cb: function(msg) {
action === false || table.onappend._action(table, msg.Option(ice.MSG_ACTION)||can.Conf(ice.MSG_ACTION), action) action === false || table.onappend._action(table, msg.Option(ice.MSG_ACTION)||can.Conf(ice.MSG_ACTION), action)
action === false || table.onappend._status(table, msg.Option(ice.MSG_STATUS)) action === false || table.onappend._status(table, msg.Option(ice.MSG_STATUS))
}, target: output}) can.base.isFunc(cb) && cb(msg)
}, target: output||can._output})
}) })
}, },
_status: function(can, list, status) { status = status||can._status, can.onmotion.clear(can, status) _status: function(can, list, status) { status = status||can._status, can.onmotion.clear(can, status)
@ -361,8 +362,9 @@ Volcanos("onappend", {help: "渲染引擎", list: [], _init: function(can, meta,
item.type == html.TEXT && can.onkeymap.input(event, can), can.onmotion.selectField(event, can) item.type == html.TEXT && can.onkeymap.input(event, can), can.onmotion.selectField(event, can)
}, list: [input]}]).concat(br))[item.name] }, list: [input]}]).concat(br))[item.name]
}, },
table: function(can, msg, cb, target, sort) { table: function(can, msg, cb, target, sort) { var isaction = false
var table = can.page.AppendTable(can, msg, target||can._output, msg.append, cb||function(value, key, index, line, array) { var table = can.page.AppendTable(can, msg, target||can._output, msg.append, cb||function(value, key, index, line, array) {
if (key == "action") { isaction = true }
if (msg.append.length == 2 && msg.append[0] == mdb.KEY && msg.append[1] == mdb.VALUE) { if (msg.append.length == 2 && msg.append[0] == mdb.KEY && msg.append[1] == mdb.VALUE) {
if (key == mdb.VALUE) { key = line.key } if (key == mdb.VALUE) { key = line.key }
line = {}, can.core.List(array, function(item) { line[item.key] = item.value }) line = {}, can.core.List(array, function(item) { line[item.key] = item.value })
@ -399,6 +401,7 @@ Volcanos("onappend", {help: "渲染引擎", list: [], _init: function(can, meta,
can.onmotion.modifys(can, event.target, function(event, value, old) { run([ctx.ACTION, mdb.MODIFY, key, value]) }, item) can.onmotion.modifys(can, event.target, function(event, value, old) { run([ctx.ACTION, mdb.MODIFY, key, value]) }, item)
}} }}
}); table && can.page.Modify(can, table, {className: chat.CONTENT}) }); table && can.page.Modify(can, table, {className: chat.CONTENT})
if (isaction) { can.page.ClassList.add(can, table, "action") }
return sort && can.page.RangeTable(can, table, sort), table return sort && can.page.RangeTable(can, table, sort), table
}, },
board: function(can, text, target) { text && text.Result && (text = text.Result()); if (!text) { return } board: function(can, text, target) { text && text.Result && (text = text.Result()); if (!text) { return }

View File

@ -28,6 +28,11 @@ table.content tr { background-color:#04272f45; }
table.content tr.show { background-color:red; } table.content tr.show { background-color:red; }
table.content th { background-color:#0fbd45; padding:2px 6px; } table.content th { background-color:#0fbd45; padding:2px 6px; }
table.content td { padding:2px 6px; max-width:800px; } table.content td { padding:2px 6px; max-width:800px; }
table.content.action td:last-child, table.content.action th:last-child {
background-color:#7dc6d7eb;
position:sticky;
right:0;
}
td>input[type=button][name=create] { background-color:blue; } td>input[type=button][name=create] { background-color:blue; }
td>input[type=button][name=remove] { background-color:red; } td>input[type=button][name=remove] { background-color:red; }
@ -36,7 +41,7 @@ td>input[type=button][name=stop] { background-color:red; }
div.tabs { background-color:#00000038; color:white; padding:5px; margin:0 1px; } div.tabs { background-color:#00000038; color:white; padding:5px; margin:0 1px; }
div.code { background-color:#343a3445; color:white; padding:10px; border:solid 3px green; } div.code { background-color:#343a3445; color:white; padding:10px; border:solid 3px green; }
div.story[data-type=spark] { background-color:#2169a9a6; color:white; padding:4px 10px; border-left:solid 4px blue; margin:10px 0px; } div.story[data-type=spark] { background-color:#2169a9a6; color:white; padding:4px 10px; border-left:solid 4px blue; margin:10px; }
form.option>div.item { margin-right:3px; } form.option>div.item { margin-right:3px; }
form.option>div.item.select { background-color:#0000; } form.option>div.item.select { background-color:#0000; }

View File

@ -58,6 +58,7 @@ Volcanos("onimport", {help: "导入数据", list: [], _init: function(can, msg)
opts: can.misc.Search(can), opts: can.misc.Search(can),
}) })
can.onappend.plugin(can, item, function(sub, meta, skip) { can.onappend.plugin(can, item, function(sub, meta, skip) {
can.page.style(can, sub._output, html.MAX_WIDTH, window.innerWidth)
can.user.title(meta.name), skip || next() can.user.title(meta.name), skip || next()
}) })
}, },

View File

@ -170,7 +170,9 @@ Volcanos("onimport", {help: "导入数据", _init: function(can, msg, cb, target
}) })
}) })
} else if (msg.Option(ice.MSG_DISPLAY) != "") { } else if (msg.Option(ice.MSG_DISPLAY) != "") {
can.onappend._output(can, msg, msg.Option(ice.MSG_DISPLAY), target, false) can.onappend._output(can, msg, msg.Option(ice.MSG_DISPLAY), target, false, function(msg) {
can.onimport.layout(can)
})
} else { } else {
can.onappend.table(can, msg, null, target) can.onappend.table(can, msg, null, target)
can.onappend.board(can, msg, target) can.onappend.board(can, msg, target)
@ -189,6 +191,7 @@ Volcanos("onimport", {help: "导入数据", _init: function(can, msg, cb, target
can.page.styleWidth(can, can.ui.profile_output, can.profile_size[can.onexport.keys(can)]||(width-can.ui.project.offsetWidth)/2) can.page.styleWidth(can, can.ui.profile_output, can.profile_size[can.onexport.keys(can)]||(width-can.ui.project.offsetWidth)/2)
can.page.styleWidth(can, can.ui.content, width-can.ui.project.offsetWidth-can.ui.profile.offsetWidth) can.page.styleWidth(can, can.ui.content, width-can.ui.project.offsetWidth-can.ui.profile.offsetWidth)
can.page.styleWidth(can, can.ui.display, width-can.ui.project.offsetWidth)
if (!height) { return } if (!height) { return }
can.page.style(can, can.ui.content, can.user.mod.isCmd? html.HEIGHT: html.MAX_HEIGHT, height) can.page.style(can, can.ui.content, can.user.mod.isCmd? html.HEIGHT: html.MAX_HEIGHT, height)

View File

@ -3,7 +3,7 @@ Volcanos("onimport", {help: "导入数据", list: [], _init: function(can, msg,
can.ui = can.onlayout.profile(can) can.ui = can.onlayout.profile(can)
can.onmotion.hidden(can, can._action) can.onmotion.hidden(can, can._action)
can.onimport[can.Option("scale")||"week"](can, msg) can.onimport[can.Option("scale")||"week"](can, msg)
can.page.Modify(can, can._output, {style: {"min-height": 452}}) // can.page.Modify(can, can._output, {style: {"min-height": 452}})
can.page.Modify(can, can.ui.project, {style: {"max-height": can.ui.content.offsetHeight}}) can.page.Modify(can, can.ui.project, {style: {"max-height": can.ui.content.offsetHeight}})
can.page.Modify(can, can.ui.profile, {style: {"max-height": can.ui.content.offsetHeight}}) can.page.Modify(can, can.ui.profile, {style: {"max-height": can.ui.content.offsetHeight}})
can.page.Modify(can, can.ui.profile, {style: {display: "block"}}) can.page.Modify(can, can.ui.profile, {style: {display: "block"}})

View File

@ -6,6 +6,7 @@ Volcanos("onimport", {help: "导入数据", _init: function(can, msg, cb, target
can.page.Select(can, target, wiki.ITEM, function(item) { var data = item.dataset||{} can.page.Select(can, target, wiki.ITEM, function(item) { var data = item.dataset||{}
can.core.CallFunc([can.onimport, data.type], [can, data, item]) can.core.CallFunc([can.onimport, data.type], [can, data, item])
can.page.Modify(can, item, {style: can.base.Obj(data.style)}) can.page.Modify(can, item, {style: can.base.Obj(data.style)})
can.page.style(can, item, html.MAX_WIDTH, can.ConfWidth()-(can.user.isWindows? 40: 30))
}) })
}, },
navmenu: function(can, data, target) { var nav = can.sup._navmenu navmenu: function(can, data, target) { var nav = can.sup._navmenu
@ -105,6 +106,7 @@ Volcanos("onimport", {help: "导入数据", _init: function(can, msg, cb, target
} }
sub.ConfHeight(can.ConfHeight()) sub.ConfHeight(can.ConfHeight())
sub.ConfWidth(item.width = (width||can.ConfWidth())-(can.user.isWindows? 40: 20)) sub.ConfWidth(item.width = (width||can.ConfWidth())-(can.user.isWindows? 40: 20))
can.page.style(can, sub._output, html.MAX_WIDTH, sub.ConfWidth())
can.core.Value(item, "auto.cmd") && can.core.Timer300ms(function() { can.core.Value(item, "auto.cmd") && can.core.Timer300ms(function() {
var msg = sub.request({}, can.core.Value(item, "opts")); msg.Option(ice.MSG_HANDLE, ice.TRUE) var msg = sub.request({}, can.core.Value(item, "opts")); msg.Option(ice.MSG_HANDLE, ice.TRUE)

View File

@ -1,7 +1,7 @@
Volcanos("onimport", {help: "导入数据", list: [], _init: function(can, msg, cb, target) { Volcanos("onimport", {help: "导入数据", list: [], _init: function(can, msg, cb, target) {
can.onmotion.clear(can) can.onmotion.clear(can, target)
can.onappend.table(can, msg) can.onappend.table(can, msg, null, target)
can.onappend.board(can, msg) can.onappend.board(can, msg, target)
can.onmotion.story.auto(can) can.onmotion.story.auto(can)
can.base.isFunc(cb) && cb(msg) can.base.isFunc(cb) && cb(msg)
}, },