1
0
mirror of https://shylinux.com/x/volcanos synced 2025-04-25 08:48:06 +08:00
This commit is contained in:
IT 老营长 @云轩领航-创始人 2023-08-21 01:33:49 +08:00
parent 2cf9dcee54
commit a25e5d1901
11 changed files with 80 additions and 37 deletions

View File

@ -69,6 +69,7 @@ var mdb = {
SEARCH: "search", ENGINE: "engine", RENDER: "render", PLUGIN: "plugin",
DETAIL: "detail",
PRUNE: "prune",
INFO: "info",
KEYS: "keys",
MAIN: "main", PAGE: "page", NEXT: "next", PREV: "prev", LIMIT: "limit", OFFEND: "offend",
@ -132,6 +133,7 @@ var tcp = {
var nfs = {
DIR: "dir", CAT: "cat", DEFS: "defs", PACK: "pack", TRASH: "trash", DIR_ROOT: "dir_root",
COPY: "copy", EDIT: "edit", SAVE: "save", LOAD: "load", FIND: "find", GREP: "grep", TAGS: "tags",
SUBJECT: "subject",
CONTENT: "content", RECENT: "recent", SCRIPT: "script", MODULE: "module", SOURCE: "source", TARGET: "target", REPOS: "repos", MASTER: "master",
PATH: "path", FILE: "file", LINE: "line", SIZE: "size",
PUSH: "push", PULL: "pull",
@ -141,6 +143,7 @@ var nfs = {
_CSS: ".css", _JS: ".js",
PWD: "./", SRC: "src/", USR: "usr/", USR_LOCAL_WORK: "usr/local/work/", SRC_DOCUMENT: "src/document/",
DF: ice.DF, PS: ice.PS, PT: ice.PT,
SRC_TEMPLATE: "src/template/",
}
var cli = {
OPENS: "opens", SYSTEM: "system", DAEMON: "daemon", ORDER: "order", BUILD: "build",
@ -277,6 +280,7 @@ var html = {PLUGIN_MARGIN: 10, ACTION_HEIGHT: 32, ACTION_MARGIN: 200,
DIV_LAYOUT: "div.layout", DIV_LAYOUT_HEAD: "div.layout.head", DIV_LAYOUT_FOOT: "div.layout.foot", DIV_LAYOUT_LEFT: "div.layout.left",
DIV_FLOAT: "div.float", DIV_TOAST: "div.toast", DIV_CARTE: "div.carte",
DESKTOP: "desktop", DIV_DESKTOP: "div.desktop", DIV_EXPAND: "div.expand",
DIV_ITEM_SELECT: "div.item.select",
}
var svg = {
GROUP: "group", PID: "pid", GRID: "grid",

View File

@ -6,7 +6,7 @@ Volcanos(chat.ONENGINE, {_init: function(can, meta, list, cb, target) { can.requ
can.onappend._init(can, item, item.list, function(sub) { can[item.name] = sub
sub.run = function(event, cmds, cb) { var msg = sub.request(event); cmds = cmds||[]; return (can.onengine[cmds[0]]||can.onengine._remote)(event, can, msg, sub, cmds, cb) }
can.core.Item(sub.onplugin, function(key, cmd) { sub.onplugin.hasOwnProperty(key) && can.base.isFunc(cmd) && can.onengine.plugin(sub, can.core.Keys(ice.CAN, key), cmd) })
can.core.ItemCB(sub.onaction, function(key, cb) { can.onengine.listen(can, key, function(msg) { can.core.CallFunc(cb, {can: sub, msg: msg}) }) })
can.core.ItemCB(sub.onaction, function(key, cb) { can.onengine.listen(can, key, function(msg) { can.core.CallFunc(cb, {event: msg._event, can: sub, msg: msg}) }) })
can.core.CallFunc([sub.onaction, chat._INIT], {can: sub, cb: next, target: sub._target}), delete(sub._history), delete(sub._conf.feature)
}, target)
}, function() { can.onlayout._init(can, target), can.onmotion._init(can, target), can.onkeymap._init(can, target)
@ -23,8 +23,8 @@ Volcanos(chat.ONENGINE, {_init: function(can, meta, list, cb, target) { can.requ
if (panel.onengine._engine(event, can, msg, panel, cmds, cb)) { return }
if (panel.onengine._static(event, can, msg, panel, cmds, cb)) { return }
var toast, _toast = msg.Option(chat._TOAST); if (_toast) { can.onmotion.delay(can, function() { if (msg._can && msg._can._toast) { return } toast = toast||can.user.toastProcess(msg._can, _toast) }, 500) }
msg.OptionDefault(ice.MSG_THEME, can.getHeader(chat.THEME), ice.MSG_LANGUAGE, can.user.info.language, ice.SESS_HEIGHT, panel.Conf(html.HEIGHT)||panel._target.offsetHeight+"", ice.SESS_WIDTH, panel.Conf(html.WIDTH)||panel.offsetWidth+"")
msg.Option(html.HEIGHT, msg.Option(html.HEIGHT)+""), msg.Option(html.WIDTH, msg.Option(html.WIDTH)+"")
msg.OptionDefault(ice.MSG_THEME, can.getHeader(chat.THEME), ice.MSG_LANGUAGE, can.user.info.language, ice.MSG_HEIGHT, panel.Conf(html.HEIGHT)||panel._target.offsetHeight+"", ice.MSG_WIDTH, panel.Conf(html.WIDTH)||panel.offsetWidth+"")
msg.Option(ice.MSG_HEIGHT, msg.Option(ice.MSG_HEIGHT)+""), msg.Option(ice.MSG_WIDTH, msg.Option(ice.MSG_WIDTH)+"")
if (can.base.isUndefined(msg[ice.MSG_DAEMON])) { var sub = msg._can; can.base.isUndefined(sub._daemon) && can.ondaemon._list[0] && (sub._daemon = can.ondaemon._list.push(sub)-1)
if (sub._daemon) { msg.Option(ice.MSG_DAEMON, can.core.Keys(can.ondaemon._list[0], sub._daemon)) }
} if (!can.misc.CookieSessid(can) && can.user.info.sessid) { msg.Option(ice.MSG_SESSID, can.user.info.sessid) }
@ -58,7 +58,7 @@ Volcanos(chat.ONENGINE, {_init: function(can, meta, list, cb, target) { can.requ
}),
listen: shy(function(can, name, cb, target) {
arguments.callee.meta[name] = (arguments.callee.meta[name]||[]).concat(cb)
if (target) { target[name] = function(event) { can.onengine.signal(can, name) } }
if (target) { target[name] = function(event) { can.onengine.signal(can, name, can.request(event)) } }
}),
signal: function(can, name, msg) { msg = msg||can.request(); var _msg = name == chat.ONREMOTE? msg.Option("_msg"): msg
_msg.Option(ice.LOG_DISABLE) == ice.TRUE || can.misc.Log(name, can._name, (msg._cmds||[]).join(lex.SP), name == chat.ONMAIN? can: _msg)
@ -383,20 +383,12 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) {
if (can.base.isObject(meta) && meta.layout) { meta.layout(h, width) }
can.page.style(can, target, html.WIDTH, width), height -= h
} else {
if (item == html.PROJECT) {
var w = 230, h = height
} else {
var w = calc(item, target.offsetWidth||target.style.width||_width/list.length, _width), h = height
}
if (item == html.PROJECT) { var w = 230, h = height } 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) }
can.page.style(can, target, html.HEIGHT, h, html.WIDTH, w), width -= w
}
}), can.core.List(list, function(item) { if (can.base.isArray(item)) { layout(type == FLOW? FLEX: FLOW, item, height, width) } }) }
ui.filter = can.onappend.input(can, {type: html.TEXT, name: web.FILTER, placeholder: "search in n items", onkeydown: function() {}, onkeyup: function(event) {
can.page.Select(can, ui.project, html.DIV_ITEM, function(target) {
can.onmotion.toggle(can, target, target.innerText.indexOf(event.target.value) > -1 || target == ui.filter.parentNode)
})
}}, "", ui.project)
if (can.onimport.filter) { ui.filter = can.onimport.filter(can, ui.project) }
ui.layout = function(height, width, delay, cb) { can.onmotion.delay(can, function() { defer = [], layout(type, ui.list, height, width), defer.forEach(function(cb) { cb() }), cb && cb(content_height, content_width) }, delay||0) }; return ui
},
tabview: function(can, meta, list, target) { var ui = can.page.Append(can, target, [html.ACTION, html.OUTPUT])
@ -601,8 +593,9 @@ Volcanos(chat.ONMOTION, {_init: function(can, target) {
},
clear: function(can, target) { return can.page.Modify(can, target||can._output, ""), target },
cache: function(can, next) { var list = can.base.getValid(can.base.Obj(can.core.List(arguments).slice(2)), [can._output])
var key = next(can._cache_data = can._cache_data||{}, list[0]._cache_key); if (key == list[0]._cache_key) { return true }
can.core.List(list, function(target) { target && target._cache_key && can.page.Cache(target._cache_key, target, target.scrollTop+1) })
var key = next(can._cache_data = can._cache_data||{}, list[0]._cache_key); return key && can.core.List(list, function(target) { if (!target) { return }
return key && can.core.List(list, function(target) { if (!target) { return }
var pos = can.page.Cache(target._cache_key = key, target); if (pos) { target.scrollTo && target.scrollTo(0, pos-1); return target }
}).length > 0
},
@ -652,6 +645,8 @@ Volcanos(chat.ONMOTION, {_init: function(can, target) {
}
}
},
touch: function() {
},
})
Volcanos(chat.ONKEYMAP, {_init: function(can, target) { target = target||document.body
can.onkeymap._build(can), target.onkeydown = function(event) { can.misc.Event(event, can, function(msg) {

View File

@ -151,8 +151,10 @@ form.option div.icon.prev { font-size:18px; }
div.item.select>span.icon { margin-left:-25px; margin-right:3px; visibility:hidden; }
div.item.select:hover>span.icon { visibility:visible; }
div.item.text { position:relative; }
div.item.text>span.icon { margin-left:-25px; margin-right:3px; cursor:pointer; }
div.item.text>span.icon.delete { position:absolute; font-size:20px; visibility:hidden; }
div.item.text>span.icon { margin-left:-25px; cursor:pointer; }
div.item.text>span.icon.delete { font-size:20px; visibility:hidden; }
/* div.item.text>span.icon { margin-left:-25px; margin-right:3px; cursor:pointer; } */
/* div.item.text>span.icon.delete { position:absolute; font-size:20px; visibility:hidden; } */
div.item.text:hover>span.icon.delete { visibility:visible; }
div.item.button>span.icon.create { font-size:32px; line-height:32px; translate:0px -2px; display:block; }
div.tabs span.icon { margin-left:5px; visibility:hidden; }
@ -199,8 +201,9 @@ svg g[fill] rect { fill:unset; }
/* output */
div.project div.list { margin-left:10px; clear:both; }
div.project div.item { padding:2px 10px; white-space:nowrap; }
div.project div.item.filter>span.icon { margin-left:-20px; }
div.project div.item.filter { padding:0; }
div.project div.item.filter>input { width:100%; }
div.project div.item.filter>input { width:100% !important; border:var(--box-border); }
div.project div.item.filter>span.delete { top: 3px; right: 5px; }
div.project div.item>div.name { padding-left:15px; }
div.project div.expand { float:left; transition:all .3s; }
@ -271,7 +274,8 @@ select { border-radius:var(--input-radius); }
input { background-color:var(--input-bg-color); color:var(--input-fg-color); border-radius:var(--input-radius); }
input[type=button]:hover { color:var(--hover-fg-color); background-color:var(--hover-bg-color); }
legend:hover { color:var(--hover-fg-color); background-color:var(--hover-bg-color); }
input:not([type=button]) { border-radius:0; border: var(--plugin-border-color) solid 1px; }
/* input:not([type=button]) { border-radius:0; border: var(--plugin-border-color) solid 1px; } */
input:not([type=button]) { border-radius:0; height:30px; }
input:not([type=button]):hover { border:var(--input-border); }
input:not([type=button]):focus { border:var(--input-border); outline:none; }
textarea { background-color:var(--input-bg-color); color:var(--input-fg-color); }

View File

@ -135,7 +135,8 @@ Volcanos("misc", {
}
return obj.pod
}
obj.pod = can.core.Keys(can.misc.Search(can, ice.POD), obj.pod); return can.misc.MergeURL(can, obj, true)
obj.pod = obj.pod||can.misc.Search(can, ice.POD); return can.misc.MergeURL(can, obj, true)
// obj.pod = can.core.Keys(can.misc.Search(can, ice.POD), obj.pod); return can.misc.MergeURL(can, obj, true)
},
MergeURL: function(can, obj, clear) { var path = location.pathname; obj._path && (path = obj._path), delete(obj._path)
can.misc.Search(can, log.DEBUG) && (obj.debug = ice.TRUE); var hash = obj._hash||""; delete(obj._hash)

View File

@ -101,6 +101,10 @@ Volcanos("user", {
}); can.onmotion.story.auto(can, ui._target), meta.resize && can.onmotion.delayResize(can, ui._target, meta.resize)
return can._toast && (can._toast.close(), delete(can._toast)), can._toast = action
},
space: function(can) { return can.Conf(web.SPACE)||can.Conf(ice.POD)||can.misc.Search(can, ice.POD) },
template: function(can, file) {
return can.base.MergeURL(can.base.Path(nfs.SRC_TEMPLATE, can.Conf(ctx.INDEX), file), ice.POD, can.user.space(can))
},
share: function(can, msg, cmds) { can.run(msg, cmds||[ctx.ACTION, chat.SHARE], function(msg) { can.user.copy(msg._event, can, msg.Append(mdb.NAME))
can.user.toast(can, {title: msg.Append(mdb.NAME), duration: -1, content: msg.Append(mdb.TEXT), action: [cli.CLOSE, cli.OPEN], resize: html.IMG})
}) },
@ -117,7 +121,7 @@ Volcanos("user", {
parent? remove_sub(parent): can.onmotion.clearCarte(can)
var msg = can.request(event); trans = trans||meta._trans
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() { can.onkeymap.prevent(event)
function click(event, button) { can.misc.Event(event, can, function() { can.onkeymap.prevent(event), can.request(event, {action: button})
meta[button]? can.core.CallFunc([meta, button], {event: event, can: can, msg: msg, button: button}): can.base.isFunc(cb)? cb(event, button, meta, carte):
can.onaction && can.onaction[button] && can.core.CallFunc([can.onaction, button], [event, can, button])
// meta._style == nfs.PATH || can.onmotion.clearCarte(can)

View File

@ -25,7 +25,12 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg) { var river = can.Conf(chat.R
})
Volcanos(chat.ONACTION, {_init: function(can, target) {
can.Conf(html.MARGIN_Y, 4*html.PLUGIN_MARGIN+html.ACTION_MARGIN), can.Conf(html.MARGIN_X, (can.user.isMobile? 2: 4)*html.PLUGIN_MARGIN)
can.onengine.listen(can, "ontouchstart", function(msg) { can.onengine.signal(can, chat.ONACTION_TOUCH, msg) }, target)
can.core.List(["ontouchstart", "ontouchmove", "ontouchend"], function(item) {
can.onengine.listen(can, item, function(event, msg) {
can.onengine.signal(can, chat.ONACTION_TOUCH, msg)
can.onaction[item](event, can)
}, target)
})
},
onsize: function(can, msg, height, width) { can.Conf({height: can.base.Min(height-can.Conf(html.MARGIN_Y), 240), width: width-can.Conf(html.MARGIN_X)}) },
onlogin: function(can, msg) { can.onimport._menu(can, msg), can.onkeymap._build(can)
@ -74,8 +79,27 @@ Volcanos(chat.ONACTION, {_init: function(can, target) {
},
onresize: function(can) { can.onaction.layout(can), window.setsize && window.setsize(can.page.width(), can.page.height()) },
ontitle: function(can, msg) { can.onlayout._storage(can, "") },
repos: function(can) { can.user.opens(can.user.info.repos) },
ontouchstart: function(event, can) { can.touch = can.touch || {}
can.touch.isStart = true, can.touch.startX = event.touches[0].clientX
},
ontouchmove: function(event, can) {
can.touch.isMove = true, can.touch.distanceX = event.touches[0].clientX - can.touch.startX
},
ontouchend: function(event, can) {
if (can.touch.isMove && Math.abs(can.touch.distanceX) > 50) {
if (can.touch.distanceX > 0) {
can.onengine.signal(can, "onslideright")
} else {
can.onengine.signal(can, "onslideleft")
}
}
can.touch.isMove = false, can.touch.distanceX = 0
can.touch.isStart = false, can.touch.startX = 0
},
mail: function(can) { can.user.opens("/chat/pod/20230511-golang-story/cmd/web.chat.mail.client") },
repos: function(can) { can.user.opens("https://repos.shylinux.com/explore/repos") },
portal: function(can) { can.user.opens(can.misc.MergePodCmd(can, {cmd: web.WIKI_PORTAL})) },
desktop: function(can) { can.user.opens(can.misc.MergePodCmd(can, {cmd: web.CHAT_MACOS_DESKTOP})) },
layout: function(can, button, skip) { can.page.ClassList.del(can, can._target, can._layout||can.onlayout._storage(can)), can._header_tabs && can.onmotion.hidden(can, can._header_tabs)
@ -84,8 +108,8 @@ Volcanos(chat.ONACTION, {_init: function(can, target) {
can.isCmdMode() || can.core.List(can._plugins, function(sub) { sub._delay_refresh = false, can.page.ClassList.set(can, sub._target, html.OUTPUT, [TABVIEW, HORIZON, VERTICAL].indexOf(button) > -1) })
var cb = can.onlayout[button]; can.base.isFunc(cb) && cb(can) || can.onlayout._plugin(can, button)
},
_menus: [[html.LAYOUT, ice.AUTO, TABS, TABVIEW, HORIZON, VERTICAL, GRID, FREE, FLOW, PAGE], "desktop", "portal", "repos"],
_trans: kit.Dict("repos", "资源", "portal", "官网", "desktop", "桌面", html.LAYOUT, "布局", ice.AUTO, "默认布局", TABS, "标签布局", TABVIEW, "标签分屏", HORIZON, "左右分屏", VERTICAL, "上下分屏", GRID, "网格布局", FREE, "自由布局", FLOW, "流动布局", PAGE, "网页布局"),
_menus: [[html.LAYOUT, ice.AUTO, TABS, TABVIEW, HORIZON, VERTICAL, GRID, FREE, FLOW, PAGE], "desktop", "portal", "repos", "mail"],
_trans: kit.Dict("mail", "邮箱", "repos", "资源", "portal", "官网", "desktop", "桌面", html.LAYOUT, "布局", ice.AUTO, "默认布局", TABS, "标签布局", TABVIEW, "标签分屏", HORIZON, "左右分屏", VERTICAL, "上下分屏", GRID, "网格布局", FREE, "自由布局", FLOW, "流动布局", PAGE, "网页布局"),
})
Volcanos(chat.ONLAYOUT, {
tabs: function(can) { can.getActionSize(function(height, width) { can.ConfHeight(height-can.Conf(html.MARGIN_Y)+html.ACTION_MARGIN), can.ConfWidth(width-can.Conf(html.MARGIN_X)) })

View File

@ -169,7 +169,7 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb) { var paths = can.core.Sp
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]||"": "", _toggle: function() { can.onimport.layout(can) }, _init: function(target, zone) { return cb(can, target, zone, path) }} }
if (can.base.isFunc(cb)) { return {name: name, icon: cb.meta? cb.meta.icon: "", _trans: can.onfigure._trans? can.onfigure._trans[name]||"": "", _toggle: function() { can.onimport.layout(can) }, _init: function(target, zone) { return cb(can, target, zone, path) }} }
}), can.ui.project) },
profile: function(can, msg) { var _msg = can.db.tabview[can.onexport.keys(can)]; _msg.Option(html.WIDTH, msg.Option(html.WIDTH)), border = 1
var height = (can.ui.content._root||can.ui.content).offsetHeight, width = can.onexport.size(can, _msg.Option(html.WIDTH)||0.5, can.ConfWidth()-can.ui.project.offsetWidth)+border

View File

@ -255,7 +255,7 @@ Volcanos(chat.ONSYNTAX, {
}
},
}, json: {split: {operator: "{[:,]}"}, keyword: {"true": code.CONSTANT, "false": code.CONSTANT}},
css: {prefix: {"// ": code.COMMENT, "/* ": code.COMMENT}, split: {operator: "{[(.,:;&>=)]}"},
css: {prefix: {"// ": code.COMMENT, "/* ": code.COMMENT}, split: {operator: "{[(.,:;&>!=)]}"},
regexp: {
"[-0-9]+deg": code.CONSTANT,
"[-0-9]+rem": code.CONSTANT,
@ -281,6 +281,9 @@ Volcanos(chat.ONSYNTAX, {
"box-sizing": code.FUNCTION, "border-box": code.CONSTANT,
"background": code.FUNCTION, "background-position": code.FUNCTION, "background-size": code.FUNCTION,
"flex": code.FUNCTION, "justify-content": code.FUNCTION,
"flex-grow": code.FUNCTION,
"flex-shrink": code.FUNCTION,
"important": code.KEYWORD,
"transition": code.FUNCTION, "transform": code.FUNCTION, "translate": code.FUNCTION, "rotate": code.FUNCTION,
"stroke-width": code.FUNCTION, "stroke": code.FUNCTION, "fill": code.FUNCTION,
"z-index": code.FUNCTION,
@ -334,6 +337,7 @@ Volcanos(chat.ONSYNTAX, {
"--plugin-bg-color": code.CONSTANT, "--plugin-fg-color": code.CONSTANT,
"--hover-bg-color": code.CONSTANT, "--hover-fg-color": code.CONSTANT,
"--notice-bg-color": code.CONSTANT, "--danger-bg-color": code.CONSTANT,
"--output-bg-color": code.CONSTANT,
"--box-border": code.CONSTANT, "--box-shadow": code.CONSTANT,
}, include: ["html"],
func: function(can, push, text) { text.indexOf("/* ") == 0 && push(can.base.trimPrefix(can.base.trimSuffix(text, " */"), "/* ")) },

View File

@ -94,8 +94,8 @@ Volcanos(chat.ONACTION, {list: ["编译", "构建", "路由", "终端", "源码"
})
},
"命令": function(event, can) { can.user.input(event, can, [{name: ctx.INDEX, need: "must"}, ctx.ARGS], function(list) { can.onimport.tabview(can, "", list[0]+(list[1]? mdb.FS+list[1]: ""), ctx.INDEX) }) },
"插件": function(event, can) { can.user.input(event, can, [{name: ctx.INDEX, need: "must"}, ctx.ARGS], function(list) { var sub = can.db.toolkit[list.join(",")]; if (sub) { sub.select(); return }
can.onimport.toolkit(can, {index: list[0], args: can.core.Split(list[1]||"")}, function(sub) { can.db.toolkit[list.join(",")] = sub.select() })
"插件": function(event, can) { can.user.input(event, can, [web.SPACE, {name: ctx.INDEX, need: "must"}, ctx.ARGS], function(list) { var sub = can.db.toolkit[list.join(",")]; if (sub) { sub.select(); return }
can.onimport.toolkit(can, {space: list[0], index: list[1], args: can.core.Split(list[2]||"")}, function(sub) { can.db.toolkit[list.join(",")] = sub.select() })
}) },
"扩展": 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) { can.onaction.compile(event, can, code.COMPILE) },

View File

@ -96,8 +96,15 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, target) { can.onmotion.clear(
}}, {view: [[html.LIST, item.expand? "": html.HIDE]]}]); node[name] = ui.list
}) }); return node
},
filter: function(can, target) {
return can.onappend.input(can, {type: html.TEXT, name: web.FILTER, placeholder: "search in n items", onkeydown: function() {}, onkeyup: function(event) {
can.page.Select(can, target, html.DIV_ITEM, function(target) {
can.onmotion.toggle(can, target, target.innerText.indexOf(event.currentTarget.value) > -1 || target == event.currentTarget.parentNode)
})
}}, "", target)
},
item: function(can, item, cb, cbs, target) { target = target||(can.ui && can.ui.project? can.ui.project: can._output)
var ui = can.page.Append(can, target, [{view: [html.ITEM, html.DIV, item.nick||item.name||item.zone], title: item.title, onclick: function(event) { can.onmotion.select(can, target, html.DIV_ITEM, event.target)
var ui = can.page.Append(can, target, [{view: html.ITEM, list: [{icon: item.icon}, {text: item.nick||item.name||item.zone}], title: item.title, onclick: function(event) { can.onmotion.select(can, target, html.DIV_ITEM, event.target)
cb(event, event.target, event.target._list && can.onmotion.toggle(can, event.target._list))
}, oncontextmenu: function(event) {
if (can.base.isFunc(cbs)) { var menu = cbs(event, ui._target); if (menu) { can.user.carteRight(event, can, menu.meta, menu.list, menu) } return }
@ -162,7 +169,7 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, target) { can.onmotion.clear(
meta.type = meta.type||html.PLUG, meta.name = meta.index, can.onappend.plugin(can, meta, function(sub) { sub.sup = can
sub.run = function(event, cmds, cb) {
if (can.page.Select(can, sub._option, "input[name=path]").length > 0 && sub.Option(nfs.PATH) == "") { sub.request(event, {path: nfs.PWD}) }
can.runActionCommand(can.request(event, can.Option()), meta.index, cmds, cb)
can.runActionCommand(can.request(event, can.Option(), {space: meta.space}), meta.index, cmds, cb)
}, sub.onaction.close = function() { can.onmotion.hidden(can, target) }, can.base.isFunc(cb) && cb(sub)
}, target, field)
},

View File

@ -27,8 +27,8 @@ var Volcanos = shy({iceberg: "/chat/", volcano: chat.FRAME_JS, cache: {}, pack:
if (libs[0] == undefined) { return can.require(libs.slice(1), cb, cbs) }
if (libs[0] == "") { libs[0] = can._path.replace(nfs._JS, nfs._CSS) }
if (libs[0].indexOf(nfs.SRC) == 0 || libs[0].indexOf(nfs.USR) == 0) { libs[0] = "/require/"+libs[0] }
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()
if (libs[0][0] != nfs.PS && libs[0].indexOf(web.HTTP) != 0) { libs[0] = can._path.slice(0, can._path.lastIndexOf(ice.PS)+1)+libs[0] }
var name = (libs[0].indexOf(web.HTTP) == 0 || libs[0].indexOf("?pod=") > -1? 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]||name==""? next(): (meta._load(name, next))
},
@ -103,10 +103,10 @@ try { if (typeof(window) == code.OBJECT) { var meta = Volcanos.meta
} catch (e) {
meta.version = window._version, window.outerWidth-window.innerWidth > 100 && (meta.version = "", debug = false)
}
meta._load = function(url, cb) {
meta._load = function(url, cb) { if (meta.version) { url += (url.indexOf("?") == -1? "?": "&")+meta.version.slice(1) }
switch (url.split(ice.QS)[0].split(nfs.PT).pop().toLowerCase()) {
case nfs.CSS: var item = document.createElement(mdb.LINK); item.href = url+meta.version, item.rel = "stylesheet", item.onload = cb, document.head.appendChild(item); break
default: var item = document.createElement(nfs.SCRIPT); item.src = url+meta.version, item.onerror = cb, item.onload = cb, document.body.appendChild(item)
case nfs.CSS: var item = document.createElement(mdb.LINK); item.href = url, item.rel = "stylesheet", item.onload = cb, document.head.appendChild(item); break
default: var item = document.createElement(nfs.SCRIPT); item.src = url, item.onerror = cb, item.onload = cb, document.body.appendChild(item)
}
}
meta.target = document.body, meta._height = window.innerHeight, meta._width = window.innerWidth