1
0
forked from x/volcanos

action opt text some

This commit is contained in:
shaoying 2020-08-14 14:01:37 +08:00
parent 58a5c410c7
commit 693f1e3aeb
5 changed files with 17 additions and 4 deletions

View File

@ -530,6 +530,18 @@ Volcanos("onappend", {help: "渲染引擎", list: [], _init: function(can, meta,
}
return {type: "td", inner: value, click: function(event) {
var target = event.target; if (target.tagName == "INPUT" && target.type == "button") {
if (can.Conf("feature")[target.value]) {
can.user.input(event, can, can.Conf("feature")[target.value], function(event, button, data, list) {
var msg = can.request(event); can.core.Item(can.Option(), msg.Option)
can.core.Item(line, msg.Option)
can.run(event, ["action", target.value].concat(list), function(msg) {
can.user.toast(can, target.value+"成功", "paste")
}, true)
return true
})
return
}
switch (target.value) {
case "复制":
navigator.clipboard.writeText(line.text).then(function() {

View File

@ -11,6 +11,7 @@ Volcanos("onaction", {help: "控件交互", list: [],
var feature = can.sup.Conf("feature")
var input = feature && feature[can.Conf("name")]; if (input) {
return can.user.input(event, can, input,function(event, button, data, list) {
var msg = can.request(event); can.core.Item(can.sup.Option(), msg.Option)
var args = ["action", can.Conf("name")]; can.core.Item(data, function(key, value) {
key && value && args.push(key, value)
})

View File

@ -52,7 +52,6 @@ fieldset.editor>div.output div.content {
font-size:16px; font-family:monospace;
border-left:solid 2px red;
min-height:20px;
min-width:200px;
max-width:1000px;
overflow:auto;
float:left;
@ -62,7 +61,6 @@ fieldset.editor>div.output div.content>pre.item {
height:20px; border:solid 1px black;
padding:0; margin:0;
padding-left:10px;
min-width:120px;
background-color:black;
color:white;
}

View File

@ -50,9 +50,9 @@ Volcanos("onimport", {help: "导入数据", _init: function(can, msg, list, cb,
can.file = file, can.parse = can.base.Ext(file||path), can.max = 0
can.onsyntax._init(can, can._msg)
var width = can._target.offsetWidth - can.ui.project.offsetWidth - can.ui.preview.offsetWidth - 40
var width = can._target.offsetWidth - can.ui.project.offsetWidth - can.ui.preview.offsetWidth - 60
can.Status("当前行", can.onexport.position(can, parseInt(can.Option("line")))-1)
// can.page.Modify(can, can.ui.content, {style: {"max-width": width+"px"}})
can.page.Modify(can, can.ui.content, {style: {"max-width": width+"px"}})
}
if (can.tabview[path+file]) { return show() }

View File

@ -33,6 +33,8 @@ var Volcanos = shy("火山架", {cache: {}, index: 1, order: 1, debug: {
var conf = {}, conf_cb = {}, cache = {}
can = can || {}, list.push(can) && (can.__proto__ = {_name: name, _root: "volcano", _create_time: new Date(), _load: function(name, cb) {
for (var cache = meta.cache[name] || []; meta.index < list.length; meta.index++) {
if (name == "/plugin/input/date.css" && cache.length > 0) { continue }
if (name == "/lib/base.js" && cache.length > 0) { continue }
if (list[meta.index] == can) { continue }
cache.push(list[meta.index])
// 加载缓存