From db63632956bdac9119a7f6f8f394f932dbc4c98d Mon Sep 17 00:00:00 2001 From: shaoying Date: Sat, 12 Oct 2019 19:47:17 +0800 Subject: [PATCH] opt some --- src/plugin/context/index.shy | 2 +- usr/librarys/example.js | 11 ++++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/src/plugin/context/index.shy b/src/plugin/context/index.shy index ff2110fa..f8654097 100644 --- a/src/plugin/context/index.shy +++ b/src/plugin/context/index.shy @@ -22,7 +22,7 @@ kit upgrade "升级" private "ssh._route" _ "cli.upgrade" \ button "升级" kit missyou "任务" private "ssh._route" _ "cli.missyou" \ - text "" name pod imports plugin_pod action auto \ + text "" name pod imports plugin_pod \ text "" name see imports plugin_see \ text "" name you view long \ button "行动" action auto \ diff --git a/usr/librarys/example.js b/usr/librarys/example.js index 50bffa13..aa9341e1 100644 --- a/usr/librarys/example.js +++ b/usr/librarys/example.js @@ -1025,7 +1025,8 @@ function Plugin(page, pane, field, inits, runs) { kit.classList.add(item, "args") break case "textarea": - input.type = "textarea", item.style = "height:100px;"+"width:"+(pane.target.clientWidth-30)+"px" + kit.AppendChild(option, "br") + input.type = "textarea", item.style = "height:"+(item.height||"50px")+";width:"+(pane.target.clientWidth-30)+"px" // no break case "text": item.value = value || item.value || "" @@ -1283,8 +1284,8 @@ function Inputs(plugin, meta, item, target, option) { type == "select" && input.Event(event, {}) && plugin.Check(event, item.action == "auto"? undefined: target) }, ondblclick: function(event) { - var txt = kit.History("txt", -1) - type == "text" && txt && (target.value = txt.data.trim()) + var txt = kit.History("txt", -1); + (type == "text" || type == "textarea") && txt && (target.value = txt.data.trim()) }, onselect: function(event) { kit.CopyText() @@ -1408,6 +1409,10 @@ function Output(plugin, type, msg, cb, target, option) { output.onimport.meta._table(msg, msg.append) || (target.innerHTML = msg.result.join("")) kit._call(cb, [msg]) }, + code: function(msg, cb) { + target.innerHTML = "", output.onimport.meta._code(msg) + typeof cb == "function" && cb(msg) + }, table: function(msg, cb) { target.innerHTML = "" output.onimport.meta._table(msg, msg.append) || output.onimport.meta._code(msg)