forked from x/volcanos
opt some
This commit is contained in:
parent
ce930ed420
commit
10d9e7cf7f
2
frame.js
2
frame.js
@ -1011,7 +1011,7 @@ Volcanos("onkeypop", {help: "键盘交互", list: [], _focus: [], _init: functio
|
|||||||
_mode: {
|
_mode: {
|
||||||
normal: {
|
normal: {
|
||||||
j: function(event, can, target) { target.scrollBy(0, event.ctrlKey? 300: 30) },
|
j: function(event, can, target) { target.scrollBy(0, event.ctrlKey? 300: 30) },
|
||||||
k: function(event, can, target) { target.scrollBy(0, -30) },
|
k: function(event, can, target) { target.scrollBy(0, event.ctrlKey? -300: -30) },
|
||||||
|
|
||||||
b: function(event, can, target) { can.search(event, ["Header.onaction.black"]) },
|
b: function(event, can, target) { can.search(event, ["Header.onaction.black"]) },
|
||||||
w: function(event, can, target) { can.search(event, ["Header.onaction.white"]) },
|
w: function(event, can, target) { can.search(event, ["Header.onaction.white"]) },
|
||||||
|
@ -21,22 +21,19 @@ Volcanos({name: "chat", iceberg: "/chat/", volcano: "/frame.js",
|
|||||||
"/plugin/local/team/plan.js",
|
"/plugin/local/team/plan.js",
|
||||||
"/plugin/local/chat/div.js",
|
"/plugin/local/chat/div.js",
|
||||||
], river: {
|
], river: {
|
||||||
"serivce": {name: "运营群", storm: {
|
serivce: {name: "运营群", storm: {
|
||||||
"wx": {name: "公众号 wx", action: [
|
wx: {name: "公众号 wx", action: [
|
||||||
{name: "微信公众号", help: "wx", index: "web.wiki.word", args: ["usr/icebergs/misc/wx/wx.shy"]},
|
{name: "微信公众号", help: "wx", index: "web.wiki.word", args: ["usr/icebergs/misc/wx/wx.shy"]},
|
||||||
]},
|
]},
|
||||||
"mp": {name: "小程序 mp", action: [
|
mp: {name: "小程序 mp", action: [
|
||||||
{name: "微信小程序", help: "mp", index: "web.wiki.word", args: ["usr/icebergs/misc/mp/mp.shy"]},
|
{name: "微信小程序", help: "mp", index: "web.wiki.word", args: ["usr/icebergs/misc/mp/mp.shy"]},
|
||||||
]},
|
]},
|
||||||
"lark": {name: "机器人 lark", action: [
|
lark: {name: "机器人 lark", action: [
|
||||||
{name: "飞书机器人", help: "lark", index: "web.wiki.word", args: ["usr/icebergs/misc/lark/lark.shy"]},
|
{name: "飞书机器人", help: "lark", index: "web.wiki.word", args: ["usr/icebergs/misc/lark/lark.shy"]},
|
||||||
]},
|
]},
|
||||||
"share": {name: "上下文 share", action: [
|
|
||||||
{name: "系统上下文", help: "shylinux/contexts", index: "web.wiki.word", args: ["usr/learning/社会/管理/20200724.shy"]},
|
|
||||||
]},
|
|
||||||
}},
|
}},
|
||||||
"product": {name: "产品群", storm: {
|
product: {name: "产品群", storm: {
|
||||||
"office": {name: "办公 office", action: [
|
office: {name: "办公 office", action: [
|
||||||
{name: "feel", help: "影音媒体", index: "web.wiki.feel"},
|
{name: "feel", help: "影音媒体", index: "web.wiki.feel"},
|
||||||
{name: "draw", help: "思维导图", index: "web.wiki.draw"},
|
{name: "draw", help: "思维导图", index: "web.wiki.draw"},
|
||||||
{name: "data", help: "数据表格", index: "web.wiki.data"},
|
{name: "data", help: "数据表格", index: "web.wiki.data"},
|
||||||
@ -45,18 +42,18 @@ Volcanos({name: "chat", iceberg: "/chat/", volcano: "/frame.js",
|
|||||||
{name: "index", help: "索引", index: "web.wiki.word", args: ["usr/learning/index.shy"]},
|
{name: "index", help: "索引", index: "web.wiki.word", args: ["usr/learning/index.shy"]},
|
||||||
{name: "context", help: "编程", index: "web.wiki.word", args: ["src/main.shy"]},
|
{name: "context", help: "编程", index: "web.wiki.word", args: ["src/main.shy"]},
|
||||||
]},
|
]},
|
||||||
"english": {name: "英汉 english", action: [
|
english: {name: "英汉 english", action: [
|
||||||
{name: "english", help: "英汉", index: "web.wiki.alpha.alpha", args: ["word", "hi"]},
|
{name: "english", help: "英汉", index: "web.wiki.alpha.alpha", args: ["word", "hi"]},
|
||||||
{name: "chinese", help: "汉英", index: "web.wiki.alpha.alpha", args: ["line", "你好"]},
|
{name: "chinese", help: "汉英", index: "web.wiki.alpha.alpha", args: ["line", "你好"]},
|
||||||
{name: "wubi", help: "五笔", index: "web.code.input.wubi", args: ["word", "wqvb"]},
|
{name: "wubi", help: "五笔", index: "web.code.input.wubi", args: ["word", "wqvb"]},
|
||||||
{name: "wubi", help: "五笔", index: "web.code.input.wubi", args: ["line", "你好"]},
|
{name: "wubi", help: "五笔", index: "web.code.input.wubi", args: ["line", "你好"]},
|
||||||
]},
|
]},
|
||||||
"learning": {name: "学习 learning", action: [
|
learning: {name: "学习 learning", action: [
|
||||||
{name: "golang", help: "编程", index: "web.wiki.word", args: ["usr/golang-story/src/main.shy"]},
|
{name: "golang", help: "编程", index: "web.wiki.word", args: ["usr/golang-story/src/main.shy"]},
|
||||||
{name: "tmux", help: "粘贴", index: "web.code.tmux.text"},
|
{name: "tmux", help: "粘贴", index: "web.code.tmux.text"},
|
||||||
{name: "study", help: "学习", index: "web.wiki.word", args: ["usr/learning/study.shy"]},
|
{name: "study", help: "学习", index: "web.wiki.word", args: ["usr/learning/study.shy"]},
|
||||||
]},
|
]},
|
||||||
"chrome": {name: "爬虫 chrome", action: [
|
chrome: {name: "爬虫 chrome", action: [
|
||||||
{name: "feel", help: "网页爬虫", index: "web.wiki.feel", args: ["spide/"], feature: {
|
{name: "feel", help: "网页爬虫", index: "web.wiki.feel", args: ["spide/"], feature: {
|
||||||
display: "/plugin/local/wiki/feel.js",
|
display: "/plugin/local/wiki/feel.js",
|
||||||
height: 200, limit: 3,
|
height: 200, limit: 3,
|
||||||
@ -65,66 +62,66 @@ Volcanos({name: "chat", iceberg: "/chat/", volcano: "/frame.js",
|
|||||||
{name: "spided", help: "网页爬虫", index: "web.code.chrome.spide", args: location && location.protocol && location.protocol=="chrome-extension:"? ["1", "", "spide"]: ["1"]},
|
{name: "spided", help: "网页爬虫", index: "web.code.chrome.spide", args: location && location.protocol && location.protocol=="chrome-extension:"? ["1", "", "spide"]: ["1"]},
|
||||||
]},
|
]},
|
||||||
}},
|
}},
|
||||||
"project": {name: "研发群", storm: {
|
project: {name: "研发群", storm: {
|
||||||
"studio": {name: "研发 studio", action: [
|
studio: {name: "研发 studio", action: [
|
||||||
{name: "vimer", help: "编辑器", index: "web.code.vimer", args: ["src/", "main.go"]},
|
{name: "vimer", help: "编辑器", index: "web.code.vimer", args: ["src/", "main.go"]},
|
||||||
{name: "repos", help: "代码库", index: "web.code.git.status"},
|
{name: "repos", help: "代码库", index: "web.code.git.status"},
|
||||||
{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", args: ["src/main.shy"]},
|
||||||
]},
|
]},
|
||||||
"cli": {name: "命令 cli", action: [
|
cli: {name: "命令 cli", action: [
|
||||||
{name: "bash", help: "命令行", index: "web.wiki.word", args: ["usr/icebergs/misc/bash/bash.shy"]},
|
{name: "bash", help: "命令行", index: "web.wiki.word", args: ["usr/icebergs/misc/bash/bash.shy"]},
|
||||||
{name: "git", help: "代码库", index: "web.wiki.word", args: ["usr/icebergs/misc/git/git.shy"]},
|
{name: "git", help: "代码库", index: "web.wiki.word", args: ["usr/icebergs/misc/git/git.shy"]},
|
||||||
{name: "vim", help: "编辑器", index: "web.wiki.word", args: ["usr/icebergs/misc/vim/vim.shy"]},
|
{name: "vim", help: "编辑器", index: "web.wiki.word", args: ["usr/icebergs/misc/vim/vim.shy"]},
|
||||||
{name: "tmux", help: "命令行", index: "web.wiki.word", args: ["usr/icebergs/misc/tmux/tmux.shy"]},
|
{name: "tmux", help: "命令行", index: "web.wiki.word", args: ["usr/icebergs/misc/tmux/tmux.shy"]},
|
||||||
]},
|
]},
|
||||||
"web": {name: "网页 web", action: [
|
web: {name: "网页 web", action: [
|
||||||
{name: "HTML5", help: "浏览器", index: "web.wiki.word", args: ["usr/icebergs/misc/chrome/chrome.shy"]},
|
{name: "HTML5", help: "浏览器", index: "web.wiki.word", args: ["usr/icebergs/misc/chrome/chrome.shy"]},
|
||||||
]},
|
]},
|
||||||
"linux": {name: "系统 linux", action: [
|
linux: {name: "系统 linux", action: [
|
||||||
{name: "idc", help: "平台", index: "web.wiki.word", args: ["usr/linux-story/idc/idc.shy"]},
|
{name: "idc", help: "平台", index: "web.wiki.word", args: ["usr/linux-story/idc/idc.shy"]},
|
||||||
{name: "iso", help: "系统", index: "web.wiki.word", args: ["usr/linux-story/iso/iso.shy"]},
|
{name: "iso", help: "系统", index: "web.wiki.word", args: ["usr/linux-story/iso/iso.shy"]},
|
||||||
{name: "iot", help: "设备", index: "web.wiki.word", args: ["usr/linux-story/iot/iot.shy"]},
|
{name: "iot", help: "设备", index: "web.wiki.word", args: ["usr/linux-story/iot/iot.shy"]},
|
||||||
{name: "linux", help: "系统", index: "web.wiki.word", args: ["usr/linux-story/src/main.shy"]},
|
{name: "linux", help: "系统", index: "web.wiki.word", args: ["usr/linux-story/src/main.shy"]},
|
||||||
]},
|
]},
|
||||||
"nginx": {name: "代理 nginx", action: [
|
nginx: {name: "代理 nginx", action: [
|
||||||
{name: "nginx", help: "代理", index: "web.wiki.word", args: ["usr/nginx-story/src/main.shy"]},
|
{name: "nginx", help: "代理", index: "web.wiki.word", args: ["usr/nginx-story/src/main.shy"]},
|
||||||
]},
|
]},
|
||||||
"context": {name: "编程 context", action: [
|
context: {name: "编程 context", action: [
|
||||||
{name: "golang", help: "编程", index: "web.wiki.word", args: ["usr/golang-story/src/main.shy"]},
|
{name: "golang", help: "编程", index: "web.wiki.word", args: ["usr/golang-story/src/main.shy"]},
|
||||||
]},
|
]},
|
||||||
"redis": {name: "缓存 redis", action: [
|
redis: {name: "缓存 redis", action: [
|
||||||
{name: "redis", help: "缓存", index: "web.wiki.word", args: ["usr/redis-story/src/main.shy"]},
|
{name: "redis", help: "缓存", index: "web.wiki.word", args: ["usr/redis-story/src/main.shy"]},
|
||||||
{name: "kafka", help: "队列", index: "web.wiki.word", args: ["usr/redis-story/src/kafka/kafka.shy"]},
|
{name: "kafka", help: "队列", index: "web.wiki.word", args: ["usr/redis-story/src/kafka/kafka.shy"]},
|
||||||
]},
|
]},
|
||||||
"mysql": {name: "数据 mysql", action: [
|
mysql: {name: "数据 mysql", action: [
|
||||||
{name: "mysql", help: "数据存储", index: "web.wiki.word", args: ["usr/mysql-story/src/main.shy"]},
|
{name: "mysql", help: "数据存储", index: "web.wiki.word", args: ["usr/mysql-story/src/main.shy"]},
|
||||||
{name: "clickhouse", help: "数据存储", index: "web.wiki.word", args: ["usr/mysql-story/src/clickhouse/clickhouse.shy"]},
|
{name: "clickhouse", help: "数据存储", index: "web.wiki.word", args: ["usr/mysql-story/src/clickhouse/clickhouse.shy"]},
|
||||||
]},
|
]},
|
||||||
}},
|
}},
|
||||||
"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.publish", "web.code.compile", "web.code.autogen",
|
||||||
]},
|
]},
|
||||||
"research": {name: "测试 research", index: [
|
research: {name: "测试 research", index: [
|
||||||
"web.code.favor", "web.code.bench", "web.code.pprof",
|
"web.code.favor", "web.code.bench", "web.code.pprof",
|
||||||
"web.code.case",
|
"web.code.case",
|
||||||
]},
|
]},
|
||||||
}},
|
}},
|
||||||
"operate": {name: "运维群", storm: {
|
operate: {name: "运维群", storm: {
|
||||||
"cli": {name: "系统 cli", index: [
|
cli: {name: "系统 cli", index: [
|
||||||
"qrcode", "daemon", "system", "runtime",
|
"qrcode", "daemon", "system", "runtime",
|
||||||
]},
|
]},
|
||||||
"web": {name: "应用 web", index: [
|
web: {name: "应用 web", index: [
|
||||||
"spide", "route", "share", "dream",
|
"spide", "route", "share", "dream",
|
||||||
]},
|
]},
|
||||||
"aaa": {name: "权限 aaa", index: [
|
aaa: {name: "权限 aaa", index: [
|
||||||
"user", "sess", "role", "totp",
|
"user", "sess", "role", "totp",
|
||||||
]},
|
]},
|
||||||
"nfs": {name: "文件 nfs", index: [
|
nfs: {name: "文件 nfs", index: [
|
||||||
"cat", "dir", "tail", "trash",
|
"cat", "dir", "tail", "trash",
|
||||||
]},
|
]},
|
||||||
"ssh": {name: "脚本 ssh", index: [
|
ssh: {name: "脚本 ssh", index: [
|
||||||
"connect", "session", "service", "channel",
|
"connect", "session", "service", "channel",
|
||||||
"source", "screen",
|
"source", "screen",
|
||||||
]},
|
]},
|
||||||
|
@ -75,7 +75,8 @@ Volcanos("onimport", {help: "导入数据", list: [], _init: function(can, msg)
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
Volcanos("onengine", {help: "解析引擎", list: [], _engine: function(event, page, msg, can, cmds, cb) {
|
Volcanos("onengine", {help: "解析引擎", list: [], _engine: function(event, page, msg, can, cmds, cb) {
|
||||||
var river = can.onengine.river[cmds[0]]
|
var list = can.onengine._river||can.onengine.river
|
||||||
|
var river = list[cmds[0]]
|
||||||
var storm = river && river.storm[cmds[1]]
|
var storm = river && river.storm[cmds[1]]
|
||||||
if (!storm || cmds.length != 2) { return false }
|
if (!storm || cmds.length != 2) { return false }
|
||||||
|
|
||||||
|
@ -52,11 +52,12 @@ Volcanos("onimport", {help: "导入数据", list: [], _init: function(can, msg,
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
Volcanos("onengine", {help: "解析引擎", list: [], _engine: function(event, can, msg, panel, cmds, cb) {
|
Volcanos("onengine", {help: "解析引擎", list: [], _engine: function(event, can, msg, panel, cmds, cb) {
|
||||||
cmds.length == 0 && can.core.Item(can.onengine.river, function(key, value) {
|
var list = can.onengine._river||can.onengine.river
|
||||||
|
cmds.length == 0 && can.core.Item(list, function(key, value) {
|
||||||
msg.Push({hash: key, name: value.name}) // 群组列表
|
msg.Push({hash: key, name: value.name}) // 群组列表
|
||||||
}); if (cmds.length != 1 && cmds[1] != chat.TOOL) { return false }
|
}); if (cmds.length != 1 && cmds[1] != chat.TOOL) { return false }
|
||||||
|
|
||||||
var river = can.onengine.river[cmds[0]]; if (!river) { return false }
|
var river = list[cmds[0]]; if (!river) { return false }
|
||||||
can.core.Item(river.storm, function(key, value) {
|
can.core.Item(river.storm, function(key, value) {
|
||||||
msg.Push({hash: key, name: value.name}) // 应用列表
|
msg.Push({hash: key, name: value.name}) // 应用列表
|
||||||
}), can.base.isFunc(cb) && cb(msg); return true
|
}), can.base.isFunc(cb) && cb(msg); return true
|
||||||
|
@ -297,7 +297,7 @@ Volcanos("onkeymap", {help: "键盘交互", list: ["command", "normal", "insert"
|
|||||||
can.onaction.rerankLine(can)
|
can.onaction.rerankLine(can)
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
Volcanos("onaction", {help: "控件交互", list: ["binpack", "autogen", "compile"],
|
Volcanos("onaction", {help: "控件交互", list: ["autogen", "compile"],
|
||||||
save: function(event, can) { var msg = can.request(event, {content: can.onexport.content(can)})
|
save: function(event, can) { var msg = can.request(event, {content: can.onexport.content(can)})
|
||||||
can.run(event, [ctx.ACTION, "save", can.parse, can.Option("file"), can.Option("path")], function(msg) {
|
can.run(event, [ctx.ACTION, "save", can.parse, can.Option("file"), can.Option("path")], function(msg) {
|
||||||
can.user.toast(can, "保存成功")
|
can.user.toast(can, "保存成功")
|
||||||
|
5
proto.js
5
proto.js
@ -167,13 +167,14 @@ var Volcanos = shy("火山架", {volcano: "/frame.js", args: {}, pack: {}, libs:
|
|||||||
Config.main = Config.main||{}
|
Config.main = Config.main||{}
|
||||||
|
|
||||||
// 预加载
|
// 预加载
|
||||||
var Preload = Config.preload||[]; for (var i = 0; i < Config.panels.length; i++) { var panel = Config.panels[i]
|
var Preload = (Config.preload||[]).concat(Config.main.list)
|
||||||
|
for (var i = 0; i < Config.panels.length; i++) { var panel = Config.panels[i]
|
||||||
panel && (Preload = Preload.concat(panel.list = panel.list || ["/panel/"+panel.name+".css", "/panel/"+panel.name+".js"]))
|
panel && (Preload = Preload.concat(panel.list = panel.list || ["/panel/"+panel.name+".css", "/panel/"+panel.name+".js"]))
|
||||||
}; Preload = Preload.concat(Config.plugin)
|
}; Preload = Preload.concat(Config.plugin)
|
||||||
|
|
||||||
// 根模块
|
// 根模块
|
||||||
name = Config.name, can = {_follow: Config.name, _target: document.body}
|
name = Config.name, can = {_follow: Config.name, _target: document.body}
|
||||||
libs = Preload.concat(Config.main.list, Config.libs, Config.volcano), cb = function(can) {
|
libs = Preload.concat(Config.libs, Config.volcano), cb = function(can) {
|
||||||
can.onengine._init(can, can.Conf(Config), Config.panels, function(msg) {
|
can.onengine._init(can, can.Conf(Config), Config.panels, function(msg) {
|
||||||
can.base.isFunc(Config._init) && Config._init(can)
|
can.base.isFunc(Config._init) && Config._init(can)
|
||||||
}, can._target)
|
}, can._target)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user