From 693f1e3aeb14028af436a66d356db94bc7f9a8ed Mon Sep 17 00:00:00 2001 From: shaoying Date: Fri, 14 Aug 2020 14:01:37 +0800 Subject: [PATCH] action opt text some --- frame.js | 12 ++++++++++++ plugin/input.js | 1 + plugin/local/code/inner.css | 2 -- plugin/local/code/inner.js | 4 ++-- proto.js | 2 ++ 5 files changed, 17 insertions(+), 4 deletions(-) diff --git a/frame.js b/frame.js index 268c72a3..c089550e 100644 --- a/frame.js +++ b/frame.js @@ -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() { diff --git a/plugin/input.js b/plugin/input.js index ab3e9867..038f3e4d 100644 --- a/plugin/input.js +++ b/plugin/input.js @@ -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) }) diff --git a/plugin/local/code/inner.css b/plugin/local/code/inner.css index d0db163e..4f2afd7a 100644 --- a/plugin/local/code/inner.css +++ b/plugin/local/code/inner.css @@ -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; } diff --git a/plugin/local/code/inner.js b/plugin/local/code/inner.js index 433b2158..99edcb5e 100644 --- a/plugin/local/code/inner.js +++ b/plugin/local/code/inner.js @@ -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() } diff --git a/proto.js b/proto.js index c01cbe1d..44dc6ecd 100644 --- a/proto.js +++ b/proto.js @@ -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]) // 加载缓存