diff --git a/index.css b/index.css index 707dd1a2..5bb14aba 100644 --- a/index.css +++ b/index.css @@ -33,6 +33,7 @@ table.content td { padding:2px 5px; } table.content.action th:last-child { position:sticky; right:2px; } table.content.action td:last-child { position:sticky; right:2px; } table.content col.time { width:180px; } +// table.content col.option { cursor:pointer; } table.content col.action { width:180px; } h1 { text-align:center; margin:20px 0; } h2 { margin:20px 0; } h3 { margin:20px 0; } hr, td.hr { border-bottom:var(--plugin-border-color) dashed 1px; margin:5px; } diff --git a/lib/page.js b/lib/page.js index f3aa7f0e..1afe15c6 100644 --- a/lib/page.js +++ b/lib/page.js @@ -169,9 +169,11 @@ Volcanos("page", { styleElement.appendChild(document.createTextNode(style)) }, AppendTable: function(can, msg, target, list, cb) { if (!msg.append||msg.append.length == 0) { return } - var ui = can.page.Append(can, target, [{type: html.TABLE, list: [{type: html.THEAD}, {type: html.TBODY}]}]) - can.page.Append(can, ui.table, [{type: "colgroup", list: can.core.List(list, function(key) { if (key[0] != "_") { - return {view: [key, "col"]} } }) }]), + var ui = can.page.Append(can, target, [{type: html.TABLE, list: [ + {type: "colgroup", list: can.core.List(list, function(key) { if (key[0] != "_") { + if (can.Option(key) == undefined) { return {view: [key, "col"]} } return {view: [[key, "option"], "col"]} + } }) }, {type: html.THEAD}, {type: html.TBODY}]}]) + can.page.Append(can, ui.thead, [{data: {dataset: {index: -1}}, th: can.core.List(list, function(key) { if (key[0] != "_") { return key } }) }]) can.page.Append(can, ui.tbody, can.core.List(msg.Table(), function(item, index, array) { return {dataset: {index: index}, td: can.core.List(list, function(key) { if (key[0] != "_") { return cb(can.page.Color(item[key]).trim(), key, index, item, array) } }) } diff --git a/panel/action.js b/panel/action.js index 85940ca7..bfbbafcb 100644 --- a/panel/action.js +++ b/panel/action.js @@ -42,7 +42,10 @@ Volcanos(chat.ONACTION, {_init: function(can, target) { }); if (!can.Conf(chat.TOOL) && !can.user.mod.isCmd) { return } can._names = location.pathname can.Conf(chat.TOOL)? can.onappend.layout(can, can.core.List(can.Conf(chat.TOOL), function(item, index, list) { item.type = chat.PLUGIN if (list.length == 1) { - can.user.title(item.index), can.onaction._onaction_cmd(can), item.mode = chat.CMD, item.opts = can.misc.Search(can) + if (!can.base.isIn(item.index, web.CHAT_MACOS_DESKTOP)) { + can.user.title(item.index) + } + can.onaction._onaction_cmd(can), item.mode = chat.CMD, item.opts = can.misc.Search(can) } return item }), FLOW).layout(window.innerHeight, window.innerWidth): can.runAction(can.request(), ctx.COMMAND, [], function(msg) { if (msg.Length() == 1) { can.onaction._onaction_cmd(can) } can.onimport._init(can, msg) diff --git a/plugin/local/code/inner.js b/plugin/local/code/inner.js index 13f8caa2..64efbe85 100644 --- a/plugin/local/code/inner.js +++ b/plugin/local/code/inner.js @@ -389,6 +389,7 @@ Volcanos(chat.ONSYNTAX, {_init: function(can, msg, cb) { var key = can.onexport. }, }) Volcanos(chat.ONACTION, { + _trans: {show: "预览", exec: "输出"}, _getLine: function(can, line) { return can.page.Select(can, can.ui.content, "tr.line>td.line", function(td, index) { if (td.parentNode == line || index+1 == line) { return td.parentNode } })[0] }, _getContent: function(can, line) { can.ui.content = line.parentNode, can._msg = can.ui.content._msg, can.Option(nfs.PATH, can._msg.Option(nfs.PATH)), can.Option(nfs.FILE, can._msg.Option(nfs.FILE)) diff --git a/plugin/local/code/vimer.js b/plugin/local/code/vimer.js index 6372301e..5d1d439c 100644 --- a/plugin/local/code/vimer.js +++ b/plugin/local/code/vimer.js @@ -63,6 +63,7 @@ Volcanos(chat.ONFIGURE, { }) }, }) Volcanos(chat.ONACTION, {list: ["编译", "源码", "终端", "文档", "计划", "桌面", "后台", "官网"], + _trans: {show: "预览", exec: "输出"}, _run: function(event, can, button, args, cb) { can.runAction(event, button, args, cb||function(msg) { can.onimport.tabview(can, msg.Option(nfs.PATH), msg.Option(nfs.FILE)), can.user.toastSuccess(can, button) can.ui.zone.source.refresh() diff --git a/proto.js b/proto.js index fa0488ff..5c3910b2 100644 --- a/proto.js +++ b/proto.js @@ -394,10 +394,11 @@ var Volcanos = shy({iceberg: "/chat/", volcano: "/frame.js", cache: {}, pack: {} }) try { if (typeof(window) == lang.OBJECT) { var meta = Volcanos.meta meta.target = document.body, meta._height = window.innerHeight, meta._width = window.innerWidth + var debug = location.search.indexOf("debug=true") > -1 try { - meta.version = window._version, window.parent.outerWidth-window.parent.innerWidth > 100 && (meta.version = "") + meta.version = window._version, window.parent.outerWidth-window.parent.innerWidth > 100 && (meta.version = "", debug = false) } catch (e) { - meta.version = window._version, window.outerWidth-window.innerWidth > 100 && (meta.version = "") + meta.version = window._version, window.outerWidth-window.innerWidth > 100 && (meta.version = "", debug = false) } meta._load = function(url, cb) { switch (url.split(ice.QS)[0].split(nfs.PT).pop().toLowerCase()) { @@ -410,7 +411,7 @@ try { if (typeof(window) == lang.OBJECT) { var meta = Volcanos.meta window.onmouseup = function(event) { window._mousemove && (window._mousemove.onmouseup(event)) } window.ondblclick = function(event) { can.onkeymap.prevent(event) } window.onkeydown = function(event) { if (event.key == lang.ESCAPE && !can.page.tagis(event.target, html.INPUT)) { can.onkeymap.prevent(event) } } - window.onerror = function(message, source, lineno, colno, error) { meta.version? alert([message].concat(can.misc._stacks(0, error)).join(lex.NL)): can.misc.Error(message, lex.NL+[source, lineno, colno].join(ice.DF), error) } + window.onerror = function(message, source, lineno, colno, error) { debug? alert([message].concat(can.misc._stacks(0, error)).join(lex.NL)): can.misc.Error(message, lex.NL+[source, lineno, colno].join(ice.DF), error) } window.onbeforeunload = function() { can.Action._socket && can.Action._socket.close() } var last = can.page.width() < can.page.height(); window.onresize = function(event) { can.misc.Event(event, can, function(msg) { if (can.user.isMobile && last === can.page.width() < can.page.height()) { return } last = can.page.width() < can.page.height()