1
0
mirror of https://shylinux.com/x/volcanos synced 2025-04-25 08:48:06 +08:00
This commit is contained in:
harveyshao 2023-02-19 19:14:21 +08:00
parent c767b91172
commit 21cc8ee8c5
5 changed files with 8 additions and 5 deletions

View File

@ -192,8 +192,7 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) {
} }
return can.onengine._plugin(event, can, msg, can, cmds, cb) || can.run(event, cmds, cb||function(msg) { if (silent) { return } var _can = can._fields? can.sup: can return can.onengine._plugin(event, can, msg, can, cmds, cb) || can.run(event, cmds, cb||function(msg) { if (silent) { return } var _can = can._fields? can.sup: can
if (_can == (msg._can._fields? msg._can.sup: msg._can) && can.core.CallFunc([_can, chat.ONIMPORT, ice.MSG_PROCESS], {can: _can, msg: msg})) { return } if (_can == (msg._can._fields? msg._can.sup: msg._can) && can.core.CallFunc([_can, chat.ONIMPORT, ice.MSG_PROCESS], {can: _can, msg: msg})) { return }
if (cmds && cmds[0] == ctx.ACTION) { if (msg.Length() == 0 && !msg.Result()) { return can.user.toastSuccess(can, cmds[1]), can.Update() } } if (cmds && cmds[0] == ctx.ACTION) { if (can.base.isIn(cmds[1], mdb.CREATE, mdb.INSERT, mdb.IMPORT, nfs.TRASH) || msg.Length() == 0 && msg.Result() == "") { return can.user.toastSuccess(can, cmds[1]), can.Update() } }
// if (cmds && cmds[0] == ctx.ACTION) { if (can.base.isIn(cmds[1], mdb.CREATE, mdb.INSERT, mdb.IMPORT, nfs.TRASH) || msg.Length() == 0 && msg.Result() == "") { return can.user.toastSuccess(can, cmds[1]), can.Update() } }
can.onappend._output(can, msg, meta.display||msg.Option(ice.MSG_DISPLAY)||meta.feature.display) can.onappend._output(can, msg, meta.display||msg.Option(ice.MSG_DISPLAY)||meta.feature.display)
}) })
}, },
@ -345,6 +344,7 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) {
}, ondblclick: function(event) { if ([mdb.KEY, mdb.HASH, mdb.ID].indexOf(key) > -1) { return } }, ondblclick: function(event) { if ([mdb.KEY, mdb.HASH, mdb.ID].indexOf(key) > -1) { return }
var item = can.core.List(can.Conf([ctx.FEATURE, mdb.INSERT]), function(item) { if (item.name == key) { return item } })[0]||{name: key, value: value} var item = can.core.List(can.Conf([ctx.FEATURE, mdb.INSERT]), function(item) { if (item.name == key) { return item } })[0]||{name: key, value: value}
item.run = function(event, cmds, cb) { can.run(can.request(event, line, can.Option()), cmds, cb, true) } item.run = function(event, cmds, cb) { can.run(can.request(event, line, can.Option()), cmds, cb, true) }
item._enter = function(event, value) { if (event.ctrlKey) { run(event, mdb.MODIFY, [key, value]) } }
can.onmotion.modifys(can, event.target, function(event, value, old) { run(event, mdb.MODIFY, [key, value]) }, item) can.onmotion.modifys(can, event.target, function(event, value, old) { run(event, mdb.MODIFY, [key, value]) }, item)
}} }}
}); table && can.onappend.style(can, chat.CONTENT, table), msg.append && msg.append[msg.append.length-1] == ctx.ACTION && can.onappend.style(can, ctx.ACTION, table) }); table && can.onappend.style(can, chat.CONTENT, table), msg.append && msg.append[msg.append.length-1] == ctx.ACTION && can.onappend.style(can, ctx.ACTION, table)

View File

@ -19,6 +19,7 @@ fieldset.Action.free>div.output>fieldset.plugin { position:absolute; }
fieldset.Action.free>div.output>fieldset.plugin.select { z-index:10; } fieldset.Action.free>div.output>fieldset.plugin.select { z-index:10; }
fieldset.Action.grid>div.output>fieldset.plugin { float:left; } fieldset.Action.grid>div.output>fieldset.plugin { float:left; }
fieldset.Action.free>div.output { overflow:hidden; } fieldset.Action.free>div.output { overflow:hidden; }
fieldset.Action.grid>div.output>fieldset.plugin>form.option { display:none; }
fieldset.Action.grid>div.output>fieldset.plugin>div.action { display:none; } fieldset.Action.grid>div.output>fieldset.plugin>div.action { display:none; }
fieldset.Action.grid>div.output>fieldset.plugin>div.status { display:none; } fieldset.Action.grid>div.output>fieldset.plugin>div.status { display:none; }
fieldset.Action.grid>div.output>fieldset.plugin>form.option input[type=text] { width:80px; } fieldset.Action.grid>div.output>fieldset.plugin>form.option input[type=text] { width:80px; }

View File

@ -87,7 +87,7 @@ Volcanos(chat.ONLAYOUT, {
horizon: function(can) { can.getActionSize(function(height, width) { can.ConfHeight(height), can.ConfWidth(width/2) }) }, horizon: function(can) { can.getActionSize(function(height, width) { can.ConfHeight(height), can.ConfWidth(width/2) }) },
vertical: function(can) { can.getActionSize(function(height, width) { can.ConfHeight(height/2), can.ConfWidth(width) }) }, vertical: function(can) { can.getActionSize(function(height, width) { can.ConfHeight(height/2), can.ConfWidth(width) }) },
grid: function(can) { can.getActionSize(function(height, width) { var m = can.user.isMobile? 1: 2, n = 2 grid: function(can) { can.getActionSize(function(height, width) { var m = can.user.isMobile? 1: 2, n = 2
var h = height/n-4*html.PLUGIN_MARGIN-html.ACTION_HEIGHT, w = width/m-can.Conf(html.MARGIN_X); can.ConfHeight(h), can.ConfWidth(w) var h = height/n-4*html.PLUGIN_MARGIN, w = width/m-can.Conf(html.MARGIN_X); can.ConfHeight(h), can.ConfWidth(w)
}) }, }) },
free: function(can) { can.getActionSize(function(height, width) { can.ConfHeight(height-can.Conf(html.MARGIN_Y)), can.ConfWidth(width-can.Conf(html.MARGIN_Y)) free: function(can) { can.getActionSize(function(height, width) { can.ConfHeight(height-can.Conf(html.MARGIN_Y)), can.ConfWidth(width-can.Conf(html.MARGIN_Y))
can.core.List(can._plugins, function(sub, index, array) { can.onmotion.move(can, sub._target, {left: (width/array.length/8*5+20)*index, top: (height/array.length/8*5)*index}) }), can.onmotion.toggle(can, can._header_tabs, true) can.core.List(can._plugins, function(sub, index, array) { can.onmotion.move(can, sub._target, {left: (width/array.length/8*5+20)*index, top: (height/array.length/8*5)*index}) }), can.onmotion.toggle(can, can._header_tabs, true)

View File

@ -19,7 +19,8 @@ Volcanos(chat.ONFIGURE, {key: {
}) }, }) },
onblur: function(event, can, sub) { sub && can.onmotion.delay(can, sub.close, 300) }, onblur: function(event, can, sub) { sub && can.onmotion.delay(can, sub.close, 300) },
onkeydown: function(event, can, meta, cb, target, sub, last) { onkeydown: function(event, can, meta, cb, target, sub, last) {
if (event.key == lang.ENTER) { return meta._enter && (!can.page.tagis(event.target, html.TEXTAREA) || event.ctrlKey) && meta._enter(event)? sub.close(): last(event) } if (event.key == lang.ENTER) { return meta._enter && (!can.page.tagis(event.target, html.TEXTAREA) || event.ctrlKey) && meta._enter(event, target.value)? sub.close(): last(event) }
if (!sub) { return }
sub.hidden() || can.onkeymap.selectCtrlN(event, can, sub._output, "tr:not(.hidden)>td:first-child", function(td) { return cb(sub, td.innerText, target.value), td }) || can.onmotion.delayOnce(can, function() { sub.hidden() || can.onkeymap.selectCtrlN(event, can, sub._output, "tr:not(.hidden)>td:first-child", function(td) { return cb(sub, td.innerText, target.value), td }) || can.onmotion.delayOnce(can, function() {
can.onkeymap.selectInputs(event, sub, function() { sub._load(event, sub, cb, target, meta.name) }, target) }, target.value.length < 3? 500: 150) can.onkeymap.selectInputs(event, sub, function() { sub._load(event, sub, cb, target, meta.name) }, target) }, target.value.length < 3? 500: 150)
}, },

View File

@ -56,7 +56,7 @@ Volcanos(chat.ONFIGURE, {
}) }}) }) }})
}) }, }) },
}) })
Volcanos(chat.ONACTION, { Volcanos(chat.ONACTION, {list: ["提交", "调试", "首页", "官网", "源码", "百度"],
_daemon: function(event, can, arg) { switch (arg[0]) { _daemon: function(event, can, arg) { switch (arg[0]) {
case web.DREAM: can.runAction({}, arg[0], arg.slice(1), function(msg) { can.onimport.tabview(can, can.Option(nfs.PATH), can.core.Keys(can.misc.Search(can, ice.POD), msg.Option(mdb.NAME)), web.DREAM) }); break case web.DREAM: can.runAction({}, arg[0], arg.slice(1), function(msg) { can.onimport.tabview(can, can.Option(nfs.PATH), can.core.Keys(can.misc.Search(can, ice.POD), msg.Option(mdb.NAME)), web.DREAM) }); break
case code.XTERM: can.runAction({}, arg[0], arg.slice(1), function(msg) { can.onimport.tabview(can, ctx.COMMAND, code.XTERM, msg.Result()) }); break case code.XTERM: can.runAction({}, arg[0], arg.slice(1), function(msg) { can.onimport.tabview(can, ctx.COMMAND, code.XTERM, msg.Result()) }); break
@ -106,6 +106,7 @@ Volcanos(chat.ONACTION, {
}) }, }) },
"调试": function(event, can) { can.user.opens(location.href.replace("debug=true", "debug=false")) }, "调试": function(event, can) { can.user.opens(location.href.replace("debug=true", "debug=false")) },
"首页": function(event, can) { can.user.open(location.origin+(can.misc.Search(can, log.DEBUG) == ice.TRUE? "?debug=true": "")) }, "首页": function(event, can) { can.user.open(location.origin+(can.misc.Search(can, log.DEBUG) == ice.TRUE? "?debug=true": "")) },
"提交": function(event, can) { can.onimport.tabview(can, can.Option(nfs.PATH), "web.code.git.status", ctx.INDEX) },
"官网": function(event, can) { can.user.open("https://contexts.com.cn/") }, "官网": function(event, can) { can.user.open("https://contexts.com.cn/") },
"源码": function(event, can) { can.user.open("https://shylinux.com/") }, "源码": function(event, can) { can.user.open("https://shylinux.com/") },
"百度": function(event, can) { can.user.opens("https://baidu.com/") }, "百度": function(event, can) { can.user.opens("https://baidu.com/") },