diff --git a/frame.js b/frame.js index 65450c56..9016fb25 100644 --- a/frame.js +++ b/frame.js @@ -245,7 +245,7 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) { sub.run = function(event, cmds, cb, silent) { sub.request(event)._caller().RunAction(event, sub, cmds) || can.Update(event, can.Input(cmds, !silent), cb, silent) }, can._outputs = can._outputs||[], can._outputs.push(sub), sub.sup = can - sub._index = can._index, sub._msg = msg, sub.Conf(sub._args = can.base.ParseURL(display)) + sub._index = can._index, can._msg = sub._msg = msg, sub.Conf(sub._args = can.base.ParseURL(display)) sub._trans = can.base.Copy(can.base.Copy(sub._trans||{}, can._trans), can.core.Value(sub, [chat.ONACTION, chat._TRANS])) if (sub.onimport && can.base.isArray(sub.onimport.list) && sub.onimport.list.length > 0) { can.onmotion.clear(can, can._option), can.onappend._option(can, {inputs: can.page.inputs(can, sub.onimport.list, html.TEXT) }) diff --git a/index.css b/index.css index f77a3f3e..a72473eb 100644 --- a/index.css +++ b/index.css @@ -6,7 +6,7 @@ input:not([type=button]) { width:120px; } input[name=path] { width:160px; } input[name=line] { width:60px; } input[name=limit] { width:60px; } -input[name=offend] { width:60px; } +input[name=offend] { width:80px; } input[name=id] { width:60px; } input[name=url] { width:320px; } input[name=cmd] { background-color:black; color:white; width:100%; } diff --git a/plugin/state.js b/plugin/state.js index f6a49401..83ff5055 100644 --- a/plugin/state.js +++ b/plugin/state.js @@ -148,8 +148,8 @@ Volcanos(chat.ONACTION, {list: [ clear: function(event, can) { can.onmotion.clear(can, can._output) }, actions: function(event, can) { can.onmotion.toggle(can, can._action) }, full: function(event, can) { can.onaction["切换全屏"](event, can, "切换全屏", can.core.Value(can, chat._OUTPUTS_CURRENT)) }, - prev: function(event, can) { can.runAction(event, mdb.PREV, [can.Status(mdb.TOTAL)||0, can.Option(mdb.LIMIT)||can.Action(mdb.LIMIT)||"", can.Option(mdb.OFFEND)||can.Action(mdb.OFFEND)||""], function(msg) { can.onimport._process(can, msg) }) }, - next: function(event, can) { can.runAction(event, mdb.NEXT, [can.Status(mdb.TOTAL)||0, can.Option(mdb.LIMIT)||can.Action(mdb.LIMIT)||"", can.Option(mdb.OFFEND)||can.Action(mdb.OFFEND)||""], function(msg) { can.onimport._process(can, msg) }) }, + prev: function(event, can) { can.runAction(event, mdb.PREV, [can.Status(mdb.TOTAL)||0, can.Option(mdb.LIMIT)||can.Action(mdb.LIMIT)||can._msg.Option("cache.limit")||"", can.Option(mdb.OFFEND)||can.Action(mdb.OFFEND)||""], function(msg) { can.onimport._process(can, msg) }) }, + next: function(event, can) { can.runAction(event, mdb.NEXT, [can.Status(mdb.TOTAL)||0, can.Option(mdb.LIMIT)||can.Action(mdb.LIMIT)||can._msg.Option("cache.limit")||"", can.Option(mdb.OFFEND)||can.Action(mdb.OFFEND)||""], function(msg) { can.onimport._process(can, msg) }) }, upload: function(event, can) { can.user.upload(event, can) }, keyboard: function(event, can) { can.base.isUndefined(can._daemon) && can.ondaemon._list[0] && (can._daemon = can.ondaemon._list.push(can)-1) diff --git a/plugin/story/trend.js b/plugin/story/trend.js index 9c917b88..3d77fc84 100644 --- a/plugin/story/trend.js +++ b/plugin/story/trend.js @@ -44,22 +44,17 @@ Volcanos(chat.ONACTION, {list: [[ice.VIEW, "趋势图", "柱状图", "折线图" var black = can.onimport.group(can, cli.BLACK, kit.Dict(svg.STROKE, cli.BLACK, svg.FILL, cli.BLACK)) var white = can.onimport.group(can, cli.WHITE, kit.Dict(svg.STROKE, cli.WHITE, svg.FILL, cli.WHITE)) var group = can.getHeaderTheme() == cli.BLACK? white: black; - // can.onimport.transform(can, can.svg) - can.onimport.transform(can, black) - can.onimport.transform(can, white) var color = can.core.List(can.base.Obj(can.Conf(cli.COLOR), []), function(color) { return can.onimport.group(can, color, kit.Dict(svg.STROKE, color, svg.FILL, color)) }) - can.core.List(color, function(color) { - can.onimport.transform(can, color) - }) - var max, min - can.core.List(can.base.Obj(can.Conf(mdb.FIELD), can._msg.append), function(field, index) { max = can.data[0][field], min = can.data[0][field] + can.onimport.transform(can, black), can.onimport.transform(can, white), can.core.List(color, function(color) { can.onimport.transform(can, color) }) + var max, min; can.core.List(can.core.List(can.base.Obj(can.Conf(mdb.FIELD), can._msg.append), function(field) { + if (can.base.isIn(field, "time", "id")) { return } return field + }), function(field, index) { max = can.data[0][field], min = can.data[0][field] for (var i = 1; i < can.data.length; i += 1) { var value = can.data[i][field]; if (value > max) { max = value } if (value < min) { min = value } } max = parseFloat(can.Conf("max")||max), min = parseFloat(can.Conf("min")||min) function order(i) { return i*args.step+args.margin } function scale(y) { return (y - min)/(max - min)*(args.height-2*args.margin)+args.margin } for (var i = 1; i < can.data.length; i += 1) { can.onimport.draw(can, {shape: svg.LINE, points: [{x: order(i-1), y: scale(can.data[i-1][field])}, {x: order(i), y: scale(can.data[i][field])}]}, color[index]||group) } }), can.onappend._status(can, can._msg.Option(ice.MSG_STATUS)) - var gray = can.onimport.group(can, cli.WHITE, kit.Dict(svg.STROKE, cli.GRAY, svg.FILL, cli.GRAY)) - can.onimport.transform(can, gray) + var gray = can.onimport.group(can, cli.WHITE, kit.Dict(svg.STROKE, cli.GRAY, svg.FILL, cli.GRAY)); can.onimport.transform(can, gray) var vline = can.onimport.draw(can, {shape: svg.LINE, points: [{x: 0, y: 0}, {x: 0, y: can.ConfHeight()}]}, gray) var hline = can.onimport.draw(can, {shape: svg.LINE, points: [{x: 0, y: 0}, {x: can.ConfWidth(), y: 0}]}, gray) can.svg.onmousemove = function(event) { var p = can._output.getBoundingClientRect(); p = {x: event.clientX - p.x, y: event.clientY - p.y}