diff --git a/frame.js b/frame.js index 4e3bc524..435e0e1c 100644 --- a/frame.js +++ b/frame.js @@ -372,6 +372,8 @@ Volcanos("onappend", {help: "渲染引擎", list: [], _init: function(can, meta, break case "textarea": input.type = "textarea" + item.style.width = can.Conf(["feature", "textarea", item.name, "width"].join(".")) || can.Conf(["feature", "textarea", "width"].join(".")) || item.style.width + item.style.height = can.Conf(["feature", "textarea", item.name, "height"].join(".")) || can.Conf(["feature", "textarea", "height"].join(".")) || item.style.height item.value = can.Conf("content") || item.value // no break case "password": diff --git a/pane/Search.js b/pane/Search.js index 2c3b11c5..2482e3b4 100644 --- a/pane/Search.js +++ b/pane/Search.js @@ -16,6 +16,20 @@ Volcanos("onimport", {help: "导入数据", list: [], _init: function(can, msg, var table = can.onappend.table(can, msg, can.ui.content, "table", function(value, key, index, line) { can.Status("count", index+1) return {text: [key == "text" && typeof line.text == "function" && line.text.help || value, "td"], onclick: function(event) { + if (event.shiftKey) { var msg = can.request(event, line) + can.onappend.plugin(can, {index: line.ctx+"."+line.cmd}, function(story, meta) { + story.run = function(event, cmds, cb, silent) { + can.run(event, ["command", "run", meta.index].concat(cmds), function(msg) { + typeof cb == "function" && cb(msg) + }) + } + }, can.ui.display) + return + } + if (line.ctx == "web.chat" && line.cmd == "/search") { + can.onimport.select(can, msg, [line.type, line.name, line.text], can.cb) + return + } if (typeof line.text == "function") { return can.onmotion.hide(can), line.text(event) } @@ -71,7 +85,7 @@ Volcanos("onaction", {help: "交互操作", list: ["关闭", "清空", "完成"] can.onimport._init(can, msg, list, cb, can._output) }, "关闭": function(event, can) { can.onmotion.hide(can) }, - "清空": function(event, can) { can.onmotion.clear(can, can.ui.table) }, + "清空": function(event, can) { can.onmotion.clear(can, can.ui.table), can.onmotion.clear(can, can.ui.display) }, "完成": function(event, can) { typeof can.cb == "function" && can.cb() }, choice: function(event, can, index) { diff --git a/plugin/input.js b/plugin/input.js index 82f7d73b..92d6ede4 100644 --- a/plugin/input.js +++ b/plugin/input.js @@ -9,7 +9,7 @@ Volcanos("onaction", {help: "控件交互", list: [], _init: function(can, meta, }) , typeof cb == "function" && cb() switch (meta.type) { - case "textarea": !target.placeholder && (target.placeholder = meta.name || ""); break + case "textarea": case "text": !target.placeholder && (target.placeholder = meta.name || "") !target.title && (target.title = target.placeholder)