1
0
mirror of https://shylinux.com/x/volcanos synced 2025-04-25 16:58:06 +08:00
This commit is contained in:
shaoying 2020-08-14 02:10:34 +08:00
parent 99e3810918
commit 58a5c410c7
4 changed files with 30 additions and 5 deletions

View File

@ -306,6 +306,7 @@ Volcanos("onappend", {help: "渲染引擎", list: [], _init: function(can, meta,
}, [Volcanos.meta.volcano].concat(list), function(sub) { cb(sub)
meta.feature = sub.base.Obj(meta.feature, {})
sub.page.ClassList.add(sub, field, meta.feature.style||"")
sub.page.ClassList.add(sub, field, meta.style||"")
meta.detail = meta.feature["detail"] || {}
sub.onimport && sub.onimport._init(sub, sub.Conf(meta), list, function() {}, field)
@ -317,7 +318,7 @@ Volcanos("onappend", {help: "渲染引擎", list: [], _init: function(can, meta,
return sub
},
_option: function(can, meta, list, cb) { var index = -1, args = can.base.Obj(meta.args, [])
function add(item, next) { item._input == "text" && index++
function add(item, next) { item._input != "button" && index++
return can._inputs[item.name] = Volcanos(item.name, { _help: item.name, _follow: can._follow+"."+item.name,
_target: can.onappend.input(can, can._option, item.type, item, args[index]),
_option: can._option, _action: can._action, _output: can._output,
@ -476,6 +477,7 @@ Volcanos("onappend", {help: "渲染引擎", list: [], _init: function(can, meta,
item.value = item.values[1]
}
}
item.value = value || item.value
input.type = "select", input.list = item.values.map(function(value) {
return {type: "option", value: value, inner: value}
})
@ -483,6 +485,8 @@ Volcanos("onappend", {help: "渲染引擎", list: [], _init: function(can, meta,
break
case "textarea":
input.type = "textarea"
// item.value = JSON.stringify(can.Conf("content")) || item.value
item.value = can.Conf("content") || item.value
// no break
case "password":
// no break

View File

@ -391,3 +391,9 @@ body.white fieldset.plugin table td:hover {
background-color:lightgray;
}
fieldset.command>form.option>div.item input.args {
width:300px;
}
fieldset.command>form.option>div.item textarea {
height:160px;
}

View File

@ -1,7 +1,3 @@
fieldset>form.option>div.item input.args[name=cmd] {
width:300px;
}
fieldset li.H2 {
font-weight:bold;
font-size:20px;
@ -15,6 +11,15 @@ fieldset h3.story {
fieldset p.story {
white-space:pre;
}
fieldset div.story[data-name=shell] {
padding:4px;
border-left:solid 4px blue;
background-color:#c2daef;
}
fieldset div.story[data-name=shell] span:hover {
background-color:white;
cursor:copy;
}
fieldset p.story.shell {
padding:4px;
border-left:solid 4px blue;

View File

@ -9,6 +9,16 @@ Volcanos("onimport", {help: "导入数据", list: [], _init: function(can, msg,
})
return typeof cb == "function" && cb(msg)
},
spark: function(can, list, target) {
can.page.Select(can, target, "span", function(item) {
item.title = "点击复制"
item.onclick = function(event) {
navigator.clipboard.writeText(item.innerText).then(function() {
can.user.toast(can, "复制成功", "paste")
})
}
})
},
iframe: function(can, list, target) { var meta = can.base.Obj(list.meta)
can.page.Modify(can, target, {width: can.Conf("width")-200})
},