1
0
mirror of https://shylinux.com/x/volcanos synced 2025-04-25 16:58:06 +08:00
This commit is contained in:
shylinux 2020-06-13 19:02:10 +08:00
parent c9ab57067d
commit 14ddd66d70
11 changed files with 522 additions and 648 deletions

View File

@ -264,8 +264,9 @@ Volcanos("onappend", { _init: function(can, meta, list, cb, target, field) { met
var cb = can.onaction[item] || can.onkeymap && can.onkeymap._remote
cb? cb(event, can, item): can.run(event, ["action", item], function(msg) {}, true)
}}): item.length > 0? can.onappend.input(can, action, "input", {type: "select", values: item.slice(1), name: item[0], onchange: function(event) {
can.onaction[item[0]](event, can, item[0], item[event.target.selectedIndex+1])
}}): typeof item == "object" && can.onappend.input(can, action, "input", item)
var cb = can.onaction[item[0]]
cb && cb(event, can, item[0], item[event.target.selectedIndex+1])
}}): typeof item == "object" && can.page.Append(can, action, [item])
})
},
_detail: function(can, msg, list, target) {
@ -520,6 +521,7 @@ Volcanos("onappend", { _init: function(can, meta, list, cb, target, field) { met
can.onappend.toast(can, "上传成功")
}, true);
})
action.upload.click()
},
modify: function(can, target, cb) { var back = target.innerHTML
var ui = can.page.Appends(can, target, [{type: "input", value: back, onkeydown: function(event) {

View File

@ -130,6 +130,10 @@ fieldset>div.output>div.profile>div.item {
fieldset>div.output>div.profile>div.item:hover {
border:solid 1px red;
}
fieldset>div.output>pre.display {
position:sticky; bottom:0;
clear:both;
}
fieldset div.code {
color:white;

View File

@ -10,7 +10,14 @@ Volcanos({name: "demo", volcano: "/frame.js", iceberg: "/chat/", intshell: "plug
"ncmd",
]},
], main: {name: "Header", engine: "remote", list: ["/publish/order.js"]}, plugin: [
"/plugin/state.js", "/plugin/input.js", "/plugin/table.js",
"/plugin/input/key", "/plugin/input/date",
"/plugin/state.js",
"/plugin/table.js",
"/plugin/input.js",
"/plugin/input/key",
"/plugin/input/date",
"/plugin/local/team/plan.js",
"/plugin/local/wiki/draw.js",
"/plugin/local/wiki/word.js",
"/plugin/local/code/inner.js",
],
})

View File

@ -35,6 +35,7 @@ var page = Volcanos("page", {help: "网页模块",
var size = {
"width": true, "height": true,
"max-height": true,
"min-height": true,
"margin-left": true,
"left": true, "right": true,
"top": true, "bottom": true,

View File

@ -2,31 +2,19 @@ fieldset.editor>div.action {
clear:none;
}
fieldset.editor>div.action>div.file {
border:solid 2px red;
padding:2px;
float:left;
margin:2px 0;
border:solid 2px red; padding:2px;
float:left; margin:2px 0;
cursor:pointer;
}
fieldset.editor>div.action>div.file:hover {
background-color:green;
cursor:pointer;
}
fieldset.editor>div.action>div.file.select {
background-color:green;
}
fieldset.editor>div.output {
min-height:300px;
}
fieldset.editor>div.output>table {
max-height:100px;
overflow:auto;
display:block;
}
fieldset.editor>div.output>div.project {
width:80px; overflow:auto;
position:fixed;
min-height:240px;
max-width:120px; overflow:auto;
}
fieldset.editor>div.output>div.profile {
position:absolute; right:0;
@ -38,46 +26,40 @@ fieldset.editor>div.output>div.profile:hover {
fieldset.editor>div.output div.preview {
font-family:monospace;
float:left; margin-left:80px;
float:left;
}
fieldset.editor>div.output div.preview>div.item {
text-align:right;
text-align:right; padding:0 4px; margin:0;
height:20px; border:solid 1px black;
padding:0 4px; margin:0;
}
fieldset.editor>div.output div.preview>div.item:hover {
background-color:green;
}
fieldset.editor>div.output div.preview>div.item.select {
background-color:red;
height:20px; border:solid 1px yellow;
border:solid 1px yellow;
}
fieldset.editor>div.output div.content {
font-size:16px; font-family:monospace;
border-left:solid 2px red;
padding-left:10px;
float:left;
}
fieldset.editor>div.output div.content>pre.item {
height:20px; border:solid 1px black;
padding:0; margin:0;
}
fieldset.editor>div.output div.content>pre.item:hover {
border:solid 1px red;
padding-left:10px;
}
fieldset.editor>div.output div.content>pre.item span.comment {
background-color:blue; color:cyan;
color:cyan; background-color:blue;
}
fieldset.editor>div.output div.content>pre.item span.keyword {
font-weight:bold;
color:yellow;
color:yellow; font-weight:bold;
}
fieldset.editor>div.output div.content>pre.item span.function {
font-weight:bold;
color:cyan;
color:cyan; font-weight:bold;
}
fieldset.editor>div.output div.content>pre.item span.datatype {
font-weight:bold;
color:lightgreen;
color:lightgreen; font-weight:bold;
}
fieldset.editor>div.output div.content>pre.item span.string {
color:magenta;
@ -87,41 +69,37 @@ fieldset.editor>div.output pre.display {
max-height:80px; overflow:auto;
position:sticky; bottom:0;
display:none;
clear:both;
margin:0;
}
fieldset.editor>div.output pre.display:hover {
background-color:black;
max-height:360px;
z-index:100;
z-index:10;
}
fieldset.editor>div.output textarea.editor.normal {
background-color:#00000000; color:#00000000;
caret-color:#00000000;
}
fieldset.editor>div.output textarea.editor {
position:absolute; padding:0; margin:0;
font-size:16px; font-family:monospace;
background-color:black; color:white;
caret-color:yellow;
position:absolute; left:0;
border:solid 1px red;
width:0; height:20px;
padding:0; margin:0;
padding-left:12px;
background-color:#00000000; color:#00000000;
padding-left:12px;
caret-color:yellow;
display:none;
}
fieldset.editor>div.output textarea.editor.normal {
caret-color:#00000000;
}
fieldset.editor>div.output textarea.command {
clear:both;
padding:0; margin:0;
font-size:16px; font-family:monospace;
padding-left:12px;
background-color:black; color:white;
font-family:monospace;
caret-color:red;
position:sticky; bottom:0;
width:0; height:20px;
border:solid 1px red;
padding:0; margin:0;
padding-left:10px;
z-index:200;
}

View File

@ -3,11 +3,8 @@ Volcanos("onimport", {help: "导入数据", _init: function(can, msg, list, cb,
can.page.Modify(can, target, {style: {"max-height": height-160+"px"}})
can.onappend.table(can, target, "table", msg), can.ui = can.page.Append(can, target, [
{view: ["project", "div"], style: {width: "80px", "max-height": height-180+"px"}},
{view: ["profile", "div"]},
{view: "preview", style: {width: "30px"}},
{view: "content"}, {type: "code", list: [{view: ["display", "pre"]}]},
{view: "project"}, {view: "profile"},
{view: "preview"}, {view: "content"},
{view: ["editor", "textarea"], onkeydown: function(event) {
can.onkeymap.parse(event, can, "insert"), can.Timer(10, function() {
@ -23,10 +20,11 @@ Volcanos("onimport", {help: "导入数据", _init: function(can, msg, list, cb,
{view: ["command", "textarea"], onkeydown: function(event) {
can.onkeymap.parse(event, can, "command")
}},
{type: "code", list: [{view: ["display", "pre"]}]},
])
msg.Option("path", can.Option("path"))
msg.Option("name", can.Option("name"))
msg.Option("file", can.Option("file"))
msg.Option("key", can.Option("key"))
can.tabview = {}, can.Timer(10, function() {
can.onimport.project(can, can.Option("path"))
@ -45,13 +43,13 @@ Volcanos("onimport", {help: "导入数据", _init: function(can, msg, list, cb,
can.Conf("height", can.Conf("height") + 64)
}
},
tabview: function(can, path, name) { can.Option({path: path, name: name, key: ""})
if (can.tabview[path+name]) { return can.onsyntax._init(can, can.tabview[path+name]) }
can.run({}, [path, name], function(msg) {
msg.Option({path: can.Option("path"), name: can.Option("name")})
can.page.Append(can, can._action, [{view: ["file", "div", name], onclick: function(event) {
can.onsyntax._init(can, can.tabview[path+name] = msg)
can.Option({path: path, name: name, key: ""})
tabview: function(can, path, file) { can.Option({path: path, file: file, key: ""})
if (can.tabview[path+file]) { return can.onsyntax._init(can, can.tabview[path+file]) }
can.run({}, [path, file], function(msg) {
msg.Option({path: can.Option("path"), file: can.Option("file")})
can.page.Append(can, can._action, [{view: ["file", "div", file], onclick: function(event) {
can.onsyntax._init(can, can.tabview[path+file] = msg)
can.Option({path: path, file: file, key: ""})
}, ondblclick: function(event) {
can.onkeymap._remote(event, can, "运行")
}, oncontextmenu: function(event) {
@ -62,17 +60,22 @@ Volcanos("onimport", {help: "导入数据", _init: function(can, msg, list, cb,
project: function(can, path) { can.Option({path: path}), can.ui.project.innerHTML = ""
can.run({}, ["action", "project", path+"/"], function(res) { res.Table(function(value) {
var title = can.core.List(["time", "size"], function(item) { return item + ": " + value[item] }).join("\n")
can.page.Append(can, can.ui.project, [{text: [value.file, "div", "item"], title: title, onclick: function(event) {
value.file.endsWith("/")? can.onimport.project(can, can.base.Path(can.Option("path"), value.file)):
can.onimport.tabview(can, can.Option("path"), value.file)
}} ])
can.page.Append(can, can.ui.project, [{text: [value.file, "div", "item"], title: title,
onclick: function(event) {
value.file.endsWith("/")? can.onimport.project(can, can.base.Path(can.Option("path"), value.file)):
can.onimport.tabview(can, can.Option("path"), value.file)
},
ondblclick: function(event) {
can.onkeymap._remote(event, can, "运行", ["action", "运行", path, value.file])
},
}])
}) }, true)
},
}, ["/plugin/local/code/inner.css"])
Volcanos("onsyntax", {help: "语法高亮", list: ["keyword", "prefix", "line"], _init: function(can, msg) { can._msg = msg
// action
can.page.Select(can, can._action, "div.file", function(item) {
item.innerText == msg.Option("name")? can.page.ClassList.add(can, item, "select"):
item.innerText == msg.Option("file")? can.page.ClassList.add(can, item, "select"):
can.page.ClassList.del(can, item, "select")
})
@ -81,7 +84,7 @@ Volcanos("onsyntax", {help: "语法高亮", list: ["keyword", "prefix", "line"],
can.Cache(can.file+item, can.ui[item], can.current)
});
// caches load
can.file = can.base.Path(msg.Option("path"), msg.Option("name"))
can.file = can.base.Path(msg.Option("path"), msg.Option("file"))
var cache = false; can.core.List(["preview", "content", "display"], function(item) {
var p = can.Cache(can.file+item, can.ui[item]); if (!cache && p) { p.click(), cache = true }
}); if (cache) { return }
@ -100,7 +103,7 @@ Volcanos("onsyntax", {help: "语法高亮", list: ["keyword", "prefix", "line"],
typeof p.display == "object" && ( p.display.height && can.page.Modify(can, can.ui.display, {style: {
"max-height": p.display.height,
}}))
}; var p = can.onsyntax[can.parse]; !p? can.run({}, ["action", "plug", can.Option("path"), can.Option("name")], function(msg) {
}; var p = can.onsyntax[can.parse]; !p? can.run({}, ["action", "plug", can.Option("path"), can.Option("file")], function(msg) {
p = can.onsyntax[can.parse] = can.base.Obj(msg.Result()), can.onsyntax._init(can, can._msg), init(p)
}, true): init(p)
},
@ -319,7 +322,8 @@ Volcanos("onsyntax", {help: "语法高亮", list: ["keyword", "prefix", "line"],
line: function(can, line) { var auto = true, loop = true, total = 0
var p = location.href.startsWith("https")? "": "http://localhost:9020"
function cb(event) { console.log(event) }
return {className: "preview", type: "video", style: {height: can.Conf("height")-160+"px", width: can.Conf("width")-160+"px"},
can.page.Modify(can, can._target, {style: {"min-height": can.Conf("height")-160}})
return {className: "preview", type: "video", style: {height: can.Conf("height")-160+"px", width: can._target.offsetWidth-160+"px"},
data: {src: p+"/share/local/"+line, controls: "controls", autoplay: auto, loop: loop},
oncontextmenu: cb, onplay: cb, onpause: cb, onended: cb,
onloadedmetadata: function(event) { total = event.timeStamp
@ -357,8 +361,9 @@ Volcanos("onkeymap", {help: "键盘交互", list: ["command", "normal", "insert"
}), can.onkeymap[item]._engine = engine
}), can.onkeymap._mode(can, mode||"normal")
},
_mode: function(can, value) {
can.ui.editor.className = "editor "+can.Status("输入法", can.Action("mode", can.mode = value))
_mode: function(can, value) { can.Action("mode", can.mode = value)
can.page.Modify(can, can.ui.editor, {className: "editor "+can.mode, style: {display: "none"}})
can.page.Modify(can, can.ui.command, {className: "command "+can.mode, style: {display: "none"}})
return value
},
_command: function(can) { can.onkeymap._mode(can, "command")
@ -371,9 +376,10 @@ Volcanos("onkeymap", {help: "键盘交互", list: ["command", "normal", "insert"
_remote: function(event, can, key, arg, cb) { can.ui.display.innerHTML = "", can.ui.profile.innerHTML = ""
var p = can.onsyntax[can.parse]; can.display = p && p.profile && can.ui.profile || can.ui.display
can.page.Modify(can, can.display, {innerHTML: "", style: {display: "none"}})
var msg = can.request(event); msg.Option("content", can.onexport.content(can))
can.run(event, arg||["action", key, can.Option("path"), can.Option("name")], cb||function(msg) {
can.page.Modify(can, can.display, {innerHTML: "", style: {display: "block"}})
can.run(event, arg||["action", key, can.Option("path"), can.Option("file")], cb||function(msg) {
(msg.Result() || msg.append && msg.append.length > 0) && can.page.Modify(can, can.display, {innerHTML: "", style: {display: "block"}})
can.onappend.table(can, can.display, "table", msg)
can.onappend.board(can, can.display, "board", msg)
}, true)
@ -415,11 +421,11 @@ Volcanos("onkeymap", {help: "键盘交互", list: ["command", "normal", "insert"
},
command: {
Escape: function(event, can) { can.onkeymap._normal(can)
can.page.Modify(can, can.ui.command, {style: {display: "none"}})
can.editor.focus()
can.current.click()
},
Enter: function(event, can) { var line = can.ui.command.value; var ls = can.core.Split(line, " ", ",", {simple: true})
var cb = can.onkeymap._engine[ls[0]]; typeof cb == "function"? cb(event, can, line, ls): can.onkeymap._remote(event, can, line, ["action", "cmd"].concat(ls))
var cb = can.onkeymap._engine[ls[0]]; typeof cb == "function"? cb(event, can, line, ls):
can.onkeymap._remote(event, can, line, ["action", "cmd"].concat(ls))
can.onkeymap.command.Escape(event, can)
},
jk: function(event, can) { can.history = can.history.slice(0, -1)
@ -531,10 +537,8 @@ Volcanos("onkeymap", {help: "键盘交互", list: ["command", "normal", "insert"
},
})
Volcanos("onaction", {help: "控件交互", list: [
"", "项目", "上传",
"", "保存", "运行", "串行", "并行", "日志",
"", "提交", "历史", "记录", "复盘",
"", "收藏", "列表", "搜索", "推荐",
"", "项目", "上传", "", "保存", "运行",
"", "提交", "记录", "复盘", "历史",
],
modifyLine: function(can, target, value) { var p = can.onsyntax.parse(can, value)
typeof p == "object"? can.page.Appends(can, target, [p]): target.innerHTML = p
@ -552,12 +556,14 @@ Volcanos("onaction", {help: "控件交互", list: [
}); if (typeof target != "object") { return }; can.current = target
can.page.Modify(can, can.editor, {className: "editor "+can.mode, value: can.current.innerText, style: {
height: target.offsetHeight+"px", width: target.offsetWidth+"px",
top: (target.offsetTop)+"px", display: "block",
height: target.offsetHeight, width: target.offsetWidth,
left: target.offsetLeft, top: target.offsetTop,
display: "block",
}}), can.editor.focus()
can.page.Modify(can, can.ui.command, {value: can.current.innerText, style: {
height: target.offsetHeight+"px", width: target.offsetWidth+"px",
can.page.Modify(can, can.ui.command, {style: {
height: target.offsetHeight, width: target.offsetWidth,
left: target.offsetLeft,
}})
},
appendLine: function(can, value) { var index = can.max++
@ -635,20 +641,7 @@ Volcanos("onlayout", {help: "页面布局", list: [], _init: function(can) {
can.onlayout.project(can)
},
project: function(can) { var hide = can.ui.project.style.display == "none"
var width = 80, height = 480;
can.page.Modify(can, can.ui.project, {style: {width: width, "max-height": height, display: hide? "": "none"}})
var style = {style: {
"margin-left": hide? width: 0,
}}; can.page.Modify(can, can.ui.preview, style)
var style = {style: {
"margin-left": hide? width+30: 30,
}}; can.page.Modify(can, can.ui.content, style)
can.page.Modify(can, can.ui.display, style)
can.page.Modify(can, can.ui.command, style)
can.page.Modify(can, can.ui.editor, style)
can.page.Modify(can, can.ui.project, {style: {display: hide? "": "none"}})
},
})
Volcanos("onexport", {help: "导出数据", list: ["输入法", "输入值", "文件名", "解析器", "当前行", "ncmd"],

View File

@ -7,30 +7,25 @@ fieldset.plan>div.output table.content {
fieldset.plan>div.output table.profile {
float:left;
}
fieldset.plan>div.output pre.display {
position:sticky; bottom:0;
clear:both;
}
fieldset.plan>div.output table.content div.prepare {
background-color:blue;
}
fieldset.plan>div.output table.content div.process {
/* background-color:yellow; */
}
fieldset.plan>div.output table.content div.finish {
background-color:green;
}
fieldset.plan>div.output table.content div.cancel {
fieldset.plan>div.output table.content div.finish {
background-color:red;
}
fieldset.plan>div.output table.content div.cancel {
background-color:yellow;
}
fieldset.plan>div.output table.content td {
vertical-align:top;
}
fieldset.plan>div.output table.content td div.date {
color:gray;
}
fieldset.plan>div.output table.content td.over {
border:solid 2px red;
}
fieldset.plan>div.output table.content td div.date {
color:gray;
}

View File

@ -2,7 +2,7 @@ Volcanos("onimport", {help: "导入数据", list: [], _init: function(can, msg,
can._name = "plan", can.ui = can.page.Append(can, can._target, [
{view: ["project", "table"], style: {display: can.user.Searchs(can, "project")||"none"}},
{view: ["content", "table"]},
{view: ["profile", "table"], style: {display: can.user.Searchs(can, "profile")||"none"}},
{view: ["profile", "table"]},
{view: ["display", "pre"]},
])

View File

@ -1,34 +1,5 @@
fieldset.item>div.output>div.status>div {
float:left;
height:20px;
border:1px solid black;
fieldset.draw div.output div.project {
}
fieldset.item>div.output>div.status>input.cmd {
float:left;
background-color:black;
color:lightgreen;;
font-size:16px;
width:250px;
}
fieldset.item>div.output>div.action>button.trap {
background-color:lightblue;
border:2px blue solid;
}
fieldset.item>div.output>div.action>div.space {
width:10px;
display:inline-block;
}
fieldset.item>div.output>canvas {
background-color:#8dd09e;
}
fieldset table tr.hidden {
display:none;
}
fieldset table th.order {
background-color:red;
cursor:pointer;
}
fieldset table td.clip {
background-color:red;
fieldset.draw div.output div.project div.item.select {
background-color:red; border:solid 2px yellow;
}

File diff suppressed because it is too large Load Diff

View File

@ -1,51 +1,25 @@
fieldset.story {
clear:both;
margin:5px;
}
fieldset.float {
float:left;
clear:none;
}
fieldset.clear {
fieldset.word h2.story {
clear:both;
}
fieldset p.story {
fieldset.word p.story {
white-space:pre;
}
fieldset ul.story li:hover {
border:solid 2px red;
cursor:pointer;
fieldset.word svg.story {
display:block;
float:left;
}
fieldset.word fieldset.story {
float:left; clear:both;
}
fieldset.word fieldset.story:hover {
border:solid 1px red;
}
fieldset code.story {
display:block;
color:white;
font-size:14px;
font-family:monospace;
background-color:#272822;
white-space:pre;
padding:10px;
overflow:auto;
border:solid 3px green;
max-height:640px;
display:block; border:solid 3px green;
color:white; background-color:#272822;
font-size:14px; font-family:monospace;
max-height:640px; overflow:auto;
padding:10px; white-space:pre;
clear:both;
}
fieldset div.stack:hover {
background-color:red;
}
fieldset div.stack {
cursor:pointer;
width:fit-content;
}
fieldset div.stack.fold {
font-weight:bold;
}
fieldset ul.stack {
border:solid 2px #0000;
margin:0px;
}
fieldset ul.stack:hover {
border:solid 2px red;
}