From f75608408455896de06afb9564c659e89ffcc804 Mon Sep 17 00:00:00 2001 From: shylinux Date: Sun, 30 Jul 2023 09:48:04 +0800 Subject: [PATCH] add web.flows --- frame.js | 7 +++++-- index.css | 15 +++++++++++---- lib/page.js | 2 +- lib/user.js | 7 ++++++- panel/action.css | 3 ++- plugin/local/code/inner.js | 15 ++++++++------- plugin/local/code/inner/syntax.js | 6 +++++- plugin/local/code/vimer.js | 14 +++++++------- plugin/local/wiki/draw.js | 1 + plugin/state.js | 6 ++++-- plugin/table.js | 9 ++++++--- proto.js | 3 ++- 12 files changed, 58 insertions(+), 30 deletions(-) diff --git a/frame.js b/frame.js index 4cc910d4..de84689b 100644 --- a/frame.js +++ b/frame.js @@ -234,7 +234,7 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) { return action.list && action.list.length > 0? can.user.input(event, can, action.list, function(data) { can.core.CallFunc(action, {can: can, msg: can.request(event, data), arg: cmds.slice(2), cb: cb}) }): can.core.CallFunc(action, {sup: meta.can, can: can, msg: can.request(event), arg: cmds.slice(2), cb: cb}) - } return can.user.input(event, can, meta.feature[cmds[1]], function(args) { can.Update(can.request(event, {_handle: ice.TRUE}, can.Option()), cmds.slice(0, 2).concat(args), cb) }) + } return can.user.input(event, can, meta.feature[cmds[1]], function(args) { can.Update(can.request(event, {_handle: ice.TRUE}, msg, can.Option()), cmds.slice(0, 2).concat(args), cb) }) } return can.onengine._plugin(event, can, msg, can, cmds, cb) || can.run(event, cmds, function(msg) { if (can.base.isFunc(cb)) { return cb(msg) } if (silent) { return } @@ -264,7 +264,7 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) { // can.page.style(can, can._output, html.HEIGHT, "", html.WIDTH, ""), can.onappend.style(sub, sub.Conf(ctx.STYLE)) can.onappend.style(sub, sub.Conf(ctx.STYLE)) if (can.isFullMode() || can.isCmdMode()) { can.onimport.size(can, can.page.height(), can.page.width(), true) } - can.onmotion.story.auto(can, can._output), can.onexport.output(can, msg), can.base.isFunc(cb) && cb(msg) + can.onmotion.story.auto(can, can._output), can.onexport.output(sub, msg), can.base.isFunc(cb) && cb(msg) }, target: output}) }) }, @@ -424,6 +424,9 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) { }} }); table && can.onappend.style(can, chat.CONTENT, table), msg.append && msg.append[msg.append.length-1] == ctx.ACTION && can.onappend.style(can, ctx.ACTION, table) ;(can.isCmdMode() || table.offsetWidth > can.ConfWidth() / 2) && can.onappend.style(can, "full", table) + can.page.Select(can, table, "input", function(target) { + target.name == target.value && (target.value = can.user.trans(can, target.value)) + }) return keys && can.page.RangeTable(can, table, can.core.List(keys, function(key) { return can.page.Select(can, table, html.TH, function(th, index) { if (th.innerHTML == key) { return index } })[0] })), table }, board: function(can, text, target) { text && text.Result && (text = text.Result()); if (!text) { return } diff --git a/index.css b/index.css index e0e215d4..085ce93d 100644 --- a/index.css +++ b/index.css @@ -10,9 +10,9 @@ body { --code-datatype:cornflowerblue; --code-function:darkcyan; --code-constant:gray; --code-string:brown; --code-object:purple; - --svg-stroke-width:2; --box-border:var(--plugin-border-color) solid 1px; --box-shadow:var(--body-fg-color) 2px 2px 8px; + --svg-stroke-width:2; } /* element */ * { tab-size:4; box-sizing:border-box; padding:0; border:0; margin:0; } @@ -42,6 +42,7 @@ body:not(.windows) div.code { font-family:monospace; } body:not(.windows) div.tabs { font-family:monospace; } body:not(.windows) div.path { font-family:monospace; } body:not(.windows) div.carte { font-family:monospace; } +fieldset.panel.Action.tabs table.content { width:100%; } 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; } ol, ul { margin-left:40px; } @@ -174,11 +175,15 @@ fieldset.float div.text:hover>span.icon.delete { visibility:hidden; } body.mobile:not(.landscape) fieldset.float>form.option>div.text>span.value { display:none; } body.windows form.option>div.icon { font-size:21px; } /* svg */ +fieldset.web.wiki.draw div.output svg { min-width:100%; min-height:100%; } svg text { font-size:24px; font-family:monospace; stroke:var(--body-fg-color); fill:var(--body-fg-color); cursor:pointer; } -svg text:hover { font-size:24px; font-family:monospace; stroke:var(--hover-fg-color); fill:var(--hover-fg-color); cursor:pointer; } +svg text:hover { stroke:var(--hover-fg-color); fill:var(--hover-fg-color); cursor:pointer; } svg rect { stroke-width:var(--svg-stroke-width); stroke:var(--body-fg-color); fill:var(--output-bg-color); } +svg rect:hover { stroke:var(--hover-fg-color); fill:var(--hover-bg-color); } svg line { stroke-width:var(--svg-stroke-width); stroke:var(--body-fg-color); } +svg line:hover { stroke:var(--hover-fg-color); } svg path { stroke-width:var(--svg-stroke-width); stroke:var(--body-fg-color); } +svg path:hover { stroke:var(--hover-fg-color); } svg g[stroke] text { stroke:unset; } svg g[stroke] rect { stroke:unset; } svg g[stroke] line { stroke:unset; } @@ -189,7 +194,8 @@ svg g[fill] rect { fill:unset; } div.project div.list { margin-left:10px; clear:both; } div.project div.item { padding:2px 10px; } div.project div.item.filter { padding:0; } -div.project div.item.filter input { width:100%; } +div.project div.item.filter>input { width:100%; } +div.project div.item.filter>span.delete { top: 3px; right: 5px; } div.project div.item>div.name { padding-left:15px; } div.project div.expand { float:left; transition:all .3s; } div.project div.expand.open { rotate:90deg; translate:1px 2px; transition:all .3s; } @@ -198,7 +204,8 @@ div.project div.zone>div.item>div.icon { margin-left:3px; float:right; } div.project div.zone>div.list>div.zone>div.item { text-align:left; padding-left:20px; } div.project div.zone>div.list>div.zone>div.item:hover { margin-left:10px; transition:all 0.3s; } fieldset>div.output div.project { border-right:var(--box-border); width:230px; } -fieldset>div.output div.profile { border-left:var(--box-border); max-width:320px; } +/* fieldset>div.output div.profile { border-left:var(--box-border); max-width:320px; } */ +fieldset>div.output div.profile { border-left:var(--box-border); } fieldset>div.output div.display { border-top:var(--box-border); } /* table card */ div.output.card>div.item.stop { color:var(--disable-fg-color); } diff --git a/lib/page.js b/lib/page.js index 3392d651..258415f8 100644 --- a/lib/page.js +++ b/lib/page.js @@ -24,7 +24,7 @@ Volcanos("page", { SelectInput: function(can, target, name, cb) { return can.page.Select(can, target, "input[name="+name+"]", cb)[0] }, SelectChild: function(can, target, key, cb) { return can.core.List(can.page.Select(can, target, key||"*", function(node) { if (node.parentNode == target) { return node } }), cb) }, SelectOne: function(can, target, key, cb) { return can.page.Select(can, target, key, function(target, index) { return index == 0 && can.base.isFunc(cb) && cb(target), target })[0] }, - Select: function(can, target, key, cb, interval, cbs) { target = target || document.body + Select: function(can, target, key, cb, interval, cbs) { target = target || document.body, key = key||"*" return can.core.List(key == nfs.PT? [target]: target.querySelectorAll(can.page.Keys(key)), cb, interval, cbs) }, Modify: function(can, target, value) { target = can.base.isString(target)? document.querySelector(target): target; if (!target) { return } diff --git a/lib/user.js b/lib/user.js index fd1686e5..a7cc336c 100644 --- a/lib/user.js +++ b/lib/user.js @@ -163,6 +163,10 @@ Volcanos("user", { carteRight: function(event, can, meta, list, cb, parent) { var carte = can.user.carte(event, can, meta, list, cb, parent) return carte && can.onlayout.figure(event, can, carte._target, true), carte }, + carteItem: function(event, can, item) { if (!item.action) { return } + var trans = {}, list = can.page.Select(can, can.page.Create(can, html.DIV, item.action), "", function(target) { trans[target.name] = can.user.trans(can, target.value); return target.name }) + can.user.carteRight(event, can, {_trans: trans}, list, function(event, button) { can.Update(can.request(event, item), [ctx.ACTION, button]) }) + }, input: function(event, can, form, cb, button) { if (!form || form.length == 0) { return cb() } var msg = can.request(event); event = event._event||event; var need = {} var ui = can.page.Append(can, document.body, [{view: [[html.INPUT, chat.FLOAT]], list: [ @@ -170,7 +174,8 @@ Volcanos("user", { {view: html.OPTION, list: [{type: html.TABLE, list: can.core.List(form, function(item) { item = can.base.isString(item)? {type: html.TEXT, name: item}: item.length > 0? {type: html.SELECT, name: item[0], values: item.slice(1)}: item item.type = item.type||(item.values? html.SELECT: item.name == html.TEXT? html.TEXTAREA: html.TEXT), need[item.name] = item.need - item._init = function(target) { if (item.type == html.SELECT) { return can.onmotion.delay(can, function() { can.onappend.select(can, target, item) }) } + item._init = function(target) { if (item.type == html.SELECT) { target.value = item.value||item.values[0] + return can.onmotion.delay(can, function() { can.onappend.select(can, target, item) }) } if (item.name && item.name != ctx.ACTION) { target.value = msg.Option(item.name)||can.Option(item.name)||target.value||"" } item.mode = chat.SIMPLE, can.onappend.figure(can, can.base.Copy({run: function(event, cmds, cb) { var _msg = can.request(event, {_handle: ice.TRUE, action: msg.Option(html.ACTION)}, msg, can.Option()) can.page.Select(can, ui.table, html.OPTION_ARGS, function(item) { item.name && item.value && _msg.Option(item.name, item.value) }) diff --git a/panel/action.css b/panel/action.css index 6b4008d8..27a0a699 100644 --- a/panel/action.css +++ b/panel/action.css @@ -18,7 +18,8 @@ fieldset.Action.grid>div.output>fieldset.plugin>div.action { display:none; } fieldset.Action.grid>div.output>fieldset.plugin>div.status { display:none; } fieldset.Action.grid>div.output>fieldset.plugin>form.option input[type=text] { width:80px; } fieldset.Action>div.project.toggle { font-size:32px; cursor:pointer; padding-top:50px; height:150px; position:fixed; top:30%; border-top-right-radius:20px; border-bottom-right-radius:20px; } -fieldset.Action>div.project.toggle { background-color:#4a566e6e; color:white; width:20px; } +fieldset.Action>div.project.toggle { background-color:#4a566e6e; color:var(--body-fg-color); width:20px; } +fieldset.Action>div.project.toggle:hover { background-color:var(--hover-bg-color); color:var(--hover-fg-color); width:20px; } fieldset.Action.tabview>div.project.toggle { display:none; } fieldset.Action.vertical>div.project.toggle { display:none; } fieldset.Action.horizon>div.project.toggle { display:none; } diff --git a/plugin/local/code/inner.js b/plugin/local/code/inner.js index dd753ec1..d8016305 100644 --- a/plugin/local/code/inner.js +++ b/plugin/local/code/inner.js @@ -112,11 +112,13 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb) { var paths = can.core.Sp }, tabview: function(can, path, file, line, cb) { path = path||can.Option(nfs.PATH); var key = can.onexport.keys(can, path, file) function isIndex() { return line == ctx.INDEX } function isSpace() { return line == web.SPACE } - function show(skip) { can._msg && can._msg.Option(nfs.LINE, can.Option(nfs.LINE)), can._msg = can.db.tabview[key] + function show(skip) { can._msg && can._msg.Option && can._msg.Option(nfs.LINE, can.Option(nfs.LINE)), can._msg = can.db.tabview[key] can.Option(can.onimport.history(can, {path: path, file: file, line: line||can.misc.sessionStorage(can, SELECT_LINE+nfs.DF+path+file)||can._msg.Option(nfs.LINE)||1})) can.onsyntax._init(can, can._msg, function(content) { var msg = can._msg; can.onexport.hash(can) can.isCmdMode() && can.onexport.title(can, (isIndex()||isSpace()? "": path)+file), can.onmotion.select(can, can.ui.tabs, html.DIV_TABS, msg._tab), can.isCmdMode() && msg._tab.scrollIntoView() - if (isSpace()) { can.ui.path.innerHTML = can.page.Format(html.A, can.misc.MergePodCmd(can, {pod: can.Option(nfs.FILE)})) } else if (isIndex()) { + if (isSpace()) { + can.ui.path.innerHTML = can.page.Format(html.A, can.misc.MergePodCmd(can, {pod: can.Option(nfs.FILE)})) + } else if (isIndex()) { can.onimport._tabPath(can, nfs.PT, ice.CMD, can.Option(nfs.FILE), function(p, pre) { can.onimport.tabview(can, "", can.core.Keys(can.base.trimSuffix(pre, nfs.PT), p), ctx.INDEX) }, can.ui.path) @@ -136,6 +138,7 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb) { var paths = can.core.Sp function load(msg) { var skip = false; can.db.tabview[key] = msg; var name = file if (can.base.beginWith(file, web.HTTP)) { name = decodeURI(file.split(web.QS)[0]) var link = can.misc.ParseURL(can, name); if (link.pod) { name = link.pod } + name = can.base.trimPrefix(name, location.origin) } else { name = file.split(mdb.FS)[0].split(isIndex()? nfs.PT: nfs.PS).pop() } @@ -189,7 +192,7 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb) { var paths = can.core.Sp if (can.base.isIn(item.index, web.WIKI_WORD)) { item.style = html.OUTPUT } can.onimport.plug(can, item, function(sub) { sub.onaction.close = function() { can.onmotion.hidden(can, target), can.onimport.layout(can) } - sub.onexport.output = function(_sub, _msg) { can.onmotion.delay(can, function() { can.base.isFunc(cb) && cb(_sub, _msg) }) } + sub.onexport.output = function(_sub, _msg) { can.onmotion.delay(can, function() { can.base.isFunc(cb) && cb(_sub.sup, _msg) }) } }, target) }) } else if (msg.Option(ice.MSG_DISPLAY) != "") { @@ -223,11 +226,9 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb) { var paths = can.core.Sp can.ui.layout(can.ConfHeight(), can.ConfWidth(), 0, function(height, width) { can.ui.content = content, can.onlayout.layout(can, height, width) var sub = can.ui.profile._plugin; sub && can.page.isDisplay(can.ui.profile) && sub.onimport && sub.onimport.size(sub, can.ui.profile.offsetHeight, can.ui.profileWidth, true) var sub = can.ui.content._plugin; if (!sub) { return } if (height == sub.ConfHeight()+sub.onexport.actionHeight(sub)+sub.onexport.statusHeight(sub) && width == sub.ConfWidth()) { return } - content._root || sub.onimport.size(sub, height, width, true), can.onlayout.layout(can) + content._root || sub.onimport.size(sub, height, width, true), can.onlayout.layout(can, height, width) }) - if (can.isCmdMode()) { - can.ui.zone.source._layout(), can.ui.zone[can.Option(nfs.PATH)] && can.ui.zone[can.Option(nfs.PATH)]._layout() - } + if (can.isCmdMode()) { can.ui.zone.source._layout(), can.ui.zone[can.Option(nfs.PATH)] && can.ui.zone[can.Option(nfs.PATH)]._layout() } }, exts: function(can, url, cb) { var sub = can.db.toolkit[url.split(web.QS)[0]]; if (sub) { return can.base.isFunc(cb)? cb(sub): sub.select() } can.onimport.toolkit(can, {index: ice.CAN_PLUGIN, display: (url[0] == nfs.PS || url.indexOf(web.HTTP) == 0? "": can.base.Dir(can._path))+url}, function(sub) { diff --git a/plugin/local/code/inner/syntax.js b/plugin/local/code/inner/syntax.js index 94e01383..a899faa9 100644 --- a/plugin/local/code/inner/syntax.js +++ b/plugin/local/code/inner/syntax.js @@ -270,7 +270,7 @@ Volcanos(chat.ONSYNTAX, { "padding": code.FUNCTION, "padding-left": code.FUNCTION, "padding-top": code.FUNCTION, "padding-right": code.FUNCTION, "padding-bottom": code.FUNCTION, "border": code.FUNCTION, "border-left": code.FUNCTION, "border-top": code.FUNCTION, "border-right": code.FUNCTION, "border-bottom": code.FUNCTION, "margin": code.FUNCTION, "margin-left": code.FUNCTION, "margin-top": code.FUNCTION, "margin-right": code.FUNCTION, "margin-bottom": code.FUNCTION, - "height": code.FUNCTION, "width": code.FUNCTION, "min-width": code.FUNCTION, "max-width": code.FUNCTION, "max-height": code.FUNCTION, + "height": code.FUNCTION, "width": code.FUNCTION, "min-width": code.FUNCTION, "max-width": code.FUNCTION, "min-height": code.FUNCTION, "max-height": code.FUNCTION, "display": code.FUNCTION, "visibility": code.FUNCTION, "overflow": code.FUNCTION, "float": code.FUNCTION, "clear": code.FUNCTION, "both": code.CONSTANT, "position": code.FUNCTION, "left": code.FUNCTION, "top": code.FUNCTION, "right": code.FUNCTION, "bottom": code.FUNCTION, "border-radius": code.FUNCTION, "outline": code.FUNCTION, "box-shadow": code.FUNCTION, "text-shadow": code.FUNCTION, @@ -328,6 +328,10 @@ Volcanos(chat.ONSYNTAX, { "calc": code.FUNCTION, "url": code.FUNCTION, "contexts": code.CONSTANT, + + "--body-bg-color": code.CONSTANT, "--body-fg-color": code.CONSTANT, + "--plugin-bg-color": code.CONSTANT, "--plugin-fg-color": code.CONSTANT, + "--hover-bg-color": code.CONSTANT, "--hover-fg-color": code.CONSTANT, }, include: ["html"], func: function(can, push, text) { text.indexOf("/* ") == 0 && push(can.base.trimPrefix(can.base.trimSuffix(text, " */"), "/* ")) }, }, diff --git a/plugin/local/code/vimer.js b/plugin/local/code/vimer.js index 5fe841d6..539cad0b 100644 --- a/plugin/local/code/vimer.js +++ b/plugin/local/code/vimer.js @@ -62,7 +62,7 @@ Volcanos(chat.ONFIGURE, { can.page.Select(can, sub._output, html.DIV_ITEM, function(target, index) { can.onappend.style(can, msg.status[index], target) }) }) }, }) -Volcanos(chat.ONACTION, {list: ["编译", "源码", "终端", "文档", "计划", "桌面", "后台", "官网"], +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) @@ -102,15 +102,15 @@ Volcanos(chat.ONACTION, {list: ["编译", "源码", "终端", "文档", "计划" var sub = can.db.toolkit[list[0]]; sub? sub.select(): can.onimport.exts(can, list[0]) }) }, "编译": function(event, can) { can.onaction.compile(event, can, code.COMPILE) }, + "终端": function(event, can) { can.user.input(can.request(event, {action: "xterm"}), can, [mdb.TYPE], function(args) { + can.onimport.tabview(can, "", [web.CODE_XTERM, args[1]||"ish"].join(mdb.FS), ctx.INDEX) + }) }, + "路由": function(event, can) { can.onimport.tabview(can, "", web.ROUTE, ctx.INDEX) }, + "构建": function(event, can) { can.onimport.tabview(can, "", web.CODE_COMPILE, ctx.INDEX) }, "源码": function(event, can) { can.onimport.tabview(can, "", web.CODE_GIT_STATUS, ctx.INDEX) }, - "终端": function(event, can) { - can.user.input(can.request(event, {action: "xterm"}), can, [mdb.TYPE], function(args) { - can.onimport.tabview(can, "", [web.CODE_XTERM, args[1]||"ish"].join(mdb.FS), ctx.INDEX) - }) - }, "文档": function(event, can) { can.onimport.tabview(can, "", web.WIKI_WORD, ctx.INDEX) }, "计划": function(event, can) { can.onimport.tabview(can, "", web.TEAM_PLAN, ctx.INDEX) }, - "桌面": function(event, can) { can.onimport.tabview(can, "", "web.chat.macos.desktop", ctx.INDEX) }, + "桌面": function(event, can) { can.onimport.tabview(can, "", web.CHAT_MACOS_DESKTOP, ctx.INDEX) }, "后台": function(event, can) { var pod = can.misc.Search(can, ice.POD); can.onimport.tabview(can, "", location.origin+"/chat/portal/"+(pod? "?pod="+pod: ""), web.SPACE) }, "官网": function(event, can) { can.onimport.tabview(can, "", can.misc.MergePodCmd(can, {cmd: web.WIKI_PORTAL}), web.SPACE) }, insertLine: function(can, value, before) { var line = can.onaction.appendLine(can, value); before && can.ui.content.insertBefore(line, can.onaction._getLine(can, before)); return can.onaction.rerankLine(can), can.onexport.line(can, line) }, diff --git a/plugin/local/wiki/draw.js b/plugin/local/wiki/draw.js index 1c6d11f2..85378e6a 100644 --- a/plugin/local/wiki/draw.js +++ b/plugin/local/wiki/draw.js @@ -2,6 +2,7 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, target) { can.onmotion.clear( can.svg = null, can.group = null, can.temp = null, can.current = null, can.points = [], can._display_heights = {} if (can.Conf(ctx.INDEX) == web.WIKI_DRAW) { can.ui = can.onappend.layout(can); if (can.user.isMobile) { can.onmotion.hidden(can, can.ui.project), can.onmotion.hidden(can, can.ui.profile) } + can.onmotion.hidden(can, can.ui.project), can.onmotion.hidden(can, can.ui.profile) } else { can.ui = {content: can._output} } can.page.Modify(can, can.ui.content, msg.Results()||can.onexport.content(can)), can.onexport.title(can, can.Option(nfs.PATH)) can.page.Select(can, can.ui.content, html.SVG, function(target) { can.svg = can.group = can.onimport._block(can, target), can.onimport._group(can, target) diff --git a/plugin/state.js b/plugin/state.js index f500d04d..94f6a12e 100644 --- a/plugin/state.js +++ b/plugin/state.js @@ -17,6 +17,10 @@ Volcanos(chat.ONIMPORT, { sub.Conf(can.base.Obj(item.conf)); if (sub.isSimpleMode()) { sub.ConfHeight(can.ConfHeight()/2) var res = can.request(); res.Echo(sub.Conf(ice.MSG_RESULT)), can.onappend._output(sub, res, sub.Conf(ctx.DISPLAY)); return } + if (can.page.ClassList.has(can, sub._target, html.FLOAT)) { + height = window.innerHeight/2, width = window.innerWidth/2 + can.onmotion.move(can, sub._target, {left: window.innerWidth-width, top: window.innerHeight-height}) + } sub.run = function(event, cmds, cb) { sub.onimport.size(sub, height, width, true) sub.onexport.output = function() { sub.onimport.size(sub, height, width, true) // can.page.SelectChild(can, can._output, html.TABLE, function(target) { can.page.style(can, target, html.MAX_HEIGHT, height, html.DISPLAY, html.BLOCK) }) @@ -26,8 +30,6 @@ Volcanos(chat.ONIMPORT, { can.page.SelectChild(can, can._output, html.FIELDSET, function(target) { can.page.style(can, target, "z-index", "9") }) can.page.style(can, sub._target, "z-index", "10") } - can.page.style(can, sub._target, "z-index", "10") - can.onappend.style(can, "move", sub._target) can.base.isFunc(cb) && cb(sub) }) }) }, diff --git a/plugin/table.js b/plugin/table.js index 880458c0..f0c8e2f4 100644 --- a/plugin/table.js +++ b/plugin/table.js @@ -86,7 +86,7 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, target) { can.onmotion.clear( "+", function(event) { sub.Update(event, [ctx.ACTION, mdb.CREATE]) }, "=", function() { can.onimport.tabview(can, "", sub._index, ctx.INDEX) }, )) - sub.onexport.output = function(sub, msg) { zone._total(msg.Length()), cb(sub, msg) + sub.onexport.output = function(_sub, msg) { zone._total(msg.Length()), cb(sub, msg) zone._menu = shy({_trans: sub._trans}, action.concat(can.base.Obj(msg.Option(ice.MSG_ACTION), [])), function(event, button, meta, carte) { sub.Update(event, [ctx.ACTION, button]), carte.close() }), can.user.toastSuccess(can) @@ -149,9 +149,12 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, target) { can.onmotion.clear( }) }); return node }, item: function(can, item, cb, cbs, target) { target = target||(can.ui && can.ui.project? can.ui.project: can._output) - var ui = can.page.Append(can, target, [{view: [html.ITEM, html.DIV, item.nick||item.name], title: item.title, onclick: function(event) { can.onmotion.select(can, target, html.DIV_ITEM, event.target) + var ui = can.page.Append(can, target, [{view: [html.ITEM, html.DIV, item.nick||item.name||item.zone], title: item.title, onclick: function(event) { can.onmotion.select(can, target, html.DIV_ITEM, event.target) cb(event, event.target, event.target._list && can.onmotion.toggle(can, event.target._list)) - }, oncontextmenu: function(event) { if (can.base.isFunc(cbs)) { var menu = cbs(event, ui._target); if (menu) { can.user.carteRight(event, can, menu.meta, menu.list, menu) } } }, + }, oncontextmenu: function(event) { + if (can.base.isFunc(cbs)) { var menu = cbs(event, ui._target); if (menu) { can.user.carteRight(event, can, menu.meta, menu.list, menu) } return } + can.user.carteItem(event, can, item) + }, }]); return ui._target }, itemlist: function(can, list, cb, cbs, target) { diff --git a/proto.js b/proto.js index b881b5bb..57f86142 100644 --- a/proto.js +++ b/proto.js @@ -79,7 +79,7 @@ var mdb = { EQ: ice.EQ, FS: ice.FS, } var web = {CHAT: "chat", LINK: "link", - SPACE: "space", DREAM: "dream", SHARE: "share", SPIDE: "spide", + DREAM: "dream", SPACE: "space", ROUTE: "route", SPIDE: "spide", COUNT: "count", SHARE: "share", WEBSITE: "website", DRAW: "draw", PLAY: "play", CLEAR: "clear", REFRESH: "refresh", RESIZE: "resize", FILTER: "filter", INPUT: "input", CANCEL: "cancel", SUBMIT: "submit", UPLOAD: "upload", DOWNLOAD: "download", TOIMAGE: "toimage", SHARE_CACHE: "/share/cache/", SHARE_LOCAL: "/share/local/", @@ -99,6 +99,7 @@ var web = {CHAT: "chat", LINK: "link", TEAM_PLAN: "web.team.plan", WIKI_PORTAL: "web.wiki.portal", CHAT_PORTAL: "web.chat.portal", + CODE_COMPILE: "web.code.compile", } var aaa = { LOGIN: "login", LOGOUT: "logout", INVITE: "invite", TOKEN: "token",