mirror of
https://shylinux.com/x/volcanos
synced 2025-04-25 08:48:06 +08:00
add some
This commit is contained in:
parent
8f3c12ee99
commit
50302be95a
@ -458,18 +458,18 @@ Volcanos(chat.ONACTION, {
|
||||
msg.Append(nfs.FILE)? can.onimport.tabview(can, msg.Append(nfs.PATH), msg.Append(nfs.FILE), msg.Append(nfs.LINE)): can.user.toastFailure(can, "not found "+value)
|
||||
})
|
||||
}), can.page.Select(can, tr, "td.text", function(td) { offset += td.innerText.length+1 })
|
||||
}) },
|
||||
show: function(event, can) { can._msg._profile_hidden = false, can.runAction(can.request(event, {_toast: "渲染中...", args: can.onexport.session(can, PROFILE_ARGS+can.Option(nfs.PATH)+can.Option(nfs.FILE))}), mdb.RENDER, [can.onexport.parse(can), can.Option(nfs.FILE), can.Option(nfs.PATH)], function(msg) { can.onimport.profile(can, msg) }) },
|
||||
exec: function(event, can) { can.runAction(can.request(event, {_toast: "执行中...", args: can.onexport.session(can, DISPLAY_ARGS+can.Option(nfs.PATH)+can.Option(nfs.FILE))}), mdb.ENGINE, [can.onexport.parse(can), can.Option(nfs.FILE), can.Option(nfs.PATH)], function(msg) { can.onimport.display(can, msg) }) },
|
||||
plug: function(event, can, button) {
|
||||
}) },
|
||||
show: function(event, can) { can._msg._profile_hidden = false, can.runAction(can.request(event, {_toast: "渲染中...", args: can.onexport.session(can, PROFILE_ARGS+can.Option(nfs.PATH)+can.Option(nfs.FILE))}), mdb.RENDER, [can.onexport.parse(can), can.Option(nfs.FILE), can.Option(nfs.PATH)], function(msg) { can.onimport.profile(can, msg) }) },
|
||||
exec: function(event, can) { can.runAction(can.request(event, {_toast: "执行中...", args: can.onexport.session(can, DISPLAY_ARGS+can.Option(nfs.PATH)+can.Option(nfs.FILE))}), mdb.ENGINE, [can.onexport.parse(can), can.Option(nfs.FILE), can.Option(nfs.PATH)], function(msg) { can.onimport.display(can, msg) }) },
|
||||
plug: function(event, can, button) {
|
||||
function show(index, args) { input.cancel(); can.onimport.toolkit(can, {index: index, args: can.core.Split(args||"")}, function(sub) { sub.select() }) }
|
||||
var input = can.user.input(can.request(event, {type: button}), can, [{type: html.TEXT, name: ctx.INDEX, run: function(event, cmds, cb) { can.run(event, cmds, function(msg) {
|
||||
if (cmds[0] == ctx.ACTION && cmds[1] == mdb.INPUTS && cmds[2] == ctx.INDEX) { var _msg = can.request({})
|
||||
can.core.Item(can.db.toolkit, function(index) { _msg.Push(ctx.INDEX, index) }), _msg.Push(ctx.INDEX, ""), _msg.Copy(msg), cb(_msg)
|
||||
} else { cb(msg) }
|
||||
}, true) }}, ctx.ARGS], function(list) { show(list[0], list[1]) })
|
||||
},
|
||||
open: function(event, can, button) {
|
||||
},
|
||||
open: function(event, can, button) {
|
||||
console.log(new Error())
|
||||
var left = can._output.offsetWidth/4, width = can._output.offsetWidth/2; if (can.user.isMobile) { left = 0, width = can.page.width()-40 }
|
||||
var input = can.user.input(can.request(event, {type: button}), can, [{name: nfs.FILE, style: {width: width}, _force: true, select: function(item) { input.submit(event, can, web.SUBMIT) }, run: function(event, cmds, cb) {
|
||||
@ -490,8 +490,8 @@ Volcanos(chat.ONACTION, {
|
||||
default: var ls = can.onexport.split(can, list[0]); can.onimport.tabview(can, ls[0], ls[1])
|
||||
} }); can.page.Modify(can, input._target, {className: "input inner open float"})
|
||||
can.page.style(can, input._target, html.LEFT, left, html.TOP, can._output.offsetHeight/4, html.RIGHT, "")
|
||||
},
|
||||
find: function(event, can) { var last = can.onexport.line(can, can.current.line)
|
||||
},
|
||||
find: function(event, can) { var last = can.onexport.line(can, can.current.line)
|
||||
var ui = can.page.Append(can, can._output, [{view: "input inner find float", list: [html.ACTION, html.OUTPUT],
|
||||
style: {left: can.ui.project.offsetWidth+can._output.offsetWidth/4-34, top: can._output.offsetHeight/2-60}}]); can.onmotion.move(can, ui._target)
|
||||
function find(begin, text) { for (begin; begin <= can.ui.content._max; begin++) { if (can.onexport.text(can, can.onaction._getLine(can, begin)).indexOf(text) > -1) {
|
||||
@ -529,13 +529,13 @@ Volcanos(chat.ONACTION, {
|
||||
can.current.text(text.replace(from.value, to.value)), can.current.text().indexOf(from.value) == -1, find(last+1, from.value)
|
||||
}, close: function() { can.page.Remove(can, ui._target) },
|
||||
})
|
||||
},
|
||||
clear: function(event, can) { if (can.onmotion.clearFloat(can)) { return }
|
||||
},
|
||||
clear: function(event, can) { if (can.onmotion.clearFloat(can)) { return }
|
||||
if (can.page.Select(can, document.body, "div.vimer.find.float", function(target) { return can.page.Remove(can, target) }).length > 0) { return }
|
||||
if (can.page.Select(can, can.ui.plug, "legend.select", function(target) { return target.click(), target }).length > 0) { return }
|
||||
if (can.page.isDisplay(can.ui.display)) { return can.onmotion.hidden(can, can.ui.display), can.onimport.layout(can) }
|
||||
if (can.page.isDisplay(can.ui.profile)) { return can.onmotion.hidden(can, can.ui.profile), can.onimport.layout(can) }
|
||||
},
|
||||
},
|
||||
})
|
||||
Volcanos(chat.ONEXPORT, {
|
||||
path: function(can) { return can.Option(nfs.PATH)+can.Option(nfs.FILE) },
|
||||
@ -543,33 +543,29 @@ Volcanos(chat.ONEXPORT, {
|
||||
text: function(can, line) { return can.core.Value(can.page.SelectOne(can, line, "td.text"), "innerText") },
|
||||
size: function(can, size, full) { if (size > 1) { return size } if (size > 0) { return size*full } },
|
||||
keys: function(can, path, file) { return [path||can.Option(nfs.PATH), file||can.Option(nfs.FILE)].join(nfs.DF) },
|
||||
content: function(can) {
|
||||
var parse = can.onexport.parse(can)
|
||||
var deep = 0
|
||||
content: function(can) { var block = "()[]{}", deep = 0, parse = can.onexport.parse(can)
|
||||
return can.page.Select(can, can.current&&can.current.content||can.ui.content, "td.text", function(item) { var text = item.innerText.trimEnd()
|
||||
if (parse == "js" && !can.base.beginWith(text, "(")) { var list = []
|
||||
if (parse == "js" && !can.base.beginWith(text, block[0])) { var list = []
|
||||
for (var i = 0; i < text.length; i++) {
|
||||
if (text[i] == "{") {
|
||||
for (var j = 0; j < block.length; j += 2) {
|
||||
if (text[i] == block[j]) {
|
||||
list.push(text[i])
|
||||
} else if (text[i] == "}") {
|
||||
if (list[list.length-1] == "{") { list.pop() } else { list.push(text[i]) }
|
||||
}
|
||||
if (text[i] == "(") {
|
||||
break
|
||||
} else if (text[i] == block[j+1]) {
|
||||
if (list[list.length-1] == block[j]) {
|
||||
list.pop()
|
||||
} else {
|
||||
list.push(text[i])
|
||||
} else if (text[i] == ")") {
|
||||
if (list[list.length-1] == "(") { list.pop() } else { list.push(text[i]) }
|
||||
}
|
||||
if (text[i] == "[") {
|
||||
list.push(text[i])
|
||||
} else if (text[i] == "]") {
|
||||
if (list[list.length-1] == "[") { list.pop() } else { list.push(text[i]) }
|
||||
break
|
||||
}
|
||||
}
|
||||
if (list.indexOf("}") > -1) { deep-- } else if (list.indexOf("]") > -1) { deep-- } else if (list.indexOf(")") > -1) { deep-- }
|
||||
}
|
||||
for (var j = 0; j < block.length; j += 2) { if (list.indexOf(block[j+1]) > -1) { deep--; break } }
|
||||
if (deep < 0) { deep = 0 }
|
||||
text = "\t".repeat(deep < 0? 0: deep)+text.trimStart()
|
||||
can.base.beginWith(text, "+") && (text = "\t"+text)
|
||||
if (list.indexOf("{") > -1) { deep++ } else if (list.indexOf("[") > -1) { deep++ } else if (list.indexOf("(") > -1) { deep++ }
|
||||
for (var j = 0; j < block.length; j += 2) { if (list.indexOf(block[j]) > -1) { deep++; break } }
|
||||
}
|
||||
return text
|
||||
}).join(lex.NL)
|
||||
|
@ -66,8 +66,8 @@ Volcanos(chat.ONIMPORT, {
|
||||
var target = document.createElementNS("http://www.w3.org/2000/svg", type)
|
||||
return group.appendChild(can.onimport._block(can, target)), target.Value(value), target
|
||||
},
|
||||
group: function(can, name, value, group) { var target = can.onimport.block(can, svg.G, value, group||can.ui.svg)
|
||||
return target.Value(html.CLASS, name), can.onimport._project(can, target), target
|
||||
group: function(can, name, value, group) { var target = can.onimport.block(can, svg.G, {}, group||can.ui.svg)
|
||||
return target.Value(html.CLASS, name), target.Value(value), can.onimport._project(can, target), target
|
||||
},
|
||||
draw: function(can, meta, group) { group = group||can.ui.svg
|
||||
var figure = can.onfigure[meta.shape], data = figure.draw({}, can, meta.points, meta.style||{}); can.core.Item(meta.style, function(key, value) { data[key] = value })
|
||||
@ -81,7 +81,8 @@ Volcanos(chat.ONIMPORT, {
|
||||
})
|
||||
},
|
||||
})
|
||||
Volcanos(chat.ONACTION, {list: [
|
||||
Volcanos(chat.ONACTION, {
|
||||
list: [
|
||||
[svg.GO, ctx.RUN, ice.AUTO, "manual"], [ice.MODE, web.DRAW, html.MOVE, html.RESIZE],
|
||||
[svg.SHAPE, svg.RECT, svg.LINE, svg.TEXT, svg.BLOCK, svg.CIRCLE, svg.ELLIPSE],
|
||||
[svg.STROKE_WIDTH, svg.STROKE_WIDTH, 1, 2, 3, 4, 5],
|
||||
@ -253,7 +254,8 @@ Volcanos(chat.ONEXPORT, {list: [svg.GROUP, svg.FIGURE, ctx.INDEX, "pos"],
|
||||
can.Status(svg.GROUP, target.Groups()||can.ui.group.Groups()||html.SVG)
|
||||
can.Status(ctx.INDEX, target.Value(ctx.INDEX)||"")
|
||||
},
|
||||
content: function(can, target) { return ['<svg xmlns="https://www.w3.org/2000/svg" vertion="1.1" text-anchor="middle" dominant-baseline="middle"'].concat(
|
||||
content: function(can, target) {
|
||||
return ['<svg xmlns="https://www.w3.org/2000/svg" vertion="1.1" text-anchor="middle" dominant-baseline="middle"'].concat(
|
||||
target? can.core.List([mdb.COUNT, svg.PID], function(item) { return target.Value(item)? can.base.joinKV([item, target.Value(item)], mdb.EQ): ""}).join(lex.SP): "").concat([">", target? target.innerHTML: "", "</svg>"]).join("")
|
||||
},
|
||||
grid: function(can) { var grid = can.Action(svg.GRID); return grid == svg.GRID || grid == ice.AUTO? 10: grid },
|
||||
|
Loading…
x
Reference in New Issue
Block a user