mirror of
https://shylinux.com/x/volcanos
synced 2025-04-25 16:58:06 +08:00
add order.js
This commit is contained in:
parent
4a04a8f5b4
commit
5c39492fa6
45
frame.js
45
frame.js
@ -6,25 +6,27 @@ Volcanos("onaction", { _init: function(can, meta, list, cb, target) {
|
||||
}, can[item.name] = pane, next();
|
||||
}, can._target);
|
||||
}, function() { can.onlayout._init(can, meta, list, function() {
|
||||
function getAction() {}
|
||||
function getStorm(storm) { can.core.Item(storm, function(key, value) {
|
||||
value._link? can.require([value._link], function(can) {
|
||||
}, function(can, name, sub) {
|
||||
getAction(value.action = sub.action)
|
||||
return true
|
||||
}): getAction(value.action)
|
||||
}) }
|
||||
function getRiver(river) { can.core.Item(river, function(key, value) {
|
||||
value._link? can.require([value._link], function(can) {
|
||||
}, function(can, name, sub) {
|
||||
getStorm(value.storm = sub.storm)
|
||||
return true
|
||||
}): getStorm(value.storm)
|
||||
}) }
|
||||
can.onengine && getRiver(can.onengine.river)
|
||||
can.require(["publish/order.js"], function(can) {
|
||||
function getAction() {}
|
||||
function getStorm(storm) { can.core.Item(storm, function(key, value) {
|
||||
value._link? can.require([value._link], function(can) {
|
||||
}, function(can, name, sub) {
|
||||
getAction(value.action = sub.action)
|
||||
return true
|
||||
}): getAction(value.action)
|
||||
}) }
|
||||
function getRiver(river) { can.core.Item(river, function(key, value) {
|
||||
value._link? can.require([value._link], function(can) {
|
||||
}, function(can, name, sub) {
|
||||
getStorm(value.storm = sub.storm)
|
||||
return true
|
||||
}): getStorm(value.storm)
|
||||
}) }
|
||||
can.onengine && getRiver(can.onengine.river)
|
||||
|
||||
var pane = can[meta.main.name], msg = can.request(can._event);
|
||||
pane.onaction._init(pane, msg, msg.option||[], cb, target);
|
||||
var pane = can[meta.main.name], msg = can.request(can._event);
|
||||
pane.onaction._init(pane, msg, msg.option||[], cb, target);
|
||||
})
|
||||
}, target) });
|
||||
},
|
||||
search: function(event, can, msg, pane, cmds, cb) { var chain = cmds[1]
|
||||
@ -34,7 +36,7 @@ Volcanos("onaction", { _init: function(can, meta, list, cb, target) {
|
||||
|
||||
typeof fun == "function" && fun(sub, msg, cmds.slice(2), cb, sub._target)
|
||||
},
|
||||
engine: function(event, can, msg, pane, cmds, cb) {
|
||||
engine: function(event, can, msg, pane, cmds, cb) { if (!can.onengine) { return false }
|
||||
switch (pane._name) {
|
||||
case "River":
|
||||
if (cmds.length == 0) {
|
||||
@ -62,6 +64,7 @@ Volcanos("onaction", { _init: function(can, meta, list, cb, target) {
|
||||
msg.Push("name", value.name||"");
|
||||
msg.Push("help", value.help||"");
|
||||
msg.Push("inputs", JSON.stringify(value.inputs||[]));
|
||||
msg.Push("feature", JSON.stringify(value.feature||{}));
|
||||
})
|
||||
typeof cb == "function" && cb(msg);
|
||||
} else if (action.engine) {
|
||||
@ -130,7 +133,9 @@ Volcanos("onappend", { _init: function(can, meta, list, cb, target, field) {
|
||||
if (silent) { typeof cb == "function" && cb(msg); return }
|
||||
|
||||
// 添加组件
|
||||
var display = "plugin/"+(msg.Option("_display")||feature.display||"table.js")
|
||||
var display = (msg.Option("_display")||feature.display||"table.js")
|
||||
display.indexOf("/") == 0 || (display = "plugin/"+display)
|
||||
|
||||
sub[display] = Volcanos(display, { _target: output,
|
||||
_option: option, _action: action, _output: output,
|
||||
_follow: can._follow+"."+meta.name+"."+display,
|
||||
|
1
index.js
1
index.js
@ -15,7 +15,6 @@ var Config = {name: "demo", volcano: "frame.js", iceberg: "/chat/", intshell: "p
|
||||
"plugin/input/date",
|
||||
"plugin/input/upload",
|
||||
"plugin/input/province",
|
||||
"publish/order.js",
|
||||
],
|
||||
}
|
||||
|
||||
|
8
proto.js
8
proto.js
@ -54,6 +54,14 @@ var Volcanos = shy("火山架", {cache: {}, index: 1, order: 1, debug: {
|
||||
var source = !libs[0].endsWith("/") && (libs[0].indexOf(".") == -1? libs[0]+".js": libs[0]) || libs[0];
|
||||
|
||||
if (source.endsWith(".js")) { var script = document.createElement("script");
|
||||
if (can.user && source.indexOf("publish") == 0) {
|
||||
source += "?pod="+(can.user.Search(can, "pod")||"")
|
||||
libs[0] = source
|
||||
}
|
||||
if (can.user && source.indexOf("/publish") == 0) {
|
||||
source += "?pod="+(can.user.Search(can, "pod")||"")
|
||||
libs[0] = source
|
||||
}
|
||||
script.src = source, script.onload = function() {
|
||||
can._load(libs[0], each), can.require(libs.slice(1), cb, each);
|
||||
} // 加载脚本
|
||||
|
Loading…
x
Reference in New Issue
Block a user