mirror of
https://shylinux.com/x/volcanos
synced 2025-04-25 16:58:06 +08:00
opt some
This commit is contained in:
parent
cc25eedb5d
commit
100df45867
@ -106,8 +106,8 @@ Volcanos("user", {help: "用户操作", info: {}, agent: {
|
||||
toastConfirm: function(can, content, title, action) {
|
||||
return can.user.toast(can, {title: title, content: content, action: action||[cli.CLOSE], duration: -1, width: -300})
|
||||
},
|
||||
toastProcess: function(can, content, title) { return can.user.toast(can, content, title||ice.PROCESS, -1) },
|
||||
toastSuccess: function(can, content, title) { return can.user.toast(can, content, title||ice.SUCCESS) },
|
||||
toastProcess: function(can, title, content) { return can.user.toast(can, content||ice.PROCESS, title, -1) },
|
||||
toastSuccess: function(can, title, content) { return can.user.toast(can, content||ice.SUCCESS, title) },
|
||||
toast: function(can, content, title, duration, progress) {
|
||||
var meta = can.base.isObject(content)? content: {content: content, title: title||can._help, duration: duration, progress: progress}
|
||||
var width = meta.width||400, height = meta.height||100; if (width < 0) { width = window.innerWidth + width }
|
||||
|
@ -1,5 +1,5 @@
|
||||
body, fieldset, table, tr, th, td { padding:0; border:0; margin:0; }
|
||||
body { background-color:black; color:cyan; font-size:16px; }
|
||||
body { background-color:black; color:cyan; font-size:16px; overflow:hidden; }
|
||||
legend { background-color:cadetblue; color:white; padding:0 20px; }
|
||||
select { background-color:black; color:cyan; padding:0 10px; border:0; }
|
||||
textarea { background-color:cyan; width:400px; padding:5px; border:0; }
|
||||
|
@ -47,7 +47,7 @@ fieldset.Header action>div.tabs:hover { background:none; }
|
||||
fieldset.Header div.tabs div.tabs { padding:5px 10px; }
|
||||
fieldset.Header div.tabs div.tabs:hover { background:#6495ed63; }
|
||||
|
||||
fieldset.iframe>div.output { overflow:hidden; }
|
||||
/* fieldset.iframe>div.output { overflow:hidden; } */
|
||||
|
||||
fieldset.Action>div.project.toggle {
|
||||
background-color:cornsilk; opacity:0.4; color:teal; font-size: 28px; padding-top: 50px; height: 100px; width:20px; position: fixed; top: 30%;
|
||||
|
@ -35,6 +35,7 @@ Volcanos(chat.ONIMPORT, {help: "导入数据", _init: function(can, msg) {
|
||||
_cmd: function(can, item, next) { can.onengine.signal(can, chat.ONACTION_CMD)
|
||||
can.onappend.plugin(can, can.base.Copy(item, {mode: "cmd", opts: can.misc.Search(can)}), function(sub, meta, skip) {
|
||||
sub.run = function(event, cmds, cb) { can.runActionCommand(event, sub._index, cmds, cb) }
|
||||
// sub.onimport.size(sub, sub.ConfHeight(), sub.ConfWidth(), true)
|
||||
can.user.title(meta.name), skip || next()
|
||||
})
|
||||
},
|
||||
@ -44,6 +45,7 @@ Volcanos(chat.ONIMPORT, {help: "导入数据", _init: function(can, msg) {
|
||||
})
|
||||
can.page.Select(can, can._root.Header._output, "action", function(target) {
|
||||
can._header_tabs = can.page.Append(can, target, ["tabs"]).first
|
||||
can.onmotion.hidden(can, can._header_tabs)
|
||||
})
|
||||
},
|
||||
})
|
||||
@ -215,7 +217,8 @@ Volcanos(chat.ONLAYOUT, {help: "界面布局",
|
||||
if (can.page.Select(can, can._output, "fieldset.plugin.select").length > 0) { return }
|
||||
can.onmotion.select(can, can._action, html.DIV_TABS, 0), can.onmotion.select(can, can._output, html.FIELDSET_PLUGIN, 0)
|
||||
},
|
||||
tabview: function(can) { can.onmotion.toggle(can, can._header_tabs, true)
|
||||
tabview: function(can) {
|
||||
can.onmotion.toggle(can, can._header_tabs, true)
|
||||
can.onmotion.hidden(can, can._root.River._target), can.onmotion.hidden(can, can._root.Footer._target), can.onlayout._init(can)
|
||||
can.getActionSize(function(height, width) { can.ConfHeight(height), can.ConfWidth(width) })
|
||||
if (can.page.Select(can, can._output, "fieldset.plugin.select").length > 0) { return }
|
||||
|
@ -116,13 +116,13 @@ Volcanos(chat.ONACTION, {help: "交互操作", list: [
|
||||
},
|
||||
_resize: function(can, auto, height, width) { can.onimport.size(can, height, width, auto) },
|
||||
|
||||
"刷新页面": function(event, can, button, sub) { can.core.CallFunc([sub.onlayout, "_init"], {can: sub}) },
|
||||
"刷新页面": function(event, can, button, sub) { can.core.CallFunc([sub.onlayout, "_init"], {can: sub}), can.user.toastSuccess(can, button) },
|
||||
"刷新数据": function(event, can) { can.Update({}, can.Input([], true)) },
|
||||
"切换浮动": function(event, can, button, sub) {
|
||||
can.onaction._switch(can, sub, "float", function() {
|
||||
can.ConfHeight(window.innerHeight/2), html.WIDTH, can.ConfWidth(window.innerWidth/2)
|
||||
can.getActionSize(function(left) { can.onmotion.move(can, can._target, {left: left||0, bottom: html.ACTION_HEIGHT}) })
|
||||
}, function() { can.page.style(can, can._target, html.LEFT, "", html.BOTTOM, "") })
|
||||
can.getActionSize(function(left) { can.onmotion.move(can, can._target, {left: left||0, top: window.innerHeight/2-4*html.ACTION_HEIGHT-html.PLUGIN_MARGIN}) })
|
||||
}, function() { can.page.style(can, can._target, html.LEFT, "", html.TOP, "") })
|
||||
},
|
||||
"切换全屏": function(event, can, button, sub) {
|
||||
can.onaction._switch(can, sub, "full", function() { can.ConfWidth(window.innerWidth)
|
||||
|
@ -150,9 +150,10 @@ Volcanos(chat.ONDETAIL, {help: "用户交互",
|
||||
}, true)
|
||||
},
|
||||
plugin: function(can, index, args, prefix) {
|
||||
can.onappend.plugin(can, {type: chat.FLOAT, index: index, args: args, mode: "float"}, function(sub) {
|
||||
can.onappend.plugin(can, {type: chat.STORY, mode: chat.FLOAT, index: index, args: args}, function(sub) {
|
||||
sub.run = function(event, cmds, cb) { can.runAction(can.request(event), prefix||[ice.RUN, index], cmds, cb) }
|
||||
sub.Mode("float"), can.getActionSize(function(left, top, width, height) { left = left||0
|
||||
sub.onaction.close = function() { can.page.Remove(can, sub._target) }
|
||||
can.getActionSize(function(left, top, width, height) { left = left||0
|
||||
var top = can.Mode() == undefined? 120: 0; if (can.user.isMobile) { top = can.user.isLandscape()? 0: 48 }
|
||||
sub.ConfHeight(height-top-2*html.ACTION_HEIGHT-(can.user.isMobile&&!can.user.isLandscape()? 2*html.ACTION_HEIGHT: 0)), sub.ConfWidth(width)
|
||||
can.onmotion.move(can, sub._target, {position: html.FIXED, left: left, top: top})
|
||||
|
@ -181,8 +181,15 @@ Volcanos(chat.ONIMPORT, {help: "导入数据", _init: function(can, msg, cb, tar
|
||||
Volcanos(chat.ONLAYOUT, {help: "界面布局",
|
||||
_init: function(can) { can.core.CallFunc([can.onimport, html.LAYOUT], {can: can}) },
|
||||
float: function(can) { can.onlayout._init(can) },
|
||||
full: function(can) { can.onlayout._init(can) },
|
||||
cmd: function(can) { can.onlayout._init(can) },
|
||||
full: function(can) {
|
||||
can.sup.onimport.size(can.sup, can.ConfHeight(), can.ConfWidth(), false)
|
||||
can.onlayout._init(can)
|
||||
},
|
||||
cmd: function(can) {
|
||||
can.ConfHeight(can.ConfHeight()+html.ACTION_HEIGHT)
|
||||
can.sup.onimport.size(can.sup, can.ConfHeight(), can.ConfWidth(), true)
|
||||
can.onlayout._init(can)
|
||||
},
|
||||
})
|
||||
Volcanos(chat.ONACTION, {help: "操作数据",
|
||||
_trans: {"full": "全屏"},
|
||||
|
Loading…
x
Reference in New Issue
Block a user