diff --git a/const.js b/const.js index f5b45b93..1170e022 100644 --- a/const.js +++ b/const.js @@ -512,10 +512,10 @@ var svg = { TEXT_LENGTH: "textLength", } try { module.exports = { - kit, ice, - ctx, mdb, web, aaa, - lex, yac, ssh, gdb, - tcp, nfs, cli, log, - code, wiki, chat, team, mall, - http, html, icon, svg -} } catch {} + kit: kit, ice: ice, + ctx: ctx, mdb: mdb, web: web, aaa: aaa, + lex: lex, yac: lex, ssh: ssh, gdb: gdb, + tcp: tcp, nfs: nfs, cli: cli, log: log, + code: code, wiki: wiki, chat: chat, team: team, mall: mall, + http: http, html: html, icon: icon, svg: svg +} } catch (e) {} diff --git a/frame.js b/frame.js index 02b0e281..d44a5dc2 100644 --- a/frame.js +++ b/frame.js @@ -153,7 +153,7 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) { if (can.base.beginWith(value, nfs.PS, ice.HTTP)) { value = can.page.Format(html.A, value) } return can.base.isUndefined(value)? (value = target.innerText): (target.innerHTML = value.trim? value.trim(): value+"") }); return value - } catch {} }, + } catch (e) {} }, Action: function(key, value) { // value && (value = can.user.trans(sub, value, null, html.INPUT)) return can.page.SelectArgs(can, action, key, value)[0] @@ -269,7 +269,7 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) { meta[item[0]]? can.core.CallFunc(meta[item[0]], [event, can, item[0], button]): meta[button]? can.core.CallFunc(meta[button], [event, can, button]): can.Action(item[0], button) })}, _init: function() { - if (can.onexport.session) { var value = can.onexport.session(can, "action:"+item[0]); value && can.Action(item[0], value) } + if (can.onexport && can.onexport.session) { var value = can.onexport.session(can, "action:"+item[0]); value && can.Action(item[0], value) } }}: /* 4.其它 */(item.type == html.BUTTON && (item.value = item.value||can.user.trans(can, item.name, meta._trans), item.onclick = item.onclick||function(event) { run(event, item.name||item.value) }, item._init = item._init||function(target) { item.action && can.onappend.figure(sub, item, target, function(_sub, value) { can.Update() }) @@ -304,6 +304,9 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) { if (can.base.isFunc(cb) && !cb(msg)) { return } if (silent) { return } if (_can == (msg._can._fields? msg._can.sup: msg._can)) { if (can.core.CallFunc([_can, chat.ONIMPORT, ice.MSG_PROCESS], {can: _can, msg: msg})) { return } } if (cmds && cmds[0] == ctx.ACTION) { if (can.base.isIn(cmds[1], mdb.CREATE, mdb.INSERT, mdb.PRUNES, mdb.EXPORT, mdb.IMPORT, "exports", "imports", nfs.TRASH) || msg.Length() == 0 && !msg.Result()) { + if (can.base.isIn(cmds[1], ctx.COMMAND)) { + return + } return can._toast || can.user.toastSuccess(can, cmds[1], ice.SUCCESS), can.Update() } } can.onappend._output(can, msg, meta.display||msg.Option(ice.MSG_DISPLAY)||meta.feature.display) @@ -405,11 +408,13 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) { field: function(can, type, item, target) { type = type||html.STORY, item = item||{} var name = can.core.Split(item.nick||item.index||"", " .").pop()||""; can.base.isIn(name, "cluster", - tcp.SERVER, tcp.CLIENT, web.STUDIO, mdb.SEARCH, web.SERVICE, can.core.Split(can.ConfIndex(), nfs.PT).pop(), "launchTemplate", + "launchTemplate", + tcp.SERVER, tcp.CLIENT, web.STUDIO, mdb.SEARCH, web.SERVICE, + can.core.Split(can.ConfIndex(), nfs.PT).pop() ) && (name = (item.index||"").split(nfs.PT).slice(-2).join(nfs.PT)) - type == html.PLUG || (type == html.STORY && item.style != html.FLOAT) || can.base.isIn(can.ConfIndex(), - // web.DESKTOP, web.MESSAGE, web.VIMER, - ) || (name = can.core.Keys(item.space||item._space, name)) + type == html.PLUG || (type == html.STORY && item.style != html.FLOAT) || + // can.base.isIn(can.ConfIndex(), web.DESKTOP, web.MESSAGE, web.VIMER) || + (name = can.core.Keys(item.space||item._space, name)) item.index && (item.help = item.help||can.user.trans(can, item.index.split(".").pop(), "")) var title = item.title || can.user.isMobile && (can.user.isEnglish(can)? name: (item.help||name)) || (!item.help || name == item.help || can.user.isEnglish(can)? name: name+"("+can.core.Split(item.help)[0]+")") target = can.base.isFunc(target)? target(): target @@ -574,7 +579,7 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) { function run(event, cmd, arg) { can.misc.Event(event, can, function(msg) { can.run(request(event), [ctx.ACTION, cmd].concat(arg)) }) } function img(p) { return !msg.IsDetail()? can.page.Format(html.IMG, p, 48, 48): can.user.isMobile? can.page.Format(html.IMG, p, null, 320): can.page.Format(html.IMG, p, 320, null) } // if (key == mdb.NAME && value) { _value = can.user.trans(can, value, null, html.INPUT) } - if (key == mdb.ICON && value) { _value = can.base.contains(value, ".ico", ".png", ".jpg")? img(can.misc.Resource(can, data[key], data[ice.POD]||data[web.SPACE])): `` } + if (key == mdb.ICON && value) { _value = can.base.contains(value, ".ico", ".png", ".jpg")? img(can.misc.Resource(can, data[key], data[ice.POD]||data[web.SPACE])): "" } if (key == mdb.ICONS && value) { _value = img(can.misc.Resource(can, data[key])) } if (key == nfs.IMAGE && value) { _value = can.core.List(can.core.Split(data[key]), function(item) { return img(can.misc.ShareCache(can, item, data.space)) }).join("") } if (key == web.SPACE && value) { _value = can.page.Format(html.A, can.misc.MergePodCmd(can, {pod: value}), value) } @@ -765,7 +770,7 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) { }), can.core.List(list, function(item) { if (can.base.isArray(item)) { layout(type == FLOW? FLEX: FLOW, item, height, width) } }) } ui.project && can.user.isMobile && can.onmotion.hidden(can, ui.project); ui.filter = can.onappend.filter(can, ui.project) ui.display && can.onmotion.hidden(can, ui.display), ui.profile && can.onmotion.hidden(can, ui.profile) - can.onexport.session && can.onexport.session(can, "project.hide") == "true" && can.onmotion.hidden(can, ui.project) + can.onexport.session && can.onexport.session(can, "project.hide") == "true" && ui.project && can.onmotion.hidden(can, ui.project) can.onexport.session && can.onexport.session(can, "display.show") == "true" && can.onmotion.toggle(can, ui.display, true) can.onexport.session && can.onexport.session(can, "profile.show") == "true" && can.onmotion.toggle(can, ui.profile, true) ui.layout = function(height, width, delay, cb) { can.onmotion.delay(can, function() { diff --git a/index.css b/index.css index ba72b9ca..e6fbfa5e 100644 --- a/index.css +++ b/index.css @@ -262,6 +262,7 @@ div.layout>div.profile:not(.toggle) { width:50%; flex:0 0 50%; } fieldset.story div.project:not(.toggle) { width:230px; flex:0 0 230px; } div.layout>div.toggle.profile { top:20%; right:0; border-top-left-radius:var(--plugin-radius); border-bottom-left-radius:var(--plugin-radius); } div.layout>div.toggle.display { left:20%; bottom:-52px; transform:rotate(90deg); border-top-left-radius:var(--plugin-radius); border-bottom-left-radius:var(--plugin-radius); } +div.layout:not(:hover)>div.toggle { display:none; } /* fieldset */ body.mobile div.item.online.state { display:none; } div.item.online.state { margin-left:var(--button-margin) !important; display:block; align-items:center; } @@ -272,7 +273,7 @@ div.item.online.state img:hover { background-color:var(--hover-bg-color); } div.item.online.state:not(:hover) img:not(:first-child) { margin-right:-20px; } fieldset.output>div.header { display:none; } fieldset>div.header { display:contents; } -fieldset>div.header>div { line-height:22px; padding:var(--input-padding); height:var(--action-height); float:right; } +fieldset>div.header>div { line-height:22px; padding:var(--input-padding); margin-left:var(--input-margin); height:var(--action-height); float:right; } fieldset>div.header>div.avatar { padding:0; } fieldset>div.header div.online { padding:0; } fieldset>div.header img { height:var(--action-height); float:right; } @@ -560,8 +561,8 @@ fieldset:not(.panel):hover { box-shadow:var(--notice-box-shadow); } body.light fieldset.plugin>legend { box-shadow:var(--legend-box-shadow); margin-right:var(--legend-margin); } body.light fieldset.story>legend { box-shadow:var(--legend-box-shadow); margin-right:var(--legend-margin); } fieldset.story>legend { border-top-left-radius:var(--plugin-radius); } -fieldset.float>form.option input:not(:hover) { border-top:0; } -fieldset.float>div.action input:not(:hover) { border-top:0; } +// fieldset.float>form.option div.item.text input:not(:hover) { border-top:0; } +// fieldset.float>div.action div.item.text input:not(:hover) { border-top:0; } fieldset>form.option div.item:not(.icon) { box-shadow:var(--input-box-shadow); } fieldset>form.option div.item.select { border-radius:var(--button-radius); } fieldset>form.option div.item.button { border-radius:var(--button-radius); } @@ -657,10 +658,10 @@ form.option>div.item.icon.refresh { font-size:28px; line-height:26px; display:fl form.option>div.item.icon.goback { font-size:28px; line-height:26px; display:flex; align-items:flex-start; } form.option>div.icon.delete { font-size:20px; line-height:33px; display:flex; align-items:flex-start; } form.option>div.item.icon.play { font-size:16px; } -body.windows form.option>div.item.icon.delete { line-height:31px; display:flex; align-items:flex-start; } -body.windows form.option>div.item.icon.menu { font-size:18px; line-height:30px; padding:0 3px; } -body.windows form.option>div.item.icon.refresh { font-size:24px; line-height:28px; } -body.windows form.option>div.item.icon.goback { font-size:24px; line-height:28px; } +body.windows form.option>div.item.icon.delete { line-height:32px; display:flex; align-items:flex-start; } +body.windows form.option>div.item.icon.menu { font-size:18px; line-height:32px; padding:0 3px; } +body.windows form.option>div.item.icon.refresh { font-size:24px; line-height:32px; } +body.windows form.option>div.item.icon.goback { font-size:24px; line-height:32px; } div.item.text { position:relative; } div.item.text.filter input { padding-left:24px; } div.item.text._icon input { padding-left:24px; } @@ -695,7 +696,7 @@ div.item.button.create>span.icon { font-size:28px; line-height:26px; height:var( div.item.button.insert>span.icon { font-size:28px; line-height:26px; height:var(--action-height); } div.item.button.refresh>span.icon { font-size:28px; line-height:26px; height:var(--action-height); } body.windows div.item.button.create>span.icon { line-height:28px; } -body.windows div.item.button.refresh>span.icon { font-size:22px; line-height:30px; } +body.windows div.item.button.refresh>span.icon { font-size:22px; line-height:32px; } div.item.button._space.icons { flex-grow:1; min-width:var(--button-margin); } div.item.button._space.icons:hover { background-color:unset; cursor:unset; } fieldset.inner fieldset.story div.item.button._space.icons { margin-left:0; flex-grow:1; } @@ -743,7 +744,7 @@ fieldset.story.float:not(.plug)>form.option>div.text:not(.filter)>input { displa fieldset.story.float:not(.plug)>form.option>div.text.filter>span.value { display:none; } fieldset.story.float:not(.plug)>form.option>div.text>span.icon { display:none; } fieldset.story.float:not(.plug)>form.option>div.text>span.value { display:unset; } -fieldset.float>div.action>div.item.button._space.icons { margin-left:0; } +// fieldset.float>div.action>div.item.button._space.icons { margin-left:0; } /* svg */ svg text { font-size:var(--svg-font-size); font-family:var(--svg-font-family); stroke:var(--body-fg-color); fill:var(--body-fg-color); cursor:pointer; } svg text.offline { stroke:var(--disable-fg-color); fill:var(--disable-fg-color); } @@ -833,6 +834,14 @@ body.print fieldset.draw div.output div.content svg { background-color:lightgray fieldset.iframe>form.option>div.item.hash input { width:var(--form-width); } fieldset.iframe.float>form.option>div.item.hash input { width:var(--form-width); } fieldset.desktop { border:0; } +fieldset.desktop>legend { background-color:transparent; color:silver; } +fieldset.desktop>form.option input { background-color:transparent; } +fieldset.desktop>div.action input { background-color:transparent; } +fieldset.desktop>form.option { color:silver; } +fieldset.desktop>div.action { color:silver; } +fieldset.desktop>div.status { color:silver; } +fieldset.desktop.float>form.option>div.item:not(.delete) { display:none; } +fieldset.desktop.float>div.status { display:none; } fieldset.qrcode>div.output div.code { padding:0; } fieldset.xterm>div.output>div.project { font-family:var(--code-font-family); } fieldset.vimer>div.output>div.project div.item.modify { background-color:#00800036; } diff --git a/lib/misc.js b/lib/misc.js index 90bd36e6..add35c46 100644 --- a/lib/misc.js +++ b/lib/misc.js @@ -24,8 +24,8 @@ Volcanos("misc", { OptionStatus: function() { return msg.Option(ice.MSG_STATUS) }, StatusTimeCount: function(obj) { msg.append && msg.Status(can.base.Copy(kit.Dict(mdb.TIME, can.base.Time(), mdb.COUNT, msg.Length()+"x"+msg.append.length), obj)) }, Status: function(obj) { return msg.Option(ice.MSG_STATUS, JSON.stringify(can.core.Item(obj, function(key, value) { return {name: key, value: value} }))) }, - OptionDefault(key, val) { var arg = arguments; for (var i = 0; i < arg.length; i += 2) { msg.Option(arg[i]) || msg.Option(arg[i], arg[i+1]) } return msg.Option(key) }, - OptionSimple(key) { var arg = arguments, res = [] + OptionDefault: function(key, val) { var arg = arguments; for (var i = 0; i < arg.length; i += 2) { msg.Option(arg[i]) || msg.Option(arg[i], arg[i+1]) } return msg.Option(key) }, + OptionSimple: function(key) { var arg = arguments, res = [] for (var i = 0; i < arg.length; i++) { res.push(arg[i], msg.Option(arg[i])) } return res }, @@ -194,7 +194,7 @@ Volcanos("misc", { args.text = location.pathname+location.search, args.module = "shylinux.com/x/volcanos", args.version = can.base.trimPrefix(window._version, "?_v=") var msg = can.request(); can.page.exportValue(can, msg), can.core.List(msg.Option(), function(value) { args[value] = msg.Option(value) }) var url = location.protocol.replace(ice.HTTP, "ws")+"//"+location.host+"/space/"; if (url.indexOf(html.CHROME) == 0) { url = "ws://localhost:9020/space/" } - try { var socket = new WebSocket(can.base.MergeURL(url, args)); _msg = _msg || can.request()._caller() } catch {} + try { var socket = new WebSocket(can.base.MergeURL(url, args)); _msg = _msg || can.request()._caller() } catch (e) {} can._socket = socket, socket.onclose = function() { can.misc.Log(html.WSS, cli.CLOSE, args); if (socket._close) { return } can.base.isFunc(onclose)? onclose(socket): can.core.Timer(can.base.random(3000, 300), function() { args.name = args.name||can._wss_name, can.misc.WSS(can, args, cb, onopen, onerror, onclose, _msg) @@ -220,20 +220,20 @@ Volcanos("misc", { }) } return socket }, - ResourceFavicon(can, path) { return can.misc.Resource(can, path||can.user.info.favicon||nfs.SRC_MAIN_ICO) }, - Resource(can, path, space, serve) { + ResourceFavicon: function(can, path) { return can.misc.Resource(can, path||can.user.info.favicon||nfs.SRC_MAIN_ICO) }, + Resource: function(can, path, space, serve) { if (!can.base.beginWith(path, web.HTTP, nfs.PS)) { path = nfs.P+path+_version } if (!can.base.beginWith(path, web.HTTP)) { if (serve && serve.indexOf(location.origin) == -1) { var u = can.base.ParseURL(serve); path = u.origin + path } } if (path.indexOf("pod=") > 0) { return path } return can.base.MergeURL(path, ice.POD, space||can.ConfSpace()||can.misc.Search(can, ice.POD)) }, - ShareLocal(can, path, space) { if (can.base.beginWith(path, web.HTTP, nfs.PS)) { return path } + ShareLocal: function(can, path, space) { if (can.base.beginWith(path, web.HTTP, nfs.PS)) { return path } return can.base.MergeURL(nfs.SHARE_LOCAL+path+_version, ice.POD, space||can.ConfSpace()) }, - ShareCache(can, path, space) { if (can.base.beginWith(path, web.HTTP, nfs.PS)) { return path } + ShareCache: function(can, path, space) { if (can.base.beginWith(path, web.HTTP, nfs.PS)) { return path } return can.base.MergeURL(nfs.SHARE_CACHE+path+_version, ice.POD, space||can.ConfSpace()||can.misc.Search(can, ice.POD)) }, - Template(can, path, file) { return can.base.Path(nfs.SRC_TEMPLATE, can.ConfIndex(), path, file) }, + Template: function(can, path, file) { return can.base.Path(nfs.SRC_TEMPLATE, can.ConfIndex(), path, file) }, MergePath: function(can, file, path) { return file.indexOf(nfs.PS) == 0 || file.indexOf(ice.HTTP) == 0? file: can.base.Path(path, file) }, MergeCache: function(can, hash, pod) { return can.base.MergeURL(can.misc.MergeURL(can, {_path: can.base.Path(web.SHARE_CACHE, hash)}, true), ice.POD, pod||can.ConfSpace()||can.misc.Search(can, ice.POD)) }, MergePodCmd: function(can, obj) { diff --git a/lib/page.js b/lib/page.js index 68f1feb9..65374b7a 100644 --- a/lib/page.js +++ b/lib/page.js @@ -186,7 +186,7 @@ Volcanos("page", { 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: "colgroup", list: can.core.List(list, function(key) { if (key[0] != "_") { - try { var value = can.Option(key) } catch {} + try { var value = can.Option(key) } catch (e) {} if (value == undefined) { return {view: [key, "col"]} } return {view: [[key, "option"], "col"]} } }) }, {type: html.THEAD}, {type: html.TBODY}]}]) can.page.Append(can, ui.thead, [{type: html.TR, data: {dataset: {index: -1}}, list: can.core.List(list, function(key) { diff --git a/panel/footer.js b/panel/footer.js index 0ef79f39..b4a89627 100644 --- a/panel/footer.js +++ b/panel/footer.js @@ -193,34 +193,4 @@ Volcanos(chat.ONPLUGIN, { daemon: can.misc.sessionStorage(can, "can.daemon"), })).Display("/plugin/story/json.js") }), - dir: shy("网页目录", [nfs.PATH, ice.LIST, ice.BACK], async function(can, msg, arg, cb) { var can = msg._can._fields? msg._can.sup: msg._can - async function list(key, root) { can._handle[key] = root - for await (const [name, handle] of root) { if (can.base.beginWith(name, nfs.PT)) { continue } - if (handle.kind == nfs.FILE) { var _file = await handle.getFile() - msg.Push(mdb.TIME, can.base.Time(new Date(_file.lastModified))), msg.Push(nfs.PATH, key+name), msg.Push(nfs.SIZE, can.base.Size(_file.size)) - } else { - msg.Push(mdb.TIME, can.base.Time()), msg.Push(nfs.PATH, key+name+nfs.PS), msg.Push(nfs.SIZE, 0) - } - } can.onmotion.delay(can, function() { can.page.Select(can, can._output, "tr>th")[1].click(), can.page.Select(can, msg._can._output, "tr>th")[1].click() }, 50) - } can._handle = can._handle||{}; if (arg[0] == ctx.ACTION && arg[1] == ice.LIST) { arg = [] } - if (arg.length == 0) { if (!msg._event.isTrusted) { return msg.Echo(can.page.Format(html.INPUT, "", mdb.TYPE, html.BUTTON, mdb.NAME, ice.LIST, mdb.VALUE, "list")), cb(msg) } - await list("", can._handle[""] || await window.showDirectoryPicker()), cb(msg) - } else { - if (can.base.endWith(arg[0], nfs.PS)) { var path = can.base.trimSuffix(arg[0], nfs.PS) - if (path.indexOf(nfs.PS) == -1) { - var file = path, path = "" - } else { - var file = path.slice(path.lastIndexOf(nfs.PS)+1), path = path.slice(0, path.lastIndexOf(nfs.PS)+1) - } var handle = can._handle[path] - await list(arg[0], await handle.getDirectoryHandle(file)), cb(msg) - } else { - if (arg[0].indexOf(nfs.PS) == -1) { - var file = arg[0], path = "" - } else { var path = can.base.trimSuffix(arg[0], nfs.PS) - var file = path.slice(path.lastIndexOf(nfs.PS)+1), path = path.slice(0, path.lastIndexOf(nfs.PS)+1) - } var handle = can._handle[path], _file = await handle.getFileHandle(file) - var reader = new FileReader(); reader.onload = () => { msg.Echo(reader.result), cb(msg) }, reader.readAsText(await _file.getFile()) - } - } - }), }) })() diff --git a/panel/header.js b/panel/header.js index e9000109..6a7f7ea4 100644 --- a/panel/header.js +++ b/panel/header.js @@ -129,7 +129,7 @@ Volcanos(chat.ONACTION, {_init: function(can) {}, can.user.jumps(can.misc.MergeURL(can, args, true)) }, avatar: function(event, can) { if (can.user.isMobile) { return can.onaction.usernick(event, can) } - var src = can.onexport.avatar(can); can.onaction.carte(can.request(event, {_style: "header avatar"}), can, [``]) }, + var src = can.onexport.avatar(can); can.onaction.carte(can.request(event, {_style: "header avatar"}), can, [""]) }, usernick: function(event, can) { can.onaction.carte(can.request(event, {_style: "header usernick"}), can, can.onaction._menus) }, shareuser: function(event, can) { can.user.share(can, can.request(event), [ctx.ACTION, chat.SHARE, mdb.TYPE, aaa.LOGIN, mdb.NAME, can.user.title()]) }, theme: function(event, can) { can.page.Select(can, can._output, "div.item.theme>i:first-child", function(target) { @@ -169,7 +169,7 @@ Volcanos(chat.ONACTION, {_init: function(can) {}, "change language to zh-cn", "切换语言为中文", "change language to en-us", "切换语言为英文", - "en-us", "英文", "zh-cn", "中文", "auto", "默认", + "en-us", "英文", "zh-cn", "中文", "auto", "默认" ), }) Volcanos(chat.ONEXPORT, { diff --git a/plugin/input/date.js b/plugin/input/date.js index c92bc4e9..6a4a0636 100644 --- a/plugin/input/date.js +++ b/plugin/input/date.js @@ -11,7 +11,7 @@ Volcanos(chat.ONFIGURE, {date: { mdb.PREV, function() { now.setMonth(now.getMonth()-1), show(now) }, YEAR, function(event, can, button, value) { now.setFullYear(parseInt(value)), show(now) }, MONTH, function(event, can, button, value) { now.setMonth(parseInt(value)-1), show(now) }, - mdb.NEXT, function() { now.setMonth(now.getMonth()+1), show(now) }, + mdb.NEXT, function() { now.setMonth(now.getMonth()+1), show(now) } ) var ui = can.page.Append(can, can._action, ["time", "date"]) can.onappend._action(can, [cli.CLOSE, [HOUR].concat(can.core.List(24)), [MINUTE].concat(can.core.List(0, 60, 5)), [SECOND].concat(can.core.List(0, 60, 5)), TODAY], ui.time, meta) diff --git a/plugin/local/code/inner.js b/plugin/local/code/inner.js index 9d71166b..797e3acf 100644 --- a/plugin/local/code/inner.js +++ b/plugin/local/code/inner.js @@ -177,7 +177,9 @@ Volcanos(chat.ONIMPORT, { return can.onmotion.toggle(can, can.ui.profile, true), can.onimport.layout(can) } } - can.onimport.process(can, msg, can.ui.profile, height, width-border, function(sub) { can.ui.profile._plugin = sub, can.page.style(can, sub._output, html.MAX_WIDTH, "") + can.onimport.process(can, msg, can.ui.profile, height, width-border, function(sub) { + _msg._profile_plugin = sub + can.ui.profile._plugin = sub, can.page.style(can, sub._output, html.MAX_WIDTH, "") sub.onaction.close = function() { can._msg._profile_hidden = true can.onexport.session(can, PROFILE_ARGS+can.Option(nfs.PATH)+can.Option(nfs.FILE), ""), @@ -265,7 +267,7 @@ Volcanos(chat.ONIMPORT, { if (can.isCmdMode()) { can.page.style(can, can._output, html.HEIGHT, can.ConfHeight(can.page.height())) } can.ui.size = {profile: can._msg.Option(html.WIDTH), display: can._msg.Option(html.HEIGHT)} can.ui.layout(can.ConfHeight(), can.ConfWidth(), 0, function(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.profile.offsetWidth-1, true) + var sub = can._msg._profile_plugin; sub && can.page.isDisplay(can.ui.profile) && sub.onimport && sub.onimport.size(sub, can.ui.profile.offsetHeight, can.ui.profile.offsetWidth-1, false) 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 } sub.onimport.size(sub, height, width, false), can.page.style(can, sub._target, html.HEIGHT, height) }) diff --git a/plugin/local/code/vimer.js b/plugin/local/code/vimer.js index c98d32c2..2ae2211c 100644 --- a/plugin/local/code/vimer.js +++ b/plugin/local/code/vimer.js @@ -25,7 +25,7 @@ Volcanos(chat.ONFIGURE, { if (can.base.beginWith(p, nfs.USR_LOCAL_WORK) || can.base.isIn(p, nfs.USR_LEARNING, nfs.USR_INTSHELL, nfs.USR_ICONS, nfs.USR_GEOAREA, nfs.USR_PROGRAM, nfs.USR_NODE_MODULES, - nfs.USR_WEBSOCKET, nfs.USR_GO_QRCODE, nfs.USR_GO_GIT, + nfs.USR_WEBSOCKET, nfs.USR_GO_QRCODE, nfs.USR_GO_GIT )) { return } if (p && paths.indexOf(p) == -1 && p[0] != nfs.PS) { paths.push(p) } }) diff --git a/plugin/local/team/plan.js b/plugin/local/team/plan.js index d08ecafa..3b6d4242 100644 --- a/plugin/local/team/plan.js +++ b/plugin/local/team/plan.js @@ -2,7 +2,9 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, target) { can._display_heights = {}, can.list = {}; var ls = can.misc.SearchHash(can) can.ui = can.onappend.layout(can), can.ui.toggle = can.onappend.toggle(can) can.onmotion.hidden(can, can.ui.project), can.isCmdMode() || can.onmotion.hidden(can, can._action) - can.onimport[can.Option("scale")||team.WEEK](can, msg), can.Status(mdb.COUNT, msg.Length()), can.ui.filter.placeholder = `search in ${ msg.Length() } items`, can.onimport.layout(can) + can.onimport[can.Option("scale")||team.WEEK](can, msg), can.Status(mdb.COUNT, msg.Length()) + // can.ui.filter.placeholder = `search in ${ msg.Length() } items` + can.onimport.layout(can) var item; if (can.isCmdMode() && ls.length > 0) { item = can.list[can.core.Keys(ls)] } else if (can.sup.task) { item = can.list[can.core.Keys(can.sup.task.space, can.sup.task.zone, can.sup.task.id)] } item && item.click() }, _content: function(can, msg, head, list, key, get, set) { var begin_time = can.base.Date(can.Option(team.BEGIN_TIME)); can.sup.task && (can.sup.task._target = null) diff --git a/plugin/local/wiki/draw.js b/plugin/local/wiki/draw.js index c35e8cc5..05662b41 100644 --- a/plugin/local/wiki/draw.js +++ b/plugin/local/wiki/draw.js @@ -184,7 +184,7 @@ Volcanos(chat.ONACTION, {list: [ oncontextmenu: function(event, can) { can.page.style(can, can.user.carte(event, can, can.ondetail)._target, {left: event.clientX, top: event.clientY}) }, }) Volcanos(chat.ONDETAIL, {list: [cli.START, nfs.COPY, html.LABEL, mdb.REMOVE], _trans: {copy: "复制", label: "标签"}, - _select(can, name, cb) { if (!name) { return } var target = can.page.SelectOne(can, can.ui.svg, nfs.PT+name, cb); if (!target) { return } + _select: function(can, name, cb) { if (!name) { return } var target = can.page.SelectOne(can, can.ui.svg, nfs.PT+name, cb); if (!target) { return } can.onimport._profile(can, target), can.onimport._display(can, target), can.onimport.layout(can); return target }, _move: function(can, target, list) { diff --git a/plugin/local/wiki/feel.js b/plugin/local/wiki/feel.js index 3d6fb760..bd718899 100644 --- a/plugin/local/wiki/feel.js +++ b/plugin/local/wiki/feel.js @@ -129,7 +129,7 @@ Volcanos(chat.ONACTION, {list: ["full", record1: function(event, can) { can.onaction.record0(event, can, "shot", function(stream, cb) { var height = window.innerHeight var video = can.page.Append(can, document.body, [{type: html.VIDEO, height: height}])._target; video.srcObject = stream, video.onloadedmetadata = function() { video.play(), width = video.offsetWidth var canvas = can.page.Append(can, document.body, [{type: html.CANVAS, height: height, width: width}])._target; canvas.getContext("2d").drawImage(video, 0, 0, width, height) - canvas.toBlob((blob) => { cb([blob], nfs.PNG) }) + canvas.toBlob(function(blob) { cb([blob], nfs.PNG) }) } }) }, record2: function(event, can) { can.onaction.record0(event, can, "shot", function(stream, cb) { diff --git a/plugin/state.js b/plugin/state.js index 8881bccb..1e8b82c7 100644 --- a/plugin/state.js +++ b/plugin/state.js @@ -164,7 +164,7 @@ Volcanos(chat.ONACTION, {list: ["刷新数据", html.HEIGHT, can.ConfHeight(), html.WIDTH, can.ConfWidth(), ice.MODE, can.Mode()||"", html.ACTION, can.page.isDisplay(can._action), html.STATUS, can.page.isDisplay(can._status), html.OUTPUT, can.base.Copy({}, can._output.style, html.HEIGHT, html.WIDTH, html.MAX_HEIGHT, html.MAX_WIDTH), - ctx.STYLE, can.base.Copy({}, can._target.style, html.LEFT, html.TOP, html.RIGHT, html.BOTTOM), save(), + ctx.STYLE, can.base.Copy({}, can._target.style, html.LEFT, html.TOP, html.RIGHT, html.BOTTOM), save() )), can.onimport.size(can, can.ConfHeight(), can.ConfWidth(), false, mode) } else { var back = (can._mode_list = can._mode_list||[]).pop(); if (!back) { return } can.onmotion.toggle(can, can._action, back.action), can.onmotion.toggle(can, can._status, back.status) @@ -306,7 +306,7 @@ Volcanos(chat.ONACTION, {list: ["刷新数据", record1: function(event, can) { can.onaction.record0(event, can, "shot", function(stream, cb) { var height = window.innerHeight var video = can.page.Append(can, document.body, [{type: html.VIDEO, height: height}])._target; video.srcObject = stream, video.onloadedmetadata = function() { video.play(), width = video.offsetWidth var canvas = can.page.Append(can, document.body, [{type: html.CANVAS, height: height, width: width}])._target; canvas.getContext("2d").drawImage(video, 0, 0, width, height) - canvas.toBlob((blob) => { cb([blob], nfs.PNG) }) + canvas.toBlob(function(blob) { cb([blob], nfs.PNG) }) } }) }, record2: function(event, can) { can.onaction.record0(event, can, "shot", function(stream, cb) { diff --git a/plugin/table.js b/plugin/table.js index 30462353..b1e026b7 100644 --- a/plugin/table.js +++ b/plugin/table.js @@ -193,7 +193,7 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, target, cb) { "Close Other", function(event) { target.click(), can.page.SelectChild(can, action, html.DIV_TABS, function(target) { target == tabs._target || target._close() }) }, "Rename Tabs", function(event) { can.user.input(event, can, [mdb.NAME], function(list) { can.page.SelectOne(can, target, html.SPAN, function(target) { can.page.Modify(can, target, list[0]||tabs.name) }) - }) }, menu.meta, + }) }, menu.meta ), ["Close", "Close Other", "Rename Tabs", ""].concat(can.base.getValid(menu.list, can.core.Item(menu.meta)), _action), function(event, button, meta) { (meta[button]||menu)(can.request(event, tabs), button, meta) })