mirror of
https://shylinux.com/x/volcanos
synced 2025-04-25 16:58:06 +08:00
opt vimer.js
This commit is contained in:
parent
116eea85b8
commit
0ad3e4ca3d
20
frame.js
20
frame.js
@ -243,7 +243,8 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) {
|
||||
action === false || sub.onappend._status(sub, sub.onexport&&sub.onexport.list||msg.Option(ice.MSG_STATUS)), can.user.isMobile || sub.onappend.tools(sub, msg)
|
||||
can.isCmdMode() && can.onappend.style(can, can.misc.Search(can, ctx.STYLE), can._target)
|
||||
can.page.style(can, can._output, html.HEIGHT, "", html.WIDTH, "")
|
||||
if (can.isCmdMode()) { can.onimport.size(can, can.page.height(), can.page.width(), true) }
|
||||
can.onappend.style(sub, sub.Conf(ctx.STYLE))
|
||||
// if (can.isCmdMode()) { can.onimport.size(can, can.page.height(), can.page.width(), true) }
|
||||
can.core.List([chat.FLOAT, chat.FULL, chat.CMD], function(mode) { can.page.ClassList.has(can, can._target, mode) && sub.onlayout[mode](sub) })
|
||||
can.onmotion.story.auto(can, can._output), can.onexport.output(can, msg), can.base.isFunc(cb) && cb(msg)
|
||||
}, target: output})
|
||||
@ -414,13 +415,14 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) {
|
||||
function calc(item, size, total) { return !ui.size[item]? can.base.isString(size)? parseInt(can.base.trimSuffix(size, "px")): size: ui.size[item] < 1? total*ui.size[item]: ui.size[item] }
|
||||
var defer = [], content_height, content_width; function layout(type, list, height, width) { var _width = width, _height = height; can.core.List(list, function(item) {
|
||||
if (can.base.isArray(item)) { return }
|
||||
if (can.base.isObject(item)) { var meta = item; item = item._index } if (item == "plug") { return }
|
||||
if (can.base.isObject(item)) { var meta = item; item = item._index }
|
||||
// if (item == "plug") { return }
|
||||
var target = ui[item]; if (!can.page.isDisplay(target)) { return }
|
||||
if (item == html.CONTENT) { return defer.push(function() { can.page.style(can, target, html.HEIGHT, content_height = height, html.WIDTH, content_width = width) }) }
|
||||
if (item == html.PROFILE) { width -= 1 }
|
||||
if (item == html.PROJECT) { width -= 1 }
|
||||
// if (item == html.PROFILE) { width -= 1 }
|
||||
// if (item == html.PROJECT) { width -= 1 }
|
||||
if (type == FLOW) { var h = calc(item, target.offsetHeight, height)
|
||||
if (can.base.isObject(meta)) { meta.layout(h, width) }
|
||||
if (can.base.isObject(meta) && meta.layout) { meta.layout(h, width) }
|
||||
can.page.style(can, target, html.WIDTH, width), height -= h
|
||||
} else { var w = calc(item, target.offsetWidth||target.style.width||_width/list.length, _width), h = height
|
||||
if (can.base.isObject(meta)) { meta.layout(h, w = _width/list.length) }
|
||||
@ -606,7 +608,13 @@ Volcanos(chat.ONMOTION, {_init: function(can, target) {
|
||||
} 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) }
|
||||
delay: function(can, cb, interval, key) {
|
||||
if (!key) {
|
||||
if (interval === 0) {
|
||||
return cb()
|
||||
}
|
||||
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)
|
||||
can.core.Timer(interval||30, function() { cb(self, last, can._delay_list.meta[key]) })
|
||||
|
@ -119,6 +119,7 @@ Volcanos("core", {
|
||||
function loop(i) { timer.stop || i >= interval.length && interval.length >= 0 || cb(timer, interval.interval||interval[i], i, interval)?
|
||||
typeof cbs == lang.FUNCTION && cbs(timer, interval): setTimeout(function() { loop(i+1) }, interval.interval||interval[i+1])
|
||||
} interval = typeof interval == lang.OBJECT? interval: [interval]; if (interval.interval == 0) { return cb(), timer }
|
||||
return typeof cb == lang.FUNCTION && setTimeout(function() { loop(0) }, interval.delay||interval.interval/2||interval[0]), timer
|
||||
var delay = interval.delay||interval.interval/2||interval[0]
|
||||
return typeof cb == lang.FUNCTION && setTimeout(function() { loop(0) }, delay), timer
|
||||
}),
|
||||
})
|
||||
|
@ -42,7 +42,7 @@ Volcanos(chat.ONACTION, {_init: function(can, target) {
|
||||
}); if (!can.Conf(chat.TOOL) && !can.user.mod.isCmd) { return } can._names = location.pathname
|
||||
can.Conf(chat.TOOL)? can.onappend.layout(can, can.core.List(can.Conf(chat.TOOL), function(item, index, list) { item.type = chat.PLUGIN
|
||||
if (list.length == 1) {
|
||||
item.height = can.page.height()-2*html.ACTION_HEIGHT, item.width = can.page.width()
|
||||
item.height = can.page.height(), item.width = can.page.width()
|
||||
can.user.title(item.index), can.onaction._onaction_cmd(can), item.mode = chat.CMD, item.opts = can.misc.Search(can)
|
||||
} return item
|
||||
}), FLOW).layout(window.innerHeight, window.innerWidth): can.runAction(can.request(), ctx.COMMAND, [], function(msg) {
|
||||
|
@ -77,11 +77,10 @@ div.path span.item { padding:5px; }
|
||||
div.carte.path.float { font-size:14px; border-radius:0; } div.carte.path.float div.item { padding:5px; }
|
||||
div.carte.cmd.float { font-size:14px; border-radius:0; } div.cmd.path.float div.item { padding:5px; }
|
||||
div.vimer.open.float td:first-child { display:none; }
|
||||
div.layout.flex>input.current { clear:both; }
|
||||
tr.line>td.line { user-select:none; }
|
||||
tr.line>td.line { text-align:right; padding:0 10px; position:sticky; left:0; }
|
||||
tr.line>td.text { line-height:20px; white-space:pre; padding-left:10px; cursor:text; }
|
||||
tr.line>td.text { line-height:20px; white-space:pre; padding-left:10px; width:100%; cursor:text; }
|
||||
tr.line.delete { background-color:#ff000036; color:gray; }
|
||||
tr.line.insert { background-color:#00800036; }
|
||||
fieldset.inner>div.output>div.project div.item.modify { background-color:#00800036; }
|
||||
body.black tr.line.select { background-color:darkblue; } body.black tr.line:hover { background-color:darkblue; }
|
||||
body.white tr.line.select { background-color:dimgray; } body.white tr.line:hover { background-color:dimgray; }
|
||||
|
@ -121,7 +121,8 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb) { var paths = can.core.Sp
|
||||
}), can.ui.content._plugin = msg._plugin, can.ui.profile._plugin = msg._profile
|
||||
can.page.SelectChild(can, can.ui._profile.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() && !isSpace())
|
||||
})
|
||||
can.onimport.layout(can), can.ui.current && can.onmotion.toggle(can, can.ui.current, !isIndex() && !isSpace())
|
||||
skip || can.onmotion.delay(can, function() { can.onaction.selectLine(can, can.Option(nfs.LINE), true) }), can.base.isFunc(cb) && cb(), cb = null
|
||||
var ls = can.onexport.path(can).split(nfs.PS); if (ls.length > 4) { ls = [ls.slice(0, 2).join(nfs.PS)+"/.../"+ls.slice(-2).join(nfs.PS)] }
|
||||
can.Status(kit.Dict(nfs.FILE, ls.join(nfs.PS)))
|
||||
@ -144,9 +145,13 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb) { var paths = can.core.Sp
|
||||
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.onmotion.clear(can, can.ui.project), can.onimport.zone(can, can.core.Item(can.onfigure, function(name, cb) {
|
||||
if (can.base.isFunc(cb)) { return {name: name, _trans: can.onfigure._trans? can.onfigure._trans[name]||"": "", _init: function(target, zone) { return cb(can, target, zone, path) }} }
|
||||
}), can.ui.project) },
|
||||
project: function(can, path) {
|
||||
can.page.style(can, can.ui.project, "visibility", "hidden")
|
||||
can.onmotion.clear(can, can.ui.project), can.onimport.zone(can, can.core.Item(can.onfigure, function(name, cb) {
|
||||
if (can.base.isFunc(cb)) { return {name: name, _trans: can.onfigure._trans? can.onfigure._trans[name]||"": "", _init: function(target, zone) { return cb(can, target, zone, path) }} }
|
||||
}), can.ui.project)
|
||||
can.page.style(can, can.ui.project, "visibility", "visible")
|
||||
},
|
||||
profile: function(can, msg) { var _msg = can.db.tabview[can.onexport.keys(can)]; _msg.Option(html.WIDTH, msg.Option(html.WIDTH)||0.5)
|
||||
if (msg.Result().indexOf("<iframe src=") > -1) { if (_msg._profile != can.ui._profile) { can.page.Remove(can, _msg._profile) }
|
||||
var src = can.page.Select(can, can.page.Create(can, html.DIV, msg.Result()), html.IFRAME, function(target) { return target.src })[0]
|
||||
@ -165,7 +170,7 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb) { var paths = can.core.Sp
|
||||
},
|
||||
display: function(can, msg) { var _msg = can.db.tabview[can.onexport.keys(can)]; _msg.Option(html.HEIGHT, msg.Option(html.HEIGHT))
|
||||
var height = can.onexport.size(can, _msg.Option(html.HEIGHT)||0.5, can.ui._content.offsetHeight||can.ConfHeight()); can.page.style(can, can.ui.display, html.MAX_HEIGHT, height)
|
||||
var width = can.ui._content.offsetWidth+can.ui.profile.offsetWidth||can.ConfWidth()-can.ui.project.offsetWidth
|
||||
var width = can.ConfWidth()-can.ui.project.offsetWidth
|
||||
can.onimport.process(can, msg, can.ui.display, height, width, function(sub) { if (sub.ConfHeight() < can.ui._content.offsetHeight-100) { can.page.style(can, sub._output, html.MAX_HEIGHT, "") }
|
||||
can.onmotion.delay(can, function() { var _height = can.base.Max(sub._target.offsetHeight, height)
|
||||
_msg.Option(html.HEIGHT, _height), can.onimport.layout(can), sub.onimport.size(sub, _height == height? _height-1: _height, width, true)
|
||||
@ -204,7 +209,7 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb) { var paths = can.core.Sp
|
||||
can.onimport.tabview(can, item.path, can.base.trimPrefix(item.file, nfs.PWD), parseInt(item.line)); return true
|
||||
}, can.base.isFunc(cb) && cb(sub) }, can.ui.plug.parentNode, can.ui.plug), can.page.isDisplay(can.ui.plug) || can.onmotion.toggle(can, can.ui.plug, true) && can.onimport.layout(can)
|
||||
},
|
||||
layout: function(can) { if (can.isSimpleMode()) { return can.page.style(can, can.ui.content, html.WIDTH, can.ConfWidth()) } if (can.isCmdMode()) { can.ConfHeight(can.page.height()), can.ConfWidth(can.page.width()) }
|
||||
layout: function(can) { if (can.isSimpleMode()) { return can.page.style(can, can.ui.content, html.WIDTH, can.ConfWidth()) } if (can.isCmdMode()) { can.ConfHeight(can.page.height()) }
|
||||
var content = can.ui.content; if (content._root) { can.ui.content = content._root } can.ui.size = {profile: can._msg.Option(html.WIDTH), display: can._msg.Option(html.HEIGHT)}
|
||||
can.ui.layout(can.ConfHeight(), can.ConfWidth(), 0, function(height, width) { can.ui.content = content, can.onlayout.layout(can, height, width)
|
||||
var sub = can.ui.profile._plugin; sub && can.page.isDisplay(can.ui.profile) && sub.onimport.size(sub, can.ui.profile.offsetHeight, can.ui.profileWidth, true)
|
||||
@ -228,10 +233,8 @@ Volcanos(chat.ONFIGURE, {
|
||||
can.onimport.tree(can, can.core.List(msg.Table(), function(item) {
|
||||
if (path == args[0] && args[1].indexOf(item.path) == 0) { item.expand = true } return item
|
||||
}), nfs.PATH, nfs.PS, function(event, item) { can.onimport.tabview(can, path, item.path) }, target), zone._total(msg.Length())
|
||||
}, true) } if (path.length == 1) { return show(target, zone, path[0]) }
|
||||
can.onimport.zone(can, can.core.List(path, function(path) {
|
||||
return kit.Dict(mdb.NAME, path, path == args[0]? chat._INIT: chat._DELAY_INIT, function(target, zone) { show(target, zone, path) })
|
||||
}), target), can.page.Remove(can, zone._action)
|
||||
}, true) } if (path.length == 1) { return show(target, zone, path[0]) } can.page.Remove(can, zone._action)
|
||||
can.onimport.zone(can, can.core.List(path, function(path) { return kit.Dict(mdb.NAME, path, path == args[0]? chat._INIT: chat._DELAY_INIT, function(target, zone) { show(target, zone, path) }) }), target)
|
||||
},
|
||||
module: function(can, target, zone) { zone._delay_init = function() { can.runAction({}, mdb.INPUTS, [ctx.INDEX], function(msg) {
|
||||
can.onimport.tree(can, msg.Table(), ctx.INDEX, nfs.PT, function(event, item) { can.onimport.tabview(can, "", item.index, ctx.INDEX) }, target), zone._total(msg.Length())
|
||||
@ -243,30 +246,25 @@ Volcanos(chat.ONFIGURE, {
|
||||
},
|
||||
})
|
||||
Volcanos(chat.ONLAYOUT, {
|
||||
_split: function(can, type) { var target = can.ui.content, msg = target._msg
|
||||
_split: function(can, type) { var target = can.ui.content, msg = target._msg, scroll = target.scrollTop
|
||||
var style = type == html.FLOW? {height: target.offsetHeight/2, width: target.offsetWidth}: {height: target.offsetHeight, width: parseInt(target.offsetWidth/2)}
|
||||
var layout = can.page.insertBefore(can, [{view: [[html.LAYOUT, type]]}], target); layout.appendChild(target), can.page.style(can, target, style)
|
||||
var right = can.page.Append(can, layout, [{view: html.CONTENT, style: style}])._target; layout._root = right._root = target._root = target._root||layout, right._msg = msg
|
||||
msg._content = target._root, can.onmotion.cache(can, function() { return can.onexport.keys(can) }, right)
|
||||
var right = can.page.Append(can, layout, [{view: html.CONTENT, style: style}])._target; can.onmotion.cache(can, function() { return can.onexport.keys(can) }, right)
|
||||
can.ui.content = right, right._max = 0, can.page.SelectChild(can, target, "tr.line", function(target) { can.onaction.appendLine(can, can.page.SelectOne(can, target, "td.text").innerText, right) })
|
||||
layout.parentNode == can.ui._profile.parentNode && can.page.Append(can, target, [{view: ["tips", "", msg.Option(nfs.FILE)]}]), can.page.Append(can, right, [{view: ["tips", "", msg.Option(nfs.FILE)]}])
|
||||
right.scrollTop = target.scrollTop = scroll, right._msg = msg, msg._content = layout._root = right._root = target._root = target._root||layout
|
||||
},
|
||||
split: function(can) { can.onlayout._split(can, html.FLOW) },
|
||||
vsplit: function(can) { can.onlayout._split(can, html.FLEX) },
|
||||
close: function(can) { var target = can.ui.content; if (!target._root) { return target._msg._tab._close() }
|
||||
var right = target.nextSibling||target.previousSibling, close = target._msg._tab._close
|
||||
close: function(can) { var target = can.ui.content, close = target._msg._tab._close; if (!target._root) { return close() }
|
||||
var list = can.core.Item(target._cache); if (list.length > 0) { var key = target._cache_key, msg = can.db.tabview[key]
|
||||
return can.onmotion.cache(can, function() { return list[0] }, target), delete(target._cache[key]), msg._tab._close()
|
||||
}
|
||||
if (target.parentNode.childElementCount == 2) {
|
||||
if (can.page.ClassList.has(can, target.parentNode, html.FLEX)) {
|
||||
can.page.style(can, right, html.WIDTH, right.offsetWidth+target.offsetWidth)
|
||||
} else {
|
||||
can.page.style(can, right, html.HEIGHT, right.offsetHeight+target.offsetHeight)
|
||||
}
|
||||
if (target.parentNode.parentNode == can.ui._profile.parentNode && right._msg) { right._msg._content = right }
|
||||
can.page.insertBefore(can, right, target.parentNode), target = target.parentNode
|
||||
} close(), can.page.Remove(can, target), can.ui.content = right, can.onimport.layout(can)
|
||||
} var right = target.nextSibling||target.previousSibling; if (can.page.ClassList.has(can, target.parentNode, html.FLEX)) { can.page.style(can, right, html.WIDTH, right.offsetWidth+target.offsetWidth) } else { can.page.style(can, right, html.HEIGHT, right.offsetHeight+target.offsetHeight) }
|
||||
if (target.parentNode.childElementCount == 2) { if (target.parentNode.parentNode == can.ui._profile.parentNode && right._msg) { right._msg._content = right }
|
||||
can.page.insertBefore(can, right, target.parentNode), can.page.Remove(can, target.parentNode)
|
||||
} else {
|
||||
can.page.Remove(can, target)
|
||||
} close(), can.ui.content = right, can.onimport.layout(can)
|
||||
},
|
||||
layout: function(can, height, width) { var target = can.ui.content._root||can.ui.content
|
||||
function layout(target, height, width) { can.page.style(can, target, html.HEIGHT, height, html.WIDTH, width)
|
||||
@ -277,32 +275,27 @@ Volcanos(chat.ONLAYOUT, {
|
||||
} layout(target, height||target.offsetHeight, width||target.offsetWidth)
|
||||
},
|
||||
})
|
||||
Volcanos(chat.ONSYNTAX, {_init: function(can, msg, cb) {
|
||||
var key = can.onexport.keys(can), path = msg.Option(nfs.PATH, can.Option(nfs.PATH)), file = msg.Option(nfs.FILE, can.Option(nfs.FILE))
|
||||
Volcanos(chat.ONSYNTAX, {_init: function(can, msg, cb) { var key = can.onexport.keys(can), path = msg.Option(nfs.PATH, can.Option(nfs.PATH)), file = msg.Option(nfs.FILE, can.Option(nfs.FILE))
|
||||
if (msg._content) { var list = can.page.Select(can, msg._content, html.DIV_CONTENT, function(target) { if (target._cache_key == key) { return target } })
|
||||
if (list.length > 0) { can.onmotion.select(can, msg._content, html.DIV_CONTENT, list[0]) } else {
|
||||
var list = can.page.Select(can, msg._content, html.DIV_CONTENT, function(target) { if (target._cache && target._cache[key]) { return target } })
|
||||
if (list.length > 0) { can.onmotion.cache(can, function(cache_data) { return key }, list[0]) }
|
||||
} return can.ui.content = list[0]||msg._content, cb(msg._content)
|
||||
}
|
||||
var content = can.ui.content; if (content._root) { can.onmotion.cache(can, function(cache_data) { return key }, content) }
|
||||
if (can.base.Ext(file) == nfs.SVG) { msg.Option(ctx.INDEX, web.WIKI_DRAW+mdb.FS+path+file) }
|
||||
if (msg.Option(ctx.INDEX)) { return can.onsyntax._index(can, msg, function(target) {
|
||||
can.ui.content = target, cb(msg._content = content._root? (target._root = content._root): target) }, content._root? content: can.ui._profile.parentNode)
|
||||
}
|
||||
} var content = can.ui.content; if (content._root) { can.onmotion.cache(can, function(cache_data) { return key }, content) }
|
||||
if (can.onexport.parse(can) == nfs.SVG) { msg.Option(ctx.INDEX, web.WIKI_DRAW+mdb.FS+path+file) }
|
||||
if (msg.Option(ctx.INDEX)) { return can.onsyntax._index(can, msg, function(target) { can.ui.content = target, cb(msg._content = content._root? (target._root = content._root): target) }, content._root? content: can.ui._profile.parentNode) }
|
||||
function show(p) {
|
||||
if (content._root) { can.page.Append(can, content, [{view: ["tips", "", file]}]) } else {
|
||||
if (can.db.history.length > 1) { content = can.ui.content = can.page.insertBefore(can, [{view: html.CONTENT, style: {width: can.ui.content.offsetWidth}}], can.ui._profile) }
|
||||
content._cache_key = key
|
||||
} content._msg = msg, can.ui.content._max = 0, msg.__content = content
|
||||
if (can.db.history.length > 1) { content = can.ui.content = can.page.insertBefore(can, [{view: html.CONTENT, style: {width: can.ui.content.offsetWidth}}], can.ui._profile) } content._cache_key = key
|
||||
} content._max = 0, content._msg = msg, msg.__content = content
|
||||
can.page.style(can, can.ui.content, "visibility", "hidden")
|
||||
if (msg.Length() > 0) { can.onsyntax._change(can, msg), can.onaction.rerankLine(can, "tr.line:not(.delete)>td.line")
|
||||
can.page.Select(can, content, "tr.line.delete>td.line", function(target) { target.innerHTML = "" })
|
||||
} else { can.core.List(msg.Result().split(lex.NL), function(item) { can.onaction.appendLine(can, item) }) }
|
||||
can.page.style(can, can.ui.content, "visibility", "visible")
|
||||
can.onengine.signal(can, VIEW_CREATE, msg), can.base.isFunc(cb) && cb(msg._content = content._root? content._root: content)
|
||||
} can.require(["inner/syntax.js"], function() { var parse = can.base.Ext(file); can.Conf(chat.PLUG) && (can.onsyntax[parse] = can.Conf(chat.PLUG))
|
||||
var p = can.onsyntax[parse]; !p? can.runAction({}, mdb.PLUGIN, [parse, file, path], function(msg) {
|
||||
show(p = can.onsyntax[parse] = can.base.Obj(msg.Result()||"{}"))
|
||||
}): show(p)
|
||||
} can.require(["inner/syntax.js"], function() { var parse = can.onexport.parse(can); can.Conf(chat.PLUG) && (can.onsyntax[parse] = can.Conf(chat.PLUG))
|
||||
var p = can.onsyntax[parse]; !p? can.runAction({}, mdb.PLUGIN, [parse, file, path], function(msg) { show(p = can.onsyntax[parse] = can.base.Obj(msg.Result()||"{}")) }): show(p)
|
||||
})
|
||||
},
|
||||
_space: function(can, msg, cb, parent) { if (can.Option(nfs.LINE) == web.SPACE) { can.ui.zone.space && can.onmotion.delay(can, function() { can.ui.zone.space.refresh() }, 1000)
|
||||
@ -314,14 +307,14 @@ Volcanos(chat.ONSYNTAX, {_init: function(can, msg, cb) {
|
||||
if (item.index == web.CODE_XTERM && item.args.length > 0) { item.style = html.OUTPUT }
|
||||
can.onimport.plug(can, item, function(sub) { sub.onimport.size(sub, can.ui.content.offsetHeight, can.ui.content.offsetWidth, true)
|
||||
sub.onimport._open = function(sub, msg, arg) { can.onimport.tabview(can, "", arg, web.SPACE), sub.Update() }
|
||||
sub.onaction.close = function() { can.onaction.back(can), msg._tab._close() }
|
||||
sub.onaction.close = function() { msg._tab._close() }
|
||||
sub.onexport.title = function(_, title) { can.page.Modify(can, can.page.SelectOne(can, msg._tab, html.SPAN_NAME), title) }
|
||||
sub.onexport.record = function(_, value, key, item) { item.file && can.onimport.tabview(can, item.path, item.file, item.line); return true }
|
||||
sub.onexport.output = function() { can.onimport.layout(can) }
|
||||
msg._plugin = sub, can.base.isFunc(cb) && cb(sub._target), sub.Focus()
|
||||
}, parent)
|
||||
},
|
||||
_parse: function(can, line) { var parse = can.base.Ext(can.Option(nfs.FILE))
|
||||
_parse: function(can, line) { var parse = can.onexport.parse(can)
|
||||
function wrap(text, type) { return can.page.Format(html.SPAN, can.page.trans(can, text), type) }
|
||||
var p = can.onsyntax[parse]||{}; p = can.onsyntax[p.link]||p, p.split = p.split||{}
|
||||
if (p.prefix && can.core.Item(p.prefix, function(pre, type) { if (can.base.beginWith(line, pre)) { return line = wrap(line, type) } }).length > 0) { return line }
|
||||
@ -381,8 +374,7 @@ Volcanos(chat.ONACTION, {
|
||||
can.onaction._getContent(can, ui._target), can.onaction.selectLine(can, ui.tr)
|
||||
}, ondblclick: function(event) { can.onaction.find(event, can) }},
|
||||
{view: [mdb.TEXT, html.TD, can.onsyntax._parse(can, value)], onclick: function(event) {
|
||||
can.onaction._getContent(can, ui._target), can.onaction.selectLine(can, ui.tr), can.onkeymap._insert && can.onkeymap._insert(event, can, 0, (event.offsetX)/12-1)
|
||||
if (event.metaKey) { if (ui.text.innerText.indexOf(web.HTTP) > -1) { var ls = (/(http[^ ]+)/).exec(ui.text.innerText); if (ls && ls[1]) { can.user.open(ls[1]) } } }
|
||||
can.onaction._getContent(can, ui._target), can.onaction.selectLine(can, ui.tr), can.onkeymap._insert && can.onkeymap._insert(event, can, 0, (event.offsetX)/8.5)
|
||||
}, ondblclick: function(event) { can.onaction.searchLine(event, can, can.onexport.selection(can, ui.text.innerText)) }}
|
||||
]}]); return ui._target },
|
||||
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) }) },
|
||||
@ -399,35 +391,20 @@ Volcanos(chat.ONACTION, {
|
||||
return parseFloat((can.current.line.offsetTop-content.scrollTop)/can.current.line.offsetHeight)
|
||||
}, window: function() { return parseFloat(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), text: can.current.text()})
|
||||
can.isCmdMode() && can.misc.sessionStorage(can, SELECT_LINE+nfs.DF+can.Option(nfs.PATH)+can.Option(nfs.FILE), can.onexport.line(can, can.current.line))
|
||||
can.onexport.hash(can), scroll && can.onaction.scrollIntoView(can), can.onengine.signal(can, LINE_SELECT, can._msg)
|
||||
})
|
||||
if (content._root) {
|
||||
can.onmotion.select(can, content.parentNode, "*", content)
|
||||
}
|
||||
if (can.isCmdMode()) { can.misc.sessionStorage(can, SELECT_LINE+nfs.DF+can.Option(nfs.PATH)+can.Option(nfs.FILE), can.onexport.line(can, can.current.line))
|
||||
can.user.isWebview && can.misc.localStorage(can, CURRENT_FILE, [can.Option(nfs.PATH), can.Option(nfs.FILE), can.onexport.line(can, can.current.line)].join(nfs.DF))
|
||||
} return can.onexport.line(can, line)
|
||||
}); return can.onexport.line(can, line)
|
||||
},
|
||||
scrollIntoView: function(can, offset) { can.ui.content.scrollTo(0, (can.onexport.line(can, can.current.line)-can.current.window()/4)*can.current.line.offsetHeight) },
|
||||
searchLine: function(event, can, value) {
|
||||
var offset = 0; can.page.Select(can, can.ui.content, "tr.line", function(tr) {
|
||||
tr == can.current.line && can.page.Select(can, tr, "td.text>span", function(span) { offset += span.innerText.length;
|
||||
(span == event.target || span.innerText == value) && can.runAction(can.request(event, {name: value, text: can.current.text(), offset: offset-1}, can.Option()), code.NAVIGATE, [], function(msg) {
|
||||
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 })
|
||||
})
|
||||
},
|
||||
favorLine: function(event, can, value) { can.user.input(event, can, [{name: mdb.ZONE, value: "hi"}, {name: mdb.NAME, value: "hello"}], function(data) {
|
||||
can.runAction(event, code.FAVOR, [ctx.ACTION, mdb.INSERT, mdb.ZONE, data.zone||"",
|
||||
mdb.TYPE, can.db.parse, mdb.NAME, data.name||"", mdb.TEXT, (value||"").trimRight(),
|
||||
nfs.PATH, can.Option(nfs.PATH), nfs.FILE, can.Option(nfs.FILE), nfs.LINE, can.Option(nfs.LINE),
|
||||
], function() { can.user.toastSuccess(can) })
|
||||
searchLine: function(event, can, value) { var offset = 0; can.page.Select(can, can.ui.content, "tr.line", function(tr) {
|
||||
tr == can.current.line && can.page.Select(can, tr, "td.text>span", function(span) { offset += span.innerText.length;
|
||||
(span == event.target || span.innerText == value) && can.runAction(can.request(event, {name: value, text: can.current.text(), offset: offset-1}, can.Option()), code.NAVIGATE, [], function(msg) {
|
||||
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 })
|
||||
}) },
|
||||
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) { 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) }) },
|
||||
show: function(event, can) { can.runAction(can.request(event, {_toast: "渲染中..."}), mdb.RENDER, [can.db.parse, can.Option(nfs.FILE), can.Option(nfs.PATH)], function(msg) { can.onimport.profile(can, msg) }) },
|
||||
show: function(event, can) { can.runAction(can.request(event, {_toast: "渲染中..."}), 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: "执行中..."}), 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) {
|
||||
function show(value) { input.cancel(); var sub = can.db.toolkit[value]; if (sub) { sub.select(); return } can.onimport.toolkit(can, {index: value}, function(sub) { can.db.toolkit[value] = sub.select() }) }
|
||||
var input = can.user.input(event, can, [{type: html.TEXT, name: ctx.INDEX, run: function(event, cmds, cb) { can.run(event, cmds, function(msg) {
|
||||
@ -453,17 +430,15 @@ Volcanos(chat.ONACTION, {
|
||||
case ssh.SHELL: return can.onimport.tabview(can, "", [web.CODE_XTERM, list[0].slice(6)].join(mdb.FS), ctx.INDEX)
|
||||
case cli.OPENS: return can.runAction(event, ls[0], ls[1], null, true)
|
||||
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 vimer open float"})
|
||||
} }); can.page.Modify(can, input._target, {className: "input vimer open float"})
|
||||
can.page.style(can, input._target, html.LEFT, can.ui.project.offsetWidth+(can._output.offsetWidth)/4-34, html.TOP, can._output.offsetHeight/4, html.RIGHT, "")
|
||||
},
|
||||
find: function(event, can) { var last = can.onexport.line(can, can.current.line)
|
||||
var ui = can.page.Append(can, can._output, [{view: "input vimer 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) { if (parseInt(text) > 0) { return can.onaction.selectLine(can, parseInt(text)) && meta.close() }
|
||||
for (begin; begin <= can.ui.content._max; begin++) { if (can.onexport.text(can, can.onaction._getLine(can, begin)).indexOf(text) > -1) {
|
||||
return last = begin, can.onaction.selectLine(can, begin, true)
|
||||
} } last = 0, can.user.toast(can, "已经到最后一行")
|
||||
}
|
||||
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) {
|
||||
return last = begin, can.onaction.selectLine(can, begin, true)
|
||||
} } last = 0, can.user.toast(can, "已经到最后一行") }
|
||||
function complete(target, button) {
|
||||
can.onappend.figure(can, {action: "key", mode: chat.SIMPLE, _enter: function(event) {
|
||||
if (event.ctrlKey) { meta.grep() } else { meta[button](), can.onmotion.delay(can, function() { target.focus() }) } return true
|
||||
@ -476,10 +451,9 @@ Volcanos(chat.ONACTION, {
|
||||
}), cb(msg) }}, target)
|
||||
}
|
||||
function grep(value, file, path) { var arg = can.core.List(arguments); can.onimport.exts(can, "inner/search.js", function(sub) {
|
||||
can.page.isDisplay(sub._target) || (sub._delay_init = false, sub.select())
|
||||
sub.runAction(can.request({}, {value: value}), nfs.GREP, arg)
|
||||
can.page.isDisplay(sub._target) || (sub._delay_init = false, sub.select()), sub.runAction(can.request({}, {value: value}), nfs.GREP, arg)
|
||||
}) }
|
||||
var meta = can.onappend._action(can, [
|
||||
var from, to; var meta = can.onappend._action(can, [
|
||||
{type: html.TEXT, name: nfs.FROM, style: {width: 200}, _init: function(target) { from = target, complete(target, nfs.FIND), can.onmotion.delay(can, function() { target.focus() }) }},
|
||||
{type: html.BUTTON, name: nfs.FIND}, {type: html.BUTTON, name: nfs.GREP}, {type: html.TEXT, name: nfs.TO, _init: function(target) { to = target, complete(target, nfs.REPLACE) }},
|
||||
{type: html.BUTTON, name: nfs.REPLACE}, {type: html.BUTTON, name: cli.CLOSE},
|
||||
@ -491,7 +465,7 @@ Volcanos(chat.ONACTION, {
|
||||
grep(from.value, can.Option(nfs.FILE), can.Option(nfs.PATH))
|
||||
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) },
|
||||
}); var from, to
|
||||
})
|
||||
},
|
||||
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 }
|
||||
@ -499,32 +473,30 @@ Volcanos(chat.ONACTION, {
|
||||
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) }
|
||||
},
|
||||
refresh: function(event, can, button) { can.run(event, [can.Option(nfs.PATH), can.Option(nfs.FILE)], function(msg) { can._msg.result = msg.result, can.onmotion.clear(can, can.ui.content)
|
||||
can.ui.content._max = 0, can.core.List(msg.Result().split(lex.NL), function(item) { can.onaction.appendLine(can, item) }), can.user.toastSuccess(can)
|
||||
}) },
|
||||
onkeydown: function(event, can) {
|
||||
if (can.page.tagis(event.target, html.TD)) { return }
|
||||
// if (can.page.tagis(event.target, html.TD)) { return }
|
||||
if (can.onkeymap.selectCtrlN(event, can, can.ui.tabs, html.DIV_TABS)) { return }
|
||||
can.db._key_list = can.onkeymap._parse(event, can, mdb.PLUGIN, can.db._key_list, can.ui.content)
|
||||
},
|
||||
})
|
||||
Volcanos(chat.ONEXPORT, {list: [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(nfs.DF) },
|
||||
line: function(can, line) { return parseInt(can.core.Value(can.page.SelectOne(can, line, "td.line"), "innerText")) },
|
||||
path: function(can) { return can.Option(nfs.PATH)+can.Option(nfs.FILE) },
|
||||
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.SelectOne(can, line, "td.text"), "innerText") },
|
||||
content: function(can) { return can.page.Select(can, can.current&&can.current.content||can.ui.content, "td.text", function(item) { return item.innerText }).join(lex.NL) },
|
||||
position: function(can, index, total) { total = total||can.ui.content._max; return (parseInt(index))+nfs.PS+parseInt(total)+" = "+parseInt((index)*100/total)+"%" },
|
||||
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) },
|
||||
hash: function(can) { return can.misc.SearchHash(can, can.Option(nfs.PATH), can.Option(nfs.FILE), can.Option(nfs.LINE)) },
|
||||
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
|
||||
},
|
||||
parse: function(can) { return can.base.Ext(can.Option(nfs.FILE)) },
|
||||
split: function(can, file) { var ls = file.split(nfs.PS); if (ls.length == 1) { return [nfs.PWD, ls[0]] }
|
||||
if (ls[0] == ice.USR) { return [ls.slice(0, 2).join(nfs.PS)+nfs.PS, ls.slice(2).join(nfs.PS)] }
|
||||
return [ls.slice(0, 1).join(nfs.PS)+nfs.PS, ls.slice(1).join(nfs.PS)]
|
||||
},
|
||||
hash: function(can) { return can.misc.SearchHash(can, can.Option(nfs.PATH), can.Option(nfs.FILE), can.Option(nfs.LINE)) },
|
||||
func: function(can) { var p = can.onsyntax[can.base.Ext(can.Option(nfs.FILE))]||{}, opts = {}
|
||||
func: function(can) { var p = can.onsyntax[can.onexport.parse(can)]||{}, opts = {}
|
||||
function indent(text) { var indent = 0; for (var i = 0; i < text.length; i++) { switch (text[i]) {
|
||||
case lex.TB: indent+=4; break
|
||||
case lex.SP: indent++; break
|
||||
@ -533,18 +505,18 @@ Volcanos(chat.ONEXPORT, {list: [nfs.FILE, nfs.LINE, ice.BACK],
|
||||
var list = [], current = can.Option(nfs.LINE), percent = " = "+parseInt(can.Option(nfs.LINE)*100/(can.ui.content._max||1))+"%"
|
||||
can.page.Select(can, can.ui.content, "tr.line>td.text", function(item, index) { var text = item.innerText, _indent = indent(text)
|
||||
function push(item) { list.push(item+(item? nfs.DF+(index+1): "")); if (index < can.Option(nfs.LINE)) { current = list[list.length-1], percent = " = "+parseInt((index+1)*100/(can.ui.content._max||1))+"%" } }
|
||||
if (p.func) { p.func(can, push, text, _indent, opts) }
|
||||
p.func && p.func(can, push, text, _indent, opts)
|
||||
}); return {list: list, current: current, percent: percent}
|
||||
},
|
||||
})
|
||||
Volcanos(chat.ONKEYMAP, {
|
||||
_mode: {plugin: {
|
||||
Escape: shy("切换模式", function(event, can) { can.onaction.clear(event, can) }),
|
||||
Escape: shy("清除浮窗", function(event, can) { can.onaction.clear(event, can) }),
|
||||
f: shy("打开文件", function(event, can) { can.onaction.open(event, can) }),
|
||||
g: shy("查找搜索", function(event, can) { can.onaction.find(event, can) }),
|
||||
d: shy("查找函数", function(event, can) { can.page.Select(can, can.ui.path, "span.func", function(target) { target.click() }) }),
|
||||
v: shy("渲染界面", function(event, can) { can.onaction.show(event, can) }),
|
||||
r: shy("执行命令", function(event, can) { can.onaction.exec(event, can) }),
|
||||
f: shy("打开文件", function(event, can) { can.onaction.open(event, can) }),
|
||||
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) }),
|
||||
l: shy("打开右边标签", function(can) { var next = can._tab.nextSibling; next && next.click() }),
|
||||
h: shy("打开左边标签", function(can) { var prev = can._tab.previousSibling; prev && prev.click() }),
|
||||
x: shy("关闭标签", function(can) { can._tab._close() }),
|
||||
|
@ -1,6 +1,4 @@
|
||||
fieldset.vimer>div.output>div.project>div.zone.space div.item.stop { color:gray; }
|
||||
fieldset.vimer>div.output>div.layout>div.path span.mode.normal { background-color:blue; color:white; }
|
||||
fieldset.vimer>div.output>div.layout>div.path span.mode.insert { background-color:red; color:white; }
|
||||
fieldset.vimer>div.output>div.layout>div.layout div.content input.current { background-color:transparent; color:transparent; padding-left:10px; height:20px; position:absolute; }
|
||||
fieldset.vimer>div.output>div.layout>div.layout div.content div.complete { background-color:unset; padding-top:0; display:none; overflow:auto; position:absolute; }
|
||||
fieldset.vimer>div.output>div.layout>div.layout div.content div.complete div.prefix { color:transparent; white-space:pre; float:left; }
|
||||
|
@ -76,8 +76,8 @@ Volcanos(chat.ONACTION, {list: ["编译", "变更", "源码", "终端", "导图"
|
||||
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.base.Ext(can.Option(nfs.FILE)) == nfs.GO) { var line = can.onaction.selectLine(can); can.onmotion.clear(can, can.ui.content)
|
||||
can.onaction._run(event, can, button, [can.onexport.parse(can), can.Option(nfs.FILE), can.Option(nfs.PATH)], function(msg) {
|
||||
if (can.onexport.parse(can) == nfs.GO) { var line = can.onaction.selectLine(can); can.onmotion.clear(can, can.ui.content)
|
||||
can.ui.content._max = 0, can.core.List(msg.Result().split(lex.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))
|
||||
@ -113,6 +113,7 @@ Volcanos(chat.ONACTION, {list: ["编译", "变更", "源码", "终端", "导图"
|
||||
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-can.page.Select(can, can.current.line, "td.line")[0].offsetWidth))
|
||||
can.db.mode == mdb.NORMAL && can.onkeymap._normal(can)
|
||||
if (can.ui.content._root) { can.onmotion.select(can, can.ui.content.parentNode, "*", can.ui.content) }
|
||||
}) },
|
||||
})
|
||||
Volcanos(chat.ONKEYMAP, {
|
||||
@ -128,7 +129,7 @@ Volcanos(chat.ONKEYMAP, {
|
||||
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.user.isChrome? can.current.line.offsetHeight: 5)
|
||||
can.runAction(can.request(event, {text: pre}, can.Option()), code.COMPLETE, [], function(msg) { can.page.Appends(can, target, [{view: [lex.PREFIX, html.DIV, pre]}])
|
||||
var parse = can.onsyntax[can.base.Ext(can.Option(nfs.FILE))]; can.core.CallFunc(can.core.Value(parse, code.COMPLETE), [event, can, msg, target, pre, key])
|
||||
var parse = can.onsyntax[can.onexport.parse(can)]; can.core.CallFunc(can.core.Value(parse, code.COMPLETE), [event, can, msg, target, pre, key])
|
||||
can.core.Item(can.core.Value(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)
|
||||
|
@ -1,6 +1,7 @@
|
||||
Volcanos(chat.ONIMPORT, {_init: function(can, msg, target) { can.onmotion.clear(can, target), can._display_heights = {}
|
||||
can.list = {}; var ls = can.misc.SearchHash(can)
|
||||
can.ui = can.onappend.layout(can), can.onmotion.hidden(can, can.ui.profile), can.onmotion.hidden(can, can.ui.display)
|
||||
can.onmotion.hidden(can, can.ui.project)
|
||||
can.onimport[can.Option("scale")||team.WEEK](can, msg), can.Status(mdb.COUNT, msg.Length()), can.onimport.layout(can)
|
||||
var item; if (can.isCmdMode() && ls.length > 0) { item = can.list[can.core.Keys(ls[0], ls[1])] } else if (can.sup.task) { item = can.list[can.core.Keys(can.sup.task.zone, can.sup.task.id)] } item && item.click()
|
||||
},
|
||||
|
@ -18,10 +18,9 @@ Volcanos(chat.ONIMPORT, {
|
||||
var res = can.request(); res.Echo(sub.Conf(ice.MSG_RESULT)), can.onappend._output(sub, res, sub.Conf(ctx.DISPLAY)); return
|
||||
}
|
||||
sub.run = function(event, cmds, cb) { sub.onimport.size(sub, height, can.ConfWidth(), true)
|
||||
sub.onexport.output = function() {
|
||||
can.page.SelectChild(can, can._output, html.TABLE, function(target) { can.page.style(can, target, html.MAX_HEIGHT, can.ConfHeight()-height, html.DISPLAY, html.BLOCK) })
|
||||
}
|
||||
can.run(event, (!msg.Option("_index") || msg.Option("_index") == can._index || can._index.indexOf("can.") == 0? msg[ice.MSG_PREFIX]||[]: [ice.RUN, msg.Option("_index")]).concat(cmds), cb, true)
|
||||
sub.onexport.output = function() { sub.onimport.size(sub, height, can.ConfWidth(), true)
|
||||
can.page.SelectChild(can, can._output, html.TABLE, function(target) { can.page.style(can, target, html.MAX_HEIGHT, height, html.DISPLAY, html.BLOCK) })
|
||||
}, can.run(event, (!msg.Option("_index") || msg.Option("_index") == can._index || can._index.indexOf("can.") == 0? msg[ice.MSG_PREFIX]||[]: [ice.RUN, msg.Option("_index")]).concat(cmds), cb, true)
|
||||
}
|
||||
}) })
|
||||
},
|
||||
|
2
proto.js
2
proto.js
@ -300,7 +300,7 @@ var Volcanos = shy({iceberg: "/chat/", volcano: "/frame.js", cache: {}, pack: {}
|
||||
if (libs[0][0] != ice.PS && libs[0].indexOf(ice.HTTP) != 0) { libs[0] = can._path.slice(0, can._path.lastIndexOf(ice.PS)+1)+libs[0] }
|
||||
var name = (libs[0].indexOf(ice.HTTP) == 0? libs[0]: libs[0].split(ice.QS)[0]).toLowerCase()
|
||||
function next() { can._load(name, cbs), can.require(libs.slice(1), cb, cbs) }
|
||||
meta.cache[name]? next(): (_can_path = libs[0], meta._load(name, next))
|
||||
meta.cache[name]||name==""? next(): (_can_path = libs[0], meta._load(name, next))
|
||||
},
|
||||
request: function(event) { event = event||{}, event = event._event||event
|
||||
var msg = event._msg||can.misc.Message(event, can); event._msg = msg
|
||||
|
Loading…
x
Reference in New Issue
Block a user