diff --git a/frame.js b/frame.js index aeb2795d..de74cee2 100644 --- a/frame.js +++ b/frame.js @@ -683,13 +683,17 @@ Volcanos(chat.ONMOTION, {_init: function(can, target) { }, _window.onmouseup = function(event) { target = null, begin = {}, delete(window._scroll) } _window.onmousemove = function(event) { if (window._scroll && target) { can.onkeymap.prevent(event) + function move() { can.page.style(can, target, + html.LEFT, can.base.Min(begin.left + event.x - begin.x, 0, window.innerWidth-target.offsetWidth), + html.TOP, can.base.Min(begin.top + event.y - begin.y, top||0, window.innerHeight-html.ACTION_HEIGHT) + ) } switch (action) { case "left": can.page.style(can, target, html.LEFT, can.base.Min(begin.left + event.x - begin.x, 0, window.innerWidth-target.offsetWidth)) cb? cb(target.offsetHeight, begin.width + begin.x - event.x): can.page.style(can, target, html.WIDTH, begin.width + begin.x - event.x) break case "right": - cb? cb(target.offsetHeight, begin.width + event.x - begin.x): can.page.style(can, target, html.WIDTH, begin.width + event.x - begin.x); + cb? cb(target.offsetHeight, begin.width + event.x - begin.x): can.page.style(can, target, html.WIDTH, begin.width + event.x - begin.x) break case "top": can.page.style(can, target, html.TOP, can.base.Min(begin.top + event.y - begin.y, top, window.innerHeight-target.offsetHeight)) @@ -698,11 +702,7 @@ Volcanos(chat.ONMOTION, {_init: function(can, target) { case "bottom": cb? cb(begin.height + event.y - begin.y, target.offsetWidth): can.page.style(can, target, html.HEIGHT, begin.height + event.y - begin.y) break - default: - can.page.style(can, target, - html.LEFT, can.base.Min(begin.left + event.x - begin.x, 0, window.innerWidth-target.offsetWidth), - html.TOP, can.base.Min(begin.top + event.y - begin.y, top||0, window.innerHeight-html.ACTION_HEIGHT) - ) + default: move() } } else { var _target = findTarget(event); if (!_target) { return } var x = event.x - _target.offsetLeft, y = event.y - _target.offsetTop, margin = 20 diff --git a/index.css b/index.css index 9cb8c9c3..bbdb75cb 100644 --- a/index.css +++ b/index.css @@ -219,6 +219,7 @@ fieldset.output>legend { display:none; } fieldset.output>form.option { display:none; } fieldset.output>div.action { display:none; } fieldset.output>div.status { display:none; } +fieldset>form.option>div.item.select, fieldset>div.action>div.item.select { border-radius:5px; } fieldset>form.option, fieldset>div.action { display:contents; } form.option.hide, div.action.hide, .hidden, .hide { display:none; } div.action, div.output, div.status, div.project, div.content, div.profile, div.display, table.content, table.content td, div.list, div.code, div.story, div.float, fieldset.float { overflow:auto; } legend, form.option, form.option>div.item, div.action, div.action>div.item, div.action>div.tabs, fieldset>div.status>div.item { float:left; } diff --git a/lib/user.js b/lib/user.js index 91e464e7..e2383765 100644 --- a/lib/user.js +++ b/lib/user.js @@ -173,7 +173,7 @@ Volcanos("user", { can.core.CallFunc(cb, {event: can.request(event, {_handle: ice.TRUE})._event, button: button, data: data, list: list, args: args, input: action}) || action.cancel() }, _target: ui._target, _engine: function(event, can, button) { action.submit(event, can, button) }, }); can.onlayout.figure(event, can, ui._target, false, 0.8), can.onmotion.delay(can, function() { action.focus() }) - can.onmotion.move(can, ui._target, {}) + can.onmotion.move(can, ui._target, {}), can.onmotion.resize(can, ui._target) return button === true && action.submit(event, can, html.SUBMIT), action }, select: function(event, can, type, fields, cb, cbs) { diff --git a/plugin/local/code/vimer.js b/plugin/local/code/vimer.js index 4be6a966..0951e043 100644 --- a/plugin/local/code/vimer.js +++ b/plugin/local/code/vimer.js @@ -69,7 +69,7 @@ Volcanos(chat.ONFIGURE, { } } }) }, }) -Volcanos(chat.ONACTION, {list: ["编译", "源码", "终端", "导图", "计划", "收藏", "桌面", "首页"], +Volcanos(chat.ONACTION, {list: ["编译", "源码", "终端", "文档", "导图", "计划", "收藏", "桌面", "首页"], _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() @@ -110,6 +110,7 @@ Volcanos(chat.ONACTION, {list: ["编译", "源码", "终端", "导图", "计划" "编译": function(event, can) { can.onaction.compile(event, can, code.COMPILE) }, "源码": function(event, can) { can.onimport.tabview(can, "", web.CODE_GIT_STATUS, ctx.INDEX) }, "终端": function(event, can) { can.onimport.tabview(can, "", web.CODE_XTERM, ctx.INDEX) }, + "文档": function(event, can) { can.onimport.tabview(can, "", web.WIKI_WORD, ctx.INDEX) }, "导图": function(event, can) { can.onimport.tabview(can, "", web.WIKI_DRAW, ctx.INDEX) }, "计划": function(event, can) { can.onimport.tabview(can, "", web.TEAM_PLAN, ctx.INDEX) }, "收藏": function(event, can) { can.onimport.tabview(can, "", web.CHAT_FAVOR, ctx.INDEX) }, diff --git a/plugin/table.js b/plugin/table.js index c2f37d20..b3601d9e 100644 --- a/plugin/table.js +++ b/plugin/table.js @@ -25,7 +25,12 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, target) { can.onmotion.clear( {view: html.ACTION, inner: item.action, onclick: function(event) { can.run(can.request(event, item), [ctx.ACTION, event.target.name]) }}, ]} })), can.onlayout.expand(can, can._output, 320) }, - icon: function(can, name, button, target) { can.page.Append(can, target, [{text: [can.page.unicode[name]||name, html.SPAN, html.ICON], onclick: function(event) { + icon: function(can, msg, target, cb) { return msg.Table(function(value) { value.icon = can.misc.PathJoin(value.icon||can.page.drawText(can, value.name, 80)) + return can.page.Append(can, target, [{view: html.ITEM, list: [{view: html.ICON, list: [{img: value.icon}]}, {view: [mdb.NAME, "", value.name]}], _init: function(target) { + cb && cb(target, value) + }, onclick: function(event) { can.sup.onexport.record(can.sup, value.name, mdb.NAME, value) }}])._target + }) }, + _icon: function(can, name, button, target) { can.page.Append(can, target, [{text: [can.page.unicode[name]||name, html.SPAN, html.ICON], onclick: function(event) { can.base.isFunc(button)? button(event, button): can.onaction[button](event, can, button), can.onkeymap.prevent(event) }}]) }, tabs: function(can, list, cb, cbs, action) { action = action||can._action; return can.page.Append(can, action, can.core.List(list, function(tabs) { @@ -105,7 +110,7 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, target) { can.onmotion.clear( zone._total = function(total) { return can.page.Modify(can, zone._search, {placeholder: "search in "+total+" items"}), total } zone._icon = function(list) { can.page.Select(can, zone._legend, html.SPAN_ICON, function(target) { can.page.Remove(can, target) }) - can.core.Item(list, function(name, button) { can.onimport.icon(can, name, button, zone._legend) }) + can.core.Item(list, function(name, button) { can.onimport._icon(can, name, button, zone._legend) }) } zone.refresh = function() { can.onmotion.clear(can, target), zone._init(target, zone) } can.base.isFunc(zone._init) && (zone._menu = zone._init(target, zone)||zone._menu)