1
0
mirror of https://shylinux.com/x/volcanos synced 2025-04-25 08:48:06 +08:00

add studio

This commit is contained in:
IT 老营长 @云轩领航-创始人 2024-05-06 23:06:04 +08:00
parent 3587d7ab28
commit 6d3f37c7bc
7 changed files with 71 additions and 38 deletions

View File

@ -311,7 +311,7 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) {
can.misc.Search(can, log.DEBUG) == ice.TRUE && can.base.beginWith(display, "/require/src/") && delete(Volcanos.meta.cache[display]) can.misc.Search(can, log.DEBUG) == ice.TRUE && can.base.beginWith(display, "/require/src/") && delete(Volcanos.meta.cache[display])
Volcanos(display, {_root: can._root, _follow: can.core.Keys(can._follow, display), _fields: can._target, _target: output, _path: display||chat.PLUGIN_TABLE_JS, Volcanos(display, {_root: can._root, _follow: can.core.Keys(can._follow, display), _fields: can._target, _target: output, _path: display||chat.PLUGIN_TABLE_JS,
_legend: can._legend, _option: can._option, _action: action||can._action, _output: output, _status: status||can._status, _legend: can._legend, _option: can._option, _action: action||can._action, _output: output, _status: status||can._status,
Update: can.Update, Option: can.Option, Action: can.Action, Status: can.Status, db: {}, ui: {layout: function() {}}, Update: can.Update, Option: can.Option, Action: can.Action, Status: can.Status, db: {hash:[""], value: {}}, ui: {layout: function() {}},
}, [display, msg.Option(ice.MSG_DISPLAY_CSS)||undefined, chat.PLUGIN_TABLE_JS], function(sub) { sub.Conf(can.Conf()) }, [display, msg.Option(ice.MSG_DISPLAY_CSS)||undefined, chat.PLUGIN_TABLE_JS], function(sub) { sub.Conf(can.Conf())
sub.db.hash = can.base.getValid(can.isCmdMode()? can.misc.SearchHash(can): [], can.misc.localStorage(can, [sub.ConfSpace()||can.misc.Search(can, ice.POD), sub.ConfIndex(), "hash"]))||[] sub.db.hash = can.base.getValid(can.isCmdMode()? can.misc.SearchHash(can): [], can.misc.localStorage(can, [sub.ConfSpace()||can.misc.Search(can, ice.POD), sub.ConfIndex(), "hash"]))||[]
var last = can.sub; last && can.core.CallFunc([last, "onaction.hidden"], {can: last}) var last = can.sub; last && can.core.CallFunc([last, "onaction.hidden"], {can: last})
@ -387,7 +387,7 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) {
sub.run = function(event, cmds, cb) { var _msg = can.request(event); _msg.result = [JSON.stringify(msg)], cb(_msg) } sub.run = function(event, cmds, cb) { var _msg = can.request(event); _msg.result = [JSON.stringify(msg)], cb(_msg) }
}) })
} else if (item.name == ice.LOG_TRACEID) { } else if (item.name == ice.LOG_TRACEID) {
can.onappend._float(can, web.CODE_XTERM, ["sh", item.value, "grep "+item.value+" var/log/bench.log | grep -v grep | grep -v '"+item.value+" $'"]) can.onappend._float(can, web.CODE_XTERM, ["sh", item.value, "grep "+item.value+" var/log/bench.log | grep -v grep | grep -v 'id: "+item.value+" $'"])
} else { } else {
can.user.copy(event, can, item.value) can.user.copy(event, can, item.value)
} }
@ -536,7 +536,7 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) {
if (msg.append && msg.append[msg.append.length-1] == ctx.ACTION && can.core.List(msg[ctx.ACTION], function(item) { if (item) { return item } }).length == 0) { msg.append.pop() } if (msg.append && msg.append[msg.append.length-1] == ctx.ACTION && can.core.List(msg[ctx.ACTION], function(item) { if (item) { return item } }).length == 0) { msg.append.pop() }
if (msg.append[msg.append.length-1] == ctx.ACTION && (!msg[ctx.ACTION] || msg[ctx.ACTION].length == 0)) { msg.append.pop() } if (msg.append[msg.append.length-1] == ctx.ACTION && (!msg[ctx.ACTION] || msg[ctx.ACTION].length == 0)) { msg.append.pop() }
var option = can.core.Item(can.Option()) var option = can.core.Item(can.Option())
var table = can.page.AppendTable(can, msg, target||can._output, msg.append, cb||function(value, key, index, data, list) { var _value = value var table = can.page.AppendTable(can, msg, target||can.ui.content||can._output, msg.append, cb||function(value, key, index, data, list) { var _value = value
if (msg.append.length == 2 && msg.append[0] == mdb.KEY && msg.append[1] == mdb.VALUE) { if (msg.append.length == 2 && msg.append[0] == mdb.KEY && msg.append[1] == mdb.VALUE) {
if (key == mdb.VALUE) { key = data.key } data = {}, can.core.List(list, function(item) { data[item.key] = item.value }) if (key == mdb.VALUE) { key = data.key } data = {}, can.core.List(list, function(item) { data[item.key] = item.value })
} }
@ -603,7 +603,7 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) {
return table return table
}, },
board: function(can, text, target) { text && text.Result && (text = text.Result()); if (!text) { return } board: function(can, text, target) { text && text.Result && (text = text.Result()); if (!text) { return }
var code = can.page.Append(can, target||can._output, [{text: [can.page.Color(text), html.DIV, html.CODE]}]).code var code = can.page.Append(can, target||can.ui.content||can._output, [{text: [can.page.Color(text), html.DIV, html.CODE]}]).code
code.ondblclick = function(event) { can.Option(mdb.KEY, window.getSelection().toString()) && can.Update() } code.ondblclick = function(event) { can.Option(mdb.KEY, window.getSelection().toString()) && can.Update() }
if (text.indexOf("<fieldset") == 0) { can.page.Select(can, code, html.FIELDSET, function(target) { var data = target.dataset if (text.indexOf("<fieldset") == 0) { can.page.Select(can, code, html.FIELDSET, function(target) { var data = target.dataset
data.index && can.onappend.plugin(can, {index: data.index, args: can.base.Split(data.args)}, function(sub) { data.index && can.onappend.plugin(can, {index: data.index, args: can.base.Split(data.args)}, function(sub) {
@ -693,7 +693,7 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) {
} else if (can.base.isObject(item)) { } else if (can.base.isObject(item)) {
if (item.index) { item._index = count++, ui.size[item._index] = item.height||item.width if (item.index) { item._index = count++, ui.size[item._index] = item.height||item.width
item.type = item.type||"story", item.layout = function(height, width) { item.type = item.type||"story", item.layout = function(height, width) {
can.page.style(can, ui[item._index], html.WIDTH, width) can.page.style(can, ui[item._index], html.WIDTH, width)
} }
can.onappend.plugin(can, item, function(sub) { can._plugins = (can._plugins||[]).concat([sub]) can.onappend.plugin(can, item, function(sub) { can._plugins = (can._plugins||[]).concat([sub])
item.layout = function(height, width) { sub.onimport.size(sub, height, width, false) } item.layout = function(height, width) { sub.onimport.size(sub, height, width, false) }
@ -724,16 +724,23 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) {
if (can.page.isDisplay(target)) { width -= w } if (can.page.isDisplay(target)) { width -= w }
} }
}), can.core.List(list, function(item) { if (can.base.isArray(item)) { layout(type == FLOW? FLEX: FLOW, item, height, width) } }) } }), can.core.List(list, function(item) { if (can.base.isArray(item)) { layout(type == FLOW? FLEX: FLOW, item, height, width) } }) }
ui.profile && can.onmotion.hidden(can, ui.profile), ui.display && can.onmotion.hidden(can, ui.display) ui.project && can.user.isMobile && can.onmotion.hidden(can, ui.project); if (can.onimport.filter) { ui.filter = can.onimport.filter(can, ui.project) }
if (can.onimport.filter) { ui.filter = can.onimport.filter(can, ui.project) } ui.display && can.onmotion.hidden(can, ui.display), ui.profile && can.onmotion.hidden(can, ui.profile)
ui.project && can.user.isMobile && can.onmotion.hidden(can, ui.project) ui.layout = function(height, width, delay, cb) { can.onmotion.delay(can, function() {
ui.layout = function(height, width, delay, cb) { can.onmotion.delay(can, function() { defer = [], layout(type, ui.list, height, width), defer.forEach(function(cb) { cb() }), cb && cb(content_height, content_width) }, delay||0) } defer = [], layout(type, ui.list, height, width), defer.forEach(function(cb) { cb() })
if (can.db.value) { can.db.value._display_plugin && (height = height/2-1), can.page.style(can, can.ui.content, html.HEIGHT, height)
can.db.value._content_plugin && can.db.value._content_plugin.onimport.size(can.db.value._content_plugin, height, content_width, false)
can.db.value._display_plugin && can.db.value._display_plugin.onimport.size(can.db.value._display_plugin, height, content_width, false)
can.db.value._display_plugin && can.onmotion.toggle(can, can.ui.display, true)
} cb && cb(content_height, content_width)
}, delay||0) }
can.onimport.layout = can.onimport.layout||function(can) { can.onimport.layout = can.onimport.layout||function(can) {
ui.layout(can.ConfHeight(), can.ConfWidth()), can.onimport._layout && can.onimport._layout(can) ui.layout(can.ConfHeight(), can.ConfWidth(), 0, function(height, width) {
can.Action(html.FILTER) && can.onmotion.filter(can, can.Action(html.FILTER)) can.ui._content_plugin && can.ui._content_plugin.onimport.size(can.ui._content_plugin, height, width, false)
}), can.onimport._layout && can.onimport._layout(can), can.Action(html.FILTER) && can.onmotion.filter(can, can.Action(html.FILTER))
} }
can.onimport._layout = can.onimport._layout||function(can) { if (!can.ui.content || !can.ui.content.innerHTML) { return } can.onimport._layout = can.onimport._layout||function(can) { if (!can.ui.content || !can.ui.content.innerHTML) { return }
can.page.style(can, can.ui.content, html.HEIGHT, can._output.style[html.HEIGHT], html.MAX_HEIGHT, can._output.style[html.MAX_HEIGHT]) // can.page.style(can, can.ui.content, html.HEIGHT, can._output.style[html.HEIGHT], html.MAX_HEIGHT, can._output.style[html.MAX_HEIGHT])
can.page.style(can, can.ui.project, html.HEIGHT, can.ui.content.offsetHeight+can.ui.display.offsetHeight) can.page.style(can, can.ui.project, html.HEIGHT, can.ui.content.offsetHeight+can.ui.display.offsetHeight)
can.onlayout.expand(can, can.ui.content) can.onlayout.expand(can, can.ui.content)
} }

View File

@ -551,7 +551,8 @@ div.output.card>div.item:hover { box-shadow:var(--notice-box-shadow); }
fieldset>div.output.card>div.item>div.title { border-bottom:var(--box-border); } fieldset>div.output.card>div.item>div.title { border-bottom:var(--box-border); }
fieldset>div.output.card>div.item>div.action>input { box-shadow:var(--input-box-shadow); } fieldset>div.output.card>div.item>div.action>input { box-shadow:var(--input-box-shadow); }
fieldset>div.status { border-top:var(--status-border); } fieldset>div.status { border-top:var(--status-border); }
fieldset>div.status>legend { box-shadow:var(--legend-box-shadow); } fieldset>div.status>legend.select { box-shadow:var(--legend-box-shadow); }
fieldset>div.status>legend:hover { box-shadow:var(--legend-box-shadow); }
fieldset.Action>div.toast>div.toast:hover { box-shadow:var(--notice-box-shadow); } fieldset.Action>div.toast>div.toast:hover { box-shadow:var(--notice-box-shadow); }
table.content th { box-shadow:var(--th-box-shadow); } table.content th { box-shadow:var(--th-box-shadow); }
table.content th.select { border:var(--box-notice); } table.content th.select { border:var(--box-notice); }
@ -574,7 +575,7 @@ kbd { font-family:var(--code-font-family); line-height:var(--code-line-height);
kbd:hover { background-color:var(--notice-bg-color); color:var(--notice-fg-color); } kbd:hover { background-color:var(--notice-bg-color); color:var(--notice-fg-color); }
table.content { font-family:var(--table-font-family); } table.content { font-family:var(--table-font-family); }
table.content th { font-family:var(--input-font-family); font-style:italic; } table.content th { font-family:var(--input-font-family); font-style:italic; }
body div.code { font-family:var(--table-font-family); } body div.code { font-family:var(--table-font-family); padding:var(--table-padding); }
body div.tabs { font-family:var(--code-font-family); } body div.tabs { font-family:var(--code-font-family); }
body div.path { font-family:var(--code-font-family); } body div.path { font-family:var(--code-font-family); }
body div.carte { font-family:var(--code-font-family); } body div.carte { font-family:var(--code-font-family); }
@ -642,6 +643,7 @@ div.item.text.id>input { width:80px; }
div.item.text.url>input { width:var(--river-width); } div.item.text.url>input { width:var(--river-width); }
div.item.text.port>input { width:80px; } div.item.text.port>input { width:80px; }
div.item.text.line>input { width:80px; } div.item.text.line>input { width:80px; }
div.item.text.path>input { width:var(--project-width); }
div.item.text.limit>input { width:var(--button-width); } div.item.text.limit>input { width:var(--button-width); }
div.item.text.offend>input { width:var(--button-width); } div.item.text.offend>input { width:var(--button-width); }
body:not(.width2):not(.mobile) fieldset.plugin>form.option>div.item.text.path>input { width:var(--project-width); } body:not(.width2):not(.mobile) fieldset.plugin>form.option>div.item.text.path>input { width:var(--project-width); }

View File

@ -70,9 +70,9 @@ fieldset.inner>div.output>div.layout>div.path span.view { font-size:22px; font-s
body.windows fieldset.inner>div.output>div.layout>div.path span.view { margin-top:0; } body.windows fieldset.inner>div.output>div.layout>div.path span.view { margin-top:0; }
body.windows fieldset.inner>div.output>div.layout>div.path span.view { font-style:normal; } body.windows fieldset.inner>div.output>div.layout>div.path span.view { font-style:normal; }
fieldset.inner>div.output>div.layout>fieldset.plug.output { white-space:pre; } fieldset.inner>div.output>div.layout>fieldset.plug.output { white-space:pre; }
fieldset.inner.cmd>div.output>div.layout>div.plug { height:var(--action-height); overflow:auto; } fieldset.inner.cmd>div.output>div.layout>div.plug { box-shadow:var(--box-shadow); height:var(--action-height); overflow:auto; }
fieldset.inner.cmd>div.output>div.layout>div.plug>legend { fieldset.inner.cmd>div.output>div.layout>div.plug>legend {
box-shadow:var(--legend-box-shadow); // box-shadow:var(--legend-box-shadow);
font-style:italic; font-size:var(--legend-font-size); font-style:italic; font-size:var(--legend-font-size);
padding:0 var(--input-padding); margin-left:var(--input-margin); margin-right:0; padding:0 var(--input-padding); margin-left:var(--input-margin); margin-right:0;
float:right; } float:right; }

View File

@ -278,7 +278,7 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb) { var paths = can.core.Sp
}, },
layout: function(can) { layout: function(can) {
if (can.isCmdMode()) { can.ConfHeight(can.page.height()) } if (can.isCmdMode()) { can.ConfHeight(can.page.height()) }
if (can.isOutputStyle()) { return can.page.style(can, can.ui.content, html.WIDTH, can.ConfWidth()) } if (can.Conf(ctx.STYLE) == html.OUTPUT) { return can.page.style(can, can.ui.content, html.WIDTH, can.ConfWidth()) }
if (can.isSimpleMode() && !can.page.tagis(can._fields, html.FIELDSET_FLOAT)) { can.page.style(can, can._output, html.MAX_HEIGHT, "") } if (can.isSimpleMode() && !can.page.tagis(can._fields, html.FIELDSET_FLOAT)) { can.page.style(can, can._output, html.MAX_HEIGHT, "") }
if (can.isSimpleMode()) { can.ui.layout(can.ConfHeight(), can.ConfWidth()); return can.page.style(can, can.ui.content, html.WIDTH, can.ConfWidth()) } if (can.isSimpleMode()) { can.ui.layout(can.ConfHeight(), can.ConfWidth()); return can.page.style(can, can.ui.content, html.WIDTH, can.ConfWidth()) }
if (can.ui.zone && can.ui.zone.source) { if (can.ui.zone && can.ui.zone.source) {
@ -335,18 +335,21 @@ Volcanos(chat.ONFIGURE, {
function show(target, zone, path) { can.run(can.request({}, {dir_root: path, dir_deep: true, "_toast": "目录加载中..."}), [nfs.PWD], function(msg) { can.onmotion.clear(can, target) function show(target, zone, path) { can.run(can.request({}, {dir_root: path, dir_deep: true, "_toast": "目录加载中..."}), [nfs.PWD], function(msg) { can.onmotion.clear(can, target)
can.onimport.tree(can, can.core.List(msg.Table(), function(item) { can.onimport.tree(can, can.core.List(msg.Table(), function(item) {
if (path == args[0] && args[1].indexOf(item.path) == 0) { item.expand = true } return item if (path == args[0] && args[1].indexOf(item.path) == 0) { item.expand = true } return item
}), nfs.PATH, nfs.PS, function(event, item) { can.onimport.tabview(can, path, item.path) }, target), zone._total(msg.Length()) }), function(event, item) { can.onimport.tabview(can, path, item.path) }, function() {}, target), zone._total(msg.Length())
}, true) } if (path.length == 1) { return show(target, zone, path[0]) } can.page.Remove(can, zone._action) }, true) } if (path.length == 1) { return show(target, zone, path[0]) } can.page.Remove(can, zone._action)
can.onimport.zone(can, can.core.List(path, function(path) { return kit.Dict(mdb.NAME, path, path == args[0]? chat._INIT: chat._DELAY_INIT, function(target, zone) { show(target, zone, path) }) }), target) can.onimport.zone(can, can.core.List(path, function(path) { return kit.Dict(mdb.NAME, path, path == args[0]? chat._INIT: chat._DELAY_INIT, function(target, zone) { show(target, zone, path) }) }), target)
}, },
module: function(can, target, zone) { zone._delay_init = function() { can.runAction({}, mdb.INPUTS, [ctx.INDEX], function(msg) { module: function(can, target, zone) { zone._delay_init = function() { can.runAction({}, mdb.INPUTS, [ctx.INDEX], function(msg) {
can.onimport.tree(can, msg.Table(), ctx.INDEX, nfs.PT, function(event, item) { can.onimport.tabview(can, "", item.index, ctx.INDEX) }, target), zone._total(msg.Length()) can.onimport.tree(can, msg.Table(),
function(event, item) { can.onimport.tabview(can, "", item.index, ctx.INDEX) },
function() {}, target, null, ctx.INDEX, nfs.PT), zone._total(msg.Length())
can.onmotion.orderShow(can, target) can.onmotion.orderShow(can, target)
}) }, zone.toggle(false) }, }) }, zone.toggle(false) },
plugin: function(can, target, zone) { zone._delay_init = function() { var total = 0 plugin: function(can, target, zone) { zone._delay_init = function() { var total = 0
can.onimport.tree(can, can.core.ItemKeys(can.onengine.plugin.meta, function(key) { if (key[0] != "_") { return total++, {index: key} } }), ctx.INDEX, nfs.PT, function(event, item) { can.onimport.tree(can, can.core.ItemKeys(can.onengine.plugin.meta, function(key) { if (key[0] != "_") { return total++, {index: key} } }),
function(event, item) {
can.onimport.tabview(can, "", can.core.Keys(ice.CAN, item.index), ctx.INDEX) can.onimport.tabview(can, "", can.core.Keys(ice.CAN, item.index), ctx.INDEX)
}, target), zone._total(total) }, function() {}, target, null, ctx.INDEX, nfs.PT), zone._total(total)
can.onmotion.orderShow(can, target) can.onmotion.orderShow(can, target)
}, zone.toggle(false) }, }, zone.toggle(false) },
}) })

View File

@ -46,7 +46,7 @@ Volcanos(chat.ONFIGURE, {
can.onaction.script(can.request(event, {path: path, file: item.path+(can.base.endWith(item.path, "/")? "client.go": "")}), can, nfs.SCRIPT) }, can.onaction.script(can.request(event, {path: path, file: item.path+(can.base.endWith(item.path, "/")? "client.go": "")}), can, nfs.SCRIPT) },
nfs.TRASH, function(event, button) { can.runAction(event, nfs.TRASH, [path+item.path], function(msg) { show(target, zone, path) }) }, nfs.TRASH, function(event, button) { can.runAction(event, nfs.TRASH, [path+item.path], function(msg) { show(target, zone, path) }) },
)}; return item )}; return item
}); cache = can.onimport.tree(can, list, nfs.PATH, nfs.PS, function(event, item) { can.onimport.tabview(can, path, item.path) }, target, cache) }); cache = can.onimport.tree(can, list, function(event, item) { can.onimport.tabview(can, path, item.path) }, function() {}, target, cache)
can.onmotion.orderShow(can, target) can.onmotion.orderShow(can, target)
}, true) } if (path.length == 1) { return show(target, zone, path[0]) } can.page.Remove(can, zone._action) }, true) } if (path.length == 1) { return show(target, zone, path[0]) } can.page.Remove(can, zone._action)
can.onimport.zone(can, can.core.List(path, function(path) { return kit.Dict(mdb.NAME, path, path == args[0]? chat._INIT: chat._DELAY_INIT, function(target, zone) { can.onimport.zone(can, can.core.List(path, function(path) { return kit.Dict(mdb.NAME, path, path == args[0]? chat._INIT: chat._DELAY_INIT, function(target, zone) {
@ -138,8 +138,7 @@ Volcanos(chat.ONKEYMAP, {
scrollHold: function(can, count, begin) { var scroll = can.ui.content.scrollLeft; can.ui.current.focus(), count != undefined && can.onkeymap.cursorMove(can.ui.current, count, begin == undefined? count: begin), can.ui.content.scrollLeft = scroll }, scrollHold: function(can, count, begin) { var scroll = can.ui.content.scrollLeft; can.ui.current.focus(), count != undefined && can.onkeymap.cursorMove(can.ui.current, count, begin == undefined? count: begin), can.ui.content.scrollLeft = scroll },
cursorDown: function(can, target) { var p = can.onkeymap.cursorMove(target); can.onaction.selectLine(can, can.current.next()), can.onkeymap.cursorMove(target, 0, p) }, cursorDown: function(can, target) { var p = can.onkeymap.cursorMove(target); can.onaction.selectLine(can, can.current.next()), can.onkeymap.cursorMove(target, 0, p) },
cursorUp: function(can, target) { var p = can.onkeymap.cursorMove(target); can.onaction.selectLine(can, can.current.prev()), can.onkeymap.cursorMove(target, 0, p) }, cursorUp: function(can, target) { var p = can.onkeymap.cursorMove(target); can.onaction.selectLine(can, can.current.prev()), can.onkeymap.cursorMove(target, 0, p) },
_model: function(can, value) { _model: function(can, value) { can.db.mode = value, can.onimport.__tabPath(can, true),
can.db.mode = value, can.onimport.__tabPath(can, true),
can.core.List([mdb.PLUGIN, mdb.NORMAL, mdb.INSERT], function(item) { can.page.ClassList.del(can, can.ui.content, item) }), can.page.ClassList.add(can, can.ui.content, value) can.core.List([mdb.PLUGIN, mdb.NORMAL, mdb.INSERT], function(item) { can.page.ClassList.del(can, can.ui.content, item) }), can.page.ClassList.add(can, can.ui.content, value)
can.core.List([mdb.PLUGIN, mdb.NORMAL, mdb.INSERT], function(item) { can.page.ClassList.del(can, can._output, item) }), can.page.ClassList.add(can, can._output, value) can.core.List([mdb.PLUGIN, mdb.NORMAL, mdb.INSERT], function(item) { can.page.ClassList.del(can, can._output, item) }), can.page.ClassList.add(can, can._output, value)
can.core.List([mdb.NORMAL, mdb.INSERT], function(item) { can.page.ClassList.del(can, can._fields, item) }), can.page.ClassList.add(can, can._fields, value) can.core.List([mdb.NORMAL, mdb.INSERT], function(item) { can.page.ClassList.del(can, can._fields, item) }), can.page.ClassList.add(can, can._fields, value)
@ -268,6 +267,7 @@ Volcanos(chat.ONKEYMAP, {
zt: shy("屏幕最上", function(can, count) { return can.current.scroll(can.current.scroll()-(count>1? count: 3)), true }), zt: shy("屏幕最上", function(can, count) { return can.current.scroll(can.current.scroll()-(count>1? count: 3)), true }),
zz: shy("屏幕中间", function(can, count) { return can.current.scroll(can.current.scroll()-(count = count>1? count: can.current.window()/2)), true }), zz: shy("屏幕中间", function(can, count) { return can.current.scroll(can.current.scroll()-(count = count>1? count: can.current.window()/2)), true }),
zb: shy("屏幕最下", function(can, count) { return can.current.scroll(can.current.scroll()-can.current.window()+(count>1? count: 5)), true }), zb: shy("屏幕最下", function(can, count) { return can.current.scroll(can.current.scroll()-can.current.window()+(count>1? count: 5)), true }),
F5: shy("刷新网页", function(can, target) { can.user.reload(true) }),
}, },
normal_ctrl: { normal_ctrl: {
e: shy("向下滚屏", function(can) { can.current.scroll(1) }), e: shy("向下滚屏", function(can) { can.current.scroll(1) }),

View File

@ -24,7 +24,7 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, target) { can.Conf(html.PADDI
if (can.base.beginWith(link, nfs.PS, web.HTTP)) { return can.user.opens(link) } if (can.base.beginWith(link, nfs.PS, web.HTTP)) { return can.user.opens(link) }
if (can.onmotion.cache(can, function() { return can.onexport.title(can, item.meta.name), can.Option(nfs.PATH, link) })) { return } if (can.onmotion.cache(can, function() { return can.onexport.title(can, item.meta.name), can.Option(nfs.PATH, link) })) { return }
return can.sup.Update(event, [link]) return can.sup.Update(event, [link])
}, nav) }, function() {}, nav)
can.onimport.layout(can) can.onimport.layout(can)
}, },
premenu: function(can, meta, target) { can.page.Select(can, can._output, can.page.Keys(html.H2, html.H3), function(_target) { premenu: function(can, meta, target) { can.page.Select(can, can._output, can.page.Keys(html.H2, html.H3), function(_target) {

View File

@ -152,8 +152,7 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, target) {
}, },
itemlist: function(can, list, cb, cbs, target) { if (!list || list.length == 0) { return } itemlist: function(can, list, cb, cbs, target) { if (!list || list.length == 0) { return }
if (!target) { return can.core.List(list, function(value) { can.onimport.item(can, value, cb, cbs) }) } if (!target) { return can.core.List(list, function(value) { can.onimport.item(can, value, cb, cbs) }) }
var _select var _list = can.core.List(list, function(item) { var icon = item.icon||item.icons
target._list = can.page.insertBefore(can, [{view: html.LIST, list: can.core.List(list, function(item) { var icon = item.icon||item.icons
return {view: html.ITEM, list: [ return {view: html.ITEM, list: [
icon && (can.base.contains(icon, ice.HTTP, ".ico", ".png", ".jpg")? {img: can.misc.Resource(can, icon)}: {icon: icon}), icon && (can.base.contains(icon, ice.HTTP, ".ico", ".png", ".jpg")? {img: can.misc.Resource(can, icon)}: {icon: icon}),
{text: item.nick||item.name||item.zone} {text: item.nick||item.name||item.zone}
@ -167,31 +166,53 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, target) {
if (can.base.isFunc(cbs)) { var menu = cbs(event, event.currentTarget); if (menu) { return can.user.carteRight(event, can, menu.meta, menu.list, menu) } } if (can.base.isFunc(cbs)) { var menu = cbs(event, event.currentTarget); if (menu) { return can.user.carteRight(event, can, menu.meta, menu.list, menu) } }
can.user.carteItem(event, can, item) can.user.carteItem(event, can, item)
}} }}
}) }], target.nextSibling, target.parentNode) })
_select && _select.click() var _select; if (target._list) { can.page.Append(can, target._list, _list) } else {
target._list = can.page.insertBefore(can, [{view: html.LIST, list: _list}], target.nextSibling, target.parentNode)
} _select && _select.click()
return target._list return target._list
}, },
list: function(can, root, cb, target, cbs) { target = target||can._output list: function(can, root, cb, cbs, target) { target = target||can._output
can.core.List(root.list, function(item) { var ui = can.page.Append(can, target, [{view: [[html.ITEM, "open"]], list: [{text: item.meta.name}, item.list && {icon: icon.CHEVRON_DOWN}], onclick: function(event) { can.core.List(root.list, function(item) { var ui = can.page.Append(can, target, [{view: [[html.ITEM, "open"]], list: [{text: item.meta.name}, item.list && {icon: icon.CHEVRON_DOWN}], onclick: function(event) {
can.page.ClassList.set(can, ui.item, "open", can.base.isFunc(cb) && cb(event, item) || can.onmotion.toggle(can, ui.list)) can.page.ClassList.set(can, ui.item, "open", can.base.isFunc(cb) && cb(event, item) || can.onmotion.toggle(can, ui.list))
can.onmotion.select(can, target, html.DIV_ITEM, event.target) can.onmotion.select(can, target, html.DIV_ITEM, event.target)
}, _init: function(target) { if (item.meta.name == "_") { target.innerHTML = "", can.onappend.style(can, html.SPACE, target) } }, _init: function(target) { if (item.meta.name == "_") { target.innerHTML = "", can.onappend.style(can, html.SPACE, target) }
cbs && cbs(target, item) cbs && cbs(target, item)
}}, {view: html.LIST}]); can.onimport.list(can, item, cb, ui.list, cbs) }) }}, {view: html.LIST}]); can.onimport.list(can, item, cb, cbs, ui.list) })
}, },
tree: function(can, list, field, split, cb, target, node) { node = node||{"": target} tree: function(can, list, cb, cbs, target, node, field, split) { node = node||{"": target||can.ui.project}
field = field||nfs.PATH, split = split||nfs.PS
can.core.List(list, function(item) { item[field] && can.core.List(item[field].split(split), function(value, index, array) { if (!value) { return } 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 last = array.slice(0, index).join(split), name = array.slice(0, index+1).join(split); if (node[name]) { return }
last && node[last] && can.page.Select(can, node[last].previousSibling, "div.expand", function(target) { target.innerHTML == "" && (target.innerHTML = can.page.unicode.closes) })
var ui = can.page.Append(can, node[last], [{view: html.ITEM, list: [ var ui = can.page.Append(can, node[last], [{view: html.ITEM, list: [
{view: [[html.EXPAND, item.expand? cli.OPEN: ""], html.DIV, (index==array.length-1? "": can.page.unicode.closes)]}, {view: [[html.EXPAND, item.expand? cli.OPEN: ""], html.DIV, (index==array.length-1? "": can.page.unicode.closes)]},
{view: [mdb.NAME, html.DIV, value], _init: item._init}, {view: [mdb.NAME, html.DIV, value], _init: item._init},
], onclick: function(event) { ], onclick: function(event) { var target = event.currentTarget
if (node[name].childElementCount == 2) { node[name].firstChild.click() } if (node[name].childElementCount > 0&& !can.page.ClassList.set(can, ui[html.EXPAND], cli.OPEN, !can.page.ClassList.neg(can, node[name], html.HIDE))) { return }
index < array.length - 1? can.page.ClassList.set(can, ui[html.EXPAND], cli.OPEN, !can.page.ClassList.neg(can, node[name], html.HIDE)): can.base.isFunc(cb) && cb(event, item) target && can.page.Select(can, can.ui.project, html.DIV_ITEM, function(target) { can.page.ClassList.del(can, target, html.SELECT) })
for (var p = target; p; p = p.parentNode.previousElementSibling) {
can.page.ClassList.add(can, p, html.SELECT), can.onmotion.toggle(can, p.nextSibling, true)
} can.onexport.hash(can, [item[field]]), can.base.isFunc(cb) && cb(event, item, ui.item)
node[item[field]] && can.page.ClassList.add(can, node[item[field]].previousSibling, html.SELECT)
if (node[name].childElementCount == 2) { can.onmotion.delay(can, function() { node[name].firstChild.click() }) }
}, oncontextmenu: function(event) { if (!item._menu) { return } }, oncontextmenu: function(event) { if (!item._menu) { return }
var menu = item._menu; can.user.carteRight(event, can, menu.meta, menu.list, menu) var menu = item._menu; can.user.carteRight(event, can, menu.meta, menu.list, menu)
}}, {view: [[html.LIST, item.expand? "": html.HIDE]]}]); node[name] = ui.list }}, {view: [[html.LIST, item.expand? "": html.HIDE]]}]); node[name] = ui.list;
}) }); return node (item._select || can.db.hash && (can.db.hash[0]||"").indexOf(item[field]) == 0) && can.onmotion.delay(can, function() { ui.item.click() })
}) });
return node
},
tabsCache: function(can, msg, key, value, target, cb) { if (value._tabs) { return value._tabs.click() }
value._tabs = can.onimport.tabs(can, [value], function() { can.onexport.hash(can, [key]), can.Status(value), can.db.value = value
can.page.ClassList.has(can, target, html.SELECT) || can.onmotion.delay(can, function() { target.click() })
if (can.onmotion.cache(can, function() { return key }, can.ui.content, can.ui.profile, can.ui.display)) { return can.onimport.layout(can) }
if (cb && cb()) { return }
if (msg.Append(ctx.INDEX)) { msg.Table(function(value, index) {
index == 0 && can.onappend.plugin(can, value, function(sub) { can.db.value._content_plugin = sub, can.onimport.layout(can) }, can.ui.content)
index == 1 && can.onappend.plugin(can, value, function(sub) { can.db.value._display_plugin = sub, can.onimport.layout(can) }, can.ui.display)
}) } else { can.onappend.table(can, msg), can.onappend.board(can, msg) }
}, function() { delete(value._tabs), can.onmotion.cacheClear(can, key, can.ui.content, can.ui.profile, can.ui.display) })
}, },
tabs: function(can, list, cb, cbs, action) { action = action||can._action; return can.page.Append(can, action, can.core.List(list, function(tabs) { tabs: function(can, list, cb, cbs, action) { action = action||can._action; return can.page.Append(can, action, can.core.List(list, function(tabs) {
if (typeof tabs == code.STRING) { tabs = {name: tabs} } if (typeof tabs == code.STRING) { tabs = {name: tabs} }
@ -298,7 +319,7 @@ Volcanos(chat.ONEXPORT, {
session: function(can, key, value) { return can.misc[can.user.isWebview? "localStorage": "sessionStorage"](can, [can.Conf(ctx.INDEX), key, location.pathname].join(":"), value == ""? "": JSON.stringify(value)) }, session: function(can, key, value) { return can.misc[can.user.isWebview? "localStorage": "sessionStorage"](can, [can.Conf(ctx.INDEX), key, location.pathname].join(":"), value == ""? "": JSON.stringify(value)) },
action_value: function(can, key, def) { var value = can.Action(key); return can.base.isIn(value, ice.AUTO, key, undefined)? def: value }, action_value: function(can, key, def) { var value = can.Action(key); return can.base.isIn(value, ice.AUTO, key, undefined)? def: value },
tool: function(can) { can.misc.sessionStorage(can, [can.ConfIndex(), "tool"], JSON.stringify(can.page.Select(can, can._status, html.LEGEND, function(target) { return target._meta }))) }, tool: function(can) { can.misc.sessionStorage(can, [can.ConfIndex(), "tool"], JSON.stringify(can.page.Select(can, can._status, html.LEGEND, function(target) { return target._meta }))) },
hash: function(can, hash) { can.misc.SearchHash(can, hash) hash: function(can, hash) { hash = typeof hash == code.STRING? [hash]: hash, can.misc.SearchHash(can, hash)
can.misc.localStorage(can, [can.ConfSpace()||can.misc.Search(can, ice.POD), can.ConfIndex(), "hash"], hash) can.misc.localStorage(can, [can.ConfSpace()||can.misc.Search(can, ice.POD), can.ConfIndex(), "hash"], hash)
}, },
tabs: function(can) {}, tabs: function(can) {},