1
0
forked from x/volcanos

opt vimer.js

This commit is contained in:
harveyshao 2023-01-26 20:51:17 +08:00
parent 00394e2c84
commit dabcaa5421
12 changed files with 193 additions and 206 deletions

View File

@ -109,7 +109,7 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) {
Status: function(key, value) { if (can.base.isObject(key)) { return can.core.Item(key, sub.Status), key }
can.page.Select(can, status, [[[html.SPAN, key]]], function(target) {
if (can.base.beginWith(value, ice.PS, ice.HTTP)) { value = can.page.Format(html.A, value) }
return can.base.isUndefined(value)? (value = target.innerHTML): (target.innerHTML = value)
return can.base.isUndefined(value)? (value = target.innerHTML): (target.innerHTML = value||"")
}); return value
},
Action: function(key, value) { return can.page.SelectArgs(can, action, key, value)[0] },
@ -178,7 +178,7 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) {
_output0: function(can, meta, event, cmds, cb, silent) { var msg = can.request(event); if (msg.RunAction(event, can, cmds)) { return }
if (msg.Option(ice.MSG_HANDLE) != ice.TRUE && cmds && cmds[0] == ctx.ACTION && meta.feature[cmds[1]]) { var msg = can.request(event, {action: cmds[1]})
if (can.base.isFunc(meta.feature[cmds[1]])) { return meta.feature[cmds[1]](can, msg, cmds.slice(2)) }
return can.user.input(event, can, meta.feature[cmds[1]], function(args) { can.Update(can.request(event, {_handle: ice.TRUE}, can.Option()), cmds.slice(0, 2).concat(args)) })
return can.user.input(event, can, meta.feature[cmds[1]], function(args) { can.Update(can.request(event, {_handle: ice.TRUE}, can.Option()), cmds.slice(0, 2).concat(args), cb) })
}
return can.onengine._plugin(event, can, msg, can, cmds, cb) || can.run(event, cmds, cb||function(msg) { if (silent) { return } var _can = can._fields? can.sup: can
if (_can == (msg._can._fields? msg._can._fields.sup: msg._can._fields) && can.core.CallFunc([_can, chat.ONIMPORT, ice.MSG_PROCESS], {can: _can, msg: msg})) { return }
@ -260,6 +260,7 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) {
{type: "div.zone div.item>div.name", name: [html.HOVER], style: _fg(color.text)},
{type: "tr.line.select", style: [ITEM_HOVER_STYLE]}, {type: "tr.line", style: [ITEM_HOVER_STYLE]},
{type: "tr.line>td.line", style: [OUTPUT_STYLE]}, {type: "tr.line.select>td.line", style: [ITEM_HOVER_STYLE]},
{type: "div.complete>table", style: [TABLE_HEAD_STYLE]},
{type: html.TABLE_CONTENT, list: [{type: html.TR, style: [TABLE_ROW_HOVER_STYLE]}]},
{type: html.TABLE_CONTENT, list: [{type: html.TH, style: [TABLE_HEAD_STYLE]}]},
{type: html.TABLE_CONTENT, name: [html.ACTION], list: [{type: html.TD+":last-child", style: [TABLE_HEAD_STYLE]}]},
@ -440,8 +441,13 @@ Volcanos(chat.ONLAYOUT, {_init: function(can, target) { target = target||can._ro
figure: function(event, can, target, right) { if (!event || !event.target) { return {} } target = target||can._fields||can._target
var rect = event.target == document.body? {left: can.page.width()/2, top: can.page.height()/2, right: can.page.width()/2, bottom: can.page.height()/2}: event.target.getBoundingClientRect()
var layout = right? {left: rect.right, top: rect.top}: {left: rect.left, top: rect.bottom}
if (right) {
for (var p = event.target; p != document.body; p = p.parentNode) {
var _right = p.clientLeft+p.clientWidth+10; if (_right < layout.left) { layout.left = _right }
}
}
can.getActionSize(function(left, top, width, height) { left = left||0, top = top||0, height = can.base.Max(height, can.page.height()-top)
can.page.style(can, target, html.MAX_HEIGHT, can.base.Max(top+height-layout.top, height/4*3))
can.page.style(can, target, html.MAX_HEIGHT, can.base.Max(top+height-layout.top, height/2))
if (layout.top+target.offsetHeight > top+height) { layout.top = top+height-target.offsetHeight }
if (layout.left+target.offsetWidth > left+width) { layout.left = left+width-target.offsetWidth }
}); return can.onmotion.move(can, target, layout), layout
@ -545,6 +551,9 @@ Volcanos(chat.ONMOTION, {_init: function(can, target) {
can.page.style(can, target, html.WIDTH, _target.offsetWidth+10, html.LEFT, (window.innerWidth-_target.offsetWidth)/2)
}) }) },
delayLong: function(can, cb, interval, key) { can.onmotion.delay(can, cb, interval||300, key) },
delayOnce: function(can, cb, interval, list) { can.core.Item(list, function(key) { delete(list[key]) })
var key = can.base.Time(null, "%H:%M:%S.%s"); can.onmotion.delay(can, list[key] = function() { list[key] && cb() }, interval)
},
delay: function(can, cb, interval, key) { if (!key) { return can.core.Timer(interval||30, cb) }
can._delay_list = can._delay_list||shy({}, [])
var last = can._delay_list.meta[key]||0, self = can._delay_list.meta[key] = can._delay_list.list.push(cb)

View File

@ -16,10 +16,10 @@ Volcanos("base", {
} return to
} for (var i = 2; i < arguments.length; i++) { var k = arguments[i]; to[k] = from[k] } return to
},
Eq: function(to, from) { var call = arguments.callee; if (typeof to != typeof from) { return false }
Eq: function(to, from, skip) { var call = arguments.callee; if (typeof to != typeof from) { return false }
if (typeof to == lang.OBJECT) { if (to.length != from.length) { return false }
for (var i = 0; i < to.length; i++) { if (!call(to[i], from[i])) { return false } }
for (var k in to) { if (!call(to[k], from[k])) { return false } }
for (var k in to) { if (k != skip && !call(to[k], from[k])) { return false } }
return true
} return to === from
},
@ -95,6 +95,7 @@ Volcanos("base", {
fmt = fmt.replace("%H", this.Number(now.getHours(), 2))
fmt = fmt.replace("%M", this.Number(now.getMinutes(), 2))
fmt = fmt.replace("%S", this.Number(now.getSeconds(), 2))
fmt = fmt.replace("%s", this.Number(now.getMilliseconds(), 3))
return fmt
},
Date: function(time) { var now = new Date()

View File

@ -183,6 +183,11 @@ Volcanos("misc", {Message: function(event, can) { var msg = {}
var _location = location; if (can.user.isExtension) { var _location = new URL(Volcanos.meta.iceberg) }
return can.base.MergeURL(_location.origin+path+(clear?"":_location.search), objs)
},
ParseURL: function(can, url) { var _url = can.base.ParseURL(url)
var _ls = (_url._origin.split("/chat/")[1]||"").split(ice.PS)
for (var i = 0; i < _ls.length; i += 2) { _url[_ls[i]] = _ls[i+1] }
return _url
},
SearchOrConf: function(can, key, def) { return can.base.getValid(can.misc.Search(can, key), can.Conf(key), def) },
SearchHash: function(can) { if (!can.isCmdMode()) { return [] }
if (arguments.length > 1) { location.hash = encodeURIComponent(can.core.List(arguments).slice(1).join(ice.FS)) }

View File

@ -97,12 +97,11 @@ Volcanos("user", {info: {}, agent: {
can.onmotion.focus(can, input), document.execCommand("Copy"), can.page.Remove(can, input)
return can.user.toastSuccess(can, text, "copy success"), can.misc.Log(nfs.COPY, text), text
},
carte: function(event, can, meta, list, cb, parent, trans) {
carte: function(event, can, meta, list, cb, parent, trans) { parent || can.onmotion.clearCarte(can)
meta = meta||can.ondetail||can.onaction||{}, list = can.base.getValid(list, meta.list, can.core.Item(meta)); if (!list || list.length == 0) { return }
function click(event, button) { can.misc.Event(event, can, function(msg) {
function click(event, button) { can.misc.Event(event, can, function(msg) { can.onkeymap.prevent(event)
meta[button]? meta[button](event, can, button): can.base.isFunc(cb)? cb(event, button, meta, carte):
can.core.CallFunc([can.onaction, button], [event, can, button])// , can.page.Remove(can, ui._target)
can.onkeymap.prevent(event)
can.core.CallFunc([can.onaction, button], [event, can, button]), can.page.Remove(can, ui._target)
}) }
function remove_sub(carte) { carte._sub && can.page.Remove(can, carte._sub._target), delete(carte._sub) }
var ui = can.page.Append(can, document.body, [{view: [[chat.CARTE, meta._style||"", chat.FLOAT]], list: can.core.List(list, function(item, index) {

View File

@ -32,6 +32,7 @@ Volcanos(chat.ONFIGURE, {key: {
if (event.key == lang.ESCAPE) { return last(event) }
if (sub.hidden()) { return }
can.onkeymap.selectCtrlN(event, can, sub._output, "tr:not(.hidden)>td:first-child", function(td) { return cb(sub, td.innerText, target.value), td })
|| can.onkeymap.selectInputs(event, sub, function() { sub._load(event, sub, cb, target, meta.name) }, target)
|| can.onmotion.delayOnce(can, function() { can.onkeymap.selectInputs(event, sub, function() { sub._load(event, sub, cb, target, meta.name) }, target) },
target.value.length < 3? 500: 150, sub._delay_select = sub._delay_select||{})
},
}})

View File

@ -72,6 +72,7 @@ body.dark fieldset.inner>div.output div.content td.text span.object { color:gold
body.mobile fieldset.inner>form.option input[name=file] { width:90px; }
body.mobile fieldset.word fieldset.inner>form.option input[type=text] { display:none; }
div.carte.history.float * { tab-size:2; }
div.vimer.find.float div.item>span.icon { margin-left:-20px; margin-right:10px; visibility:hidden; }
div.vimer.find.float div.item:hover>span.icon { visibility:visible; }
div.vimer.open.float td:first-child { display:none; }

View File

@ -1,3 +1,5 @@
(function() { const CURRENT_FILE = "web.code.inner:currentFile", SELECT_LINE = "web.code.inner.selectLine"
const VIEW_CREATE = "tabview.view.create", VIEW_REMOTE = "tabview.view.remove", LINE_SELECT = "tabview.line.select"
Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb, target) { can.onmotion.clear(can), can.onappend.style(can, code.INNER)
if (msg.Option(nfs.FILE)) { can.Option(nfs.FILE, msg.Option(nfs.FILE))
msg.Option(nfs.PATH) && can.Option(nfs.PATH, msg.Option(nfs.PATH))
@ -6,7 +8,6 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb, target) { can.onmotion.cl
var files = can.core.Split(can.Option(nfs.FILE), ice.FS); can.Option(nfs.FILE, files[0])
var paths = can.core.Split(can.Option(nfs.PATH), ice.FS); can.Option(nfs.PATH, paths[0])
can.core.List(paths.concat(can.core.Split(msg.Option(nfs.REPOS))), function(p) {
if (can.base.endWith(p, "-story/", "-dict/")) { return }
if (p && paths.indexOf(p) == -1 && p[0] != ice.PS) { paths.push(p) }
})
can.db = {paths: paths, tabview: {}, _history: [], history: [], profile_size: {}, display_size: {}, toolkit: {}}, can.onengine.plugin(can, can.onplugin)
@ -22,7 +23,7 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb, target) { can.onmotion.cl
default: can.onimport.project(can, paths), can.onimport._tabs(can)
can.onmotion.delay(can, function() { can.core.Next(files.slice(1), function(file, next) { can.onimport._tabview(can, paths[0], file, "", next) }, function() {
can.core.List(can.base.Obj(msg.Option(html.TABS)), function(item) { can.onimport.tabview(can, paths[0], item, ctx.INDEX) })
if (can.user.isWebview) { var last = can.misc.localStorage(can, "web.code.inner:currentFile"); if (last) {
if (can.user.isWebview) { var last = can.misc.localStorage(can, CURRENT_FILE); if (last) {
var ls = can.core.Split(last, ice.DF); ls.length > 0 && can.onimport._tabview(can, ls[0], ls[1], ls[2])
} }
}) })
@ -37,10 +38,20 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb, target) { can.onmotion.cl
}) },
_tabs: function(can) { if (!can.isCmdMode()) { return can.ui.tabs = can._action }
can.core.List([{name: can.page.unicode.menu, onclick: function() { can.user.carte(event, can, can.onaction, can.onaction.list) }},
{name: "\u25C0", style: {"font-size": "14px", "margin-top": "3px"}, onclick: function() { can.onaction.back(can) }},
{name: "\u25C0", style: {"font-size": "14px", "margin-top": "3px"}, onclick: function(event) {
var list = {}; can.user.carte(event, can, {_style: "history"}, can.core.List(can.db.history, function(item) {
var value = [item.path, item.file, item.line, ice.TB+(item.text&&item.text.length>30? item.text.slice(0, 30)+"...": item.text||"")].join(ice.DF); if (!list[value]) { list[value] = item; return value }
}).reverse(), function(event, button, meta, carte) { carte.close()
var ls = button.split(ice.DF); can.onimport.tabview(can, ls[0], ls[1], ls[2])
})
}},
{name: "\u21BB", style: {"font-size": "24px", "margin-top": "0px"}, onclick: function() { location.reload() }},
{name: "\u25B6", style: {"font-size": "14px", "margin-top": "3px"}, onclick: function() { can.onaction.reback(can) }},
], function(item) { can.page.Append(can, can.ui.tabs, [{view: [[html.ICON, web.WEBSITE], html.DIV, item.name], style: item.style, onclick: item.onclick}]) })
{name: "\u25B6", style: {"font-size": "14px", "margin-top": "3px"}, onclick: function() {
var list = {}; can.user.carte(event, can, {_style: "tabview"}, can.core.Item(can.db.tabview), function(event, button, meta, carte) { carte.close()
var ls = button.split(ice.DF); can.onimport.tabview(can, ls[0], ls[1])
})
}},
], function(item) { can.page.Append(can, can.ui.tabs, [can.base.Copy(item, {view: [[html.ICON, web.WEBSITE], html.DIV, item.name]})]) })
can.user.isMobile || can.page.Append(can, can.ui.tabs, [{view: mdb.TIME, _init: function(target) {
can.core.Timer({interval: 100}, function() { can.page.Modify(can, target, can.user.time(can, null, "%y-%m-%d %H:%M:%S %w")) })
can.onappend.figure(can, {action: "date", _hold: true}, target, function(sub, value) {})
@ -91,7 +102,7 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb, target) { can.onmotion.cl
tabview: function(can, path, file, line, cb) { var key = can.onexport.keys(can, path, file)
function isIndex() { return line == ctx.INDEX } function isDream() { return line == web.DREAM }
function show(skip) { can._msg && can._msg.Option(nfs.LINE, can.Option(nfs.LINE)), can._msg = can.db.tabview[key]
can.Option(can.onimport.history(can, {path: path, file: file, line: line||can.misc.sessionStorage(can, "web.code.inner:selectLine:"+path+file)||can._msg.Option(nfs.LINE)||1}))
can.Option(can.onimport.history(can, {path: path, file: file, line: line||can.misc.sessionStorage(can, SELECT_LINE+ice.DF+path+file)||can._msg.Option(nfs.LINE)||1}))
can.onsyntax._init(can, can._msg, function(content) { var msg = can._msg; can.onexport.hash(can)
can.isCmdMode() && can.onexport.title(can, path+file), can.onmotion.select(can, can.ui.tabs, html.DIV_TABS, msg._tab), can.isCmdMode() && msg._tab.scrollIntoView()
if (isIndex()) {
@ -115,9 +126,9 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb, target) { can.onmotion.cl
can.page.SelectChild(can, can.ui._content.parentNode, can.page.Keys(html.DIV_PROFILE, [[[html.IFRAME, html.PROFILE]]]), function(target) {
if (can.onmotion.toggle(can, target, target == msg._profile)) { can.ui.profile = msg._profile }
}), can.onimport.layout(can), can.ui.current && can.onmotion.toggle(can, can.ui.current, !isIndex() && !isDream())
skip || can.onaction.selectLine(can, can.Option(nfs.LINE), true), can.base.isFunc(cb) && cb(), cb = null
skip? can.onaction.scrollIntoView(can): can.onaction.selectLine(can, can.Option(nfs.LINE), true), can.base.isFunc(cb) && cb(), cb = null
var ls = can.db.file.split(ice.PS); if (ls.length > 4) { ls = [ls.slice(0, 2).join(ice.PS)+"/.../"+ls.slice(-2).join(ice.PS)] }
can.Status(kit.Dict("文件", ls.join(ice.PS), "类型", can.db.parse))
can.Status(kit.Dict(nfs.FILE, ls.join(ice.PS), mdb.TYPE, can.db.parse))
})
}
function load(msg) { var skip = false; can.db.tabview[key] = msg
@ -125,7 +136,7 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb, target) { can.onmotion.cl
can.onaction[button](event, can, button)
})}], function(event, tabs) {
can._tab = msg._tab = tabs._target, show(skip), skip = true
}, function(tabs) { can.onengine.signal(can, "tabview.view.remove", msg)
}, function(tabs) { can.onengine.signal(can, VIEW_REMOVE, msg)
msg._content != can.ui._content && can.page.Remove(can, msg._content), msg._profile != can.ui._profile && can.page.Remove(can, msg._profile)
delete(can.ui._content._cache[key]), delete(can.ui._profile._cache[key]), delete(can.ui.display._cache[key])
delete(can._cache_data[key]), delete(can.db.tabview[key])
@ -134,8 +145,9 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb, target) { can.onmotion.cl
if (can.db.tabview[key]) { return !can._msg._tab && !can.isSimpleMode()? load(can.db.tabview[key]): show() }
isIndex()||isDream()? load(can.request({}, {index: file, line: line})): can.run({}, [path, file], load, true)
},
history: function(can, record) { can.base.Eq(record, can.db.history[can.db.history.length-1]) || can.db.history.push(record)
return can.Status("跳转", can.db.history.length), record
history: function(can, record) {
can.base.Eq(record, can.db.history[can.db.history.length-1], mdb.TEXT) || can.db.history.push(record)
return can.Status(ice.BACK, can.db.history.length), record
},
project: function(can, path) {
can.onimport.zone(can, can.core.Item(can.onfigure, function(name, cb) {
@ -199,6 +211,7 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb, target) { can.onmotion.cl
sub.onexport.record = function(sub, value, key, line) { if (!line.file && !line.line) { return }
can.onimport.tabview(can, line.path||can.Option(nfs.PATH), can.base.trimPrefix(line.file, nfs.PWD)||can.Option(nfs.FILE), parseInt(line.line))
}, sub.onaction.close = sub.select = function() { return sub._legend.click(), sub }
sub.hidden = function() { can.onmotion.hidden(can, sub._target), can.page.ClassList.del(can, sub._legend, html.SELECT) }
sub.onimport.size(sub, can.ConfHeight()/2, can.ConfWidth()-can.ui.project.offsetWidth, true), can.base.isFunc(cb) && cb(sub)
}, can.ui.plug.parentNode)
},
@ -215,10 +228,8 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb, target) { can.onmotion.cl
sub.run = function(event, cmds, cb) {
if (cmds.length > 0 && cmds[0] == ctx.ACTION) {
can.run(can.request(event, can.Option()), cmds, cb||function(msg) { can.onappend._output(sub, msg, sub.Conf(ctx.DISPLAY)) }, true)
} else {
can.onappend._output(sub, can.request(event), sub.Conf(ctx.DISPLAY))
}
}, can.db.toolkit[url.split("?")[0]] = sub, can.base.isFunc(cb)? cb(sub): sub.select()
} else { can.onappend._output(sub, can.request(event), sub.Conf(ctx.DISPLAY)) }
}, can.db.toolkit[url.split("?")[0]] = sub, can.base.isFunc(cb)? cb(sub): sub.select(), can.page.Modify(can, sub._legend, url)
})
},
}, [""])
@ -255,12 +266,12 @@ Volcanos(chat.ONSYNTAX, {_init: function(can, msg, cb) {
can.db.file = can.onexport.keys(can, can.Option(nfs.PATH), can.Option(nfs.FILE)); var p = cache_data[can.db.file]; if (p) {
can.db.max = p.max, can.current = p.current, can.ui.profile.className = p.profile, can.ui.display.className = p.display
} else { can.onmotion.hidden(can, can.ui.profile), can.onmotion.hidden(can, can.ui.display) }
can.db.parse = can.base.Ext(can.db.file), can.Status("模式", mdb.PLUGIN); return can.db.file
can.db.parse = can.base.Ext(can.db.file), can.Status(ice.MODE, mdb.PLUGIN); return can.db.file
}, can.ui._content, can.ui._profile, can.ui._display)) { return can.base.isFunc(cb) && cb(msg._content) }
if (msg.Option(ctx.INDEX)) { return can.onsyntax._index(can, msg, cb) }
function init(p) { msg._can = can
can.db.max = 0, can.core.List(msg.Result().split(ice.NL), function(item) { can.onaction.appendLine(can, item) })
can.onengine.signal(can, "tabview.view.create", msg), can.base.isFunc(cb) && cb(msg._content = can.ui._content)
can.onengine.signal(can, VIEW_CREATE, msg), can.base.isFunc(cb) && cb(msg._content = can.ui._content)
} can.require(["inner/syntax.js"], function() { can.Conf(chat.PLUG) && (can.onsyntax[can.db.parse] = can.Conf(chat.PLUG))
var p = can.onsyntax[can.db.parse]; !p? can.runAction({}, mdb.PLUGIN, [can.db.parse, can.Option(nfs.FILE), can.Option(nfs.PATH)], function(msg) {
init(p = can.onsyntax[can.db.parse] = can.base.Obj(msg.Result()||"{}"))
@ -305,7 +316,7 @@ Volcanos(chat.ONSYNTAX, {_init: function(can, msg, cb) {
}).join("")); return line
},
})
Volcanos(chat.ONACTION, {list: ["首页", "官网", "调试", "百度"],
Volcanos(chat.ONACTION, {list: ["首页", "官网", "调试", "百度", "录屏", "编辑器", "浏览器"],
_getLine: function(can, line) { return can.page.Select(can, can.ui.content, "tr.line>td.line", function(td, index) { if (td.parentNode == line || index+1 == line) { return td.parentNode } })[0] },
_getLineno: function(can, line) { return can.page.Select(can, can.ui.content, "tr.line>td.line", function(td, index) { if (td.parentNode == line || index+1 == line) { return index+1 } })[0] },
appendLine: function(can, value) { var ui = can.page.Append(can, can.ui._content, [{view: [nfs.LINE, html.TR], list: [
@ -324,7 +335,7 @@ Volcanos(chat.ONACTION, {list: ["首页", "官网", "调试", "百度"],
selectLine: function(can, line, scroll) { if (!line) { return can.onexport.line(can, can.page.SelectOne(can, can.ui._content, "tr.select")) }
can.page.Select(can, can.ui._content, "tr.line>td.line", function(td, index) { var tr = td.parentNode, n = parseInt(td.innerText)
if (!can.page.ClassList.set(can, tr, html.SELECT, tr == line || n == line)) { return }
line = tr, can.Status("行号", can.onexport.position(can, can.Option(nfs.LINE, n)))
line = tr, can.Status(nfs.LINE, can.onexport.position(can, can.Option(nfs.LINE, n)))
}); if (!can.base.isObject(line)) { return 0 }
can.page.Select(can, line, "td.text", function(item) {
can.current = {line: line, next: function() { return line.nextSibling }, prev: function() { return line.previousSibling },
@ -332,11 +343,11 @@ Volcanos(chat.ONACTION, {list: ["首页", "官网", "调试", "百度"],
scroll: function(count) { if (count) { can.ui._content.scrollTop += count*can.current.line.offsetHeight }
return parseInt((can.current.line.offsetTop-can.ui._content.scrollTop)/can.current.line.offsetHeight)
}, window: function() { return parseInt(can.ui._content.offsetHeight/can.current.line.offsetHeight) },
}, can.onimport.history(can, {path: can.Option(nfs.PATH), file: can.Option(nfs.FILE), line: can.Option(nfs.LINE)})
can.onexport.hash(can), scroll && can.onaction.scrollIntoView(can), can.onengine.signal(can, "tabview.line.select", can._msg)
}, can.onimport.history(can, {path: can.Option(nfs.PATH), file: can.Option(nfs.FILE), line: can.Option(nfs.LINE), text: can.current.text()})
can.onexport.hash(can), scroll && can.onaction.scrollIntoView(can), can.onengine.signal(can, LINE_SELECT, can._msg)
})
can.misc.localStorage(can, "web.code.inner:currentFile", [can.Option(nfs.PATH), can.Option(nfs.FILE), can.onaction._getLineno(can, can.current.line)].join(ice.DF))
can.misc.sessionStorage(can, "web.code.inner:selectLine:"+can.Option(nfs.PATH)+can.Option(nfs.FILE), can.onaction._getLineno(can, can.current.line))
can.misc.localStorage(can, CURRENT_FILE, [can.Option(nfs.PATH), can.Option(nfs.FILE), can.onaction._getLineno(can, can.current.line)].join(ice.DF))
can.misc.sessionStorage(can, SELECT_LINE+ice.DF+can.Option(nfs.PATH)+can.Option(nfs.FILE), can.onaction._getLineno(can, can.current.line))
return can.onexport.line(can, line)
},
scrollIntoView: function(can, offset) { var current = can.onaction._getLineno(can, can.current.line), window = can.current.window(); offset = offset||parseInt(window/4)+2
@ -362,18 +373,19 @@ Volcanos(chat.ONACTION, {list: ["首页", "官网", "调试", "百度"],
}), can.runAction(can.request(event, {text: can.base.Format(list)}), button)
},
clear: function(event, can) {
if (can.page.Select(can, can._root._target, "div.vimer.find.float", function(item) { return can.page.Remove(can, item) }).length > 0) { return }
if (can.page.Select(can, can._root._target, ".input.float", function(item) { return can.page.Remove(can, item) }).length > 0) { return }
var list = [".input.float", "div.carte.float", "div.vimer.find.float"]; for (var i = 0; i < list.length; i++) {
if (can.page.Select(can, can._root._target, list[i], function(item) { return can.page.Remove(can, item) }).length > 0) { return }
}
if (can.page.Select(can, can.ui.plug, "legend.select", function(item) { return item.click(), item }).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) }
},
back: function(can) { can.db._history.push(can.db.history.pop())
var last = can.db.history.pop(); last && can.onimport.tabview(can, last.path, last.file, last.line)
},
reback: function(can) {
var last = can.db._history.pop(); last && can.onimport.tabview(can, last.path, last.file, last.line)
},
back: function(can) { can.db._history.push(can.db.history.pop())
var last = can.db.history.pop(); last && can.onimport.tabview(can, last.path, last.file, last.line)
},
exec: function(event, can) {
if (can.base.Ext(can.Option(nfs.FILE)) == nfs.JS) { delete(Volcanos.meta.cache[can.base.Path(ice.PS, ice.REQUIRE, can.Option(nfs.PATH), can.Option(nfs.FILE))]) }
can.runAction(can.request(event, {_toast: "执行中..."}), mdb.ENGINE, [can.db.parse, can.Option(nfs.FILE), can.Option(nfs.PATH)], function(msg) { can.onimport.display(can, msg) })
@ -453,10 +465,12 @@ Volcanos(chat.ONACTION, {list: ["首页", "官网", "调试", "百度"],
}); var from, to
},
})
Volcanos(chat.ONEXPORT, {list: ["目录", "类型", "文件", "行号", "跳转"],
Volcanos(chat.ONEXPORT, {list: [mdb.COUNT, mdb.TYPE, nfs.FILE, nfs.LINE, ice.BACK],
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(ice.DF) },
line: function(can, line) { return parseInt(can.core.Value(can.page.SelectOne(can, line, "td.line"), "innerText")) },
text: function(can, line) { return can.core.Value(can.page.Select(can, can.onaction._getLine(can, line), "td.text")[0], "innerText") },
content: function(can) { return can.page.Select(can, can.ui.content, "td.text", function(item) { return item.innerText }).join(ice.NL) },
position: function(can, index, total) { total = total||can.db.max; return (parseInt(index))+ice.PS+parseInt(total)+" = "+parseInt((index)*100/total)+"%" },
selection: function(can, str) { var s = document.getSelection().toString(), begin = str.indexOf(s), end = begin+s.length
for (var i = begin; i >= 0; i--) { if (str[i].match(/[a-zA-Z0-9_.]/)) { s = str.slice(i, end) } else { break } } return s
@ -476,6 +490,8 @@ Volcanos(chat.ONEXPORT, {list: ["目录", "类型", "文件", "行号", "跳转"
var _block = can.base.trimPrefix(ls[1], "chat.").toLowerCase()
if (_block != block) { push("") } block = _block
if (text.indexOf(chat._INIT) > -1) { push(block+ice.PT+chat._INIT+ice.DF+(index+1)) }
} else if (_indent == 0 && can.base.beginWith(text, "var ")) {
block = ls[1]
} else if (_indent == 4) {
ls[0] && push(block+ice.PT+ls[0]+ice.DF+(index+1))
}
@ -515,3 +531,4 @@ Volcanos(chat.ONKEYMAP, {
x: shy("关闭标签", function(can) { can._tab._close() }),
}}, _engine: {},
})
})()

View File

@ -3,11 +3,13 @@ fieldset.vimer>div.output div.project div.zone.dream div.item.stop { color:gray;
fieldset.vimer>div.output input.current { background-color:transparent; color:transparent; padding-left:10px; height:20px; position:absolute; }
fieldset.vimer>div.output input.current.insert { caret-color:black; }
fieldset.vimer>div.output input.current.normal { caret-color:lightgray; }
fieldset.vimer>div.output div.complete { padding-top:0; display:none; overflow:auto; position:absolute; }
fieldset.vimer>div.output div.complete { background-color:unset; padding-top:0; display:none; overflow:auto; position:absolute; }
fieldset.vimer>div.output div.complete.insert:not(.hide) { display:block; }
fieldset.vimer>div.output div.complete div.prefix { color:transparent; white-space:pre; float:left; }
fieldset.vimer>div.output div.complete table.content thead { display:none; }
fieldset.vimer>div.output div.complete table.content { width:unset; max-width:600px; display:block; }
body.black fieldset.vimer>div.output input.current.normal { caret-color:gray; }
body.black fieldset.vimer>div.output input.current.insert { caret-color:yellow; }
body.dark fieldset.vimer>div.output input.current.normal { caret-color:gray; }
body.dark fieldset.vimer>div.output input.current.insert { caret-color:yellow; }
div.input.vimer.source.create.float td:first-child { display:none; }

View File

@ -1,11 +1,11 @@
Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb, target) { can.require(["inner.js"], function(can) { can.onimport._last_init(can, msg, function() {
can.db.undo = [], can.db.redo = [], can.onimport._input(can), can.base.isFunc(cb) && cb(msg)
can.onengine.listen(can, "tabview.line.select", function(msg) { can.onaction._selectLine(can) })
can.db.undo = [], can.db.redo = [], can.onimport._input(can), can.base.isFunc(cb) && cb(msg)
}, target) }) },
_input: function(can) { var ui = can.page.Append(can, can.ui.content.parentNode, [
{view: [code.CURRENT, html.INPUT], spellcheck: false, onkeydown: function(event) { can.onimport._value(can); if (event.metaKey) { return }
can.db._keylist = can.onkeymap._parse(event, can, can.db.mode+(event.ctrlKey? "_ctrl": ""), can.db._keylist, can.ui.current)
if (can.db.mode == mdb.NORMAL) { can.onkeymap.prevent(event), can.Status("按键", can.db._keylist.join("")) }
if (can.db.mode == mdb.NORMAL) { can.onkeymap.prevent(event), can.Status(mdb.KEYS, can.db._keylist.join("")) }
if (can.db.mode == mdb.INSERT) { can.db._keylist = [] }
}, onkeyup: function(event) { can.onimport._value(can); if (event.metaKey) { return }
can.onaction._complete(event, can)
@ -13,35 +13,34 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb, target) { can.require(["i
can.current.line.appendChild(can.ui.complete)
}, onclick: function(event) {
can.onkeymap._insert(event, can)
}}, {view: [[code.COMPLETE, chat.FLOAT]]},
}}, {view: [[code.COMPLETE]]},
]); can.ui.current = ui.current, can.ui.complete = ui.complete, can.onkeymap._build(can), can.onkeymap._plugin(can) },
_value: function(can) { can.db.mode == mdb.INSERT && can.onmotion.delay(can, function() { can.current.text(can.ui.current.value) }) },
}, [""])
Volcanos(chat.ONFIGURE, {
recent: function(can, target, zone) { var total = 0
function show(msg, cb) { var list = {}; msg.Table(function(item) { var path = item.path+item.file; if (!list[path]) { list[path] = item, can.page.Append(can, target, cb(item, path)), total++ } }) }
can.runAction({}, code.FAVOR, ["_recent_file"], function(msg) { can.core.List(["plugin/local/code/vimer.js"], function(item) { msg.Push(nfs.PATH, ice.USR_VOLCANOS).Push(nfs.FILE, item) })
show(msg, function(item, path) { return [{text: [path.split(ice.PS).slice(-2).join(ice.PS), html.DIV, html.ITEM], onclick: function(event) {
can.runAction({}, code.FAVOR, ["_recent_file"], function(msg) {
show(msg, function(item, path) { return [{text: [path.split(ice.PS).slice(-2).join(ice.PS), html.DIV, html.ITEM], title: path, onclick: function(event) {
can.onimport.tabview(can, item.path, item.file)
}}] }), zone._total(total)
})
},
source: function(can, target, zone, path) { var args = can.base.getValid(can.misc.SearchHash(can), [can.Option(nfs.PATH), can.Option(nfs.FILE)])
// zone._icon({"+": function(event) { can.user.carteRight(event, can, {}, ["script", "autogen"]) } })
function show(target, zone, path) { can.run(can.request({}, {dir_root: path, dir_deep: true}), [nfs.PWD], function(msg) { can.onmotion.clear(can, target)
if (path == nfs.SRC) { can.ui.zone.source.refresh = function() { show(target, zone, path) } }
var total, node; function add(list) {
can.core.List(list, function(item) { if (path == args[0] && args[1].indexOf(item.path) == 0) { item.expand = true } item._menu = shy({
create: function(event) { can.user.input(event, can, ["filename"], function(list) {
create: function(event) { can.onappend.style(can, [code.VIMER, nfs.SOURCE, mdb.CREATE], can.user.input(event, can, ["filename"], function(list) {
can.request(event, {path: can.base.endWith(item.path, ice.PS)? path+item.path: path+item.path.split(ice.PS).slice(0, -1).join(ice.PS)+ice.PS, file: list[0]})
can.runAction(event, nfs.SAVE, [], function(msg) { var file = (msg.Option(nfs.PATH)+msg.Option(nfs.FILE)).slice(path.length)
add([{path: file}], node), can.onimport.tabview(can, path, file)
add([{path: file}]), can.onimport.tabview(can, path, file)
})
}) },
})._target) },
trash: function(event) { can.runAction(event, nfs.TRASH, [can.base.Path(path, item.path)], function() { item._remove() }) },
}), item._init = function(target) { item._remove = function() { can.page.Remove(can, target.parentNode), delete(node[item.path]) } } })
return can.onimport.tree(can, list, nfs.PATH, ice.PS, function(event, item) { can.onimport.tabview(can, path, item.path) }, target, node)
} node = add(msg.Table(), node), can.Status("目录", zone._total(msg.Length()))
} node = add(msg.Table()), can.Status(mdb.COUNT, total += zone._total(msg.Length()))
}, true) } if (path.length == 1) { return show(target, path[0]) }
can.onimport.zone(can, can.core.List(path, function(path) {
return {name: path, _init: function(target, zone) { path == args[0] && show(target, zone, path) },
@ -50,16 +49,22 @@ Volcanos(chat.ONFIGURE, {
},
repos: function(can, target, zone) { can.onimport._zone(can, zone, "web.code.git.status", function(sub, msg) {
sub.onexport.record = function(sub, value, key, line) { can.onimport.tabview(can, line.path, line.file) }
zone._icon({ "\u21BA": function() { sub.Update() },
"\u21C8": function() { sub.run({}, [ctx.ACTION, "push"]) },
"\u21CA": function() { sub.run({}, [ctx.ACTION, "pull"]) },
"=": function() { can.onimport.tabview(can, can.Option(nfs.PATH), "web.code.git.status", ctx.INDEX) },
zone._icon({
"\u21BA": function(event) { sub.Update(event) },
"\u21C8": function(event) { sub.runAction(event, "push") },
"\u21CA": function(event) { sub.runAction(event, "pull") },
"=": function() { can.onimport.tabview(can, can.Option(nfs.PATH), sub._index, ctx.INDEX) },
})
}) },
dream: function(can, target, zone) { can.onimport._zone(can, zone, web.DREAM, function(sub, msg) {
sub.onexport.record = function(sub, value, key, line) { can.onimport.tabview(can, can.Option(nfs.PATH), value, web.DREAM) }
can.page.Select(can, sub._output, html.DIV_ITEM, function(target, index) { can.onappend.style(can, msg.status[index], target) })
zone._icon({ "\u21BA": function() { sub.Update() }, "+": function() { sub.run({}, [ctx.ACTION, mdb.CREATE]) }})
sub.onimport._open = function(sub, msg, arg) { var url = can.misc.ParseURL(can, arg)
url.pod? can.onimport.tabview(can, can.Option(nfs.PATH), url.pod+(url.cmd? "/cmd/"+url.cmd:""), web.DREAM): can.user.open(arg)
}
sub.onexport.record = function(sub, value, key, line) { can.onimport.tabview(can, can.Option(nfs.PATH), value, web.DREAM) }
zone._icon({ "\u21BA": function(event) { sub.Update(event) }, "+": function(event) { sub.Update(event, [ctx.ACTION, mdb.CREATE], function(msg) {
can.onimport.tabview(can, can.Option(nfs.PATH), msg.Option(mdb.NAME), web.DREAM), sub.Update()
}) }})
}) },
})
Volcanos(chat.ONACTION, {
@ -74,61 +79,33 @@ Volcanos(chat.ONACTION, {
_runs: function(event, can, button, cb) { var meta = can.Conf(); can.request(event, {action: button})
can.user.input(event, can, meta.feature[button], function(args) { can.onaction._run(event, can, button, args, cb) })
},
save: function(event, can, button) { can.request(event, {file: can.Option(nfs.FILE), content: can.onexport.content(can)})
function imports(str) { var block = "", count = 0; can.core.List(str.split(ice.NL), function(item) {
if (can.base.beginWith(item, "import (")) { block = can.core.Split(item)[0]; return }
if (can.base.beginWith(item, ")")) { block = ""; return }
if (can.base.beginWith(item, "import ")) { count++; return }
if (block == "import") { count++ }
}); return count }
can.onaction._run(event, can, button, [can.db.parse, can.Option(nfs.FILE), can.Option(nfs.PATH)], function(msg) {
if (can.db.parse == nfs.GO) { var line = can.onaction.selectLine(can); can.onmotion.clear(can, can.ui.content)
can.db.max = 0, can.core.List(msg.Result().split(ice.NL), function(item) { can.onaction.appendLine(can, item) })
can.onaction.selectLine(can, line+imports(msg.Result())-imports(msg.Option(nfs.CONTENT)))
} can.user.toastSuccess(can, button, can.Option(nfs.PATH)+can.Option(nfs.FILE))
})
},
compile: function(event, can, button) { can.runAction(can.request(event, {_toast: "编译中..."}), button, [], function(msg) { can.ui.search && can.ui.search.hidden()
if (msg.Length() > 0 || msg.Result()) { return can.onimport.exts(can, "inner/search.js", function(sub) { can.onappend._output(sub, msg, sub.Conf(ctx.DISPLAY)), sub.select() }) }
var toast = can.user.toastProcess(can, "重启中..."); can.onmotion.delay(can, function() { toast.close(), can.user.toastSuccess(can) }, 3000)
}) },
autogen: function(event, can, button) { can.onaction._runs(can.request(event, {path: nfs.SRC}), can, button, function(msg) {
can.onimport.tabview(can, msg.Option(nfs.PATH), msg.Option(cli.MAIN), "", function() {
can.onimport.tabview(can, msg.Option(nfs.PATH), msg.Option(nfs.FILE)), can.ui.zone.source.refresh(), can.user.toastSuccess(can)
}, true)
}) },
script: function(event, can, button) {
can.onaction._runs(can.request(event, {path: nfs.SRC, file: can.base.trimSuffix(can.Option(nfs.FILE), can.base.Ext(can.Option(nfs.FILE)))+nfs.JS}), can, button)
},
dream: function(event, can, button) {
can.onaction._runs(can.request(event, {name: can.base.trimSuffix(can.Option(nfs.FILE).split(ice.PS).pop(), ice.PT+can.base.Ext(can.Option(nfs.FILE)))}), can, button, function(msg) {
can.onimport.tabview(can, can.Option(nfs.PATH), msg.Option(mdb.NAME), web.DREAM), can.ui.zone.dream.refresh(), can.user.toastSuccess(can)
})
},
website: function(event, can, button) {
can.onaction._runs(can.request(event, {path: "src/website/", file: (can.base.trimSuffix(can.Option(nfs.FILE), can.base.Ext(can.Option(nfs.FILE)))+nfs.ZML).split(ice.PS).pop()}), can, button)
},
save: function(event, can, button) { can.request(event, {file: can.Option(nfs.FILE), content: can.onexport.content(can)})
function imports(str) { var block = "", count = 0
can.core.List(str.split(ice.NL), function(item) {
if (can.base.endWith(item, "(") || can.base.endWith(item, "{")) { block = can.core.Split(item)[0]; return }
if (can.base.beginWith(item, ")") || can.base.beginWith(item, "}")) { block = ""; return }
if (block == "import") { count++ }
})
return count
}
can.onaction._run(event, can, button, [can.db.parse, can.Option(nfs.FILE), can.Option(nfs.PATH)], function(msg) {
if (can.db.parse == nfs.GO) { var line = can.onaction.selectLine(can); can.onmotion.clear(can, can.ui.content)
can.db.max = 0, can.core.List(can.db.ls = msg.Result().split(ice.NL), function(item) { can.onaction.appendLine(can, item) })
can.onaction.selectLine(can, line+imports(msg.Result())-imports(msg.Option("content")))
} can.user.toastSuccess(can, button, can.Option(nfs.PATH)+can.Option(nfs.FILE))
})
},
compile: function(event, can, button) { var _toast = can.user.toastProcess(can, "编译中...")
can.runAction(can.request(event), button, [], function(msg) { _toast.close(), can.ui.search && can.onmotion.hidden(can, can.ui.search._target)
if (msg.Length() > 0 || msg.Result()) { return can.onimport.exts(can, "inner/search.js", function(sub) {
can.onappend._output(sub, msg, sub.Conf("display")), sub.select()
}) }
var toast = can.user.toastProcess(can, "重启中..."); can.onmotion.delay(can, function() { toast.close(), can.user.toastSuccess(can) }, 3000)
})
},
favor: function(event, can) { can.onimport.tabview(can, can.Option(nfs.PATH), "web.code.favor", ctx.INDEX) },
git: function(event, can) { can.onimport.tabview(can, can.Option(nfs.PATH), "web.code.git.status", ctx.INDEX) },
status: function(event, can) { can.onimport.tabview(can, can.Option(nfs.PATH), "web.code.git.status", ctx.INDEX) },
plan: function(event, can) { can.onimport.tabview(can, can.Option(nfs.PATH), "web.team.plan", ctx.INDEX) },
vim: function(event, can) { can.onaction._run(can.request(event, can.Option()), can, code.XTERM, [mdb.TYPE, "vim +"+can.Option(nfs.LINE)+" "+can.Option(nfs.PATH)+can.Option(nfs.FILE)], function(msg) {
can.onimport.tabview(can, can.Option(nfs.PATH), msg.Result(), code.XTERM), can.ui.xterm.refresh(), can.user.toastSuccess(can)
}) },
xterm: function(event, can, button) { can.onaction._runs(can.request(event, can.Option()), can, button, function(msg) {
can.onimport.tabview(can, can.Option(nfs.PATH), msg.Result(), code.XTERM), can.ui.xterm.refresh(), can.user.toastSuccess(can)
}) },
"首页": function(event, can) { can.user.open(location.protocol+"//"+location.host) },
"官网": function(event, can) { can.user.open("https://shylinux.com/") },
"调试": function(event, can) { can.user.opens(location.href.replace("debug=true", "debug=false")) },
"文档": function(event, can) { can.user.opens("https://developer.mozilla.org/") },
"百度": function(event, can) { can.user.opens("https://baidu.com/") },
"命令": function(event, can) {
can.user.input(event, can, [ctx.INDEX, ctx.ARGS], function(list) { can.onimport.tabview(can, can.Option(nfs.PATH), list[0]+(list[1]? ice.FS+list[1]: ""), ctx.INDEX) })
},
@ -138,46 +115,46 @@ Volcanos(chat.ONACTION, {
"扩展": function(event, can) { can.user.input(can.request(event, {action: "extension"}), can, ["url"], function(list) {
var sub = can.db.toolkit[list[0]]; sub? sub.select(): can.onimport.exts(can, list[0])
}) },
"录屏": function(event, can) { window.openapp("QuickTime Player") },
"日志": function(event, can) { window.opencmd("cd ~/contexts; tail -f var/log/bench.log") },
"编辑器": function(event, can) { window.opencmd("cd ~/contexts; vim +"+can.Option(nfs.LINE)+" "+can.Option(nfs.PATH)+can.Option(nfs.FILE)) },
"浏览器": function(event, can) { window.openurl(location.href) },
_open: function(can, url) { can.user.isWebview? window.openurl(url): window.open(url) },
"首页": function(event, can) { can.user.open(location.origin) },
"官网": function(event, can) { can.user.open("https://shylinux.com/") },
"调试": function(event, can) { can.user.opens(location.href.replace("debug=true", "debug=false")) },
"百度": function(event, can) { can.user.opens("https://baidu.com/") },
"录屏": function(event, can) { window.isWebview && window.openapp("QuickTime Player") },
"编辑器": function(event, can) { window.isWebview && window.opencmd("cd ~/contexts; vim +"+can.Option(nfs.LINE)+" "+can.Option(nfs.PATH)+can.Option(nfs.FILE)) },
"浏览器": function(event, can) { window.isWebview && window.openurl(location.href) },
_complete: function(event, can, target) { if (event == undefined || event.type == "click") { return } target = target||can.ui.complete
var pre = can.ui.current.value.slice(0, can.ui.current.selectionStart), key = can.core.Split(pre, "\t .[]", " ").pop()||"", end = can.ui.current.value.slice(can.ui.current.selectionStart)
var pre = can.ui.current.value.slice(0, can.ui.current.selectionStart), key = can.core.Split(pre, "\t .[]", ice.SP).pop()||"", end = can.ui.current.value.slice(can.ui.current.selectionStart)
function update() { target._pre = pre, target._end = end, target._index = -1
can.current.line.appendChild(target), can.page.style(can, target, html.LEFT, can.ui.current.offsetLeft, html.MARGIN_TOP, can.current.line.offsetHeight)
can.runAction(can.request(event, {text: pre}, can.Option()), code.COMPLETE, [], function(msg) { can.page.Appends(can, target, [{view: ["prefix", html.DIV, pre]}])
can.runAction(can.request(event, {text: pre}, can.Option()), code.COMPLETE, [], function(msg) { can.page.Appends(can, target, [{view: [lex.PREFIX, html.DIV, pre]}])
if (can.db.parse == nfs.JS) { var msg = can.request()
var ls = can.core.Split(can.core.Split(pre, "\t {(,:)}").pop(), ice.PT)
var list = {can: can, msg: msg, target: target, window: window}
var ls = can.core.Split(can.core.Split(pre, "\t {(:,)}").pop(), ice.PT), list = {can: can, msg: msg, target: target, window: window}
can.core.ItemKeys(key == ""? list: can.core.Value(list, ls)||can.core.Value(window, ls)||window, function(k, v) {
v && msg.Push(mdb.NAME, k).Push(mdb.TEXT, v.toString().split(ice.NL)[0])
msg.Push(mdb.NAME, k).Push(mdb.TEXT, (v+"").split(ice.NL)[0])
})
}
can.core.Item(can.core.Value(can.onsyntax[can.db.parse], "keyword"), function(key, value) {
msg.Push(mdb.NAME, key)
})
can.onappend.table(can, msg, function(value, key, index) { return {text: [value, html.TD], onclick: function(event) {
can.current.text(can.ui.current.value = target._pre+value+target._end), can.onaction.scrollHold(can, target._pre.length+value.length)
}} }, target), can.page.style(can, target, html.MAX_HEIGHT, can.ui._content.offsetHeight-(can.current.line.offsetTop-can.ui.content.scrollTop)-can.current.line.offsetHeight)
} can.core.Item(can.core.Value(can.onsyntax[can.db.parse], code.KEYWORD), function(key, value) { msg.Push(mdb.NAME, key) })
can.onappend.table(can, msg, function(value, key, index) { return {text: [value, html.TD], onclick: function(event) { change(value) }} }, target)
can.page.style(can, target, html.MAX_HEIGHT, can.ui._content.offsetHeight-(can.current.line.offsetTop-can.ui.content.scrollTop)-can.current.line.offsetHeight)
can.onmotion.toggle(can, target, true)
})
}
function change(key) { can.current.text(can.ui.current.value = target._pre+key+target._end), can.onkeymap.cursorMove(can.ui.current, target._pre.length+key.length, 0) }
function filter() { can.page.ClassList.set(can, can.ui.complete, html.HIDE, can.page.Select(can, target, [html.TBODY, html.TR], function(tr) {
if (!can.page.ClassList.set(can, tr, html.HIDE, can.page.Select(can, tr, html.TD, function(td) { if (td.innerText.toLowerCase().indexOf(key.toLowerCase()) == 0) { return td } }).length == 0)) { return tr }
if (!can.page.ClassList.set(can, tr, html.HIDE,
can.page.Select(can, tr, html.TD, function(td) {
if (td.innerText.toLowerCase().indexOf(key.toLowerCase()) == 0) { return td }
}).length == 0)) { return tr }
}).length == 0) }
function select(index, total) { index = (index+(total+1))%(total+1); if (index == total) { can.current.text(can.ui.current.value = target._pre+target._end) }
can.page.Select(can, target, [html.TBODY, "tr:not(.hide)"], function(tr, i) { if (can.page.ClassList.set(can, tr, html.SELECT, i == index)) {
can.current.text(can.ui.current.value = target._pre+can.page.Select(can, tr, html.TD)[0].innerText+target._end)
can.page.Select(can, target, [html.TBODY, html.TR+html.NOT_HIDE], function(tr, i) { if (can.page.ClassList.set(can, tr, html.SELECT, i == index)) {
change(can.page.Select(can, tr, html.TD)[0].innerText)
} }); return index
}
if (event.ctrlKey) { if (event.type == "keyup") { var total = can.page.Select(can, target, [html.TBODY, "tr:not(.hide)"]).length; switch (event.key) {
case "n": target._index = select(target._index+1, total); break
case "p": target._index = select(target._index-1, total); break
default:
return can.onkeymap.selectCtrlN(event, can, target, [html.TBODY, "tr:not(.hide)"], function(tr) {
can.current.text(can.ui.current.value = target._pre+can.page.Select(can, tr, html.TD)[0].innerText+target._end)
})
if (event.ctrlKey) { if (event.type == "keyup") { var total = can.page.Select(can, target, [html.TBODY, html.TR+html.NOT_HIDE]).length; switch (event.key) {
case "n": target._index = select(target._index+1, total); can.onkeymap.prevent(event); break
case "p": target._index = select(target._index-1, total); can.onkeymap.prevent(event); break
default: return can.onkeymap.selectCtrlN(event, can, target, [html.TBODY, html.TR+html.NOT_HIDE], function(tr) { change(can.page.Select(can, tr, html.TD)[0].innerText) })
} return can.onkeymap.prevent(event) } return }
switch (pre.slice(-1)) {
case ice.TB:
@ -190,33 +167,25 @@ Volcanos(chat.ONACTION, {
default: filter()
}
},
_selectLine: function(can) { if (!can.current) { return }
can.page.Select(can, can.current.line, "td.text", function(td) { var target = can.ui.current; target.value = td.innerText
can.current.line.appendChild(target), can.page.style(can, target, html.LEFT, td.offsetLeft-1, html.TOP, td.offsetTop, html.WIDTH, can.base.Min(td.offsetWidth, can.ui._content.offsetWidth))
_selectLine: function(can) { can.page.Select(can, can.current.line, "td.text", function(td) { var target = can.ui.current; target.value = td.innerText
can.current.line.appendChild(target), can.page.style(can, target, html.LEFT, td.offsetLeft-1, html.TOP, td.offsetTop, html.WIDTH, can.base.Min(td.offsetWidth, can.ui._content.offsetWidth))
if (event && event.target && event.target.tagName && can.page.tagis(event.target, html.TD, html.SPAN)) {
can.onkeymap._insert(event, can, 0, (event.offsetX)/12-1), can.onmotion.clear(can, can.ui.complete)
} else {
can.db.mode == mdb.NORMAL && can.onkeymap._normal(can)
if (event && event.target && event.target.tagName && can.page.tagis(event.target, html.TD, html.SPAN)) {
can.onkeymap._insert(event, can, 0, (event.offsetX)/12-1)
can.onmotion.clear(can, can.ui.complete)
}
})
},
}
}) },
rerankLine: function(can, value) { can.db.max = can.page.Select(can, can.ui.content, "tr>td.line", function(td, index) { return td.innerText = index+1 }).length },
insertLine: function(can, value, before) { var line = can.onaction.appendLine(can, value)
before && can.ui.content.insertBefore(line, can.onaction._getLine(can, before))
return can.onaction.rerankLine(can), can.onaction._getLineno(can, line)
},
deleteLine: function(can, line) { line = can.onaction._getLine(can, line)
var next = line.nextSibling||line.previousSibling
return can.page.Remove(can, line), can.onaction.rerankLine(can), next
},
insertLine: function(can, value, before) { var line = can.onaction.appendLine(can, value); before && can.ui.content.insertBefore(line, can.onaction._getLine(can, before)); return can.onaction.rerankLine(can), can.onaction._getLineno(can, line) },
deleteLine: function(can, line) { line = can.onaction._getLine(can, line); var next = line.nextSibling||line.previousSibling; return can.page.Remove(can, line), can.onaction.rerankLine(can), next },
modifyLine: function(can, line, value) { can.page.Select(can, can.onaction._getLine(can, line), "td.text", function(td) { td.innerHTML = can.onsyntax._parse(can, value) }) },
cursorUp: function(can, target) { var p = can.onkeymap.cursorMove(target); can.onaction.selectLine(can, can.current.prev()), can.onkeymap.cursorMove(target, 0, p) },
cursorDown: function(can, target) { var p = can.onkeymap.cursorMove(target); can.onaction.selectLine(can, can.current.next()), can.onkeymap.cursorMove(target, 0, p) },
scrollHold: function(can, count, begin) { var scroll = can.ui.content.scrollLeft; can.ui.current.focus(), count != undefined && can.onkeymap.cursorMove(can.ui.current, count, begin == undefined? count: begin), can.ui.content.scrollLeft = scroll },
})
Volcanos(chat.ONEXPORT, {list: ["目录", "模式", "按键", "类型", "文件", "行号", "跳转"]})
Volcanos(chat.ONEXPORT, {list: [mdb.COUNT, mdb.TYPE, nfs.FILE, nfs.LINE, ice.BACK, ice.MODE, mdb.KEYS]})
Volcanos(chat.ONKEYMAP, {
_model: function(can, value) { can.Status("模式", can.db.mode = value), can.page.styleClass(can, can.ui.current, [code.CURRENT, can.db.mode]), can.page.styleClass(can, can.ui.complete, [code.COMPLETE, can.db.mode, "float"]) },
_model: function(can, value) { can.Status(ice.MODE, can.db.mode = value), can.page.styleClass(can, can.ui.current, [code.CURRENT, can.db.mode]), can.page.styleClass(can, can.ui.complete, [code.COMPLETE, can.db.mode, chat.FLOAT]) },
_plugin: function(can) { can.onkeymap._model(can, mdb.PLUGIN), can.ui.current.blur() },
_normal: function(can) { can.onkeymap._model(can, mdb.NORMAL), can.onaction.scrollHold(can), can.onkeymap.prevent(event) },
_insert: function(event, can, count, begin) { can.onkeymap._model(can, mdb.INSERT), can.onaction.scrollHold(can, count, begin), can.onkeymap.prevent(event) },
@ -242,24 +211,24 @@ Volcanos(chat.ONKEYMAP, {
p: shy("添加插件", function(event, can) { can.onaction["插件"](event, can) }),
e: shy("添加扩展", function(event, can) { can.onaction["扩展"](event, can) }),
i: shy("插入模式", function(event, can) { can.onkeymap._insert(event, can) }),
n: shy("命令模式", function(event, can) { can.onkeymap._normal(can) }),
i: shy("插入模式", function(event, can) { can.onaction.selectLine(can, can.onaction.selectLine(can)), can.onkeymap._insert(event, can) }),
n: shy("命令模式", function(event, can) { can.onaction.selectLine(can, can.onaction.selectLine(can)), can.onkeymap._normal(can) }),
":": shy("底行模式", function(event, can) { can.onimport.toolkit(can, {index: "cli.system"}, function(sub) { can.db.toolkit["cli.system"] = sub.select(), can.onmotion.delay(can, function() { sub.Focus() }) }) }),
d: shy("查找替换", function(event, can) {
can.page.Select(can, can.ui.path, "span.func", function(target) { target.click() })
}),
g: shy("查找替换", function(event, can) { can.onaction.find(event, can) }),
s: shy("保存文件", function(event, can) { can.onaction.save(event, can, nfs.SAVE) }),
c: shy("编译项目", function(event, can) { can.onaction.compile(event, can, code.COMPILE) }),
d: shy("查找函数", function(event, can) { can.page.Select(can, can.ui.path, "span.func", function(target) { target.click() }) }),
g: shy("查找搜索", function(event, can) { can.onaction.find(event, can) }),
},
normal: {
s: shy("保存文件", function(event, can) { can.onaction.save(event, can, nfs.SAVE) }),
c: shy("编译项目", function(event, can) { can.onaction.compile(event, can, code.COMPILE) }),
Escape: shy("切换模式", function(event, can) { can.onkeymap._plugin(can) }),
ArrowLeft: shy("光标左移", function(can, target) { can.onkeymap.cursorMove(target, -1) }),
ArrowRight: shy("光标右移", function(can, target) { can.onkeymap.cursorMove(target, 1) }),
ArrowDown: shy("光标下移", function(can, target) { can.onaction.cursorDown(can, target) }),
ArrowUp: shy("光标上移", function(can, target) { can.onaction.cursorUp(can, target) }),
H: shy("跳到行首", function(can, target) { can.onkeymap.cursorMove(target, 0, 0) }),
L: shy("跳到行尾", function(can, target) { can.onkeymap.cursorMove(target, 0, -1) }),
h: shy("光标左移", function(can, target) { can.onkeymap.cursorMove(target, -1) }),
@ -270,7 +239,7 @@ Volcanos(chat.ONKEYMAP, {
I: shy("插入行首", function(event, can) { can.onkeymap._insert(event, can, 0, 0) }),
A: shy("插入行尾", function(event, can) { can.onkeymap._insert(event, can, 0, -1) }),
i: shy("插入模式", function(event, can) { can.onkeymap._insert(event, can) }),
a: shy("插入模式", function(event, can) { can.onkeymap._insert(event, can, 1) }),
a: shy("插入模式", function(event, can) { can.onkeymap._insert(event, can) }),
o: shy("插入下一行", function(event, can) { var text = can.current.text()
text = text.substr(0, text.indexOf(text.trimLeft()))+(can.base.endWith(text, "{")? ice.TB: "")
can.onaction.selectLine(can, can.onaction.insertLine(can, text, can.current.next()))
@ -282,42 +251,30 @@ Volcanos(chat.ONKEYMAP, {
can.onkeymap._insert(event, can, 0, -1)
}),
yy: shy("复制当前行", function(event, can, target, count) {
var list = [], line = can.current.line; for (var i = 0; i < count; i++) {
list.push(can.onexport.text(can, line)), line = line.nextSibling
} can.db._last_text = list
return true
yy: shy("复制当前行", function(event, can, target, count) { var list = [], line = can.current.line
for (var i = 0; i < count; i++) { list.push(can.onexport.text(can, line)), line = line.nextSibling } can.db._last_text = list; return true
}),
dd: shy("剪切当前行", function(event, can, target, count) {
var line = can.onaction.selectLine(can), callee = arguments.callee
can.db.redo.push(function() { callee(event, can, target, count) })
var list = []; for (var i = 0; i < count; i++) { (function() {
var line = can.onaction.selectLine(can), text = can.current.text(); list.push(text)
can.onaction.selectLine(can, can.onaction.deleteLine(can, line))
can.db.undo.push(function() { can.onaction.insertLine(can, text, line), can.onaction.selectLine(can, line) })
})() } can.db._last_text = list
dd: shy("剪切当前行", function(event, can, target, count) { var line = can.onaction.selectLine(can), callee = arguments.callee
var list = []; for (var i = 0; i < count; i++) { (function() { var line = can.onaction.selectLine(can), text = can.current.text(); list.push(text)
can.onaction.selectLine(can, can.onaction.deleteLine(can, line)), can.db.undo.push(function() { can.onaction.insertLine(can, text, line), can.onaction.selectLine(can, line) })
})() } can.db._last_text = list, can.db.redo.push(function() { callee(event, can, target, count) })
return true
}),
p: shy("粘贴", function(can) { if (!can.db._last_text) { return }
var line = can.onaction.selectLine(can), callee = arguments.callee
can.db.redo.push(function() { callee(event, can, target, count) })
for (var i = can.db._last_text.length-1; i >= 0; i--) { (function() {
var line = can.onaction.insertLine(can, can.db._last_text[i], can.current.next())
p: shy("粘贴", function(can) { if (!can.db._last_text) { return } var line = can.onaction.selectLine(can), callee = arguments.callee
for (var i = can.db._last_text.length-1; i >= 0; i--) { (function() { var line = can.onaction.insertLine(can, can.db._last_text[i], can.current.next())
can.db.undo.push(function() { can.onaction.deleteLine(can, line), can.onaction.selectLine(can, line-1) })
})() }
})() } can.db.redo.push(function() { callee(event, can, target, count) })
}),
P: shy("粘贴", function(can) { if (!can.db._last_text) { return }
var line = can.onaction.selectLine(can), callee = arguments.callee
can.db.redo.push(function() { callee(event, can, target, count) })
for (var i = 0; i < can.db._last_text.length; i++) { (function() {
var line = can.onaction.insertLine(can, can.db._last_text[i], can.current.line)
P: shy("粘贴", function(can) { if (!can.db._last_text) { return } var line = can.onaction.selectLine(can), callee = arguments.callee
for (var i = 0; i < can.db._last_text.length; i++) { (function() { var line = can.onaction.insertLine(can, can.db._last_text[i], can.current.line)
can.db.undo.push(function() { can.onaction.deleteLine(can, line), can.onaction.selectLine(can, line+1) })
})() }
})() } can.db.redo.push(function() { callee(event, can, target, count) })
}),
J: shy("合并两行", function(can) { var next = can.current.next(); if (!next) { return }
var line = can.onaction.selectLine(can), text = can.current.text(), rest = can.onexport.text(can, next)
can.ui.current.value = can.current.text(text.trimRight()+(can.base.endWith(text, "(")||can.base.beginWith(rest, ")")? "":
can.base.beginWith(rest.trim(), ",")? "": ice.SP)+rest.trimLeft()), can.onaction.deleteLine(can, next)
can.ui.current.value = can.current.text(text.trimRight()+(
can.base.endWith(text.trim(), "(", "[")||can.base.beginWith(rest.trim(), ",", "]", ")")?
"": ice.SP)+rest.trimLeft()), can.onaction.deleteLine(can, next)
can.db.undo.push(function() { can.onaction.modifyLine(can, line, text), can.onaction.insertLine(can, rest, line+1) })
}),
".": shy("重复操作", function(can) { var cb = can.db.redo.pop(); cb && cb() }),
@ -328,21 +285,17 @@ Volcanos(chat.ONKEYMAP, {
zt: shy("将当前行拉到屏幕最上", function(can, count) { return can.current.scroll(can.current.scroll()-(count>1? count: 3)), true }),
zz: shy("将当前行拉到屏幕中间", function(can, count) { return can.current.scroll(can.current.scroll()-(count = count>1? count: can.current.window()/2)), true }),
zb: shy("将当前行拉到屏幕最下", function(can, count) { return can.current.scroll(can.current.scroll()-can.current.window()+(count>1? count: 5)), true }),
s: shy("保存文件", function(event, can) { can.onaction.save(event, can, nfs.SAVE) }),
c: shy("编译项目", function(event, can) { can.onaction.compile(event, can, code.COMPILE) }),
},
normal_ctrl: {
f: shy("向下翻页", function(can, count) {
var line = can.onaction.selectLine(can)+can.current.window()-3-can.current.scroll()
return can.current.scroll(line), can.onaction.selectLine(can, line), true
}),
b: shy("向上翻页", function(can, count) {
var line = can.onaction.selectLine(can)-can.current.window()+3
return can.current.scroll(line), can.onaction.selectLine(can, line), true
}),
f: shy("向下翻页", function(can, count) { var line = can.onaction.selectLine(can)+can.current.window()-3-can.current.scroll(); return can.current.scroll(line), can.onaction.selectLine(can, line), true }),
b: shy("向上翻页", function(can, count) { var line = can.onaction.selectLine(can)-can.current.window()+3; return can.current.scroll(line), can.onaction.selectLine(can, line), true }),
e: shy("向下滚屏", function(can) { can.current.scroll(1) }),
y: shy("向上滚屏", function(can) { can.current.scroll(-1) }),
},
insert_ctrl: {
n: shy("向上滚屏", function(event) { can.onkeymap.prevent(event) }),
p: shy("向上滚屏", function(event) { can.onkeymap.prevent(event) }),
},
insert: {
Escape: shy("退出编辑", function(event, can) { can.onkeymap._normal(can) }),
Tab: shy("缩进", function(event, can) { can.onkeymap.insertText(can.ui.current, ice.TB), can.onkeymap.prevent(event) }),
@ -354,16 +307,14 @@ Volcanos(chat.ONKEYMAP, {
var rest = can.onkeymap.deleteText(target, target.selectionEnd).trimLeft(), text = can.ui.current.value
var left = text.substr(0, text.indexOf(text.trimLeft()))||(text.trimRight() == ""? text: "")
var line = can.onaction.selectLine(can), next = rest; for (var i = line; i < can.db.max; i++) { next += can.onexport.text(can, i).trimLeft(); if (next != "") { break } }
function deep(text) { var deep = 0; for (var i = 0; i < text.length; i++) { if (text[i] == "\t") { deep += 4 } else if (text[i] == " ") { deep++ } else { break } } return deep }
function deep(text) { var deep = 0; for (var i = 0; i < text.length; i++) { if (text[i] == ice.TB) { deep += 4 } else if (text[i] == ice.SP) { deep++ } else { break } } return deep }
text.trim() && can.core.List(["{}", "[]", "()", "``"], function(item) { if (can.base.endWith(text, item[0])) {
if (can.base.beginWith(next, item[1])) {
can.onaction.insertLine(can, left+rest, can.current.next()), rest = ""
} else if (deep(text) >= deep(can.onexport.text(can, line+1)) && rest == "") {
can.onaction.insertLine(can, left+item[1], can.current.next())
} left += ice.TB
} else if (can.base.beginWith(rest, item[1])) {
left = left.slice(0, -1)
}})
} else if (can.base.beginWith(rest, item[1])) { left = left.slice(0, -1) }})
var line = can.onaction.insertLine(can, left+rest, can.current.next())
can.current.text(text.trimRight()||text), can.onaction.selectLine(can, line), can.onkeymap._insert(event, can, 0, left.length)
}),
@ -372,10 +323,6 @@ Volcanos(chat.ONKEYMAP, {
},
}, _engine: {},
})
Volcanos(chat.ONEXPORT, {
text: function(can, line) { return can.core.Value(can.page.Select(can, can.onaction._getLine(can, line), "td.text")[0], "innerText") },
content: function(can) { return can.page.Select(can, can.ui.content, "td.text", function(item) { return item.innerText }).join(ice.NL) },
})
Volcanos(chat.ONPLUGIN, {
"code.vimer.keymap": shy("按键", {}, ["mode", "key", ice.LIST, ice.BACK], function(can, msg, cmds) {
can.core.Item(can.onkeymap._mode, function(mode, value) {

View File

@ -1,5 +1,5 @@
Volcanos(chat.ONIMPORT, {_process: function(can, msg) { msg.OptionStatus() && can.onmotion.clear(can, can._status) && can.onappend._status(can, msg.OptionStatus())
if (can.onimport[msg.OptionProcess()]) { return can.core.CallFunc([can.onimport, msg.OptionProcess()], {can: can, msg: msg, arg: _arg}), true }
if (can.onimport[msg.OptionProcess()]) { return can.core.CallFunc([can.onimport, msg.OptionProcess()], {can: can, msg: msg, arg: msg.Option("_arg")}), true }
},
_location: function(can, msg, arg) { can.user.jumps(arg) },
_replace: function(can, msg, arg) { location.replace(arg) },

View File

@ -6,7 +6,8 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, target) { can.onmotion.clear(
can.onimport.item(can, {name: can.page.Color(value[can.Conf(mdb.FIELD)||mdb.VIEW]||value[mdb.NAME])}, function() {
can.sup.onexport.record(can, value.name, mdb.NAME, value)
}, function() { return shy(action, function(event, button, meta, carte) { can.misc.Event(event, can, function(msg) {
can.sup.onexport.action(can, button, value) || can.run(event, [ctx.ACTION, button], function(msg) { can.Update() }), carte.close()
can.sup.onexport.action(can, button, value) || can.run(event, [ctx.ACTION, button], function(msg) {
can.sup.onimport._process(can.sup, msg) || can.Update() }), carte.close()
}, value) }) })
}); return }
var cbs = can.onimport[can.Conf(ctx.STYLE)||msg.Option(ctx.STYLE)]; if (can.base.isFunc(cbs)) {
@ -73,7 +74,8 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, target) { can.onmotion.clear(
zone._menu = shy({_trans: sub._trans}, action.concat(can.base.Obj(msg.Option(ice.MSG_ACTION), [])), function(event, button, meta, carte) {
sub.Update(event, [ctx.ACTION, button]), carte.close()
}), can.user.toastSuccess(can)
}, zone._target = sub._target, can.ui[zone.name].refresh = function() { sub.Update() }
}, zone._target = sub._target
can.ui.zone[zone.name].refresh = function() { sub.Update() }
}, zone._target) } },
zone: function(can, list, target) {
return can.page.Append(can, target, can.core.List(list, function(zone) { can.base.isString(zone) && (zone = {name: zone}); return zone && {view: [[html.ZONE, zone.name]], list: [
@ -87,7 +89,8 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, target) { can.onmotion.clear(
}},
{view: html.ACTION, _init: function(target) { zone._action = target
can.onappend._action(can, [{type: html.TEXT, name: mdb.SEARCH, _init: function(target) { zone._search = target }, onkeyup: function(event) {
can.onkeymap.selectItems(event, can, zone._target), can.page.Select(can, zone._target, html.DIV_LIST, function(item) { can.onmotion.toggle(can, item, true) })
can.onmotion.delayOnce(can, function() { can.onkeymap.selectItems(event, can, zone._target) }, event.target.value.length<3? 500: 150, zone._delay_select = zone._delay_select||{})
can.page.Select(can, zone._target, html.DIV_LIST, function(item) { can.onmotion.toggle(can, item, true) })
if (event.target.value == "") { can.page.Select(can, zone._target, html.DIV_LIST, function(target) { can.onmotion.hidden(can, target) })
can.page.Select(can, zone._target, html.DIV_EXPAND, function(target) { can.page.ClassList.del(can, target, cli.OPEN) })
}

View File

@ -66,6 +66,7 @@ var mdb = {
INPUTS: "inputs", PRUNES: "prunes", EXPORT: "export", IMPORT: "import", REVERT: "revert", NORMAL: "normal",
SEARCH: "search", ENGINE: "engine", RENDER: "render", PLUGIN: "plugin",
KEYS: "keys",
MAIN: "main", PAGE: "page", NEXT: "next", PREV: "prev", LIMIT: "limit", OFFEND: "offend",
FOREACH: "*", RANDOMS: "%",
}
@ -208,6 +209,7 @@ var html = {PLUGIN_MARGIN: 10, ACTION_HEIGHT: 31, ACTION_MARGIN: 200,
BACKGROUND_COLOR: "background-color", COLOR: "color", SIZE: "size", OPACITY: "opacity",
FLOW: "flow", FLEX: "flex", LIGHT: "light", DARK: "dark",
FILTER: "filter", TOGGLE: "toggle", EXPAND: "expand", SPEED: "speed", HOVER: "hover", HOVER_SELECT: "hover,select",
NOT_HIDE: ":not(.hide)",
PAGE: "page", TABS: "tabs", MENU: "menu", NODE: "node", PLUG: "plug",
ZONE: "zone", LIST: "list", ITEM: "item", NAME: "name", ICON: "icon", VIEW: "view",