diff --git a/frame.js b/frame.js index de4aef6b..7bfd0cbe 100644 --- a/frame.js +++ b/frame.js @@ -69,7 +69,7 @@ Volcanos(chat.ONENGINE, {_init: function(can, meta, list, cb, target) { }, }) Volcanos(chat.ONDAEMON, {_init: function(can, name, type, cbs) { if (can.user.isLocalFile) { return } - return can.misc.WSS(can, {type: type||web.PORTAL, name: name||can.misc.Search(can, cli.DAEMON)||can.misc.sessionStorage(can, "can.daemon")||""}, function(event, msg, cmd, arg, cb) { + return can.misc.WSS(can, {type: type||web.PORTAL, name: name||can.misc.Search(can, cli.DAEMON)||can.user.isChrome&&can.misc.sessionStorage(can, "can.daemon")||""}, function(event, msg, cmd, arg, cb) { if (cbs && can.core.CallFunc(cbs, {event: event, msg: msg, cmd: cmd, arg: arg, cb: cb})) { return } var sub = can.ondaemon._list[can.core.Keys(msg[ice.MSG_TARGET])]||can; can.base.isFunc(sub.ondaemon[cmd])? can.core.CallFunc(sub.ondaemon[cmd], {can: can, msg: msg, sub: sub, cmd: cmd, arg: arg, cb: cb}): diff --git a/index.css b/index.css index 9a2d39f6..6be6a860 100644 --- a/index.css +++ b/index.css @@ -594,7 +594,7 @@ fieldset.draw>form.option>div.item.pid>input { width:var(--button-width) !import fieldset.draw.trends div.output { overflow:hidden; } fieldset.draw.trends div.output svg { background-color:#1b5b738c; } fieldset.form>div.output>div.code { text-align:center; } -fieldset.form>div.output>div.code>div.info { font-size:20px; padding:40px 20px; overflow:auto; } +fieldset.form>div.output>div.code>div.info { font-size:20px; padding:40px 20px; overflow:auto; white-space:break-spaces; } fieldset.form>div.output>div.code>input[type=button] { font-size:24px; border:var(--notice-bg-color) solid 1px; height:48px; width:240px; margin:40px; } fieldset>div.output.form { padding:20px; display:flex; flex-direction:column; align-items:center; justify-content:center; } fieldset>div.output.form>div.item { text-align:left; margin:10px; } diff --git a/lib/misc.js b/lib/misc.js index 8311f38a..edfaa81d 100644 --- a/lib/misc.js +++ b/lib/misc.js @@ -140,11 +140,7 @@ Volcanos("misc", { if (data && can.base.isIn(msg._method, http.GET, http.DELETE)) { url += (url.indexOf("?") == -1? "?": "&")+data, data = "" } xhr.open(msg._method||http.POST, url), xhr.onreadystatechange = function() { if (xhr.readyState != 4) { return } try { var res = JSON.parse(xhr.responseText) } catch (e) { - if (xhr.responseText.indexOf("warn: ")) { - var res = {result: [xhr.responseText]} - } else { - var res = {result: [xhr.responseText]} - } + if (xhr.responseText.indexOf("warn: ")) { var res = {result: [xhr.responseText]} } else { var res = {result: [xhr.responseText]} } } msg.Option("_cost", new Date() - begin) if (xhr.status == 200) { return msg.detail || (msg.detail = res.detail), can.base.isFunc(cb) && cb(msg.Copy(res)) } can.user.toastFailure(msg._can||can, xhr.response), can.misc.Warn(xhr.status, res, url, form) @@ -207,14 +203,11 @@ Volcanos("misc", { } return obj.pod } obj.pod = obj.pod||can.misc.Search(can, ice.POD); return can.misc.MergeURL(can, obj, true) - // obj.pod = can.core.Keys(can.misc.Search(can, ice.POD), obj.pod); return can.misc.MergeURL(can, obj, true) }, MergeURL: function(can, obj, clear) { var path = location.pathname; obj._path && (path = obj._path), delete(obj._path) can.misc.Search(can, log.DEBUG) && (obj.debug = ice.TRUE); var hash = obj._hash||""; delete(obj._hash) - // var args = [web.CHAT]; can.core.List([ice.POD, ice.CMD], function(key) { obj[key] && args.push(key, obj[key]), delete(obj[key]) }) var args = []; can.core.List([ice.POD, ice.CMD], function(key) { obj[key] && args.push(key == ice.POD? "s": "c", obj[key]), delete(obj[key]) }) var _location = location; if (can.user.isExtension) { var _location = new URL(Volcanos.meta.iceberg) } - // return can.base.MergeURL(_location.origin+(args.length == 1? path: nfs.PS+args.join(nfs.PS))+(clear? "": _location.search), obj)+(hash? "#"+hash: "") return can.base.MergeURL(_location.origin+(args.length > 0? nfs.PS+args.join(nfs.PS): path)+(clear? "": _location.search), obj)+(hash? "#"+hash: "") }, ParseURL: function(can, url) { url = url||location.href; var args = can.base.ParseURL(url), _location = new URL(url) diff --git a/panel/action.js b/panel/action.js index cc855c77..f0d347a8 100644 --- a/panel/action.js +++ b/panel/action.js @@ -2,7 +2,7 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg) { var river = can.Conf(chat.RIVER), storm = can.Conf(chat.STORM), list = can.misc.SearchHash(can) can.onmotion.clear(can), can.core.Next(msg.Table(), function(item, next, index) { item.type = chat.PLUGIN, item.mode = can.Mode(); if (item.deleted == ice.TRUE) { return next() } item.width = can.ConfWidth()-can.Conf(html.MARGIN_X); if (item.style == html.OUTPUT) { item.width = can.ConfWidth()-2*html.PLUGIN_MARGIN-2*html.PLUGIN_PADDING } - if (msg.Length() == 1) { item.height = can.ConfHeight()-(can.user.isMobile? 1: 1)*html.ACTION_HEIGHT-can.Conf(html.MARGIN_Y) } + if (msg.Length() == 1) { item.height = can.ConfHeight()-(can.user.isMobile? 1: 0)*html.ACTION_HEIGHT-can.Conf(html.MARGIN_Y) } can.onappend.plugin(can, item, function(sub, meta, skip) { can.user.isChrome && (can.ondaemon._list[sub._daemon = can.core.Keys(river, storm, index)] = sub) can._plugins = (can._plugins||[]).concat([sub]), can.onimport._tabs(can, sub, meta), skip || next() sub.onaction._close = function() { can.onengine.signal(can, chat.ONACTION_REMOVE, can.request({river: river, storm: storm}, item)), can.page.Remove(can, sub._target) } @@ -55,7 +55,6 @@ Volcanos(chat.ONACTION, {_init: function(can, target) { if (list.length == 1) { can.user.mod.cmd = item.index can.base.isIn(item.index, web.CHAT_MACOS_DESKTOP) || can.user.title(item.index) can.onaction._onaction_cmd(can), item.mode = chat.CMD, item.opts = can.misc.Search(can) - // can.user.mod.isCmd && can.user.isMobile && (can.ConfHeight(can.ConfHeight()-html.ACTION_HEIGHT)) can.onappend.style(can, ice.CMD, document.body), can.onappend.style(can, item.index, document.body) } return item }), FLOW).layout(can.page.height(), can.page.width()): can.runAction(can.request(), ctx.COMMAND, [], function(msg) { @@ -84,7 +83,6 @@ Volcanos(chat.ONACTION, {_init: function(can, target) { can._keylist = can.onkeymap._parse(msg._event, can, model, can._keylist||[], can._output) }, onresize: function(can) { can.onaction.layout(can) }, - // onresize: function(can) { can.onaction.layout(can), window.setsize && window.setsize(can.page.width(), can.page.height()) }, ontitle: function(can, msg) { can.onlayout._storage(can, "") }, ontouchstart: function(event, can) { can.touch = can.touch || {} @@ -108,10 +106,7 @@ Volcanos(chat.ONACTION, {_init: function(can, target) { layout: function(can, button, skip) { can.page.ClassList.del(can, can._target, can._layout||can.onlayout._storage(can)), can._header_tabs && can.onmotion.hidden(can, can._header_tabs) button = (can.onlayout._storage(can, can._layout = button == ice.AUTO? "": button))||can.misc.SearchOrConf(can, html.LAYOUT), can.page.ClassList.add(can, can._target, button) can.onengine.signal(can, chat.ONLAYOUT, can.request({}, {layout: button})), can._root.River && can._river_show === false && can.onmotion.hidden(can, can._root.River._target), skip || can.onlayout._init(can) - can.isCmdMode() || can.core.List(can._plugins, function(sub) { - sub._delay_refresh = false - // can.page.ClassList.set(can, sub._target, html.OUTPUT, [TABVIEW, HORIZON, VERTICAL].indexOf(button) > -1) - }) + can.isCmdMode() || can.core.List(can._plugins, function(sub) { sub._delay_refresh = false }) var cb = can.onlayout[button]; can.base.isFunc(cb) && cb(can) || can.onlayout._plugin(can, button) }, _menus: [[html.LAYOUT, ice.AUTO, TABS, TABVIEW, HORIZON, VERTICAL, GRID, FREE, FLOW, PAGE], web.DREAM, "desktop", "portal"], @@ -135,12 +130,8 @@ Volcanos(chat.ONLAYOUT, { flow: function(can) { can.getActionSize(function(height, width) { can.ConfHeight(height-html.ACTION_MARGIN), can.ConfWidth(width) }) }, page: function(can) { can.page.styleHeight(can, can._output, ""), can.page.style(can, document.body, kit.Dict(html.OVERFLOW, "")) }, _plugin: function(can, button) { can.core.List(can._plugins, function(sub) { - if (can.page.ClassList.has(can, sub._target, html.OUTPUT)) { - return sub.onimport.size(sub, - can.ConfHeight()-2*html.PLUGIN_MARGIN-2*html.PLUGIN_PADDING, - can.ConfWidth()-2*html.PLUGIN_MARGIN-2*html.PLUGIN_PADDING, - true) } - if (can._plugins.length == 1) { return sub.onimport.size(sub, can.ConfHeight()-(can.user.isMobile? 2: 1)*html.ACTION_HEIGHT-can.Conf(html.MARGIN_Y), can.ConfWidth()-can.Conf(html.MARGIN_X), false) } + if (can.page.ClassList.has(can, sub._target, html.OUTPUT)) { return sub.onimport.size(sub, can.ConfHeight()-2*html.PLUGIN_MARGIN-2*html.PLUGIN_PADDING, can.ConfWidth()-2*html.PLUGIN_MARGIN-2*html.PLUGIN_PADDING, true) } + if (can._plugins.length == 1) { return sub.onimport.size(sub, can.ConfHeight()-(can.user.isMobile? 2: 0)*html.ACTION_HEIGHT-can.Conf(html.MARGIN_Y), can.ConfWidth()-can.Conf(html.MARGIN_X), false) } sub.onimport.size(sub, can.ConfHeight()-can.Conf(html.MARGIN_Y)-(button || sub.isCmdMode()? 0: html.ACTION_MARGIN), can.ConfWidth()-can.Conf(html.MARGIN_X), can.onexport.isauto(can)) && can.page.style(can, sub._output, html.MAX_HEIGHT, "") }) }, _storage: function(can, value) { return can.misc.sessionStorage(can, can.core.Keys(CAN_LAYOUT, location.pathname), value) }, diff --git a/panel/header.js b/panel/header.js index 88017322..4658ce88 100644 --- a/panel/header.js +++ b/panel/header.js @@ -65,7 +65,7 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, target) { Volcanos(chat.ONACTION, {_init: function(can) {}, onsize: function(can) { can.ConfHeight(can._target.offsetHeight), can.ConfWidth(can._target.offsetWidth) }, onmain: function(can) { - if (!can.user.isMailMaster) { if (can.misc.Search(can, ice.MSG_SESSID)) { can.misc.CookieSessid(can, can.misc.Search(can, ice.MSG_SESSID)); return can.misc.Search(can, ice.MSG_SESSID, "") } } + if (can.misc.Search(can, ice.MSG_SESSID) && can.misc.CookieSessid(can, can.misc.Search(can, ice.MSG_SESSID))) { return can.misc.Search(can, ice.MSG_SESSID, "") } function lang(msg, cb) { can.user.info.language = msg.SearchOrOption(aaa.LANGUAGE) can.user.info.language? can.require([can.misc.Resource(can, nfs.SRC_TEMPLATE+web.CHAT_HEADER+"/language/"+can.user.info.language+".js")], cb, function(can, name, sub) { can.base.Copy(can.user._trans, sub._trans) }): cb && cb() diff --git a/plugin/table.js b/plugin/table.js index 80fbf3c1..d6104621 100644 --- a/plugin/table.js +++ b/plugin/table.js @@ -1,5 +1,8 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, target) { can.onmotion.clear(can, target), can.onappend.style(can, can.Conf(ctx.STYLE)) + if (can.isCmdMode() && can.Conf(ctx.STYLE) == "form" && can.base.isIn(can.ConfIndex(), "aaa.offer", "aaa.apply")) { + can.onappend.style(can, html.OUTPUT) + } if (can.Mode() == html.ZONE) { return can.onimport._vimer_zone(can, msg, target) } var cbs = can.onimport[can.Conf(ctx.STYLE)||msg.Option(ctx.STYLE)]; if (can.base.isFunc(cbs)) { can.onappend.style(can, can._args[ctx.STYLE], target), can.core.CallFunc(cbs, {can: can, msg: msg, target: target})