From 53a6407349b991bb4455f2d0872f3c3c96951ab3 Mon Sep 17 00:00:00 2001 From: shaoying Date: Thu, 13 Aug 2020 22:54:47 +0800 Subject: [PATCH] fix textarea --- frame.js | 5 ++--- index.css | 2 +- index.js | 6 +++--- pane/Header.js | 6 +++--- plugin/input.js | 3 +++ plugin/table.js | 4 ++++ 6 files changed, 16 insertions(+), 10 deletions(-) diff --git a/frame.js b/frame.js index 756d5086..4c80221a 100644 --- a/frame.js +++ b/frame.js @@ -182,9 +182,9 @@ Volcanos("onengine", {help: "解析引擎", list: [], _init: function(can, meta, "studio": {name: "studio", action: [ {name: "vimer", help: "编辑器", index: "web.code.vimer", args: ["src/", "main.go"]}, {name: "paste", help: "粘贴板", index: "web.code.tmux.text"}, - {name: "favor", help: "收藏夹", index: "web.wiki.word", args: ["usr/learning/favor.shy"]}, - {name: "total", help: "代码统计", index: "web.code.git.total"}, + {name: "contexts", help: "上下文", index: "web.wiki.word", args: ["src/main.shy"]}, {name: "status", help: "代码状态", index: "web.code.git.status"}, + {name: "total", help: "代码统计", index: "web.code.git.total"}, ]}, "cli": {name: "cli", action: [ {name: "tmux", help: "命令行", index: "web.wiki.word", args: ["usr/icebergs/misc/tmux/tmux.shy"]}, @@ -196,7 +196,6 @@ Volcanos("onengine", {help: "解析引擎", list: [], _init: function(can, meta, {name: "HTML5", help: "浏览器", index: "web.wiki.word", args: ["usr/icebergs/misc/chrome/chrome.shy"]}, ]}, "linux": {name: "linux", action: [ - {name: "ES", help: "搜索", index: "web.wiki.word", args: ["usr/learning/自然/编程/es.shy"]}, {name: "linux", help: "系统", index: "web.wiki.word", args: ["usr/linux-story/src/main.shy"]}, ]}, "nginx": {name: "nginx", action: [ diff --git a/index.css b/index.css index 36ed5a39..edc446f8 100644 --- a/index.css +++ b/index.css @@ -69,7 +69,7 @@ fieldset>form.option>div.item input.opts { } fieldset>form.option>div.item textarea.args { background-color:cyan; - width:300px; + width:500px; height:50px; } fieldset>form.option>div.item.textarea { diff --git a/index.js b/index.js index 2044dcb2..cc72886c 100644 --- a/index.js +++ b/index.js @@ -1,11 +1,11 @@ _can_name = "" -Volcanos({name: "chat", volcano: "/frame.js", iceberg: "/chat/", intshell: "plug.sh", +Volcanos({name: "chat", volcano: "/frame.js", iceberg: "/chat/", libs: ["/lib/base.js", "/lib/core.js", "/lib/misc.js", "/lib/page.js", "/lib/user.js"], panes: [ {name: "Header", help: "标题栏", pos: "head", state: ["time", "username"]}, + {name: "Search", help: "搜索框", pos: "float"}, {name: "River", help: "群聊组", pos: "left"}, {name: "Action", help: "工作台", pos: "middle"}, - {name: "Search", help: "搜索框", pos: "float"}, - {name: "Footer", help: "状态条", pos: "foot", state: ["ncmd" ]}, + {name: "Footer", help: "状态条", pos: "foot", state: ["ncmd"]}, ], main: {name: "Header", engine: "remote", list: ["publish/order.js"]}, plugin: [ "/plugin/state.js", "/plugin/table.js", diff --git a/pane/Header.js b/pane/Header.js index c25f91ad..f8d28113 100644 --- a/pane/Header.js +++ b/pane/Header.js @@ -61,7 +61,7 @@ Volcanos("onaction", {help: "交互数据", list: [], _init: function(can, msg, }) }, }) -Volcanos("onexport", {help: "导出数据", list: [], _init: function(can, msg, list, cb, target) { +Volcanos("onexport", {help: "导出数据", list: ["River", "Footer", "pack"], _init: function(can, msg, list, cb, target) { can.run(msg._event, [], function(msg) { can._output.innerHTML = "" can.Conf("username", msg.Option("user.nick")||msg.Option("user.name")) if (can.Conf("username").length > 10) { @@ -85,14 +85,14 @@ Volcanos("onexport", {help: "导出数据", list: [], _init: function(can, msg, }) }) - can.user.isMobile || (can.search = can.page.Append(can, can._output, [{view: "search", list: [{type: "input", onkeydown: function(event) { + can.user.isMobile || (can.search = can.page.Append(can, can._output, [{view: "search", list: [{type: "input", data: {placeholder: "search"}, onkeydown: function(event) { switch (event.key) { case "Enter": can.run(event, ["search", "Search.onimport.input", "*", event.target.value]); break } }, }], }]).input) var height = document.body.offsetHeight - var ui = can.page.Append(can, can._output, can.core.List(["Search", "River", "Footer", "pack"], function(item) { + var ui = can.page.Append(can, can._output, can.core.List(can.onexport.list, function(item) { return {view: "item", list: [{type: "input", data: {name: item, type: "button", value: item.toLowerCase()}, onclick: function(event) { var cb = can.onaction[item]; if (typeof cb == "function") { diff --git a/plugin/input.js b/plugin/input.js index 42e5f6e3..ab3e9867 100644 --- a/plugin/input.js +++ b/plugin/input.js @@ -44,6 +44,9 @@ Volcanos("onaction", {help: "控件交互", list: [], onkeydown: function(event, can) { switch (event.key) { case "Enter": + if (event.target.tagName == "TEXTAREA") { + break + } if (event.target.tagName == "INPUT") { can.run(event) } diff --git a/plugin/table.js b/plugin/table.js index 962b4e03..64da6f7e 100644 --- a/plugin/table.js +++ b/plugin/table.js @@ -4,6 +4,10 @@ Volcanos("onimport", {help: "导入数据", list: [], _init: function(can, msg, ]) can.onappend.table(can, can.ui.content, "table", msg) can.onappend.board(can, can.ui.display, "board", msg) + var refresh = msg.Option("_refresh") || can.Conf("feature")["_refresh"] + refresh && can.Timer(refresh, function() { + can.run({}) + }) return typeof cb == "function" && cb(msg) }, })