forked from x/volcanos
opt some
This commit is contained in:
parent
de5ae0f0a4
commit
43af770a54
2
frame.js
2
frame.js
@ -216,7 +216,7 @@ Volcanos(chat.ONAPPEND, {help: "渲染引擎", _init: function(can, meta, list,
|
||||
var cb = meta[item]||meta[chat._ENGINE]; cb? can.core.CallFunc(cb, {event: event, can: can, button: item}): can.run(event, [ctx.ACTION, item].concat(can.sup.Input()))
|
||||
}
|
||||
|
||||
}}: item.length > 0? /*列表*/ {type: html.SELECT, name: item[0], values: item.slice(1), value: can.sup[item[0]], onchange: function(event) {
|
||||
}}: item.length > 0? /*列表*/ {type: html.SELECT, name: item[0], values: item.slice(1), value: can.sup&&can.sup[item[0]]||"", onchange: function(event) {
|
||||
var which = item[event.target.selectedIndex+1]
|
||||
can.core.CallFunc(meta[which], [event, can, which])
|
||||
can.core.CallFunc(meta[item[0]], [event, can, item[0], which])
|
||||
|
@ -163,7 +163,8 @@ Volcanos("misc", {help: "通信协议", Message: function(event, can) { var msg
|
||||
try { var data = JSON.parse(event.data) } catch (e) { var data = {detail: [event.data]} }
|
||||
|
||||
var msg = can.request(event); msg.Reply = function() { // 回复命令
|
||||
msg.Option({_handle: true, _source: (msg[ice.MSG_TARGET]||[]).reverse().slice(1).join(ice.PT)||"", _target: (msg[ice.MSG_SOURCE]||[]).reverse().join(ice.PT)})
|
||||
msg.Option({_handle: true, _target: (msg[ice.MSG_SOURCE]||[]).reverse().join(ice.PT)})
|
||||
msg._source = (msg[ice.MSG_TARGET]||[]).reverse().slice(1)||[]
|
||||
msg.result = (msg.result||[]).concat(can.core.List(arguments)), can.misc.Log(html.WSS, ice.MSG_RESULT, msg.result, msg)
|
||||
delete(msg._event), delete(msg._can), socket.send(JSON.stringify(msg))
|
||||
}, msg.detail = data.detail, msg.Copy(data)
|
||||
|
@ -22,6 +22,7 @@ Volcanos(chat.ONIMPORT, {help: "导入数据", _init: function(can, msg, cb, tar
|
||||
item._menu = shy(can.ondetail, can.ondetail.list, function(event, button, meta) {
|
||||
can.request(event, item, item.extra), meta[button](event, can, button, item)
|
||||
})
|
||||
item.nick = item.name+": "+item.type
|
||||
return item._item = can.onimport.item(can, item, function(event) {
|
||||
item._tabs? item._tabs.click(): item._tabs = can.onimport.tabs(can, [item], function(event) {
|
||||
can.onimport._connect(can, item)
|
||||
@ -30,7 +31,7 @@ Volcanos(chat.ONIMPORT, {help: "导入数据", _init: function(can, msg, cb, tar
|
||||
},
|
||||
_create: function(can, args, data) {
|
||||
can.runAction({}, mdb.CREATE, args, function(msg) {
|
||||
var current = can.onimport._item(can, {hash: msg.Result(), name: msg.Option(mdb.NAME), extra: data})
|
||||
var current = can.onimport._item(can, {hash: msg.Result(), name: msg.Option(mdb.NAME), type: msg.Option(mdb.TYPE), extra: data})
|
||||
can.page.insertBefore(can, current, can.ui.project.firstChild).click()
|
||||
})
|
||||
},
|
||||
@ -73,6 +74,7 @@ Volcanos(chat.ONIMPORT, {help: "导入数据", _init: function(can, msg, cb, tar
|
||||
term.onTitleChange(function(title) { can.isCmdMode() && can.user.title(title) })
|
||||
term.onCursorMove(function(e) { can.onexport.term(can, term) })
|
||||
|
||||
can._current = item.hash
|
||||
can.term[item.hash] = item._term = target._term = term, term._target = target, term._item = item
|
||||
can.runAction(can.request(event, item), "select"), item._term.focus()
|
||||
return can.onimport._plug(can, item), can.onexport.term(can, term)
|
||||
@ -95,7 +97,7 @@ Volcanos(chat.ONIMPORT, {help: "导入数据", _init: function(can, msg, cb, tar
|
||||
}
|
||||
},
|
||||
})
|
||||
Volcanos(chat.ONACTION, {help: "操作数据", list: [mdb.CREATE, lex.SPLIT, mdb.PRUNES],
|
||||
Volcanos(chat.ONACTION, {help: "操作数据", list: [mdb.CREATE, lex.SPLIT, mdb.PRUNES, "install"],
|
||||
_trans: {split: "分屏", theme: "主题"},
|
||||
create: function(event, can) {
|
||||
can.user.input(event, can, [mdb.TYPE, mdb.NAME, "background", ctx.INDEX, ctx.ARGS], function(args, data) {
|
||||
@ -113,6 +115,10 @@ Volcanos(chat.ONACTION, {help: "操作数据", list: [mdb.CREATE, lex.SPLIT, mdb
|
||||
})
|
||||
})
|
||||
},
|
||||
install: function(event, can) {
|
||||
can.request(event, {"hash": can._current})
|
||||
can.runAction(event, "install")
|
||||
},
|
||||
})
|
||||
Volcanos(chat.ONDETAIL, {help: "操作数据", list: ["share", "plugin", "theme", "rename", "remove"],
|
||||
share: function(event, can, button, item) { var msg = can.request(event); msg.Option("args", "")
|
||||
|
@ -20,12 +20,14 @@ fieldset.word table.content { display:block; max-height:400px; }
|
||||
fieldset.word fieldset.story { margin:10px; }
|
||||
fieldset.word fieldset.story.full { margin:0px; }
|
||||
|
||||
body.white fieldset.word svg.story text { stroke:blue; fill:blue; }
|
||||
body.white fieldset.word svg.story line { stroke:red; stroke-width:1; }
|
||||
body.white fieldset.word svg.story path { stroke:red; stroke-width:1; }
|
||||
fieldset.word svg.story text { stroke:yellow; fill:yellow; }
|
||||
fieldset.word svg.story line { stroke:red; stroke-width:1; }
|
||||
fieldset.word svg.story path { stroke:red; stroke-width:1; }
|
||||
body.white fieldset.word svg.story.auto rect { stroke:blue; fill:yellow; }
|
||||
body.white fieldset.word svg.story.auto text { stroke:blue; fill:blue; }
|
||||
body.white fieldset.word svg.story.auto line { stroke:red; stroke-width:1; }
|
||||
body.white fieldset.word svg.story.auto path { stroke:red; stroke-width:1; }
|
||||
fieldset.word svg.story.auto rect { stroke:yellow; fill:black; }
|
||||
fieldset.word svg.story.auto text { stroke:yellow; fill:yellow; }
|
||||
fieldset.word svg.story.auto line { stroke:red; stroke-width:1; }
|
||||
fieldset.word svg.story.auto path { stroke:red; stroke-width:1; }
|
||||
|
||||
fieldset.word.float { padding:0; margin:0; width:-webkit-fill-available; position:fixed; left:0; top:0; z-index:10; }
|
||||
fieldset.word.float>div.action { display:contents; }
|
||||
|
@ -100,6 +100,8 @@ Volcanos(chat.ONIMPORT, {help: "导入数据", _init: function(can, msg, cb, tar
|
||||
})
|
||||
},
|
||||
chart: function(can, data, target) {
|
||||
if (!data.fg && !data.bg) { target.className.baseVal = "story auto" }
|
||||
|
||||
target.onclick = function(event) {
|
||||
can.runAction(can.request(event, data), "run", [data.index, "find", event.target.innerHTML])
|
||||
}
|
||||
|
@ -23,7 +23,10 @@ Volcanos(chat.ONIMPORT, {help: "导入数据", _init: function(can, conf, cb, ta
|
||||
_display: function(can, msg) {
|
||||
return can.onappend._output(can, msg, msg.Option(ice.MSG_DISPLAY)), true
|
||||
},
|
||||
_field: function(can, msg) {
|
||||
_field: function(can, msg) { var opts = {}
|
||||
can.page.Select(can, can._option, "input.args", function(target) {
|
||||
var value = msg.Option(target.name); target.name && value && (opts[target.name] = value)
|
||||
})
|
||||
msg.Table(function(item) { item.type = chat.STORY, can.onappend._plugin(can, item, {type: chat.STORY, index: item.index, args: can.base.Obj(item[ice.ARG], [])}, function(sub, meta) {
|
||||
sub.Conf(can.base.Obj(item.conf))
|
||||
if (sub.Conf("mode") == "simple") { (function() {
|
||||
@ -35,7 +38,7 @@ Volcanos(chat.ONIMPORT, {help: "导入数据", _init: function(can, conf, cb, ta
|
||||
sub.ConfHeight(can.ConfHeight())
|
||||
sub.ConfWidth(can.ConfWidth()-4*html.PLUGIN_MARGIN)
|
||||
sub.run = function(event, cmds, cb, silent) {
|
||||
var res = can.request(event, can.Option(), {pid: msg.Option("pid")})
|
||||
var res = can.request(event, can.Option(), {pid: msg.Option("pid")}, opts)
|
||||
for (var i = 0; i < opt.length; i += 2) { res.Option(opt[i], opt[i+1]) }
|
||||
can.run(event, (msg[ice.MSG_PREFIX]||[]).concat(cmds), cb, true)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user