forked from x/volcanos
opt some
This commit is contained in:
parent
937ac50c56
commit
edef2eb8cc
17
frame.js
17
frame.js
@ -143,7 +143,7 @@ Volcanos("onappend", {help: "渲染引擎", list: [], _init: function(can, meta,
|
|||||||
Update: function(event, cmds, cb, silent) { sub.onappend._output0(sub, sub.Conf(), event||{}, cmds||sub.Input(), cb, silent); return true },
|
Update: function(event, cmds, cb, silent) { sub.onappend._output0(sub, sub.Conf(), event||{}, cmds||sub.Input(), cb, silent); return true },
|
||||||
Focus: function() { can.page.Select(can, option, html.INPUT_ARGS, function(item, index) { index == 0 && item.focus() }) },
|
Focus: function() { can.page.Select(can, option, html.INPUT_ARGS, function(item, index) { index == 0 && item.focus() }) },
|
||||||
Input: function(cmds, silent) {
|
Input: function(cmds, silent) {
|
||||||
cmds = cmds && cmds.length > 0? cmds: can.page.SelectArgs(can, option, ""), cmds = can.base.trim(cmds)
|
cmds = cmds && cmds.length > 0? cmds: can.page.SelectArgs(can, option, "").concat(can.page.SelectArgs(can, action, "")), cmds = can.base.trim(cmds)
|
||||||
silent || cmds[0] == ctx.ACTION || can.base.Eq(sub._history[sub._history.length-1], cmds) || sub._history.push(cmds)
|
silent || cmds[0] == ctx.ACTION || can.base.Eq(sub._history[sub._history.length-1], cmds) || sub._history.push(cmds)
|
||||||
return cmds
|
return cmds
|
||||||
},
|
},
|
||||||
@ -191,8 +191,21 @@ Volcanos("onappend", {help: "渲染引擎", list: [], _init: function(can, meta,
|
|||||||
},
|
},
|
||||||
_action: function(can, list, action, meta) {
|
_action: function(can, list, action, meta) {
|
||||||
list = can.base.getValid(list, can.core.Item(meta))
|
list = can.base.getValid(list, can.core.Item(meta))
|
||||||
|
list = can.base.Obj(list, can.core.Value(can, [chat.ONACTION, mdb.LIST]))
|
||||||
meta = meta||can.onaction, action = action||can._action, can.onmotion.clear(can, action)
|
meta = meta||can.onaction, action = action||can._action, can.onmotion.clear(can, action)
|
||||||
return can.core.List(can.base.Obj(list, can.core.Value(can, [chat.ONACTION, mdb.LIST])), function(item) { if (item == undefined) { return } can.onappend.input(can, item == ""? /*空白*/ {type: html.SPACE}:
|
var _list = []
|
||||||
|
for (var i = 0; i < list.length; i++) {
|
||||||
|
switch (list[i]) {
|
||||||
|
case "page":
|
||||||
|
_list.push({type: "text", name: "limit", value: can._msg.Option("limit")})
|
||||||
|
_list.push({type: "text", name: "offend", value: can._msg.Option("offend")})
|
||||||
|
_list.push("prev", "next")
|
||||||
|
break
|
||||||
|
default:
|
||||||
|
_list.push(list[i])
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return can.core.List(_list, function(item) { if (item == undefined) { return } can.onappend.input(can, item == ""? /*空白*/ {type: html.SPACE}:
|
||||||
can.base.isString(item)? /*按键*/ {type: html.BUTTON, value: can.user.trans(can, item), onclick: function(event) {
|
can.base.isString(item)? /*按键*/ {type: html.BUTTON, value: can.user.trans(can, item), onclick: function(event) {
|
||||||
var cb = meta[item]||meta["_engine"]; cb? can.core.CallFunc(cb, {event: event, can: can, button: item}): can.run(event, [ctx.ACTION, item].concat(can.sup.Input()))
|
var cb = meta[item]||meta["_engine"]; cb? can.core.CallFunc(cb, {event: event, can: can, button: item}): can.run(event, [ctx.ACTION, item].concat(can.sup.Input()))
|
||||||
|
|
||||||
|
@ -8,6 +8,7 @@ Volcanos("onimport", {help: "导入数据", list: [], _init: function(can, conf,
|
|||||||
_rewrite: function(can, msg) {
|
_rewrite: function(can, msg) {
|
||||||
for (var i = 0; i < msg._arg.length; i += 2) {
|
for (var i = 0; i < msg._arg.length; i += 2) {
|
||||||
can.Option(msg._arg[i], msg._arg[i+1])
|
can.Option(msg._arg[i], msg._arg[i+1])
|
||||||
|
can.Action(msg._arg[i], msg._arg[i+1])
|
||||||
}
|
}
|
||||||
can.Update()
|
can.Update()
|
||||||
return true
|
return true
|
||||||
@ -193,10 +194,10 @@ Volcanos("onaction", {help: "交互操作", list: [
|
|||||||
},
|
},
|
||||||
|
|
||||||
next: function(event, can) {
|
next: function(event, can) {
|
||||||
can.Update(event, [ctx.ACTION, "next", can.Status("total")||0, can.Option("limit"), can.Option("offend")])
|
can.Update(event, [ctx.ACTION, "next", can.Status("total")||0, can.Option("limit")||can.Action("limit"), can.Option("offend")||can.Action("offend")])
|
||||||
},
|
},
|
||||||
prev: function(event, can) {
|
prev: function(event, can) {
|
||||||
can.Update(event, [ctx.ACTION, "prev", can.Status("total")||0, can.Option("limit"), can.Option("offend")])
|
can.Update(event, [ctx.ACTION, "prev", can.Status("total")||0, can.Option("limit")||can.Action("limit"), can.Option("offend")||can.Action("offend")])
|
||||||
},
|
},
|
||||||
|
|
||||||
listTags: function(event, can, button) { var list = []
|
listTags: function(event, can, button) { var list = []
|
||||||
|
Loading…
x
Reference in New Issue
Block a user