mirror of
https://shylinux.com/x/volcanos
synced 2025-04-25 16:58:06 +08:00
opt some
This commit is contained in:
parent
d75d499726
commit
e9c1566672
2
frame.js
2
frame.js
@ -616,7 +616,7 @@ Volcanos("onappend", {help: "渲染引擎", list: [], _init: function(can, meta,
|
||||
|
||||
can.onappend._init(can, meta, [chat.PLUGIN_STATE_JS], function(sub, skip) {
|
||||
sub._index = value.index||meta.index
|
||||
sub.run = function(event, cmds, cb) { can.run(event, can.misc.concat(can, [ctx.ACTION, ice.RUN, meta.index], cmds), cb) }
|
||||
sub.run = function(event, cmds, cb) { can.run(event, can.misc.concat(can, [ctx.ACTION, ice.RUN, sub._index], cmds), cb) }
|
||||
can.base.isFunc(cb) && cb(sub, meta, skip)
|
||||
}, target||can._output)
|
||||
},
|
||||
|
@ -65,7 +65,6 @@ Volcanos("user", {help: "用户操作", agent: {
|
||||
return can.core.Item(text, function(k, v) { can.core.Value(can._trans, k, v) })
|
||||
}
|
||||
|
||||
if (text == "password") { return text }
|
||||
if (can.user.language(can) == "en") { return text }
|
||||
if (can.base.isFunction(text)) { text = text.name||"" }
|
||||
return list&&list[text] || can.Conf("trans."+text) || can.Conf("feature._trans."+text) || can._trans&&can._trans[text] || {
|
||||
|
@ -88,7 +88,7 @@ Volcanos("onimport", {help: "导入数据", list: [], _init: function(can, msg,
|
||||
msg.Option(aaa.AVATAR) && can.page.Modify(can, "div.state.avatar>img", {src: "/share/local/avatar"})
|
||||
},
|
||||
_menus: function(can, msg, target) {
|
||||
can.setHeaderMenu(can.user.mod.isPod||can.user.isExtension||can.user.isMobile? [ctx.CONFIG, code.PUBLISH]:
|
||||
can.setHeaderMenu(can.user.mod.isPod||can.user.isExtension||can.user.isMobile? [ctx.CONFIG]:
|
||||
can.base.Obj(msg.Option(chat.MENUS)||can.Conf(chat.MENUS), can.onaction._menus), function(event, button) {
|
||||
can.core.CallFunc(can.onaction[button]||function(event, can) {
|
||||
can.run(event, [button], function(msg) { can.user.toast(can, "执行成功", can.user.trans(can, button)) })
|
||||
@ -194,14 +194,6 @@ Volcanos("onaction", {help: "交互数据", list: [], _init: function(can, cb, t
|
||||
can.run(event, [ctx.ACTION, ctx.CONFIG].concat(args), function(msg) { can.user.jumps(msg.Result()) })
|
||||
})
|
||||
},
|
||||
publish: function(event, can) {
|
||||
can.run(event, [ctx.ACTION, code.PUBLISH], function(msg) {
|
||||
can.user.toast(can, {
|
||||
title: "发布应用", duration: -1, width: -300,
|
||||
content: msg.Result(), action: [cli.CLOSE],
|
||||
})
|
||||
})
|
||||
},
|
||||
webpack: function(event, can) {
|
||||
can.user.input(event, can, [{name: mdb.NAME, value: can.user.title()}], function(ev, button, meta, list) {
|
||||
can.core.Item(Volcanos.meta.pack, function(key, msg) {
|
||||
@ -244,7 +236,7 @@ Volcanos("onaction", {help: "交互数据", list: [], _init: function(can, cb, t
|
||||
can.user.isMobile && can.page.Modify(can, ui._target, {style: {top: 40, right: 0, left: ""}})
|
||||
},
|
||||
password: function(event, can) {
|
||||
var ui = can.user.input(event, can, [{type: html.PASSWORD, action: ice.AUTO}, {type: html.PASSWORD, action: ice.AUTO}], function(ev, button, data, list, args) {
|
||||
var ui = can.user.input(event, can, [{name: html.PASSWORD, type: html.PASSWORD, action: ice.AUTO}, {name: html.PASSWORD, type: html.PASSWORD, action: ice.AUTO}], function(ev, button, data, list, args) {
|
||||
if (list[0] != list[1]) {
|
||||
can.user.toast(can, "密码不一致")
|
||||
ui.focus()
|
||||
|
@ -92,6 +92,7 @@ body.simple fieldset.inner>div.output td.project div.project div.kind { color: w
|
||||
body.simple fieldset.inner>div.output td.project div.project div.kind:first-child { position:sticky; top:0 }
|
||||
body.simple fieldset.inner>div.output div.content { background-color:#263238; font-size:16px; }
|
||||
body.simple fieldset.inner>div.output div.toggle { display:none; }
|
||||
body.simple fieldset.inner>div.output div.toggle.profile { background-color:#664f4f45; display:block; }
|
||||
|
||||
body.white.simple fieldset.inner>div.output div.project div.action div.item { float:left; width:auto; padding:unset; }
|
||||
body.white.simple fieldset.inner>div.output div.project { background:lightyellow; }
|
||||
|
@ -165,7 +165,7 @@ Volcanos("onkeymap", {help: "键盘交互", list: [],
|
||||
},
|
||||
}, _engine: {},
|
||||
})
|
||||
Volcanos("onaction", {help: "控件交互", list: [nfs.SAVE, "dream", code.AUTOGEN, code.COMPILE, "script", chat.WEBSITE],
|
||||
Volcanos("onaction", {help: "控件交互", list: [nfs.SAVE, code.AUTOGEN, code.COMPILE, "script", chat.WEBSITE, "dream", "publish"],
|
||||
save: function(event, can) { var msg = can.request(event, {content: can.onexport.content(can)})
|
||||
can.run(event, [ctx.ACTION, nfs.SAVE, can.parse, can.Option(nfs.FILE), can.Option(nfs.PATH)], function(msg) {
|
||||
can.onimport.project(can, can.Option(nfs.PATH))
|
||||
@ -180,6 +180,15 @@ Volcanos("onaction", {help: "控件交互", list: [nfs.SAVE, "dream", code.AUTOG
|
||||
}, true)
|
||||
})
|
||||
},
|
||||
compile: function(event, can, button) { var msg = can.ui.search.request(event, {_handle: ice.TRUE, _toast: "编译中..."}, can.Option())
|
||||
can.run(event, [ctx.ACTION, button], function(msg) {
|
||||
if (msg.Length() == 0) { var toast = can.user.toast(can, "重启中...", "", -1)
|
||||
can.core.Timer(5000, function() { toast.close(), can.onaction["展示"]({}, can) })
|
||||
} else {
|
||||
can.ui.search._show(msg)
|
||||
}
|
||||
}, true)
|
||||
},
|
||||
_complete: function(event, can, target) {
|
||||
var pre = event.target.value.slice(0, event.target.selectionStart)
|
||||
var end = event.target.value.slice(event.target.selectionStart)
|
||||
@ -209,17 +218,8 @@ Volcanos("onaction", {help: "控件交互", list: [nfs.SAVE, "dream", code.AUTOG
|
||||
default: select() || update(target); break
|
||||
}
|
||||
},
|
||||
compile: function(event, can, button) { var msg = can.ui.search.request(event, {_handle: ice.TRUE, _toast: "编译中..."}, can.Option())
|
||||
can.run(event, [ctx.ACTION, button], function(msg) {
|
||||
if (msg.Length() == 0) { var toast = can.user.toast(can, "重启中...", "", -1)
|
||||
can.core.Timer(5000, function() { toast.close(), can.onaction["展示"]({}, can) })
|
||||
} else {
|
||||
can.ui.search._show(msg)
|
||||
}
|
||||
}, true)
|
||||
},
|
||||
script: function(event, can, button) { var meta = can.Conf()
|
||||
can.request(event, {_handle: ice.TRUE, file: "hi/hi.js", text: `Volcanos("onimport", {help: "导入数据", list:[], _init: function(can, msg, cb, target) {
|
||||
can.request(event, {_handle: ice.TRUE, action: button, file: "hi/hi.js", text: `Volcanos("onimport", {help: "导入数据", list:[], _init: function(can, msg, cb, target) {
|
||||
msg.Echo("hello world")
|
||||
can.onappend.table(can, msg)
|
||||
can.onappend.board(can, msg)
|
||||
@ -232,14 +232,17 @@ Volcanos("onaction", {help: "控件交互", list: [nfs.SAVE, "dream", code.AUTOG
|
||||
})
|
||||
},
|
||||
website: function(event, can, button) { var meta = can.Conf()
|
||||
can.request(event, {_handle: ice.TRUE, file: "hi.iml", text: `
|
||||
hi
|
||||
he
|
||||
cli.runtime
|
||||
cli.system
|
||||
hi/hi.sh
|
||||
hi/hi.go
|
||||
hi/hi.js
|
||||
can.request(event, {_handle: ice.TRUE, action: button, file: "hi.zml", text: `
|
||||
left
|
||||
username
|
||||
系统
|
||||
命令 index cli.system
|
||||
共享 index cli.qrcode
|
||||
代码
|
||||
趋势 index web.code.git.trend args icebergs action auto
|
||||
状态 index web.code.git.status args icebergs
|
||||
main
|
||||
|
||||
`.trim()}, can.Option())
|
||||
can.user.input(event, can, meta.feature[button], function(ev, btn, data, list, args) {
|
||||
can.run(event, [ctx.ACTION, button].concat(args), function(msg) {
|
||||
@ -248,6 +251,14 @@ hi
|
||||
}, true)
|
||||
})
|
||||
},
|
||||
publish: function(event, can, button) {
|
||||
can.run(event, [ctx.ACTION, button], function(msg) {
|
||||
can.user.toast(can, {
|
||||
title: "发布应用", duration: -1, width: -300,
|
||||
content: msg.Result(), action: [cli.CLOSE],
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
_selectLine: function(event, can) {
|
||||
can.page.Select(can, can.current.line, "td.text", function(td) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user