From 50c1a077be020cce0fbc8fa745febbb7c51fc81e Mon Sep 17 00:00:00 2001 From: shy Date: Sun, 28 Jan 2024 14:00:12 +0800 Subject: [PATCH] opt some --- frame.js | 2 +- lib/user.js | 4 +--- plugin/state.js | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/frame.js b/frame.js index 699e83d5..e55d0211 100644 --- a/frame.js +++ b/frame.js @@ -199,7 +199,7 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) { if (can.Conf("_ismain") && !can.Conf("_role") && can.misc.Search(can, log.DEBUG) != ice.TRUE) { } else if (p && can.isCmdMode()) { - skip || can.Conf(ice.AUTO) == cli.DELAY || can.Update({}, [ctx.ACTION, p]) + skip || can.Conf(ice.AUTO) == cli.DELAY || can.Update(can.request({}, {_method: http.GET}), [ctx.ACTION, p]) } else { skip || can.Conf(ice.AUTO) == cli.DELAY || auto && auto.click() } diff --git a/lib/user.js b/lib/user.js index aa479aa2..6fd32d06 100644 --- a/lib/user.js +++ b/lib/user.js @@ -276,9 +276,7 @@ Volcanos("user", { var _cmd = "space login "+arg[0]; ui.display = can.page.Append(can, ui._target, [html.DISPLAY])._target, can.onappend.style(can, html.FLEX, ui.display) can.page.Appends(can, ui.display, [{text: ["或命令行授权: ", html.LABEL]}, {text: ["$ "+_cmd, "", html.ITEM], title: "点击复制,并后台执行此命令,即可登录", style: {cursor: "copy"}, onclick: function() { can.user.copy(event, can, _cmd) }}]) can.page.Append(can, ui.display, [{text: ["或第三方授权: ", html.LABEL]}, {view: [["sso", html.FLEX]], list: _msg.Table(function(value) { - return value.type == "oauth" && {view: [[html.ITEM, html.FLEX]], title: "点击跳转,授权登录", list: [{img: can.misc.Resource(can, value.icons)}, {text: value.name}], onclick: function() { - can.user.jumps(can.base.MergeURL(value.link, "back", location.href)) - }} + return value.type == "oauth" && {view: [[html.ITEM, html.FLEX]], title: "点击跳转,授权登录", list: [{img: can.misc.Resource(can, value.icons)}, {text: value.name}], onclick: function() { can.user.jumps(value.link) }} }) }]) can.page.style(can, ui._target, {left: (can.page.width()-ui._target.offsetWidth)/2, top: can.page.height() < 640? (can.page.height()-ui._target.offsetHeight)/2: (can.page.height()-ui._target.offsetHeight-html.HEADER_HEIGHT-html.ACTION_HEIGHT)/4+html.HEADER_HEIGHT}) diff --git a/plugin/state.js b/plugin/state.js index 5914875f..26fcdeb5 100644 --- a/plugin/state.js +++ b/plugin/state.js @@ -8,7 +8,7 @@ Volcanos(chat.ONIMPORT, { _rewrite: function(can, msg) { var arg = msg._arg; for (var i = 0; i < arg.length; i += 2) { can.Option(arg[i], arg[i+1]), can.Action(arg[i], arg[i+1]) } can.Update() }, _display: function(can, msg) { can.onappend._output(can, msg, msg.Option(ice.MSG_DISPLAY)) }, _clear: function(can, msg) { can.onmotion.clear(can) }, - _inner: function(can, sub, msg) { can.onmotion.scrollIntoView(can, can.onappend.table(sub, msg)), can.onmotion.scrollIntoView(can, can.onappend.board(sub, msg)), can.onmotion.story.auto(sub) }, + _inner: function(can, sub, msg) { sub = sub||can, can.onmotion.scrollIntoView(can, can.onappend.table(sub, msg)), can.onmotion.scrollIntoView(can, can.onappend.board(sub, msg)), can.onmotion.story.auto(sub) }, _cookie: function(can, msg) { can.misc.Cookie(can, msg._arg[0], msg._arg[1]), can.Update() }, _session: function(can, msg) { can.misc.sessionStorage(can, msg._arg[0], msg._arg[1]), can.Update() }, _field: function(can, msg, cb) { var height = can.base.Max(html.STORY_HEIGHT, can.ConfHeight()-2*html.ACTION_HEIGHT), width = can.ConfWidth()