mirror of
https://shylinux.com/x/volcanos
synced 2025-04-25 16:58:06 +08:00
mix github
This commit is contained in:
commit
358dce636d
149
frame.js
149
frame.js
@ -47,6 +47,38 @@ Volcanos("onengine", { _init: function(can, meta, list, cb, target) {
|
||||
},
|
||||
|
||||
river: {
|
||||
"serivce": {name: "运营群", storm: {
|
||||
"wx": {name: "wx", action: [
|
||||
{name: "微信公众号", help: "wx", inputs: [
|
||||
{type: "text", name: "path", value: "icebergs/misc/wx/wx.shy"},
|
||||
{type: "button", name: "查看", value: "auto"},
|
||||
], index: "web.wiki.word", feature: {display: "/plugin/local/wiki/word.js"}},
|
||||
]},
|
||||
"mp": {name: "mp", action: [
|
||||
{name: "微信小程序", help: "mp", inputs: [
|
||||
{type: "text", name: "path", value: "icebergs/misc/mp/mp.shy"},
|
||||
{type: "button", name: "查看", value: "auto"},
|
||||
], index: "web.wiki.word", feature: {display: "/plugin/local/wiki/word.js"}},
|
||||
]},
|
||||
"lark": {name: "lark", action: [
|
||||
{name: "飞书机器人", help: "lark", inputs: [
|
||||
{type: "text", name: "path", value: "icebergs/misc/lark/lark.shy"},
|
||||
{type: "button", name: "查看", value: "auto"},
|
||||
], index: "web.wiki.word", feature: {display: "/plugin/local/wiki/word.js", style: "word"}},
|
||||
]},
|
||||
"share": {name: "share", action: [
|
||||
{name: "contexts", help: "shylinux/contexts", inputs: [
|
||||
{type: "text", name: "path", value: "learning/speak/20200724.shy"},
|
||||
{type: "button", name: "查看", value: "auto"},
|
||||
], index: "web.wiki.word", feature: {display: "/plugin/local/wiki/word.js", style: "word"}},
|
||||
]},
|
||||
// "company": {name: "company", action: [
|
||||
// {name: "公司", help: "company", inputs: [
|
||||
// {type: "text", name: "path", value: "learning/社会/管理/company.shy"},
|
||||
// {type: "button", name: "查看", value: "auto"},
|
||||
// ], index: "web.wiki.word", feature: {display: "/plugin/local/wiki/word.js"}},
|
||||
// ]},
|
||||
}},
|
||||
"product": {name: "产品群", storm: {
|
||||
"office": {name: "office", index: [
|
||||
"web.wiki.feel",
|
||||
@ -59,6 +91,42 @@ Volcanos("onengine", { _init: function(can, meta, list, cb, target) {
|
||||
"web.code.chrome.chrome",
|
||||
"web.code.chrome.bookmark",
|
||||
]},
|
||||
"english": {name: "english", action: [
|
||||
{name: "english", help: "英汉", inputs: [
|
||||
{type: "text", name: "word", value: "hi"},
|
||||
{type: "button", name: "查看", value: "auto"},
|
||||
], index: "web.wiki.alpha.find", feature: {}},
|
||||
{name: "chinese", help: "汉英", inputs: [
|
||||
{type: "text", name: "word", value: "你好"},
|
||||
{type: "text", name: "method", value: "line"},
|
||||
{type: "button", name: "查看", value: "auto"},
|
||||
], index: "web.wiki.alpha.find", feature: {}},
|
||||
{name: "wubi", help: "五笔", inputs: [
|
||||
{type: "text", name: "word", value: "wqvb"},
|
||||
{type: "button", name: "查看", value: "auto"},
|
||||
], index: "web.code.input.find", feature: {}},
|
||||
{name: "wubi", help: "五笔", inputs: [
|
||||
{type: "text", name: "word", value: "你好"},
|
||||
{type: "text", name: "method", value: "line"},
|
||||
{type: "button", name: "查看", value: "auto"},
|
||||
], index: "web.code.input.find", feature: {}},
|
||||
]},
|
||||
"context": {name: "context", action: [
|
||||
{name: "knowledge", help: "智库", inputs: [
|
||||
{type: "text", name: "path", value: "learning/", action: "auto"},
|
||||
{type: "button", name: "查看", value: "auto"},
|
||||
{type: "button", name: "返回"},
|
||||
], index: "web.wiki.word", feature: {display: "/plugin/local/wiki/word.js"}},
|
||||
{name: "index", help: "索引", inputs: [
|
||||
{type: "text", name: "path", value: "learning/index.shy", action: "auto"},
|
||||
{type: "button", name: "查看", value: "auto"},
|
||||
{type: "button", name: "返回"},
|
||||
], index: "web.wiki.word", feature: {display: "/plugin/local/wiki/word.js"}},
|
||||
{name: "context", help: "编程", inputs: [
|
||||
{type: "text", name: "path", value: "learning/自然/编程/hi.shy"},
|
||||
{type: "button", name: "查看", value: "auto"},
|
||||
], index: "web.wiki.word", feature: {display: "/plugin/local/wiki/word.js"}},
|
||||
]},
|
||||
}},
|
||||
"project": {name: "研发群", storm: {
|
||||
"inner": {name: "inner", index: [
|
||||
@ -79,6 +147,60 @@ Volcanos("onengine", { _init: function(can, meta, list, cb, target) {
|
||||
"web.code.tmux.buffer",
|
||||
"web.code.tmux.session",
|
||||
]},
|
||||
"vim": {name: "vim", action: [
|
||||
{name: "git", help: "git", inputs: [
|
||||
{type: "text", name: "path", value: "icebergs/misc/git/git.shy"},
|
||||
{type: "button", name: "查看", value: "auto"},
|
||||
], index: "web.wiki.word", feature: {display: "/plugin/local/wiki/word.js"}},
|
||||
{name: "vim", help: "vim", inputs: [
|
||||
{type: "text", name: "path", value: "icebergs/misc/vim/vim.shy"},
|
||||
{type: "button", name: "查看", value: "auto"},
|
||||
], index: "web.wiki.word", feature: {display: "/plugin/local/wiki/word.js"}},
|
||||
]},
|
||||
"html": {name: "html", action: [
|
||||
{name: "spide", help: "爬虫", inputs: [
|
||||
{type: "text", name: "name", value: "icebergs"},
|
||||
{type: "button", name: "查看", value: "auto"},
|
||||
], index: "web.code.git.spide", feature: {display: "/plugin/story/spide.js"}},
|
||||
{name: "trend", help: "趋势", inputs: [
|
||||
{type: "text", name: "name", value: "icebergs"},
|
||||
{type: "text", name: "begin_time", value: "@date"},
|
||||
{type: "button", name: "查看", value: "auto"},
|
||||
], index: "web.code.git.trend", feature: {display: "/plugin/story/trend.js"}},
|
||||
{name: "draw", help: "绘图", inputs: [
|
||||
{type: "text", name: "path", value: "hi.svg"},
|
||||
{type: "button", name: "查看", value: "auto"},
|
||||
], index: "web.wiki.draw.draw", feature: {display: "/plugin/local/wiki/draw.js"}},
|
||||
{name: "HTML5", help: "网页", inputs: [
|
||||
{type: "text", name: "path", value: "icebergs/misc/chrome/chrome.shy"},
|
||||
{type: "button", name: "查看", value: "auto"},
|
||||
], index: "web.wiki.word", feature: {display: "/plugin/local/wiki/word.js"}},
|
||||
]},
|
||||
"nginx": {name: "nginx", action: [
|
||||
{name: "nginx", help: "代理", inputs: [
|
||||
{type: "text", name: "path", value: "nginx-story/src/main.shy"},
|
||||
{type: "button", name: "查看", value: "auto"},
|
||||
], index: "web.wiki.word", feature: {display: "/plugin/local/wiki/word.js"}},
|
||||
]},
|
||||
"golang": {name: "golang", action: [
|
||||
{name: "golang", help: "编程", inputs: [
|
||||
{type: "text", name: "path", value: "golang-story/src/main.shy"},
|
||||
{type: "button", name: "查看", value: "auto"},
|
||||
], index: "web.wiki.word", feature: {display: "/plugin/local/wiki/word.js"}},
|
||||
]},
|
||||
"redis": {name: "redis", action: [
|
||||
{name: "redis", help: "缓存", inputs: [
|
||||
{type: "text", name: "path", value: "redis-story/src/main.shy", action: "auto"},
|
||||
{type: "button", name: "查看", value: "auto"},
|
||||
{type: "button", name: "返回"},
|
||||
], index: "web.wiki.word", feature: {display: "/plugin/local/wiki/word.js"}},
|
||||
]},
|
||||
"context": {name: "context", action: [
|
||||
{name: "context", help: "编程", inputs: [
|
||||
{type: "text", name: "path", value: "learning/自然/编程/context.shy"},
|
||||
{type: "button", name: "查看", value: "auto"},
|
||||
], index: "web.wiki.word", feature: {display: "/plugin/local/wiki/word.js"}},
|
||||
]},
|
||||
}},
|
||||
"profile": {name: "测试群", storm: {
|
||||
"pprof": {name: "pprof", index: [
|
||||
@ -94,6 +216,14 @@ Volcanos("onengine", { _init: function(can, meta, list, cb, target) {
|
||||
"web.code.docker.command",
|
||||
]},
|
||||
}},
|
||||
"operate": {name: "运维群", storm: {
|
||||
"os": {name: "os", action: [
|
||||
{name: "操作系统", help: "os", inputs: [
|
||||
{type: "text", name: "path", value: "learning/自然/编程/system.shy"},
|
||||
{type: "button", name: "查看", value: "auto"},
|
||||
], index: "web.wiki.word", feature: {display: "/plugin/local/wiki/word.js"}},
|
||||
]},
|
||||
}},
|
||||
},
|
||||
search: function(event, can, msg, pane, cmds, cb) { var chain = cmds[1]
|
||||
var sub, mod = can, key, fun = can; can.core.List(chain.split("."), function(value, index, array) {
|
||||
@ -235,7 +365,7 @@ Volcanos("onappend", { _init: function(can, meta, list, cb, target, field) { met
|
||||
for (var k in sub._inputs) { sub._inputs[k]._target.focus(); break }
|
||||
})
|
||||
}, target) },
|
||||
}, Volcanos.meta.libs.concat([item.display||"/plugin/input.js"]), function(input) {
|
||||
}, Volcanos.meta.libs.concat([item.display||"/plugin/input.js"]), function(input) { input.sup = sub
|
||||
input.onimport._init(input, input.Conf(item), item.list||[], function() {}, input._target)
|
||||
|
||||
if (location.protocol == "chrome-extension:") {
|
||||
@ -264,7 +394,7 @@ Volcanos("onappend", { _init: function(can, meta, list, cb, target, field) { met
|
||||
}
|
||||
break
|
||||
default:
|
||||
msg.Option("_action", item.name)
|
||||
cmds && cmds[0] == "action" || msg.Option("_action", item.name||item.value)
|
||||
}
|
||||
|
||||
// 解析参数
|
||||
@ -310,6 +440,7 @@ Volcanos("onappend", { _init: function(can, meta, list, cb, target, field) { met
|
||||
if (!cmds[i]) { cmds.pop() } else { break }
|
||||
}
|
||||
|
||||
var last = sub._history[sub._history.length-1]; !can.core.Eq(last, cmds) && cmds[0] != "action" && sub._history.push(cmds)
|
||||
return run(event, cmds, cb, silent)
|
||||
}
|
||||
|
||||
@ -423,6 +554,9 @@ Volcanos("onappend", { _init: function(can, meta, list, cb, target, field) { met
|
||||
if (!item.values && item.value) {
|
||||
item.values = item.value.split("|")
|
||||
item.value = item.values[0]
|
||||
if (item.values[0] == "day") {
|
||||
item.value = item.values[1]
|
||||
}
|
||||
}
|
||||
input.type = "select", input.list = item.values.map(function(value) {
|
||||
return {type: "option", value: value, inner: value}
|
||||
@ -455,7 +589,7 @@ Volcanos("onappend", { _init: function(can, meta, list, cb, target, field) { met
|
||||
item.type == "text" && !target.placeholder && (target.placeholder = item.name || "")
|
||||
item.type == "text" && !target.title && (target.title = target.placeholder)
|
||||
// item.type == "button" && item.action == "auto" && can.run && can.run({})
|
||||
// item.type == "select" && (target.value = item.value || item.values[item.index||0])
|
||||
item.type == "select" && item.value && (target.value = item.value)
|
||||
return target
|
||||
},
|
||||
table: function(can, target, type, msg, cb) {
|
||||
@ -464,7 +598,7 @@ Volcanos("onappend", { _init: function(can, meta, list, cb, target, field) { met
|
||||
var msg = can.request(event)
|
||||
msg.Option(can.Option()), msg.Option(line)
|
||||
var cb = can.onaction[item] || can.onaction["运行"]
|
||||
cb? cb(event, can, item): can.run(event, ["action", item, key, value.trim()], function(res) {
|
||||
cb? cb(event, can, item): can.run(event, ["action", item, key=="value"? line.key: key, value.trim()], function(res) {
|
||||
can.ui.display.innerHTML = ""
|
||||
can.onappend.table(can, can.ui.display, "table", res)
|
||||
can.onappend.board(can, can.ui.display, "board", res)
|
||||
@ -472,6 +606,13 @@ Volcanos("onappend", { _init: function(can, meta, list, cb, target, field) { met
|
||||
}
|
||||
return {type: "td", inner: value, click: function(event) {
|
||||
var target = event.target; if (target.tagName == "INPUT" && target.type == "button") {
|
||||
switch (target.value) {
|
||||
case "复制":
|
||||
navigator.clipboard.writeText(line.text).then(function() {
|
||||
can.user.toast(can, "复制成功", "paste")
|
||||
})
|
||||
return
|
||||
}
|
||||
return run(event, event.target.value, value)
|
||||
}
|
||||
can.page.Select(can, can._option, "input.args", function(input) { if (input.name == key) { var data = input.dataset || {}
|
||||
|
@ -184,6 +184,9 @@ table td:hover {
|
||||
table td.select {
|
||||
background-color:red;
|
||||
}
|
||||
table td input {
|
||||
margin-left:4px;
|
||||
}
|
||||
|
||||
div.toast {
|
||||
color:yellow;
|
||||
|
@ -37,8 +37,8 @@ var user = Volcanos("user", {help: "用户模块",
|
||||
{text: ["", "div", "duration"]},
|
||||
]}])
|
||||
|
||||
can.Timer({value: 1000, length: (meta.duration||3000)/1000}, function(event, interval, index) {
|
||||
if (index > 2) { ui.duration.innerHTML = index+"s..." }
|
||||
can.Timer({value: 100, length: (meta.duration||1000)/100}, function(event, interval, index) {
|
||||
if (index > 20) { ui.duration.innerHTML = (index/10)+"s..." }
|
||||
}, function() { can.page.Remove(can, ui.first) })
|
||||
|
||||
ui.Close = function() { can.page.Remove(can, ui.first) }
|
||||
|
@ -37,7 +37,7 @@ Volcanos("onexport", {help: "导出数据", list: [], _init: function(can, msg,
|
||||
// 插件回调
|
||||
return can.run(event, can.onengine[cmds[0]]? cmds: [river, storm, value.action].concat(cmds), function(msg) {
|
||||
can.run(msg._event, ["search", "Footer.onaction.ncmd"]);
|
||||
can.user.toast(can, "执行成功", value.name, 2000);
|
||||
can.user.toast(can, "执行成功", value.name, 1000);
|
||||
typeof cb == "function" && cb(msg)
|
||||
}, silent)
|
||||
}
|
||||
|
@ -55,7 +55,7 @@ Volcanos("onaction", {help: "控件交互", list: ["创建", "刷新"], _init: f
|
||||
can.user.Search(can, {"river": can.Conf("river")})
|
||||
},
|
||||
})
|
||||
Volcanos("ondetail", {help: "菜单交互", list: ["添加应用", "添加用户", "重命名", "共享", "删除"], _init: function(can, msg, list, cb, target) {
|
||||
Volcanos("ondetail", {help: "菜单交互", list: ["添加应用", "添加设备", "添加用户", "重命名", "共享", "删除"], _init: function(can, msg, list, cb, target) {
|
||||
can.onexport._init(can, msg, list, cb, target)
|
||||
},
|
||||
"添加工具": function(event, can, value) {
|
||||
@ -80,13 +80,25 @@ Volcanos("ondetail", {help: "菜单交互", list: ["添加应用", "添加用户
|
||||
return true
|
||||
})
|
||||
},
|
||||
"添加设备": function(event, can, value) {
|
||||
can.run(event, ["search", "Search.onimport.select", "space", "", ""], function(list) {
|
||||
var args = []; can.core.List(list, function(item) {
|
||||
args = args.concat([item[4]])
|
||||
})
|
||||
var toast = can.user.toast(can, "执行中...", "添加设备", 100000)
|
||||
can.run(event, [can.Conf("river"), "action", "node"].concat(args), function(msg) {
|
||||
toast.Close(), can.user.toast(can, "执行完成...", "添加设备", 1000)
|
||||
// can.user.Search(can, {"river": can.Conf("river")})
|
||||
})
|
||||
})
|
||||
},
|
||||
"添加用户": function(event, can, river, button) {
|
||||
can.run(event, ["search", "Search.onimport.select", "user", "", ""], function(list) {
|
||||
var args = []; can.core.List(list, function(item) {
|
||||
args = args.concat([item[5]])
|
||||
})
|
||||
can.run(event, [can.Conf("river"), "action", "user"].concat(args), function(msg) {
|
||||
can.user.Search(can, {"river": can.Conf("river")})
|
||||
// can.user.Search(can, {"river": can.Conf("river")})
|
||||
})
|
||||
})
|
||||
},
|
||||
|
@ -10,11 +10,21 @@ Volcanos("onaction", {help: "控件交互", list: [],
|
||||
},
|
||||
onclick: function(event, can) {
|
||||
if (can.Conf("name") == "添加") {
|
||||
setTimeout(async () => {
|
||||
const text = await navigator.clipboard.readText();
|
||||
console.log(text);
|
||||
can.user.input(event, can, can.sup.Conf("feature").insert,function(event, button, data, list) {
|
||||
var args = ["action", "insert"]; can.core.Item(data, function(key, value) {
|
||||
key && value && args.push(key, value)
|
||||
})
|
||||
can.run(event, args, function(msg) {
|
||||
can.user.toast(can, "添加成功")
|
||||
})
|
||||
return true
|
||||
})
|
||||
return
|
||||
|
||||
navigator.clipboard.readText().then(function(text) {
|
||||
console.log(text)
|
||||
can.run(event, ["action", "insert", "paste", "", text], function() {})
|
||||
}, 20)
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,9 @@
|
||||
Volcanos("onimport", {help: "导入数据", _init: function(can, msg, list, cb, target) { target.innerHTML = ""
|
||||
var feature = can.Conf("feature")
|
||||
can.onaction.list = feature.action || can.onaction.list
|
||||
can.Conf("height", feature.height || can.Conf("height"))
|
||||
can.Conf("width", feature.width || can.Conf("width"))
|
||||
|
||||
if (can.Conf("height") < 600) { can.Conf("height", 600) }
|
||||
can.onimport._share(can); var width = can.Conf("width"), height = can.Conf("height")
|
||||
// can.page.Modify(can, target, {style: {"max-height": height-160+"px"}})
|
||||
@ -8,7 +13,8 @@ Volcanos("onimport", {help: "导入数据", _init: function(can, msg, list, cb,
|
||||
{view: "profile"},
|
||||
|
||||
{view: "holdon", list: [
|
||||
{view: "preview"}, {view: "content", style: {"max-width": can.Conf("width")-160+"px"}},
|
||||
{view: "preview"},
|
||||
{view: "content", style: {"max-width": can.Conf("width")-(feature.width?0:120)+"px"}},
|
||||
]},
|
||||
|
||||
{view: ["editor", "textarea"], onkeydown: function(event) {
|
||||
@ -573,6 +579,9 @@ Volcanos("onaction", {help: "控件交互", list: [
|
||||
}, true)
|
||||
},
|
||||
|
||||
"关闭": function(event, can, msg) {
|
||||
can.page.Remove(can, can._target.parentNode)
|
||||
},
|
||||
"串行": function(event, can, msg) {
|
||||
can.core.Next(can.page.Select(can, can._action, "div.file", function(item) {
|
||||
return item.innerHTML
|
||||
|
@ -130,7 +130,7 @@ Volcanos("onimport", {help: "导入数据", list: [], _init: function(can, msg,
|
||||
})
|
||||
|
||||
var head = ["hour"].concat(["周日", "周一", "周二", "周三", "周四", "周五", "周六"]);
|
||||
var list = [0]; for (var i = 6; i < 24; i++) { list.push(i) }
|
||||
var list = [0]; for (var i = 6; i < 24; i++) { list.push(can.base.Number(i, 2)) }
|
||||
|
||||
function set(week, hour) { return can.base.Time(can.base.TimeAdd(begin_time, week-begin_time.getDay()+hour/24)) }
|
||||
var table = can.page.Append(can, can.ui.content, [{type: "table", list:
|
||||
|
@ -42,7 +42,7 @@ Volcanos("onimport", {help: "导入数据", list: [], _init: function(can, msg,
|
||||
|
||||
can.rate = can.ctrl.rate.value = 1
|
||||
limit = can.ctrl.limit.value = parseInt(msg.Option("limit"))||1
|
||||
can.height = can.ctrl.height.value = parseInt(msg.Option("height"))||400
|
||||
can.height = can.ctrl.height.value = parseInt(msg.Option("height"))||200
|
||||
can.Option("path") != "最近/" && can.onimport.page(can, list, begin, limit)
|
||||
},
|
||||
page: function(can, list, begin, limit) { can.ui.display.innerHTML = ""
|
||||
@ -62,6 +62,7 @@ Volcanos("onfigure", {help: "组件菜单", list: [],
|
||||
image: function(can, path) {
|
||||
return {img: path, height: can.height}
|
||||
},
|
||||
jpeg: function(can, path) { return can.onfigure.image(can, path) },
|
||||
jpg: function(can, path) { return can.onfigure.image(can, path) },
|
||||
png: function(can, path) { return can.onfigure.image(can, path) },
|
||||
qrc: function(can, path) { return can.onfigure.image(can, path) },
|
||||
|
@ -1,3 +1,7 @@
|
||||
fieldset li.H2 {
|
||||
font-weight:bold;
|
||||
font-size:20px;
|
||||
}
|
||||
fieldset h2.story {
|
||||
clear:both;
|
||||
}
|
||||
|
@ -25,15 +25,7 @@ Volcanos("onimport", {help: "导入数据", list: [],
|
||||
can.Action("scale", "1")
|
||||
can.sub.svg.Value("transform", "scale("+can.Action("scale")+")")
|
||||
can.onaction["横向"](event, can)
|
||||
|
||||
return
|
||||
can.Timer(100, function() {
|
||||
can.core.Next(["base", "base/mdb", "base/log", "base/gdb", "base/ctx", "base/cli", "LICENSE"], function(value, next) {
|
||||
can._tree[value].view.scrollIntoView()
|
||||
can._tree[value].view.onclick()
|
||||
can.Timer(500, next)
|
||||
})
|
||||
})
|
||||
sub.Action("go", "run")
|
||||
})
|
||||
}
|
||||
}, can.ui.content)
|
||||
@ -66,7 +58,7 @@ Volcanos("onaction", {help: "组件菜单", list: ["编辑", "清空", ["view",
|
||||
var name = array.slice(0, index+1).join("/")
|
||||
list[last] = list[last] || {name: last, list: []}
|
||||
if (!item || list[name]) { return }
|
||||
list[last].list.push(list[name] = {hide: true, name: item+(index==array.length-1? "": "/"), last: last, list: []})
|
||||
list[last].list.push(list[name] = {hide: true, file: value.path, name: item+(index==array.length-1? "": "/"), last: last, list: []})
|
||||
})
|
||||
})
|
||||
return list
|
||||
@ -84,17 +76,54 @@ Volcanos("onaction", {help: "组件菜单", list: ["编辑", "清空", ["view",
|
||||
})
|
||||
return tree.height = height
|
||||
},
|
||||
_draw: function(can, tree, x, y) { var sub = can.sub, name = tree.name || can.Option("name") || "."
|
||||
_draw: function(can, tree, x, y) { var sub = can.sub, name = tree.name || can.Option("path") || "."
|
||||
tree.view = sub.onimport.draw({}, sub, {
|
||||
shape: "text", point: [{x: x, y: y+tree.height*30/2}], style: {inner: name, "text-anchor": "start", "stroke-width": 1, fill: "yellow"},
|
||||
})
|
||||
if (x+name.length*16 > can.width) {
|
||||
can.width = x+name.length*20
|
||||
}
|
||||
tree.view.onclick = function(event) {
|
||||
sub.svg.innerHTML = ""
|
||||
tree.hide = !tree.hide
|
||||
can.onaction["横向"](event, can)
|
||||
if (!event) {return}
|
||||
event.stopPropagation()
|
||||
event.preventDefault()
|
||||
if (name.endsWith("/") || tree.tags) {
|
||||
sub.svg.innerHTML = ""
|
||||
tree.hide = !tree.hide
|
||||
can.onaction["横向"](event, can)
|
||||
return
|
||||
}
|
||||
|
||||
if (tree.name.endsWith("go") ||
|
||||
tree.name.endsWith("c") ||
|
||||
tree.name.endsWith("h")) {
|
||||
can.run(event, [can.Option("path"), tree.file], function(msg) {
|
||||
msg.Table(function(value) { tree.tags = true
|
||||
tree.list.push({type: "tags", file: value.file, line: value.line, name: value.name, last: tree, list: []})
|
||||
})
|
||||
|
||||
sub.svg.innerHTML = ""
|
||||
tree.hide = !tree.hide
|
||||
can.onaction["横向"](event, can)
|
||||
}, true)
|
||||
return
|
||||
}
|
||||
|
||||
tree.inner = can.onappend._init(can, {name: "inner", help: "源码", inputs: [
|
||||
{type: "text", name: "path", value: can.Option("path")},
|
||||
{type: "text", name: "file", value: tree.file},
|
||||
{type: "text", name: "line", value: tree.line},
|
||||
{type: "button", name: "查看", value: "auto"},
|
||||
], index: "web.code.inner", feature: {
|
||||
display: "/plugin/local/code/inner.js", style: "editor", width: 800, height: 600,
|
||||
action: ["关闭"],
|
||||
}}, Volcanos.meta.libs.concat(["/plugin/state.js"]), function(sub) {
|
||||
sub.run = function(event, cmds, cb, silent) {
|
||||
can.run(event, ["inner"].concat(cmds), cb, true)
|
||||
}
|
||||
}, document.body)
|
||||
|
||||
can.page.Modify(can, tree.inner._target, {style: {position: "fixed",
|
||||
left: event.x-(event.x>600? 400: 100),
|
||||
top: event.y-(event.y>600? 400: 0),
|
||||
}})
|
||||
}
|
||||
tree.view.onmouseenter = function(event) {
|
||||
can.page.Remove(can, can.pos)
|
||||
@ -130,10 +159,12 @@ Volcanos("onaction", {help: "组件菜单", list: ["编辑", "清空", ["view",
|
||||
},
|
||||
|
||||
"横向": function(event, can) { var sub = can.sub
|
||||
can.width = 0
|
||||
can._tree = can._tree || can.onaction._tree(can, can._msg)
|
||||
can.onaction._height(can, can._tree[""])
|
||||
sub.svg.Val("height", can._tree[""].height*30)
|
||||
can.onaction._draw(can, can._tree[""], 0, 0)
|
||||
sub.svg.Val("width", can.width)
|
||||
},
|
||||
"纵向": function(event, can) {
|
||||
},
|
||||
|
Loading…
x
Reference in New Issue
Block a user