mirror of
https://shylinux.com/x/volcanos
synced 2025-04-25 16:58:06 +08:00
add share storm
This commit is contained in:
parent
fdeae81193
commit
c3d8554e2c
12
frame.js
12
frame.js
@ -124,6 +124,14 @@ var can = Volcanos("chat", {
|
||||
key && plugin[key] && plugin[key].target && plugin[key].Import(event, value, key)
|
||||
},
|
||||
|
||||
Share: function(event) {
|
||||
can.user.input(event, can, ["name", "text"], function(event, cmd, meta, list) {
|
||||
cmd == "提交" && plugin.Run(event, ["action", "share", meta.name, meta.text], function(msg) {
|
||||
can.user.toast(can.user.Share(can, {path: "/share/"+msg.Result()+"/"}, true))
|
||||
}, true)
|
||||
return true
|
||||
})
|
||||
},
|
||||
Rename: function(event) {var meta = field.Meta;
|
||||
meta.help = can.user.prompt("", function(help) {
|
||||
meta.help = help
|
||||
@ -286,10 +294,10 @@ var can = Volcanos("chat", {
|
||||
can[Config.main] = can.Page(can, Config.main, Config, function(chat) {
|
||||
chat.Import(event||{}, can.user.Search(can, "layout")||Config.layout.def, "layout")
|
||||
can.user.title(can.user.Search(can, "you")||Config.title)
|
||||
can.user.login(function(user) {
|
||||
chat.Login? can.user.login(function(user) {
|
||||
chat.River.Import(event||{}, "update", "river")
|
||||
chat.Header.Import(event||{}, user.name, "username")
|
||||
})
|
||||
}): (chat.Action.Import(event||{}, location.pathname.split("/")[2], "river"), chat.Action.Import(event||{}, "none", "storm"))
|
||||
}, document.body)
|
||||
|
||||
can.require(["page/"+(can.user.Search(can, "topic")||Config.topic)+".css"], function() {})
|
||||
|
@ -9,7 +9,7 @@
|
||||
</head>
|
||||
<body>
|
||||
<script src="/static/volcanos/proto.js"></script>
|
||||
<script src="/static/volcanos/order.js"></script>
|
||||
<script src="/static/volcanos/index.js"></script>
|
||||
<script src="/static/volcanos/frame.js"></script>
|
||||
</body>
|
||||
|
||||
|
@ -51,7 +51,7 @@ Volcanos("onimport", {help: "导入数据", list: [],
|
||||
can._plugin && can._plugin.Import(event, msg, cmd)
|
||||
},
|
||||
})
|
||||
Volcanos("onaction", {help: "组件交互", list: [["layout", "工作", "办公", "聊天", "最长"], "刷新", "清屏", "并行","串行",
|
||||
Volcanos("onaction", {help: "组件交互", list: [["layout"].concat(Config.layout.list), "刷新", "清屏", "并行","串行",
|
||||
["action", "正常", "编辑", "编排", "定位"],
|
||||
{input: "pod"}, {input: "you"}, {input: "hot"}, {input: "top"},
|
||||
],
|
||||
@ -61,6 +61,14 @@ Volcanos("onaction", {help: "组件交互", list: [["layout", "工作", "办公"
|
||||
|
||||
layout: function(event, can, value, cmd, target) {can.Export(event, value, cmd)},
|
||||
|
||||
"共享": function(event, can, msg, cmd, target) {
|
||||
can.user.input(event, can, ["name", "text"], function(event, cmd, meta, list) {
|
||||
cmd == "提交" && can.run(event, [can.Conf("river"), can.Conf("storm"), "share", meta.name, meta.text], function(msg) {
|
||||
can.user.toast(can.user.Share(can, {path: "/share/"+msg.Result()+"/"}, true))
|
||||
}, true)
|
||||
return true
|
||||
})
|
||||
},
|
||||
"保存": function(event, can, msg, cmd, target) {
|
||||
var list = []
|
||||
can.page.Select(can, target, "fieldset", function(item) {var meta = item.Meta
|
||||
@ -153,7 +161,7 @@ Volcanos("onaction", {help: "组件交互", list: [["layout", "工作", "办公"
|
||||
}
|
||||
},
|
||||
})
|
||||
Volcanos("onchoice", {help: "组件菜单", list: ["保存", "刷新"]})
|
||||
Volcanos("onchoice", {help: "组件菜单", list: ["保存", "刷新", "共享"]})
|
||||
Volcanos("ondetail", {help: "组件详情", list: []})
|
||||
Volcanos("onexport", {help: "导出数据", list: []})
|
||||
|
||||
|
@ -8,9 +8,10 @@ Volcanos("onimport", {help: "导入数据", list: [],
|
||||
},
|
||||
})
|
||||
Volcanos("onaction", {help: "组件交互", list: []})
|
||||
Volcanos("onchoice", {help: "组件菜单", list: ["执行", "返回", "重命名", "选项", "加参", "减参", "克隆", "删除"],
|
||||
Volcanos("onchoice", {help: "组件菜单", list: ["执行", "返回", "共享", "重命名", "选项", "加参", "减参", "克隆", "删除"],
|
||||
"执行": function(event, can, msg, cmd, field) {can.Runs(event)},
|
||||
"返回": function(event, can, msg, cmd, field) {can.Last(event)},
|
||||
"共享": function(event, can, msg, cmd, field) {can.Share(event)},
|
||||
"重命名": function(event, can, msg, cmd, field) {can.Rename(event)},
|
||||
"选项": function(event, can, msg, cmd, field) {
|
||||
can.user.input(event, can, ["name", "value"], function(event, cmd, meta, list) {
|
||||
|
15
share.html
Normal file
15
share.html
Normal file
@ -0,0 +1,15 @@
|
||||
<!DOCTYPE html>
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width,initial-scale=0.7,user-scalable=no">
|
||||
<title>volcanos</title>
|
||||
|
||||
<link rel="shortcut icon" type="image/ico" href="/static/volcanos/favicon.ico">
|
||||
<link rel="stylesheet" type="text/css" href="/static/volcanos/style.css">
|
||||
</head>
|
||||
<body>
|
||||
<script src="/static/volcanos/proto.js"></script>
|
||||
<script src="/static/volcanos/share.js"></script>
|
||||
<script src="/static/volcanos/frame.js"></script>
|
||||
</body>
|
||||
|
22
share.js
Normal file
22
share.js
Normal file
@ -0,0 +1,22 @@
|
||||
var Config = {iceberg: "", volcano: "/static/volcanos/",
|
||||
libs: ["lib/base", "lib/core", "lib/misc", "lib/page", "lib/user"],
|
||||
main: "chat", list: [
|
||||
"pane/Header",
|
||||
"pane/River", "pane/Storm",
|
||||
"pane/Target", "pane/Source", "pane/Action",
|
||||
"pane/Footer",
|
||||
], pane: [
|
||||
{group: "index", name: "Header", pos: "head", state: ["time", "user", "link"], title: "github.com/shylinux/context"},
|
||||
{group: "index", name: "River", pos: "left"},
|
||||
{group: "index", name: "Storm", pos: "right"},
|
||||
|
||||
{group: "index", name: "Target", pos: "top"},
|
||||
{group: "index", name: "Source", pos: "center"},
|
||||
{group: "index", name: "Action", pos: "bottom"},
|
||||
{group: "index", name: "Footer", pos: "foot", state: ["ntxt", "ncmd"], title: '<a href="mailto:shylinux@163.com">shylinux@163.com</a>'},
|
||||
],
|
||||
title: "volcanos", topic: "black", layout: {def: "最大", list: ["最大"], size: {
|
||||
"最大": {head: 0, foot: 0, left: 0, right: 0, bottom: -1, center: 0, top: 0},
|
||||
}, border: 4,
|
||||
},
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user