1
0
mirror of https://shylinux.com/x/volcanos synced 2025-04-25 16:58:06 +08:00
This commit is contained in:
shaoying 2022-12-15 09:14:44 +08:00
parent 12af5ef04f
commit 5e516f3b86
4 changed files with 113 additions and 107 deletions

View File

@ -61,25 +61,15 @@ setTimeout(function() { Volcanos({
can.onmotion.move(can, sub._target, {left: msg.Option(html.LEFT), top: msg.Option(html.TOP), right: msg.Option(html.RIGHT), bottom: msg.Option(html.BOTTOM)}, function(target) { can.onmotion.move(can, sub._target, {left: msg.Option(html.LEFT), top: msg.Option(html.TOP), right: msg.Option(html.RIGHT), bottom: msg.Option(html.BOTTOM)}, function(target) {
can.page.style(can, sub._output, html.MAX_HEIGHT, window.innerHeight-target.offsetTop-80, html.MAX_WIDTH, window.innerWidth-target.offsetLeft-20) can.page.style(can, sub._output, html.MAX_HEIGHT, window.innerHeight-target.offsetTop-80, html.MAX_WIDTH, window.innerWidth-target.offsetLeft-20)
}) })
sub._legend.onclick = function(event) { sub._legend.onclick = function(event) { can.onmotion.toggle(can, sub._option), can.onmotion.toggle(can, sub._action), can.onmotion.toggle(can, sub._output), can.onmotion.toggle(can, sub._status) }
can.onmotion.toggle(can, sub._option), can.onmotion.toggle(can, sub._action), can.onmotion.toggle(can, sub._output), can.onmotion.toggle(can, sub._status)
}
msg.Option("selection")? can.onengine.listen(can, "onselection", function() { sub.Option(msg.Option("selection"), window.getSelection()), sub.Update() }): sub._legend.onclick() msg.Option("selection")? can.onengine.listen(can, "onselection", function() { sub.Option(msg.Option("selection"), window.getSelection()), sub.Update() }): sub._legend.onclick()
sub.onaction["保存参数"] = function(event) { can.run(can.request(event, {domain: location.host, id: msg.Option(mdb.ID)}), [chat.FIELD, mdb.MODIFY, html.TOP, sub._target.offsetTop, html.LEFT, sub._target.offsetLeft, ctx.ARGS, JSON.stringify(sub.Input([], true))]) } sub.onaction["保存参数"] = function(event) { can.run(can.request(event, {domain: location.host, id: msg.Option(mdb.ID)}), [chat.FIELD, mdb.MODIFY, html.TOP, sub._target.offsetTop, html.LEFT, sub._target.offsetLeft, ctx.ARGS, JSON.stringify(sub.Input([], true))]) }
}, document.body) }, document.body)
}, },
change: function(can, msg, arg) {
arg.length > 1 && can.page.Modify(can, arg[0], can.base.Obj(arg[1]))
arg.length > 0 && can.page.Select(can, document.body, arg[0], function(item) {
msg.Push(mdb.TEXT, item.outerHTML)
})
},
order: function(can, msg, arg) { order: function(can, msg, arg) {
var ui = can.user.input(event, can, [ctx.INDEX, ctx.ARGS, "selection", html.LEFT, html.TOP], function(args) { var ui = can.user.input(event, can, [ctx.INDEX, ctx.ARGS, "selection", html.LEFT, html.TOP], function(args) {
can.run(event, [chat.FIELD, mdb.INSERT, mdb.ZONE, location.host].concat(args), function(res) { can.run(event, [chat.FIELD, mdb.INSERT, web.DOMAIN, location.host].concat(args), function(res) { can.user.toastSuccess(can) })
can.user.toastSuccess(can)
})
}); can.page.style(can, ui._target, {left: 200, top: 200}) }); can.page.style(can, ui._target, {left: 200, top: 200})
can.page.ClassList.add(can, ui._target, chat.CONTEXTS) can.page.ClassList.add(can, ui._target, chat.CONTEXTS)
}, },

View File

@ -1,22 +1,17 @@
Volcanos({ Volcanos({
chrome: function(can, msg, arg, cb) { msg.detail = msg.detail.slice(3) chrome: function(can, msg, arg, cb) { msg.detail = msg.detail.slice(3)
if (arg.length == 0 || arg[0] == "") { if (arg.length == 0 || arg[0] == "") {
chrome.windows.getAll(function(wins) { chrome.windows.getAll(function(win) { can.core.List(win, function(win) { win.wid = win.id
can.core.List(wins, function(win) { win.wid = win.id msg.Push(win, ["type", "state", "wid", "focused", html.LEFT, html.TOP, html.WIDTH, html.HEIGHT])
msg.Push(win, ["type", "state", "wid", "focused", html.LEFT||"0", html.TOP||"0", html.WIDTH, html.HEIGHT]) }), can.base.isFunc(cb) && cb(msg) })
}), can.base.isFunc(cb) && cb(msg)
})
} else if (arg.length == 1 || arg[1] == "") { } else if (arg.length == 1 || arg[1] == "") {
chrome.tabs.getAllInWindow(parseInt(arg[0]), function(tabs) { chrome.tabs.getAllInWindow(parseInt(arg[0]), function(tab) { can.core.Next(tab, function(tab, next) { var _msg = can.request(); _msg.detail = ["info"]
can.core.Next(tabs, function(tab, next) { var _msg = can.request(); _msg.detail = ["info"]
can._tabsend(can, _msg, function(res) { tab.tid = tab.id can._tabsend(can, _msg, function(res) { tab.tid = tab.id
msg.Push(tab, ["index", "tid", "active", html.WIDTH, html.HEIGHT]) msg.Push(tab, ["index", "tid", "active", html.WIDTH, html.HEIGHT])
msg.Push("title", res && res["title"][0] || "") msg.Push("title", res&&res["title"][0]||"").Push("url", res&&res["url"][0]||"")
msg.Push("url", res && res["url"][0] || "")
next() next()
}, tab.id) }, tab.id)
}, function() { can.base.isFunc(cb) && cb(msg) }) }, function() { can.base.isFunc(cb) && cb(msg) }) })
})
} else if (arg[1] == "current") { } else if (arg[1] == "current") {
chrome.tabs.query({currentWindow: true, active: true}, function(tabs) { arg[1] = tabs[0].id chrome.tabs.query({currentWindow: true, active: true}, function(tabs) { arg[1] = tabs[0].id
can._tabsend(can, msg, null, arg[1]) can._tabsend(can, msg, null, arg[1])

View File

@ -3,7 +3,7 @@
<meta charset="utf-8"> <meta charset="utf-8">
<link rel="stylesheet" href="/page/can.css"> <link rel="stylesheet" href="/page/can.css">
</head> </head>
<body style="width:1200px; height:600px; overflow:auto"> <body style="width:800px; height:600px; overflow:auto">
<script src="/page/can.js"></script> <script src="/page/can.js"></script>
<script src="/publish/chrome/popup.js"></script> <script src="/publish/chrome/popup.js"></script>
</body> </body>

View File

@ -20,42 +20,63 @@ Volcanos({name: "popup", iceberg: "http://localhost:9020/chat/", river: {
}}, }},
project: {name: "研发群", storm: { project: {name: "研发群", storm: {
studio: {name: "研发 studio", list: [ studio: {name: "研发 studio", list: [
{name: "vimer", help: "编辑器", index: "web.code.vimer", args: ["src/", "main.go"]}, {name: "vimer", help: "编辑器", index: "web.code.vimer", args: ["src/,usr/volcanos/,usr/icebergs/,usr/toolkits/", "main.go"]},
{name: "repos", help: "代码库", index: "web.code.git.status"}, {name: "repos", help: "代码库", index: "web.code.git.status"},
{name: "favor", help: "收藏夹", index: "web.chat.favor"},
{name: "plan", help: "任务表", index: "web.team.plan"}, {name: "plan", help: "任务表", index: "web.team.plan"},
{name: "ctx", help: "上下文", index: "web.wiki.word", args: ["src/main.shy"]}, {name: "ctx", help: "上下文", index: "web.wiki.word"},
]}, ]},
web: {name: "网页 web", list: [ chrome: {name: "网页 chrome", index: [
{name: "HTML5", help: "浏览器", index: "web.wiki.word", args: ["usr/icebergs/misc/chrome/chrome.shy"]}, "web.code.chrome.chrome",
"web.code.chrome.daemon",
"web.code.chrome.spide",
"web.code.chrome.cache",
"web.code.chrome.style",
"web.code.chrome.field",
]}, ]},
}}, }},
profile: {name: "测试群", storm: { profile: {name: "测试群", storm: {
release: {name: "发布 release", index: [ release: {name: "发布 release", index: [
"web.code.publish", "web.code.compile", "web.code.autogen", "web.code.webpack",
"web.code.compile",
"web.code.publish",
"web.code.docker.client",
"web.space",
"web.dream",
"web.code.git.server",
"web.code.git.status",
]}, ]},
research: {name: "测试 research", index: [ toolkit: {name: "工具 toolkit", index: [
"web.code.favor", "web.code.bench", "web.code.pprof", "web.code.favor",
"web.code.case", "web.code.xterm",
"web.code.inner",
"web.code.vimer",
"web.code.bench",
"web.code.pprof",
"web.code.oauth",
]},
language: {name: "语言 language", index: [
"web.code.c",
"web.code.sh",
"web.code.py",
"web.code.shy",
"web.code.js",
"web.code.go",
]}, ]},
}}, }},
operate: {name: "运维群", storm: { operate: {name: "运维群", storm: {
aaa: {name: "权限 aaa", index: [ aaa: {name: "权限 aaa", index: [
"user", "sess", "role", "totp", "offer", "email", "user", "totp", "sess", "role",
]}, ]},
web: {name: "应用 web", index: [ web: {name: "应用 web", index: [
"spide", "route", "share", "dream", "broad", "serve", "space", "dream", "share", "cache", "spide",
]}, ]},
cli: {name: "系统 cli", index: [ cli: {name: "系统 cli", index: [
"qrcode", "daemon", "system", "runtime", "qrcode", "daemon", "system", "runtime", "mirrors", "forever", "host", "port",
]}, ]},
nfs: {name: "文件 nfs", index: [ nfs: {name: "文件 nfs", index: [
"cat", "dir", "tail", "trash", "cat", "dir", "pack", "tail", "trash",
]},
ssh: {name: "脚本 ssh", index: [
"connect", "session", "service", "channel",
"source", "screen",
]}, ]},
}}, }},
}, }})
})