1
0
mirror of https://shylinux.com/x/volcanos synced 2025-04-25 16:58:06 +08:00
This commit is contained in:
harveyshao 2022-11-22 00:07:34 +08:00
parent cb05b4edf3
commit 050490cb8b
6 changed files with 25 additions and 21 deletions

View File

@ -55,7 +55,7 @@ Volcanos("user", {info: {}, agent: {
html.PLUGIN, "插件", html.LABEL, "标签", html.HEIGHT, "高度", html.WIDTH, "宽度", ice.SHOW, "显示", ice.HIDE, "隐藏", chat.PROJECT, "项目", chat.PROFILE, "详情", chat.ACTIONS, "参数",
ctx.ACTION, "操作", ice.RUN, "执行", ice.LIST, "查看", ice.BACK, "返回", mdb.PREV, "上一页", mdb.NEXT, "下一页", mdb.LINK, "链接",
nfs.COPY, "复制", nfs.EDIT, "编辑", nfs.SAVE, "保存", nfs.TRASH, "删除", nfs.SOURCE, "源码", nfs.MODULE, "模块", nfs.RECENT, "最近",
cli.OPEN, "打开", cli.CLOSE, "关闭", cli.START, "启动", cli.STOP, "停止", cli.BEGIN, "开始", cli.END, "结束", cli.EXEC, "执行", cli.DONE, "完成",
cli.BEGIN, "开始", cli.START, "启动", cli.OPEN, "打开", cli.CLOSE, "关闭", cli.STOP, "停止", cli.END, "结束", cli.EXEC, "执行", cli.DONE, "完成", cli.RESTART, "重启",
web.CLEAR, "清空", web.REFRESH, "刷新", web.SUBMIT, "提交", web.CANCEL, "取消", web.UPLOAD, "上传", web.DOWNLOAD, "下载", web.TOIMAGE, "截图", web.SHARE, "共享",
"Close", "关闭", "Close others", "关闭其它", "Close all", "关闭所有",
chat.IFRAME, "浏览", chat.LOCATION, "地图",

View File

@ -16,6 +16,7 @@ input[name=offend] { width:48px; }
input[name=id] { width:48px; }
input[name=ID] { width:48px; }
input[type=button] { background-color:black; color:cyan; border:0; margin:0 2px; }
input[type=button][name=restart] { background-color:blue; }
input[type=button][name=start] { background-color:blue; }
input[type=button][name=open] { background-color:blue; }
input[type=button][name=stop] { background-color:red; }

View File

@ -85,7 +85,7 @@ Volcanos(chat.ONIMPORT, {
can._tab = msg._tab = event.target, show(true)
}, function(item) { can.onengine.signal(can, "tabview.view.delete", msg)
delete(can.tabview[key]), delete(can._cache_data[key]), delete(can.ui._content._cache[key])
delete(can.ui._profile_output._cache[key]), delete(can.ui.display_output._cache[key])
delete(can.ui._profile_output._cache[key]), delete(can.ui.display._cache[key])
msg._content != can.ui._content && can.page.Remove(can, msg._content)
}, can.ui._tabs)
}
@ -123,7 +123,7 @@ Volcanos(chat.ONSYNTAX, {_init: function(can, msg, cb) {
can.page.style(can, can.ui.display, html.DISPLAY, p? p.display_display: html.NONE)
can.parse = can.base.Ext(can.file), can.Status("模式", "plugin")
return can.file
}, can.ui._content, can.ui._profile_output, can.ui.display_output)) {
}, can.ui._content, can.ui._profile_output, can.ui.display)) {
return can.base.isFunc(cb) && cb(msg._content)
}
@ -278,14 +278,6 @@ Volcanos(chat.ONIMPORT, {
)); can.ui.profile_output = ui.output
},
_display: function(can, target) {
var ui = can.onimport._panel(can, target, kit.Dict(
ice.SHOW, function(event) { can.onaction[ice.EXEC](event, can) },
html.HEIGHT, function(event) {
can.user.input(event, can, [{name: html.HEIGHT, value: can.display_size[can.onexport.keys(can)]*100/can.ConfHeight()||50}], function(list) {
can.display_size[can.onexport.keys(can)] = can.ConfHeight()*parseInt(list[0])/100, can.onaction[ice.EXEC](event, can)
})
}
)); can.ui.display_output = ui.output, can.ui.display_status = ui.status
},
profile: function(can, msg) { var sup = can.tabview[can.onexport.keys(can)]
if (msg.Result().indexOf("<iframe") > -1) { if (sup._profile_output != can.ui._profile_output) { can.page.Remove(can, sup._profile_output) }
@ -305,17 +297,20 @@ Volcanos(chat.ONIMPORT, {
},
display: function(can, msg) {
var height = can.display_size[can.onexport.keys(can)]||can.ConfHeight()/2
can.onimport.process(can, msg, can.ui.display_output, height, can.ui.display.offsetWidth, function(sub) {
can.display_size[can.onexport.keys(can)] = can.base.Max(sub._output.offsetHeight, can.ConfHeight()/2)+2*html.ACTION_HEIGHT+sub.onexport.statusHeight(sub)
can.onimport.process(can, msg, can.ui.display, height, can.ui.display.offsetWidth, function(sub) {
can.page.style(can, sub._output, html.HEIGHT, ""), can.onmotion.delay(can, function() {
can.display_size[can.onexport.keys(can)] = can.base.Max(sub._output.offsetHeight, can.ConfHeight()/2)+html.ACTION_HEIGHT+sub.onexport.statusHeight(sub)
can.page.style(can, sub._output, html.MAX_HEIGHT, can.display_size[can.onexport.keys(can)])
can.onimport.layout(can)
}), sub.onaction.close = function() { can.onmotion.hidden(can, can.ui.display), can.onimport.layout(can) }
})
can.onappend._status(can, msg.Option(ice.MSG_STATUS), can.ui.display_status)
can.onmotion.toggle(can, can.ui.display, true), can.onimport.layout(can)
},
process: function(can, msg, target, height, width, cb) { can.onmotion.clear(can, target), can.user.toastSuccess(can)
if (msg.Option(ice.MSG_PROCESS) == "_field") {
msg.Table(function(item) { item.display = msg.Option(ice.MSG_DISPLAY), item.height = height-3*html.ACTION_HEIGHT
can.onimport.plug(can, item, function(sub) { sub.onaction._output = function(_sub, _msg) { can.base.isFunc(cb) && cb(_sub, _msg) }
can.onimport.plug(can, item, function(sub) {
sub.onaction._output = function(_sub, _msg) { can.base.isFunc(cb) && cb(_sub, _msg) }
sub.onaction.close = function() { can.onmotion.hidden(can, target.parentNode), can.onimport.layout(can) }
height && sub.ConfHeight(height-3*html.ACTION_HEIGHT), width && sub.ConfWidth(width), sub.Focus()
}, target)
@ -466,15 +461,15 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb, target) {
var content_width = width-project_width-profile_width
can.page.styleWidth(can, can.ui.content, content_width)
can.page.styleWidth(can, can.ui.profile_output, profile_width)
can.page.styleWidth(can, can.ui.display_output, width-project_width)
can.page.styleWidth(can, can.ui.display, width-project_width)
var height = can.user.isMobile && can.isFloatMode()? can.page.height()-2*html.ACTION_HEIGHT: can.base.Min(can.ConfHeight(), 320)-1
can.user.isMobile && can.isCmdMode() && can.page.style(can, can._output, html.MAX_HEIGHT, height)
var display_height = can.ui.display.style.display == html.NONE? 0: (can.display_size[can.onexport.keys(can)]||height/2-html.ACTION_HEIGHT)
var display_height = can.ui.display.style.display == html.NONE? 0: (can.display_size[can.onexport.keys(can)]||html.ACTION_HEIGHT)
var content_height = height-display_height; if (can.isCmdMode()) { content_height -= can.ui._tabs.offsetHeight + can.ui._path.offsetHeight + 4 }
var profile_height = height-html.ACTION_HEIGHT-display_height
can.page.styleHeight(can, can.ui.profile_output, profile_height)
can.page.styleHeight(can, can.ui.display_output, display_height-html.ACTION_HEIGHT)
can.page.styleHeight(can, can.ui.display, display_height)
can.page.styleHeight(can, can.ui.content, content_height-(can.ui.content != can.ui._content? 4: 0))
can.page.styleHeight(can, can.ui.project, height)

View File

@ -269,6 +269,8 @@ Volcanos(chat.ONACTION, {
return can.onimport.exts(can, "inner/search.js", function() {
can.onmotion.delay(can, function() { can.ui.search._show(msg) }, 300)
})
} else {
can.ui.search && can.onmotion.hidden(can, can.ui.search._target)
}
var toast = can.user.toastProcess(can, "重启中...")
can.onmotion.delay(can, function() { toast.close(), can.user.toastSuccess(can) }, 3000)

View File

@ -5,6 +5,9 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb, target) { can.onmotion.cl
} else {
can.onappend.table(can, msg, null, target), can.onappend.board(can, msg, target)
} can.onmotion.story.auto(can, target), can.base.isFunc(cb) && cb(msg)
if (can.isCmdMode()) {
can.page.style(can, can._output, html.MAX_HEIGHT, can.ConfHeight())
}
},
card: function(can, msg, target) {
can.page.Appends(can, target, msg.Table(function(item) {

View File

@ -64,7 +64,8 @@ var ctx = {
EXTRA_INDEX: "extra.index", EXTRA_ARGS: "extra.args",
}
var cli = {
DAEMON: "daemon", START: "start", STOP: "stop", OPEN: "open", CLOSE: "close", BEGIN: "begin", END: "end",
DAEMON: "daemon",
BEGIN: "begin", START: "start", OPEN: "open", CLOSE: "close", STOP: "stop", END: "end", RESTART: "restart",
COLOR: "color", WHITE: "white", BLACK: "black", RED: "red", GREEN: "green", BLUE: "blue",
YELLOW: "yellow", CYAN: "cyan", PURPLE: "purple", MAGENTA: "magenta", GLASS: "#0000",
MAKE: "make", MAIN: "main", EXEC: "exec", DONE: "done", COST: "cost", FROM: "from", CLEAR: "clear",
@ -292,7 +293,9 @@ var Volcanos = shy({iceberg: "/chat/", volcano: "/frame.js", cache: {}, pack: {}
can.base.isFunc(item.Option)? can.core.List(item.Option(), function(key) {
key.indexOf("_") == 0 || key.indexOf("user.") == 0 || set(key, item.Option(key))
}): can.core.Item(can.base.isFunc(item)? item(): item, set)
}); return msg
});
set(html.HEIGHT, can.ConfHeight()), set(html.WIDTH, can.ConfWidth())
return msg
},
runActionCommand: function(event, index, args, cb) { can.runAction(event, ice.RUN, can.misc.concat(can, [index], args), cb, true) },