diff --git a/close.png b/close.png deleted file mode 100644 index 44495a39..00000000 Binary files a/close.png and /dev/null differ diff --git a/frame.js b/frame.js index 55447057..8b9d292b 100644 --- a/frame.js +++ b/frame.js @@ -17,11 +17,22 @@ Volcanos(chat.ONENGINE, {_init: function(can, meta, list, cb, target) { can.onengine.listen(can, chat.ONSEARCH, function(msg, arg) { arg[0] == ctx.COMMAND && can.run(msg, ["can.command"]) }) can.onengine.signal(can, chat.ONMAIN, can.request()), can.base.isFunc(cb) && cb(can) }) - // can.onappend.topic(can, "dark", {topic: "#0d1117", plugin: "#030507", input: "#212121", output: "#0d1117", table: "#060709", can.onappend.topic(can, "dark", {topic: "#0d1117", plugin: "#030507", input: "#212121", output: "#0d1117", table: "#030507", hover: "#3f3f46", border: "#3a3f47", label: "#c9d1d9", text: "white", warn: "red", notice: "blue"}), can.onappend.topic(can, "light", {topic: "white", plugin: "#f3f5f6", input: "white", output: "white", table: "#f3f5f6", hover: "#E1F2F4", border: "#0000", label: "black", text: "black", warn: "red", notice: "blue"}) + can.onappend.icon(can, { + open: [-27, -158], + close: [-82, -158], + }, 16) + can.onappend.icon(can, { + open: [-30, -177], + close: [-93, -177], + }, 18) + can.onappend.icon(can, { + open: [-40, -236], + close: [-123, -236], + }, 24) }, _search: function(event, can, msg, panel, cmds, cb) { var sub, mod = can, fun = can, key = ""; can.core.List(cmds[1].split(ice.PT), function(value) { fun && (sub = mod, mod = fun, fun = mod[value], key = value) }) @@ -150,7 +161,7 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) { }) } if (can._root && can._root.name == "popup") { can.onmotion.hidden(can, sub._action) } - can.core.Value(sub._legend, chat.ONMOUSEENTER, function(event) { + can.core.Value(sub._legend, "onclick", function(event) { can.user.carte(event, sub, sub.onaction, sub.onaction.list.concat([[ctx.ACTION].concat(can.core.Item(meta.feature._trans))]), function(event, button, meta) { var _sub = can.core.Value(sub, chat._OUTPUTS_CURRENT) var cb = can.core.Value(_sub, [chat.ONACTION, button]); if (can.base.isFunc(cb)) { return cb(event, _sub, button) } @@ -343,114 +354,102 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) { } }), can.onfigure[input]._init && can.onfigure[input]._init(can, meta, target, _cb) }) }, + icon: function(can, list, size) { + can.core.Item(list, function(key, value) { + var text = `div.icon.s${size}.${key} { + background:url(/publish/icon/full.jpg); background-size:${size*20}px; width:${size}px; height:${size}px; + background-repeat: no-repeat; background-position-x:${value[0]}px; background-position-y:${value[1]}px; +}`; can.page.Append(can, document.head, "style", {"innerText": text}), console.log("icon", size, key, text) + }) + }, topic: function(can, topic, color, style, list) { const SOLID = " solid 1px", GLASS = "#0000" - const INPUT_STYLE = "input-style", INPUT_HOVER_STYLE = "input-hover-style", GLASS_STYLE = "glass-style", OUTPUT_STYLE = "output-style" - const TABLE_HEAD_STYLE = "table-head-style", TABLE_ROW_HOVER_STYLE = "table-row-hover-style", TABLE_CELL_HOVER_STYLE = "table-cell-hover-style" + const INPUT_STYLE = "input-style", INPUT_HOVER_STYLE = "input-hover-style", OUTPUT_STYLE = "output-style", GLASS_STYLE = "glass-style" + const TABLE_HEAD_STYLE = "table-head-style", TABLE_HEAD_HOVER_STYLE = "table-head-hover-style", TABLE_ROW_HOVER_STYLE = "table-row-hover-style", TABLE_CELL_HOVER_STYLE = "table-cell-hover-style" const ITEM_HOVER_STYLE = "item-hover-style", CARTE_ITEM_HOVER_STYLE = "carte-item-hover-style", CARTE_ITEM_STYLE = "carte-item-style" const PANEL_STYLE = "panel-style", PLUGIN_STYLE = "plugin-style" - style = style||{ - "input-style": {"background-color": color.input, color: color.text, border: color.border+SOLID, "border-radius": "5px", "outline": html.NONE, "box-shadow": html.NONE}, - "input-hover-style": {"border": color.text+SOLID}, "glass-style": {"background-color": GLASS}, - "output-style": {"background-color": color.output}, "item-hover-style": {"background-color": color.hover}, "carte-item-hover-style": {"background-color": color.hover}, - "table-head-style": {"background-color": color.table, color: color.text}, "table-row-hover-style": {"background-color": color.table}, "table-cell-hover-style": {"background-color": color.hover}, - "panel-style": {"background-color": color.topic, color: color.label}, "plugin-style": {"background-color": color.plugin, border: color.border+SOLID, "border-radius": "10px"}, - }, list = list||[ - {type: "*", style: {"color": color.label}}, - {type: html.LEGEND, style: [INPUT_STYLE]}, - {type: html.LEGEND, name: [html.HOVER], style: [INPUT_HOVER_STYLE]}, - {type: html.SELECT, style: [INPUT_STYLE]}, - {type: html.SELECT, name: [html.HOVER], style: [INPUT_HOVER_STYLE]}, - {type: html.INPUT, style: [INPUT_STYLE]}, - {type: html.INPUT, name: [html.HOVER], style: [INPUT_HOVER_STYLE]}, - {type: "input:not([type=button])", style: {"border-radius": "0px"}}, - {type: "input:not([type=button])", name: [html.HOVER], style: {border: color.notice+SOLID}}, - {type: html.TEXTAREA, style: [INPUT_STYLE]}, + function _bg(color) { var res = {"background-color": color}, arg = arguments; for (var i = 1; i < arg.length; i += 2) { res[arg[i]] = arg[i+1] } return res } + function _fg(color) { var res = {"color": color}, arg = arguments; for (var i = 1; i < arg.length; i += 2) { res[arg[i]] = arg[i+1] } return res } + function _b_r(size) { return {"border-radius": size} } + style = style||kit.Dict( + INPUT_STYLE, _bg(color.input, html.COLOR, color.label, html.BORDER, color.border+SOLID, "border-radius", "5px", "outline", html.NONE, "box-shadow", html.NONE), + INPUT_HOVER_STYLE, _fg(color.text, html.BORDER, color.text+SOLID), OUTPUT_STYLE, _bg(color.output), GLASS_STYLE, _bg(GLASS), + TABLE_HEAD_STYLE, _bg(color.table, html.COLOR, color.label), TABLE_HEAD_HOVER_STYLE, _bg(color.table, html.COLOR, text), + TABLE_ROW_HOVER_STYLE, _bg(color.table), TABLE_CELL_HOVER_STYLE, _bg(color.hover), ITEM_HOVER_STYLE, _bg(color.hover, html.COLOR, color.text), CARTE_ITEM_HOVER_STYLE, _bg(color.hover, html.COLOR, color.text), + PANEL_STYLE, _bg(color.topic, html.COLOR, color.label), PLUGIN_STYLE, _bg(color.plugin, "border-radius", "10px"), + ), list = list||[ + {type: "", style: _fg(color.label)}, + {type: html.LEGEND, style: [INPUT_STYLE, TABLE_HEAD_STYLE]}, {type: html.LEGEND, style: [INPUT_HOVER_STYLE]}, + {type: html.SELECT, style: [INPUT_STYLE]}, {type: html.SELECT, style: [INPUT_HOVER_STYLE]}, + {type: html.INPUT, style: [INPUT_STYLE]}, {type: html.INPUT, style: [INPUT_HOVER_STYLE]}, + {type: html.INPUT+":not([type=button])", style: _b_r(0)}, {type: html.INPUT+":not([type=button])", name: [html.HOVER], style: {border: color.notice+SOLID}}, + {type: html.TEXTAREA, style: [INPUT_STYLE]}, {type: html.TEXTAREA, style: _b_r(0)}, {type: html.FORM_OPTION, list: [{type: html.DIV_ITEM, name: [html.SELECT], style: [GLASS_STYLE]}]}, {type: html.FORM_OPTION, list: [{type: html.DIV_ITEM, name: [html.HOVER], style: [GLASS_STYLE]}]}, {type: html.DIV_ACTION, list: [{type: html.DIV_ITEM, name: [html.SELECT], style: [GLASS_STYLE]}]}, {type: html.DIV_ACTION, list: [{type: html.DIV_ITEM, name: [html.HOVER], style: [GLASS_STYLE]}]}, - {type: html.DIV_OUTPUT, style: [OUTPUT_STYLE]}, - {type: "div.path", style: [OUTPUT_STYLE]}, - {type: "tr.line:hover>td.line", style: [ITEM_HOVER_STYLE]}, - {type: "tr.line.select>td.line", style: [ITEM_HOVER_STYLE]}, - {type: html.DIV_STATUS, style: {color: color.label}}, + {type: html.DIV_OUTPUT, style: [OUTPUT_STYLE]}, {type: html.DIV_STATUS, style: _fg(color.label)}, {type: html.TABLE_LAYOUT, list: [{type: html.DIV_TOGGLE, style: [ITEM_HOVER_STYLE]}]}, + {type: html.TABLE_CONTENT, list: [{type: html.TR, style: [TABLE_ROW_HOVER_STYLE]}]}, {type: html.TABLE_CONTENT, list: [{type: html.TH, style: [TABLE_HEAD_STYLE]}]}, - {type: html.TABLE_CONTENT, name: [html.ACTION], list: [{type: "td:last-child", style: [TABLE_HEAD_STYLE]}]}, - {type: html.TABLE_CONTENT, list: [{type: html.TR, name: [html.HOVER], style: [TABLE_ROW_HOVER_STYLE]}]}, - {type: html.TABLE_CONTENT, list: [{type: html.TD, name: [html.HOVER], style: [TABLE_CELL_HOVER_STYLE]}]}, + {type: html.TABLE_CONTENT, name: [html.ACTION], list: [{type: html.TD+":last-child", style: [TABLE_HEAD_STYLE]}]}, {type: html.TABLE_CONTENT, list: [{type: html.TD, name: [html.SELECT], style: [TABLE_CELL_HOVER_STYLE]}]}, - {type: "div.zone>div.name", style: [TABLE_HEAD_STYLE]}, + {type: html.TABLE_CONTENT, list: [{type: html.TD, style: [TABLE_CELL_HOVER_STYLE]}]}, + {type: html.H1, style: [ITEM_HOVER_STYLE]}, {type: html.H2, style: [ITEM_HOVER_STYLE]}, {type: html.H3, style: [ITEM_HOVER_STYLE]}, + {type: html.LABEL, style: _fg(color.label)}, {type: html.A, style: _fg(color.notice)}, + {type: "tr.line.select", style: [ITEM_HOVER_STYLE]}, {type: "tr.line", style: [ITEM_HOVER_STYLE]}, {type: "tr.line>td.line", style: [OUTPUT_STYLE]}, + {type: "div.zone>div.name", style: [TABLE_HEAD_STYLE]}, {type: "div.zone>div.name", style: [TABLE_HEAD_HOVER_STYLE]}, {type: "div.zone>div.list>div.zone>div.name", style: [TABLE_HEAD_STYLE]}, - {type: "div.zone>div.list>div.zone>div.name", name: [html.HOVER], style: [ITEM_HOVER_STYLE]}, - {type: html.H1, name: [html.HOVER], style: [ITEM_HOVER_STYLE]}, - {type: html.H2, name: [html.HOVER], style: [ITEM_HOVER_STYLE]}, - {type: html.H3, name: [html.HOVER], style: [ITEM_HOVER_STYLE]}, - {type: html.LABEL, style: {color: color.label}}, - {type: html.A, style: {color: color.notice}}, - {type: html.DIV_CODE, style: {border: color.border+SOLID}}, - {type: html.DIV_ITEM, name: [html.HOVER], style: [ITEM_HOVER_STYLE]}, - {type: html.DIV_ITEM, name: [html.SELECT], style: [ITEM_HOVER_STYLE]}, - {type: html.DIV_TABS, list: [{type: ">"+html.DIV, style: {"background-color": color.plugin}}]}, - {type: html.DIV_TABS, list: [{type: ">"+html.DIV, name: [html.HOVER], style: [OUTPUT_STYLE]}]}, - {type: html.DIV_TABS, list: [{type: ">"+html.DIV, name: [html.SELECT], style: [OUTPUT_STYLE]}]}, + {type: "div.zone>div.list>div.zone>div.name", style: [TABLE_HEAD_HOVER_STYLE]}, + {type: "div.zone div.item>div.name", name: [html.HOVER], style: _fg(color.text)}, + {type: html.DIV_ITEM, name: [html.SELECT], style: [ITEM_HOVER_STYLE]}, {type: html.DIV_ITEM, style: [ITEM_HOVER_STYLE]}, + {type: html.DIV_TABS, list: [{type: html.DIV, style: _bg(color.plugin)}]}, + {type: html.DIV_TABS, list: [{type: html.DIV, name: [html.SELECT], style: [OUTPUT_STYLE]}]}, + {type: html.DIV_TABS, list: [{type: html.DIV, name: [html.HOVER], style: [OUTPUT_STYLE]}]}, + {type: html.DIV_TABS, list: [{type: html.DIV, name: [html.HOVER], style: _fg(color.text)}]}, + {type: html.DIV_PATH, style: [OUTPUT_STYLE]}, {type: html.DIV_CODE, style: {border: color.border+SOLID}}, + {type: html.DIV_PATH, list: [{type: html.SPAN, style: [ITEM_HOVER_STYLE]}]}, {type: html.DIV_CARTE, list: [{type: html.DIV_ITEM, style: [TABLE_HEAD_STYLE, CARTE_ITEM_STYLE]}]}, - {type: html.DIV_CARTE, list: [{type: html.DIV_ITEM, name: [html.HOVER], style: [CARTE_ITEM_HOVER_STYLE]}]}, + {type: html.DIV_CARTE, list: [{type: html.DIV_ITEM, style: [CARTE_ITEM_HOVER_STYLE]}]}, {type: html.DIV_FLOAT, style: [PLUGIN_STYLE]}, - {type: html.FIELDSET_PANEL, style: [PANEL_STYLE]}, - {type: html.FIELDSET_PANEL, list: [{type: ">"+html.DIV_OUTPUT, style: [PANEL_STYLE]}]}, + {type: html.FIELDSET_FLOAT, style: [PLUGIN_STYLE]}, + {type: html.FIELDSET_PANEL, style: [PANEL_STYLE]}, {type: html.FIELDSET_PANEL, list: [{type: ">"+html.DIV_OUTPUT, style: [PANEL_STYLE]}]}, {type: html.FIELDSET_PANEL, name: ["Footer"], list: [{type: html.DIV_OUTPUT, list: [{type: html.DIV_TOAST, style: [TABLE_HEAD_STYLE]}], }]}, - {type: html.FIELDSET_PANEL, name: ["Footer"], list: [{type: html.DIV_OUTPUT, list: [{type: html.DIV, name: [html.HOVER], style: [ITEM_HOVER_STYLE]}], }]}, - {type: html.FIELDSET_PANEL, name: ["Header"], list: [{type: html.DIV_OUTPUT, list: [{type: html.DIV, name: [html.HOVER], style: [ITEM_HOVER_STYLE]}], }]}, - {type: html.FIELDSET_STORY, list: [{type: html.DIV_STATUS, style: {"border-top": color.border+SOLID}}]}, - {type: html.FIELDSET_PLUGIN, list: [{type: html.DIV_STATUS, style: {"border-top": color.border+SOLID}}]}, - {type: html.FIELDSET_PLUGIN, style: [PLUGIN_STYLE]}, - {type: html.FIELDSET_STORY, style: [PLUGIN_STYLE]}, - {type: html.FIELDSET_INPUT, style: [PLUGIN_STYLE]}, - {type: html.FIELDSET_INPUT, style: {"border-radius": 0}}, - // {type: html.FIELDSET_INPUT, style: {"border": color.notice+SOLID}}, + {type: html.FIELDSET_PANEL, name: ["Footer"], list: [{type: html.DIV_OUTPUT, list: [{type: html.DIV, style: [ITEM_HOVER_STYLE]}], }]}, + {type: html.FIELDSET_PANEL, name: ["Header"], list: [{type: html.DIV_OUTPUT, list: [{type: html.DIV, style: [ITEM_HOVER_STYLE]}], }]}, + {type: html.FIELDSET_PLUGIN, style: [PLUGIN_STYLE]}, {type: html.FIELDSET_PLUGIN, list: [{type: html.DIV_STATUS, style: {"border-top": color.border+SOLID}}]}, + {type: html.FIELDSET_STORY, style: [PLUGIN_STYLE]}, {type: html.FIELDSET_STORY, list: [{type: html.DIV_STATUS, style: {"border-top": color.border+SOLID}}]}, + {type: html.FIELDSET_INPUT, style: [PLUGIN_STYLE]}, {type: html.FIELDSET_INPUT, style: _b_r(0)}, ] function render(pre, list) { return can.core.List(list, function(item) { var type = item.type+can.core.List(item.name, function(name) { return (name==html.HOVER? ice.DF: ice.PT)+name }).join("") + if (!item.name && type.indexOf(".select") == -1 && type.indexOf(":hover") == -1 && can.base.isArray(item.style) && item.style.join(",").indexOf("-hover-") > -1) { type += ":hover" } return (item.style? (pre+ice.SP+type+" { "+(can.base.isArray(item.style)? can.core.List(item.style, function(item) { return can.core.Item(style[item], function(key, value) { return key+": "+value }).join("; ") }).join("; "): can.core.Item(can.base.Obj(item.style), function(key, value) { return key+": "+value }).join("; "))+" }"): "")+(item.list? render(pre+ice.SP+type, item.list): "") }).join(ice.NL) } - var text = render("body."+topic, list) - console.log("what", text) - can.page.Append(can, document.head, "style", {"innerText": text}) + var text = render("body."+topic, list); can.page.Append(can, document.head, "style", {"innerText": text}), console.log("topic", topic, text) }, layout: function(can, target, type, list) { const FLOW = "flow", FLEX = "flex" switch (type||ice.AUTO) { case FLOW: case FLEX: - case ice.AUTO: var count = 0; - type = type == "" || type == ice.AUTO? FLEX: type - var ui = {size: {}}; function append(target, type, list) { can.page.ClassList.add(can, target, [html.LAYOUT, type]), - can.core.List(list, function(item) { - if (can.base.isArray(item)) { - append(can.page.Append(can, target, [{}])._target, type==FLOW? FLEX: FLOW, item) - } else if (can.base.isObject(item)) { item._index = count++ - item.layout = function(width, height) { - item.width = width - item.height = height - } - ui.size[item._index+""] = item.height||item.width - can.onappend.plugin(can, item, function(sub) { - item.layout = function(width, height) { - sub.onimport.size(sub, height, width) - } - }, target, ui[item._index+""] = can.onappend.field(can, item.type, item, target)._target) - } else if (can.base.isString(item)) { - ui[item] = can.page.Append(can, target, [item])._target - } - }); return list - } + case ice.AUTO: var count = 0, ui = {size: {}}; type = type == "" || type == ice.AUTO? FLEX: type + function append(target, type, list) { can.page.ClassList.add(can, target, [html.LAYOUT, type]), can.core.List(list, function(item) { + if (can.base.isArray(item)) { + append(can.page.Append(can, target, [{}])._target, type==FLOW? FLEX: FLOW, item) + } else if (can.base.isObject(item)) { item._index = count++, ui.size[item._index] = item.height||item.width + item.layout = function(width, height) { item.width = width, item.height = height } + can.onappend.plugin(can, item, function(sub) { + item.layout = function(width, height) { sub.onimport.size(sub, height, width) } + }, target, ui[item._index] = can.onappend.field(can, item.type, item, target)._target) + } else if (can.base.isString(item)) { + ui[item] = can.page.Append(can, target, [item])._target + } + }); return list } var defer = []; function layout(type, list, width, height) { var _width = width, _height = height; can.core.List(list, function(item) { if (item == html.CONTENT) { - defer.push(function() { can.page.style(can, ui[item], html.HEIGHT, height, html.WIDTH, width) }) - return + return defer.push(function() { can.page.style(can, ui[item], html.HEIGHT, height, html.WIDTH, width) }) } else { - if (can.base.isObject(item)) { var meta = item; item = (item._index||"")+"" } + if (can.base.isObject(item)) { var meta = item; item = (item._index)+"" } function calc(item, size, total) { if (!ui.size[item]) { return size @@ -474,7 +473,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, width, height) } }) } list = append(target, type, list||[html.PROJECT, [[html.CONTENT, html.PROFILE], html.DISPLAY]]) - ui.layout = function(width, height) { can.onmotion.delayLong(can, function() { defer = [], layout(type, list, width, height), defer.forEach(function(cb) { cb() }) }) } + ui.layout = function(width, height, delay) { can.onmotion.delay(can, function() { defer = [], layout(type, list, width, height), defer.forEach(function(cb) { cb() }) }, delay||0) } return ui case "tabs-box": can.page.ClassList.add(can, target, "layout tabs box") diff --git a/lib/page.js b/lib/page.js index c358f9fb..7083f908 100644 --- a/lib/page.js +++ b/lib/page.js @@ -33,9 +33,7 @@ Volcanos("page", {ClassList: { key == "className" && can.base.isArray(val) && (val = val.join(ice.SP)) !can.base.isObject(val)? (target[key] = val): can.core.Item(val, function(k, v) { if (can.base.isIn(k, "height", "width", "min-height", "max-height", "min-width", "max-width") && parseInt(v) < 0) { return target[key] && (target[key][k] = "") } - if (can.base.isIn(k, "height", "width", "min-height", "max-height", "min-width", "max-width", - "left", "top", "right", "bottom", "margin-left", "margin-top", "margin", "padding", "font-size", - ) && v && (can.base.isNumber(v) || !can.base.endWith(v, "px"))) { v += "px" } + if (can.base.isIn(k, "height", "width", "min-height", "max-height", "min-width", "max-width", "left", "top", "right", "bottom", "margin-left", "margin-top", "margin", "padding", "font-size") && v && (can.base.isNumber(v) || !can.base.endWith(v, "px"))) { v += "px" } target[key] && (target[key][k] = v) }) }); return target diff --git a/lib/user.js b/lib/user.js index 9bc199f1..df3af1dc 100644 --- a/lib/user.js +++ b/lib/user.js @@ -108,7 +108,9 @@ Volcanos("user", {info: {}, agent: { var sub = can.user.carte(event, can, meta, item.slice(1), cb, carte, trans); can.onlayout.figure(event, can, sub._target, true), remove_sub(carte), carte._sub = sub } }: /* object */ {view: html.ITEM, list: [{text: can.user.trans(can, item.name, trans), onclick: function(event) { click(event, item.name) }, onmouseenter: function(event) { remove_sub(carte) } }] } }), onmouseover: function(event) { can.onkeymap.prevent(event) } }]); can.onkeymap.prevent(event) - var carte = {_target: ui._target, _parent: parent, layout: can.onlayout.figure(event, can, ui._target)}; return carte + var carte = {_target: ui._target, _parent: parent, layout: can.onlayout.figure(event, can, ui._target)} + can.page.Select(can, ui._target, "img", function(target) { target.onload = function() { can.onlayout.figure(event, can, ui._target) } }) + return carte }, carteRight: function(event, can, meta, list, cb, parent) { var carte = can.user.carte(event, can, meta, list, cb, parent) return can.page.style(can, carte._target, can.onlayout.figure(event, can, carte._target, true)), carte diff --git a/page/index.css b/page/index.css index 4704b910..aea2f886 100644 --- a/page/index.css +++ b/page/index.css @@ -41,13 +41,14 @@ table.content th { background-color:steelblue; padding:2px 5px; } table.content td { padding:2px 5px; } table.content.action th:last-child { position:sticky; right:2px; } table.content.action td:last-child { background-color:steelblue; position:sticky; right:2px; } -div.code { background-color:#343a3445; color:white; font-size:12px; padding:10px; border:green solid 1px; } +div.code { background-color:#343a3445; font-size:12px; padding:10px; border:green solid 1px; } div.story[data-type=spark] { background-color:#2169a9a6; color:white; padding:5px 10px; border-left:solid 5px blue; margin:10px; } /* fieldset */ -div.tabs div { background-color:gray; } +// div.tabs div { background-color:gray; } div.tabs div:hover { background-color:#0000; } div.tabs div.select { background-color:#0000; } fieldset.plugin { background-color:#061c3c9e; padding:10px; margin:10px; } +fieldset.plugin:not(.cmd):not(.full):not(.float)>legend { float:none; } fieldset.plugin>div.status { border-top:1px solid darkcyan; } fieldset.story>div.status { border-top:1px solid darkcyan; } fieldset.panel>div.status { display:none; } @@ -63,9 +64,9 @@ fieldset.simple>legend { display:none; } fieldset.simple>form.option { display:none; } fieldset.simple>div.status { display:none; } fieldset.simple div.toggle { display:none; } -fieldset.float { background-color:#0e3369; color:white; padding:0; margin:0; } -fieldset.full { background-color:#0e3369; color:white; padding:0; margin:0; overflow:auto; position:absolute; left:0; top:0; } -fieldset.cmd>div.output { overflow:auto; } +fieldset.float { padding:0; margin:0; } +fieldset.full { padding:0; margin:0; overflow:auto; position:absolute; left:0; top:0; } +fieldset.cmd { padding:0; margin:0; } /* input */ fieldset.input>legend { display:none; } fieldset.input.key { overflow:auto; } @@ -73,10 +74,12 @@ fieldset.input.key div.action { display:none; } fieldset.input.key.simple div.status { display:none; } fieldset.input.key.simple th { display:none; } fieldset.input.key.simple td { min-width:40px; } -fieldset.input.date select { width:63px; } -fieldset.input.date select[name=year] { width:88px; } -fieldset.input.date select[name=month] { width:70px; } -fieldset.input.date table { text-align:center; width:280px; } +fieldset.input.date select { width:87px; } +fieldset.input.date select { margin-right:0; } +fieldset.input.date input:not([type=file]) { margin-right:0; } +fieldset.input.date select[name=year] { width:128px; } +fieldset.input.date select[name=month] { width:102px; } +fieldset.input.date table { text-align:center; width:350px; } fieldset.input.date div.action div.space { width:0; clear:both; } fieldset.input.date div.output td { padding:2px 10px; } fieldset.input.date div.output td.prev { color:gray; } @@ -86,7 +89,8 @@ fieldset.input.date div.output td span.lunar.term { color:green; } fieldset.input.date div.output td span.lunar.fest { color:red; } fieldset.input.date div.status { text-align:center; } /* float */ -body>div.float { background-color:#0e3369b3; color:white; padding:5px; } +// body div.float { background-color:#0e3369b3; color:white; padding:5px; } +body div.float { background-color:#0e3369b3; padding:5px; } body>div.toast div.title { color:yellow; float:left; } body>div.toast div.duration { color:gray; float:right; } body>div.toast div.content { color:yellow; text-align:center; } @@ -95,7 +99,7 @@ body>div.toast div.progress div.current { background-color:red; height:18px; } body>div.toast div.action { display:block; } body>div.toast div.action>div.item.space { height:unset; } body>div.carte { padding:0; } -body>div.carte div.item { background-color:#0e3369b3; padding:3px 12px; } +body>div.carte div.item { padding:3px 12px; } body>div.carte div.space { border-bottom:solid 1px gray; } body>div.input div.content { overflow:auto; } body>div.input td { padding:5px; } @@ -120,7 +124,7 @@ textarea { tab-size:2; height:62px; } legend { font-size:1.2rem; height:31px; } select, input { font-size:1.0rem; height:31px; } table.content, div.project, div.item, div.code, div.story[data-type=spark], svg { font-family:monospace; white-space:pre; text-align:left; } -div.action>div.tabs { padding:5px 10px; height:31px; } +div.action>div.tabs { padding:5px; height:31px; } div.status>div.item { padding:5px; height:30px; } div.status>div.item>label { font-size:0.6rem; } h1 { text-align:center; margin:20px 0; } @@ -130,24 +134,25 @@ ul { padding-left:40px; margin:20px 0; } /* hover */ legend:hover { background-color:skyblue; } select:hover { background-color:gray; color:cyan; } -div.item:hover, div.item.select, table.content tr:hover, table.content tr.select, h1:hover, h2:hover, h3:hover { background-color:steelblue; } +span.item:hover, div.item:hover, div.item.select, table.content tr:hover, table.content tr.select, h1:hover, h2:hover, h3:hover { background-color:steelblue; } table.content th:hover, table.content td:hover, table.content td.select { background-color:cornflowerblue; } div.story[data-type=spark] span:hover { background-color:deepskyblue; box-shadow:4px 4px 20px 4px #29318e; } body>div.carte div.item:hover { background-color:cornflowerblue; } select, input[type=text], textarea { box-shadow:4px 4px 20px 4px #626bd0; } -legend, select, input[type=button], div.tabs, div.item, th, td, h1, h2, h3 { cursor:pointer; } +legend, select, input[type=button], div.tabs, div.item, div.zone>div.name, th, td, h1, h2, h3 { cursor:pointer; } div.title, div.story[data-type=spark] { cursor:copy; } /* display */ form.option, div.action { display:contents; } form.option>div.item>label, div.action>div.item>label, .hidden, .hide { display:none; } -fieldset:not(.float):not(.full)>form.option input[type=button][name=close] { display:none; } +fieldset:not(.float):not(.plug):not(.full):not(.cmd)>form.option input[type=button][name=close] { display:none; } legend, form.option, form.option>div.item, div.action, div.action>div.item, div.action>div.tabs, div.status>div.item { float:left; } div.output, div.status, div.project div.item, div.content, div.item.textarea, div.code, div.story[data-type=spark] { clear:both; } div.action, div.output, div.status, div.project, div.display, div.profile, div.content, div.code, div.story, table.content, table.content td, body>div.toast { overflow:auto; } -fieldset.auto, fieldset.full, fieldset.float, body>div.float { position:fixed; z-index:10; } +fieldset.auto, fieldset.full, fieldset.float, div.float { position:fixed; z-index:10; } div.status>legend { margin-left:2px; margin-right:0; float:right; clear:none; } div.code { position:sticky; left:0; } /* white */ +body.dark { overflow:hidden; } body.black a { color:yellow; } body.white { background-color:rgba(5,34,56,0.75); color:white; } body.white select { background-color:yellowgreen; color:white; } @@ -164,17 +169,18 @@ body.white input[type=button][name=remove] { background-color:red; } body.white textarea { background-color:white; } body.white table.content th { background-color:skyblue; } body.white table.content.action td:last-child { background-color:skyblue; } -body.white div.zone>div.list>div.zone>div.name { background-color:#e8e9f3; color:black; } +body.white div.zone>div.list>div.zone>div.name { background-color:whitesmoke; color:black; } +body.white div.float { background-color:whitesmoke; color:black; } +body.white div.toast div.title { color:blue; } +body.white div.toast div.content { color:blue; } body.white fieldset.panel.Search a { color:yellow; } body.white fieldset.panel.Action { color:black; } body.white fieldset.panel.Action div.action { color:white; } body.white fieldset.plugin { background-color:#ffffffa1; } -body.white fieldset.float { background-color:#0e3369; color:white; } -body.white fieldset.full { background-color:#0e3369; color:white; } -body.white fieldset.full div.zone>div.list>div.zone>div.name { background-color:#09466f66; color:white; } +body.white fieldset.float { background-color:whitesmoke; color:black; } +body.white fieldset.full { background-color:white; } body.white legend:hover { background-color:skyblue; } body.white select:hover { background-color:#99cc667d; } -body.white input:hover { background-color:cyan; } body.white input[name=cmd]:hover { background-color:white; color:black; } body.white input[type=button]:hover { background-color:#1b7acc8c; } body.white table.content tr:hover { background-color:#4682b46b; } @@ -209,7 +215,7 @@ body.mobile textarea { font-size:1.2rem; } body.mobile table.content th { padding:6px 6px; } body.mobile form.option>div.item { margin:0; height:38px; } body.mobile div.action>div.item { margin:0; height:38px; } -body.mobile div.action { display:none; } +// body.mobile div.action { display:none; } body.mobile>div.carte div.item { font-size:1.6rem; } body.mobile>div.input.login input { font-size:1.4rem; width:264px; } body.mobile fieldset.plugin { margin:10px 0; } @@ -220,14 +226,14 @@ body.mobile fieldset.Header.head div.output { height:3rem; } body.mobile fieldset.Header.head div.output div { height:3rem; margin-left:0; } body.mobile fieldset.Header.head div.state.time { display:none; } body.mobile fieldset.Header.head div.search { height:3rem; width:100%; } -body.mobile fieldset.Header.head div.search>input { background-color:#21181838; color:white; margin:0; width:100%; } -body.mobile fieldset.River { background-color:#243950bf; font-size:1.6rem; min-width:240px; position:fixed; top:3rem; z-index:10; } +body.mobile fieldset.Header.head div.search>input { background-color:#21181838; color:white; margin:0; width:100%; height:42px; } +body.mobile fieldset.River { font-size:1.6rem; min-width:240px; position:fixed; top:3rem; z-index:10; } body.mobile fieldset.River>div.output { width:320px; } body.mobile fieldset.River>div.output div.item { font-size:1.6rem; } body.mobile fieldset.Action.main { margin-top:3rem; margin-bottom:3rem; overflow:hidden; } body.mobile fieldset.Action.main.cmd { margin-top:0; margin-bottom:0; } body.mobile fieldset.Footer.foot { width:100%; } -body.mobile fieldset.Footer.foot { background-color:#000000b8; font-size:1.6rem; height:3rem; position:fixed; bottom:0; } +body.mobile fieldset.Footer.foot { font-size:1.6rem; height:3rem; position:fixed; bottom:0; } body.mobile fieldset.Footer.foot div.output { height:3rem; } body.mobile fieldset.Footer.foot div.output div { height:3rem; } body.mobile fieldset.Footer.foot input[name=cmd] { height:3rem; } @@ -250,7 +256,7 @@ fieldset.plugin.parse.cmd>div.status { display:none; } fieldset.plugin.inner.cmd>legend { display:none; } fieldset.plugin.inner.cmd>div.action { display:none; } fieldset.plugin.inner.cmd>form.option { display:none; } -fieldset.story.inner.float { background-color:black; } +// fieldset.story.inner.float { background-color:black; } fieldset.xterm div.toggle { display:none; } /* layout */ table.layout { border-spacing:0; } diff --git a/panel/action.css b/panel/action.css index f9d097d8..1c482ddc 100644 --- a/panel/action.css +++ b/panel/action.css @@ -8,6 +8,10 @@ fieldset.Action.tabs>div.output { overflow:hidden; } fieldset.Action.tabs>div.output>fieldset>legend { display:none; } fieldset.Action.tabs>div.output>fieldset.plugin { display:none; } fieldset.Action.tabs>div.output>fieldset.plugin.select { display:block; } +fieldset.Header action>div.tabs { padding:0; margin-left:20px; display:contents; } +fieldset.Header action>div.tabs:hover { background-color:none; } +fieldset.Header div.tabs div.tabs { padding:5px 10px; } +fieldset.Header div.tabs div.tabs:hover { background-color:#6495ed63; } fieldset.Action.tabview>div.output { overflow:hidden; } fieldset.Action.tabview>div.output fieldset.plugin.iframe div.output { overflow:hidden; } fieldset.Action.tabview>div.output>fieldset>legend { display:none; } @@ -37,19 +41,10 @@ fieldset.Action.grid>div.output>fieldset.plugin>form.option input[type=text] { w fieldset.Action.flow>div.output>fieldset.plugin { float:left; } fieldset.Action.free>div.output>fieldset.plugin { position:absolute; } fieldset.Action.free>div.output>fieldset.plugin.select { display:block; } -fieldset.Header action>div.tabs { padding:0; margin-left:20px; display:contents; } -fieldset.Header action>div.tabs:hover { background-color:none; } -fieldset.Header div.tabs div.tabs { padding:5px 10px; } -fieldset.Header div.tabs div.tabs:hover { background-color:#6495ed63; } fieldset.Action>div.project.toggle { background-color:cornsilk; opacity:0.4; color:teal; font-size:36px; padding-top:50px; height:150px; width:20px; position:fixed; top:30%; border-top-right-radius:20px; border-bottom-right-radius:20px; } -// fieldset.Action>div.output>fieldset.plugin>legend { box-shadow:4px 4px 20px 4px #626bd0; } -fieldset.Action>div.output>fieldset.plugin:not(.float):not(.full)>legend { float:none; } -fieldset.Action.cmd>div.output>fieldset.plugin { padding:0; margin:0; } -fieldset.Action.cmd>div.output>fieldset.plugin>legend { padding:0 10px; float:left; } -fieldset.Action.cmd>div.output>fieldset.plugin:not(.float):not(.full)>legend { float:left; } div.head { background-color:#404040; color:white; padding:5px; height:42px; clear:both; } div.head div.username { float:right; margin-right:10px; } diff --git a/panel/action.js b/panel/action.js index 1bb95df5..460ab60b 100644 --- a/panel/action.js +++ b/panel/action.js @@ -42,7 +42,7 @@ Volcanos(chat.ONKEYMAP, {_init: function(can, target) { can.onkeymap._build(can) var sub = can._plugins[parseInt(event.key)-1]; if (sub) { can._output.scrollTop = sub._target.offsetTop-html.PLUGIN_MARGIN sub._header_tabs.click() - // can.onmotion.delay(can, function() { sub.Focus() }) + can.onmotion.delay(can, function() { sub.Focus() }) } } can._keylist = can.onkeymap._parse(msg._event, can, model, can._keylist||[], can._output) @@ -100,15 +100,10 @@ Volcanos(chat.ONACTION, {_init: function(can, target) { ), onmain: function(can) { can.onimport._share(can, can.misc.Search(can, web.SHARE)) }, onlogin: function(can) { if (!can.Conf(chat.TOOL) && !can.user.mod.isCmd) { return } - // can._names = location.pathname, can.Conf(chat.TOOL)? can.core.Next(can.Conf(chat.TOOL), function(item, next) { - // can.onimport._cmd(can, item, next) - // }): can.runAction(can.request(), ctx.COMMAND, [], function(msg) { can.core.Next(msg.Table(), function(item, next) { - can.onengine.signal(can, chat.ONACTION_CMD) - can._names = location.pathname, can.Conf(chat.TOOL)? can.onappend.layout(can, can._output, "flow", can.core.List(can.Conf(chat.TOOL), function(item) { - item.type = "plugin" - item.opts = can.misc.Search(can) - item.mode = chat.CMD; return item + can._names = location.pathname, can.Conf(chat.TOOL)? can.onappend.layout(can, can._output, "flow", can.core.List(can.Conf(chat.TOOL), function(item, index, list) { + if (list.length == 1) { item.height = window.innerHeight-2*html.ACTION_HEIGHT } + item.type = chat.PLUGIN, item.mode = chat.CMD, item.opts = can.misc.Search(can); return item })).layout(window.innerWidth, window.innerHeight): can.runAction(can.request(), ctx.COMMAND, [], function(msg) { can.core.Next(msg.Table(), function(item, next) { can.onimport._cmd(can, item, next) }) }) @@ -126,7 +121,8 @@ Volcanos(chat.ONACTION, {_init: function(can, target) { return can.onengine.signal(can, chat.ONACTION_NOTOOL, can.request({}, {river: river, storm: storm})) } can.onaction.layout(can, can.misc.SearchOrConf(can, html.LAYOUT)||msg.Option(html.LAYOUT), true) - return can.onkeymap._init(can), can.onimport._menu(can, msg), can.onimport._init(can, msg) + // return can.onkeymap._init(can), can.onimport._menu(can, msg), can.onimport._init(can, msg) + return can.onkeymap._init(can), can.onimport._init(can, msg) }) }, onaction_cmd: function(can, msg) { can.Conf(html.MARGIN_Y, 2*html.ACTION_HEIGHT), can.Conf(html.MARGIN_X, 0) diff --git a/panel/footer.css b/panel/footer.css index 19db4d7a..9ad1a7a1 100644 --- a/panel/footer.css +++ b/panel/footer.css @@ -1,12 +1,14 @@ fieldset.Footer { font-size:1.1rem; padding:0 5px; clear:both; } fieldset.Footer>div.output { overflow:auto; } -fieldset.Footer>div.output div { cursor:pointer; padding:5px; height:31px; } +fieldset.Footer>div.output div { padding:5px; height:31px; cursor:pointer; } fieldset.Footer>div.output div:hover { background-color:#2e515f; } fieldset.Footer>div.output div.title { float:left; } fieldset.Footer>div.output div.state { font-family:monospace; float:right; } +fieldset.Footer>div.output div.state label { font-size:12px; } fieldset.Footer>div.output div.toast { background-color:darkcyan; float:right; } fieldset.Footer>div.output div.cmd { padding:0px; float:left; } -fieldset.Footer>div.output input[name=cmd] { width:120px; } -fieldset.Footer>div.output input[name=cmd]:focus { width:320px; } +fieldset.Footer>div.output input[name=cmd] { margin-left:40px; width:120px; transition:all 0.5s; } +fieldset.Footer>div.output input[name=cmd]:focus { width:320px; transition:all 0.5s; } +fieldset.Footer>div.output input[name=cmd]:hover { width:320px; transition:all 0.5s; } fieldset.story.nlog.float tbody tr.warn { color:yellow; } fieldset.story.nlog.float tbody tr.error { color:red; } diff --git a/panel/footer.js b/panel/footer.js index 56a9a920..a5689b6c 100644 --- a/panel/footer.js +++ b/panel/footer.js @@ -17,7 +17,7 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, target) { case cli.CLEAR: can.cli && can.cli.close(); break default: can.runAction(event, ice.RUN, can.core.Split(event.target.value, ice.SP), function(msg) { can.cli && can.cli.close && can.cli.close(), can["cli"] = {}; var ui = can.onexport.float(can, msg, "cli") - can.getActionSize(function(left) { can.page.style(can, ui._target, html.LEFT, left, html.RIGHT, "", html.BOTTOM, can.onexport.height(can)) }) + can.getActionSize(function(left) { can.page.style(can, ui._target, html.LEFT, left+10, html.RIGHT, "", html.BOTTOM, can.onexport.height(can)) }) }) } }}, "", target, [chat.TITLE, ice.CMD]) }, count: function(can, name) { can.page.Select(can, can._output, can.core.Keys(html.SPAN, name), function(item) { item.innerHTML = can.Conf(name, parseInt(can.Conf(name)||"0")+1+"")+"" }) }, diff --git a/panel/header.css b/panel/header.css index 9df8e149..b71661b6 100644 --- a/panel/header.css +++ b/panel/header.css @@ -1,11 +1,14 @@ fieldset.Header { font-size:1.1rem; padding:0 5px; height:31px; overflow:auto; z-index:10; } fieldset.Header>div.output { overflow:hidden; } -fieldset.Header>div.output div { cursor:pointer; padding:5px; height:31px; float:left; } +fieldset.Header>div.output div { padding:5px; height:31px; float:left; cursor:pointer; } fieldset.Header>div.output div:hover { background-color:#2e515f; } fieldset.Header>div.output div.title { float:left; } fieldset.Header>div.output div.state { float:right; } fieldset.Header>div.output div.state.avatar { padding:0; height:31px; } fieldset.Header>div.output div.state.avatar>img { height:31px; } fieldset.Header>div.output div.search { margin-left:20px; float:left; } -fieldset.Header>div.output div.search>input { margin-top:-5px; height:30px; } +fieldset.Header>div.output search { float:left; } +fieldset.Header>div.output div.search>input { margin-top:-5px; height:30px; transition:all 0.5s; } +fieldset.Header>div.output div.search>input:focus { width:320px; transition:all 0.5s; } +fieldset.Header>div.output div.search>input:hover { width:320px; transition:all 0.5s; } fieldset.Header>div.output river { margin-right:100px; } diff --git a/panel/header.js b/panel/header.js index 79292f50..f6478b6a 100644 --- a/panel/header.js +++ b/panel/header.js @@ -4,7 +4,7 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, target) { can.onimport._avatar(can, msg, target) can.onimport._background(can, msg, target) can.onimport._search(can, msg, target) - can.onimport._menus(can, msg, target) + // can.onimport._menus(can, msg, target) }, _title: function(can, msg, target) { if (can.user.isMobile) { return } can.core.List(can.base.getValid(can.Conf(chat.TITLE)||msg.result, ["shylinux.com/x/contexts"]), function(item) { @@ -12,13 +12,14 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, target) { }) }, _state: function(can, msg, target) { if (can.user.isMobile) { return } - can.core.List(can.base.Obj(can.Conf(chat.STATE)||msg.Option(chat.STATE), [aaa.AVATAR, aaa.USERNICK, mdb.TIME]).reverse(), function(item) { + can.core.List(can.base.Obj(can.Conf(chat.STATE)||msg.Option(chat.STATE), [aaa.USERNICK, aaa.AVATAR, mdb.TIME]).reverse(), function(item) { + // can.core.List(can.base.Obj(can.Conf(chat.STATE)||msg.Option(chat.STATE), [aaa.AVATAR, aaa.USERNICK, mdb.TIME]).reverse(), function(item) { if (item == aaa.AVATAR ) { if (can.user.isLocalFile) { return } - can.page.Append(can, target, [{view: can.base.join([chat.STATE, item]), list: [{img: ice.SP}], onmouseenter: function(event) { + can.page.Append(can, target, [{view: can.base.join([chat.STATE, item]), list: [{img: ice.SP}], onclick: function(event) { can.onaction.carte(event, can, [can.page.Format(html.IMG, can.onexport.avatar(can), 160)]) }}]); return } - can.page.Append(can, target, [{view: [can.base.join([chat.STATE, item]), html.DIV, (can.Conf(item)||msg.Option(item)||"").split("@")[0].slice(0, 10)], onmouseenter: function(event) { + can.page.Append(can, target, [{view: [can.base.join([chat.STATE, item]), html.DIV, (can.Conf(item)||msg.Option(item)||"").split("@")[0].slice(0, 10)], onclick: function(event) { can.core.CallFunc([can.onaction, item], [event, can, item]) }, _init: function(target) { item == mdb.TIME && can.onimport._time(can, target) }}]) }) @@ -113,7 +114,7 @@ Volcanos(chat.ONACTION, { logout: function(event, can) { can.user.logout(can) }, }) Volcanos(chat.ONEXPORT, {height: function(can) { return can._target.offsetHeight }, - topic: function(can) { return can._topic || can.misc.Search(can, chat.TOPIC) || (can.base.isNight()? "dark": chat.WHITE) }, + topic: function(can) { return can._topic || can.misc.Search(can, chat.TOPIC) || (can.base.isNight()? "dark": "light") }, background: function(can) { return can.user.info.background == "void"? "": can.user.info.background }, avatar: function(can) { return can.user.info.avatar == "void"? "": can.user.info.avatar }, }) @@ -123,7 +124,7 @@ Volcanos(chat.ONPLUGIN, { }), topic: shy("界面主题", { _init: function(can) { can.Option(chat.TOPIC, can.getHeader(chat.TOPIC)) }, - }, ["topic:select=black,white,light,dark", ice.RUN], function(can, msg, arg) { + }, ["topic:select=dark,light,white,black", ice.RUN], function(can, msg, arg) { msg.Echo(can.onimport.topic(can, arg[0])) }), location: shy("请求地址", { diff --git a/panel/search.css b/panel/search.css index 76906d9a..2dfe3ad5 100644 --- a/panel/search.css +++ b/panel/search.css @@ -1,5 +1,5 @@ fieldset.Search { background-color:#041a25bd; padding:10px; display:none; position:fixed; left:0px; top:31px; } fieldset.Search input.word { width:100%; } fieldset.Search>div.output table { width:100%; } -// fieldset.Search>div.status { border-top:1px solid darkcyan; } -fieldset.Search>div.status { display:block; overflow:auto; } +fieldset.Search>div.status { display:block; } +fieldset.Search.panel fieldset.story>form.option input[type=button][name=close] { display:block; } diff --git a/panel/search.js b/panel/search.js index 67738a70..cadb0db8 100644 --- a/panel/search.js +++ b/panel/search.js @@ -12,7 +12,9 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg) { can.onmotion.clear(can, can can.onengine.signal(can, chat.ONSEARCH, res), can.type = arg[0], can.onimport._init(can, res) }), can.onmotion.show(can) }, - select: function(can, msg, cmds, cb) { can.getActionSize(function(left, top, width, height) { can.page.style(can, can._target, {left: left||0, top: top||0}), can.onaction.onsize(can, height, width) }) + select: function(can, msg, cmds, cb) { can.getActionSize(function(left, top, width, height) { + can.page.style(can, can._target, {left: left||0, top: top||0, width: width}), can.onaction.onsize(can, height, width) + }) var fields = (cmds[2]||msg.Option(ice.MSG_FIELDS)||"ctx,cmd,type,name,text").split(ice.FS); can.page.Appends(can, can.ui.display, [{th: fields}]), can.onmotion.hidden(can, can.ui.display) can.ui.word.value = cmds[1], can.input = function(event, word) { cmds[1] = word||cmds[1]; can.onimport._word(can, msg, cmds, fields) } can.cb = function() { can.base.isFunc(cb) && cb(can.onexport.select(can)), can.onmotion.hide(can) } diff --git a/plugin/local/code/inner.css b/plugin/local/code/inner.css index 18cd702d..e6905cd9 100644 --- a/plugin/local/code/inner.css +++ b/plugin/local/code/inner.css @@ -1,20 +1,8 @@ fieldset.inner>form.option input[name=path] { width:80px; } fieldset.inner>form.option input[name=file] { width:160px; } -fieldset.inner>div.action>div.tabs { padding:5px; margin:0 1px; } -fieldset.inner>div.output>div.project { width:230px; } -fieldset.inner>div.output>div.layout.flow { width:min-content; } -fieldset.inner>div.output>div.layout.flow>div.tabs { display:none; } -fieldset.inner>div.output>div.layout.flow>div.path { display:none; } -fieldset.inner>div.output input { font-size:14px; } -fieldset.inner>div.output div.zone { font-size:14px; line-height:20px; } -fieldset.inner>div.output div.zone input { outline:none; } -fieldset.inner>div.output div.content { color:white; font-size:14px; font-family:monospace; position:relative; } -fieldset.inner>div.output div.content>tr:hover { background-color:#4682b46b; } -fieldset.inner>div.output div.content>tr.select { background-color:#4682b46b; } -fieldset.inner>div.output div.content>tr.select td.line { background-color:#6495ed63; border:solid 1px red; border-right:solid 2px red; } -fieldset.inner>div.output div.content td.line { position:sticky; left:0; text-align:right; padding:0 6px; border-right:solid 2px red; } -fieldset.inner>div.output div.content td.text { line-height:20px; white-space:pre; padding-left:10px; cursor:text; } -fieldset.inner>div.output div.content td.text span.comment { background-color:#0000; color:green; } +fieldset.inner>div.output * { font-size:14px; font-family:monospace; outline:none; } +fieldset.inner>div.output div.content { position:relative; } +fieldset.inner>div.output div.content td.text span.comment { color:green; } fieldset.inner>div.output div.content td.text span.keyword { color:yellow; } fieldset.inner>div.output div.content td.text span.package { color:lightgreen; } fieldset.inner>div.output div.content td.text span.datatype { color:cyan; } @@ -22,101 +10,65 @@ fieldset.inner>div.output div.content td.text span.function { color:lightgreen; fieldset.inner>div.output div.content td.text span.constant { color:magenta; } fieldset.inner>div.output div.content td.text span.string { color:magenta; } fieldset.inner>div.output div.content td.text span.object { color:cyan; } -fieldset.inner>div.output div.find.float { position:absolute; z-index:10; } -fieldset.inner.cmd>div.output>div.layout.flow>div.tabs { height:38px; overflow:auto; display:block; } -// fieldset.inner.cmd>div.output>div.layout.flow>div.tabs { background-color:#70809096; height:38px; overflow:auto; display:block; } -fieldset.inner.cmd>div.output>div.layout.flow>div.tabs>div { font-family:monospace; padding:10px 30px; height:38px; float:left; } +fieldset.inner>div.output legend { font-size:1rem; line-height:2rem; } +fieldset.inner>div.output>div.project { width:230px; } +fieldset.inner>div.output>div.layout.flow>div.tabs { display:none; } +fieldset.inner>div.output>div.layout.flow>div.path { display:none; } +fieldset.inner.cmd>div.output>div.layout.flow>div.tabs { height:38px; display:block; overflow:auto; } +fieldset.inner.cmd>div.output>div.layout.flow>div.tabs>div { padding:10px 20px; height:38px; float:left; } fieldset.inner.cmd>div.output>div.layout.flow>div.tabs div.avatar { padding:0; height:38px; float:right; } fieldset.inner.cmd>div.output>div.layout.flow>div.tabs div.avatar>img { height:38px; } fieldset.inner.cmd>div.output>div.layout.flow>div.tabs div.time { float:right; } -fieldset.inner.cmd>div.output>div.layout.flow>div.path { font-family:monospace; padding:5px 10px; display:block; } -fieldset.inner.cmd>div.output>div.layout.flow>div.path span.item { padding:0px 5px; } -fieldset.inner.cmd>div.output>div.layout.flow>div.path span.item:hover { background-color:cornflowerblue; cursor:pointer; } -body.black fieldset.inner>div.output div.content td.text span.comment { background-color:blue; color:cyan; } -// body.white fieldset.inner.cmd>div.output>div.layout.flow>div.tabs div { padding:10px 30px; } -body.white fieldset.inner>div.output div.project div.zone>div.list>div.zone>div.name { background-color:#e8e9f3; } -body.white fieldset.inner.cmd>div.output>div.layout.flow>div.tabs { height:38px; } -body.white fieldset.inner>div.output div.zone { color:#6c6c6c; } -body.white fieldset.inner>div.output div.zone.dream { color:black; } -body.white fieldset.inner>div.output input[type=button] { background-color:#1f87d5;; } -body.white fieldset.inner>div.output div.content td.text { line-height:14px; } -body.white fieldset.inner>div.output div.content td.text span.constant { color:#876d2e; } -body.white fieldset.inner.cmd>div.output>div.layout.flow>div.tabs { background-color:#f5f5f5; } -body.white fieldset.inner.cmd>div.output>div.layout.flow>div.tabs div { background-color:#eeefee; } -body.white fieldset.inner:not(.float):not(.full)>div.output div.content { color:black; } -body.white fieldset.inner:not(.float):not(.full)>div.output div.content td.text span.keyword { color:blue; } -body.white fieldset.inner:not(.float):not(.full)>div.output div.content td.text span.datatype { color:#02168e; } -body.white fieldset.inner:not(.float):not(.full)>div.output div.content td.text span.function { color:green; } -body.white fieldset.inner.cmd>div.output>div.layout.flow>div.tabs div:hover { background-color:white; } -body.white fieldset.inner.cmd>div.output>div.layout.flow>div.tabs div.select { background-color:white; } -body.white fieldset.inner.cmd>div.output>div.layout.flow>div.path { background-color:white; } -body.white fieldset.inner.cmd>div.output div.project { background-color:whitesmoke; } -body.white fieldset.inner.cmd>div.output div.project.toggle { background-color:#4682b46b; } +fieldset.inner.cmd>div.output>div.layout.flow>div.path { padding:5px; display:block; } +fieldset.inner.cmd>div.output>div.layout.flow>div.path span.func { margin-left:20px; } + +body.white div.path span.item:hover { background-color:whitesmoke; } +body.white div.carte.path.float div.item:hover { background-color:white; } +body.white fieldset.inner.cmd>div.output { background-color:whitesmoke; } body.white fieldset.inner.cmd>div.output div.content { background-color:white; } -body.white fieldset.inner.cmd>div.output div.content tr.select { background-color:white; } -body.white fieldset.inner.cmd>div.output div.content tr.select td.line { background-color:steelblue; color:white; border:none; } -body.white fieldset.inner.cmd>div.output div.content tr.select td.text { border:solid 1px lightgray; } -body.white fieldset.inner.cmd>div.output div.content td.line { background:white; padding-top:4px; border-right:none; } -body.white fieldset.inner.cmd>div.output div.content td.text { border:solid 1px transparent; } -body.white fieldset.inner>div.output div.content td.text span.string { color:royalblue; } +body.white fieldset.inner.cmd>div.output>div.layout.flow>div.tabs div.select { background-color:white; } +body.white fieldset.inner.cmd>div.output>div.layout.flow>div.tabs div:hover { background-color:white; } +body.white fieldset.inner.cmd>div.output>div.layout.flow>div.path { background-color:white; } +body.white fieldset.inner>div.output div.content tr:hover { background-color:whitesmoke; } +body.white fieldset.inner>div.output div.content tr.select { background-color:whitesmoke; } +body.white fieldset.inner>div.output div.content tr.select td.line { background-color:steelblue; color:white; } +body.white fieldset.inner>div.output div.content td.text span.comment { color:darkgrey; } +body.white fieldset.inner>div.output div.content td.text span.keyword { color:blue; } body.white fieldset.inner>div.output div.content td.text span.package { color:brown; } +body.white fieldset.inner>div.output div.content td.text span.datatype { color:darkgreen; } +body.white fieldset.inner>div.output div.content td.text span.function { color:green; } +body.white fieldset.inner>div.output div.content td.text span.constant { color:brown; } +body.white fieldset.inner>div.output div.content td.text span.string { color:royalblue; } +body.white fieldset.inner>div.output div.content td.text span.object { color:darkcyan; } +body.black fieldset.inner>div.output div.content td.text span.comment { background-color:blue; color:cyan; } body.mobile fieldset.inner>form.option input[name=file] { width:90px; } -body.mobile fieldset.inner.cmd>div.output div.toggle { display:block; } -body.mobile fieldset.inner.cmd>div.output div.toggle { background-color:lightblue; width:30px; } -body.mobile fieldset.inner.cmd>div.output div.toggle.display { background-color:lightblue; margin-top:-33px; height:30px; width:100px; } -.unselectable { - -webkit-touch-callout:none; - -webkit-user-select:none; - -khtml-user-select:none; - -moz-user-select:none; - -ms-user-select:none; - -o-user-select:none; - user-select:none; -} -div.project div.zone.create>div.action { display:none; } -div.project div.zone.create>div.list div.item { padding:2px; float:left; clear:none; } -div.project div.zone.create>div.list div.item input { font-family:monospace; letter-spacing:2px; } -body.webview div.project div.zone.create>div.list div.item { padding:2px; } -body.white.simple fieldset.plugin div.output.json div.item span.nonce { color:lightgray; } -fieldset.word fieldset.inner>form.option input[name=path] { width:240px; } +body.mobile fieldset.word fieldset.inner>form.option input[type=text] { display:none; } -fieldset.Action fieldset.plugin.cmd { border:none; } -div.carte.path.float { font-size:14px; border-radius:0; } -div.carte.path.float div.item { padding:5px; } +div.zone>div.action>div.item input[type=text] { margin-right:-10px; } +div.zone>div.list>div.zone>div.name:hover { margin-left:10px; transition:all 0.3s; } +div.tabs>div div.icon { margin-left:10px; margin-top:2px; float:right; visibility:hidden; } div.tabs>div:hover div.icon { visibility:visible; } +div.action>div div.icon { margin-left:10px; margin-top:2px; float:right; visibility:hidden; } div.action>div:hover div.icon { visibility:visible; } +div.carte.path.float { font-size:14px; border-radius:0; } div.carte.path.float div.item { padding:5px; } +div.path span.item { padding:5px; cursor:pointer; } +tr.line>td.line { text-align:right; padding:0 10px; position:sticky; left:0; } +tr.line>td.text { line-height:20px; white-space:pre; padding-left:10px; cursor:text; } +body.white tr.line.select { background-color:dimgray; } body.white tr.line:hover { background-color:dimgray; } +body.black tr.line.select { background-color:darkblue; } body.black tr.line:hover { background-color:darkblue; } +fieldset>div.output>fieldset.plug { bottom:0px; right:0px; display:none; } +fieldset>div.output>fieldset.plug.select { display:block; } +body.mobile fieldset.plugin>legend { border:none; } +.unselectable { -webkit-touch-callout:none; -webkit-user-select:none; -khtml-user-select:none; -moz-user-select:none; -ms-user-select:none; -o-user-select:none; user-select:none; } -fieldset>div.output>fieldset.plug { position:absolute; bottom:0px; right:0px; } -fieldset.cmd>div.output>fieldset.plug { position:fixed; bottom:0px; right:0px; } -fieldset>div.output>fieldset.plug { display:none; } -fieldset>div.output>fieldset.plug.select { background-color:#060709; color:white; display:block; z-index:10; } - -fieldset.inner div.output div.complete>div { - white-space: pre; - float:left; -} -fieldset.inner div.project div.zone>div.action>div.item input[type=text] { margin-right:-10px; } -body.dark fieldset.inner div.project div.zone>div.action>div.item input[type=text] { background-color:#444444; color:white; outline:none; margin-right:-10px; } -body.dark fieldset.inner div.project div.zone>div.action>div.item input[type=text]:hover { background-color:#444444; color:white; outline:none; } -body.dark fieldset.inner>div.output div.project div.zone>div.list>div.zone>div.name { background-color:#3f3f46; } -body.dark fieldset.inner>div.output div.zone { background-color:#2a2a2a; } -body.dark fieldset.inner>div.output input { background-color:#444444; color:white; font-family:monospace; outline:none; } -body.dark fieldset.inner>div.output div.complete div.content { background-color:#2a2a2a; } -body.dark fieldset.inner>div.output div.complete table { background-color:#2a2a2a; } -body.dark fieldset.inner>div.output input[type=button] { background-color:#1d6fa8; } -body.dark fieldset.inner>div.output input:hover { background-color:#444444; color:white; outline:none; } -body.dark fieldset.inner>div.output { font-size:14px; line-height:20px; color:#d2d2d2; } -body.dark fieldset.inner>div.output legend { font-size:1rem; line-height:2rem; color:#d2d2d2; } -body.dark fieldset.inner>div.output>div.layout.flow>div.tabs { height:40px; } -body.dark fieldset.inner>div.output>div.layout.flow>div.tabs>div { padding:10px 30px; } -body.dark fieldset.inner>div.output>div.layout.flow>div.tabs div.avatar { height:40px; } -body.dark fieldset.inner>div.output div.content tr.select td.line { border:solid 0px #494949; } -body.dark fieldset.inner>div.output div.content td.text span.keyword { color:#5e99c9; font-weight:normal; } +body.dark fieldset.inner>div.output div.content td.text span.comment { color:green; } +body.dark fieldset.inner>div.output div.content td.text span.keyword { color:#5e99c9; } +body.dark fieldset.inner>div.output div.content td.text span.datatype { color:#d2d2d2; } body.dark fieldset.inner>div.output div.content td.text span.constant { color:#bed3af; } body.dark fieldset.inner>div.output div.content td.text span.string { color:#d19b81; } -body.dark fieldset.inner>div.output div.content td.text span.comment { background-color:#0000; color:green; } -body.dark fieldset.inner>div.output div.content td.text span.datatype { color:#d2d2d2; } - -body.dark div.code { border:solid 1px cadetblue } -body.dark div.float { background-color:#2a2a2a; } -body.dark div.float input { background-color:#444444; color:white; } -body.dark div.float input:hover { background-color:#444444; } -body.dark div.float input:focus { outline:none; border:solid 1px #64afeb; } \ No newline at end of file +body.light fieldset.inner>div.output div.content td.text span.comment { color:darkgrey; } +body.light fieldset.inner>div.output div.content td.text span.keyword { color:#3d45ff; } +body.light fieldset.inner>div.output div.content td.text span.package { color:darkblue; } +body.light fieldset.inner>div.output div.content td.text span.datatype { color:darkblue; } +body.light fieldset.inner>div.output div.content td.text span.function { color:darkcyan; } +body.light fieldset.inner>div.output div.content td.text span.constant { color:#a8120e; } +body.light fieldset.inner>div.output div.content td.text span.string { color:#a8120e; } +body.light fieldset.inner>div.output div.content td.text span.object { color:darkblue; } diff --git a/plugin/local/code/inner.js b/plugin/local/code/inner.js index 90fe109b..8c6f9313 100644 --- a/plugin/local/code/inner.js +++ b/plugin/local/code/inner.js @@ -113,9 +113,10 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb, target) { can.onmotion.cl if (block && ls[1] == ice.DF) { push("+ "+block+ice.SP+ls[0]+ice.DF+(index+1)) } } } - }); (can.parse == nfs.JS || can.parse == nfs.GO) && can.page.Append(can, target, [{view: [html.ITEM, html.SPAN, (current||"function")+" / "+can.max+percent], onclick: function(event) { + }); (can.parse == nfs.JS || can.parse == nfs.GO) && can.page.Append(can, target, [{view: [[html.ITEM, "func"], html.SPAN, (current||"function")+" / "+can.max+percent], onclick: function(event) { can.user.carte(event, can, {_style: nfs.PATH}, list, function(ev, button) { can.onimport.tabview(can, can.Option(nfs.PATH), can.Option(nfs.FILE), can.core.Split(button, ice.DF)[1]) + can.onmotion.clearFloat(can) }) }}]) }, @@ -148,14 +149,14 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb, target) { can.onmotion.cl }), can.ui.current && can.onmotion.toggle(can, can.ui.current, !isCommand() && !isDream()) var ls = can.file.split(ice.PS); if (ls.length > 4) { ls = [ls.slice(0, 2).join(ice.PS)+"/.../"+ls.slice(-2).join(ice.PS)] } can.Status(kit.Dict("文件", ls.join(ice.PS), "类型", can.parse)), can.onimport.layout(can) - // if (!skip) { can.onaction.selectLine(can, can.Option(nfs.LINE)), can.onaction.scrollIntoView(can) } can.base.isFunc(cb) && cb(), cb = null + can.onaction.selectLine(can, can.Option(nfs.LINE)), can.onaction.scrollIntoView(can) can.base.isFunc(cb) && cb(), cb = null }) } function load(msg) { var skip = false; can.db.tabview[key] = msg - can.onimport.tabs(can, [{name: file.split(isCommand()? ice.PT: ice.PS).pop(), text: file}], function(event) { - can._tab = msg._tab = event.target, show(skip), skip = true + can.onimport.tabs(can, [{name: file.split(isCommand()? ice.PT: ice.PS).pop(), text: file}], function(event, tabs) { + can._tab = msg._tab = tabs._target, show(skip), skip = true }, function(item) { can.onengine.signal(can, "tabview.view.delete", msg) msg._content != can.ui._content && can.page.Remove(can, msg._content), msg._profile != can.ui._profile && can.page.Remove(can, msg._profile) delete(can.ui._content._cache[key]), delete(can.ui._profile._cache[key]), delete(can.ui.display._cache[key]) @@ -179,7 +180,10 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb, target) { can.onmotion.cl can.ui.profile = sup._profile = can.page.Append(can, can.ui._profile.parentNode, [{view: [html.PROFILE, html.IFRAME], src: msg.Append(mdb.LINK)}])._target can.onmotion.toggle(can, can.ui.profile, true), can.onimport.layout(can) } else { can.ui.profile = sup._profile = can.ui._profile - can.onimport.process(can, msg, can.ui.profile, can.ui.profile.offsetHeight||can.ui.content.offsetHeight, can.db.profile_size[can.onexport.keys(can)]||(can.ConfWidth()-can.ui.project.offsetWidth)/2) + can.onimport.process(can, msg, can.ui.profile, can.ui.profile.offsetHeight||can.ui.content.offsetHeight, can.db.profile_size[can.onexport.keys(can)]||(can.ConfWidth()-can.ui.project.offsetWidth)/2, function(sub) { + can.db.profile_size[can.onexport.keys(can)] = sub.ConfWidth() + can.onimport.layout(can) + }) can.page.Select(can, can.ui.profile, html.TABLE, function(target) { can.onmotion.delay(can, function() { if (target.offsetWidth < can.ui._profile.offsetWidth) { can.db.profile_size[can.onexport.keys(can)] = target.offsetWidth, can.onimport.layout(can) } }) }) @@ -234,13 +238,13 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb, target) { can.onmotion.cl }, layout: function(can) { if (can.isSimpleMode()) { return can.page.style(can, can.ui.content, html.WIDTH, can.ConfWidth()) } - if (can.isCmdMode()) { can.ConfHeight(can.page.height()), can.ConfWidth(can.page.width()) } + if (can.isCmdMode()) { can.page.styleHeight(can, can._output, can.ConfHeight(can.page.height())), can.ConfWidth(can.page.width()) } if (can.isFloatMode()) { can.onmotion.hidden(can, can.ui.profile) } var width = can.ConfWidth()+(can.user.isWindows && !can.isCmdMode()? 20: 0) var height = can.user.isMobile && can.isFloatMode()? can.page.height()-2*html.ACTION_HEIGHT: can.base.Min(can.ConfHeight(), 320)-1 can.user.isMobile && can.isCmdMode() && can.page.style(can, can._output, html.MAX_HEIGHT, height) can.ui.size = {profile: can.db.profile_size[can.onexport.keys(can)]||0.5, display: can.db.display_size[can.onexport.keys(can)]||3*html.ACTION_HEIGHT} - can.ui.layout(width-2, height) + can.ui.layout(width, height, 0) var sub = can.ui.content._plugin; sub && sub.onimport.size(sub, can.ui.content.offsetHeight-2*html.ACTION_HEIGHT, can.ui.content.offsetWidth, true) }, exts: function(can, url, cb) { @@ -310,6 +314,8 @@ Volcanos(chat.ONSYNTAX, {_init: function(can, msg, cb) { _parse: function(can, line) { line = can.page.replace(can, line||"") function wrap(text, type) { return can.page.Format(html.SPAN, text, type) } var p = can.onsyntax[can.parse]||{}; p = can.onsyntax[p.link]||p, p.split = p.split||{} + if (p.prefix && can.core.Item(p.prefix, function(pre, type) { if (can.base.beginWith(line, pre)) { return line = wrap(line, type) } }).length > 0) { return line } + if (p.suffix && can.core.Item(p.suffix, function(end, type) { if (can.base.endWith(line, end)) { return line = wrap(line, type) } }).length > 0) { return line } p.keyword && (line = can.core.List(can.core.Split(line, p.split.space||"\t ", p.split.operator||"{[(.,:;!?|&*/+-<=>)]}", {detail: true}), function(item, index, array) { item = can.base.isObject(item)? item: {text: item}; var text = item.text, type = p.keyword[text] switch (item.type||type) { @@ -327,8 +333,6 @@ Volcanos(chat.ONSYNTAX, {_init: function(can, msg, cb) { return t && t.length > 0? wrap(text, t[0]): type? wrap(text, type): text } }).join("")) - p.prefix && can.core.Item(p.prefix, function(pre, type) { if (can.base.beginWith(line, pre)) { line = wrap(line, type) } }) - p.suffix && can.core.Item(p.suffix, function(end, type) { if (can.base.endWith(line, end)) { line = wrap(line, type) } }) return line }, }) @@ -436,7 +440,7 @@ Volcanos(chat.ONACTION, { function complete(target, button) { can.onappend.figure(can, {action: "key", mode: chat.SIMPLE, _enter: function(event) { if (event.ctrlKey) { meta.grep() } else { meta[button](), can.onmotion.delay(can, function() { target.focus() }) } return true - }, run: function(event, cmds, cb) { var msg = can.request(event); can.core.List(can.core.Split(can.current.text(), "\t \n{[(,:;=)]}", {detail: true}), function(value) { + }, run: function(event, cmds, cb) { var msg = can.request(event); can.core.List(can.core.Split(can.current.text(), "\t {([,:;=<>])}", {detail: true}), function(value) { if (can.base.isObject(value)) { if (value.type == html.SPACE) { return } value.type == lang.STRING && msg.Push(mdb.VALUE, value.left+value.text+value.right), msg.Push(mdb.VALUE, value.text) } else { @@ -450,7 +454,7 @@ Volcanos(chat.ONACTION, { {type: html.BUTTON, name: nfs.REPLACE}, {type: html.BUTTON, name: cli.CLOSE}, ], ui.action, {_trans: {find: "查找", grep: "搜索", replace: "替换"}, find: function() { find(last+1, from.value) }, - grep: function() { can.onimport.exts(can, "inner/search.js", function(sub) { sub.select(), meta.close(), can.onmotion.delayLong(can, function() { sub.runAction(event, nfs.GREP, [from.value, can.Option(nfs.PATH)]) }) }) }, + grep: function() { can.onimport.exts(can, "inner/search.js", function(sub) { sub.select(), meta.close(), can.onmotion.delay(can, function() { sub.runAction(event, nfs.GREP, [from.value, can.Option(nfs.PATH)]) }) }) }, replace: function() { var text = can.current.text(), line = can.onaction._getLineno(can, can.current.line) can.db.undo.push(function() { can.onaction.selectLine(can, line), can.onaction.modifyLine(can, line, text) }) can.current.text(text.replace(from.value, to.value)), can.current.text().indexOf(from.value) == -1 && meta.find() diff --git a/plugin/local/code/inner/search.js b/plugin/local/code/inner/search.js index 4688860e..cb9d19ba 100644 --- a/plugin/local/code/inner/search.js +++ b/plugin/local/code/inner/search.js @@ -1,14 +1,12 @@ Volcanos(chat.ONIMPORT, {list: ["main", "filter", "grep:button", "history", "last"], _init: function(can, msg) { - can.misc.Debug("what") can.onmotion.clear(can), can.onappend.table(can, msg) can.onmotion.delay(can, function() { + msg can.page.Select(can, can._option, "input[name=filter]", function(target) { target.onkeyup = function(event) { can.onmotion.highlight(can, target.value) } }) }) }}) Volcanos(chat.ONACTION, { - "grep": function(event, can, button) { - can.runAction(event, nfs.GREP, [can.Option("main")], function(msg) { can.onimport._init(can, msg) }) - }, + grep: function(event, can, button) { can.runAction(event, nfs.GREP, [can.Option("main")], function(msg) { can.onimport._init(can, msg) }) }, }) diff --git a/plugin/local/code/inner/syntax.js b/plugin/local/code/inner/syntax.js index 54adb113..f010fc71 100644 --- a/plugin/local/code/inner/syntax.js +++ b/plugin/local/code/inner/syntax.js @@ -290,9 +290,7 @@ Volcanos(chat.ONSYNTAX, { }, sum: {}, js: { prefix: {"// ": code.COMMENT}, - regexp: { - "[A-Z_0-9]+": code.CONSTANT, - }, + regexp: {"[A-Z_0-9]+": code.CONSTANT}, keyword: { "const": code.KEYWORD, "var": code.KEYWORD, @@ -381,6 +379,7 @@ Volcanos(chat.ONSYNTAX, { }, }, json: {}, css: { + prefix: {"// ": code.COMMENT, "/* ": code.COMMENT}, split: {operator: "{[(.,:;&>=)]}"}, regexp: { "[-0-9]+deg": code.CONSTANT, @@ -390,10 +389,6 @@ Volcanos(chat.ONSYNTAX, { "[-0-9]+": code.CONSTANT, "#[^ ;]+": code.CONSTANT, }, - prefix: { - "/* ": code.COMMENT, - "// ": code.COMMENT, - }, keyword: { "body": code.KEYWORD, "fieldset": code.KEYWORD, @@ -411,10 +406,12 @@ Volcanos(chat.ONSYNTAX, { "h1": code.KEYWORD, "h2": code.KEYWORD, "h3": code.KEYWORD, + "a": code.KEYWORD, + "label": code.KEYWORD, + "span": code.KEYWORD, + "div": code.KEYWORD, "img": code.KEYWORD, "svg": code.KEYWORD, - "div": code.KEYWORD, - "span": code.KEYWORD, "hover": code.DATATYPE, "focus": code.DATATYPE, "not": code.DATATYPE, @@ -422,6 +419,7 @@ Volcanos(chat.ONSYNTAX, { "name": code.FUNCTION, "display": code.FUNCTION, + "visibility": code.FUNCTION, "overflow": code.FUNCTION, "position": code.FUNCTION, "z-index": code.FUNCTION, @@ -431,47 +429,57 @@ Volcanos(chat.ONSYNTAX, { "border": code.FUNCTION, "border-left": code.FUNCTION, "border-top": code.FUNCTION, + "border-right": code.FUNCTION, "border-bottom": code.FUNCTION, + "border-radius": code.FUNCTION, "margin": code.FUNCTION, "margin-left": code.FUNCTION, "margin-top": code.FUNCTION, "margin-right": code.FUNCTION, "margin-bottom": code.FUNCTION, + "box-shadow": code.FUNCTION, + "outline": code.FUNCTION, "height": code.FUNCTION, "width": code.FUNCTION, "min-width": code.FUNCTION, + "max-height": code.FUNCTION, "left": code.FUNCTION, "top": code.FUNCTION, "right": code.FUNCTION, "bottom": code.FUNCTION, "box-sizing": code.FUNCTION, "border-box": code.CONSTANT, - "relative": code.CONSTANT, - "absolute": code.CONSTANT, - "sticky": code.CONSTANT, - "fixed": code.CONSTANT, - "unset": code.CONSTANT, - "solid": code.CONSTANT, "block": code.CONSTANT, "none": code.CONSTANT, "auto": code.CONSTANT, "hidden": code.CONSTANT, + "visible": code.CONSTANT, + "relative": code.CONSTANT, + "absolute": code.CONSTANT, + "sticky": code.CONSTANT, + "fixed": code.CONSTANT, + "solid": code.CONSTANT, + "unset": code.CONSTANT, + "transition": code.FUNCTION, + "transform": code.FUNCTION, + "translate": code.FUNCTION, + "rotate": code.FUNCTION, "float": code.FUNCTION, "clear": code.FUNCTION, "both": code.CONSTANT, - "transform": code.FUNCTION, - "rotate": code.FUNCTION, - "translate": code.FUNCTION, "background-color": code.FUNCTION, "color": code.FUNCTION, + "tab-size": code.FUNCTION, "font-size": code.FUNCTION, "font-family": code.FUNCTION, + "font-weight": code.FUNCTION, + "line-height": code.FUNCTION, "text-align": code.FUNCTION, "white-space": code.FUNCTION, - "tab-size": code.FUNCTION, + "caret-color": code.FUNCTION, "cursor": code.FUNCTION, - "box-shadow": code.FUNCTION, + "pointer": code.CONSTANT, "center": code.CONSTANT, "monospace": code.CONSTANT, "black": code.CONSTANT, @@ -481,28 +489,31 @@ Volcanos(chat.ONSYNTAX, { "blue": code.CONSTANT, "red": code.CONSTANT, "green": code.CONSTANT, + "brown": code.CONSTANT, "yellow": code.CONSTANT, + "magenta": code.CONSTANT, "skyblue": code.CONSTANT, + "darkblue": code.CONSTANT, + "royalblue": code.CONSTANT, "cadetblue": code.CONSTANT, + "lightblue": code.CONSTANT, + "aliceblue": code.CONSTANT, "steelblue": code.CONSTANT, - "lightgray": code.CONSTANT, "cornflowerblue": code.CONSTANT, + "lightgray": code.CONSTANT, + "darkgrey": code.CONSTANT, "darkcyan": code.CONSTANT, - "pointer": code.CONSTANT, + "darkgreen": code.CONSTANT, + "lightgreen": code.CONSTANT, + "whitesmoke": code.CONSTANT, + "dimgray": code.CONSTANT, }, keyword0: { - "font-weight": code.FUNCTION, - "word-break": code.FUNCTION, "vertical-align": code.FUNCTION, - "outline": code.FUNCTION, - "caret-color": code.FUNCTION, - "calc": code.FUNCTION, "url": code.FUNCTION, - "bold": code.CONSTANT, - "pointer": code.CONSTANT, "contexts": code.CONSTANT, }, }, diff --git a/plugin/local/code/vimer.css b/plugin/local/code/vimer.css index 6438fc76..f6a60e44 100644 --- a/plugin/local/code/vimer.css +++ b/plugin/local/code/vimer.css @@ -1,21 +1,15 @@ -fieldset.vimer>div.output input.current { - background-color:#0000; color:#0000; font-family:monospace; - padding-left:12px; border:none; outline:none; height:22px; position:absolute; -} -fieldset.vimer>div.output input.current.normal { caret-color:gray; } -fieldset.vimer>div.output input.current.insert { caret-color:yellow; } -fieldset.vimer>div.output div.project div.zone.recent div.list { max-height:240px; overflow:auto; } -fieldset.vimer>div.output div.complete { overflow:auto; position:absolute; display:none; } +fieldset.vimer>div.output div.project div.zone.create>div.action { display:none; } +fieldset.vimer>div.output div.project div.zone.create>div.list div.item { padding:2px; float:left; clear:none; } +fieldset.vimer>div.output div.project div.zone.create>div.list div.item input { letter-spacing:2px; } +fieldset.vimer>div.output div.project div.zone.recent>div.list { max-height:240px; overflow:auto; } +fieldset.vimer>div.output input.current { background-color:#0000; color:#0000; padding-left:10px; height:20px; position:absolute; } +fieldset.vimer>div.output input.current.insert { caret-color:black; } +fieldset.vimer>div.output input.current.normal { caret-color:lightgray; } +fieldset.vimer>div.output div.complete { padding-top:0; display:none; overflow:auto; position:absolute; } fieldset.vimer>div.output div.complete.insert { display:block; } -fieldset.vimer>div.output div.complete div.pre { color:#00000000; margin-left:5px; float:left; } -fieldset.vimer>div.output div.complete table { background-color:darkblue; } +fieldset.vimer>div.output div.complete div.prefix { color:#0000; white-space:pre; float:left; } fieldset.vimer>div.output div.complete table.content thead { display:none; } - -body.white fieldset.vimer>div.output input.current.insert { caret-color:black; } -body.white fieldset.vimer>div.output input.current.normal { caret-color:lightgray; } -body.white fieldset.vimer>div.output div.complete table { background-color:aliceblue; } -body.white fieldset.vimer>div.output input.current { background-color:#0000; color:#0000; margin-left:0px; margin-top:4px; height:16px; } -body.white fieldset.vimer>div.output input.current { background-color:#0000; color:#0000; } -body.white fieldset.vimer>div.output input.current:hover { background-color:#0000; color:#0000; } -body.dark fieldset.vimer>div.output input.current { background-color:#0000; color:#0000; margin-left:-1px; margin-top:2px; height:16px; } -body.dark fieldset.vimer>div.output input.current:hover { background-color:#0000; color:#0000; } +body.black fieldset.vimer>div.output input.current.normal { caret-color:gray; } +body.black fieldset.vimer>div.output input.current.insert { caret-color:yellow; } +body.dark fieldset.vimer>div.output input.current.normal { caret-color:gray; } +body.dark fieldset.vimer>div.output input.current.insert { caret-color:yellow; } diff --git a/plugin/local/code/vimer.js b/plugin/local/code/vimer.js index b9859182..38e28ccc 100644 --- a/plugin/local/code/vimer.js +++ b/plugin/local/code/vimer.js @@ -15,9 +15,10 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb, target) { if (can.mode == mdb.NORMAL) { can.onkeymap.prevent(event), can.Status("按键", can.db._keylist.join("")) } }, onkeyup: function(event) { can.onaction._complete(event, can) }, onfocus: function() { var target = can.ui.complete; can.current.line.appendChild(target), can.onmotion.toggle(can, target, true) - }, onblur: function(event) { can.onmotion.hidden(can, can.ui.complete) }, onclick: function(event) { + }, onblur: function(event) { }, onclick: function(event) { +// }, onblur: function(event) { can.onmotion.hidden(can, can.ui.complete) }, onclick: function(event) { can.onkeymap._insert(event, can) - }}, code.COMPLETE, + }}, {view: [[code.COMPLETE, "float"]]}, ]); can.ui.current = ui.current, can.ui.complete = ui.complete }, }, [""]) Volcanos(chat.ONFIGURE, { @@ -85,6 +86,8 @@ Volcanos(chat.ONFIGURE, { can.onimport.tree(can, can.core.ItemKeys(can.onengine.plugin.meta, function(key) { return total++, {index: key} }), ctx.INDEX, ice.PT, function(event, item) { can.onimport.tabview(can, can.Option(nfs.PATH), can.core.Keys(ice.CAN, item.index), ctx.INDEX) }, target), zone._total(total) + can.onmotion.hidden(can, target) + can.onmotion.hidden(can, target.previousSibling) }, module: function(can, target, zone) { can.runAction(can.request({}, {fields: ctx.INDEX}), ctx.COMMAND, [mdb.SEARCH, ctx.COMMAND], function(msg) { @@ -176,7 +179,7 @@ Volcanos(chat.ONACTION, { var pre = can.ui.current.value.slice(0, can.ui.current.selectionStart), key = can.core.Split(pre, "\t .[]", " ").pop()||"", end = can.ui.current.value.slice(can.ui.current.selectionStart) function update() { target._pre = pre, target._end = end, target._index = -1 can.current.line.appendChild(target), can.page.style(can, target, html.LEFT, can.ui.current.offsetLeft, html.MARGIN_TOP, can.current.line.offsetHeight) - can.runAction(can.request(event, {text: pre}, can.Option()), code.COMPLETE, [], function(msg) { can.page.Appends(can, target, [{view: ["pre", html.DIV, pre]}]) + can.runAction(can.request(event, {text: pre}, can.Option()), code.COMPLETE, [], function(msg) { can.page.Appends(can, target, [{view: ["prefix", html.DIV, pre]}]) if (can.parse == nfs.JS) { var msg = can.request() var ls = can.core.Split(can.core.Split(pre, "\t (", " ").pop(), ice.PT) var list = {can: can, msg: msg, target: target, window: window} @@ -184,14 +187,17 @@ Volcanos(chat.ONACTION, { v && msg.Push(mdb.NAME, k).Push(mdb.TEXT, v.toString().split(ice.NL)[0]) }) } + can.core.Item(can.core.Value(can.onsyntax[can.parse], "keyword"), function(key, value) { + msg.Push(mdb.NAME, key) + }) can.onappend.table(can, msg, function(value, key, index) { return {text: [value, html.TD], onclick: function(event) { can.current.text(can.ui.current.value = target._pre+value+target._end), can.onaction.scrollHold(can, target._pre.length+value.length) }} }, target), can.page.style(can, target, html.MAX_HEIGHT, can.ui._content.offsetHeight-(can.current.line.offsetTop-can.ui.content.scrollTop)-can.current.line.offsetHeight) }) } - function filter() { can.page.Select(can, target, [html.TBODY, html.TR], function(tr) { - can.page.ClassList.set(can, tr, html.HIDE, can.page.Select(can, tr, html.TD, function(td) { if (td.innerText.toLowerCase().indexOf(key.toLowerCase()) == 0) { return td } }).length == 0) - }) } + function filter() { can.page.ClassList.set(can, can.ui.complete, html.HIDE, can.page.Select(can, target, [html.TBODY, html.TR], function(tr) { + if (!can.page.ClassList.set(can, tr, html.HIDE, can.page.Select(can, tr, html.TD, function(td) { if (td.innerText.toLowerCase().indexOf(key.toLowerCase()) == 0) { return td } }).length == 0)) { return tr } + }).length == 0) } function select(index, total) { index = (index+(total+1))%(total+1); if (index == total) { can.current.text(can.ui.current.value = target._pre+target._end) } can.page.Select(can, target, [html.TBODY, "tr:not(.hide)"], function(tr, i) { if (can.page.ClassList.set(can, tr, html.SELECT, i == index)) { can.current.text(can.ui.current.value = target._pre+can.page.Select(can, tr, html.TD)[0].innerText+target._end) @@ -242,7 +248,7 @@ Volcanos(chat.ONACTION, { }) Volcanos(chat.ONEXPORT, {list: ["目录", "模式", "按键", "类型", "文件", "行号", "跳转"]}) Volcanos(chat.ONKEYMAP, { - _model: function(can, value) { can.Status("模式", can.mode = value), can.page.styleClass(can, can.ui.current, [code.CURRENT, can.mode]), can.page.styleClass(can, can.ui.complete, [code.COMPLETE, can.mode]) }, + _model: function(can, value) { can.Status("模式", can.mode = value), can.page.styleClass(can, can.ui.current, [code.CURRENT, can.mode]), can.page.styleClass(can, can.ui.complete, [code.COMPLETE, can.mode, "float"]) }, _plugin: function(can) { can.onkeymap._model(can, mdb.PLUGIN), can.ui.current.blur() }, _normal: function(can) { can.onkeymap._model(can, mdb.NORMAL), can.onaction.scrollHold(can), can.onkeymap.prevent(event) }, _insert: function(event, can, count, begin) { can.onkeymap._model(can, mdb.INSERT), can.onaction.scrollHold(can, count, begin), can.onkeymap.prevent(event) }, @@ -374,22 +380,17 @@ Volcanos(chat.ONKEYMAP, { Enter: shy("换行", function(can, target) { var rest = can.onkeymap.deleteText(target, target.selectionEnd).trimLeft(), text = can.ui.current.value var left = text.substr(0, text.indexOf(text.trimLeft()))||(text.trimRight() == ""? text: "") - var line = can.onaction.selectLine(can), next = rest; for (var i = line; i < can.max; i++) { - next += can.onexport.text(can, i).trimLeft(); if (next != "") { break } - } - function deep(text) { var deep = 0; for (var i = 0; i < text.length; i++) { - if (text[i] == "\t") { deep += 4 } else if (text[i] == " ") { deep++ } else { break } - } return deep } + var line = can.onaction.selectLine(can), next = rest; for (var i = line; i < can.max; i++) { next += can.onexport.text(can, i).trimLeft(); if (next != "") { break } } + function deep(text) { var deep = 0; for (var i = 0; i < text.length; i++) { if (text[i] == "\t") { deep += 4 } else if (text[i] == " ") { deep++ } else { break } } return deep } text.trim() && can.core.List(["{}", "[]", "()", "``"], function(item) { if (can.base.endWith(text, item[0])) { if (can.base.beginWith(next, item[1])) { can.onaction.insertLine(can, left+rest, can.current.next()), rest = "" - } else if (deep(text) >= deep(can.onexport.text(can, line+1))) { + } else if (deep(text) >= deep(can.onexport.text(can, line+1)) && rest == "") { can.onaction.insertLine(can, left+item[1], can.current.next()) } left += ice.TB }}) var line = can.onaction.insertLine(can, left+rest, can.current.next()) - can.current.text(text.trimRight()||text), can.onaction.selectLine(can, line) - can.onkeymap._insert(event, can, 0, left.length) + can.current.text(text.trimRight()||text), can.onaction.selectLine(can, line), can.onkeymap._insert(event, can, 0, left.length) }), ArrowDown: shy("光标下移", function(can, target) { event.key == "ArrowDown" && can.onaction.cursorDown(can, target) }), ArrowUp: shy("光标上移", function(can, target) { event.key == "ArrowUp" && can.onaction.cursorUp(can, target) }), diff --git a/plugin/local/wiki/draw.css b/plugin/local/wiki/draw.css index 6a6dd140..b2e29668 100644 --- a/plugin/local/wiki/draw.css +++ b/plugin/local/wiki/draw.css @@ -1,3 +1,3 @@ fieldset.draw td.content { position:relative; } -fieldset.draw div.output { background-color:#1b5b738c; font-size:20px; } +// fieldset.draw div.output { background-color:#1b5b738c; } fieldset.draw div.output div.content svg { background-color:#1b5b738c; } diff --git a/plugin/local/wiki/word.css b/plugin/local/wiki/word.css index 682f17b5..4f1caad6 100644 --- a/plugin/local/wiki/word.css +++ b/plugin/local/wiki/word.css @@ -19,7 +19,7 @@ fieldset.word ul.story[data-type=endmenu] { clear:both; } fieldset.word p.story[data-name=inner] { background-color:#4b6c8a7a; padding:4px 10px; border-left:solid 4px blue; margin:10px 0px; } fieldset.word p.story[data-name=inner]:hover { background-color:#c10c8a; cursor:copy; } fieldset.word table.content { display:block; max-height:400px; } -fieldset.word>div.output>fieldset.story { margin:10px; } +fieldset.word>div.output>fieldset.story:not(.full) { margin:10px; } // fieldset.word>div.output>fieldset.story { margin:10px; background-color:#58a4d37d; } fieldset.word fieldset.story.full { margin:0px; } fieldset.word fieldset.story.float { margin:0px; } diff --git a/plugin/state.js b/plugin/state.js index 0a9abf3e..91a2057f 100644 --- a/plugin/state.js +++ b/plugin/state.js @@ -83,7 +83,7 @@ Volcanos(chat.ONIMPORT, {_process: function(can, msg) { } else { can.page.style(can, can._output, html.HEIGHT, can.ConfHeight(height), html.WIDTH, can.ConfWidth(width), html.MAX_HEIGHT, "", html.MAX_WIDTH, "") } - can.user.isMobile && can.onmotion.toggle(can, can._action, can.ConfHeight() < can.ConfWidth()-100) + // can.user.isMobile && can.onmotion.toggle(can, can._action, can.ConfHeight() < can.ConfWidth()-100) var sub = can.core.Value(can, chat._OUTPUTS_CURRENT); if (!sub) { return } sub.ConfHeight(can.ConfHeight()), sub.ConfWidth(can.ConfWidth()) if (mode) { sub.Mode(can.Mode(mode)), sub.onlayout[mode](sub) } else { sub.onlayout._init(sub) } }, @@ -117,6 +117,7 @@ Volcanos(chat.ONACTION, {list: [ can.onmotion.toggle(can, can._action, back.action), can.onmotion.toggle(can, can._status, back.status) can.base.isFunc(load) && load(back), sub.Mode(can.Mode()), sub.ConfHeight(can.ConfHeight()), sub.ConfWidth(can.ConfWidth()), sub.onlayout._init(sub) } + can.user.isMobile && can.onmotion.hidden(can, can._action) }, _resize: function(can, auto, height, width) { can.onimport.size(can, height, width, auto) }, _output: function(can, msg) {}, diff --git a/plugin/table.js b/plugin/table.js index 0e738d7e..46945a15 100644 --- a/plugin/table.js +++ b/plugin/table.js @@ -64,7 +64,7 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb, target) { can.onmotion.cl var ui = can.page.Append(can, target, [{view: [html.ITEM, html.DIV, item.nick||item.name], 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)) - }, onmouseenter: function(event) { + }, 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) } } @@ -90,7 +90,7 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb, target) { can.onmotion.cl node = node||{"": target}; can.core.List(list, function(item) { item[field] && can.core.List(item[field].split(split), function(value, index, array) { if (!value) { return } var last = array.slice(0, index).join(split), name = array.slice(0, index+1).join(split); if (node[name]) { return } - var ui = can.page.Append(can, node[last], [{view: html.ITEM, list: [{view: ["switch", html.DIV, (index==array.length-1?"":"⌃")]}, {view: [mdb.NAME, html.DIV, value+(index==array.length-1?"":"")], _init: item._init, onmouseenter: function(event) { if (!item._menu) { return } + var ui = can.page.Append(can, node[last], [{view: html.ITEM, list: [{view: ["switch", html.DIV, (index==array.length-1?"":"⌃")]}, {view: [mdb.NAME, html.DIV, value+(index==array.length-1?"":"")], _init: item._init, oncontextmenu: function(event) { if (!item._menu) { return } can.user.carteRight(event, can, item._menu.meta, item._menu.list||can.core.Item(item._meta.meta), function(event, button) { (item._menu.meta[button]||item._menu)(event, can, button) }) @@ -105,7 +105,7 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb, target) { can.onmotion.cl {view: html.NAME, inner: can.user.trans(can, zone.name), onclick: function() { if (zone._delay_show) { zone._delay_show(zone._target), delete(zone._delay_show) } can.onmotion.toggle(can, zone._action), can.onmotion.toggle(can, zone._target) - }, onmouseenter: function(event) { + }, oncontextmenu: function(event) { zone._menu? can.user.carteRight(event, can, zone._menu.meta, zone._menu.list||can.core.Item(zone._menu.meta), function(event, button, meta) { (meta[button]||can.onaction[button])(event, can, button) }): can.page.Select(can, document.body, can.page.Keys("div.carte.float"), function(target) { can.page.Remove(can, target) }) @@ -132,20 +132,18 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb, target) { can.onmotion.cl tabs: function(can, list, cb, cbs, action, each) { action = action||can._action return can.page.Append(can, action, can.core.List(list, function(tabs) { - return {view: html.TABS, list: [{text: [tabs.name, html.SPAN]}, {img: "/close.png", onclick: function(event) { - item = event.target.parentNode - var next = item.nextSibling||item.previousSibling; if (!next) { return } - next.click(), can.onmotion.delay(can, function() { can.base.isFunc(cbs) && cbs(item._meta), can.page.Remove(can, item) }) - can.onkeymap.prevent(event) + return {view: html.TABS, list: [{text: [tabs.name, html.SPAN]}, {view: "close icon s16", onclick: function(event) { + var item = event.target.parentNode, next = item.nextSibling||item.previousSibling; if (!next) { return } + next.click(), can.onmotion.delay(can, function() { can.base.isFunc(cbs) && cbs(item._meta), can.page.Remove(can, item) }), can.onkeymap.prevent(event) }}], title: tabs.text, onclick: function(event) { - can.onmotion.select(can, action, html.DIV_TABS, event.target), can.base.isFunc(cb) && cb(event, tabs) - }, _init: function(item) { + can.onmotion.select(can, action, html.DIV_TABS, tabs._target), can.base.isFunc(cb) && cb(event, tabs) + }, _init: function(item) { tabs._target = item function close(item) { var next = item.nextSibling||item.previousSibling; if (!next) { return } next.click(), can.onmotion.delay(can, function() { can.base.isFunc(cbs) && cbs(item._meta), can.page.Remove(can, item) }) } var menu = tabs._menu||shy({}, [], function(event, button, meta) { (meta[button])(event, can, button) }) can.page.Modify(can, item, {draggable: true, _close: function() { close(item) }, _meta: tabs, - onmouseenter: function(event) { can.user.carte(event, can, can.base.Copy(kit.Dict( + oncontextmenu: function(event) { can.user.carte(event, can, can.base.Copy(kit.Dict( "Close", function(event) { close(item) }, "Close others", function(event) { can.page.Select(can, action, html.DIV_TABS, function(_item) { _item == item || close(_item) }) }, "Close all", function(event) { can.page.Select(can, action, html.DIV_TABS, close) }, @@ -162,6 +160,7 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb, target) { can.onmotion.cl }, plug: function(can, meta, cb, target) { if (!meta || !meta.index) { return } meta.type = "plug", can.onappend.plugin(can, meta, function(sub) { sub.sup = can + can.page.ClassList.add(can, sub._target, chat.FLOAT) sub.ConfHeight(target.offsetHeight-2*html.ACTION_HEIGHT) can.page.style(can, sub._output, html.MAX_HEIGHT, sub.ConfHeight(), html.MAX_WIDTH, sub.ConfWidth()) sub.run = function(event, cmds, cb) { diff --git a/proto.js b/proto.js index 850868ea..58a1d170 100644 --- a/proto.js +++ b/proto.js @@ -152,14 +152,12 @@ var chat = { LAYOUT: "layout", PROJECT: "project", CONTENT: "content", DISPLAY: "display", PROFILE: "profile", ACTIONS: "actions", TITLE: "title", TOPIC: "topic", BLACK: "black", WHITE: "white", PRINT: "print", SHARE: "share", RIVER: "river", STORM: "storm", FIELD: "field", TOOL: "tool", - STATE: "state", MENUS: "menus", SSO: "sso", LOCATION: "location", + STATE: "state", MENUS: "menus", SSO: "sso", LOCATION: "location", IFRAME: "iframe", SIMPLE: "simple", OUTPUT: "output", FLOAT: "float", FULL: "full", CMD: "cmd", HEADER: "Header", ACTION: "Action", FOOTER: "Footer", libs: ["/lib/base.js", "/lib/core.js", "/lib/date.js", "/lib/misc.js", "/lib/page.js", "/lib/user.js"], - panel_list: [ - {name: "Header", pos: "head"}, {name: "River", pos: "left"}, {name: "Action", pos: "main"}, {name: "Search", pos: "auto"}, {name: "Footer", pos: "foot"}, - ], + panel_list: [{name: "Header", pos: "head"}, {name: "River", pos: "left"}, {name: "Action", pos: "main"}, {name: "Search", pos: "auto"}, {name: "Footer", pos: "foot"}], plugin_list: [ "/plugin/state.js", "/plugin/input.js", @@ -178,20 +176,17 @@ var chat = { "/plugin/local/team/plan.js", "/plugin/local/mall/goods.js", ], PLUGIN_INPUT: "/plugin/input/", PLUGIN_STORY: "/plugin/story/", PLUGIN_LOCAL: "/plugin/local/", - SHARE_LOCAL: "/share/local/", PLUGIN_STATE_JS: "/plugin/state.js", PLUGIN_INPUT_JS: "/plugin/input.js", PLUGIN_TABLE_JS: "/plugin/table.js", ONENGINE: "onengine", ONDAEMON: "ondaemon", ONAPPEND: "onappend", ONLAYOUT: "onlayout", ONMOTION: "onmotion", ONKEYMAP: "onkeymap", ONIMPORT: "onimport", ONSYNTAX: "onsyntax", ONFIGURE: "onfigure", ONACTION: "onaction", ONDETAIL: "ondetail", ONEXPORT: "onexport", ONPLUGIN: "onplugin", - + ONMAIN: "onmain", ONLOGIN: "onlogin", ONREMOTE: "onremote", ONSEARCH: "onsearch", ONSIZE: "onsize", ONTOAST: "ontoast", ONDEBUG: "ondebug", ONSHARE: "onshare", ONPRINT: "onprint", ONRESIZE: "onresize", ONKEYUP: "onkeyup", ONKEYDOWN: "onkeydown", ONMOUSEENTER: "onmouseenter", ORIENTATIONCHANGE: "orientationchange", ONSTORM_SELECT: "onstorm_select", ONACTION_NOTOOL: "onaction_notool", ONACTION_TOUCH: "onaction_touch", ONACTION_CMD: "onaction_cmd", ONOPENSEARCH: "onopensearch", ONSEARCH_FOCUS: "onsearch_focus", ONCOMMAND_FOCUS: "oncommand_focus", - _INIT: "_init", _TRANS: "_trans", _ENGINE: "_engine", _SEARCH: "_search", _OUTPUTS_CURRENT: "_outputs.-1", - _NAMES: "_names", _TOAST: "_toast", - IFRAME: "iframe", LOCATION: "location", + _INIT: "_init", _TRANS: "_trans", _STYLE: "_style", _ENGINE: "_engine", _SEARCH: "_search", _OUTPUTS_CURRENT: "_outputs.-1", _NAMES: "_names", _TOAST: "_toast", } var team = { TASK: "task", PLAN: "plan", @@ -218,42 +213,37 @@ var svg = { var html = {PLUGIN_MARGIN: 10, ACTION_HEIGHT: 31, ACTION_MARGIN: 200, FIELDSET: "fieldset", LEGEND: "legend", OPTION: "option", ACTION: "action", OUTPUT: "output", STATUS: "status", FORM_OPTION: "form.option", DIV_ACTION: "div.action", DIV_OUTPUT: "div.output", DIV_STATUS: "div.status", - FIELDSET_PANEL: "fieldset.panel", FIELDSET_PLUGIN: "fieldset.plugin", FIELDSET_STORY: "fieldset.story", FIELDSET_FLOAT: "fieldset.float", - FIELDSET_INPUT: "fieldset.input", + FIELDSET_PANEL: "fieldset.panel", FIELDSET_PLUGIN: "fieldset.plugin", FIELDSET_STORY: "fieldset.story", FIELDSET_INPUT: "fieldset.input", FIELDSET_FLOAT: "fieldset.float", FIELDSET_HEAD: "fieldset.head", FIELDSET_FOOT: "fieldset.foot", FIELDSET_LEFT: "fieldset.left", FIELDSET_MAIN: "fieldset.main", OPTION_ARGS: "select.args,input.args,textarea.args", INPUT_ARGS: "input.args,textarea.args", INPUT_BUTTON: "input[type=button]", INPUT_FILE: "input[type=file]", - - INPUT: "input", TEXT: "text", TEXTAREA: "textarea", SELECT: "select", BUTTON: "button", - FORM: "form", FILE: "file", CLICK: "click", SUBMIT: "submit", CANCEL: "cancel", UPLOAD: "upload", USERNAME: "username", PASSWORD: "password", + FORM: "form", SELECT: "select", INPUT: "input", TEXT: "text", FILE: "file", BUTTON: "button", TEXTAREA: "textarea", + CLICK: "click", CANCEL: "cancel", SUBMIT: "submit", UPLOAD: "upload", USERNAME: "username", PASSWORD: "password", TABLE: "table", THEAD: "thead", TBODY: "tbody", TR: "tr", TH: "th", TD: "td", BR: "br", UL: "ul", LI: "li", H1: "h1", H2: "h2", H3: "h3", A: "a", LABEL: "label", INNER: "inner", TITLE: "title", - SPAN: "span", CODE: "code", DIV: "div", IMG: "img", VIDEO: "video", SPACE: "space", - WSS: "wss", SVG: "svg", CANVAS: "canvas", IFRAME: "iframe", - WEBVIEW: "webview", CHROME: "chrome", MOBILE: "mobile", LANDSCAPE: "landscape", + SPAN: "span", CODE: "code", DIV: "div", IMG: "img", VIDEO: "video", WSS: "wss", SVG: "svg", CANVAS: "canvas", IFRAME: "iframe", + SPACE: "space", WEBVIEW: "webview", CHROME: "chrome", MOBILE: "mobile", LANDSCAPE: "landscape", + BODY: "body", HOVER: "hover", HOVER_SELECT: "hover,select", CLASS: "class", DISPLAY: "display", BLOCK: "block", NONE: "none", HIDDEN: "hidden", TOGGLE: "toggle", SIZE: "size", - HEIGHT: "height", WIDTH: "width", PADDING: "padding", MARGIN: "margin", LEFT: "left", TOP: "top", RIGHT: "right", BOTTOM: "bottom", - MIN_HEIGHT: "min-height", MAX_HEIGHT: "max-height", MIN_WIDTH: "min-width", MAX_WIDTH: "max-width", MARGIN_TOP: "margin-top", MARGIN_X: "margin-x", MARGIN_Y: "margin-y", - BACKGROUND: "background", OPACITY: "opacity", OVERFLOW: "overflow", SCROLL: "scroll", SPEED: "speed", FLOAT: "float", CLEAR: "clear", BOTH: "both", + PADDING: "padding", BORDER: "border", MARGIN: "margin", MARGIN_TOP: "margin-top", MARGIN_X: "margin-x", MARGIN_Y: "margin-y", + HEIGHT: "height", WIDTH: "width", MIN_HEIGHT: "min-height", MAX_HEIGHT: "max-height", MIN_WIDTH: "min-width", MAX_WIDTH: "max-width", LEFT: "left", TOP: "top", RIGHT: "right", BOTTOM: "bottom", + BACKGROUND: "background", COLOR: "color", OPACITY: "opacity", OVERFLOW: "overflow", SCROLL: "scroll", SPEED: "speed", FLOAT: "float", CLEAR: "clear", BOTH: "both", PAGE: "page", TABS: "tabs", MENU: "menu", NODE: "node", ZONE: "zone", LIST: "list", ITEM: "item", NAME: "name", ICON: "icon", HEAD: "head", LEFT: "left", MAIN: "main", FOOT: "foot", AUTO: "auto", SHOW: "show", HIDE: "hide", PLUGIN: "plugin", LAYOUT: "layout", PROJECT: "project", DISPLAY: "display", PROFILE: "profile", CONTENT: "content", - DIV_PAGE: "div.page", DIV_TABS: "div.tabs", + DIV_PAGE: "div.page", DIV_TABS: "div.tabs", DIV_PATH: "div.path", DIV_CODE: "div.code", DIV_ZONE: "div.zone", DIV_LIST: "div.list", DIV_ITEM: "div.item", DIV_NAME: "div.name", + DIV_CONTENT: "div.content", TABLE_CONTENT: "table.content", TABLE_LAYOUT: "table.layout", DIV_TOGGLE: "div.toggle", DIV_LAYOUT_HEAD: "div.layout.head", DIV_LAYOUT_FOOT: "div.layout.foot", DIV_LAYOUT_LEFT: "div.layout.left", - DIV_CODE: "div.code", DIV_FLOAT: "div.float", DIV_CONTENT: "div.content", TABLE_CONTENT: "table.content", - DIV_CARTE: "div.carte", - DIV_TOAST: "div.toast", - DIV_TOGGLE: "div.toggle", - TABLE_LAYOUT: "table.layout", + DIV_FLOAT: "div.float", DIV_TOAST: "div.toast", DIV_CARTE: "div.carte", } var lang = { UNDEFINED: "undefined", STRING: "string", NUMBER: "number", BOOLEAN: "boolean", FUNCTION: "function", OBJECT: "object", ARRAY: "array", - META: "Meta", ALT: "Alt", CONTROL: "Control", SHIFT: "Shift", TAB: "Tab", ENTER: "Enter", ESCAPE: "Escape", + META: "Meta", ALT: "Alt", CONTROL: "Control", SHIFT: "Shift", TAB: "Tab", ESCAPE: "Escape", ENTER: "Enter", CMD: "Cmd", CTRL: "Ctrl", SPACE: "Space", BACKSPACE: "Backspace", ESC: "Esc", PS: "/", }