mirror of
https://shylinux.com/x/volcanos
synced 2025-04-25 16:58:06 +08:00
add some
This commit is contained in:
parent
01548ab7cf
commit
c9fb8d2a3e
5
const.js
5
const.js
@ -222,9 +222,7 @@ var chat = {
|
||||
"local/wiki/word.js",
|
||||
"local/team/plan.js",
|
||||
"local/mall/goods.js",
|
||||
].map(function(p) { return "/plugin/"+p }).concat([
|
||||
"/require/modules/bootstrap-icons/font/bootstrap-icons.min.css", // https://icons.getbootstrap.com/
|
||||
]),
|
||||
].map(function(p) { return "/plugin/"+p }),
|
||||
PLUGIN_LOCAL: "/plugin/local/",
|
||||
PLUGIN_STORY: "/plugin/story/",
|
||||
PLUGIN_INPUT: "/plugin/input/",
|
||||
@ -232,6 +230,7 @@ var chat = {
|
||||
PLUGIN_TABLE_JS: "/plugin/table.js",
|
||||
PLUGIN_STATE_JS: "/plugin/state.js",
|
||||
FRAME_JS: "/volcanos/frame.js",
|
||||
ICONS_CSS: "/require/modules/bootstrap-icons/font/bootstrap-icons.min.css", // https://icons.getbootstrap.com/
|
||||
|
||||
ONENGINE: "onengine", ONDAEMON: "ondaemon", ONAPPEND: "onappend", ONLAYOUT: "onlayout", ONMOTION: "onmotion", ONKEYMAP: "onkeymap",
|
||||
ONIMPORT: "onimport", ONACTION: "onaction", ONDETAIL: "ondetail", ONEXPORT: "onexport",
|
||||
|
13
frame.js
13
frame.js
@ -10,22 +10,9 @@ Volcanos(chat.ONENGINE, {_init: function(can, meta, list, cb, target) {
|
||||
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)
|
||||
// can.onengine._config(can),
|
||||
can.onengine.signal(can, chat.ONMAIN, can.request()), can.base.isFunc(cb) && cb(can)
|
||||
}), can._path = location.href
|
||||
},
|
||||
_config: function(can) { can.require(["/require/src/conf.js"], function() {}, function(can, name, sub) {
|
||||
name == chat.ONIMPORT && can.core.Item(sub.list, function(path, meta) {
|
||||
can.require([path], function() {}, function(can, name, sub) {
|
||||
name == chat.ONPLUGIN && can.core.Item(sub, function(key, cmd) {
|
||||
if (sub.hasOwnProperty(key) && can.base.isFunc(cmd)) {
|
||||
cmd.meta._path = sub._path, can.base.Copy(cmd.meta, meta)
|
||||
can.onengine.plugin(can, can.core.Keys(ice.CAN, key), cmd)
|
||||
}
|
||||
})
|
||||
})
|
||||
})
|
||||
}) },
|
||||
_search: function(event, can, msg, panel, cmds, cb) {
|
||||
var sub, mod = can, fun = can, key = ""; can.core.List(cmds[1].split(nfs.PT), function(value) { fun && (sub = mod, mod = fun, fun = mod[value], key = value) })
|
||||
if (!sub || !mod || !fun) { can.misc.Warn(ice.ErrNotFound, cmds); return can.base.isFunc(cb) && cb(msg.Echo(ice.ErrWarn, ice.ErrNotFound, cmds)) }
|
||||
|
@ -457,6 +457,7 @@ fieldset.config form.option input[name=key] { width:240px; }
|
||||
fieldset.qrcode>div.output div.code { padding:0; }
|
||||
fieldset.macos.desktop.cmd>div.output>fieldset.macos.dock { z-index:11; }
|
||||
fieldset.web.code.git.status>div.output table.content { width:100%; }
|
||||
fieldset.web.chat.iframe>form.option input[name=hash] { width:320px; }
|
||||
fieldset.can.view { font-size:14px; }
|
||||
fieldset.can.data { font-size:14px; }
|
||||
fieldset.word>form.option>div.item>input[name=path] { width:320px !important; }
|
||||
|
@ -25,7 +25,6 @@ fieldset.inner>div.output>div.layout>div.tabs>div.tabs:hover { background-color:
|
||||
fieldset.inner>div.output>div.layout>div.tabs>div.tabs.select { background-color:var(--output-bg-color); border-top-left-radius:10px; border-top-right-radius:10px; border-bottom:lightgray solid 2px; }
|
||||
fieldset.inner>div.output>div.layout>div.path { font-size:var(--code-font-size); display:none; }
|
||||
fieldset.inner>div.output>div.layout>div.layout>iframe.profile { border-left:var(--box-border); }
|
||||
// fieldset.inner>div.output>div.layout>div.layout>div.profile { white-space:pre; }
|
||||
fieldset.inner>div.output>div.layout>div.layout>div.profile h1 { text-align:left; padding:10px 0; border-bottom:var(--box-border); margin:20px 0; }
|
||||
fieldset.inner>div.output>div.layout>div.layout>div.profile h2 { padding:10px 0; border-bottom:var(--box-border); margin:20px 0; }
|
||||
fieldset.inner>div.output>div.layout>div.layout>div.profile pre>code { padding-left:10px; border-left:var(--code-border-color) solid 5px; display:block; }
|
||||
@ -53,6 +52,7 @@ fieldset.inner.cmd>div.output>div.layout>div.path span.func { padding:5px 10px;
|
||||
fieldset.inner.cmd>div.output>div.layout>div.path span.mode { padding:5px 10px; margin-left:20px; }
|
||||
fieldset.inner.cmd>div.output>div.layout>div.path span.view { font-size:22px; padding:0 5px; margin-top:-5px; float:right; }
|
||||
fieldset.inner.cmd>div.output>div.layout>fieldset.plug { bottom:32px; }
|
||||
fieldset.inner.cmd>div.output>div.layout>fieldset.plug.output { white-space:pre; }
|
||||
fieldset.inner.cmd>div.output>div.layout>div.plug { height:32px; position:fixed; right:0; bottom:0; }
|
||||
fieldset.inner.cmd>div.output>div.layout>div.plug>legend { font-size:1rem; font-style:italic; padding:0 10px; float:right; }
|
||||
fieldset.inner.cmd>div.output>div.layout>div.plug>legend>span.remove { padding:5px; }
|
||||
|
@ -29,7 +29,7 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb) { var paths = can.core.Sp
|
||||
can.onexport.session(can, PROJECT_HIDE) == html.HIDE && can.onmotion.hidden(can, can.ui.project)
|
||||
if (can.onexport.session(can, TABVIEW_HIDE) == html.HIDE) { can.onmotion.hidden(can, can.ui.project), can.onmotion.hidden(can, can.ui.tabs) }
|
||||
can.onengine.listen(can, chat.ONUNLOAD, function() { can.onexport.recover(can) })
|
||||
tool = tool||can.base.Obj(msg.Option(ice.MSG_TOOLKIT)), msg.Option(ice.MSG_TOOLKIT, "[]")
|
||||
tool = tool||(can.base.Obj(msg.Option(ice.MSG_TOOLKIT), []).reverse()), msg.Option(ice.MSG_TOOLKIT, "[]")
|
||||
case chat.FULL: // no break
|
||||
default: can.user.isMobile && can.onmotion.hidden(can, can.ui.project), can.onimport.project(can, paths), can.onimport._tabs(can)
|
||||
}
|
||||
@ -332,7 +332,7 @@ Volcanos(chat.ONLAYOUT, {
|
||||
} layout(target, height||target.offsetHeight, width||target.offsetWidth)
|
||||
},
|
||||
})
|
||||
Volcanos(chat.ONSYNTAX, {_init: function(can, msg, cb) {
|
||||
Volcanos(chat.ONSYNTAX, {_init: function(can, msg, cb) { if (!msg) { return }
|
||||
var key = can.onexport.keys(can), path = msg.Option(nfs.PATH, can.Option(nfs.PATH)), file = msg.Option(nfs.FILE, can.Option(nfs.FILE))
|
||||
can.onmotion.cache(can, function(save, load) { save({profile: can.ui.profile.className, display: can.ui.display.className})
|
||||
can.onmotion.hidden(can, can.ui.profile), can.onmotion.hidden(can, can.ui.display)
|
||||
|
@ -12,8 +12,8 @@ Volcanos(chat.ONIMPORT, {
|
||||
_clear: function(can, msg) { can.onmotion.clear(can) },
|
||||
_inner: function(can, sub, msg) { can.onappend.table(sub, msg), can.onappend.board(sub, msg), can.onmotion.story.auto(sub) },
|
||||
_field: function(can, msg, cb) { var height = can.onexport.outputHeight(can), width = can.ConfWidth()
|
||||
// height = can.base.Min(msg.Option(html.HEIGHT)||height, can.isCmdMode()? can.ConfHeight()/2: 320), width = msg.Option(html.WIDTH)||can.ConfWidth()
|
||||
msg.Table(function(item) { can.onappend._plugin(can, item, {index: item.index, args: can.base.Obj(item.args||item.arg, []), height: height, width: width}, function(sub) {
|
||||
can.onmotion.delay(can, function() { sub._target.scrollIntoView() }, 300)
|
||||
sub.run = function(event, cmds, cb) { var index = msg.Option(ice.MSG_INDEX)
|
||||
can.run(event, (!index || index == can._index || index.indexOf("can.") == 0? msg[ice.MSG_PREFIX]||[]: [ice.RUN, index]).concat(cmds), cb, true)
|
||||
}, can.page.ClassList.has(can, sub._target, html.FLOAT)? can.onmotion.float(sub): sub.onimport.size(sub, height, width, true), cb && cb(sub)
|
||||
|
@ -179,7 +179,7 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, target) { can.onmotion.clear(
|
||||
}}
|
||||
}))._target },
|
||||
tool: function(can, list, cb, target, status) { target = target||can._output, status = status||can._status
|
||||
can.core.List(list.reverse(), function(meta) { can.base.isString(meta) && (meta = {index: meta}), meta.mode = html.FLOAT
|
||||
can.core.Next(list.reverse(), function(meta, next) { can.base.isString(meta) && (meta = {index: meta}), meta.mode = html.FLOAT
|
||||
can.onimport.plug(can, meta, function(sub) {
|
||||
sub.onexport.output = function() { var width = can.ConfWidth()-(can.ui && can.ui.project? can.ui.project.offsetWidth: 0)
|
||||
can.page.style(can, can._output, html.MAX_HEIGHT, "", html.HEIGHT, "", html.WIDTH, "", html.MAX_WIDTH, "")
|
||||
@ -193,7 +193,7 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, target) { can.onmotion.clear(
|
||||
if (can.page.SelectOne(can, status, nfs.PT+html.SELECT, function(target) { can.onmotion.hidden(can, target._target), can.page.ClassList.del(can, target, html.SELECT); return target }) == sub._legend) { return }
|
||||
can.onmotion.select(can, status, html.LEGEND, sub._legend), can.onmotion.toggle(can, sub._target, true)
|
||||
can.onmotion.select(can, target, "fieldset.plug", sub._target)
|
||||
if (sub._delay_init || meta.msg) { sub._delay_init = false, meta.msg = false, sub.Update() }
|
||||
if (sub._delay_init || meta.msg) { sub._delay_init = false, meta.msg = false, (sub._inputs && sub._inputs.list || sub._inputs && sub._inputs.refresh) && sub.Update() }
|
||||
}) }, sub._delay_init = true, sub.select = function(show) {
|
||||
if (show && can.page.ClassList.has(can, sub._legend, html.SELECT)) { return sub }
|
||||
return sub._legend.click(), sub
|
||||
@ -201,6 +201,7 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, target) { can.onmotion.clear(
|
||||
sub.hidden = function() { can.onmotion.hidden(can, sub._target), can.page.ClassList.del(can, sub._legend, html.SELECT) }
|
||||
sub.onaction._close = function() { can.page.Remove(can, sub._target), can.page.Remove(can, sub._legend), can.onexport.tool(can) }
|
||||
sub.onaction.close = function() { sub.select() }, can.base.isFunc(cb) && cb(sub), can.onexport.tool(can)
|
||||
next()
|
||||
}, target)
|
||||
})
|
||||
},
|
||||
@ -212,12 +213,9 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, target) { can.onmotion.clear(
|
||||
}, sub.onaction.close = function() { can.onmotion.hidden(can, target) }, can.base.isFunc(cb) && cb(sub)
|
||||
}, target, field)
|
||||
},
|
||||
// layout: function(can) { can.ui && can.ui.layout && can.ui.layout(can.ConfHeight(), can.ConfWidth()) },
|
||||
})
|
||||
Volcanos(chat.ONLAYOUT, {
|
||||
_init: function(can, height, width) {
|
||||
can.core.CallFunc([can.onimport, html.LAYOUT], {can: can, height: height, width: width})
|
||||
},
|
||||
_init: function(can, height, width) { can.core.CallFunc([can.onimport, html.LAYOUT], {can: can, height: height, width: width}) },
|
||||
zone: function(can, height, width) { can.onlayout._init(can, height, width) },
|
||||
result: function(can, height, width) { can.onlayout._init(can, height, width) },
|
||||
simple: function(can, height, width) { can.onlayout._init(can, height, width) },
|
||||
@ -231,8 +229,9 @@ Volcanos(chat.ONLAYOUT, {
|
||||
})
|
||||
Volcanos(chat.ONEXPORT, {
|
||||
title: function(can, title) { can.sup.onexport.title(can, title) },
|
||||
table: function(can) { var msg = can._msg; if (msg.Length() == 0) { return }
|
||||
var res = [msg.append && msg.append.join(mdb.FS)]; msg.Table(function(line, index, array) { res.push(can.core.Item(line, function(key, value) { return value }).join(ice.FS)) }); return res.join(lex.NL)
|
||||
table: function(can) { var msg = can._msg; if (msg.Length() == 0) { return } var res = [msg.append && msg.append.join(mdb.FS)]
|
||||
msg.Table(function(line, index, array) { res.push(can.core.Item(line, function(key, value) { return value }).join(ice.FS)) })
|
||||
return res.join(lex.NL)
|
||||
},
|
||||
board: function(can) { var msg = can._msg; return msg.Result() },
|
||||
session: function(can, key, value) { return can.misc[can.user.isWebview? "localStorage": "sessionStorage"](can, [can.Conf(ctx.INDEX), key, location.pathname].join(":"), value == ""? "": JSON.stringify(value)) },
|
||||
|
22
proto.js
22
proto.js
@ -4,20 +4,17 @@ function shy(help, meta, list, cb) { var arg = arguments, i = 0; function next(t
|
||||
} else if (i < arg.length && (!type || type == typeof arg[i])) { return arg[i++] }
|
||||
} return cb = typeof arg[arg.length-1] == code.FUNCTION? arg[arg.length-1]: function() {}, cb.help = next(code.STRING)||"", cb.meta = next(code.OBJECT)||{}, cb.list = next(code.ARRAY)||[], cb
|
||||
}; var _can_name = "", _can_path = ""
|
||||
var Volcanos = shy({
|
||||
iceberg: "", volcano: "", frame: chat.FRAME_JS,
|
||||
cache: {}, pack: {}, args: {}}, function(name, can, libs, cb) {
|
||||
var Volcanos = shy({iceberg: "", volcano: "", frame: chat.FRAME_JS,
|
||||
_cache: {}, cache: {}, pack: {}, args: {}}, function(name, can, libs, cb) {
|
||||
var meta = arguments.callee.meta, list = arguments.callee.list; if (typeof name == code.OBJECT) {
|
||||
if (name.length > 0) { return Volcanos({panels: [{name: chat.HEADER, style: html.HIDE, state: [mdb.TIME, aaa.USERNICK]}, {name: chat.ACTION, style: html.MAIN, tool: name}, {name: chat.FOOTER, style: html.HIDE}]}) }
|
||||
var Config = name; name = Config.name||ice.CAN, _can_name = ""
|
||||
meta.iceberg = Config.iceberg||meta.iceberg, meta.volcano = Config.volcano||meta.volcano
|
||||
meta.libs = (Config.libs||chat.libs).concat(Config.list), panels = Config.panels||chat.panel_list, delete(Config.panels)
|
||||
libs = [], panels.forEach(function(p) { p && (libs = libs.concat(p.list = p.list||["/panel/"+p.name+nfs._JS, "/panel/"+p.name+nfs._CSS])) }), libs = libs.concat(Config.plugins||chat.plugin_list)
|
||||
cb = can||function(can) {
|
||||
can.require([can.frame], function() {
|
||||
can.onengine._init(can, can.Conf(Config), panels, Config._init||meta._init, can._target)
|
||||
}, function(can, key, sub) { can[key] = sub })
|
||||
}
|
||||
cb = can||function(can) { can.require([can.frame, chat.ICONS_CSS], function() {
|
||||
can.onengine._init(can, can.Conf(Config), panels, Config._init||meta._init, can._target)
|
||||
}, function(can, key, sub) { can[key] = sub }) }
|
||||
can = Config, can._follow = name, can._target = Config.target||meta.target, can._height = Config.height||meta._height, can._width = Config.width||meta._width
|
||||
}
|
||||
can = kit.proto(can||{}, kit.proto({_name: name, _path: _can_name, _load: function(name, cbs) { var cache = meta.cache[name]||[]
|
||||
@ -128,10 +125,13 @@ 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) { if (meta.version) { url += (url.indexOf("?") == -1? "?": "&")+meta.version.slice(1) }
|
||||
meta._load = function(url, cb) {
|
||||
if (meta.version) { url += (url.indexOf("?") == -1? "?": "&")+meta.version.slice(1) }
|
||||
if (meta._cache[url]) { return meta._cache[url].push(cb) } else { meta._cache[url] = [cb] }
|
||||
function _cb() { meta._cache[url].forEach(function(cb) { cb() }), delete(meta._cache[url]) }
|
||||
switch (url.split(ice.QS)[0].split(nfs.PT).pop().toLowerCase()) {
|
||||
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)
|
||||
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
|
||||
|
Loading…
x
Reference in New Issue
Block a user