From d3a86baffec5a204894d4b50ab5fa8d963c79b95 Mon Sep 17 00:00:00 2001 From: shy Date: Wed, 17 Jan 2024 19:30:44 +0800 Subject: [PATCH] add some --- const.js | 4 +++- plugin/state.js | 12 +++++------- plugin/table.js | 2 +- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/const.js b/const.js index 56f1f612..ce8fe481 100644 --- a/const.js +++ b/const.js @@ -210,8 +210,10 @@ var wiki = { TITLE: "title", BRIEF: "brief", REFER: "refer", SPARK: "spark", SHELL: "shell", ORDER: "order", TABLE: "table", CHART: "chart", IMAGE: "image", VIDEO: "video", FIELD: "field", LOCAL: "local", PARSE: "parse", + WORD: "word", NAVMENU: "navmenu", PREMENU: "premenu", CONTENT: "content", STORY_ITEM: ".story", H2: "h2.story", H3: "h3.story", + PORTAL: "portal", DRAW: "draw", } var chat = { @@ -220,7 +222,7 @@ var chat = { LAYOUT: "layout", PROJECT: "project", CONTENT: "content", DISPLAY: "display", PROFILE: "profile", ACTIONS: "actions", TITLE: "title", THEME: "theme", BLACK: "black", WHITE: "white", PRINT: "print", LIGHT: "light", DARK: "dark", SHARE: "share", RIVER: "river", STORM: "storm", FIELD: "field", TOOL: "tool", - STATE: "state", MENUS: "menus", SSO: "sso", LOCATION: "location", IFRAME: "iframe", + STATE: "state", MENUS: "menus", SSO: "sso", LOCATION: "location", IFRAME: "iframe", DESKTOP: "desktop", OUTPUT: "output", SIMPLE: "simple", FLOAT: "float", FULL: "full", CMD: "cmd", HEADER: "Header", ACTION: "Action", FOOTER: "Footer", diff --git a/plugin/state.js b/plugin/state.js index f848ac47..47a254d3 100644 --- a/plugin/state.js +++ b/plugin/state.js @@ -11,15 +11,13 @@ Volcanos(chat.ONIMPORT, { _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) }, _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()), width = can.ConfWidth() + _field: function(can, msg, cb) { var height = can.base.Max(html.STORY_HEIGHT, can.ConfHeight()-2*html.ACTION_HEIGHT), width = can.ConfWidth() msg.Table(function(item) { can.onappend._plugin(can, item, {_space: can.ConfSpace(), index: item.index, args: can.base.Obj(item.args||item.arg, []), height: height, width: width}, function(sub) { - if (can.base.isIn(sub.ConfIndex(), - web.WIKI_PORTAL, web.CHAT_IFRAME, web.CHAT_MACOS_DESKTOP, web.WIKI_WORD, web.CODE_VIMER, - )) { height = can.base.Max(can.base.Min(can.onexport.outputHeight(can), 640), can.ConfHeight()-2*html.ACTION_HEIGHT) } + sub.run = function(event, cmds, cb) { var index = msg.Option(ice.MSG_INDEX); can.run(event, (msg[ice.MSG_PREFIX]? msg[ice.MSG_PREFIX]: index? [ctx.RUN, index]: []).concat(cmds), cb, true) } + if (can.base.isIn(sub.ConfIndex(), wiki.PORTAL, chat.IFRAME, chat.DESKTOP, wiki.WORD, code.VIMER,)) { height = can.onexport.outputHeight(can) } + can.page.ClassList.has(can, sub._target, html.FLOAT)? can.onmotion.float(sub): sub.onimport.size(sub, height, width, true), cb && cb(sub) + if (can.base.isIn(sub.ConfIndex(), wiki.WORD)) { sub.onexport.output = function() { can.page.style(can, sub._output, html.HEIGHT, "", html.MAX_HEIGHT, "") } } can.onmotion.delay(can, function() { can.onmotion.scrollIntoView(can, sub._target) }, 300) - sub.run = function(event, cmds, cb) { var index = msg.Option(ice.MSG_INDEX) - can.run(event, (msg[ice.MSG_PREFIX]? msg[ice.MSG_PREFIX]: index? [ctx.RUN, index]: []).concat(cmds), cb, true) - }, can.page.ClassList.has(can, sub._target, html.FLOAT)? can.onmotion.float(sub): sub.onimport.size(sub, height, width, true), cb && cb(sub) }) }) }, _float: function(can, msg) { can.onimport._field(can, msg, function(sub) { can.onmotion.float(sub) }) }, diff --git a/plugin/table.js b/plugin/table.js index 4c8eacb9..c8fef32b 100644 --- a/plugin/table.js +++ b/plugin/table.js @@ -8,7 +8,7 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, target) { can.onappend.table(can, msg, null, target), can.onappend.board(can, msg, target), can.onmotion.story.auto(can, target) } }, - card: function(can, msg, target) { can.sup.onexport.outputMargin = function() { return 260 } + card: function(can, msg, target) { can.sup.onexport.outputMargin = function() { return 200 } can.page.Appends(can, target||can._output, msg.Table(function(value) { value.icon = value.icon||value.image return {view: [[html.ITEM, value.type, value.status]], list: [ {view: [wiki.TITLE, html.DIV], list: [value.icon && {img: can.misc.Resource(can, value.icon, value.type == web.MASTER? "": value.name)}, {text: value.name}]},