mirror of
https://shylinux.com/x/volcanos
synced 2025-04-25 16:58:06 +08:00
opt some
This commit is contained in:
parent
942aac2df3
commit
019791e42f
2
frame.js
2
frame.js
@ -218,8 +218,8 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) {
|
||||
} return can.user.input(event, can, meta.feature[cmds[1]], function(args) { can.Update(can.request(event, {_handle: ice.TRUE}, can.Option()), cmds.slice(0, 2).concat(args), cb) })
|
||||
}
|
||||
return can.onengine._plugin(event, can, msg, can, cmds, cb) || can.run(event, cmds, function(msg) {
|
||||
var _can = can._fields? can.sup: can; if (_can == (msg._can._fields? msg._can.sup: msg._can)) { if (can.core.CallFunc([_can, chat.ONIMPORT, ice.MSG_PROCESS], {can: _can, msg: msg})) { return } }
|
||||
if (can.base.isFunc(cb)) { return cb(msg) } if (silent) { return }
|
||||
var _can = can._fields? can.sup: can; if (_can == (msg._can._fields? msg._can.sup: msg._can)) { if (can.core.CallFunc([_can, chat.ONIMPORT, ice.MSG_PROCESS], {can: _can, msg: msg})) { return } }
|
||||
if (cmds && cmds[0] == ctx.ACTION) { if (can.base.isIn(cmds[1], mdb.CREATE, mdb.INSERT, mdb.IMPORT, mdb.EXPORT, "exports", "imports", nfs.TRASH) || msg.Length() == 0 && !msg.Result()) { return can.user.toastSuccess(can, cmds[1]), can.Update() } }
|
||||
can.onappend._output(can, msg, meta.display||msg.Option(ice.MSG_DISPLAY)||meta.feature.display)
|
||||
})
|
||||
|
@ -137,7 +137,7 @@ div.item.text:hover>span.icon.delete { visibility:visible; }
|
||||
fieldset.float div.text:hover>span.icon.delete { visibility:hidden; }
|
||||
fieldset.float>form.option>div.text>input { display:none; }
|
||||
fieldset.float>form.option>div.text>span { display:none; }
|
||||
fieldset.float>form.option>div.text>span.value { padding:7px; height:32px; display:block; }
|
||||
fieldset.float>form.option>div.text>span.value { padding:7px; height:32px; display:block; max-width:200px; overflow:auto; }
|
||||
fieldset:not(.float)>form.option>div.text>span.value { display:none; }
|
||||
form.option>div.icon:first-child { margin-left:-5px; }
|
||||
form.option>div.icon { line-height:30px; font-size:26px; padding:0 5px; height:32px; }
|
||||
|
@ -93,7 +93,7 @@ Volcanos("page", {
|
||||
function short(value, length) {
|
||||
if (length == undefined) {
|
||||
value.indexOf(lex.NL) > -1 && (value = value.trim().split(lex.NL)[0]+can.page.unicode.inner)
|
||||
return can.page.replace(can, value)
|
||||
return can.page.trans(can, value)
|
||||
} else { if (length > 5) {
|
||||
return can.page.unicode.inner }
|
||||
} return value
|
||||
|
@ -129,7 +129,7 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb) { var paths = can.core.Sp
|
||||
})
|
||||
}
|
||||
function load(msg) { var skip = false; can.db.tabview[key] = msg
|
||||
can.onimport.tabs(can, [{name: can.base.beginWith(file, "http://")? file.split(web.QS)[0]: file.split(mdb.FS)[0].split(isIndex()? nfs.PT: nfs.PS).pop(), text: file, _menu: shy([
|
||||
can.onimport.tabs(can, [{name: decodeURI(can.base.beginWith(file, "http://")? file.split(web.QS)[0]: file.split(mdb.FS)[0].split(isIndex()? nfs.PT: nfs.PS).pop()), text: file, _menu: shy([
|
||||
nfs.SAVE, nfs.TRASH, web.REFRESH,
|
||||
], function(event, button, meta) { can.onaction[button](event, can, button) })}], function(event, tabs) {
|
||||
can._tab = msg._tab = tabs._target, show(skip), skip = true
|
||||
|
@ -21,7 +21,7 @@ fieldset.word.play.float>div.status { clear:none; }
|
||||
fieldset.word.play.float>div.output>div.project { background-color:#4682b46b; padding:10px; position:fixed; right:0; top:32px; z-index:10; }
|
||||
fieldset.word.play.float div.content div.page { text-align:center; display:none; }
|
||||
fieldset.word.play.float div.content div.page.show { display:block; }
|
||||
fieldset.word.play.float div.content.grid div.page { background-color:#a4cbecb5; margin:10px; height:200px; width:200px; overflow:auto; display:block; float:left; }
|
||||
fieldset.word.play.float div.content.grid div.page { background-color:#a4cbecb5; margin:10px; height:200px; width:30%; overflow:auto; display:block; float:left; }
|
||||
fieldset.word.play.float h1 { text-align:center; }
|
||||
fieldset.word.play.float h2 { text-align:center; }
|
||||
fieldset.word.play.float h3 { text-align:center; }
|
||||
|
@ -11,17 +11,18 @@ Volcanos(chat.ONIMPORT, {
|
||||
_display: function(can, msg) { can.onappend._output(can, msg, msg.Option(ice.MSG_DISPLAY)) },
|
||||
_clear: function(can, msg) { can.onmotion.clear(can) },
|
||||
_inner: function(can, msg) { can.onappend.table(can, msg), can.onappend.board(can, msg), can.onmotion.story.auto(can) },
|
||||
_field: function(can, msg) { var height = can.ConfHeight(); can.page.SelectChild(can, can._output, html.TABLE, function(target) { height -= target.offsetHeight })
|
||||
height = can.base.Min(height, can.isCmdMode()? can.ConfHeight()/2: 320)
|
||||
msg.Table(function(item) { can.onappend._plugin(can, item, {index: item.index, args: can.base.Obj(item.args||item.arg, []), height: height}, function(sub, meta) {
|
||||
_field: function(can, msg, cb) { var height = can.ConfHeight(), width = can.ConfWidth(); can.page.SelectChild(can, can._output, html.TABLE, function(target) { height -= target.offsetHeight })
|
||||
height = can.base.Min(msg.Option(html.HEIGHT)||height, can.isCmdMode()? can.ConfHeight()/2: 320), width = msg.Option(html.WIDTH)||can.ConfWidth()
|
||||
msg.Table(function(item) { can.onappend._plugin(can, item, {index: item.index, args: can.base.Obj(item.args||item.arg, []), height: height, width: width}, function(sub, meta) {
|
||||
sub.Conf(can.base.Obj(item.conf)); if (sub.isSimpleMode()) { sub.ConfHeight(can.ConfHeight()/2)
|
||||
var res = can.request(); res.Echo(sub.Conf(ice.MSG_RESULT)), can.onappend._output(sub, res, sub.Conf(ctx.DISPLAY)); return
|
||||
}
|
||||
sub.run = function(event, cmds, cb) { sub.onimport.size(sub, height, can.ConfWidth(), true)
|
||||
sub.onexport.output = function() { sub.onimport.size(sub, height, can.ConfWidth(), true)
|
||||
sub.run = function(event, cmds, cb) { sub.onimport.size(sub, height, width, true)
|
||||
sub.onexport.output = function() { sub.onimport.size(sub, height, width, true)
|
||||
can.page.SelectChild(can, can._output, html.TABLE, function(target) { can.page.style(can, target, html.MAX_HEIGHT, height, html.DISPLAY, html.BLOCK) })
|
||||
}, can.run(event, (!msg.Option("_index") || msg.Option("_index") == can._index || can._index.indexOf("can.") == 0? msg[ice.MSG_PREFIX]||[]: [ice.RUN, msg.Option("_index")]).concat(cmds), cb, true)
|
||||
}
|
||||
can.base.isFunc(cb) && cb(sub)
|
||||
}) })
|
||||
},
|
||||
_float: function(can, msg) { var arg = msg._arg; msg.Table(function(item) { can.onappend._plugin(can, item, {index: item.index, args: arg? arg.slice(1): [], mode: chat.FLOAT}, function(sub, meta) {
|
||||
|
@ -32,7 +32,7 @@ Volcanos(chat.ONACTION, {list: [[ice.VIEW, "横向", "纵向"], [html.SIZE, 24,
|
||||
can.onaction._draw_vertical(can, can._tree[can.dir_root], can.margin, can.margin+(can.size+can.margin)/2)
|
||||
},
|
||||
_draw: function(can, tree, x, y, style) { var color = can.onimport._color(can, tree)
|
||||
tree.view = can.onimport.draw(can, {shape: html.TEXT, points: [{x: x, y: y}], style: can.base.Copy(kit.Dict(svg.STROKE, color, svg.FILL, color, html.INNER, tree.name||" "), style)})
|
||||
tree.view = can.onimport.draw(can, {shape: html.TEXT, points: [{x: x, y: y}], style: can.base.Copy(kit.Dict(html.INNER, tree.name||" "), style)})
|
||||
return can.core.ItemCB(can.ondetail, tree.view, can, tree), tree.view
|
||||
},
|
||||
_draw_vertical: function(can, tree, x, y) {
|
||||
@ -40,7 +40,7 @@ Volcanos(chat.ONACTION, {list: [[ice.VIEW, "横向", "纵向"], [html.SIZE, 24,
|
||||
var offset = 0; tree.hide || can.core.List(tree.list, function(item) {
|
||||
can.onimport.draw(can, {shape: svg.PATH2V, points: [
|
||||
{x: x+tree.width/2, y: y+tree.height/2-can.margin/2}, {x: x+offset+item.width/2, y: y+tree.height/2+8*can.margin-can.margin/2},
|
||||
], style: {stroke: cli.CYAN}}), can.onaction._draw_vertical(can, item, x+offset, y+tree.height+8*can.margin), offset += item.width
|
||||
]}), can.onaction._draw_vertical(can, item, x+offset, y+tree.height+8*can.margin), offset += item.width
|
||||
})
|
||||
},
|
||||
_draw_horizontal: function(can, tree, x, y) { var height = can.size+can.margin
|
||||
@ -48,7 +48,7 @@ Volcanos(chat.ONACTION, {list: [[ice.VIEW, "横向", "纵向"], [html.SIZE, 24,
|
||||
var offset = 0; tree.hide || can.core.List(tree.list, function(item) {
|
||||
can.onimport.draw(can, {shape: svg.PATH2H, points: [
|
||||
{x: x+tree.width+can.margin/2, y: y+tree.height*height/2-can.size/4}, {x: x+tree.width+8*can.margin-can.margin/2, y: y+offset+item.height*height/2-can.size/4}
|
||||
], style: {stroke: cli.CYAN}}), can.onaction._draw_horizontal(can, item, x+tree.width+8*can.margin, y+offset), offset += item.height*(can.size+can.margin)
|
||||
]}), can.onaction._draw_horizontal(can, item, x+tree.width+8*can.margin, y+offset), offset += item.height*(can.size+can.margin)
|
||||
})
|
||||
},
|
||||
})
|
||||
|
@ -5,7 +5,7 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb) { can.page.requireDraw(ca
|
||||
_sum: function(can) { if (can.list) { return can.list }
|
||||
var begin = "", count = 0, rest = 0, add = 0, del = 0, max = 0
|
||||
can.max = 0, can.min = 0, can.list = can.core.List(can.data, function(value, index) {
|
||||
var item = {date: value[can._msg.append[0]], text: value[can._msg.append[4]], add: parseInt(value[can._msg.append[1]]), del: parseInt(value[can._msg.append[2]])}
|
||||
var item = {date: value[can._msg.append[0]], text: value[can._msg.append[4]], add: parseInt(value[can._msg.append[1]]), del: parseInt(value[can._msg.append[2]]), hash: value.hash}
|
||||
item.begin = rest, item.max = rest + item.add, item.min = rest - item.del, item.close = rest + item.add - item.del
|
||||
begin = begin || item.date, count++, rest = item.close, add += item.add, del += item.del
|
||||
if (item.max - item.min > max) { max = item.max - item.min }
|
||||
@ -72,6 +72,16 @@ Volcanos(chat.ONACTION, {list: [[ice.VIEW, "趋势图", "柱状图", "折线图"
|
||||
})
|
||||
Volcanos(chat.ONDETAIL, {
|
||||
onmouseenter: function(event, can, item) { can.Status(item) },
|
||||
onclick: function(event, can, item) {
|
||||
can.run(can.request(event, item, can.Option()), [mdb.DETAIL], function(msg) {
|
||||
can.getActionSize(function(left, top, width, height) { msg.Option(html.HEIGHT, height*3/4), msg.Option(html.WIDTH, width)
|
||||
can.sup.onimport._field(can.sup, msg, function(sub) {
|
||||
sub.onimport.size(sub, sub.ConfHeight(height/2), sub.ConfWidth(width), true)
|
||||
can.onmotion.move(can, sub._target, {left: left||0, top: (top||0)+height/4})
|
||||
})
|
||||
})
|
||||
})
|
||||
},
|
||||
})
|
||||
Volcanos(chat.ONEXPORT, {list: ["from", "commit", "total", "max", "date", "text", "add", "del"],
|
||||
height: function(can) { var height = can.Action(html.HEIGHT)
|
||||
|
1
proto.js
1
proto.js
@ -68,6 +68,7 @@ var mdb = {
|
||||
CREATE: "create", REMOVE: "remove", INSERT: "insert", DELETE: "delete", MODIFY: "modify", SELECT: "select",
|
||||
INPUTS: "inputs", PRUNES: "prunes", EXPORT: "export", IMPORT: "import", REVERT: "revert", NORMAL: "normal",
|
||||
SEARCH: "search", ENGINE: "engine", RENDER: "render", PLUGIN: "plugin",
|
||||
DETAIL: "detail",
|
||||
|
||||
KEYS: "keys",
|
||||
MAIN: "main", PAGE: "page", NEXT: "next", PREV: "prev", LIMIT: "limit", OFFEND: "offend",
|
||||
|
Loading…
x
Reference in New Issue
Block a user