From d81a08d4ae255076cacc44831bbfd7f1633cfb22 Mon Sep 17 00:00:00 2001 From: harveyshao Date: Thu, 8 Dec 2022 20:55:12 +0800 Subject: [PATCH] opt git --- page/index.css | 1 + plugin/local/code/inner.js | 2 +- plugin/local/code/vimer.js | 7 ++++++- plugin/local/wiki/word.js | 3 ++- plugin/table.js | 1 + proto.js | 4 ++-- 6 files changed, 13 insertions(+), 5 deletions(-) diff --git a/page/index.css b/page/index.css index 5e197779..e973e047 100644 --- a/page/index.css +++ b/page/index.css @@ -47,6 +47,7 @@ div.output div.project div.list { margin-left:10px; } div.output div.project div.switch { transform: rotate(90deg) translate(1px, 0px); width:12px; float:left; } div.output div.project div.switch.open { transform: rotate(180deg) translate(-4px, 4px); } div.output div.project div.zone>div.name { background-color:steelblue; color:white; text-align:center; padding:3px; clear:both; } +div.output div.project div.zone>div.list>div.zone>div.name { padding-left:20px; text-align:left; } div.output div.project div.item>div.name { padding-left:20px; } div.output div.project div.zone>div.action>div.item { padding:0; margin:0; float:right; clear:none; } div.output div.project div.zone>div.action>div.item input[type=text] { background-color:#ff000000; padding-left:10px; color:white; } diff --git a/plugin/local/code/inner.js b/plugin/local/code/inner.js index 5c7b941e..04351098 100644 --- a/plugin/local/code/inner.js +++ b/plugin/local/code/inner.js @@ -413,7 +413,7 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb, target) { can.onengine.plugin(can, can.onplugin) var paths = can.core.Split(can.Option(nfs.PATH), ice.FS); can.Option(nfs.PATH, paths[0]) var files = can.core.Split(can.Option(nfs.FILE), ice.FS); can.Option(nfs.FILE, files[0]) - can.core.List(paths.concat(msg.modules||[], can.sup.paths||[]), function(p) { if (paths.indexOf(p) == -1) { paths.push(p) } }) + can.core.List(paths.concat(msg.modules||[], can.sup.paths||[], can.core.Split(msg.Option("repos"))), function(p) { if (paths.indexOf(p) == -1 && p[0] != ice.PS) { paths.push(p) } }) can.sup.paths = paths can.ui._content = can.ui.content, can.ui._profile_output = can.ui.profile_output diff --git a/plugin/local/code/vimer.js b/plugin/local/code/vimer.js index b6eeeeaf..64e594c6 100644 --- a/plugin/local/code/vimer.js +++ b/plugin/local/code/vimer.js @@ -82,7 +82,12 @@ Volcanos(chat.ONFIGURE, { }, true) } if (path.length == 1) { return show(target, path[0]) } can.page.Remove(can, target.previousSibling) - can.onimport.zone(can, can.core.List(path, function(path) { return {name: path, _init: function(target) { show(target, path) }} }), target) + can.onimport.zone(can, can.core.List(path, function(path) { return {name: path, _delay_show: function(target) { + show(target, path) + }, _init: function(target, zone) { + can.onmotion.hidden(can, zone._action) + can.onmotion.hidden(can, zone._target) + }} }), target) can.sup.onexport.link = function(can) { var meta = can.Conf(), args = can.Option() args.cmd = meta.index||can.core.Keys(meta.ctx, meta.cmd), args.path = path.join(ice.FS), args.topic = chat.BLACK return can.misc.MergePodCmd(can, args, true) diff --git a/plugin/local/wiki/word.js b/plugin/local/wiki/word.js index bc0e399d..aceb3523 100644 --- a/plugin/local/wiki/word.js +++ b/plugin/local/wiki/word.js @@ -79,7 +79,8 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, target) { can.onmotion.clear( }, field: function(can, meta, target, width) { var item = can.base.Obj(meta.meta) can.onappend._init(can, item, [chat.PLUGIN_STATE_JS], function(sub) { - sub.run = function(event, cmds, cb, silent) { + sub.run = function(event, cmds, cb, silent) { var msg = can.request(event) + if (msg.Option(nfs.PATH) == can.Option(nfs.PATH)) { msg.Option(nfs.PATH, "") } can.runAction(event, chat.STORY, can.misc.concat(can, [meta.type, meta.name, meta.text], cmds), cb, true) }, can._plugins = (can._plugins||[]).concat([sub]) diff --git a/plugin/table.js b/plugin/table.js index 4c1c6d8e..afe406e5 100644 --- a/plugin/table.js +++ b/plugin/table.js @@ -103,6 +103,7 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb, target) { can.onmotion.cl zone: function(can, list, target) { return can.page.Append(can, target, can.core.List(list, function(zone, index) { can.base.isString(zone) && (zone = {name: zone}); return zone && {view: html.ZONE+ice.SP+zone.name, list: [ {view: html.NAME, inner: can.user.trans(can, zone.name), onclick: function() { + if (zone._delay_show) { zone._delay_show(zone._target), delete(zone._delay_show) } can.onmotion.toggle(can, zone._action), can.onmotion.toggle(can, zone._target) }, onmouseenter: function(event) { zone._menu? can.user.carteRight(event, can, zone._menu.meta, zone._menu.list||can.core.Item(zone._menu.meta), function(event, button, meta) { diff --git a/proto.js b/proto.js index 716d58d7..9cd48715 100644 --- a/proto.js +++ b/proto.js @@ -306,8 +306,8 @@ var Volcanos = shy({iceberg: "/chat/", volcano: "/frame.js", cache: {}, pack: {} can.runAction(event, cmds[1], cmds.slice(2), cb, true) }, runActionCommand: function(event, index, args, cb) { can.runAction(event, ice.RUN, can.misc.concat(can, [index], args), cb, true) }, - runAction: function(event, action, args, cb, silent) { - can.run(can.request(event, {_handle: ice.TRUE}, can.Option()), can.misc.concat(can, [ctx.ACTION].concat(action), args), cb, silent) + runAction: function(event, action, args, cb, silent) { can.request(event, {_handle: ice.TRUE}, can.Option()) + can.run(event, can.misc.concat(can, [ctx.ACTION].concat(action), args), cb, silent) }, search: function(event, cmds, cb) {