mirror of
https://shylinux.com/x/volcanos
synced 2025-04-25 08:48:06 +08:00
add some
This commit is contained in:
parent
68edc8fa54
commit
58182dc2a2
2
frame.js
2
frame.js
@ -656,7 +656,7 @@ Volcanos(chat.ONAPPEND, {
|
||||
if (key == mdb.STATUS && value) { _value = can.user.trans(can, value, "", key) }
|
||||
if (key == ctx.ACTION && !value && msg.IsDetail()) { return }
|
||||
return {className: option.indexOf(key) > -1? ice.MSG_OPTION: key == ctx.ACTION? ctx.ACTION: "", text: [
|
||||
msg.IsDetail() && key == mdb.KEY? can.user.trans(can, _value, null, html.INPUT): _value, html.TD,
|
||||
msg.IsDetail() && key == mdb.KEY? can.user.trans(can, _value, null, html.INPUT): can.user.trans(can, _value, null, "value."+key), html.TD,
|
||||
], onclick: function(event) { if (onclick()) { return } var target = event.target
|
||||
if (key == cli.QRCODE && can.page.tagis(event.target, html.IMG)) { can.user.opens(event.target.title) }
|
||||
if (can.page.tagis(target, html.INPUT) && target.type == html.BUTTON) { can.requestAction(request(event), target.name)
|
||||
|
15
index.css
15
index.css
@ -184,6 +184,21 @@ div.output.card>div.item>div.title>div.title>span { padding:var(--input-padding)
|
||||
div.output.card>div.item>div.title>div.title>span.exists { color:var(--notice-bg-color); }
|
||||
div.output.card>div.item>div.title>img { height:var(--header-height); width:var(--header-height); margin:0; float:left; }
|
||||
div.output.card>div.item>div.title>img.jpg { padding:var(--input-padding); }
|
||||
div.item.card { position:relative; display:flex; align-items:center; padding:0; }
|
||||
div.item.card img { height:40px; }
|
||||
div.item.card div.info { width:100%; }
|
||||
div.item.card div.title { font-size:16px; }
|
||||
div.item.card div.title span { margin-right:5px; }
|
||||
div.item.card div.title span.type { border:var(--box-notice); color:var(--notice-bg-color); font-size:12px; padding:0 5px; margin-left:5px; }
|
||||
div.item.card div.title span.role { border:var(--box-notice); color:var(--notice-bg-color); font-size:12px; padding:0 5px; margin-left:5px; }
|
||||
div.item.card div.status { font-size:12px; color:gray; }
|
||||
div.item.card div.status span { margin-right:5px; }
|
||||
div.item.card div.action { height:40px; }
|
||||
div.item.card div.action { position:absolute; right:0; }
|
||||
div.item.card div.output { padding:10px 0; width:100%; display:flex; transition:left .2s; }
|
||||
div.item.card div.output { background-color:var(--output-bg-color); }
|
||||
div.item.card.select div.title { font-weight:bold; }
|
||||
div.item.card.select div.output { transition:left .5s; }
|
||||
div.item img[src*=".ico"] { padding:3px; }
|
||||
div.item img[src*=".jpg"] { padding:3px; }
|
||||
table.content tr>td img[src*=".jpg"] { padding:5px; }
|
||||
|
@ -141,6 +141,7 @@ Volcanos("misc", {
|
||||
}
|
||||
var input = can.user.input(event, can, meta.feature[cmds[1]], function(args) {
|
||||
can.page.ClassList.add(can, input._target, html.PROCESS)
|
||||
msg.result = []
|
||||
can.Update(can.request(event, {_handle: ice.TRUE}, msg, can.Option()), cmds.slice(0, 2).concat(args), function(msg) {
|
||||
can.page.ClassList.del(can, input._target, html.PROCESS)
|
||||
if (msg.IsErr()) {
|
||||
|
20
lib/page.js
20
lib/page.js
@ -437,6 +437,26 @@ Volcanos("page", {
|
||||
case html.BUTTON: item.value = item.value||item.name||mdb.LIST; break
|
||||
} return input
|
||||
},
|
||||
itemcard: function(can, value, list, cb) {
|
||||
return {view: [[html.ITEM_CARD]], list: [
|
||||
{view: html.ACTION, _init: function(target) { if (!value.action) { return }
|
||||
target.innerHTML = value.action
|
||||
can.page.Select(can, target, html.INPUT_BUTTON, function(target) {
|
||||
var style = can.Conf("_style."+target.name)||can.page.buttonStyle(can, target.name); style && can.onappend.style(can, style, target)
|
||||
target.onclick = function(event) { can.Update(can.request(event, value), [ctx.ACTION, target.name]) }
|
||||
})
|
||||
}},
|
||||
{view: html.OUTPUT, list: [
|
||||
{img: can.misc.ResourceIcons(can, value.icons)},
|
||||
{view: html.INFO, list: list},
|
||||
], _init: function(target) { if (!value.action) { return }
|
||||
can.onmotion.slideAction(can, target)
|
||||
}, onclick: function(event) {
|
||||
can.onmotion.select(can, event.currentTarget.parentNode.parentNode, html.DIV_ITEM, event.currentTarget.parentNode)
|
||||
cb && cb(event)
|
||||
}},
|
||||
]}
|
||||
},
|
||||
icons: function(can, name, space) { if (!name) { return }
|
||||
if (can.base.contains(name, "/") && can.misc.isImage(can, name)) { return {img: can.misc.Resource(can, name, space)} }
|
||||
// if (can.page.unicode[name]) { return {text: [can.page.unicode[name], "", "icon"]} }
|
||||
|
@ -254,7 +254,7 @@ Volcanos("user", {
|
||||
})
|
||||
title && can.page.Select(can, action._target, "input[name=submit]", function(target) { target.value = can.user.trans(can, title) })
|
||||
if (event && event.target) { can.onlayout.figure(event, can, ui._target)
|
||||
can.user.isMobile && can.page.style(can, ui._target, html.LEFT, (can.page.width()-ui._target.offsetWidth)/2, html.TOP, 100)
|
||||
can.user.isMobile && can.page.style(can, ui._target, html.LEFT, (can.page.width()-ui._target.offsetWidth)/2, html.TOP, 60)
|
||||
// can.user.isMobile && can.page.style(can, ui._target, html.LEFT, (can.page.width()-ui._target.offsetWidth)/2, html.TOP, can.getHeaderHeight(can))
|
||||
} else {
|
||||
can.getActionSize(function(left, top, height) { can.page.style(can, ui._target, html.LEFT, left||0, html.TOP, (height/4||0)) })
|
||||
|
@ -338,15 +338,12 @@ Volcanos(chat.ONKEYMAP, {
|
||||
Volcanos(chat.ONINPUTS, {
|
||||
_nameicon: function(event, can, msg, target, name, title) { name = name||mdb.NAME
|
||||
can.page.Appends(can, can._output, msg.Table(function(value) {
|
||||
var _title = can.user.trans(can.sup, value[title]||value[name]||value[mdb.NAME], null, "value."+name)
|
||||
return {view: html.ITEM, list: [{img: can.misc.Resource(can, value.icons||"usr/icons/icebergs.png")},
|
||||
{view: html.CONTAINER, list: [{view: [html.TITLE, "", value[title]||value[name]||value[mdb.NAME]]},
|
||||
can.onappend.label(can, value, kit.Dict(
|
||||
"version", icon.version,
|
||||
"time", icon.compile,
|
||||
name, icon.data,
|
||||
)),
|
||||
{view: html.CONTAINER, list: [{view: [html.TITLE, "", _title]},
|
||||
can.onappend.label(can, value, kit.Dict("version", icon.version, "time", icon.compile, name, icon.data)),
|
||||
]},
|
||||
], onclick: function(event) { can.showIcons(value[name]||value[mdb.NAME], value.icons||"usr/icons/icebergs.png", value[title]) }}
|
||||
], onclick: function(event) { can.showIcons(value[name]||value[mdb.NAME], value.icons||"usr/icons/icebergs.png", _title) }}
|
||||
}))
|
||||
},
|
||||
dream: function(event, can, msg, target, name) { can.sup.sub.oninputs._nameicon(event, can, msg, target, name) },
|
||||
|
Loading…
x
Reference in New Issue
Block a user