mirror of
https://shylinux.com/x/volcanos
synced 2025-04-25 16:58:06 +08:00
mix github
This commit is contained in:
commit
88e773d746
@ -119,6 +119,10 @@ Volcanos("page", {help: "网页模块",
|
||||
data.title = data.title || data.placeholder;
|
||||
data.autocomplete = data.autocomplete || "current-password"
|
||||
|
||||
} else if (item.img) {var list = can.core.List(item.img);
|
||||
type = "img";
|
||||
data.src = list[0];
|
||||
|
||||
} else if (item.row) {type = "tr";
|
||||
item.list = item.row.map(function(text) {return {text: [text, item.sub||"td"]}});
|
||||
}
|
||||
|
@ -8,9 +8,10 @@ Volcanos("user", {help: "用户模块",
|
||||
toast: function(text) {},
|
||||
carte: function(event, cb) {},
|
||||
|
||||
Share: shy("共享链接", function(can, objs, clear) {var obj = objs || {};
|
||||
Share: shy("共享链接", function(can, objs, clear) {var obj = objs || {}; var path = location.pathname;
|
||||
obj.path && (path = obj.path, delete(obj.path))
|
||||
!clear && can.core.Item(can.user.Search(), function(key, value) {obj[key] || (obj[key] = value)});
|
||||
return location.origin+location.pathname+(objs? "?"+can.core.Item(obj, function(key, value) {
|
||||
return location.origin+path+(objs? "?"+can.core.Item(obj, function(key, value) {
|
||||
return can.core.List(value, function(value) {return key+"="+encodeURIComponent(value)}).join("&");
|
||||
}).join("&"): "");
|
||||
}),
|
||||
|
@ -4,6 +4,9 @@ Volcanos("onimport", {help: "导入数据", list: [],
|
||||
can.Export(event, line.key, "storm")
|
||||
})
|
||||
},
|
||||
layout: function(event, can, value, cmd, output) {
|
||||
can.Conf("layout", value)
|
||||
},
|
||||
river: function(event, can, value, cmd, output) {
|
||||
if (value == "update") {return}
|
||||
can.run(event, [can.Conf("river", value)], function(msg) {
|
||||
@ -15,6 +18,8 @@ Volcanos("onimport", {help: "导入数据", list: [],
|
||||
can.run(event, [can.Conf("river")], function(msg) {
|
||||
can.onimport.init(event, can, msg, cmd, output)
|
||||
})
|
||||
} else {
|
||||
can.Conf("storm", value)
|
||||
}
|
||||
},
|
||||
favor: function(event, can, msg, cmd, output) {var key = msg.detail[0];
|
||||
@ -29,7 +34,7 @@ Volcanos("onimport", {help: "导入数据", list: [],
|
||||
})
|
||||
},
|
||||
})
|
||||
Volcanos("onaction", {help: "组件交互", list: ["创建", "刷新"],
|
||||
Volcanos("onaction", {help: "组件交互", list: ["创建", "刷新", "共享"],
|
||||
"创建": function(event, can, meta, cmd, output) {
|
||||
can.Export(event, "create", "steam")
|
||||
},
|
||||
@ -38,6 +43,9 @@ Volcanos("onaction", {help: "组件交互", list: ["创建", "刷新"],
|
||||
can.onimport.init(event, can, msg, cmd, output)
|
||||
})
|
||||
},
|
||||
"共享": function(event, can, meta, cmd, output) {
|
||||
can.ondetail[cmd](event, can, meta, "", cmd, output)
|
||||
},
|
||||
})
|
||||
Volcanos("onchoice", {help: "组件菜单", list: ["创建", "刷新"],
|
||||
"创建": function(event, can, msg, cmd, output) {
|
||||
@ -49,7 +57,18 @@ Volcanos("onchoice", {help: "组件菜单", list: ["创建", "刷新"],
|
||||
})
|
||||
},
|
||||
})
|
||||
Volcanos("ondetail", {help: "组件详情", list: ["保存", "恢复", "重命名", "删除"],
|
||||
Volcanos("ondetail", {help: "组件详情", list: ["共享", "保存", "恢复", "重命名", "删除"],
|
||||
"共享": function(event, can, line, value, cmd, item) {can.share || (can.share = {});
|
||||
var p = can.user.Share(can, {layout: can.Conf("layout"), river: can.Conf("river"), storm: can.Conf("storm")}, true)
|
||||
if (can.share[p]) {
|
||||
can.user.toast({duration: 10000, height: 300, text: p, list: [{img: [can.user.Share(can, {path: "/share/"+can.share[p]}, true)]}]});
|
||||
} else {
|
||||
can.run(event, [can.Conf("river"), can.Conf("storm"), "share", "qrcode", can.Conf("storm"), p], function(msg) {
|
||||
can.share[p] = msg.Result();
|
||||
can.user.toast({duration: 10000, height: 300, text: p, list: [{img: [can.user.Share(can, {path: "/share/"+msg.Result()}, true)]}]});
|
||||
})
|
||||
}
|
||||
},
|
||||
"重命名": function(event, can, line, value, cmd, item) {
|
||||
can.user.prompt("输入新名:", function(name) {
|
||||
can.run(event, [can.Conf("river"), value, "rename", name], function(msg) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user