mirror of
https://shylinux.com/x/volcanos
synced 2025-04-29 02:09:23 +08:00
opt chat
This commit is contained in:
parent
ca8b0a8ab5
commit
af564ea26a
20
frame.js
20
frame.js
@ -108,23 +108,18 @@ Volcanos("onengine", {help: "解析引擎", list: [], _init: function(can, meta,
|
|||||||
typeof cb == "function" && cb(msg)
|
typeof cb == "function" && cb(msg)
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
can.misc.Run(event, can, {names: pane._name}, [river.name, storm.name, "order"].concat(storm.index), cb)
|
can.misc.Run(event, can, {names: pane._name}, ["action", "command"].concat(storm.index), cb)
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
if (location.pathname == "/share") {
|
if (location.pathname == "/share") { return false }
|
||||||
return false
|
|
||||||
}
|
|
||||||
|
|
||||||
can.core.List(storm.action, function(value) {
|
can.core.List(storm.action, function(value) {
|
||||||
msg.Push("name", value.name||"")
|
msg.Push("name", value.name||"")
|
||||||
msg.Push("help", value.help||"")
|
msg.Push("help", value.help||"")
|
||||||
msg.Push("pod", value.pod||"")
|
|
||||||
msg.Push("group", value.group||"")
|
|
||||||
msg.Push("index", value.index||"")
|
|
||||||
msg.Push("args", value.args||"[]")
|
|
||||||
msg.Push("action", value.action||value.index||"")
|
|
||||||
msg.Push("inputs", JSON.stringify(value.inputs||[]))
|
msg.Push("inputs", JSON.stringify(value.inputs||[]))
|
||||||
msg.Push("feature", JSON.stringify(value.feature||{}))
|
msg.Push("feature", JSON.stringify(value.feature||{}))
|
||||||
|
msg.Push("index", value.index||"")
|
||||||
|
msg.Push("args", value.args||"[]")
|
||||||
})
|
})
|
||||||
typeof cb == "function" && cb(msg)
|
typeof cb == "function" && cb(msg)
|
||||||
} else if (action && action.engine) {
|
} else if (action && action.engine) {
|
||||||
@ -316,12 +311,11 @@ Volcanos("onappend", {help: "渲染引擎", list: [], _init: function(can, meta,
|
|||||||
},
|
},
|
||||||
}, [Volcanos.meta.volcano].concat(list), function(sub) { cb(sub)
|
}, [Volcanos.meta.volcano].concat(list), function(sub) { cb(sub)
|
||||||
meta.feature = sub.base.Obj(meta.feature, {})
|
meta.feature = sub.base.Obj(meta.feature, {})
|
||||||
sub.page.ClassList.add(sub, field, meta.feature.style||"")
|
sub.page.ClassList.add(sub, field, meta.style||meta.feature.style||"")
|
||||||
sub.page.ClassList.add(sub, field, meta.style||"")
|
|
||||||
meta.detail = meta.feature["detail"] || {}
|
|
||||||
|
|
||||||
sub.onimport && sub.onimport._init(sub, sub.Conf(meta), list, function() {}, field)
|
sub.onimport && sub.onimport._init(sub, sub.Conf(meta), list, function() {}, field)
|
||||||
|
|
||||||
|
// meta.detail = meta.feature["detail"] || {}
|
||||||
|
|
||||||
meta.inputs && sub.onappend._option(sub, meta, list, cb)
|
meta.inputs && sub.onappend._option(sub, meta, list, cb)
|
||||||
sub.onaction && sub.onappend._action(sub, sub._action, meta.button || sub.onaction.list)
|
sub.onaction && sub.onappend._action(sub, sub._action, meta.button || sub.onaction.list)
|
||||||
sub.onexport && sub.onappend._status(sub, sub._status, sub.onexport.list)
|
sub.onexport && sub.onappend._status(sub, sub._status, sub.onexport.list)
|
||||||
|
@ -34,6 +34,10 @@ Volcanos("onaction", {help: "交互操作", list: [], _init: function(can, msg,
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
add_plugin: function(can, river, storm, value) {
|
add_plugin: function(can, river, storm, value) {
|
||||||
|
value.action = value.id || value.index
|
||||||
|
value.height = can._target.offsetHeight
|
||||||
|
value.width = can._target.offsetWidth
|
||||||
|
|
||||||
if (can.user.Search(can, "river") == river && can.user.Search(can, "storm") == storm && can.user.Search(can, "active") == value.name) {
|
if (can.user.Search(can, "river") == river && can.user.Search(can, "storm") == storm && can.user.Search(can, "active") == value.name) {
|
||||||
value.args = can.core.List(value.inputs, function(item) {
|
value.args = can.core.List(value.inputs, function(item) {
|
||||||
if (item._input == "text" || item._input == "select") {
|
if (item._input == "text" || item._input == "select") {
|
||||||
@ -41,7 +45,7 @@ Volcanos("onaction", {help: "交互操作", list: [], _init: function(can, msg,
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
value.name && can.onappend._init(can, value, Volcanos.meta.libs.concat(["/plugin/state.js"]), function(sub) {
|
can.onappend._init(can, value, Volcanos.meta.libs.concat(["/plugin/state.js"]), function(sub) {
|
||||||
sub._legend.onclick = function(event) {
|
sub._legend.onclick = function(event) {
|
||||||
var opt = {pod: can.user.Search(can, "pod"), river: river, storm: storm, active: value.name}
|
var opt = {pod: can.user.Search(can, "pod"), river: river, storm: storm, active: value.name}
|
||||||
can.core.Item(sub.Option(), function(key, value) { opt[key] = value })
|
can.core.Item(sub.Option(), function(key, value) { opt[key] = value })
|
||||||
@ -86,20 +90,18 @@ Volcanos("onexport", {help: "导出数据", list: [], _init: function(can, msg,
|
|||||||
can.core.Next(sup.Table(), function(value, next) {
|
can.core.Next(sup.Table(), function(value, next) {
|
||||||
value.feature = can.base.Obj(value.feature||value.meta||"{}", [])
|
value.feature = can.base.Obj(value.feature||value.meta||"{}", [])
|
||||||
value.inputs = can.base.Obj(value.inputs||value.list||"[]", [])
|
value.inputs = can.base.Obj(value.inputs||value.list||"[]", [])
|
||||||
value.height = can._target.offsetHeight
|
if (value.inputs.length > 0) {
|
||||||
value.width = can._target.offsetWidth
|
|
||||||
|
|
||||||
if (value.inputs.length == 0) {
|
|
||||||
can.run({}, ["action", "command", value.index], function(msg) {
|
|
||||||
value.inputs = can.base.Obj(msg.list&&msg.list[0]||"[]", [])
|
|
||||||
value.feature = can.base.Obj(msg.meta&&msg.meta[0]||"{}", {})
|
|
||||||
can.onaction.add_plugin(can, river, storm, value), next()
|
can.onaction.add_plugin(can, river, storm, value), next()
|
||||||
})
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
can.run({}, ["action", "command", value.index], function(msg) {
|
||||||
|
value.feature = can.base.Obj(msg.meta&&msg.meta[0]||"{}", {})
|
||||||
|
value.inputs = can.base.Obj(msg.list&&msg.list[0]||"[]", [])
|
||||||
can.onaction.add_plugin(can, river, storm, value), next()
|
can.onaction.add_plugin(can, river, storm, value), next()
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
})
|
||||||
},
|
},
|
||||||
key: function(can, msg) { msg.Option("active", can.Conf("action"))
|
key: function(can, msg) { msg.Option("active", can.Conf("action"))
|
||||||
can.core.Item(can.Conf("active"), msg.Option)
|
can.core.Item(can.Conf("active"), msg.Option)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user