forked from x/volcanos
opt vimer.js
This commit is contained in:
parent
14c72af026
commit
2cddbcc870
17
frame.js
17
frame.js
@ -493,25 +493,26 @@ Volcanos(chat.ONLAYOUT, {help: "页面布局", _init: function(can, target) { ta
|
|||||||
]}] }])
|
]}] }])
|
||||||
},
|
},
|
||||||
profile: function(can, target) { target = target||can._output
|
profile: function(can, target) { target = target||can._output
|
||||||
function toggle(view) {
|
function toggle(view) { var show = view.style.display == html.NONE
|
||||||
view._toggle? view._toggle(event, view.style.display == html.NONE): can.onmotion.toggle(can, view)
|
can.onmotion.toggle(can, view, show), view._toggle && view._toggle(event, show)
|
||||||
return view.style.display == html.NONE
|
return show
|
||||||
}
|
}
|
||||||
|
|
||||||
var gt = "❯", lt = "❮", down = "˅", up = "˄"
|
// var gt = "❯", lt = "❮", down = "˅", up = "˄"
|
||||||
|
var gt = "❯", lt = "❮", down = lt, up = gt
|
||||||
var ui = can.page.Append(can, target, [{view: [chat.LAYOUT, html.TABLE], list: [
|
var ui = can.page.Append(can, target, [{view: [chat.LAYOUT, html.TABLE], list: [
|
||||||
{view: [chat.PROJECT, html.TD], list: [{view: [chat.PROJECT]}]},
|
{view: [chat.PROJECT, html.TD], list: [{view: [chat.PROJECT]}]},
|
||||||
{type: html.TD, list: [
|
{type: html.TD, list: [
|
||||||
{type: html.TR, list: [{type: html.TR, list: [
|
{type: html.TR, list: [{type: html.TR, list: [
|
||||||
{view: [chat.CONTENT, html.TD], list: [{view: [chat.CONTENT]},
|
{view: [chat.CONTENT, html.TD], list: [{view: [chat.CONTENT]},
|
||||||
{view: [[html.TOGGLE, chat.PROJECT]], list: [{text: [gt, html.DIV]}], onclick: function(event) {
|
{view: [[html.TOGGLE, chat.PROJECT]], list: [{text: [lt, html.DIV]}], onclick: function(event) {
|
||||||
event.target.innerHTML = toggle(can.ui.project)? gt: lt
|
can.page.Appends(can, event.target, [{text: [toggle(can.ui.project)? lt: gt, html.DIV]}])
|
||||||
}},
|
}},
|
||||||
{view: [[html.TOGGLE, chat.PROFILE]], list: [{text: [lt, html.DIV]}], onclick: function(event) {
|
{view: [[html.TOGGLE, chat.PROFILE]], list: [{text: [lt, html.DIV]}], onclick: function(event) {
|
||||||
event.target.innerHTML = toggle(can.ui.profile)? lt: gt
|
can.page.Appends(can, event.target, [{text: [toggle(can.ui.profile)? gt: lt, html.DIV]}])
|
||||||
}},
|
}},
|
||||||
{view: [[html.TOGGLE, chat.DISPLAY]], list: [{text: [up, html.DIV]}], onclick: function(event) {
|
{view: [[html.TOGGLE, chat.DISPLAY]], list: [{text: [up, html.DIV]}], onclick: function(event) {
|
||||||
event.target.innerHTML = toggle(can.ui.display)? up: down
|
can.page.Appends(can, event.target, [{text: [toggle(can.ui.display)? down: up, html.DIV]}])
|
||||||
}},
|
}},
|
||||||
]},
|
]},
|
||||||
{view: [chat.PROFILE, html.TD], list: [{view: [chat.PROFILE], style: {display: html.NONE}}]},
|
{view: [chat.PROFILE, html.TD], list: [{view: [chat.PROFILE], style: {display: html.NONE}}]},
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
body, fieldset, table, tr, th, td { padding:0; border:0; margin:0; }
|
body, fieldset, table, tr, th, td { padding:0; border:0; margin:0; }
|
||||||
body { background-color:black; color:cyan; }
|
body { background-color:black; color:cyan; }
|
||||||
legend { background-color:#339999; color:white; padding:0px 20px; }
|
legend { background-color:#339999; color:white; padding:0 20px; }
|
||||||
select { background-color:black; color:cyan; padding:0 10px; }
|
select { background-color:black; color:cyan; padding:0 10px; }
|
||||||
textarea { background-color:cyan; width:400px; padding:4px; }
|
textarea { background-color:cyan; width:400px; padding:4px; }
|
||||||
input[type=password] { background-color:cyan; color:black; padding:0 4px; width:90px; }
|
input[type=password] { background-color:cyan; color:black; padding:0 4px; width:90px; }
|
||||||
@ -31,7 +31,7 @@ table.layout div.toggle>div { color:white; display:table-cell; }
|
|||||||
table.layout div.toggle.project { padding-top: 50px; height:100px; width:15px; top:20%; left:0px; border-top-right-radius:10px; border-bottom-right-radius:10px; }
|
table.layout div.toggle.project { padding-top: 50px; height:100px; width:15px; top:20%; left:0px; border-top-right-radius:10px; border-bottom-right-radius:10px; }
|
||||||
table.layout div.toggle.profile { padding-top: 50px; height:100px; width:15px; top:20%; right:0px; border-top-left-radius:10px; border-bottom-left-radius:10px; }
|
table.layout div.toggle.profile { padding-top: 50px; height:100px; width:15px; top:20%; right:0px; border-top-left-radius:10px; border-bottom-left-radius:10px; }
|
||||||
table.layout div.toggle.display { overflow:hidden; margin-top:-15px; height:15px; width:100px; position:sticky; left:40%; border-top-left-radius:10px; border-top-right-radius:10px; }
|
table.layout div.toggle.display { overflow:hidden; margin-top:-15px; height:15px; width:100px; position:sticky; left:40%; border-top-left-radius:10px; border-top-right-radius:10px; }
|
||||||
table.layout div.toggle.display>div { color:white; text-align:center; height:15px; width:100px; }
|
table.layout div.toggle.display>div { color:white; text-align:center; height:15px; width:100px; transform: rotate(-90deg) translate(5px, 0px); }
|
||||||
|
|
||||||
table.content thead { position:sticky; top:2px; }
|
table.content thead { position:sticky; top:2px; }
|
||||||
table.content th { background-color:#0fbd45; padding:2px 6px; }
|
table.content th { background-color:#0fbd45; padding:2px 6px; }
|
||||||
@ -190,7 +190,7 @@ body.simple fieldset.Action>div.output>fieldset.plugin.inner>div.action { displa
|
|||||||
body.simple div.output.card div.item { min-width:240px; border-radius:5px; box-shadow:2px 2px 6px 1px gray; }
|
body.simple div.output.card div.item { min-width:240px; border-radius:5px; box-shadow:2px 2px 6px 1px gray; }
|
||||||
body.simple div.output.card div.item:hover { background-color:white; box-shadow:5px 5px 10px 5px gray; }
|
body.simple div.output.card div.item:hover { background-color:white; box-shadow:5px 5px 10px 5px gray; }
|
||||||
body.simple div.output.card div.item>div.title { border-bottom:solid 1px #e7e7e7; }
|
body.simple div.output.card div.item>div.title { border-bottom:solid 1px #e7e7e7; }
|
||||||
body.simple fieldset.feel.float { top:0 }
|
body.simple fieldset.feel.float { top:0; }
|
||||||
|
|
||||||
body.white.simple fieldset.Action { background-color:white; }
|
body.white.simple fieldset.Action { background-color:white; }
|
||||||
body.white.simple div.output.card input[type=button]:hover { box-shadow:2px 2px 8px 2px gray; }
|
body.white.simple div.output.card input[type=button]:hover { box-shadow:2px 2px 8px 2px gray; }
|
||||||
|
@ -33,7 +33,7 @@ body.white fieldset.inner>div.output div.content { background-color:#013b675c; }
|
|||||||
body.white fieldset.inner>div.output div.content td.text span.string { color:#a703a7; }
|
body.white fieldset.inner>div.output div.content td.text span.string { color:#a703a7; }
|
||||||
|
|
||||||
body.simple fieldset.inner>div.output td.content>div.tabs { background-color:#546E7A; padding:0px; height:31px; overflow:auto; display:block; }
|
body.simple fieldset.inner>div.output td.content>div.tabs { background-color:#546E7A; padding:0px; height:31px; overflow:auto; display:block; }
|
||||||
body.simple fieldset.inner>div.output td.content>div.tabs div.tabs { background-color:#69818d; font-family:monospace; padding:7px; height:18px; float:left; }
|
body.simple fieldset.inner>div.output td.content>div.tabs div.tabs { background-color:#69818d; font-family:monospace; padding:7px; height:17px; float:left; }
|
||||||
body.simple fieldset.inner>div.output td.content>div.tabs div.tabs.select { background-color:#455A64; box-shadow:0px 0px 5px 1px grey; }
|
body.simple fieldset.inner>div.output td.content>div.tabs div.tabs.select { background-color:#455A64; box-shadow:0px 0px 5px 1px grey; }
|
||||||
body.simple fieldset.inner>div.output td.content>div.path { background-color:#455A64; color:white; padding:4px 10px; margin-bottom:4px; box-shadow:0px 0px 5px 1px #90A4AE; display:block; clear:both; }
|
body.simple fieldset.inner>div.output td.content>div.path { background-color:#455A64; color:white; padding:4px 10px; margin-bottom:4px; box-shadow:0px 0px 5px 1px #90A4AE; display:block; clear:both; }
|
||||||
body.simple fieldset.inner>div.output div.content td.line { padding-top:4px; border-right:none; }
|
body.simple fieldset.inner>div.output div.content td.line { padding-top:4px; border-right:none; }
|
||||||
|
@ -11,6 +11,7 @@ Volcanos(chat.ONIMPORT, {help: "导入数据", _init: function(can, msg, cb, tar
|
|||||||
can.onimport._profile(can, can.ui.profile)
|
can.onimport._profile(can, can.ui.profile)
|
||||||
can.onimport._display(can, can.ui.display)
|
can.onimport._display(can, can.ui.display)
|
||||||
can.ui._content = can.ui.content
|
can.ui._content = can.ui.content
|
||||||
|
can.onimport._input(can)
|
||||||
|
|
||||||
switch (can.Mode()) {
|
switch (can.Mode()) {
|
||||||
case "simple": can.onimport._simple(can); break
|
case "simple": can.onimport._simple(can); break
|
||||||
@ -26,15 +27,19 @@ Volcanos(chat.ONIMPORT, {help: "导入数据", _init: function(can, msg, cb, tar
|
|||||||
}), can.onimport._keydown(can)
|
}), can.onimport._keydown(can)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (can.isCmdMode() && location.hash) { var args = can.core.Split(decodeURIComponent(location.hash).slice(1))
|
var hash = location.hash
|
||||||
can.onimport.tabview(can, can.Option(nfs.PATH), args[0], args[1])
|
can.isCmdMode() || (can.tabview[can.onexport.keys(can)] = msg)
|
||||||
} else { can.isCmdMode() || (can.tabview[can.onexport.keys(can)] = msg)
|
can.onimport.tabview(can, can.Option(nfs.PATH), can.Option(nfs.FILE), can.Option(nfs.LINE), function() {
|
||||||
can.onimport.tabview(can, can.Option(nfs.PATH), can.Option(nfs.FILE), can.Option(nfs.LINE))
|
if (can.isCmdMode() && hash) { var args = can.core.Split(decodeURIComponent(hash).slice(1))
|
||||||
}
|
can.onimport.tabview(can, can.Option(nfs.PATH), args[0], args[1])
|
||||||
|
}
|
||||||
|
})
|
||||||
can.base.isFunc(cb) && cb(msg)
|
can.base.isFunc(cb) && cb(msg)
|
||||||
},
|
},
|
||||||
|
_input: function(can) {
|
||||||
|
},
|
||||||
_project: function(can, target) {
|
_project: function(can, target) {
|
||||||
target._toggle = function(event) { can.onmotion.toggle(can, target), can.onimport.layout(can) }
|
target._toggle = function(event, show) { can.onimport.layout(can) }
|
||||||
},
|
},
|
||||||
_profile: function(can, target) {
|
_profile: function(can, target) {
|
||||||
var ui = can.page.Append(can, target, [html.ACTION, html.OUTPUT]); can.ui.profile_output = ui.output
|
var ui = can.page.Append(can, target, [html.ACTION, html.OUTPUT]); can.ui.profile_output = ui.output
|
||||||
@ -356,6 +361,142 @@ Volcanos(chat.ONSYNTAX, {help: "语法高亮", list: ["keyword", "prefix", "line
|
|||||||
p.suffix && can.core.Item(p.suffix, function(end, type) { if (can.base.endWith(line, end)) { line = wrap(type, line) } })
|
p.suffix && can.core.Item(p.suffix, function(end, type) { if (can.base.endWith(line, end)) { line = wrap(type, line) } })
|
||||||
return line
|
return line
|
||||||
},
|
},
|
||||||
|
go: {
|
||||||
|
keyword: {
|
||||||
|
"package": "keyword",
|
||||||
|
"import": "keyword",
|
||||||
|
"type": "keyword",
|
||||||
|
"struct": "keyword",
|
||||||
|
"interface": "keyword",
|
||||||
|
"const": "keyword",
|
||||||
|
"var": "keyword",
|
||||||
|
"func": "keyword",
|
||||||
|
|
||||||
|
"if": "keyword",
|
||||||
|
"else": "keyword",
|
||||||
|
"for": "keyword",
|
||||||
|
"range": "keyword",
|
||||||
|
"break": "keyword",
|
||||||
|
"continue": "keyword",
|
||||||
|
"switch": "keyword",
|
||||||
|
"case": "keyword",
|
||||||
|
"default": "keyword",
|
||||||
|
"fallthrough": "keyword",
|
||||||
|
"go": "keyword",
|
||||||
|
"select": "keyword",
|
||||||
|
"defer": "keyword",
|
||||||
|
"return": "keyword",
|
||||||
|
|
||||||
|
"false": "constant",
|
||||||
|
"true": "constant",
|
||||||
|
"nil": "constant",
|
||||||
|
"iota": "constant",
|
||||||
|
"-1": "constant",
|
||||||
|
"0": "constant",
|
||||||
|
"1": "constant",
|
||||||
|
"2": "constant",
|
||||||
|
"3": "constant",
|
||||||
|
|
||||||
|
"int": "datatype", "int8": "datatype", "int16": "datatype", "int32": "datatype", "int64": "datatype",
|
||||||
|
"uint": "datatype", "uint8": "datatype", "uint16": "datatype", "uint32": "datatype", "uint64": "datatype",
|
||||||
|
"float32": "datatype", "float64": "datatype", "complex64": "datatype", "complex128": "datatype",
|
||||||
|
"rune": "datatype", "string": "datatype", "byte": "datatype", "uintptr": "datatype",
|
||||||
|
"bool": "datatype", "error": "datatype", "chan": "datatype", "map": "datatype",
|
||||||
|
|
||||||
|
"msg": "function", "m": "function",
|
||||||
|
"init": "function", "main": "function", "print": "function", "println": "function", "panic": "function", "recover": "function",
|
||||||
|
"new": "function", "make": "function", "len": "function", "cap": "function", "copy": "function", "append": "function", "delete": "function", "close": "function",
|
||||||
|
"complex": "function", "real": "function", "imag": "function",
|
||||||
|
},
|
||||||
|
},
|
||||||
|
css: {
|
||||||
|
keyword: {
|
||||||
|
"body": "keyword",
|
||||||
|
"div": "keyword",
|
||||||
|
"span": "keyword",
|
||||||
|
"form": "keyword",
|
||||||
|
"fieldset": "keyword",
|
||||||
|
"legend": "keyword",
|
||||||
|
"select": "keyword",
|
||||||
|
"textarea": "keyword",
|
||||||
|
"input": "keyword",
|
||||||
|
"table": "keyword",
|
||||||
|
"tr": "keyword",
|
||||||
|
"th": "keyword",
|
||||||
|
"td": "keyword",
|
||||||
|
|
||||||
|
"background-color": "function",
|
||||||
|
"font-family": "function",
|
||||||
|
"font-weight": "function",
|
||||||
|
"font-size": "function",
|
||||||
|
"color": "function",
|
||||||
|
"width": "function",
|
||||||
|
"height": "function",
|
||||||
|
"padding": "function",
|
||||||
|
"border": "function",
|
||||||
|
"margin": "function",
|
||||||
|
"position": "function",
|
||||||
|
"left": "function",
|
||||||
|
"top": "function",
|
||||||
|
"right": "function",
|
||||||
|
"bottom": "function",
|
||||||
|
"display": "function",
|
||||||
|
"overflow": "function",
|
||||||
|
"float": "function",
|
||||||
|
"clear": "function",
|
||||||
|
"cursor": "function",
|
||||||
|
|
||||||
|
"z-index": "function",
|
||||||
|
"tab-size": "function",
|
||||||
|
"word-break": "function",
|
||||||
|
"white-space": "function",
|
||||||
|
"text-align": "function",
|
||||||
|
"vertical-align": "function",
|
||||||
|
"min-width": "function",
|
||||||
|
"max-width": "function",
|
||||||
|
"padding-left": "function",
|
||||||
|
"padding-top": "function",
|
||||||
|
"border-left": "function",
|
||||||
|
"border-top": "function",
|
||||||
|
"border-right": "function",
|
||||||
|
"border-bottom": "function",
|
||||||
|
"border-radius": "function",
|
||||||
|
"border-spacing": "function",
|
||||||
|
"margin-left": "function",
|
||||||
|
"margin-top": "function",
|
||||||
|
"margin-right": "function",
|
||||||
|
"margin-bottom": "function",
|
||||||
|
"box-shadow": "function",
|
||||||
|
|
||||||
|
"0": "constant",
|
||||||
|
"10px": "constant",
|
||||||
|
"20px": "constant",
|
||||||
|
"cyan": "constant",
|
||||||
|
"gray": "constant",
|
||||||
|
"yellow": "constant",
|
||||||
|
"black": "constant",
|
||||||
|
"white": "constant",
|
||||||
|
"blue": "constant",
|
||||||
|
"red": "constant",
|
||||||
|
"green": "constant",
|
||||||
|
"magenta": "constant",
|
||||||
|
|
||||||
|
"monospace": "constant",
|
||||||
|
"bold": "constant",
|
||||||
|
"solid": "constant",
|
||||||
|
"none": "constant",
|
||||||
|
"block": "constant",
|
||||||
|
"contexts": "constant",
|
||||||
|
"both": "constant",
|
||||||
|
"auto": "constant",
|
||||||
|
|
||||||
|
"center": "constant",
|
||||||
|
"relative": "constant",
|
||||||
|
"absolute": "constant",
|
||||||
|
"sticky": "constant",
|
||||||
|
"fixed": "constant",
|
||||||
|
},
|
||||||
|
},
|
||||||
})
|
})
|
||||||
Volcanos(chat.ONKEYMAP, {help: "导入数据",
|
Volcanos(chat.ONKEYMAP, {help: "导入数据",
|
||||||
_mode: {
|
_mode: {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
Volcanos(chat.ONIMPORT, {help: "导入数据", _init: function(can, msg, cb, target) {
|
Volcanos(chat.ONIMPORT, {help: "导入数据", _init: function(can, msg, cb, target) {
|
||||||
can.require(["inner.js"], function(can) { can.onimport.inner_init(can, msg, function() { can.undo = [], can.redo = []
|
can.require(["inner.js"], function(can) { can.onimport.inner_init(can, msg, function() { can.undo = [], can.redo = []
|
||||||
can.onimport._input(can), can.onkeymap._build(can), can.onkeymap._plugin({}, can)
|
can.onkeymap._build(can), can.onkeymap._plugin({}, can)
|
||||||
can.base.isFunc(cb) && cb(msg)
|
can.base.isFunc(cb) && cb(msg)
|
||||||
}, target) } , function(can, name, sub) { name == chat.ONIMPORT && (can.onimport.inner_init = sub._init)
|
}, target) } , function(can, name, sub) { name == chat.ONIMPORT && (can.onimport.inner_init = sub._init)
|
||||||
if (name == chat.ONACTION) { can._trans = can.base.Copy(can._trans||{}, sub._trans) }
|
if (name == chat.ONACTION) { can._trans = can.base.Copy(can._trans||{}, sub._trans) }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user