1
0
forked from x/volcanos
This commit is contained in:
shylinux 2021-10-14 04:14:48 +08:00
parent 57f7338ac0
commit 7597f8654a
5 changed files with 22 additions and 13 deletions

View File

@ -377,7 +377,9 @@ Volcanos("onappend", {help: "渲染引擎", list: [], _init: function(can, meta,
})
},
figure: function(can, meta, target, cb) { if (target.type == html.BUTTON) { return }
figure: function(can, meta, target, cb) {
if (meta.type == html.BUTTON) { return }
if (meta.type == html.SELECT) { return }
var input = meta.action||"key"; can.require(["/plugin/input/"+input+".js"], function(can) {
can.core.Item(can.onfigure[input], function(key, on) { if (key.indexOf("on") != 0) { return }
target[key] = function(event) {

View File

@ -311,6 +311,8 @@ Volcanos("page", {help: "用户界面", ClassList: {
case "password":
// no break
case html.TEXT:
if (item.username) { item.type = "text"; return item }
if (item.password) { return item }
item.autocomplete = "off"
item.value = value||item.value||""
item.className || can.page.ClassList.add(can, item, "args")
@ -326,6 +328,7 @@ Volcanos("page", {help: "用户界面", ClassList: {
case html.BUTTON: item.value = item.value||item.name||"list"; break
case "upfile": item.type = html.FILE; break
case "upload": item.type = html.FILE, input.name = "upload"; break
default:
}
return input
},

View File

@ -193,6 +193,7 @@ Volcanos("user", {help: "用户操作", agent: {
var ui = can.page.Append(can, document.body, [{view: ["input"], style: {left: 0, top: 0}, list: [
{view: ["option", "table"], list: can.core.List(form, function(item) {
item = typeof item == "string"? {type: html.TEXT, name: item}: item.length > 0? {type: html.SELECT, name: item[0], values: item.slice(1)}: item
item.type = item.type||(item.values? html.SELECT: html.TEXT)
item._init = function(target) {
item.run = function(event, cmds, cb) {
@ -203,7 +204,7 @@ Volcanos("user", {help: "用户操作", agent: {
}, msg, can.Option()); can.run(event, cmds, cb, true)
}
target.value = target.value||can.Option(item.name)||""
target.value = target.value||(item.name&&can.Option(item.name))||""
can.onappend.figure(can, item, target)
}

View File

@ -68,12 +68,12 @@ body.en input[type=button] {
input[type=button]:hover {
background-color:gray; color:cyan;
}
input[type=password] {
width:82px; height:21px; font-size:16px;
box-shadow: 4px 4px 10px 1px #626bd0;
background-color:cyan; color:black;
padding: 0 4px;
}
/* input[type=password] { */
/* width:82px; height:21px; font-size:16px; */
/* box-shadow: 4px 4px 10px 1px #626bd0; */
/* background-color:cyan; color:black; */
/* padding: 0 4px; */
/* } */
input[type=text] {
width:82px; height:21px; font-size:16px;
box-shadow:4px 4px 10px 1px #626bd0;
@ -383,7 +383,10 @@ body>div.input {
body>div.input input[type=text] {
width:171px;
}
body>div.input input[type=password] {
body>div.input input[name=username] {
width:171px;
}
body>div.input input[name=password] {
width:171px;
}
body>div.input textarea {
@ -400,7 +403,7 @@ body>div.input.login {
padding:10px;
}
body>div.input.login input {
font-size:18px
font-size:18px;
}
body>div.upload {

View File

@ -277,9 +277,9 @@ Volcanos("ondetail", {help: "菜单交互", list: ["共享群组", "添加应用
var msg = can.request(event, {action: cli.START})
can.run(event, cmds, cb, silent)
}}, [
{name: "name", value: "@key=hi"},
{name: "repos", value: "@key"},
{name: "template", value: "@key"},
{name: "name", value: "hi", action: "key"},
{name: "repos", action: "key"},
{name: "template", action: "key"},
], function(event, button, data, list, args) {
can.run(event, [ctx.ACTION, cli.START].concat(args, chat.RIVER, river), function(msg) {
var link = can.user.MergeURL(can, {_path: "/chat/pod/"+can.core.Keys(can.user.Search(can, cli.POD), msg.Option(kit.MDB_NAME))})