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
78806f186f
commit
8ec1f532b1
@ -1,4 +1,4 @@
|
|||||||
# volcanos
|
# volcanos
|
||||||
|
|
||||||
volcanos是一个前端框架,通过模块化、集群化、自动化,快速的创建、共享应用程序和数据。
|
volcanos 是一个前端框架,通过集群化、模块化、自动化的方式,快速的创建、共享应用程序和数据。
|
||||||
|
|
||||||
|
251
frame.js
251
frame.js
@ -1,25 +1,19 @@
|
|||||||
Volcanos(chat.ONENGINE, {_init: function(can, meta, list, cb, target) {
|
Volcanos(chat.ONENGINE, {_init: function(can, meta, list, cb, target) { can.require([can.volcano], null, function(can, key, sub) { can[key] = sub })
|
||||||
can.user.isMobile && can.require(["https://unpkg.com/vconsole@latest/dist/vconsole.min.js"], function() { return window.VConsole() })
|
if (!can.user.isMailMaster) { if (can.misc.Search(can, ice.MSG_SESSID)) { can.misc.CookieSessid(can, can.misc.Search(can, ice.MSG_SESSID)); return can.misc.Search(can, ice.MSG_SESSID, "") } }
|
||||||
if (!can.user.isMailMaster) {
|
|
||||||
if (can.misc.Search(can, ice.MSG_SESSID)) { can.misc.CookieSessid(can, can.misc.Search(can, ice.MSG_SESSID)); return can.misc.Search(can, ice.MSG_SESSID, "") }
|
|
||||||
} can._path = location.href
|
|
||||||
can.user.title(can.misc.Search(can, chat.TITLE)||can.misc.Search(can, ice.POD)||location.host)
|
can.user.title(can.misc.Search(can, chat.TITLE)||can.misc.Search(can, ice.POD)||location.host)
|
||||||
|
can.onappend.topic(can, html.DARK), can.onappend.topic(can, html.LIGHT, {panel: cli.WHITE, plugin: cli.ALICEBLUE, legend: "lightsteelblue", input: cli.WHITE, output: cli.WHITE, table: cli.ALICEBLUE,
|
||||||
|
hover: cli.ALICEBLUE, border: cli.TRANSPARENT, label: cli.BLACK, text: cli.BLACK, info: cli.BLUE, warn: cli.RED})
|
||||||
can.run = function(event, cmds, cb) { var msg = can.request(event); cmds = cmds||[]; return (can.onengine[cmds[0]]||can.onengine._remote)(event, can, msg, can, cmds, cb) }
|
can.run = function(event, cmds, cb) { var msg = can.request(event); cmds = cmds||[]; return (can.onengine[cmds[0]]||can.onengine._remote)(event, can, msg, can, cmds, cb) }
|
||||||
can.require([can.volcano], null, function(can, key, sub) { can[key] = sub })
|
|
||||||
can.core.Next(list, function(item, next) { item.type = chat.PANEL
|
can.core.Next(list, function(item, next) { item.type = chat.PANEL
|
||||||
can.onappend._init(can, can.base.Copy(item, can.core.Value(can, [chat.RIVER, item.name])), item.list, function(sub) { can[item.name] = sub
|
can.onappend._init(can, can.base.Copy(item, can.core.Value(can, [chat.RIVER, item.name])), 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) }
|
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.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, {can: sub, msg: msg}) }) })
|
||||||
can.core.CallFunc([sub.onaction, chat._INIT], {can: sub, cb: next, target: sub._target})
|
can.core.CallFunc([sub.onaction, chat._INIT], {can: sub, cb: next, target: sub._target}), delete(sub._history), delete(sub._conf.feature)
|
||||||
delete(sub._history), delete(sub._conf.feature)
|
|
||||||
}, target)
|
}, target)
|
||||||
}, function() { can.onlayout._init(can, target), can.onmotion._init(can, target), can.onkeymap._init(can, target)
|
}, function() { can.onlayout._init(can, target), can.onmotion._init(can, target), can.onkeymap._init(can, target)
|
||||||
can.onengine.listen(can, chat.ONSEARCH, function(msg, arg) { arg[0] == ctx.COMMAND && can.run(msg, ["can.command"]) })
|
|
||||||
can.onengine.signal(can, chat.ONMAIN, can.request()), can.base.isFunc(cb) && cb(can)
|
can.onengine.signal(can, chat.ONMAIN, can.request()), can.base.isFunc(cb) && cb(can)
|
||||||
})
|
})
|
||||||
can.onappend.topic(can, html.DARK), can.onappend.topic(can, html.LIGHT, {panel: cli.WHITE, plugin: cli.ALICEBLUE, legend: "lavender", input: cli.WHITE, output: cli.WHITE, table: cli.ALICEBLUE,
|
|
||||||
hover: cli.ALICEBLUE, border: cli.GLASS, label: cli.BLACK, text: cli.BLACK, info: cli.BLUE, warn: cli.RED})
|
|
||||||
},
|
},
|
||||||
_search: function(event, can, msg, panel, cmds, cb) {
|
_search: function(event, can, msg, panel, cmds, cb) {
|
||||||
var sub, mod = can, fun = can, key = ""; can.core.List(cmds[1].split(ice.PT), function(value) { fun && (sub = mod, mod = fun, fun = mod[value], key = value) })
|
var sub, mod = can, fun = can, key = ""; can.core.List(cmds[1].split(ice.PT), function(value) { fun && (sub = mod, mod = fun, fun = mod[value], key = value) })
|
||||||
@ -27,19 +21,15 @@ Volcanos(chat.ONENGINE, {_init: function(can, meta, list, cb, target) {
|
|||||||
return can.core.CallFunc(fun, {event: event, can: sub, msg: msg, cmds: cmds.slice(2), cb: cb, target: sub._target, button: key, cmd: key, arg: cmds.slice(2), list: cmds.slice(2)}, mod)
|
return can.core.CallFunc(fun, {event: event, can: sub, msg: msg, cmds: cmds.slice(2), cb: cb, target: sub._target, button: key, cmd: key, arg: cmds.slice(2), list: cmds.slice(2)}, mod)
|
||||||
},
|
},
|
||||||
_remote: function(event, can, msg, panel, cmds, cb) {
|
_remote: function(event, can, msg, panel, cmds, cb) {
|
||||||
if (panel.onengine._engine(event, can, msg, panel, cmds, cb)) { return }
|
|
||||||
if (panel.onengine._plugin(event, can, msg, panel, cmds, cb)) { return }
|
if (panel.onengine._plugin(event, can, msg, panel, cmds, cb)) { return }
|
||||||
|
if (panel.onengine._engine(event, can, msg, panel, cmds, cb)) { return }
|
||||||
if (panel.onengine._static(event, can, msg, panel, cmds, cb)) { return }
|
if (panel.onengine._static(event, can, msg, panel, cmds, cb)) { return }
|
||||||
|
|
||||||
msg.Option(ice.SESS_WIDTH) || msg.Option(ice.SESS_WIDTH, panel.Conf(html.WIDTH))
|
|
||||||
msg.Option(ice.SESS_HEIGHT) || msg.Option(ice.SESS_HEIGHT, panel.Conf(html.HEIGHT))
|
|
||||||
var toast, _toast = msg.Option(chat._TOAST); if (_toast) { can.onmotion.delay(can, function() { toast = toast||can.user.toastProcess(msg._can, _toast) }, 500) }
|
var toast, _toast = msg.Option(chat._TOAST); if (_toast) { can.onmotion.delay(can, function() { toast = toast||can.user.toastProcess(msg._can, _toast) }, 500) }
|
||||||
msg.option = can.core.List(msg.option, function(item) { return [chat._TOAST, ice.MSG_HANDLE].indexOf(item) > -1 && delete(msg[item])? undefined: item })
|
msg.option = can.core.List(msg.option, function(item) { return [chat._TOAST, ice.MSG_HANDLE].indexOf(item) > -1 && delete(msg[item])? undefined: item })
|
||||||
msg.Option(ice.MSG_TOPIC) || msg.Option(ice.MSG_TOPIC, can.getHeader(chat.TOPIC))
|
msg.OptionDefault(ice.MSG_TOPIC, can.getHeader(chat.TOPIC), ice.SESS_HEIGHT, panel.Conf(html.HEIGHT), ice.SESS_WIDTH, panel.Conf(html.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 (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 (sub._daemon) { msg.Option(ice.MSG_DAEMON, can.core.Keys(can.ondaemon._list[0], sub._daemon)) }
|
||||||
} can.onengine.signal(panel, chat.ONREMOTE, can.request({}, {_follow: panel._follow, _msg: msg, _cmds: cmds}))
|
} can.onengine.signal(panel, chat.ONREMOTE, can.request({}, {_follow: panel._follow, _msg: msg, _cmds: cmds}))
|
||||||
|
|
||||||
var names = msg.Option(chat._NAMES)||panel._names||((can.Conf("iceberg")||Volcanos.meta.iceberg)+panel._name)
|
var names = msg.Option(chat._NAMES)||panel._names||((can.Conf("iceberg")||Volcanos.meta.iceberg)+panel._name)
|
||||||
can.misc.Run(event, can, {names: names, daemon: msg[ice.MSG_DAEMON]}, cmds, function(msg) { toast && toast.close(), toast = true
|
can.misc.Run(event, can, {names: names, daemon: msg[ice.MSG_DAEMON]}, cmds, function(msg) { toast && toast.close(), toast = true
|
||||||
can.base.isFunc(cb) && cb(msg), Volcanos.meta.pack[can.core.Keys(panel._name, cmds.join(ice.FS))] = msg
|
can.base.isFunc(cb) && cb(msg), Volcanos.meta.pack[can.core.Keys(panel._name, cmds.join(ice.FS))] = msg
|
||||||
@ -63,12 +53,10 @@ Volcanos(chat.ONENGINE, {_init: function(can, meta, list, cb, target) {
|
|||||||
if (can.base.isUndefined(command)) { return arguments.callee.meta[_name] }
|
if (can.base.isUndefined(command)) { return arguments.callee.meta[_name] }
|
||||||
var button = false, type = html.TEXT; command.list = can.core.List(command.list, function(item) {
|
var button = false, type = html.TEXT; command.list = can.core.List(command.list, function(item) {
|
||||||
return can.base.isString(item) && (item = can.core.SplitInput(item, can.base.isFunc(command.meta[item])? html.BUTTON: type)), item.type != html.SELECT && (type = item.type), button = button || item.type == html.BUTTON, item
|
return can.base.isString(item) && (item = can.core.SplitInput(item, can.base.isFunc(command.meta[item])? html.BUTTON: type)), item.type != html.SELECT && (type = item.type), button = button || item.type == html.BUTTON, item
|
||||||
}); if (!button) { command.list.push(can.core.SplitInput(ice.LIST, html.BUTTON)) }
|
}); if (!button) { command.list.push(can.core.SplitInput(ice.LIST, html.BUTTON)) } command.can = can, command.meta.name = name, arguments.callee.meta[_name] = command
|
||||||
command.can = can, command.meta.name = name, arguments.callee.meta[_name] = command
|
|
||||||
}),
|
}),
|
||||||
listen: shy(function(can, name, cb) { arguments.callee.meta[name] = (arguments.callee.meta[name]||[]).concat(cb) }),
|
listen: shy(function(can, name, cb) { arguments.callee.meta[name] = (arguments.callee.meta[name]||[]).concat(cb) }),
|
||||||
signal: function(can, name, msg) { msg = msg||can.request(); var _msg = name == chat.ONREMOTE? msg.Option("_msg"): msg
|
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(ice.SP), name == chat.ONMAIN? can: _msg)
|
|
||||||
_msg.Option(ice.LOG_DISABLE) == ice.TRUE || can.misc.Log(name, can._name, (msg._cmds||[]).join(ice.SP), name == chat.ONMAIN? can: _msg, _msg._can._target)
|
_msg.Option(ice.LOG_DISABLE) == ice.TRUE || can.misc.Log(name, can._name, (msg._cmds||[]).join(ice.SP), name == chat.ONMAIN? can: _msg, _msg._can._target)
|
||||||
return can.core.List(can.onengine.listen.meta[name], function(cb) { can.core.CallFunc(cb, {event: msg._event, msg: msg}) }).length
|
return can.core.List(can.onengine.listen.meta[name], function(cb) { can.core.CallFunc(cb, {event: msg._event, msg: msg}) }).length
|
||||||
},
|
},
|
||||||
@ -102,11 +90,10 @@ Volcanos(chat.ONDAEMON, {_init: function(can, name) { if (can.user.isLocalFile)
|
|||||||
},
|
},
|
||||||
input: function(can, msg, sub, arg) { can.page.Select(can, sub._target, "input:focus", function(target) { target.value += arg[0] }) },
|
input: function(can, msg, sub, arg) { can.page.Select(can, sub._target, "input:focus", function(target) { target.value += arg[0] }) },
|
||||||
grow: function(can, msg, sub, arg) {
|
grow: function(can, msg, sub, arg) {
|
||||||
if (sub.sup && sub.sup.onimport._grow) { return sub.sup.onimport._grow(sub.sup, msg, arg.join("")) }
|
if (sub._fields && sub.sup && sub.sup.onimport._grow) { return sub.sup.onimport._grow(sub.sup, msg, arg.join("")) }
|
||||||
if (sub && sub.onimport._grow) { return sub.onimport._grow(sub, msg, arg.join("")) }
|
if (!sub._fields && sub && sub.onimport._grow) { return sub.onimport._grow(sub, msg, arg.join("")) }
|
||||||
},
|
},
|
||||||
close: function(can, msg, sub) { can.user.close() },
|
close: function(can, msg, sub) { can.user.close() }, exit: function(can, msg, sub) { can.user.close() },
|
||||||
exit: function(can, msg, sub) { can.user.close() },
|
|
||||||
})
|
})
|
||||||
Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) {
|
Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) {
|
||||||
meta.index && (meta.name = meta.index), meta.name = can.core.Split(meta.name||"", "\t .\n").pop()
|
meta.index && (meta.name = meta.index), meta.name = can.core.Split(meta.name||"", "\t .\n").pop()
|
||||||
@ -127,8 +114,7 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) {
|
|||||||
},
|
},
|
||||||
Action: function(key, value) { return can.page.SelectArgs(can, action, key, value)[0] },
|
Action: function(key, value) { return can.page.SelectArgs(can, action, key, value)[0] },
|
||||||
Option: function(key, value) { return can.page.SelectArgs(can, option, key, value)[0] },
|
Option: function(key, value) { return can.page.SelectArgs(can, option, key, value)[0] },
|
||||||
Update: function(event, cmds, cb, silent) { sub.request(event)._caller()
|
Update: function(event, cmds, cb, silent) { sub.request(event)._caller(), sub.onappend._output0(sub, sub.Conf(), event||{}, cmds||sub.Input([], !silent), cb, silent); return true },
|
||||||
sub.onappend._output0(sub, sub.Conf(), event||{}, cmds||sub.Input([], !silent), cb, silent); return true },
|
|
||||||
Focus: function() { can.page.SelectOne(can, option, html.INPUT_ARGS, function(target) { target.focus() }) },
|
Focus: function() { can.page.SelectOne(can, option, html.INPUT_ARGS, function(target) { target.focus() }) },
|
||||||
Input: function(cmds, save) { cmds = cmds && cmds.length > 0? cmds: can.page.SelectArgs(sub), cmds = can.base.trim(cmds)
|
Input: function(cmds, save) { cmds = cmds && cmds.length > 0? cmds: can.page.SelectArgs(sub), cmds = can.base.trim(cmds)
|
||||||
return !save || cmds[0] == ctx.ACTION || can.base.Eq(sub._history[sub._history.length-1], cmds) || sub._history.push(cmds), cmds
|
return !save || cmds[0] == ctx.ACTION || can.base.Eq(sub._history[sub._history.length-1], cmds) || sub._history.push(cmds), cmds
|
||||||
@ -161,8 +147,8 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) {
|
|||||||
sub.run = function(event, cmds, cb, silent) { var msg = can.request(event, kit.Dict(chat._TOAST, ice.PROCESS))._caller()
|
sub.run = function(event, cmds, cb, silent) { var msg = can.request(event, kit.Dict(chat._TOAST, ice.PROCESS))._caller()
|
||||||
msg.RunAction(event, sub, cmds) || msg.RunAction(event, can.core.Value(can, chat._OUTPUTS_CURRENT), cmds) || can.Update(event, can.Input(cmds, !silent), cb, silent)
|
msg.RunAction(event, sub, cmds) || msg.RunAction(event, can.core.Value(can, chat._OUTPUTS_CURRENT), cmds) || can.Update(event, can.Input(cmds, !silent), cb, silent)
|
||||||
}, can._inputs = can._inputs||{}, can._inputs[item.name] = sub, sub.sup = can
|
}, can._inputs = can._inputs||{}, can._inputs[item.name] = sub, sub.sup = can
|
||||||
can.core.ItemCB(sub.onaction, function(key, cb) { sub._target[key] = function(event) { can.misc.Event(event, can, function(msg) { cb(event, sub) })} })
|
can.core.ItemCB(sub.onaction, function(key, cb) { sub._target[key] = function(event) { can.misc.Event(event, can, function(msg) { cb(event, sub, sub._target) })} })
|
||||||
can.core.ItemCB(item, function(key, cb) { sub._target[key] = function(event) { can.misc.Event(event, can, function(msg) { cb(event, sub) })} })
|
can.core.ItemCB(item, function(key, cb) { sub._target[key] = function(event) { can.misc.Event(event, can, function(msg) { cb(event, sub, sub._target) })} })
|
||||||
skip? next(): can.core.CallFunc([sub.onaction, chat._INIT], {can: sub, meta: item, cb: next, target: sub._target});
|
skip? next(): can.core.CallFunc([sub.onaction, chat._INIT], {can: sub, meta: item, cb: next, target: sub._target});
|
||||||
(item.action||can.core.Value(meta, [ctx.FEATURE, ctx.INPUTS])) && can.onappend.figure(sub, item, sub._target, function(_sub, value) {
|
(item.action||can.core.Value(meta, [ctx.FEATURE, ctx.INPUTS])) && can.onappend.figure(sub, item, sub._target, function(_sub, value) {
|
||||||
can.onmotion.focus(can, sub._target, value), can.onmotion.delay(can, function() { can.Update() })
|
can.onmotion.focus(can, sub._target, value), can.onmotion.delay(can, function() { can.Update() })
|
||||||
@ -173,6 +159,7 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) {
|
|||||||
_action: function(can, list, action, meta) { meta = meta||can.onaction||{}, action = action||can._action, can.onmotion.clear(can, action)
|
_action: function(can, list, action, meta) { meta = meta||can.onaction||{}, action = action||can._action, can.onmotion.clear(can, action)
|
||||||
function run(event, button) { can.misc.Event(event, can, function(msg) {
|
function run(event, button) { can.misc.Event(event, can, function(msg) {
|
||||||
var cb = meta[button]||meta[chat._ENGINE]; cb? can.core.CallFunc(cb, {event: event, can: can, button: button}): can.run(event, [ctx.ACTION, button].concat(can.sup.Input()), function(msg) {
|
var cb = meta[button]||meta[chat._ENGINE]; cb? can.core.CallFunc(cb, {event: event, can: can, button: button}): can.run(event, [ctx.ACTION, button].concat(can.sup.Input()), function(msg) {
|
||||||
|
if (can._fields && can.core.CallFunc([can.sup, chat.ONIMPORT, ice.MSG_PROCESS], {can: can.sup, msg: msg})) { return }
|
||||||
if (can.core.CallFunc([can, chat.ONIMPORT, ice.MSG_PROCESS], {can: can, msg: msg})) { return }
|
if (can.core.CallFunc([can, chat.ONIMPORT, ice.MSG_PROCESS], {can: can, msg: msg})) { return }
|
||||||
})
|
})
|
||||||
}) }
|
}) }
|
||||||
@ -182,8 +169,7 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) {
|
|||||||
run(event, item)
|
run(event, item)
|
||||||
}, onkeydown: function(event) { if (event.key == lang.ENTER) { target.click() }}}:
|
}, onkeydown: function(event) { if (event.key == lang.ENTER) { target.click() }}}:
|
||||||
item.length > 0? /* 3.列表 */ {type: html.SELECT, name: item[0], values: item.slice(1), onchange: function(event) { can.misc.Event(event, can, function(msg) {
|
item.length > 0? /* 3.列表 */ {type: html.SELECT, name: item[0], values: item.slice(1), onchange: function(event) { can.misc.Event(event, can, function(msg) {
|
||||||
var button = item[event.target.selectedIndex+1]
|
var button = item[event.target.selectedIndex+1]; meta[item[0]]? can.core.CallFunc(meta[item[0]], [event, can, item[0], button]): meta[button] && can.core.CallFunc(meta[button], [event, can, button])
|
||||||
meta[item[0]]? can.core.CallFunc(meta[item[0]], [event, can, item[0], button]): meta[button] && can.core.CallFunc(meta[button], [event, can, button])
|
|
||||||
}) }}: /* 4.其它 */(item.type == html.BUTTON && (item.value = item.value||can.user.trans(can, item.name, meta._trans), item.onclick = item.onclick||function(event) {
|
}) }}: /* 4.其它 */(item.type == html.BUTTON && (item.value = item.value||can.user.trans(can, item.name, meta._trans), item.onclick = item.onclick||function(event) {
|
||||||
run(event, item.name)
|
run(event, item.name)
|
||||||
}), item), "", action)
|
}), item), "", action)
|
||||||
@ -217,7 +203,7 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) {
|
|||||||
action === false || can.onmotion.clear(can, can._action), sub.onappend._action(sub, can.Conf(ice.MSG_ACTION)||msg.Option(ice.MSG_ACTION), action||can._action)
|
action === false || can.onmotion.clear(can, can._action), sub.onappend._action(sub, can.Conf(ice.MSG_ACTION)||msg.Option(ice.MSG_ACTION), action||can._action)
|
||||||
action === false || sub.onappend._status(sub, sub.onexport&&sub.onexport.list||msg.Option(ice.MSG_STATUS)), can.user.isMobile || sub.onappend.tools(sub, msg)
|
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.core.List([chat.FLOAT, chat.FULL, chat.CMD], function(mode) { can.page.ClassList.has(can, can._target, mode) && sub.onlayout[mode](sub) })
|
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.onaction._output(can, msg), can.base.isFunc(cb) && cb(msg)
|
can.onmotion.story.auto(can, can._output), can.onexport.output(can, msg), can.base.isFunc(cb) && cb(msg)
|
||||||
}, target: output})
|
}, target: output})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@ -239,8 +225,8 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) {
|
|||||||
function _fg(color) { return kit.Dict(html.COLOR, color, can.core.List(arguments).slice(1)) }
|
function _fg(color) { return kit.Dict(html.COLOR, color, can.core.List(arguments).slice(1)) }
|
||||||
function _b_r(size) { return kit.Dict(RADIUS, size) }
|
function _b_r(size) { return kit.Dict(RADIUS, size) }
|
||||||
color = kit.Dict(
|
color = kit.Dict(
|
||||||
html.PANEL, cli.BLACK, html.PLUGIN, cli.BLACK, html.LEGEND, INPUT_COLOR, html.INPUT, INPUT_COLOR, html.OUTPUT, OUTPUT_COLOR, html.TABLE, cli.BLACK,
|
chat.PANEL, cli.BLACK, chat.PLUGIN, cli.BLACK, html.LEGEND, INPUT_COLOR, html.INPUT, INPUT_COLOR, html.OUTPUT, OUTPUT_COLOR, html.TABLE, cli.BLACK,
|
||||||
html.HOVER, INPUT_COLOR, html.BORDER, cli.GRAY, html.LABEL, "silver", html.TEXT, cli.WHITE, log.INFO, cli.BLUE, log.WARN, cli.RED, color,
|
html.HOVER, INPUT_COLOR, html.BORDER, cli.GRAY, html.LABEL, cli.SILVER, html.TEXT, cli.WHITE, log.INFO, cli.BLUE, log.WARN, cli.RED, color,
|
||||||
), style = kit.Dict(LEGEND_STYLE, _bg(color.legend),
|
), style = kit.Dict(LEGEND_STYLE, _bg(color.legend),
|
||||||
INPUT_STYLE, _bg(color.input, html.COLOR, color.label, RADIUS, "5px", "outline", html.NONE, "box-shadow", html.NONE),
|
INPUT_STYLE, _bg(color.input, html.COLOR, color.label, RADIUS, "5px", "outline", html.NONE, "box-shadow", html.NONE),
|
||||||
INPUT_HOVER_STYLE, _fg(color.text), OUTPUT_STYLE, _bg(color.output), GLASS_STYLE, _bg(GLASS),
|
INPUT_HOVER_STYLE, _fg(color.text), OUTPUT_STYLE, _bg(color.output), GLASS_STYLE, _bg(GLASS),
|
||||||
@ -259,13 +245,14 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) {
|
|||||||
{type: html.DIV_ACTION, list: [{type: html.DIV_ITEM, name: [html.SELECT], style: [GLASS_STYLE]}]},
|
{type: html.DIV_ACTION, list: [{type: html.DIV_ITEM, name: [html.SELECT], style: [GLASS_STYLE]}]},
|
||||||
{type: html.DIV_ACTION, list: [{type: html.DIV_ITEM, name: [html.HOVER], style: [GLASS_STYLE]}]},
|
{type: html.DIV_ACTION, list: [{type: html.DIV_ITEM, name: [html.HOVER], style: [GLASS_STYLE]}]},
|
||||||
{type: html.DIV_OUTPUT, style: [OUTPUT_STYLE]}, {type: html.DIV_STATUS, style: kit.Dict(_bg(color.plugin), _fg(color.label))},
|
{type: html.DIV_OUTPUT, style: [OUTPUT_STYLE]}, {type: html.DIV_STATUS, style: kit.Dict(_bg(color.plugin), _fg(color.label))},
|
||||||
{type: html.DIV_CODE, style: {border: color.border+SOLID}},
|
|
||||||
{type: html.DIV_ITEM, name: [html.SELECT], style: [ITEM_HOVER_STYLE]}, {type: html.DIV_ITEM, style: [ITEM_HOVER_STYLE]},
|
{type: html.DIV_ITEM, name: [html.SELECT], style: [ITEM_HOVER_STYLE]}, {type: html.DIV_ITEM, style: [ITEM_HOVER_STYLE]},
|
||||||
|
{type: html.SPAN_ITEM, name: [html.SELECT], style: [ITEM_HOVER_STYLE]}, {type: html.SPAN_ITEM, style: [ITEM_HOVER_STYLE]},
|
||||||
{type: html.DIV_TABS, list: [{type: html.DIV, style: _bg(color.plugin)}]},
|
{type: html.DIV_TABS, list: [{type: html.DIV, style: _bg(color.plugin)}]},
|
||||||
{type: html.DIV_TABS, list: [{type: html.DIV, name: [html.HOVER], style: [OUTPUT_STYLE]}]},
|
{type: html.DIV_TABS, list: [{type: html.DIV, name: [html.HOVER], style: [OUTPUT_STYLE]}]},
|
||||||
{type: html.DIV_TABS, list: [{type: html.DIV, name: [html.HOVER], style: _fg(color.text)}]},
|
{type: html.DIV_TABS, list: [{type: html.DIV, name: [html.HOVER], style: _fg(color.text)}]},
|
||||||
{type: html.DIV_TABS, list: [{type: html.DIV, name: [html.SELECT], style: [OUTPUT_STYLE]}]},
|
{type: html.DIV_TABS, list: [{type: html.DIV, name: [html.SELECT], style: [OUTPUT_STYLE]}]},
|
||||||
{type: html.DIV_PATH, style: [OUTPUT_STYLE]}, {type: html.DIV_PATH, list: [{type: html.SPAN, style: [ITEM_HOVER_STYLE]}]},
|
{type: html.DIV_PATH, style: [OUTPUT_STYLE]}, {type: html.DIV_PATH, list: [{type: html.SPAN, style: [ITEM_HOVER_STYLE]}]},
|
||||||
|
{type: html.DIV_CODE, style: {border: color.border+SOLID}},
|
||||||
{type: html.DIV_PLUG, list: [{type: html.LEGEND, style: [OUTPUT_STYLE]}]},
|
{type: html.DIV_PLUG, list: [{type: html.LEGEND, style: [OUTPUT_STYLE]}]},
|
||||||
{type: html.DIV_PLUG, list: [{type: html.LEGEND, name: [html.SELECT], style: [PLUGIN_STYLE]}]},
|
{type: html.DIV_PLUG, list: [{type: html.LEGEND, name: [html.SELECT], style: [PLUGIN_STYLE]}]},
|
||||||
{type: "div.zone>div.item", style: [TABLE_HEAD_STYLE]}, {type: "div.zone>div.item", style: [TABLE_HEAD_HOVER_STYLE]},
|
{type: "div.zone>div.item", style: [TABLE_HEAD_STYLE]}, {type: "div.zone>div.item", style: [TABLE_HEAD_HOVER_STYLE]},
|
||||||
@ -279,7 +266,7 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) {
|
|||||||
{type: html.TABLE_CONTENT, list: [{type: html.TD, name: [html.SELECT], style: [TABLE_CELL_HOVER_STYLE]}]},
|
{type: html.TABLE_CONTENT, list: [{type: html.TD, name: [html.SELECT], style: [TABLE_CELL_HOVER_STYLE]}]},
|
||||||
{type: html.TABLE_CONTENT, list: [{type: html.TD, style: [TABLE_CELL_HOVER_STYLE]}]},
|
{type: html.TABLE_CONTENT, list: [{type: html.TD, style: [TABLE_CELL_HOVER_STYLE]}]},
|
||||||
{type: html.H1, style: [ITEM_HOVER_STYLE]}, {type: html.H2, style: [ITEM_HOVER_STYLE]}, {type: html.H3, style: [ITEM_HOVER_STYLE]},
|
{type: html.H1, style: [ITEM_HOVER_STYLE]}, {type: html.H2, style: [ITEM_HOVER_STYLE]}, {type: html.H3, style: [ITEM_HOVER_STYLE]},
|
||||||
{type: html.LABEL, style: _fg(color.label)}, {type: html.A, style: _fg(color.info)},
|
{type: html.A, style: _fg(color.info)}, {type: html.LABEL, style: _fg(color.label)},
|
||||||
{type: html.FIELDSET_PANEL, style: [PANEL_STYLE]}, {type: html.FIELDSET_PANEL+ice.GT+html.DIV_OUTPUT, style: [PANEL_STYLE]},
|
{type: html.FIELDSET_PANEL, style: [PANEL_STYLE]}, {type: html.FIELDSET_PANEL+ice.GT+html.DIV_OUTPUT, style: [PANEL_STYLE]},
|
||||||
{type: html.FIELDSET_PANEL, name: [chat.HEADER], list: [{type: html.DIV_OUTPUT, list: [{type: html.DIV, style: [ITEM_HOVER_STYLE]}], }]},
|
{type: html.FIELDSET_PANEL, name: [chat.HEADER], list: [{type: html.DIV_OUTPUT, list: [{type: html.DIV, style: [ITEM_HOVER_STYLE]}], }]},
|
||||||
{type: html.FIELDSET_PANEL, name: [chat.FOOTER], list: [{type: html.DIV_OUTPUT, list: [{type: html.DIV, style: [ITEM_HOVER_STYLE]}], }]},
|
{type: html.FIELDSET_PANEL, name: [chat.FOOTER], list: [{type: html.DIV_OUTPUT, list: [{type: html.DIV, style: [ITEM_HOVER_STYLE]}], }]},
|
||||||
@ -294,7 +281,7 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) {
|
|||||||
{type: html.FIELDSET_FLOAT, style: [PLUGIN_STYLE]}, {type: html.DIV_FLOAT, style: [PLUGIN_STYLE]},
|
{type: html.FIELDSET_FLOAT, style: [PLUGIN_STYLE]}, {type: html.DIV_FLOAT, style: [PLUGIN_STYLE]},
|
||||||
{type: html.DIV_CARTE, list: [{type: html.DIV_ITEM, style: [TABLE_HEAD_STYLE, CARTE_ITEM_STYLE]}]},
|
{type: html.DIV_CARTE, list: [{type: html.DIV_ITEM, style: [TABLE_HEAD_STYLE, CARTE_ITEM_STYLE]}]},
|
||||||
{type: html.DIV_CARTE, list: [{type: html.DIV_ITEM, style: [CARTE_ITEM_HOVER_STYLE]}]},
|
{type: html.DIV_CARTE, list: [{type: html.DIV_ITEM, style: [CARTE_ITEM_HOVER_STYLE]}]},
|
||||||
].concat(list); const DF = ":", FS = ";"
|
].concat(list); const DF = ice.DF, FS = ";"
|
||||||
function render(pre, list) { return can.core.List(list, function(item) { if (!item) { return } var type = item.type+can.core.List(item.name, function(name) { return (name==html.HOVER? ice.DF: ice.PT)+name }).join("")
|
function render(pre, list) { return can.core.List(list, function(item) { if (!item) { return } var type = item.type+can.core.List(item.name, function(name) { return (name==html.HOVER? ice.DF: ice.PT)+name }).join("")
|
||||||
if (!item.name && type.indexOf(ice.PT+html.SELECT) == -1 && type.indexOf(ice.DF+html.HOVER) == -1 && can.base.isArray(item.style) && item.style.join(ice.FS).indexOf("-hover-") > -1) { type += ice.DF+html.HOVER }
|
if (!item.name && type.indexOf(ice.PT+html.SELECT) == -1 && type.indexOf(ice.DF+html.HOVER) == -1 && can.base.isArray(item.style) && item.style.join(ice.FS).indexOf("-hover-") > -1) { type += ice.DF+html.HOVER }
|
||||||
return (item.style? (pre+ice.SP+type+" { "+(can.base.isArray(item.style)? can.core.List(item.style, function(item) {
|
return (item.style? (pre+ice.SP+type+" { "+(can.base.isArray(item.style)? can.core.List(item.style, function(item) {
|
||||||
@ -306,7 +293,7 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) {
|
|||||||
can.base.isObject(style) && !can.base.isArray(style)? can.page.style(can, target, style): can.page.ClassList.add(can, target, style)
|
can.base.isObject(style) && !can.base.isArray(style)? can.page.style(can, target, style): can.page.ClassList.add(can, target, style)
|
||||||
},
|
},
|
||||||
field: function(can, type, item, target) { type = type||html.STORY, item = item||{}
|
field: function(can, type, item, target) { type = type||html.STORY, item = item||{}
|
||||||
var name = can.core.Split(item.nick||item.name||"").pop(), title = !item.help || item.help == name || can.user.language(can) == "en"? name: name+"("+can.core.Split(item.help)[0]+")"
|
var name = can.core.Split(item.nick||item.name||"").pop()||"", title = !item.help || item.help == name || can.user.language(can) == "en"? name: name+"("+can.core.Split(item.help)[0]+")"
|
||||||
return can.page.Append(can, target||can._output, [{view: [type, html.FIELDSET], list: [{text: [title, html.LEGEND]}, {view: [html.OPTION, html.FORM]}, html.ACTION, html.OUTPUT, html.STATUS]}])
|
return can.page.Append(can, target||can._output, [{view: [type, html.FIELDSET], list: [{text: [title, html.LEGEND]}, {view: [html.OPTION, html.FORM]}, html.ACTION, html.OUTPUT, html.STATUS]}])
|
||||||
},
|
},
|
||||||
input: function(can, item, value, target, style) { if ([html.BR, html.HR].indexOf(item.type) > -1) { return can.page.Append(can, target, [item]) }
|
input: function(can, item, value, target, style) { if ([html.BR, html.HR].indexOf(item.type) > -1) { return can.page.Append(can, target, [item]) }
|
||||||
@ -316,13 +303,12 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) {
|
|||||||
if (item.type == html.TEXT) { input.onkeydown = item.onkeydown||function(event) {
|
if (item.type == html.TEXT) { input.onkeydown = item.onkeydown||function(event) {
|
||||||
can.onkeymap.input(event, can), can.onkeymap.selectOutput(event, can), event.key == lang.ENTER && can.onkeymap.prevent(event)
|
can.onkeymap.input(event, can), can.onkeymap.selectOutput(event, can), event.key == lang.ENTER && can.onkeymap.prevent(event)
|
||||||
}, icon.push({text: can.page.unicode.delete, className: "icon delete", onclick: function(event) {
|
}, icon.push({text: can.page.unicode.delete, className: "icon delete", onclick: function(event) {
|
||||||
_input.value = ""; if (item.name == html.FILTER) { can.page.Select(can, can._output, html.TR, function(tr) { can.page.ClassList.del(can, tr, html.HIDE) }) }
|
_input.value = ""; item.name == html.FILTER && can.page.Select(can, can._output, html.TR, function(tr) { can.page.ClassList.del(can, tr, html.HIDE) })
|
||||||
}}) }
|
}}) }
|
||||||
if (item.range) { input._init = function(target) { can.onappend.figure(can, item, target, function(sub, value, old) {
|
if (item.range) { input._init = function(target) { can.onappend.figure(can, item, target, function(sub, value, old) {
|
||||||
target.value = value, can.core.CallFunc([can.onaction, item.name], [event, can, item.name])
|
target.value = value, can.core.CallFunc([can.onaction, item.name], [event, can, item.name])
|
||||||
}) } }
|
}) } }
|
||||||
var _input = can.page.Append(can, target, [{view: [[html.ITEM, item.type, item.name].concat(style)], list: [input].concat(icon)}])[item.name]
|
var _input = can.page.Append(can, target, [{view: [[html.ITEM, item.type, item.name].concat(style)], list: [input].concat(icon)}])[item.name]; return _input
|
||||||
return _input
|
|
||||||
},
|
},
|
||||||
table: function(can, msg, cb, target, keys) { if (!msg || msg.Length() == 0) { return } var meta = can.base.Obj(msg.Option(mdb.META))
|
table: function(can, msg, cb, target, keys) { if (!msg || msg.Length() == 0) { return } var meta = can.base.Obj(msg.Option(mdb.META))
|
||||||
var table = can.page.AppendTable(can, msg, target||can._output, msg.append, cb||function(value, key, index, line, array) {
|
var table = can.page.AppendTable(can, msg, target||can._output, msg.append, cb||function(value, key, index, line, array) {
|
||||||
@ -350,83 +336,38 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) {
|
|||||||
}) } }); return code.scrollBy && code.scrollBy(0, 10000), code
|
}) } }); return code.scrollBy && code.scrollBy(0, 10000), code
|
||||||
},
|
},
|
||||||
tools: function(can, msg, cb, target) {
|
tools: function(can, msg, cb, target) {
|
||||||
can.onimport.tool(can, can.base.Obj(msg.Option(ice.MSG_TOOLKIT), []).concat(can.misc.Search(can, "debug") == ice.TRUE? ["can.debug"]: []), cb, target)
|
can.onimport.tool(can, can.base.Obj(msg.Option(ice.MSG_TOOLKIT), []).concat(can.misc.Search(can, log.DEBUG) == ice.TRUE? ["can.debug"]: []), cb, target)
|
||||||
},
|
},
|
||||||
layout: function(can, target, type, list) { const FLOW = html.FLOW, FLEX = html.FLEX
|
layout: function(can, target, type, list) { const FLOW = html.FLOW, FLEX = html.FLEX
|
||||||
switch (type||ice.AUTO) {
|
var count = 0, ui = {size: {}}; type = type||FLEX
|
||||||
case FLOW:
|
function append(target, type, list) { can.page.ClassList.add(can, target, [html.LAYOUT, type]), can.core.List(list, function(item) {
|
||||||
case FLEX:
|
if (can.base.isString(item)) {
|
||||||
case ice.AUTO: var count = 0, ui = {size: {}}; type = type == "" || type == ice.AUTO? FLEX: type
|
ui[item] = can.page.Append(can, target, [item])._target
|
||||||
function append(target, type, list) { can.page.ClassList.add(can, target, [html.LAYOUT, type]), can.core.List(list, function(item) {
|
} else if (can.base.isArray(item)) {
|
||||||
if (can.base.isString(item)) {
|
append(can.page.Append(can, target, [html.LAYOUT])._target, type==FLOW? FLEX: FLOW, item)
|
||||||
ui[item] = can.page.Append(can, target, [item])._target
|
} else if (can.base.isObject(item)) {
|
||||||
} else if (can.base.isArray(item)) {
|
if (item.index) { item._index = count++, ui.size[item._index] = item.height||item.width
|
||||||
append(can.page.Append(can, target, [html.LAYOUT])._target, type==FLOW? FLEX: FLOW, item)
|
can.onappend.plugin(can, item, function(sub) { can._plugins = can.misc.concat(can, can._plugins, [sub])
|
||||||
} else if (can.base.isObject(item)) {
|
item.layout = function(width, height) { sub.onimport.size(sub, height, width) }
|
||||||
if (item.index) { item._index = count++, ui.size[item._index] = item.height||item.width
|
}, target, ui[item._index] = can.onappend.field(can, item.type, {name: item.index, help: item.help}, target)._target)
|
||||||
can.onappend.plugin(can, item, function(sub) { can._plugins = can.misc.concat(can, can._plugins, [sub])
|
} else { can.page.Append(can, target, [item]) }
|
||||||
item.layout = function(width, height) { sub.onimport.size(sub, height, width) }
|
|
||||||
}, target, ui[item._index] = can.onappend.field(can, item.type, {name: item.index, help: item.help}, target)._target)
|
|
||||||
} else { can.page.Append(can, target, [item]) }
|
|
||||||
}
|
|
||||||
}); return list }
|
|
||||||
function calc(item, size, total) { return !ui.size[item]? size: ui.size[item] < 1? total*ui.size[item]: ui.size[item] }
|
|
||||||
var defer = [], content_height, content_width; function layout(type, list, width, height) { var _width = width, _height = height; can.core.List(list, function(item) {
|
|
||||||
if (item == html.CONTENT) { content_height = height, content_width = width
|
|
||||||
return defer.push(function() { can.page.style(can, ui[item], html.HEIGHT, height, html.WIDTH, width) })
|
|
||||||
}
|
|
||||||
if (!can.page.isDisplay(ui[item])) { return } if (can.base.isObject(item)) { var meta = item; item = item._index }
|
|
||||||
if (type == FLOW) { var h = calc(item, ui[item].offsetHeight, height)
|
|
||||||
if (can.base.isObject(meta)) { meta.layout(width, h) }
|
|
||||||
can.page.style(can, ui[item], html.WIDTH, width), height -= h
|
|
||||||
} else { var w = calc(item, ui[item].offsetWidth||_width/list.length, _width), h = height
|
|
||||||
if (can.base.isObject(meta)) { meta.layout(w = _width/list.length, h) }
|
|
||||||
can.page.style(can, ui[item], 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, width, height) } }) }
|
|
||||||
ui.layout = function(width, height, delay, cb) { can.onmotion.delay(can, function() { defer = [], layout(type, ui.list, width, height), defer.forEach(function(cb) { cb() }), cb && cb(content_height, content_width) }, delay||0) }
|
|
||||||
ui.list = append(target, type, list||[html.PROJECT, [[html.CONTENT, html.PROFILE], html.DISPLAY]])
|
|
||||||
return ui
|
|
||||||
case "tabs-top":
|
|
||||||
can.onappend.style(can, target, [html.LAYOUT, html.TABS, html.TOP])
|
|
||||||
var ui = can.page.Append(can, target, [html.TABS, html.LIST])
|
|
||||||
break
|
|
||||||
case "tabs-left":
|
|
||||||
can.onappend.style(can, target, [html.LAYOUT, html.TABS, html.LEFT])
|
|
||||||
var ui = can.page.Append(can, target, [html.TABS, html.LIST])
|
|
||||||
break
|
|
||||||
case "tabs-right":
|
|
||||||
can.onappend.style(can, target, [html.LAYOUT, html.TABS, html.RIGHT])
|
|
||||||
var ui = can.page.Append(can, target, [html.LIST, html.TABS])
|
|
||||||
break
|
|
||||||
case "tabs-bottom":
|
|
||||||
can.onappend.style(can, target, [html.LAYOUT, html.TABS, html.BOTTOM])
|
|
||||||
var ui = can.page.Append(can, target, [html.LIST, html.TABS])
|
|
||||||
break
|
|
||||||
}
|
|
||||||
ui.append = function(item, carte) {
|
|
||||||
var tabs = can.page.Append(can, ui.tabs, [{type: html.DIV, inner: item.name, onclick: function(event) {
|
|
||||||
can.onmotion.select(can, ui.tabs, html.DIV, tabs),
|
|
||||||
can.page.SelectChild(can, ui.list, html.DIV, function(item) {
|
|
||||||
can.page.ClassList.set(can, item, html.HIDE, item != view)
|
|
||||||
if (item.className == "") { delete(item.className) }
|
|
||||||
})
|
|
||||||
}}])._target
|
|
||||||
var view = can.page.Append(can, ui.list, [{view: html.HIDE, list: item.list}])._target
|
|
||||||
if (ui.tabs.childElementCount == 1) { tabs.click() }
|
|
||||||
return {
|
|
||||||
close: function() {
|
|
||||||
if (can.page.ClassList.has(can, tabs, html.SELECT)) {
|
|
||||||
(tabs.nextSibling||tabs.previousSibling).click()
|
|
||||||
} can.page.Remove(can, tabs), can.page.Remove(can, view)
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
}
|
}); return list } ui.list = append(target, type, list||[html.PROJECT, [[html.CONTENT, html.PROFILE], html.DISPLAY]])
|
||||||
can.core.List(list, function(item) {
|
function calc(item, size, total) { return !ui.size[item]? size: ui.size[item] < 1? total*ui.size[item]: ui.size[item] }
|
||||||
var view = ui.append(item, shy({
|
var defer = [], content_height, content_width; function layout(type, list, width, height) { var _width = width, _height = height; can.core.List(list, function(item) {
|
||||||
close: function() { view.close() },
|
if (item == html.CONTENT) { content_height = height, content_width = width
|
||||||
}))
|
return defer.push(function() { can.page.style(can, ui[item], html.HEIGHT, height, html.WIDTH, width) })
|
||||||
})
|
}
|
||||||
|
if (!can.page.isDisplay(ui[item])) { return } if (can.base.isObject(item)) { var meta = item; item = item._index }
|
||||||
|
if (type == FLOW) { var h = calc(item, ui[item].offsetHeight, height)
|
||||||
|
if (can.base.isObject(meta)) { meta.layout(width, h) }
|
||||||
|
can.page.style(can, ui[item], html.WIDTH, width), height -= h
|
||||||
|
} else { var w = calc(item, ui[item].offsetWidth||_width/list.length, _width), h = height
|
||||||
|
if (can.base.isObject(meta)) { meta.layout(w = _width/list.length, h) }
|
||||||
|
can.page.style(can, ui[item], 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, width, height) } }) }
|
||||||
|
ui.layout = function(width, height, delay, cb) { can.onmotion.delay(can, function() { defer = [], layout(type, ui.list, width, height), defer.forEach(function(cb) { cb() }), cb && cb(content_height, content_width) }, delay||0) }
|
||||||
return ui
|
return ui
|
||||||
},
|
},
|
||||||
tabview: function(can, meta, list, target) { var ui = can.page.Append(can, target, [html.ACTION, html.OUTPUT])
|
tabview: function(can, meta, list, target) { var ui = can.page.Append(can, target, [html.ACTION, html.OUTPUT])
|
||||||
@ -465,7 +406,6 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) {
|
|||||||
},
|
},
|
||||||
figure: function(can, meta, target, cb) { if (meta.type == html.BUTTON || meta.type == html.SELECT) { return }
|
figure: function(can, meta, target, cb) { if (meta.type == html.BUTTON || meta.type == html.SELECT) { return }
|
||||||
var input = meta.action||mdb.KEY, path = chat.PLUGIN_INPUT+input+nfs._JS; can.require([path], function(can) {
|
var input = meta.action||mdb.KEY, path = chat.PLUGIN_INPUT+input+nfs._JS; can.require([path], function(can) {
|
||||||
// function _cb(sub, value, old) { if (value == old) { return } can.base.isFunc(cb)? cb(sub, value, old): can.onmotion.delay(can, function() { can.onmotion.focus(can, target, value||"") }) }
|
|
||||||
function _cb(sub, value, old) { if (value == old) { return } can.base.isFunc(cb)? cb(sub, value, old): target.value = value }
|
function _cb(sub, value, old) { if (value == old) { return } can.base.isFunc(cb)? cb(sub, value, old): target.value = value }
|
||||||
can.core.ItemCB(can.onfigure[input], function(key, on) { var last = target[key]||function(){}; target[key] = function(event) { can.misc.Event(event, can, function(msg) {
|
can.core.ItemCB(can.onfigure[input], function(key, on) { var last = target[key]||function(){}; target[key] = function(event) { can.misc.Event(event, can, function(msg) {
|
||||||
function show(sub, cb) { can.base.isFunc(cb) && cb(sub, _cb), can.onlayout.figure(event, can, sub._target), can.onmotion.toggle(can, sub._target, true) }
|
function show(sub, cb) { can.base.isFunc(cb) && cb(sub, _cb), can.onlayout.figure(event, can, sub._target), can.onmotion.toggle(can, sub._target, true) }
|
||||||
@ -536,7 +476,7 @@ Volcanos(chat.ONLAYOUT, {_init: function(can, target) { target = target||can._ro
|
|||||||
Volcanos(chat.ONMOTION, {_init: function(can, target) {
|
Volcanos(chat.ONMOTION, {_init: function(can, target) {
|
||||||
target.onclick = function(event) { if (can.page.tagis(event.target, html.SELECT, html.INPUT, html.TEXTAREA)) { return }
|
target.onclick = function(event) { if (can.page.tagis(event.target, html.SELECT, html.INPUT, html.TEXTAREA)) { return }
|
||||||
if (can.page.tagis(event.target, html.A) && can.user.isWebview) { return event.shiftKey? window.outopen(event.target.href): can.user.open(event.target.href) }
|
if (can.page.tagis(event.target, html.A) && can.user.isWebview) { return event.shiftKey? window.outopen(event.target.href): can.user.open(event.target.href) }
|
||||||
can.page.Select(can, target, can.page.Keys("div.carte.float"), function(target) { can.page.Remove(can, target) })
|
can.onmotion.clearCarte(can)
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
story: {
|
story: {
|
||||||
@ -552,27 +492,11 @@ Volcanos(chat.ONMOTION, {_init: function(can, target) {
|
|||||||
can.page.Select(can, target, html.INPUT_BUTTON, function(target) {
|
can.page.Select(can, target, html.INPUT_BUTTON, function(target) {
|
||||||
if (target.value == target.name) { target.value = can.user.trans(can, target.name) }
|
if (target.value == target.name) { target.value = can.user.trans(can, target.name) }
|
||||||
})
|
})
|
||||||
can.page.Select(can, target, html.IFRAME, function(item) {
|
|
||||||
// can.page.style(can, item, html.HEIGHT, can.ConfHeight()-88, html.WIDTH, can.ConfWidth()-30)
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
clearFloat: function(can) {
|
clearFloat: function(can) { can.page.SelectChild(can, document.body, "div.float", function(target) { can.page.Remove(can, target) }) },
|
||||||
can.page.SelectChild(can, can._root._target, "div.float", function(target) {
|
clearCarte: function(can) { can.page.SelectChild(can, document.body, "div.carte.float", function(target) { can.page.Remove(can, target) }) },
|
||||||
can.page.Remove(can, target)
|
clearInput: function(can) { can.page.SelectChild(can, document.body, "div.input.float", function(target) { can.page.Remove(can, target) }) },
|
||||||
})
|
|
||||||
},
|
|
||||||
clearCarte: function(can) {
|
|
||||||
can.page.SelectChild(can, can._root._target, "div.carte.float", function(target) {
|
|
||||||
can.page.Remove(can, target)
|
|
||||||
})
|
|
||||||
},
|
|
||||||
clearInput: function(can) {
|
|
||||||
can.page.SelectChild(can, can._root._target, "div.input.float", function(target) {
|
|
||||||
can.page.Remove(can, target)
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
hidden: function(can, target, show) { target = target||can._target
|
hidden: function(can, target, show) { target = target||can._target
|
||||||
if (target.length > 0) { return can.core.List(target, function(target) { can.onmotion.hidden(can, target, show) }) }
|
if (target.length > 0) { return can.core.List(target, function(target) { can.onmotion.hidden(can, target, show) }) }
|
||||||
return can.page.ClassList.set(can, target, html.HIDE, !show)? target._hide && target._hide(): target._show && target._show(), show
|
return can.page.ClassList.set(can, target, html.HIDE, !show)? target._hide && target._hide(): target._show && target._show(), show
|
||||||
@ -582,10 +506,9 @@ Volcanos(chat.ONMOTION, {_init: function(can, target) {
|
|||||||
var status = can.page.isDisplay(target); if (status? can.base.isFunc(hide) && hide(): can.base.isFunc(show) && show()) { return !status }
|
var status = can.page.isDisplay(target); if (status? can.base.isFunc(hide) && hide(): can.base.isFunc(show) && show()) { return !status }
|
||||||
return can.onmotion.hidden(can, target, !status)
|
return can.onmotion.hidden(can, target, !status)
|
||||||
},
|
},
|
||||||
select: function(can, target, name, which, cb) {
|
select: function(can, target, name, which, cb) { var old = can.page.SelectOne(can, target, name+".select")
|
||||||
var old = can.page.Select(can, target, name, function(target, index) { if (can.page.ClassList.has(can, target, html.SELECT)) { return index } })[0]
|
|
||||||
can.base.isUndefined(which) || can.page.Select(can, target, name, function(target, index) {
|
can.base.isUndefined(which) || can.page.Select(can, target, name, function(target, index) {
|
||||||
if (can.page.ClassList.set(can, target, html.SELECT, target == which || which == index)) { can.base.isFunc(cb) && cb(target) }
|
if (can.page.ClassList.set(can, target, html.SELECT, target == which || index == which)) { can.base.isFunc(cb) && cb(target) }
|
||||||
}); return old
|
}); return old
|
||||||
},
|
},
|
||||||
modify: function(can, target, cb, item) { var back = target.innerHTML
|
modify: function(can, target, cb, item) { var back = target.innerHTML
|
||||||
@ -605,27 +528,21 @@ Volcanos(chat.ONMOTION, {_init: function(can, target) {
|
|||||||
default: can.onkeymap.input(event, can)
|
default: can.onkeymap.input(event, can)
|
||||||
} }, _init: function(target) { item && can.onappend.figure(can, item, target), can.onmotion.focus(can, target), can.onmotion.delay(can, function() { target.click() }) }}])
|
} }, _init: function(target) { item && can.onappend.figure(can, item, target), can.onmotion.focus(can, target), can.onmotion.delay(can, function() { target.click() }) }}])
|
||||||
},
|
},
|
||||||
|
highlight: function(can, value, target) { can.page.Select(can, target||can._output, [html.TBODY, html.TR], function(tr) {
|
||||||
|
can.page.ClassList.set(can, tr, html.HIDDEN, can.page.Select(can, tr, html.TD, function(td) { td._text = td._text||td.innerText
|
||||||
|
if (td.innerText.indexOf(value) > -1) {
|
||||||
|
return td.innerHTML = td._text.replaceAll(value, "<span style='background-color:yellow;color:red;'>"+value+"</span>")
|
||||||
|
} else {
|
||||||
|
td.innerText = td._text
|
||||||
|
}
|
||||||
|
}).length == 0)
|
||||||
|
}) },
|
||||||
tableFilter: function(can, target, value) { can.page.Select(can, target, html.TR, function(tr, index) {
|
tableFilter: function(can, target, value) { can.page.Select(can, target, html.TR, function(tr, index) {
|
||||||
index > 0 && can.page.ClassList.set(can, tr, html.HIDDEN, can.page.Select(can, tr, html.TD, function(td) { if (td.innerText.indexOf(value) > -1) { return td } }) == 0)
|
index > 0 && can.page.ClassList.set(can, tr, html.HIDDEN, can.page.Select(can, tr, html.TD, function(td) { if (td.innerText.indexOf(value) > -1) { return td } }) == 0)
|
||||||
}) },
|
}) },
|
||||||
highlight: function(can, value, target) {
|
delayResize: function(can, target, key) { can.onmotion.delay(can, function() { can.page.Select(can, target, key, function(_target) {
|
||||||
can.page.Select(can, target||can._output, [html.TBODY, html.TR], function(tr) {
|
can.page.style(can, target, html.WIDTH, _target.offsetWidth+10, html.LEFT, (window.innerWidth-_target.offsetWidth)/2)
|
||||||
can.page.ClassList.set(can, tr, html.HIDDEN, can.page.Select(can, tr, html.TD, function(td) { td._text = td._text||td.innerText
|
}) }) },
|
||||||
if (td.innerText.indexOf(value) > -1) {
|
|
||||||
td.innerHTML = td._text.replaceAll(value, "<span style='background-color:yellow;color:red;'>"+value+"</span>")
|
|
||||||
return td
|
|
||||||
} else {
|
|
||||||
td.innerText = td._text
|
|
||||||
}
|
|
||||||
}).length == 0)
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
delayResize: function(can, target, key) {
|
|
||||||
can.onmotion.delay(can, function() { can.page.Select(can, target, key, function(_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) },
|
delayLong: function(can, cb, interval, key) { can.onmotion.delay(can, cb, interval||300, key) },
|
||||||
delay: function(can, cb, interval, key) { if (!key) { return can.core.Timer(interval||30, cb) }
|
delay: function(can, cb, interval, key) { if (!key) { return can.core.Timer(interval||30, cb) }
|
||||||
can._delay_list = can._delay_list||shy({}, [])
|
can._delay_list = can._delay_list||shy({}, [])
|
||||||
@ -639,27 +556,20 @@ Volcanos(chat.ONMOTION, {_init: function(can, target) {
|
|||||||
var pos = can.page.Cache(target._cache_key = key, target); if (pos) { target.scrollTo && target.scrollTo(0, pos-1); return target }
|
var pos = can.page.Cache(target._cache_key = key, target); if (pos) { target.scrollTo && target.scrollTo(0, pos-1); return target }
|
||||||
}).length > 0
|
}).length > 0
|
||||||
},
|
},
|
||||||
selectRange: function(target) { target && target.setSelectionRange && target.setSelectionRange(0, target.value.length) },
|
|
||||||
share: function(event, can, input, args) { var _args = args
|
share: function(event, can, input, args) { var _args = args
|
||||||
return can.user.input(event, can, input, function(args) { can.onengine.signal(can, chat.ONSHARE, can.request(event, {args: [mdb.TYPE, chat.FIELD].concat(_args||[], args||[])})) })
|
return can.user.input(event, can, input, function(args) { can.onengine.signal(can, chat.ONSHARE, can.request(event, {args: [mdb.TYPE, chat.FIELD].concat(_args||[], args||[])})) })
|
||||||
},
|
},
|
||||||
focus: function(can, target, value) { if (!target) { return } if (!can.base.isUndefined(value)) { target.value = value }
|
focus: function(can, target, value) { if (!target) { return } if (!can.base.isUndefined(value)) { target.value = value }
|
||||||
target.focus(), target.setSelectionRange && target.setSelectionRange(0, target.value.length)
|
target.focus(), can.onmotion.selectRange(target)
|
||||||
},
|
}, selectRange: function(target) { target && target.setSelectionRange && target.setSelectionRange(0, target.value.length) },
|
||||||
copy: function(can, target, cb) { target.title = "点击复制", target.onclick = function(event) { can.user.copy(event, can, target.innerText), can.base.isFunc(cb) && cb(event) } },
|
copy: function(can, target, cb) { target.title = "点击复制", target.onclick = function(event) { can.user.copy(event, can, target.innerText), can.base.isFunc(cb) && cb(event) } },
|
||||||
|
|
||||||
move: function(can, target, layout, cb) { var begin; layout = layout||{}
|
move: function(can, target, layout, cb) { var begin; layout = layout||{}
|
||||||
can.page.style(can, target, layout), target.onmousedown = function(event) {
|
can.page.style(can, target, layout), target.onmousedown = function(event) {
|
||||||
if (event.target != target && !event.ctrlKey) { return }
|
if (event.target != target && !event.ctrlKey) { return } can.onkeymap.prevent(event)
|
||||||
can.onkeymap.prevent(event)
|
|
||||||
// if (can.page.tagis(event.target, html.BUTTON, html.SELECT)) { return }
|
|
||||||
// if (!event.ctrlKey && !can.page.tagis(target, html.FIELDSET)) { return }
|
|
||||||
layout.height = target.offsetHeight, layout.width = target.offsetWidth
|
layout.height = target.offsetHeight, layout.width = target.offsetWidth
|
||||||
layout.left = target.offsetLeft, layout.top = target.offsetTop
|
layout.left = target.offsetLeft, layout.top = target.offsetTop
|
||||||
begin = can.base.Copy({x: event.x, y: event.y}, layout)
|
begin = can.base.Copy({x: event.x, y: event.y}, layout)
|
||||||
}, target.onmouseup = function(event) { begin = null }, target.onmousemove = function(event) { if (!begin) { return }
|
}, target.onmouseup = function(event) { begin = null }, target.onmousemove = function(event) { if (!begin) { return }
|
||||||
// if (event.target != target) { return }
|
|
||||||
// if (can.page.tagis(event.target, html.BUTTON, html.SELECT)) { return }
|
|
||||||
if (event.shiftKey) {
|
if (event.shiftKey) {
|
||||||
layout.height = begin.height + event.y - begin.y, layout.width = begin.width + event.x - begin.x
|
layout.height = begin.height + event.y - begin.y, layout.width = begin.width + event.x - begin.x
|
||||||
can.page.style(can, target, html.HEIGHT, layout.height, html.WIDTH, layout.width)
|
can.page.style(can, target, html.HEIGHT, layout.height, html.WIDTH, layout.width)
|
||||||
@ -751,7 +661,7 @@ Volcanos(chat.ONKEYMAP, {_init: function(can, target) { target = target||documen
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
}, _engine: {},
|
}, _engine: {},
|
||||||
|
prevent: function(event) { event && (event.stopPropagation(), event.preventDefault()); return true },
|
||||||
input: function(event, can) { if (event.metaKey) { return } var target = event.target
|
input: function(event, can) { if (event.metaKey) { return } var target = event.target
|
||||||
target._keys = can.onkeymap._parse(event, can, mdb.INSERT+(event.ctrlKey? "_ctrl": ""), target._keys, target)
|
target._keys = can.onkeymap._parse(event, can, mdb.INSERT+(event.ctrlKey? "_ctrl": ""), target._keys, target)
|
||||||
},
|
},
|
||||||
@ -774,12 +684,10 @@ Volcanos(chat.ONKEYMAP, {_init: function(can, target) { target = target||documen
|
|||||||
},
|
},
|
||||||
selectItems: function(event, can, target, name) { name = (name||event.target.value).toLowerCase()
|
selectItems: function(event, can, target, name) { name = (name||event.target.value).toLowerCase()
|
||||||
can.page.Select(can, target, html.DIV_ITEM, function(item) {
|
can.page.Select(can, target, html.DIV_ITEM, function(item) {
|
||||||
if (!can.page.ClassList.set(can, item, html.HIDE, item.innerText.toLowerCase().indexOf(name) == -1)) {
|
if (!can.page.ClassList.set(can, item, html.HIDE, item.innerText == "" || item.innerText.toLowerCase().indexOf(name) == -1)) {
|
||||||
for (item = item.parentNode; item != target; item = item.parentNode) {
|
for (item = item.parentNode; item != target; item = item.parentNode) {
|
||||||
can.page.ClassList.del(can, item, html.HIDE), can.page.ClassList.del(can, item.previousSibling, html.HIDE)
|
can.page.ClassList.del(can, item, html.HIDE), can.page.ClassList.del(can, item.previousSibling, html.HIDE)
|
||||||
can.page.Select(can, item.previous, "div.switch", function(item) {
|
can.page.Select(can, item.previous, "div.expand", function(item) { can.page.ClassList.add(can, item, "open") })
|
||||||
can.page.ClassList.add(can, item, "open")
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}), can.onkeymap.selectCtrlN(event, can, target, html.DIV_ITEM+":not(.hide)", function(target) {
|
}), can.onkeymap.selectCtrlN(event, can, target, html.DIV_ITEM+":not(.hide)", function(target) {
|
||||||
@ -815,5 +723,4 @@ Volcanos(chat.ONKEYMAP, {_init: function(can, target) { target = target||documen
|
|||||||
can.page.Select(can, tr, html.TD, function(td, index) { can.Option(head[index], td.innerText) }), can.Update(event)
|
can.page.Select(can, tr, html.TD, function(td, index) { can.Option(head[index], td.innerText) }), can.Update(event)
|
||||||
} })
|
} })
|
||||||
},
|
},
|
||||||
prevent: function(event) { event && (event.stopPropagation(), event.preventDefault()); return true },
|
|
||||||
})
|
})
|
||||||
|
104
index.css
104
index.css
@ -20,34 +20,31 @@ input[type=button][name=stop] { background-color:red; }
|
|||||||
input[type=button][name=trash] { background-color:red; }
|
input[type=button][name=trash] { background-color:red; }
|
||||||
input[type=button][name=delete] { background-color:red; }
|
input[type=button][name=delete] { background-color:red; }
|
||||||
input[type=button][name=remove] { background-color:red; }
|
input[type=button][name=remove] { background-color:red; }
|
||||||
textarea { background-color:cyan; padding:5px; width:600px; resize:vertical; }
|
textarea { background-color:cyan; padding:5px; width:100%; }
|
||||||
/* output */
|
/* output */
|
||||||
div.layout.flex>* { float:left; }
|
|
||||||
div.output { position:relative; }
|
|
||||||
div.project div.list { margin-left:10px; }
|
div.project div.list { margin-left:10px; }
|
||||||
div.project div.item { padding:2px 10px; }
|
div.project div.item { padding:2px 10px; }
|
||||||
div.project div.item>div.name { padding-left:15px; }
|
div.project div.item>div.name { padding-left:15px; }
|
||||||
div.project div.switch { float:left; transition:all 0.3s; }
|
div.project div.expand { float:left; transition:all 0.3s; }
|
||||||
div.project div.switch.open { rotate:90deg; translate:1px 2px; transition:all 0.3s; }
|
div.project div.expand.open { rotate:90deg; translate:1px 2px; transition:all 0.3s; }
|
||||||
// div.project div.switch { margin-top:2px; width:12px; float:left; rotate:90deg; }
|
div.project div.zone>div.item { background-color:steelblue; color:white; text-align:center; padding:3px; }
|
||||||
// div.project div.switch.open { translate:3px -3px; rotate:180deg; }
|
|
||||||
div.project div.zone>div.item { background-color:steelblue; color:white; text-align:center; padding:3px; clear:both; position:relative; }
|
|
||||||
div.project div.zone>div.item>div.icon { margin-left:3px; display:none; float:right; }
|
div.project div.zone>div.item>div.icon { margin-left:3px; display:none; float:right; }
|
||||||
div.project div.zone:hover>div.name>div.icon { display:block; }
|
|
||||||
div.project div.zone>div.list>div.zone:hover>div.name>div.icon { top:3px; }
|
|
||||||
div.project div.zone>div.list>div.zone>div.item { text-align:left; padding-left:20px; }
|
div.project div.zone>div.list>div.zone>div.item { text-align:left; padding-left:20px; }
|
||||||
div.project div.zone>div.list>div.zone>div.item:hover { margin-left:10px; transition:all 0.3s; }
|
div.project div.zone>div.list>div.zone>div.item:hover { margin-left:10px; transition:all 0.3s; }
|
||||||
div.project div.zone>div.list { min-width:200px; overflow:auto; }
|
div.project div.zone>div.list { min-width:200px; overflow:auto; }
|
||||||
div.project div.zone>div.action>div.item { float:right; clear:none; }
|
div.project div.zone>div.action>div.item { float:right; clear:none; }
|
||||||
div.project div.zone>div.action>div.item input[type=text] { margin-right:-10px; }
|
div.project div.zone>div.action>div.item input[type=text] { margin-right:-10px; }
|
||||||
|
div.project div.zone>div.action>div.item>span.icon { font-size:18px; margin-left:-5px; visibility:hidden; }
|
||||||
|
div.project div.zone>div.action>div.item:hover>span.icon { visibility:visible; }
|
||||||
table.content thead { position:sticky; top:2px; }
|
table.content thead { position:sticky; top:2px; }
|
||||||
table.content th { background-color:steelblue; padding:2px 5px; }
|
table.content th { background-color:steelblue; padding:2px 5px; }
|
||||||
table.content td { padding:2px 5px; }
|
table.content td { padding:2px 5px; }
|
||||||
table.content.action th:last-child { position:sticky; right:2px; }
|
table.content.action th:last-child { position:sticky; right:2px; }
|
||||||
table.content.action td:last-child { background-color:steelblue; position:sticky; right:2px; }
|
table.content.action td:last-child { background-color:steelblue; position:sticky; right:2px; }
|
||||||
div.code { background-color:#343a3445; font-size:12px; padding:10px; border:green solid 1px; }
|
div.code { background-color:#343a3445; font-size:14px; padding:10px; border:green solid 1px; }
|
||||||
div.story[data-type=spark] { background-color:#2169a9a6; color:white; padding:5px 10px; border-left:blue solid 5px; margin:10px; }
|
div.story[data-type=spark] { background-color:#2169a9a6; color:white; padding:5px 10px; border-left:blue solid 5px; margin:10px; }
|
||||||
h1 { text-align:center; margin:20px 0; } h2 { margin:20px 0; } h3 { margin:20px 0; } ul { padding-left:40px; margin:20px 0; }
|
h1 { text-align:center; margin:20px 0; } h2 { margin:20px 0; } h3 { margin:20px 0; } ul { padding-left:40px; margin:20px 0; }
|
||||||
|
hr, td.hr { border-bottom:gray dashed 1px; margin:5px; }
|
||||||
/* fieldset */
|
/* fieldset */
|
||||||
fieldset.contexts { position:fixed; }
|
fieldset.contexts { position:fixed; }
|
||||||
fieldset.panel>legend { display:none; }
|
fieldset.panel>legend { display:none; }
|
||||||
@ -91,7 +88,7 @@ body div.float { background-color:#0e3369b3; padding:5px; }
|
|||||||
body>div.toast div.title { color:blue; float:left; }
|
body>div.toast div.title { color:blue; float:left; }
|
||||||
body>div.toast div.duration { color:gray; float:right; }
|
body>div.toast div.duration { color:gray; float:right; }
|
||||||
body>div.toast div.content { color:blue; text-align:center; }
|
body>div.toast div.content { color:blue; text-align:center; }
|
||||||
body>div.toast div.progress { border:green solid 1px; margin-left:-2px; height:20px; clear:both; }
|
body>div.toast div.progress { border:green solid 1px; margin-left:0px; height:20px; clear:both; }
|
||||||
body>div.toast div.progress div.current { background-color:red; height:18px; }
|
body>div.toast div.progress div.current { background-color:red; height:18px; }
|
||||||
body>div.toast div.action { display:block; }
|
body>div.toast div.action { display:block; }
|
||||||
body>div.carte { padding:0; }
|
body>div.carte { padding:0; }
|
||||||
@ -112,55 +109,49 @@ body>div.upload div.status div.size { text-align:center; }
|
|||||||
body>div.upload input[type=file] { width:320px; }
|
body>div.upload input[type=file] { width:320px; }
|
||||||
/* font */
|
/* font */
|
||||||
legend { font-size:1.2rem; height:31px; }
|
legend { font-size:1.2rem; height:31px; }
|
||||||
select, input { font-size:1rem; height:31px; } textarea { tab-size:2; height:93px; }
|
select, input { font-size:1rem; height:31px; } textarea { tab-size:2; height:93px; } input::placeholder { font-style:italic; }
|
||||||
table.content, div.project, div.item, div.code, div.story[data-type=spark], svg { font-family:monospace; white-space:pre; text-align:left; }
|
table.content, div.project, div.item, div.code, div.story[data-type=spark], svg { font-family:monospace; white-space:pre; text-align:left; }
|
||||||
div.action>div.tabs { padding:5px; height:31px; }
|
div.action>div.tabs { padding:5px; height:31px; }
|
||||||
div.status>div.item { padding:5px; height:30px; }
|
div.status>div.item { padding:5px; height:30px; }
|
||||||
div.status>div.item>label { font-size:0.6rem; }
|
div.status>div.item>label { font-size:0.6rem; }
|
||||||
fieldset div.tabs span.icon { margin-left:5px; visibility:hidden; }
|
|
||||||
fieldset div.tabs span.icon:hover { background-color:aliceblue; color:black; }
|
|
||||||
fieldset div.tabs>div:hover span.icon { visibility:visible; }
|
|
||||||
fieldset div.tabs>div.select span.icon { visibility:visible; }
|
|
||||||
fieldset div.plug { font-style:italic; }
|
|
||||||
fieldset form.option div.icon { font-size:26px; margin-right:5px; display:none; }
|
|
||||||
fieldset form.option div.icon:hover { background-color:white; }
|
|
||||||
fieldset.float form.option>div.icon { display:block; }
|
|
||||||
fieldset.full form.option>div.icon { display:block; }
|
|
||||||
fieldset.plug form.option>div.icon { margin-left:5px; }
|
|
||||||
fieldset.plug div.output table.content { width:100%; }
|
|
||||||
fieldset.web.code.git.status div.output table.content { width:100%; }
|
|
||||||
div.tabs { position:relative; }
|
|
||||||
/* display */
|
/* display */
|
||||||
form.option, div.action { display:contents; }
|
form.option, div.action { display:contents; } form.option.hide, div.action.hide { display:none; }
|
||||||
form.option.hide, div.action.hide { display:none; }
|
|
||||||
form.option>div.item>label, div.action>div.item>label, .hidden, .hide { display:none; }
|
form.option>div.item>label, div.action>div.item>label, .hidden, .hide { display:none; }
|
||||||
form.option>div.textarea { width:100%; }
|
form.option>div.cmd, form.option>div.textarea { width:100%; } textarea { resize:vertical; }
|
||||||
form.option>div.textarea>textarea { width:100%; }
|
legend, form.option, form.option>div.item, div.action, div.action>div.item, div.action>div.tabs, div.status>div.item, div.layout.flex>* { float:left; }
|
||||||
form.option>div.cmd { width:100%; }
|
div.action, div.output, div.status, div.project, div.display, div.profile, div.content, table.content, table.content td, div.code, div.plug, div.story, div.toast, div.carte, fieldset.input { overflow:auto; }
|
||||||
legend, form.option, form.option>div.item, div.action, div.action>div.item, div.action>div.tabs, div.status>div.item { float:left; }
|
|
||||||
div.action, div.output, div.status, div.project, div.display, div.profile, div.content, table.content, table.content td, div.code, div.plug, div.story, div.toast { overflow:auto; }
|
|
||||||
fieldset>div.output, fieldset>div.status, div.item.textarea, div.project div.item, div.content, div.code, div.story[data-type=spark] { clear:both; }
|
fieldset>div.output, fieldset>div.status, div.item.textarea, div.project div.item, div.content, div.code, div.story[data-type=spark] { clear:both; }
|
||||||
div.status>legend { margin-left:2px; margin-right:0; float:right; clear:none; }
|
fieldset>div.status>legend { margin-left:2px; margin-right:0; float:right; clear:none; }
|
||||||
fieldset.plugin:not(.float):not(.full):not(.cmd) { padding:10px; margin:10px; }
|
fieldset.plugin:not(.float):not(.full):not(.cmd) { padding:10px; margin:10px; }
|
||||||
fieldset.plugin:not(.float):not(.full):not(.cmd)>legend { float:none; }
|
fieldset.plugin:not(.float):not(.full):not(.cmd)>legend { float:none; }
|
||||||
fieldset.auto, fieldset.full, fieldset.float, div.float { position:fixed; z-index:10; }
|
fieldset.auto, fieldset.full, fieldset.float, div.float { position:fixed; z-index:10; }
|
||||||
div.carte { overflow:auto; }
|
fieldset.plug { position:absolute; bottom:0; right:0; } fieldset.cmd fieldset.plug { position:fixed; bottom:31px; right:0; }
|
||||||
div.zone>div.action input::placeholder { font-style:italic; }
|
fieldset.plug div.output table.content { width:100%; }
|
||||||
input::placeholder { font-style:italic; }
|
div.output { position:relative; }
|
||||||
fieldset.input { overflow:auto; }
|
div.tabs { position:relative; }
|
||||||
|
div.tabs span.icon { margin-left:5px; visibility:hidden; }
|
||||||
|
div.tabs span.icon:hover { background-color:aliceblue; color:black; }
|
||||||
|
div.tabs>div:hover span.icon { visibility:visible; }
|
||||||
|
div.tabs>div.select span.icon { visibility:visible; }
|
||||||
div.code { position:sticky; left:0; }
|
div.code { position:sticky; left:0; }
|
||||||
hr { border-bottom:gray dashed 1px; margin:5px; }
|
div.plug { font-style:italic; }
|
||||||
td.hr { border-bottom:gray dashed 1px; margin:5px; }
|
form.option>div.item { position:relative; }
|
||||||
|
form.option>div.item>span.icon { font-size:20px; position:absolute; top:2px; right:10px; visibility:hidden; }
|
||||||
|
form.option>div.item:hover>span.icon { visibility:visible; }
|
||||||
|
form.option>div.icon { font-size:26px; margin-right:5px; display:none; }
|
||||||
|
form.option>div.icon:hover { background-color:white; }
|
||||||
|
fieldset.float>form.option>div.icon { display:block; }
|
||||||
|
fieldset.full>form.option>div.icon { display:block; }
|
||||||
|
fieldset.plug>form.option>div.icon { margin-left:5px; }
|
||||||
/* hover */
|
/* hover */
|
||||||
legend:hover { background-color:skyblue; }
|
legend:hover { background-color:skyblue; }
|
||||||
select:hover { background-color:gray; color:cyan; }
|
select:hover { background-color:gray; color:cyan; }
|
||||||
div.tabs div:hover, div.tabs div.select { background-color:transparent; }
|
div.tabs div:hover, div.tabs div.select { background-color:transparent; }
|
||||||
div.item:hover, div.item.select, span.item:hover, table.content tr:hover, table.content tr.select, h1:hover, h2:hover, h3:hover { background-color:steelblue; }
|
div.item:hover, div.item.select, span.item:hover, table.content tr:hover, table.content tr.select, h1:hover, h2:hover, h3:hover { background-color:steelblue; }
|
||||||
table.content th:hover, table.content td:hover, table.content td.select { background-color:cornflowerblue; }
|
div.carte div.item:hover, table.content th:hover, table.content td:hover, table.content td.select { background-color:cornflowerblue; }
|
||||||
div.story[data-type=spark] span:hover { background-color:deepskyblue; box-shadow:4px 4px 20px 4px #29318e; }
|
div.story[data-type=spark] span:hover { background-color:deepskyblue; box-shadow:4px 4px 20px 4px #29318e; }
|
||||||
div.carte div.item:hover { background-color:cornflowerblue; }
|
|
||||||
select, input[type=text], textarea { box-shadow:4px 4px 20px 4px #626bd0; }
|
select, input[type=text], textarea { box-shadow:4px 4px 20px 4px #626bd0; }
|
||||||
legend, select, input[type=button], div.tabs, div.item, span.item, div.zone>div.item, th, td, h1, h2, h3 { cursor:pointer; }
|
legend, select, input[type=button], div.tabs, div.item, span.item, th, td, h1, h2, h3 { cursor:pointer; }
|
||||||
div.title, div.story[data-type=spark] { cursor:copy; }
|
div.title, div.story[data-type=spark] { cursor:copy; }
|
||||||
/* topic */
|
/* topic */
|
||||||
body.black a { color:yellow; }
|
body.black a { color:yellow; }
|
||||||
@ -261,10 +252,6 @@ body.mobile fieldset.Footer input[name=cmd] { height:3rem; }
|
|||||||
body.mobile fieldset.input.date div.output td { padding:8px 20px; }
|
body.mobile fieldset.input.date div.output td { padding:8px 20px; }
|
||||||
body.mobile fieldset.word.float>div.output>div.project { top:38px; }
|
body.mobile fieldset.word.float>div.output>div.project { top:38px; }
|
||||||
/* misc */
|
/* misc */
|
||||||
fieldset.draw td.content { position:relative; }
|
|
||||||
fieldset.draw div.output div.content svg { background-color:#1b5b738c; }
|
|
||||||
fieldset.draw.spide div.output div.toggle { display:none; }
|
|
||||||
fieldset.draw.trend div.output div.toggle { display:none; }
|
|
||||||
fieldset.panel.Action.cmd>div.toggle.project { display:none; }
|
fieldset.panel.Action.cmd>div.toggle.project { display:none; }
|
||||||
fieldset.panel.Search div.story[data-type=spark] { padding:0; margin:0; }
|
fieldset.panel.Search div.story[data-type=spark] { padding:0; margin:0; }
|
||||||
fieldset.plugin.location>div.action input[type=text] { width:40px; }
|
fieldset.plugin.location>div.action input[type=text] { width:40px; }
|
||||||
@ -277,11 +264,12 @@ fieldset.plugin.inner.cmd>legend { display:none; }
|
|||||||
fieldset.plugin.inner.cmd>div.action { display:none; }
|
fieldset.plugin.inner.cmd>div.action { display:none; }
|
||||||
fieldset.plugin.inner.cmd>form.option { display:none; }
|
fieldset.plugin.inner.cmd>form.option { display:none; }
|
||||||
fieldset.xterm div.toggle { display:none; }
|
fieldset.xterm div.toggle { display:none; }
|
||||||
fieldset>div.output fieldset.plug { position:absolute; bottom:0; right:0; }
|
fieldset.draw td.content { position:relative; }
|
||||||
fieldset>div.output fieldset.plug.select { display:block; }
|
fieldset.draw div.output div.content svg { background-color:#1b5b738c; }
|
||||||
fieldset.cmd>div.output fieldset.plug { position:fixed; bottom:31px; right:0; }
|
fieldset.draw.spide div.output div.toggle { display:none; }
|
||||||
|
fieldset.draw.trend div.output div.toggle { display:none; }
|
||||||
|
fieldset.web.code.git.status div.output table.content { width:100%; }
|
||||||
body.mobile fieldset.plugin>legend { border:none; }
|
body.mobile fieldset.plugin>legend { border:none; }
|
||||||
.unselectable { -webkit-touch-callout:none; -webkit-user-select:none; -khtml-user-select:none; -moz-user-select:none; -ms-user-select:none; -o-user-select:none; user-select:none; }
|
|
||||||
/* layout */
|
/* layout */
|
||||||
table.layout { border-spacing:0; }
|
table.layout { border-spacing:0; }
|
||||||
table.layout td { vertical-align:top; }
|
table.layout td { vertical-align:top; }
|
||||||
@ -328,16 +316,4 @@ div.story[data-type=spark]::-webkit-scrollbar { width:0 !important; height:0 !im
|
|||||||
div.project::-webkit-scrollbar { width:0 !important; height:0 !important; }
|
div.project::-webkit-scrollbar { width:0 !important; height:0 !important; }
|
||||||
div.content::-webkit-scrollbar { width:0 !important; height:0 !important; }
|
div.content::-webkit-scrollbar { width:0 !important; height:0 !important; }
|
||||||
|
|
||||||
.picker { box-shadow:4px 4px 20px 4px #626bd0; }
|
body.dark ::selection { background-color:#033a3a; }
|
||||||
div.view span.keyword { color:#5cadd4; }
|
|
||||||
div.view span.string { color:#f29766; }
|
|
||||||
div.item:not(.string):not(.number):not(.boolean)>span.value { color:silver; font-style:italic; }
|
|
||||||
span.item:not(.string):not(.number):not(.boolean)>span.value { color:silver; font-style:italic; }
|
|
||||||
fieldset.debug span.path { color:silver; font-style:italic; }
|
|
||||||
body.dark fieldset.debug span.path { color:gray; }
|
|
||||||
body.dark fieldset.debug span.target { color:gray; }
|
|
||||||
body.dark div.item:not(.string):not(.number):not(.boolean)>span.value { color:gray; }
|
|
||||||
body.dark span.item:not(.string):not(.number):not(.boolean)>span.value { color:gray; }
|
|
||||||
form.option>div.item { position:relative; }
|
|
||||||
form.option>div.item>span.icon { font-size:20px; position:absolute; top:2px; right:10px; visibility:hidden; }
|
|
||||||
form.option>div.item:hover>span.icon { visibility:visible; }
|
|
||||||
|
@ -14,6 +14,10 @@ Volcanos("misc", {Message: function(event, can) { var msg = {}
|
|||||||
StatusTimeCount: function(obj) { msg.append && msg.Status(can.base.Copy(kit.Dict(mdb.TIME, can.base.Time(), mdb.COUNT, msg.Length()+"x"+msg.append.length), obj)) },
|
StatusTimeCount: function(obj) { msg.append && msg.Status(can.base.Copy(kit.Dict(mdb.TIME, can.base.Time(), mdb.COUNT, msg.Length()+"x"+msg.append.length), obj)) },
|
||||||
Status: function(obj) { msg.Option(ice.MSG_STATUS, JSON.stringify(can.core.Item(obj, function(key, value) { return {name: key, value: value} }))) },
|
Status: function(obj) { msg.Option(ice.MSG_STATUS, JSON.stringify(can.core.Item(obj, function(key, value) { return {name: key, value: value} }))) },
|
||||||
|
|
||||||
|
OptionDefault(key, val) { var arg = arguments
|
||||||
|
for (var i = 0; i < arg.length; i += 2) { msg.Option(arg[i]) || msg.Option(arg[i], arg[i+1]) }
|
||||||
|
return msg.Option(key) || msg.Option(key, val)
|
||||||
|
},
|
||||||
Option: function(key, val) {
|
Option: function(key, val) {
|
||||||
if (key == undefined) { return msg && msg.option || [] }
|
if (key == undefined) { return msg && msg.option || [] }
|
||||||
if (can.base.isObject(key)) { can.core.Item(key, msg.Option) }
|
if (can.base.isObject(key)) { can.core.Item(key, msg.Option) }
|
||||||
@ -182,7 +186,7 @@ Volcanos("misc", {Message: function(event, can) { var msg = {}
|
|||||||
SearchOrConf: function(can, key, def) { return can.base.getValid(can.misc.Search(can, key), can.Conf(key), def) },
|
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 [] }
|
SearchHash: function(can) { if (!can.isCmdMode()) { return [] }
|
||||||
if (arguments.length > 1) { location.hash = encodeURIComponent(can.core.List(arguments).slice(1).join(ice.FS)) }
|
if (arguments.length > 1) { location.hash = encodeURIComponent(can.core.List(arguments).slice(1).join(ice.FS)) }
|
||||||
return can.core.Split(decodeURIComponent(location.hash.slice(1)), ",:")||[]
|
return can.core.Split(decodeURIComponent(location.hash.slice(1)), ":,")||[]
|
||||||
},
|
},
|
||||||
Search: function(can, key, value) { var args = {}
|
Search: function(can, key, value) { var args = {}
|
||||||
if (value == undefined && can.base.isString(key)) { var ls = can.core.Split(location.pathname, ice.PS); if (ls[0] == chat.SHARE) { args[chat.SHARE] = ls[1] }
|
if (value == undefined && can.base.isString(key)) { var ls = can.core.Split(location.pathname, ice.PS); if (ls[0] == chat.SHARE) { args[chat.SHARE] = ls[1] }
|
||||||
@ -256,7 +260,7 @@ Volcanos("misc", {Message: function(event, can) { var msg = {}
|
|||||||
var file = this.fileLine(depth+1, length||9)
|
var file = this.fileLine(depth+1, length||9)
|
||||||
for (var i = depth+1; i < 10; i++) {
|
for (var i = depth+1; i < 10; i++) {
|
||||||
var _file = this.fileLine(i+1, length||9)
|
var _file = this.fileLine(i+1, length||9)
|
||||||
if (_file && _file.link != file.link && !_file.path.indexOf("/lib/") == 0) { return _file }
|
if (_file && _file.path && _file.link != file.link && !_file.path.indexOf("/lib/") == 0) { return _file }
|
||||||
}
|
}
|
||||||
return file
|
return file
|
||||||
},
|
},
|
||||||
|
25
lib/page.js
25
lib/page.js
@ -248,15 +248,17 @@ Volcanos("page", {ClassList: {
|
|||||||
ismodkey: function(event) { return [lang.META, lang.ALT, lang.CONTROL, lang.SHIFT].indexOf(event.key) > -1 },
|
ismodkey: function(event) { return [lang.META, lang.ALT, lang.CONTROL, lang.SHIFT].indexOf(event.key) > -1 },
|
||||||
isDisplay: function(target) { return target && target.style.display != html.NONE && target.className.indexOf(html.HIDE) == -1 },
|
isDisplay: function(target) { return target && target.style.display != html.NONE && target.className.indexOf(html.HIDE) == -1 },
|
||||||
unicode: {
|
unicode: {
|
||||||
|
menu: "\u2630", delete: "\u2715",
|
||||||
open: "\u25BE", close: "\u25B8", inner: "..",
|
open: "\u25BE", close: "\u25B8", inner: "..",
|
||||||
delete: "\u2715",
|
|
||||||
},
|
},
|
||||||
AppendData: function(can, target, prefix, key, value, cb) { var open = can.page.unicode.open, close = can.page.unicode.close
|
AppendData: function(can, target, prefix, key, value, cb) { var open = can.page.unicode.open, close = can.page.unicode.close
|
||||||
function short(value, length) {
|
function short(value, length) {
|
||||||
if (length == undefined) { value.indexOf(ice.NL) > -1 && (value = value.trim().split(ice.NL)[0]+can.page.unicode.inner)
|
if (length == undefined) {
|
||||||
|
value.indexOf(ice.NL) > -1 && (value = value.trim().split(ice.NL)[0]+can.page.unicode.inner)
|
||||||
return can.page.replace(can, value)
|
return can.page.replace(can, value)
|
||||||
} else { if (length > 5) { return can.page.unicode.inner } }
|
} else { if (length > 5) {
|
||||||
return value
|
return can.page.unicode.inner }
|
||||||
|
} return value
|
||||||
}
|
}
|
||||||
function show(value, deep) { deep = deep == undefined? 2: 0; switch (typeof value) {
|
function show(value, deep) { deep = deep == undefined? 2: 0; switch (typeof value) {
|
||||||
case lang.OBJECT: if (!value) { return {} }
|
case lang.OBJECT: if (!value) { return {} }
|
||||||
@ -264,8 +266,8 @@ Volcanos("page", {ClassList: {
|
|||||||
if (value.tagName) { return {type: nfs.TARGET, value: "$ "+value.tagName.toLowerCase()+(value.className? ice.PT+value.className.replaceAll(ice.SP, ice.PT):"")} }
|
if (value.tagName) { return {type: nfs.TARGET, value: "$ "+value.tagName.toLowerCase()+(value.className? ice.PT+value.className.replaceAll(ice.SP, ice.PT):"")} }
|
||||||
if (deep < 0) { return {value: value.length == undefined? "{"+can.page.unicode.inner+"}": "["+can.page.unicode.inner+"]"} }
|
if (deep < 0) { return {value: value.length == undefined? "{"+can.page.unicode.inner+"}": "["+can.page.unicode.inner+"]"} }
|
||||||
if (value.length != undefined) { return {value: (value.length > 3? value.length+ice.SP: "")+"["+can.core.List(value, function(value, index) { if (index < 6) { return short(show(value, deep-1).value, index+1) } }).join(ice.FS)+"]"} }
|
if (value.length != undefined) { return {value: (value.length > 3? value.length+ice.SP: "")+"["+can.core.List(value, function(value, index) { if (index < 6) { return short(show(value, deep-1).value, index+1) } }).join(ice.FS)+"]"} }
|
||||||
return {value: "{"+can.core.Item(value, function(key, val, list) { if (value.hasOwnProperty(key) && list.length < 7) { return short(key+ice.DF+show(val, deep-1).value, list.length) } }).join(ice.FS)+"}"}
|
return {value: "{"+can.core.Item(value, function(key, val, list) { if (value.hasOwnProperty(key) && val && list.length < 7) { return short(key+ice.DF+show(val, deep-1).value, list.length) } }).join(ice.FS)+"}"}
|
||||||
case lang.STRING: return {open: "s", close: "s", value: "\""+(deep == 2? value: short(value))+"\""}
|
case lang.STRING: return {open: "s", close: "s", value: "\""+(deep == 2? value.replaceAll("\n", "\\n"): short(value))+"\""}
|
||||||
case lang.NUMBER: return {open: "n", close: "n", value: value}
|
case lang.NUMBER: return {open: "n", close: "n", value: value}
|
||||||
case lang.BOOLEAN: return {open: "b", close: "b", value: value}
|
case lang.BOOLEAN: return {open: "b", close: "b", value: value}
|
||||||
case lang.FUNCTION: return {open: "f", close: "f", value: deep == 2? (""+value).split(ice.NL)[0]: "function(..) {..}"}
|
case lang.FUNCTION: return {open: "f", close: "f", value: deep == 2? (""+value).split(ice.NL)[0]: "function(..) {..}"}
|
||||||
@ -315,4 +317,15 @@ Volcanos("page", {ClassList: {
|
|||||||
isclose && {view: [[html.ITEM, html.HIDE]], list: [{text: " "}, {className: code.KEYWORD, text: can.page.replace(can, ice.LT+ice.PS+tag+ice.GT)}], _init: function(target) { ui.close = target }},
|
isclose && {view: [[html.ITEM, html.HIDE]], list: [{text: " "}, {className: code.KEYWORD, text: can.page.replace(can, ice.LT+ice.PS+tag+ice.GT)}], _init: function(target) { ui.close = target }},
|
||||||
]}
|
]}
|
||||||
},
|
},
|
||||||
|
requireModules: function(can, libs, cb, cbs) {
|
||||||
|
for (var i = 0; i < libs.length; i++) { if (libs[i].indexOf(ice.PS) == 0 || libs[i].indexOf(ice.HTTP) == 0) { continue }
|
||||||
|
if (libs[i].indexOf(nfs._CSS) == -1 && libs[i].indexOf(nfs._JS) == -1) { libs[i] = libs[i]+"/lib/"+libs[i]+nfs._JS }
|
||||||
|
libs[i] = "/require/node_modules/"+libs[i]
|
||||||
|
} can.require(libs, cb, cbs)
|
||||||
|
},
|
||||||
|
requireDraw: function(can, cb) { can.page.ClassList.add(can, can._fields, "draw")
|
||||||
|
can.require(["/plugin/local/wiki/draw.js", "/plugin/local/wiki/draw/path.js"], function() {
|
||||||
|
can.onmotion.clear(can), can.onimport._show(can, can._msg), cb()
|
||||||
|
})
|
||||||
|
},
|
||||||
})
|
})
|
||||||
|
@ -73,7 +73,7 @@ Volcanos("user", {info: {}, agent: {
|
|||||||
{view: "duration", title: "点击关闭", onclick: function() { action.close() }},
|
{view: "duration", title: "点击关闭", onclick: function() { action.close() }},
|
||||||
can.base.isObject(meta.content)? meta.content: {text: [meta.content||"", html.DIV, nfs.CONTENT]},
|
can.base.isObject(meta.content)? meta.content: {text: [meta.content||"", html.DIV, nfs.CONTENT]},
|
||||||
html.ACTION, !can.base.isUndefined(meta.progress) && {view: "progress", style: {width: width-10}, list: [
|
html.ACTION, !can.base.isUndefined(meta.progress) && {view: "progress", style: {width: width-10}, list: [
|
||||||
{view: "current", style: {width: (meta.progress||0)*(width-14)/100}},
|
{view: "current", style: {width: (meta.progress||0)*(width-12)/100}},
|
||||||
]},
|
]},
|
||||||
] }]); can.onengine.signal(can, chat.ONTOAST, can.request({}, {time: can.misc._time(), title: meta.title, content: meta.content, fileline: can.misc.FileLine(-3)})._callers(1))
|
] }]); can.onengine.signal(can, chat.ONTOAST, can.request({}, {time: can.misc._time(), title: meta.title, content: meta.content, fileline: can.misc.FileLine(-3)})._callers(1))
|
||||||
var action = can.onappend._action(can, meta.action && meta.action.list? meta.action.list: meta.action||[""], ui.action, {
|
var action = can.onappend._action(can, meta.action && meta.action.list? meta.action.list: meta.action||[""], ui.action, {
|
||||||
@ -99,8 +99,11 @@ Volcanos("user", {info: {}, agent: {
|
|||||||
},
|
},
|
||||||
carte: function(event, can, meta, list, cb, parent, trans) {
|
carte: function(event, can, meta, list, cb, parent, trans) {
|
||||||
meta = meta||can.ondetail||can.onaction||{}, list = can.base.getValid(list, meta.list, can.core.Item(meta)); if (!list || list.length == 0) { return }
|
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) { meta[button]? meta[button](event, can, button): can.base.isFunc(cb)? cb(event, button, meta, carte):
|
function click(event, button) { can.misc.Event(event, can, function(msg) {
|
||||||
can.core.CallFunc([can.onaction, button], [event, can, button]), can.page.Remove(can, ui._target) }
|
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)
|
||||||
|
}) }
|
||||||
function remove_sub(carte) { carte._sub && can.page.Remove(can, carte._sub._target), delete(carte._sub) }
|
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) {
|
var ui = can.page.Append(can, document.body, [{view: [[chat.CARTE, meta._style||"", chat.FLOAT]], list: can.core.List(list, function(item, index) {
|
||||||
return item ==""? /* 0.space */ {type: html.HR}: can.base.isString(item)? /* 1.string */ {view: [html.ITEM, html.DIV, can.user.trans(can, item, trans)], onclick: function(event) { click(event, item) }, onmouseenter: function(event) { remove_sub(carte) } }:
|
return item ==""? /* 0.space */ {type: html.HR}: can.base.isString(item)? /* 1.string */ {view: [html.ITEM, html.DIV, can.user.trans(can, item, trans)], onclick: function(event) { click(event, item) }, onmouseenter: function(event) { remove_sub(carte) } }:
|
||||||
|
@ -4,8 +4,7 @@
|
|||||||
"browser_action": {"default_popup": "/publish/chrome/popup.html"},
|
"browser_action": {"default_popup": "/publish/chrome/popup.html"},
|
||||||
"content_scripts": [
|
"content_scripts": [
|
||||||
{"matches": ["<all_urls>"], "permissions": [
|
{"matches": ["<all_urls>"], "permissions": [
|
||||||
"tabs", "history", "cookies", "bookmarks", "contextMenus", "notifications",
|
"tabs", "history", "cookies", "bookmarks", "contextMenus", "notifications", "http://localhost:9020/*"
|
||||||
"http://localhost:9020/*"
|
|
||||||
], "css": ["/page/can.css"], "js": ["/page/can.js", "/publish/chrome/contexts.js"]}
|
], "css": ["/page/can.css"], "js": ["/page/can.js", "/publish/chrome/contexts.js"]}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -27,7 +27,7 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg) { can.onmotion.clear(can)
|
|||||||
_tabs: function(can, sub, meta) {
|
_tabs: function(can, sub, meta) {
|
||||||
var tabs = [{view: [html.TABS, html.DIV, meta.name], onclick: function(event) { can.onmotion.select(can, can._header_tabs, html.DIV_TABS, sub._header_tabs)
|
var tabs = [{view: [html.TABS, html.DIV, meta.name], onclick: function(event) { can.onmotion.select(can, can._header_tabs, html.DIV_TABS, sub._header_tabs)
|
||||||
can.onmotion.select(can, can._action, html.DIV_TABS, sub._tabs), can.onmotion.select(can, can._output, html.FIELDSET_PLUGIN, sub._target)
|
can.onmotion.select(can, can._action, html.DIV_TABS, sub._tabs), can.onmotion.select(can, can._output, html.FIELDSET_PLUGIN, sub._target)
|
||||||
if (sub._delay_refresh) { sub._delay_refresh = false, sub.onaction._resize(sub, can.Conf(html.LAYOUT) == "", can.ConfHeight(), can.ConfWidth()) }
|
if (sub._delay_refresh) { sub._delay_refresh = false, sub.onimport.size(sub, can.ConfHeight(), can.ConfWidth(), can.Conf(html.LAYOUT) == "") }
|
||||||
}, onmouseenter: sub._legend.onmouseenter, ondblclick: sub._legend.onclick}]
|
}, onmouseenter: sub._legend.onmouseenter, ondblclick: sub._legend.onclick}]
|
||||||
sub._header_tabs = can.page.Append(can, can._header_tabs, tabs)._target, sub._tabs = can.page.Append(can, can._action, tabs)._target
|
sub._header_tabs = can.page.Append(can, can._header_tabs, tabs)._target, sub._tabs = can.page.Append(can, can._action, tabs)._target
|
||||||
},
|
},
|
||||||
@ -74,6 +74,7 @@ Volcanos(chat.ONACTION, {_init: function(can, target) {
|
|||||||
event.target.innerHTML = toggle()? gt: lt, can.onaction.layout(can, can.Conf(html.LAYOUT))
|
event.target.innerHTML = toggle()? gt: lt, can.onaction.layout(can, can.Conf(html.LAYOUT))
|
||||||
}}])
|
}}])
|
||||||
} target.ontouchstart = function(event) { can.misc.Event(event, can, function(msg) { can.onengine.signal(can, chat.ONACTION_TOUCH, msg) }) }
|
} target.ontouchstart = function(event) { can.misc.Event(event, can, function(msg) { can.onengine.signal(can, chat.ONACTION_TOUCH, msg) }) }
|
||||||
|
can.onengine.listen(can, chat.ONSEARCH, function(msg, arg) { arg[0] == ctx.COMMAND && can.run(msg, ["can.command"]) })
|
||||||
},
|
},
|
||||||
_menus: [
|
_menus: [
|
||||||
[html.LAYOUT, ice.AUTO, TABS, TABVIEW, HORIZON, VERTICAL, GRID, FREE, FLOW, PAGE],
|
[html.LAYOUT, ice.AUTO, TABS, TABVIEW, HORIZON, VERTICAL, GRID, FREE, FLOW, PAGE],
|
||||||
@ -182,7 +183,7 @@ Volcanos(chat.ONLAYOUT, {
|
|||||||
can.ConfHeight(h-html.ACTION_HEIGHT-3*html.PLUGIN_MARGIN), can.ConfWidth(w), can.onlayout._plugin(can, GRID)
|
can.ConfHeight(h-html.ACTION_HEIGHT-3*html.PLUGIN_MARGIN), can.ConfWidth(w), can.onlayout._plugin(can, GRID)
|
||||||
}) },
|
}) },
|
||||||
_plugin: function(can, button) { can.core.List(can._plugins, function(sub) {
|
_plugin: function(can, button) { can.core.List(can._plugins, function(sub) {
|
||||||
sub.onaction._resize(sub, button == "" || button == FREE || button == FLOW, can.ConfHeight(), can.ConfWidth()), button == "" && can.page.style(can, sub._output, html.MAX_HEIGHT, "")
|
sub.onimport.size(sub, can.ConfHeight(), can.ConfWidth(), button == "" || button == FREE || button == FLOW), button == "" && can.page.style(can, sub._output, html.MAX_HEIGHT, "")
|
||||||
}) },
|
}) },
|
||||||
})
|
})
|
||||||
Volcanos(chat.ONEXPORT, {
|
Volcanos(chat.ONEXPORT, {
|
||||||
|
@ -6,9 +6,21 @@ fieldset.Footer>div.output div.title { float:left; }
|
|||||||
fieldset.Footer>div.output div.state { font-family:monospace; float:right; }
|
fieldset.Footer>div.output div.state { font-family:monospace; float:right; }
|
||||||
fieldset.Footer>div.output div.state label { font-size:12px; }
|
fieldset.Footer>div.output div.state label { font-size:12px; }
|
||||||
fieldset.Footer>div.output div.toast { background-color:darkcyan; float:right; }
|
fieldset.Footer>div.output div.toast { background-color:darkcyan; float:right; }
|
||||||
fieldset.Footer>div.output div.cmd { padding:0; float:left; }
|
fieldset.Footer>div.output div.cmd { padding:0; float:left; position:relative; }
|
||||||
|
fieldset.Footer>div.output div.cmd span.icon { position:absolute; top:5px; right:10px; }
|
||||||
|
fieldset.Footer>div.output div.cmd:hover input[name=cmd] { width:320px; transition:all 0.5s; }
|
||||||
fieldset.Footer>div.output input[name=cmd] { margin-left:40px; width:120px; transition:all 1s; }
|
fieldset.Footer>div.output input[name=cmd] { margin-left:40px; width:120px; transition:all 1s; }
|
||||||
fieldset.Footer>div.output input[name=cmd]:hover { width:320px; transition:all 0.5s; }
|
|
||||||
fieldset.Footer>div.output input[name=cmd]:focus { width:320px; transition:all 0.5s; }
|
fieldset.Footer>div.output input[name=cmd]:focus { width:320px; transition:all 0.5s; }
|
||||||
fieldset.story.nlog.float tbody tr.warn { color:yellow; }
|
fieldset.story.nlog.float tbody tr.warn { color:yellow; }
|
||||||
fieldset.story.nlog.float tbody tr.error { color:red; }
|
fieldset.story.nlog.float tbody tr.error { color:red; }
|
||||||
|
|
||||||
|
.picker { box-shadow:4px 4px 20px 4px #626bd0; }
|
||||||
|
div.view span.keyword { color:#5cadd4; }
|
||||||
|
div.view span.string { color:#f29766; }
|
||||||
|
div.item:not(.string):not(.number):not(.boolean)>span.value { color:silver; font-style:italic; }
|
||||||
|
span.item:not(.string):not(.number):not(.boolean)>span.value { color:silver; font-style:italic; }
|
||||||
|
fieldset.debug span.path { color:silver; font-style:italic; }
|
||||||
|
body.dark fieldset.debug span.path { color:gray; }
|
||||||
|
body.dark fieldset.debug span.target { color:gray; }
|
||||||
|
body.dark div.item:not(.string):not(.number):not(.boolean)>span.value { color:gray; }
|
||||||
|
body.dark span.item:not(.string):not(.number):not(.boolean)>span.value { color:gray; }
|
||||||
|
@ -22,8 +22,8 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, target) {
|
|||||||
} }}, "", target, [chat.TITLE]) },
|
} }}, "", target, [chat.TITLE]) },
|
||||||
count: function(can, name) { can.page.Select(can, can._output, can.core.Keys(html.SPAN, name), function(item) { item.innerHTML = can.Conf(name, parseInt(can.Conf(name)||"0")+1+"")+"" }) },
|
count: function(can, name) { can.page.Select(can, can._output, can.core.Keys(html.SPAN, name), function(item) { item.innerHTML = can.Conf(name, parseInt(can.Conf(name)||"0")+1+"")+"" }) },
|
||||||
toast: function(can, msg, title, content, fileline, time) { can.onimport._data(can, NTIP, {time: time, fileline: fileline, title: title, content: content}), can.page.Modify(can, can.toast, [time, title, content].join(ice.SP)) },
|
toast: function(can, msg, title, content, fileline, time) { can.onimport._data(can, NTIP, {time: time, fileline: fileline, title: title, content: content}), can.page.Modify(can, can.toast, [time, title, content].join(ice.SP)) },
|
||||||
ncmd: function(can, msg, _follow, _cmds) { can.onimport._data(can, NCMD, {time: can.base.Time(), follow: _follow, cmds: _cmds}), can.onimport.nlog(can) },
|
ncmd: function(can, msg, _follow, _cmds) { can.onimport._data(can, NCMD, {time: can.base.Time(), follow: _follow, cmds: _cmds}), can.onimport.nlog(can, NLOG) },
|
||||||
nlog: function(can) { can.page.Select(can, can._output, can.core.Keys(html.SPAN, name), function(item) { item.innerHTML = can.misc._list.length }) },
|
nlog: function(can, name) { can.page.Select(can, can._output, can.core.Keys(html.SPAN, name), function(item) { item.innerHTML = can.misc._list.length }) },
|
||||||
_data: function(can, name, item) { can[name] = can[name]||can.request(), can[name].Push(item), can.onimport.count(can, name) },
|
_data: function(can, name, item) { can[name] = can[name]||can.request(), can[name].Push(item), can.onimport.count(can, name) },
|
||||||
})
|
})
|
||||||
Volcanos(chat.ONACTION, {_init: function(can) { if (can.user.isExtension || can.user.mod.isPod) { can.onmotion.hidden(can) } },
|
Volcanos(chat.ONACTION, {_init: function(can) { if (can.user.isExtension || can.user.mod.isPod) { can.onmotion.hidden(can) } },
|
||||||
|
@ -8,9 +8,12 @@ fieldset.Header>div.output div.title { float:left; }
|
|||||||
fieldset.Header>div.output div.state { float:right; }
|
fieldset.Header>div.output div.state { float:right; }
|
||||||
fieldset.Header>div.output div.state.avatar { padding:0; height:31px; }
|
fieldset.Header>div.output div.state.avatar { padding:0; height:31px; }
|
||||||
fieldset.Header>div.output div.state.avatar>img { height:31px; }
|
fieldset.Header>div.output div.state.avatar>img { height:31px; }
|
||||||
fieldset.Header>div.output div.search.title { margin-left:20px; float:left; }
|
fieldset.Header>div.output div.search.title { padding:5px 0; margin-left:20px; float:left; position:relative; }
|
||||||
fieldset.Header>div.output div.search>input { margin-top:-5px; height:30px; transition:all 1s; }
|
fieldset.Header>div.output div.search>input { margin-top:-5px; margin-right:0; height:30px; transition:all 1s; }
|
||||||
fieldset.Header>div.output div.search>input:hover { width:320px; transition:all 0.5s; }
|
|
||||||
fieldset.Header>div.output div.search>input:focus { width:320px; transition:all 0.5s; }
|
fieldset.Header>div.output div.search>input:focus { width:320px; transition:all 0.5s; }
|
||||||
|
fieldset.Header>div.output div.search:hover>input { width:320px; transition:all 0.5s; }
|
||||||
|
fieldset.Header>div.output div.search:hover>span.icon { visibility:visible; }
|
||||||
|
fieldset.Header>div.output div.search>span.icon { font-size:20px; position:absolute; top:5px; right:5px; visibility:hidden; }
|
||||||
fieldset.Header>div.output div.river { margin-right:100px; }
|
fieldset.Header>div.output div.river { margin-right:100px; }
|
||||||
fieldset.Header>div.output div.search { float:left; }
|
fieldset.Header>div.output div.search { float:left; }
|
||||||
|
|
||||||
|
@ -4,6 +4,7 @@ Volcanos(chat.ONACTION, {
|
|||||||
list: function(event, can) { can.sup.isSimpleMode() || can.run(event) },
|
list: function(event, can) { can.sup.isSimpleMode() || can.run(event) },
|
||||||
back: function(event, can) { can.sup.onimport._back(can.sup) },
|
back: function(event, can) { can.sup.onimport._back(can.sup) },
|
||||||
onclick: function(event, can) { can.Conf(mdb.TYPE) == html.BUTTON && can.run(event, [ctx.ACTION, can.Conf(mdb.NAME)].concat(can.sup.Input())) },
|
onclick: function(event, can) { can.Conf(mdb.TYPE) == html.BUTTON && can.run(event, [ctx.ACTION, can.Conf(mdb.NAME)].concat(can.sup.Input())) },
|
||||||
|
onfocus: function(event, can, target) { can.Conf(mdb.TYPE) == html.TEXT && can.onmotion.selectRange(target) },
|
||||||
onchange: function(event, can) { can.Conf(mdb.TYPE) == html.SELECT && can.run(event) },
|
onchange: function(event, can) { can.Conf(mdb.TYPE) == html.SELECT && can.run(event) },
|
||||||
onkeydown: function(event, can) { can.onkeymap.input(event, can, event.target)
|
onkeydown: function(event, can) { can.onkeymap.input(event, can, event.target)
|
||||||
if (can.Conf(mdb.TYPE) == html.TEXTAREA) { if (!event.ctrlKey) { return } }
|
if (can.Conf(mdb.TYPE) == html.TEXTAREA) { if (!event.ctrlKey) { return } }
|
||||||
@ -14,18 +15,9 @@ Volcanos(chat.ONACTION, {
|
|||||||
default: can.onkeymap.selectOutput(event, can.sup); return
|
default: can.onkeymap.selectOutput(event, can.sup); return
|
||||||
} can.onkeymap.prevent(event)
|
} can.onkeymap.prevent(event)
|
||||||
},
|
},
|
||||||
onkeyup: function(event, can) {
|
onkeyup: function(event, can) { if (event.key == lang.ENTER) { return can.onkeymap.prevent(event) }
|
||||||
if (event.key == lang.ENTER) { return can.onkeymap.prevent(event) }
|
if (can.Conf(mdb.NAME) == html.FILTER) { can.user.toast(can, "filter out "+can.page.Select(can, can._output, html.TR, function(tr, index) {
|
||||||
if (can.Conf(mdb.NAME) == html.FILTER) {
|
if (!can.page.ClassList.set(can, tr, html.HIDE, index > 0 && tr.innerText.indexOf(event.target.value) == -1)) { return tr }
|
||||||
can.user.toast(can, "filter out "+
|
}).length+" lines") }
|
||||||
can.page.Select(can, can._output, html.TR, function(tr) {
|
|
||||||
if (!can.page.ClassList.set(can, tr, html.HIDE, tr.innerText.indexOf(event.target.value) == -1)) {
|
|
||||||
return tr
|
|
||||||
}
|
|
||||||
}).length+" lines")
|
|
||||||
}
|
|
||||||
},
|
|
||||||
onfocus: function(event, can) {
|
|
||||||
can.Conf(mdb.TYPE) == html.TEXT && can.onmotion.selectRange(event.target)
|
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
fieldset.inner>form.option input[name=path] { width:80px; }
|
fieldset.inner>form.option input[name=path] { width:80px; }
|
||||||
fieldset.inner>form.option input[name=file] { width:160px; }
|
fieldset.inner>form.option input[name=file] { width:160px; }
|
||||||
fieldset.inner>div.output>div.project * { font-size:14px; font-family:monospace; outline:none; }
|
|
||||||
fieldset.inner>div.output>div.layout>div.layout>div.content * { font-size:14px; font-family:monospace; outline:none; }
|
fieldset.inner>div.output>div.layout>div.layout>div.content * { font-size:14px; font-family:monospace; outline:none; }
|
||||||
fieldset.inner>div.output legend { font-size:1rem; line-height:2rem; }
|
|
||||||
fieldset.inner>div.output div.content { position:relative; }
|
fieldset.inner>div.output div.content { position:relative; }
|
||||||
fieldset.inner>div.output div.content td.text span.comment { color:green; }
|
fieldset.inner>div.output div.content td.text span.comment { color:green; }
|
||||||
fieldset.inner>div.output div.content td.text span.keyword { color:yellow; }
|
fieldset.inner>div.output div.content td.text span.keyword { color:yellow; }
|
||||||
@ -12,40 +10,32 @@ fieldset.inner>div.output div.content td.text span.function { color:lightgreen;
|
|||||||
fieldset.inner>div.output div.content td.text span.constant { color:magenta; }
|
fieldset.inner>div.output div.content td.text span.constant { color:magenta; }
|
||||||
fieldset.inner>div.output div.content td.text span.string { color:magenta; }
|
fieldset.inner>div.output div.content td.text span.string { color:magenta; }
|
||||||
fieldset.inner>div.output div.content td.text span.object { color:cyan; }
|
fieldset.inner>div.output div.content td.text span.object { color:cyan; }
|
||||||
fieldset.inner>div.output div.content fieldset>form.option>div.icon { display:none; }
|
|
||||||
fieldset.inner>div.output>div.project { width:230px; }
|
fieldset.inner>div.output>div.project { width:230px; }
|
||||||
fieldset.inner>div.output>div.project>div.zone fieldset.plug { position:static; }
|
fieldset.inner>div.output>div.project * { font-size:14px; font-family:monospace; outline:none; }
|
||||||
fieldset.inner>div.output>div.project>div.zone fieldset.plug legend { display:none; }
|
|
||||||
fieldset.inner>div.output>div.project>div.zone fieldset.plug form.option { display:none; }
|
|
||||||
fieldset.inner>div.output>div.project>div.zone fieldset.plug div.action { display:none; }
|
|
||||||
fieldset.inner>div.output>div.project>div.zone fieldset.plug div.status { display:none; }
|
|
||||||
fieldset.inner>div.output>div.project>div.zone fieldset.plug { position:static; }
|
|
||||||
fieldset.inner>div.output>div.project>div.zone>div.item { letter-spacing:10px; }
|
fieldset.inner>div.output>div.project>div.zone>div.item { letter-spacing:10px; }
|
||||||
fieldset.inner>div.output>div.project>div.zone>div.item span.icon { font-size:22px; line-height:18px; width:20px; float:right; display:none; }
|
fieldset.inner>div.output>div.project>div.zone>div.item span.icon { font-size:22px; line-height:18px; width:20px; float:right; display:none; }
|
||||||
fieldset.inner>div.output>div.project>div.zone:hover>div.item span.icon { display:block; }
|
fieldset.inner>div.output>div.project>div.zone:hover>div.item span.icon { display:block; }
|
||||||
fieldset.inner>div.output>div.project>div.zone div.action>div.item { padding-right:0; width:100%; }
|
fieldset.inner>div.output>div.project>div.zone div.action>div.item { padding-right:0; width:100%; }
|
||||||
fieldset.inner>div.output>div.project>div.zone div.action>div.item>input { width:100%; }
|
fieldset.inner>div.output>div.project>div.zone div.action>div.item>input { width:100%; }
|
||||||
|
fieldset.inner>div.output>div.project>div.zone fieldset.plug { position:static; }
|
||||||
fieldset.inner>div.output>div.layout.flow { position:relative; }
|
fieldset.inner>div.output>div.layout.flow { position:relative; }
|
||||||
fieldset.inner>div.output>div.layout.flow>div.tabs { display:none; }
|
fieldset.inner>div.output>div.layout.flow>div.tabs { display:none; }
|
||||||
fieldset.inner>div.output>div.layout.flow>div.path { display:none; }
|
fieldset.inner>div.output>div.layout.flow>div.path { display:none; }
|
||||||
fieldset.inner.cmd>div.output>div.layout.flow>div.tabs { height:38px; display:block; overflow:auto; }
|
fieldset.inner.cmd>div.output>div.layout.flow>div.tabs { height:38px; display:block; overflow:hidden; }
|
||||||
fieldset.inner.cmd>div.output>div.layout.flow>div.tabs.hide { display:none; }
|
fieldset.inner.cmd>div.output>div.layout.flow>div.tabs.hide { display:none; }
|
||||||
fieldset.inner.cmd>div.output>div.layout.flow>div.tabs>div { padding:10px; height:38px; float:left; }
|
fieldset.inner.cmd>div.output>div.layout.flow>div.tabs>div { padding:10px; height:38px; float:left; }
|
||||||
fieldset.inner.cmd>div.output>div.layout.flow>div.tabs>div>span { font-style:italic; }
|
fieldset.inner.cmd>div.output>div.layout.flow>div.tabs>div>span { font-style:italic; }
|
||||||
fieldset.inner.cmd>div.output>div.layout.flow>div.tabs>div>span.icon { padding:0 5px; }
|
fieldset.inner.cmd>div.output>div.layout.flow>div.tabs>div>span.icon { padding:0 5px; }
|
||||||
fieldset.inner.cmd>div.output>div.layout.flow>div.tabs div.avatar { padding:0; height:38px; float:right; }
|
fieldset.inner.cmd>div.output>div.layout.flow>div.tabs div.avatar { padding:0; height:38px; float:right; }
|
||||||
fieldset.inner.cmd>div.output>div.layout.flow>div.tabs div.project.icon { font-size:32px; line-height:32px; padding:0 5px; }
|
fieldset.inner.cmd>div.output>div.layout.flow>div.tabs div.create.icon { font-size:18px; line-height:32px; padding:2px 5px; margin-top:2px; }
|
||||||
fieldset.inner.cmd>div.output>div.layout.flow>div.tabs div.create.icon { font-size:18px; line-height:32px; padding:2px 10px; }
|
|
||||||
fieldset.inner.cmd>div.output>div.layout.flow>div.tabs div.avatar>img { height:38px; }
|
fieldset.inner.cmd>div.output>div.layout.flow>div.tabs div.avatar>img { height:38px; }
|
||||||
fieldset.inner.cmd>div.output>div.layout.flow>div.tabs div.time { float:right; }
|
fieldset.inner.cmd>div.output>div.layout.flow>div.tabs div.time { float:right; }
|
||||||
fieldset.inner.cmd>div.output>div.layout.flow>div.path { font-style:italic; padding:5px; display:block; }
|
fieldset.inner.cmd>div.output>div.layout.flow>div.path { font-style:italic; padding:5px; display:block; }
|
||||||
fieldset.inner.cmd>div.output>div.layout.flow>div.path span.func { margin-left:20px; }
|
|
||||||
fieldset.inner.cmd>div.output>div.layout.flow>div.path.hide { display:none; }
|
fieldset.inner.cmd>div.output>div.layout.flow>div.path.hide { display:none; }
|
||||||
|
fieldset.inner.cmd>div.output>div.layout.flow>div.path span.func { margin-left:20px; }
|
||||||
fieldset.inner.cmd>div.output>div.layout.flow>div.path span.view { font-size:22px; line-height:12px; padding:0 4px; float:right; cursor:pointer; }
|
fieldset.inner.cmd>div.output>div.layout.flow>div.path span.view { font-size:22px; line-height:12px; padding:0 4px; float:right; cursor:pointer; }
|
||||||
fieldset.inner.cmd>div.output>div.layout.flow>div.plug { height:31px; clear:both; }
|
fieldset.inner.cmd>div.output>div.layout.flow>div.plug { height:31px; clear:both; }
|
||||||
fieldset.inner.cmd>div.output>div.layout.flow>div.plug>legend { float:right; }
|
fieldset.inner.cmd>div.output>div.layout.flow>div.plug>legend { float:right; }
|
||||||
fieldset.inner.cmd>div.output fieldset.plug:not(.full) { bottom:31px; position:absolute; }
|
|
||||||
fieldset.inner fieldset.story form.option div.icon { display:block; }
|
|
||||||
|
|
||||||
body.black fieldset.inner>div.output div.content td.text span.comment { background-color:blue; color:cyan; }
|
body.black fieldset.inner>div.output div.content td.text span.comment { background-color:blue; color:cyan; }
|
||||||
body.white fieldset.inner.cmd>div.output { background-color:aliceblue; }
|
body.white fieldset.inner.cmd>div.output { background-color:aliceblue; }
|
||||||
@ -82,12 +72,10 @@ 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.inner>form.option input[name=file] { width:90px; }
|
||||||
body.mobile fieldset.word fieldset.inner>form.option input[type=text] { display:none; }
|
body.mobile fieldset.word fieldset.inner>form.option input[type=text] { display:none; }
|
||||||
|
|
||||||
div.carte.path.float { font-size:14px; border-radius:0; } div.carte.path.float div.item { padding:5px; }
|
|
||||||
div.path span.item { padding:5px; cursor:pointer; }
|
div.path span.item { padding:5px; cursor:pointer; }
|
||||||
|
div.carte.path.float { font-size:14px; border-radius:0; } div.carte.path.float div.item { padding:5px; }
|
||||||
tr.line>td.line { text-align:right; padding:0 10px; position:sticky; left:0; }
|
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; cursor:text; }
|
||||||
body.white tr.line.select { background-color:dimgray; } body.white tr.line:hover { background-color:dimgray; }
|
body.white tr.line.select { background-color:dimgray; } body.white tr.line:hover { background-color:dimgray; }
|
||||||
body.black tr.line.select { background-color:darkblue; } body.black tr.line:hover { background-color:darkblue; }
|
body.black tr.line.select { background-color:darkblue; } body.black tr.line:hover { background-color:darkblue; }
|
||||||
td.unselectable { -webkit-touch-callout:none; -webkit-user-select:none; -khtml-user-select:none; -moz-user-select:none; -ms-user-select:none; -o-user-select:none; user-select:none; }
|
tr.line>td.line { -webkit-touch-callout:none; -webkit-user-select:none; -khtml-user-select:none; -moz-user-select:none; -ms-user-select:none; -o-user-select:none; user-select:none; }
|
||||||
|
|
||||||
|
|
@ -8,15 +8,14 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb, target) { can.onmotion.cl
|
|||||||
can.core.List(paths.concat(can.core.Split(msg.Option(nfs.REPOS))), function(p) { if (p && paths.indexOf(p) == -1 && p[0] != ice.PS) { paths.push(p) } })
|
can.core.List(paths.concat(can.core.Split(msg.Option(nfs.REPOS))), function(p) { if (p && paths.indexOf(p) == -1 && p[0] != ice.PS) { paths.push(p) } })
|
||||||
can.db = {paths: paths, tabview: {}, history: [], profile_size: {}, display_size: {}, toolkit: {}, extentions: {}}, can.onengine.plugin(can, can.onplugin)
|
can.db = {paths: paths, tabview: {}, history: [], profile_size: {}, display_size: {}, toolkit: {}, extentions: {}}, can.onengine.plugin(can, can.onplugin)
|
||||||
can.ui = can.onappend.layout(can, can._output, "", [html.PROJECT, [html.TABS, nfs.PATH, [html.CONTENT, html.PROFILE], html.DISPLAY, html.PLUG]])
|
can.ui = can.onappend.layout(can, can._output, "", [html.PROJECT, [html.TABS, nfs.PATH, [html.CONTENT, html.PROFILE], html.DISPLAY, html.PLUG]])
|
||||||
can.ui._content = can.ui.content, can.ui._profile = can.ui.profile, can.ui._display = can.ui.display
|
can.ui._content = can.ui.content, can.ui._profile = can.ui.profile, can.ui._display = can.ui.display, can.onmotion.hidden(can, can.ui.plug)
|
||||||
var plug = can.base.Obj(msg.Option("plug"), []).concat(can.misc.Search(can, "debug") == ice.TRUE? ["can.debug", "log.debug"]: [])
|
|
||||||
plug.length > 0? can.run({}, [ctx.ACTION, ctx.COMMAND].concat(plug.reverse()), function(msg) {
|
|
||||||
msg.Table(function(value) { can.onimport.toolkit(can, value) })
|
|
||||||
}): can.onmotion.hidden(can, can.ui.plug), can.onengine.plugin(can, can.onplugin)
|
|
||||||
switch (can.Mode()) {
|
switch (can.Mode()) {
|
||||||
case chat.SIMPLE: can.onmotion.hidden(can, can.ui.project); break
|
case chat.SIMPLE: // no break
|
||||||
case chat.FLOAT: can.onmotion.hidden(can, can.ui.project); break
|
case chat.FLOAT: can.onmotion.hidden(can, can.ui.project); break
|
||||||
case chat.CMD: can.onmotion.hidden(can, can._status), can.onimport._keydown(can) // no break
|
case chat.CMD: can.onmotion.hidden(can, can._status), can.onimport._keydown(can)
|
||||||
|
var plug = can.base.Obj(msg.Option("plug"), []).concat(can.misc.Search(can, log.DEBUG) == ice.TRUE? ["can.debug", "log.debug"]: [])
|
||||||
|
plug.length > 0 && can.run({}, [ctx.ACTION, ctx.COMMAND].concat(plug.reverse()), function(msg) { msg.Table(function(value) { can.onimport.toolkit(can, value) }) })
|
||||||
|
// no break
|
||||||
case chat.FULL: // no break
|
case chat.FULL: // no break
|
||||||
default: can.onimport.project(can, paths), can.onimport._tabs(can)
|
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.onmotion.delay(can, function() { can.core.Next(files.slice(1), function(file, next) {
|
||||||
@ -26,67 +25,49 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb, target) { can.onmotion.cl
|
|||||||
var ls = can.core.Split(last, ice.DF); ls.length > 0 && can.onmotion.delayLong(can, function() { can.onimport._tabview(can, ls[0], ls[1], ls[2]) })
|
var ls = can.core.Split(last, ice.DF); ls.length > 0 && can.onmotion.delayLong(can, function() { can.onimport._tabview(can, ls[0], ls[1], ls[2]) })
|
||||||
can.core.List(can.base.Obj(msg.Option("tabs")), function(item) { can.onimport.tabview(can, can.Option(nfs.PATH), item, ctx.INDEX) })
|
can.core.List(can.base.Obj(msg.Option("tabs")), function(item) { can.onimport.tabview(can, can.Option(nfs.PATH), item, ctx.INDEX) })
|
||||||
}) })
|
}) })
|
||||||
}
|
} var args = can.misc.SearchHash(can); can.db.tabview[can.onexport.keys(can)] = msg
|
||||||
var hash = location.hash; can.db.tabview[can.onexport.keys(can)] = msg
|
can.onimport.tabview(can, can.Option(nfs.PATH), can.Option(nfs.FILE), can.Option(nfs.LINE), function() { if (args.length > 0) {
|
||||||
can.onimport.tabview(can, can.Option(nfs.PATH), can.Option(nfs.FILE), can.Option(nfs.LINE), function() {
|
can.onmotion.delayLong(can, function() { can.onimport._tabview(can, args[args.length-3]||can.Option(nfs.PATH), args[args.length-2]||can.Option(nfs.FILE), args[args.length-1]) })
|
||||||
if (can.isCmdMode() && hash) { var args = can.core.Split(decodeURIComponent(hash).slice(1), ice.DF)
|
} }), can.base.isFunc(cb) && cb(msg)
|
||||||
can.onmotion.delayLong(can, function() { can.onimport._tabview(can, args[args.length-3]||can.Option(nfs.PATH), args[args.length-2]||can.Option(nfs.FILE), args[args.length-1]) })
|
|
||||||
}
|
|
||||||
}), can.base.isFunc(cb) && cb(msg)
|
|
||||||
},
|
|
||||||
_tabview: function(can, path, file, line, cb) { var key = can.onexport.keys(can, path, file)
|
|
||||||
if (!can.user.isWebview) {
|
|
||||||
can.onimport.tabview(can, path, file, line, cb)
|
|
||||||
} else if (!can.db.tabview[key]) { can.onimport.tabview(can, path, file, line, cb), can.db.tabview[key] = true }
|
|
||||||
},
|
|
||||||
_keydown: function(can) {
|
|
||||||
can.onkeymap._build(can), can._root.onengine.listen(can, chat.ONKEYDOWN, function(event) {
|
|
||||||
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)
|
|
||||||
})
|
|
||||||
},
|
},
|
||||||
|
_keydown: function(can) { can.onkeymap._build(can), can._root.onengine.listen(can, chat.ONKEYDOWN, function(event) {
|
||||||
|
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)
|
||||||
|
}) },
|
||||||
_tabs: function(can) { if (!can.isCmdMode()) { return can.ui.tabs = can._action }
|
_tabs: function(can) { if (!can.isCmdMode()) { return can.ui.tabs = can._action }
|
||||||
can.page.Append(can, can.ui.tabs, [{view: [[html.ICON, mdb.CREATE], html.DIV, "\u2630"], onclick: function() {
|
can.page.Append(can, can.ui.tabs, [{view: [[html.ICON, mdb.CREATE], html.DIV, can.page.unicode.menu], onclick: function() { can.user.carte(event, can, can.onaction, can.onaction.list) }}])
|
||||||
can.user.carte(event, can, can.onaction, can.onaction.list)
|
can.page.Append(can, can.ui.tabs, [{view: [[html.ICON, mdb.CREATE], html.DIV, "\u25C0"], style: {"font-size": "14px", "margin-top": "3px"}, onclick: function() { history.back() }}])
|
||||||
}}])
|
can.page.Append(can, can.ui.tabs, [{view: [[html.ICON, mdb.CREATE], html.DIV, "\u21BB"], style: {"font-size": "24px", "margin-top": "0px"}, onclick: function() { location.reload() }}])
|
||||||
|
can.page.Append(can, can.ui.tabs, [{view: [[html.ICON, mdb.CREATE], html.DIV, "\u25B6"], style: {"font-size": "14px", "margin-top": "3px"}, onclick: function() { history.forward() }}])
|
||||||
can.user.isMobile || can.page.Append(can, can.ui.tabs, [{view: [mdb.TIME], _init: function(target) {
|
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.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) {})
|
can.onappend.figure(can, {action: "date", _hold: true}, target, function(sub, value) {})
|
||||||
|
}}]), can.user.info.avatar && can.page.Append(can, can.ui.tabs, [{view: [aaa.AVATAR], list: [{img: can.user.info.avatar}]}])
|
||||||
|
},
|
||||||
|
_tabInputs: function(can, ps, key, value, cb, target) { can.core.List(can.core.Split(value, ps), function(value, index, array) {
|
||||||
|
can.page.Append(can, target, [{text: [value+(index<array.length-1? ps: ""), html.SPAN, html.ITEM], onclick: function(event) {
|
||||||
|
can.onimport.tabInputs(event, can, ps, key, (array.slice(0, index).join(ps)||ice.PT)+ps, cb)
|
||||||
}}])
|
}}])
|
||||||
can.user.info.avatar && can.page.Append(can, can.ui.tabs, [{view: [aaa.AVATAR], list: [{img: can.user.info.avatar}]}])
|
}) },
|
||||||
},
|
tabInputs: function(event, can, ps, key, pre, cb, parent) { can.runAction(event, mdb.INPUTS, [key, pre], function(msg) { var _trans = {}
|
||||||
_tabInputs: function(can, ps, key, value, cb, target) {
|
var carte = can.user[parent? "carteRight": "carte"](event, can, {_style: nfs.PATH}, msg.Table(function(value) {
|
||||||
can.core.List(can.core.Split(value, ps), function(value, index, array) {
|
var p = can.core.Split(value[key], ps).pop()+(can.base.endWith(value[key], ps)? ps: ""); return _trans[p] = value[key], p
|
||||||
can.page.Append(can, target, [{text: [value+(index<array.length-1? ps: ""), html.SPAN, html.ITEM], onclick: function(event) {
|
}), function(event, button) {
|
||||||
can.onimport.tabInputs(event, can, ps, key, (array.slice(0, index).join(ps)||ice.PT)+ps, cb)
|
can.base.endWith(button, ps)? can.onimport.tabInputs(event, can, ps, key, pre+button, cb, carte): cb(can.core.Split(_trans[button], ps))
|
||||||
}}])
|
}, parent)._target, file = can.core.Split(event.target.innerHTML.trim(), ice.PT)[0]
|
||||||
})
|
can.page.Select(can, carte, html.DIV_ITEM, function(target) { target.innerHTML.trim() != event.target.innerHTML.trim() && can.base.beginWith(target.innerHTML, file+ice.PT) && carte.insertBefore(target, carte.firstChild) })
|
||||||
},
|
function remove(p) { if (p && p._sub) { remove(p._sub), can.page.Remove(can, p._sub), delete(p._sub) } } if (parent) { remove(parent), parent._sub = carte }
|
||||||
tabInputs: function(event, can, ps, key, pre, cb, parent) {
|
}) },
|
||||||
can.runAction(event, mdb.INPUTS, [key, pre], function(msg) { var _trans = {}
|
_tabFunc: function(can, target) { can.db.tabFunc = can.db.tabFunc||{}
|
||||||
var carte = can.user[parent? "carteRight": "carte"](event, can, {_style: nfs.PATH}, msg.Table(function(value) {
|
var last = can.db.tabFunc[can.Option(nfs.PATH)+can.Option(nfs.FILE)]||{}; can.db.tabFunc[can.Option(nfs.PATH)+can.Option(nfs.FILE)] = last
|
||||||
var p = can.core.Split(value[key], ps).pop()+(can.base.endWith(value[key], ps)? ps: ""); return _trans[p] = value[key], p
|
var carte, list = [{input: [html.FILTER, function(event) { if (event.key == lang.ESCAPE) { return can.page.Remove(can, carte._target) } can.onkeymap.selectItems(event, can, carte._target)
|
||||||
}), function(event, button) {
|
}], _init: function(target) { can.onmotion.delay(can, function() { target.placeholder = "search in "+list.length+" items", target.focus() }) }}]
|
||||||
can.base.endWith(button, ps)? can.onimport.tabInputs(event, can, ps, key, pre+button, cb, carte): cb(can.core.Split(_trans[button], ps))
|
can.core.Item(last, function(key) { list.push(key) }); var func = can.onexport.func(can); list = list.concat(func.list)
|
||||||
}, parent)._target, file = can.core.Split(event.target.innerHTML.trim(), ice.PT)[0]
|
|
||||||
can.page.Select(can, carte, html.DIV_ITEM, function(target) { target.innerHTML.trim() != event.target.innerHTML.trim() && can.base.beginWith(target.innerHTML, file+ice.PT) && carte.insertBefore(target, carte.firstChild) })
|
|
||||||
function remove(p) { if (p && p._sub) { remove(p._sub), can.page.Remove(can, p._sub), delete(p._sub) } } if (parent) { remove(parent), parent._sub = carte }
|
|
||||||
})
|
|
||||||
},
|
|
||||||
_tabFunc: function(can, target) {
|
|
||||||
can.db.tabFunc = can.db.tabFunc||{}; var last = can.db.tabFunc[can.Option(nfs.PATH)+can.Option(nfs.FILE)]||{}; can.db.tabFunc[can.Option(nfs.PATH)+can.Option(nfs.FILE)] = last
|
|
||||||
var carte, list = [{input: ["filter", function(event) {
|
|
||||||
if (event.key == lang.ESCAPE) { return can.page.Remove(can, carte._target) }
|
|
||||||
can.onkeymap.selectItems(event, can, carte._target)
|
|
||||||
}], _init: function(target) { can.onmotion.delay(can, function() { target.focus() }) }}]
|
|
||||||
can.core.Item(last, function(key) { list.push(key) }), list.push("")
|
|
||||||
var func = can.onexport.func(can);
|
|
||||||
!can.user.isMobile && (can.db.parse == nfs.JS || can.db.parse == nfs.GO) && can.page.Append(can, target, [{view: [[html.ITEM, "func"], html.SPAN, (func.current||"function")+" / "+can.db.max+func.percent], onclick: function(event) {
|
!can.user.isMobile && (can.db.parse == nfs.JS || can.db.parse == nfs.GO) && can.page.Append(can, target, [{view: [[html.ITEM, "func"], html.SPAN, (func.current||"function")+" / "+can.db.max+func.percent], onclick: function(event) {
|
||||||
carte = can.user.carte(event, can, {_style: nfs.PATH}, list.concat(func.list), function(ev, button) { last[button] = true
|
carte = can.user.carte(event, can, {_style: nfs.PATH}, list, function(ev, button) { last[button] = true
|
||||||
can.onimport.tabview(can, can.Option(nfs.PATH), can.Option(nfs.FILE), can.core.Split(button, ice.DF)[1]), can.onmotion.clearFloat(can)
|
can.onimport.tabview(can, can.Option(nfs.PATH), can.Option(nfs.FILE), can.core.Split(button, ice.DF)[1]), carte.close()
|
||||||
})
|
})
|
||||||
}}])
|
}}]), can.ui.path.ondblclick = function(event) { can.onmotion.toggle(can, can.ui.project), can.onmotion.toggle(can, can.ui.tabs), can.onmotion.toggle(can, can.ui.plug), can.onimport.layout(can) }
|
||||||
can.ui.path.ondblclick = function(event) { can.onmotion.toggle(can, can.ui.project), can.onmotion.toggle(can, can.ui.tabs), can.onmotion.toggle(can, can.ui.plug), can.onimport.layout(can) }
|
|
||||||
can.page.Append(can, can.ui.path, can.core.Item({
|
can.page.Append(can, can.ui.path, can.core.Item({
|
||||||
"\u25E8 ": function(event) {
|
"\u25E8 ": function(event) {
|
||||||
if (can.page.isDisplay(can.ui.profile)) { return can.onmotion.hidden(can, can.ui.profile), can.onimport.layout(can) }
|
if (can.page.isDisplay(can.ui.profile)) { return can.onmotion.hidden(can, can.ui.profile), can.onimport.layout(can) }
|
||||||
@ -101,6 +82,9 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb, target) { can.onmotion.cl
|
|||||||
"\u271A": !can.user.isMobile && shy({"font-size": "20px", translate: "0 2px"}, function(event) { can.onaction.open(event, can) }),
|
"\u271A": !can.user.isMobile && shy({"font-size": "20px", translate: "0 2px"}, function(event) { can.onaction.open(event, can) }),
|
||||||
}, function(text, cb) { return cb && {text: [text, html.SPAN, html.VIEW], style: cb.meta, onclick: cb} }))
|
}, function(text, cb) { return cb && {text: [text, html.SPAN, html.VIEW], style: cb.meta, onclick: cb} }))
|
||||||
},
|
},
|
||||||
|
_tabview: function(can, path, file, line, cb) { var key = can.onexport.keys(can, path, file)
|
||||||
|
if (!can.db.tabview[key]) { return can.onimport.tabview(can, path, file, line, cb), can.db.tabview[key] = true }
|
||||||
|
},
|
||||||
tabview: function(can, path, file, line, cb) { var key = can.onexport.keys(can, path, file)
|
tabview: function(can, path, file, line, cb) { var key = can.onexport.keys(can, path, file)
|
||||||
function isCommand() { return line == ctx.INDEX || path == ctx.COMMAND }
|
function isCommand() { return line == ctx.INDEX || path == ctx.COMMAND }
|
||||||
function isDream() { return line == web.DREAM }
|
function isDream() { return line == web.DREAM }
|
||||||
@ -130,7 +114,6 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb, target) { can.onmotion.cl
|
|||||||
}), can.ui.current && can.onmotion.toggle(can, can.ui.current, !isCommand() && !isDream())
|
}), can.ui.current && can.onmotion.toggle(can, can.ui.current, !isCommand() && !isDream())
|
||||||
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)] }
|
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.onimport.layout(can)
|
can.Status(kit.Dict("文件", ls.join(ice.PS), "类型", can.db.parse)), can.onimport.layout(can)
|
||||||
// can.onaction.selectLine(can, can.Option(nfs.LINE), true)
|
|
||||||
if (!skip) { can.onaction.selectLine(can, can.Option(nfs.LINE), true) }
|
if (!skip) { can.onaction.selectLine(can, can.Option(nfs.LINE), true) }
|
||||||
can.base.isFunc(cb) && cb(), cb = null
|
can.base.isFunc(cb) && cb(), cb = null
|
||||||
})
|
})
|
||||||
@ -149,8 +132,7 @@ 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() }
|
if (can.db.tabview[key]) { return !can._msg._tab && !can.isSimpleMode()? load(can.db.tabview[key]): show() }
|
||||||
isCommand()||isDream()? load(can.request({}, {index: file, line: line})): can.run({}, [path, file], load, true)
|
isCommand()||isDream()? load(can.request({}, {index: file, line: line})): can.run({}, [path, file], load, true)
|
||||||
},
|
},
|
||||||
history: function(can, record) {
|
history: function(can, record) { can.base.Eq(record, can.db.history[can.db.history.length-1]) || can.db.history.push(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
|
return can.Status("跳转", can.db.history.length), record
|
||||||
},
|
},
|
||||||
project: function(can, path) {
|
project: function(can, path) {
|
||||||
@ -190,7 +172,7 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb, target) { can.onmotion.cl
|
|||||||
can.onimport.plug(can, item, function(sub) {
|
can.onimport.plug(can, item, function(sub) {
|
||||||
can.page.ClassList.del(can, sub._target, html.HIDE)
|
can.page.ClassList.del(can, sub._target, html.HIDE)
|
||||||
height && sub.ConfHeight(height-2*html.ACTION_HEIGHT), width && sub.ConfWidth(width)
|
height && sub.ConfHeight(height-2*html.ACTION_HEIGHT), width && sub.ConfWidth(width)
|
||||||
sub.onaction._output = function(_sub, _msg) { can.base.isFunc(cb) && cb(_sub, _msg) }
|
sub.onexport.output = function(_sub, _msg) { can.base.isFunc(cb) && cb(_sub, _msg) }
|
||||||
sub.onaction.close = function() { can.onmotion.hidden(can, target), can.onimport.layout(can) }
|
sub.onaction.close = function() { can.onmotion.hidden(can, target), can.onimport.layout(can) }
|
||||||
}, target)
|
}, target)
|
||||||
})
|
})
|
||||||
@ -238,20 +220,15 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb, target) { can.onmotion.cl
|
|||||||
sub.onimport.size(sub, can.ui.content.offsetHeight-2*html.ACTION_HEIGHT, can.ui.content.offsetWidth, true)
|
sub.onimport.size(sub, can.ui.content.offsetHeight-2*html.ACTION_HEIGHT, can.ui.content.offsetWidth, true)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
exts: function(can, url, cb) {
|
exts: function(can, url, cb) { can.onimport.toolkit(can, {index: ice.CAN_PLUGIN, display: (url[0] == ice.PS || url.indexOf(ice.HTTP) == 0? "": can.base.Dir(can._path))+url}, function(sub) {
|
||||||
can.onimport.toolkit(can, {index: "can._plugin", display: (url[0] == ice.PS || url.indexOf(ice.HTTP) == 0? "": can.base.Dir(can._path))+url}, function(sub) {
|
sub.run = function(event, cmds, cb) {
|
||||||
sub.run = function(event, cmds, cb) {
|
if (cmds.length > 0 && cmds[0] == ctx.ACTION) {
|
||||||
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)
|
||||||
can.run(can.request(event, can.Option()), cmds, cb||function(msg) {
|
} else {
|
||||||
can.onappend._output(sub, msg, sub.Conf(ctx.DISPLAY))
|
can.onappend._output(sub, can.request(event), sub.Conf(ctx.DISPLAY))
|
||||||
}, true)
|
|
||||||
} else {
|
|
||||||
can.onappend._output(sub, can.request(event), sub.Conf(ctx.DISPLAY))
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
can.db.extentions[url.split("?")[0]] = sub, can.base.isFunc(cb)? cb(sub): sub.select()
|
}, can.db.extentions[url.split("?")[0]] = sub, can.base.isFunc(cb)? cb(sub): sub.select()
|
||||||
})
|
}) },
|
||||||
},
|
|
||||||
}, [""])
|
}, [""])
|
||||||
Volcanos(chat.ONFIGURE, {
|
Volcanos(chat.ONFIGURE, {
|
||||||
source: function(can, target, zone, path) { var total = 0
|
source: function(can, target, zone, path) { var total = 0
|
||||||
@ -524,7 +501,8 @@ Volcanos(chat.ONEXPORT, {list: ["目录", "类型", "文件", "行号", "跳转"
|
|||||||
function push(item) { list.push(item); if (index < can.Option(nfs.LINE)) { current = list[list.length-1], percent = " = "+parseInt((index+1)*100/(can.db.max||1))+"%" } }
|
function push(item) { list.push(item); if (index < can.Option(nfs.LINE)) { current = list[list.length-1], percent = " = "+parseInt((index+1)*100/(can.db.max||1))+"%" } }
|
||||||
if (can.db.parse == nfs.JS) {
|
if (can.db.parse == nfs.JS) {
|
||||||
if (_indent == 0 && can.base.beginWith(text, "Volcanos")) {
|
if (_indent == 0 && can.base.beginWith(text, "Volcanos")) {
|
||||||
var ls = can.core.Split(text, "\t ({:}),"); block = can.base.trimPrefix(ls[1], "chat.").toLowerCase()
|
var ls = can.core.Split(text, "\t ({:}),"), _block = can.base.trimPrefix(ls[1], "chat.").toLowerCase()
|
||||||
|
if (_block != block) { push("") } block = _block
|
||||||
if (text.indexOf("_init") > -1) { push(block+ice.PT+"_init"+ice.DF+(index+1)) }
|
if (text.indexOf("_init") > -1) { push(block+ice.PT+"_init"+ice.DF+(index+1)) }
|
||||||
} else if (_indent == 4) {
|
} else if (_indent == 4) {
|
||||||
var ls = can.core.Split(text, "\t ({:}),"); ls[0] && push(block+ice.PT+ls[0]+ice.DF+(index+1))
|
var ls = can.core.Split(text, "\t ({:}),"); ls[0] && push(block+ice.PT+ls[0]+ice.DF+(index+1))
|
||||||
|
@ -139,7 +139,7 @@ Volcanos(chat.ONACTION, {list: ["首页", "官网", "调试", "百度"],
|
|||||||
}) },
|
}) },
|
||||||
"首页": function(event, can) { can.user.open(location.protocol+"//"+location.host) },
|
"首页": function(event, can) { can.user.open(location.protocol+"//"+location.host) },
|
||||||
"官网": function(event, can) { can.user.open("https://shylinux.com/") },
|
"官网": function(event, can) { can.user.open("https://shylinux.com/") },
|
||||||
"调试": function(event, can) { can.user.opens(location.href.replace("debug=true", "")) },
|
"调试": 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://developer.mozilla.org/") },
|
||||||
"百度": function(event, can) { can.user.opens("https://baidu.com/") },
|
"百度": function(event, can) { can.user.opens("https://baidu.com/") },
|
||||||
"命令": function(event, can) {
|
"命令": function(event, can) {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb) { can.onmotion.clear(can), can.onlayout._init(can)
|
Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb) { can.onmotion.clear(can), can.onlayout._init(can)
|
||||||
can.requireModules(["xterm/css/xterm.css", "xterm", "xterm-addon-fit", "xterm-addon-web-links"], function() {
|
can.page.requireModules(can, ["xterm/css/xterm.css", "xterm", "xterm-addon-fit", "xterm-addon-web-links"], function() {
|
||||||
var item = {hash: can.Option(mdb.HASH)}; msg.Table(function(value) { can.core.Value(item, value.key, value.value) })
|
var item = {hash: can.Option(mdb.HASH)}; msg.Table(function(value) { can.core.Value(item, value.key, value.value) })
|
||||||
item.text && can.onmotion.delay(can, function() { can.onimport._input(can, item.text+ice.NL) })
|
item.text && can.onmotion.delay(can, function() { can.onimport._input(can, item.text+ice.NL) })
|
||||||
can.onimport._connect(can, item), can.onappend.tools(can, msg, function(sub) {
|
can.onimport._connect(can, item), can.onappend.tools(can, msg, function(sub) {
|
||||||
|
@ -55,7 +55,7 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, target) { can.onmotion.clear(
|
|||||||
sub.run = function(event, cmds, cb) { can.request(event, kit.Dict(team.TASK_POD, task.pod, team.TASK_ZONE, task.zone, team.TASK_ID, task.id))
|
sub.run = function(event, cmds, cb) { can.request(event, kit.Dict(team.TASK_POD, task.pod, team.TASK_ZONE, task.zone, team.TASK_ID, task.id))
|
||||||
can.page.style(can, sub._output, html.MAX_HEIGHT, ""), can.runAction(event, ice.RUN, [task[mdb.ZONE], task[mdb.ID]].concat(cmds), cb)
|
can.page.style(can, sub._output, html.MAX_HEIGHT, ""), can.runAction(event, ice.RUN, [task[mdb.ZONE], task[mdb.ID]].concat(cmds), cb)
|
||||||
}, can._plugins_display = (can._plugins_display||[]).concat([sub])
|
}, can._plugins_display = (can._plugins_display||[]).concat([sub])
|
||||||
sub.onaction._output = function() { can.onmotion.delay(can, function() {
|
sub.onexport.output = function() { can.onmotion.delay(can, function() {
|
||||||
can._display_heights[[task.zone, task.id].join(ice.FS)] = can.base.Max(sub._target.offsetHeight, can.ConfHeight()/2), can.onimport.layout(can)
|
can._display_heights[[task.zone, task.id].join(ice.FS)] = can.base.Max(sub._target.offsetHeight, can.ConfHeight()/2), can.onimport.layout(can)
|
||||||
}) }, sub.onaction.close = function() { can.onmotion.toggle(can, can.ui.display), can.onimport.layout(can) }, can.onimport.layout(can)
|
}) }, sub.onaction.close = function() { can.onmotion.toggle(can, can.ui.display), can.onimport.layout(can) }, can.onimport.layout(can)
|
||||||
}, can.ui.display)
|
}, can.ui.display)
|
||||||
|
@ -49,7 +49,7 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, target) { can.onmotion.clear(
|
|||||||
},
|
},
|
||||||
_display: function(can, target) { can.onmotion.clear(can, can.ui.display)
|
_display: function(can, target) { can.onmotion.clear(can, can.ui.display)
|
||||||
target.Value(ctx.INDEX)? can.onappend.plugin(can, {index: target.Value(ctx.INDEX), args: target.Value(ctx.ARGS), height: can.ConfHeight()/2-2*html.ACTION_HEIGHT}, function(sub) {
|
target.Value(ctx.INDEX)? can.onappend.plugin(can, {index: target.Value(ctx.INDEX), args: target.Value(ctx.ARGS), height: can.ConfHeight()/2-2*html.ACTION_HEIGHT}, function(sub) {
|
||||||
can.onimport.layout(can), sub.onaction._output = function() { can._display_heights[target.Value(svg.PID)] = can.base.Max(sub._target.offsetHeight, can.ConfHeight()/2), can.onimport.layout(can) }
|
can.onimport.layout(can), sub.onexport.output = function() { can._display_heights[target.Value(svg.PID)] = can.base.Max(sub._target.offsetHeight, can.ConfHeight()/2), can.onimport.layout(can) }
|
||||||
can._plugins = (can._plugins||[]).concat(sub)
|
can._plugins = (can._plugins||[]).concat(sub)
|
||||||
}, can.ui.display): can.onimport.layout(can)
|
}, can.ui.display): can.onimport.layout(can)
|
||||||
},
|
},
|
||||||
@ -77,7 +77,7 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, target) { can.onmotion.clear(
|
|||||||
Volcanos(chat.ONACTION, {list: [[svg.GRID, 1, 2, 3, 4, 5, 10, 20],
|
Volcanos(chat.ONACTION, {list: [[svg.GRID, 1, 2, 3, 4, 5, 10, 20],
|
||||||
[svg.FONT_SIZE, 12, 16, 18, 24, 32], [svg.STROKE_WIDTH, 1, 2, 3, 4, 5],
|
[svg.FONT_SIZE, 12, 16, 18, 24, 32], [svg.STROKE_WIDTH, 1, 2, 3, 4, 5],
|
||||||
[svg.STROKE, cli.RED, cli.YELLOW, cli.GREEN, cli.CYAN, cli.BLUE, cli.PURPLE, cli.BLACK, cli.WHITE],
|
[svg.STROKE, cli.RED, cli.YELLOW, cli.GREEN, cli.CYAN, cli.BLUE, cli.PURPLE, cli.BLACK, cli.WHITE],
|
||||||
[svg.FILL, cli.RED, cli.YELLOW, cli.GREEN, cli.CYAN, cli.BLUE, cli.PURPLE, cli.BLACK, cli.WHITE, cli.GLASS],
|
[svg.FILL, cli.RED, cli.YELLOW, cli.GREEN, cli.CYAN, cli.BLUE, cli.PURPLE, cli.BLACK, cli.WHITE, cli.TRANSPARENT],
|
||||||
[svg.GO, ice.RUN, ice.AUTO, "manual"], [ice.MODE, web.DRAW, web.RESIZE],
|
[svg.GO, ice.RUN, ice.AUTO, "manual"], [ice.MODE, web.DRAW, web.RESIZE],
|
||||||
[svg.SHAPE, svg.TEXT, svg.RECT, svg.LINE, svg.BLOCK, svg.CIRCLE, svg.ELLIPSE],
|
[svg.SHAPE, svg.TEXT, svg.RECT, svg.LINE, svg.BLOCK, svg.CIRCLE, svg.ELLIPSE],
|
||||||
], _change: function(can, key, value) { can.Action(key, value), can.group.Value(key, value) },
|
], _change: function(can, key, value) { can.Action(key, value), can.group.Value(key, value) },
|
||||||
|
@ -121,7 +121,7 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, target) { can.onmotion.clear(
|
|||||||
can.isCmdMode() && can.ConfHeight(can.page.height()) && can.page.styleHeight(can, can._output, "")
|
can.isCmdMode() && can.ConfHeight(can.page.height()) && can.page.styleHeight(can, can._output, "")
|
||||||
can.core.List(can._plugins, function(sub) {
|
can.core.List(can._plugins, function(sub) {
|
||||||
sub.ConfHeight(can.base.Min(300, can.ConfHeight()-300)), sub.ConfWidth(can.ConfWidth()-(can.user.isWindows? 40: 20))
|
sub.ConfHeight(can.base.Min(300, can.ConfHeight()-300)), sub.ConfWidth(can.ConfWidth()-(can.user.isWindows? 40: 20))
|
||||||
sub.onaction._resize(sub, true, sub.ConfHeight(), sub.ConfWidth())
|
sub.onimport.size(sub, sub.ConfHeight(), sub.ConfWidth(), true)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
}, [""])
|
}, [""])
|
||||||
|
211
plugin/state.js
211
plugin/state.js
@ -1,168 +1,127 @@
|
|||||||
Volcanos(chat.ONIMPORT, {_process: function(can, msg) {
|
Volcanos(chat.ONIMPORT, {_process: function(can, msg) { msg.OptionStatus() && can.onmotion.clear(can, can._status) && can.onappend._status(can, msg.OptionStatus())
|
||||||
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 }
|
||||||
return can.core.CallFunc([can.onimport, msg.OptionProcess()], {can: can, msg: msg})
|
|
||||||
},
|
|
||||||
_location: function(can, msg, _arg) { can.user.jumps(_arg); return true },
|
|
||||||
_replace: function(can, msg, _arg) { location.replace(_arg); return true },
|
|
||||||
_history: function(can, msg) { history.back(); return true },
|
|
||||||
_confirm: function(can, msg, _arg) { can.user.confirm(_arg) && can.runAction(can.request({}, msg), "confirm"); return true },
|
|
||||||
_refresh: function(can, msg, _arg) {
|
|
||||||
can.core.Timer(parseInt(_arg||"30"), function() {
|
|
||||||
can.Update(can.request({}, {_count: parseInt(msg.Option("_count")||"3")-1}))
|
|
||||||
}); return true
|
|
||||||
},
|
|
||||||
_rewrite: function(can, msg) {
|
|
||||||
for (var i = 0; i < msg._arg.length; i += 2) {
|
|
||||||
can.Option(msg._arg[i], msg._arg[i+1]), can.Action(msg._arg[i], msg._arg[i+1])
|
|
||||||
}; return can.Update()
|
|
||||||
},
|
|
||||||
_display: function(can, msg) { return can.onappend._output(can, msg, msg.Option(ice.MSG_DISPLAY)), true },
|
|
||||||
_clear: function(can, msg) {
|
|
||||||
can.onmotion.clear(can)
|
|
||||||
return true
|
|
||||||
},
|
|
||||||
_inner: function(can, msg) {
|
|
||||||
can.onappend.table(can, msg), can.onappend.board(can, msg), can.onmotion.story.auto(can)
|
|
||||||
can.page.style(can, can._output, html.DISPLAY, html.BLOCK); return true
|
|
||||||
},
|
},
|
||||||
|
_location: function(can, msg, arg) { can.user.jumps(arg) },
|
||||||
|
_replace: function(can, msg, arg) { location.replace(arg) },
|
||||||
|
_history: function(can, msg) { history.back() },
|
||||||
|
_confirm: function(can, msg, arg) { can.user.confirm(arg) && can.runAction(can.request({}, msg), "confirm") },
|
||||||
|
_refresh: function(can, msg, arg) { can.core.Timer(parseInt(arg||"30"), function() { can.Update(can.request({}, {_count: parseInt(msg.Option("_count")||"3")-1})) }) },
|
||||||
|
_rewrite: function(can, msg) { var arg = msg._arg; for (var i = 0; i < arg.length; i += 2) { can.Option(arg[i], arg[i+1]), can.Action(arg[i], arg[i+1]) } can.Update() },
|
||||||
|
_display: function(can, msg) { can.onappend._output(can, msg, msg.Option(ice.MSG_DISPLAY)) },
|
||||||
|
_clear: function(can, msg) { can.onmotion.clear(can) },
|
||||||
|
_inner: function(can, msg) { can.onappend.table(can, msg), can.onappend.board(can, msg), can.onmotion.story.auto(can) },
|
||||||
_field: function(can, msg) { var opts = {}
|
_field: function(can, msg) { var opts = {}
|
||||||
can.page.SelectArgs(can, can._option, "", function(target) { var value = msg.Option(target.name); target.name && value && (opts[target.name] = value) })
|
can.page.SelectArgs(can, can._option, "", function(target) { var value = msg.Option(target.name); target.name && value && (opts[target.name] = value) })
|
||||||
var height = can.ConfHeight()-2*html.ACTION_HEIGHT; can.page.Select(can, can._output, html.TABLE, function(target) { height -= target.offsetHeight+4 })
|
var height = can.ConfHeight()-2*html.ACTION_HEIGHT; can.page.Select(can, can._output, html.TABLE, function(target) { height -= target.offsetHeight+4 })
|
||||||
msg.Table(function(item) { can.onappend._plugin(can, item, {index: item.index, args: can.base.Obj(item[ice.ARG], []), height: can.base.Min(height, 200)}, function(sub, meta) {
|
msg.Table(function(item) { can.onappend._plugin(can, item, {index: item.index, args: can.base.Obj(item[ice.ARG], []), height: can.base.Min(height, 200)}, function(sub, meta) {
|
||||||
sub.Conf(can.base.Obj(item.conf)); if (sub.isSimpleMode()) { (function() { sub.ConfHeight(can.ConfHeight()/2)
|
sub.Conf(can.base.Obj(item.conf)); if (sub.isSimpleMode()) { (function() { sub.ConfHeight(can.ConfHeight()/2)
|
||||||
var msg = can.request(); msg.Echo(sub.Conf(ice.MSG_RESULT)), can.onappend._output(sub, msg, sub.Conf("feature.display"))
|
var msg = can.request(); msg.Echo(sub.Conf(ice.MSG_RESULT)), can.onappend._output(sub, msg, sub.Conf(ctx.DISPLAY))
|
||||||
})(); return }
|
})(); return }
|
||||||
|
|
||||||
var opt = can.base.Obj(item[ice.OPT], []); sub.ConfWidth(can.ConfWidth())
|
var opt = can.base.Obj(item[ice.OPT], []); sub.ConfWidth(can.ConfWidth())
|
||||||
sub.run = function(event, cmds, cb) {
|
sub.run = function(event, cmds, cb) {
|
||||||
var res = can.request(event, can.Option(), opts, {pid: msg.Option("pid")})
|
var res = can.request(event, can.Option(), opts, {pid: msg.Option("pid")}); for (var i = 0; i < opt.length; i += 2) { res.Option(opt[i], opt[i+1]) }
|
||||||
for (var i = 0; i < opt.length; i += 2) { res.Option(opt[i], opt[i+1]) }
|
|
||||||
// can.run(event, (msg.Option("_index")==can._index? []: [ice.RUN, msg.Option("_index")]).concat(msg[ice.MSG_PREFIX]||[]).concat(cmds), cb, true)
|
|
||||||
can.run(event, (msg.Option("_index")==can._index? msg[ice.MSG_PREFIX]||[]: [ice.RUN, msg.Option("_index")]).concat(cmds), cb, true)
|
can.run(event, (msg.Option("_index")==can._index? msg[ice.MSG_PREFIX]||[]: [ice.RUN, msg.Option("_index")]).concat(cmds), cb, true)
|
||||||
}
|
}
|
||||||
}) }); return true
|
}) })
|
||||||
},
|
},
|
||||||
_float: function(can, msg) { var _arg = msg._arg
|
_float: function(can, msg) { var arg = msg._arg
|
||||||
msg.Table(function(item) { can.onappend._plugin(can, item, {type: chat.STORY, mode: chat.FLOAT, index: item.index, args: _arg.slice(1)}, function(sub, meta) {
|
msg.Table(function(item) { can.onappend._plugin(can, item, {mode: chat.FLOAT, index: item.index, args: arg.slice(1)}, function(sub, meta) {
|
||||||
sub.run = function(event, cmds, cb) { can.runAction(can.request(event, {path: msg.Option(nfs.PATH), text: msg.Option(mdb.TEXT)}), [ice.RUN, msg._arg[0]], cmds, cb) }
|
sub.run = function(event, cmds, cb) { can.runAction(can.request(event, {path: msg.Option(nfs.PATH), text: msg.Option(mdb.TEXT)}), [ice.RUN, arg[0]], cmds, cb) }
|
||||||
can.getActionSize(function(left, top, width, height) { left = left||0
|
can.getActionSize(function(left, top, width, height) { left = left||0, top = !can.Mode()? 120: 0
|
||||||
var top = !can.Mode()? 120: 0; if (can.user.isMobile) { top = can.user.isLandscape()? 0: 48 }
|
|
||||||
sub.onimport.size(sub, can.base.Max(height, can.page.height())-top-2*html.ACTION_HEIGHT-(can.user.isMobile&&!can.user.isLandscape()? 2*html.ACTION_HEIGHT: 0), width, true)
|
sub.onimport.size(sub, can.base.Max(height, can.page.height())-top-2*html.ACTION_HEIGHT-(can.user.isMobile&&!can.user.isLandscape()? 2*html.ACTION_HEIGHT: 0), width, true)
|
||||||
can.onmotion.move(can, sub._target, {left: left, top: top})
|
can.onmotion.move(can, sub._target, {left: left, top: top})
|
||||||
})
|
})
|
||||||
}, can._root._target) }); return true
|
}, document.body) })
|
||||||
},
|
},
|
||||||
|
|
||||||
_hold: function(can, msg, _arg) { return _arg && can.user.toast(can, _arg), true },
|
_hold: function(can, msg, arg) { arg && can.user.toast(can, arg) },
|
||||||
_back: function(can) { can._history.pop()
|
_back: function(can) { can._history.pop()
|
||||||
for (var index = 0, his = can._history.pop(); his; his = can._history.pop()) { if (his[0] == ctx.ACTION) { continue }
|
for (var index = 0, his = can._history.pop(); his; his = can._history.pop()) { if (his[0] == ctx.ACTION) { continue }
|
||||||
can.page.SelectArgs(can, can._option, "", function(item) { item.value = his[index++]||"" })
|
can.page.SelectArgs(can, can._option, "", function(item) { item.value = his[index++]||"" })
|
||||||
can.page.SelectArgs(can, can._action, "", function(item) { item.value = his[index++]||"" })
|
can.page.SelectArgs(can, can._action, "", function(item) { item.value = his[index++]||"" })
|
||||||
can.Update(); break
|
can.Update(); break
|
||||||
} !his && can.Update(); return true
|
} !his && can.Update()
|
||||||
},
|
},
|
||||||
_rich: function(can, msg, _arg) {
|
_rich: function(can, msg) { if (can.page.Select(can, can._output, [html.TABLE_CONTENT, html.TBODY], function(table) {
|
||||||
if (can.page.Select(can, can._output, [html.TABLE_CONTENT, html.TBODY], function(table) {
|
var head = can.page.Select(can, can._output, [html.TABLE_CONTENT, html.TH], function(th) { return th.innerText })
|
||||||
var head = can.page.Select(can, can._output, [html.TABLE_CONTENT, html.TH], function(th) { return th.innerText })
|
return can.page.Append(can, table, msg.Table(function(value) { return {row: can.core.List(head, function(key) { return value[key] })} }))
|
||||||
can.page.Append(can, table, msg.Table(function(value) { return {row: can.core.List(head, function(key) { return value[key] })} }))
|
}).length == 0) { can.onappend.table(can, msg) } },
|
||||||
return true
|
_grow: function(can, msg, arg) { var sub = can.core.Value(can, chat._OUTPUTS_CURRENT)
|
||||||
}).length == 0) { can.onappend.table(can, msg) } return true
|
if (sub && sub.onimport && sub.onimport.grow) { return sub.onimport.grow(sub, msg, arg) }
|
||||||
},
|
arg = can.page.Color(arg)
|
||||||
_grow: function(can, msg, _arg) { var sub = can.core.Value(can, chat._OUTPUTS_CURRENT)
|
|
||||||
if (sub && sub.onimport && sub.onimport.grow) { return sub.onimport.grow(sub, msg, _arg), true }
|
|
||||||
_arg = can.page.Color(_arg)
|
|
||||||
if (can.page.Select(can, can._output, html.DIV_CODE, function(div) {
|
if (can.page.Select(can, can._output, html.DIV_CODE, function(div) {
|
||||||
return can.page.style(can, div, html.MAX_HEIGHT, 400), can.page.Append(can, div, [{text: _arg}]), div.scrollBy(0, 10000), true
|
return can.page.style(can, div, html.MAX_HEIGHT, 400), can.page.Append(can, div, [{text: arg}]), div.scrollBy(0, 10000), true
|
||||||
}).length == 0) { can.onappend.board(can, _arg) } return true
|
}).length == 0) { can.onappend.board(can, arg) }
|
||||||
},
|
},
|
||||||
_open: function(can, msg, _arg) { return can.user.open(_arg), true },
|
_open: function(can, msg, arg) { return can.user.open(arg) },
|
||||||
|
|
||||||
size: function(can, height, width, auto, mode) {
|
size: function(can, height, width, auto, mode) {
|
||||||
if (auto) {
|
if (auto) {
|
||||||
can.page.style(can, can._output, html.HEIGHT, "", html.WIDTH, "", html.MAX_HEIGHT, height? can.ConfHeight(height): "", html.MAX_WIDTH, can.ConfWidth(width))
|
can.page.style(can, can._output, html.HEIGHT, "", html.WIDTH, "", html.MAX_HEIGHT, height? can.ConfHeight(height): "", html.MAX_WIDTH, can.ConfWidth(width))
|
||||||
} else {
|
} else {
|
||||||
can.page.style(can, can._output, html.HEIGHT, can.ConfHeight(height), html.WIDTH, can.ConfWidth(width), html.MAX_HEIGHT, "", html.MAX_WIDTH, "")
|
can.page.style(can, can._output, html.HEIGHT, can.ConfHeight(height), html.WIDTH, can.ConfWidth(width), html.MAX_HEIGHT, "", html.MAX_WIDTH, "")
|
||||||
}
|
}
|
||||||
// can.user.isMobile && can.onmotion.toggle(can, can._action, can.ConfHeight() < can.ConfWidth()-100)
|
|
||||||
var sub = can.core.Value(can, chat._OUTPUTS_CURRENT); if (!sub) { return } sub.ConfHeight(can.ConfHeight()), sub.ConfWidth(can.ConfWidth())
|
var sub = can.core.Value(can, chat._OUTPUTS_CURRENT); if (!sub) { return } sub.ConfHeight(can.ConfHeight()), sub.ConfWidth(can.ConfWidth())
|
||||||
if (mode) { sub.Mode(can.Mode(mode)), sub.onlayout[mode](sub) } else { sub.onlayout._init(sub) }
|
if (mode) { sub.Mode(can.Mode(mode)), sub.onlayout[mode](sub) } else { sub.onlayout._init(sub) }
|
||||||
},
|
},
|
||||||
change: function(event, can, name, value, cb) {
|
change: function(event, can, name, value, cb) { return can.page.SelectArgs(can, can._option, "", function(input) {
|
||||||
return can.page.SelectArgs(can, can._option, "", function(input) {
|
if (input.name != name || value == input.value) { return } return input.value = value, can.Update(event, can.Input([], true), cb), input
|
||||||
if (input.name != name || value == input.value) { return }
|
})[0] },
|
||||||
return input.value = value, can.Update(event, can.Input([], true), cb), input
|
|
||||||
})[0]
|
|
||||||
},
|
|
||||||
title: function(can, title) { can.isCmdMode() && can.user.title(title) },
|
|
||||||
})
|
})
|
||||||
Volcanos(chat.ONACTION, {list: [
|
Volcanos(chat.ONACTION, {list: [
|
||||||
"刷新界面", "刷新数据", "切换浮动", "切换全屏", "共享工具", "远程控制", "打开链接", "生成链接", "生成脚本", "生成图片", [
|
"刷新界面", "刷新数据", "切换浮动", "切换全屏", "远程控制", "共享工具", "打开链接", "生成链接", "生成脚本", "生成图片", [
|
||||||
"其它", "保存参数", "清空参数", "扩展参数", "复制数据", "下载数据", "清空数据",
|
"其它", "保存参数", "清空参数", "扩展参数", "复制数据", "下载数据", "清空数据", "删除工具",
|
||||||
"查看文档", "查看脚本", "查看源码", "查看配置", "清理配置", "导出配置", "导入配置", "删除配置", "删除工具",
|
"查看文档", "查看脚本", "查看源码", "查看配置", "清理配置", "导出配置", "导入配置", "删除配置",
|
||||||
], [
|
], [
|
||||||
"调试", "查看日志",
|
"调试", "查看日志", "打包页面",
|
||||||
],
|
],
|
||||||
],
|
],
|
||||||
_engine: function(event, can, button) { can.Update(event, [ctx.ACTION, button].concat(can.Input())) },
|
_engine: function(event, can, button) { can.Update(event, [ctx.ACTION, button].concat(can.Input())) },
|
||||||
_switch: function(can, sub, mode, save, load) {
|
_switch: function(can, sub, mode, save, load) {
|
||||||
if (can.page.ClassList.neg(can, can._target, mode)) {
|
if (can.page.ClassList.neg(can, can._target, mode)) {
|
||||||
(can._mode_list = can._mode_list||[]).push(kit.Dict(
|
(can._mode_list = can._mode_list||[]).push(kit.Dict(
|
||||||
ice.MODE, can.Mode()||"", html.HEIGHT, can.ConfHeight(), html.WIDTH, can.ConfWidth(),
|
html.HEIGHT, can.ConfHeight(), html.WIDTH, can.ConfWidth(), ice.MODE, can.Mode()||"",
|
||||||
html.ACTION, can._action.style.display == "", html.STATUS, can._status.style.display == "",
|
html.ACTION, can.page.isDisplay(can._action), html.STATUS, can.page.isDisplay(can._status),
|
||||||
html.OUTPUT, can.base.Copy({}, can._output.style, html.HEIGHT, html.WIDTH, html.MAX_HEIGHT, html.MAX_WIDTH),
|
html.OUTPUT, can.base.Copy({}, can._output.style, html.HEIGHT, html.WIDTH, html.MAX_HEIGHT, html.MAX_WIDTH),
|
||||||
ctx.STYLE, can.base.Copy({}, can._target.style, html.LEFT, html.TOP, html.RIGHT, html.BOTTOM),
|
ctx.STYLE, can.base.Copy({}, can._target.style, html.LEFT, html.TOP, html.RIGHT, html.BOTTOM),
|
||||||
save(),
|
save(),
|
||||||
)), can.onimport.size(can, can.ConfHeight(), can.ConfWidth(), false, mode)
|
)), can.onimport.size(can, can.ConfHeight(), can.ConfWidth(), false, mode)
|
||||||
} else { var back = (can._mode_list = can._mode_list||[]).pop(); if (!back) { return }
|
} else { var back = (can._mode_list = can._mode_list||[]).pop(); if (!back) { return }
|
||||||
can.Mode(back.mode), can.ConfHeight(back.height), can.ConfWidth(back.width)
|
can.ConfHeight(back.height), can.ConfWidth(back.width), can.Mode(back.mode),
|
||||||
can.page.style(can, can._output, back.output), can.page.style(can, can._target, back.style)
|
|
||||||
can.onmotion.toggle(can, can._action, back.action), can.onmotion.toggle(can, can._status, back.status)
|
can.onmotion.toggle(can, can._action, back.action), can.onmotion.toggle(can, can._status, back.status)
|
||||||
can.base.isFunc(load) && load(back), sub.Mode(can.Mode()), sub.ConfHeight(can.ConfHeight()), sub.ConfWidth(can.ConfWidth()), sub.onlayout._init(sub)
|
can.page.style(can, can._output, back.output), can.page.style(can, can._target, back.style)
|
||||||
|
can.base.isFunc(load) && load(back), sub.ConfHeight(can.ConfHeight()), sub.ConfWidth(can.ConfWidth()), sub.Mode(can.Mode()), sub.onlayout._init(sub)
|
||||||
}
|
}
|
||||||
can.user.isMobile && can.onmotion.hidden(can, can._action)
|
|
||||||
},
|
},
|
||||||
_resize: function(can, auto, height, width) { can.onimport.size(can, height, width, auto) },
|
"刷新界面": function(event, can) { var sub = can._outputs[0]; sub.onlayout._init(sub), can.user.toastSuccess(can) },
|
||||||
_output: function(can, msg) {},
|
|
||||||
|
|
||||||
"刷新界面": function(event, can, button, sub) { sub.onlayout._init(sub), can.user.toastSuccess(can) },
|
|
||||||
"刷新数据": function(event, can) { can.Update(event, can.Input()), can.user.toastSuccess(can) },
|
"刷新数据": function(event, can) { can.Update(event, can.Input()), can.user.toastSuccess(can) },
|
||||||
"切换浮动": function(event, can, button, sub) {
|
"切换浮动": function(event, can, button, sub) { can.onaction._switch(can, sub, chat.FLOAT, function() { can.onmotion.hidden(can, can._action), can.onmotion.hidden(can, can._status)
|
||||||
can.onaction._switch(can, sub, chat.FLOAT, function() { can.onmotion.hidden(can, can._action), can.onmotion.hidden(can, can._status)
|
can.ConfHeight(can.page.height()/2-2*html.ACTION_HEIGHT-can.onexport.statusHeight(can)), html.WIDTH, can.ConfWidth(can.page.width()/(can.user.isMobile? 1: 2))
|
||||||
can.ConfHeight(can.page.height()/2-2*html.ACTION_HEIGHT-can.onexport.statusHeight(can)), html.WIDTH, can.ConfWidth(can.page.width()/(can.user.isMobile? 1: 2))
|
can.getActionSize(function(left) { can.onmotion.move(can, can._target, {left: (left||0)+(can.user.isMobile? 0: html.PLUGIN_MARGIN), top: can.page.height()/2-html.PLUGIN_MARGIN}) })
|
||||||
can.getActionSize(function(left) { can.onmotion.move(can, can._target, {left: (left||0)+(can.user.isMobile? 0: html.PLUGIN_MARGIN), top: can.page.height()/2-html.PLUGIN_MARGIN}) })
|
}) },
|
||||||
})
|
"切换全屏": function(event, can) { var sub = can._outputs[0]; can.onaction._switch(can, sub, chat.FULL, function() { can.page.style(can, can._target, html.LEFT, "", html.TOP, "", html.BOTTOM, "")
|
||||||
},
|
can.ConfHeight(can.page.height()-html.ACTION_HEIGHT-can.onexport.statusHeight(can)), can.ConfWidth(can.page.width())
|
||||||
"切换全屏": function(event, can, button, sub) {
|
}) },
|
||||||
can.onaction._switch(can, sub, chat.FULL, function() { can.page.style(can, can._target, html.LEFT, "", html.TOP, "", html.BOTTOM, "")
|
|
||||||
can.ConfHeight(can.page.height()-html.ACTION_HEIGHT-can.onexport.statusHeight(can)), can.ConfWidth(can.page.width())
|
|
||||||
})
|
|
||||||
},
|
|
||||||
"共享工具": function(event, can) { var meta = can.Conf()
|
|
||||||
can.onmotion.share(event, can, [{name: chat.TITLE, value: meta.name}, {name: chat.TOPIC, values: [can.getHeader(chat.TOPIC), cli.WHITE, cli.BLACK]}], [mdb.NAME, meta.index, mdb.TEXT, JSON.stringify(can.Input())])
|
|
||||||
},
|
|
||||||
"远程控制": function(event, can) { can.onaction.keyboard(event, can) },
|
"远程控制": function(event, can) { can.onaction.keyboard(event, can) },
|
||||||
|
"共享工具": function(event, can) { var meta = can.Conf()
|
||||||
|
can.onmotion.share(event, can, [{name: chat.TITLE, value: meta.name}, {name: chat.TOPIC, values: [can.getHeader(chat.TOPIC), "light", "dark", cli.WHITE, cli.BLACK]}], [mdb.NAME, meta.index, mdb.TEXT, JSON.stringify(can.Input())])
|
||||||
|
},
|
||||||
"打开链接": function(event, can) { can.user.open(can.onexport.link(can)) },
|
"打开链接": function(event, can) { can.user.open(can.onexport.link(can)) },
|
||||||
"生成链接": function(event, can) { can.onmotion.share(event, can, [], [mdb.LINK, can.user.copy(event, can, can.onexport.link(can))]) },
|
"生成链接": function(event, can) { can.onmotion.share(event, can, [], [mdb.LINK, can.user.copy(event, can, can.onexport.link(can))]) },
|
||||||
"生成脚本": function(event, can) { var conf = can.Conf()
|
"生成脚本": function(event, can) { var conf = can.Conf(), args = can.Input().join(ice.SP), list = [
|
||||||
var args = can.Input().join(ice.SP), list = [
|
"export ctx_dev="+location.origin+"; ctx_temp=$(mktemp); curl -o $ctx_temp -fsSL $ctx_dev;"+" source $ctx_temp cmd "+(conf.index||"")+ice.SP+args,
|
||||||
"export ctx_dev="+location.origin+"; ctx_temp=$(mktemp); curl -o $ctx_temp -fsSL $ctx_dev;"+" source $ctx_temp cmd "+(conf.index||"")+ice.SP+args,
|
"ish_sys_dev_run_command "+args, "ish_sys_dev_run_action", "ish_sys_dev_run_source",
|
||||||
"ish_sys_dev_run_command "+args, "ish_sys_dev_run_action", "ish_sys_dev_run_source",
|
]; can.user.copy(event, can, list[0]) },
|
||||||
]
|
|
||||||
can.user.copy(event, can, list[0])
|
|
||||||
},
|
|
||||||
"生成图片": function(event, can) { can.user.toimage(can, can._name) },
|
"生成图片": function(event, can) { can.user.toimage(can, can._name) },
|
||||||
"打包页面": function(event, can) { can.onengine.signal(can, "onwebpack", can.request(event)) },
|
|
||||||
|
|
||||||
"保存参数": function(event, can) { can.search(event, ["River.ondetail.保存参数"]) },
|
"保存参数": function(event, can) { can.search(event, ["River.ondetail.保存参数"]) },
|
||||||
"清空参数": function(event, can) { can.page.SelectArgs(can, can._option, "", function(item) { return item.value = "" }) },
|
"清空参数": function(event, can) { can.page.SelectArgs(can, can._option, "", function(item) { return item.value = "" }) },
|
||||||
"扩展参数": function(event, can) { can.onmotion.toggle(can, can._action) },
|
"扩展参数": function(event, can) { can.onmotion.toggle(can, can._action) },
|
||||||
"复制数据": function(event, can, button, sub) { can.user.copy(event, can, sub.onexport.table(sub)||sub.onexport.board(sub)) },
|
"复制数据": function(event, can) { var sub = can._outputs[0]; can.user.copy(event, can, sub.onexport.table(sub)||sub.onexport.board(sub)) },
|
||||||
"下载数据": function(event, can, button, sub) {
|
"下载数据": function(event, can) { var sub = can._outputs[0]; can.user.input(event, can, [{name: "filename", value: can.Conf(mdb.NAME)}], function(list) {
|
||||||
can.user.input(event, can, [{name: "filename", value: can.Conf(mdb.NAME)}], function(list) {
|
can.user.downloads(can, sub.onexport.table(sub), list[0], nfs.CSV), can.user.downloads(can, sub.onexport.board(sub), list[0], nfs.TXT)
|
||||||
can.user.downloads(can, sub.onexport.table(sub), list[0], nfs.CSV), can.user.downloads(can, sub.onexport.board(sub), list[0], nfs.TXT)
|
}) },
|
||||||
})
|
|
||||||
},
|
|
||||||
"清空数据": function(event, can) { can.onmotion.clear(can, can._output) },
|
"清空数据": function(event, can) { can.onmotion.clear(can, can._output) },
|
||||||
|
"删除工具": function(event, can) { can.page.Remove(can, can._target) },
|
||||||
|
|
||||||
"查看文档": function(event, can) { can.runAction(event, ctx.CONFIG, [ice.HELP]) },
|
"查看文档": function(event, can) { can.runAction(event, ctx.CONFIG, [ice.HELP]) },
|
||||||
"查看脚本": function(event, can) { can.runAction(event, ctx.CONFIG, [nfs.SCRIPT]) },
|
"查看脚本": function(event, can) { can.runAction(event, ctx.CONFIG, [nfs.SCRIPT]) },
|
||||||
@ -171,18 +130,12 @@ Volcanos(chat.ONACTION, {list: [
|
|||||||
"清理配置": function(event, can) { can.runActionInputs(event, [ctx.ACTION, mdb.PRUNES]) },
|
"清理配置": function(event, can) { can.runActionInputs(event, [ctx.ACTION, mdb.PRUNES]) },
|
||||||
"导出配置": function(event, can) { can.runAction(event, mdb.EXPORT) },
|
"导出配置": function(event, can) { can.runAction(event, mdb.EXPORT) },
|
||||||
"导入配置": function(event, can) { can.runAction(event, mdb.IMPORT) },
|
"导入配置": function(event, can) { can.runAction(event, mdb.IMPORT) },
|
||||||
"删除配置": function(event, can) { can.runAction(event, ctx.CONFIG, [mdb.REMOVE], function() {
|
"删除配置": function(event, can) { can.runAction(event, ctx.CONFIG, [mdb.REMOVE], function() { can.user.toastProcess(can), can.onmotion.delay(can, function() { can.user.toastSuccess(can), can.Update() }, 1000) }) },
|
||||||
can.user.toastProcess(can), can.onmotion.delay(can, function() { can.user.toastSuccess(can), can.Update() }, 1000)
|
|
||||||
}) },
|
|
||||||
"删除工具": function(event, can) { can.page.Remove(can, can._target) },
|
|
||||||
"查看日志": function(event, can, button, sub) { sub = can._outputs[0]
|
|
||||||
sub.onimport.tool(sub, ["can.debug"], function(sub) {
|
|
||||||
sub.select()
|
|
||||||
})
|
|
||||||
},
|
|
||||||
|
|
||||||
refresh: function(event, can) {
|
"查看日志": function(event, can) { var sub = can._outputs[0]; sub.onimport.tool(sub, ["can.debug"], function(sub) { sub.select() }) },
|
||||||
var sub = can.core.Value(can, chat._OUTPUTS_CURRENT); if (!sub) { return }
|
"打包页面": function(event, can) { can.onengine.signal(can, "onwebpack", can.request(event)) },
|
||||||
|
|
||||||
|
refresh: function(event, can) { var sub = can.core.Value(can, chat._OUTPUTS_CURRENT); if (!sub) { return }
|
||||||
sub.ConfHeight(can.ConfHeight()), sub.ConfWidth(can.ConfWidth()), sub.onimport.layout(sub)
|
sub.ConfHeight(can.ConfHeight()), sub.ConfWidth(can.ConfWidth()), sub.onimport.layout(sub)
|
||||||
},
|
},
|
||||||
close: function(event, can) {
|
close: function(event, can) {
|
||||||
@ -195,11 +148,18 @@ Volcanos(chat.ONACTION, {list: [
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
clear: function(event, can) { can.onmotion.clear(can, can._output) },
|
clear: function(event, can) { can.onmotion.clear(can, can._output) },
|
||||||
|
actions: function(event, can) { can.onmotion.toggle(can, can._action) },
|
||||||
full: function(event, can) { can.onaction["切换全屏"](event, can, "切换全屏", can.core.Value(can, chat._OUTPUTS_CURRENT)) },
|
full: function(event, can) { can.onaction["切换全屏"](event, can, "切换全屏", can.core.Value(can, chat._OUTPUTS_CURRENT)) },
|
||||||
next: function(event, can) { can.runAction(event, mdb.NEXT, [can.Status(mdb.TOTAL)||0, can.Option(mdb.LIMIT)||can.Action(mdb.LIMIT)||"", can.Option(mdb.OFFEND)||can.Action(mdb.OFFEND)||""]) },
|
next: function(event, can) { can.runAction(event, mdb.NEXT, [can.Status(mdb.TOTAL)||0, can.Option(mdb.LIMIT)||can.Action(mdb.LIMIT)||"", can.Option(mdb.OFFEND)||can.Action(mdb.OFFEND)||""]) },
|
||||||
prev: function(event, can) { can.runAction(event, mdb.PREV, [can.Status(mdb.TOTAL)||0, can.Option(mdb.LIMIT)||can.Action(mdb.LIMIT)||"", can.Option(mdb.OFFEND)||can.Action(mdb.OFFEND)||""]) },
|
prev: function(event, can) { can.runAction(event, mdb.PREV, [can.Status(mdb.TOTAL)||0, can.Option(mdb.LIMIT)||can.Action(mdb.LIMIT)||"", can.Option(mdb.OFFEND)||can.Action(mdb.OFFEND)||""]) },
|
||||||
actions: function(event, can) { can.onmotion.toggle(can, can._action) },
|
|
||||||
upload: function(event, can) { can.user.upload(event, can) },
|
upload: function(event, can) { can.user.upload(event, can) },
|
||||||
|
keyboard: function(event, can) {
|
||||||
|
can.base.isUndefined(can._daemon) && can.ondaemon._list[0] && (can._daemon = can.ondaemon._list.push(can)-1)
|
||||||
|
can.request(event, kit.Dict(ctx.INDEX, can._index, ice.MSG_DAEMON, can.core.Keys(can.ondaemon._list[0], can._daemon)))
|
||||||
|
can.runAction(event, "keyboard", [], 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]})
|
||||||
|
})
|
||||||
|
},
|
||||||
|
|
||||||
getClipboardData: function(event, can, button) {
|
getClipboardData: function(event, can, button) {
|
||||||
function add(text) { can.runAction(event, button, can.base.Simple(can.base.ParseJSON(text)), function() { can.Update() }) }
|
function add(text) { can.runAction(event, button, can.base.Simple(can.base.ParseJSON(text)), function() { can.Update() }) }
|
||||||
@ -236,23 +196,16 @@ Volcanos(chat.ONACTION, {list: [
|
|||||||
var recorder = new MediaRecorder(stream, {mimeType: web.VIDEO_WEBM}), blobs = []; recorder.ondataavailable = function(res) { blobs.push(res.data) }
|
var recorder = new MediaRecorder(stream, {mimeType: web.VIDEO_WEBM}), blobs = []; recorder.ondataavailable = function(res) { blobs.push(res.data) }
|
||||||
recorder.onstop = function() { cb(blobs, nfs.WEBM) }, recorder.start(1)
|
recorder.onstop = function() { cb(blobs, nfs.WEBM) }, recorder.start(1)
|
||||||
}) },
|
}) },
|
||||||
keyboard: function(event, can) {
|
|
||||||
can.base.isUndefined(can._daemon) && can.ondaemon._list[0] && (can._daemon = can.ondaemon._list.push(can)-1)
|
|
||||||
can.request(event, kit.Dict(ctx.INDEX, can._index, ice.MSG_DAEMON, can.core.Keys(can.ondaemon._list[0], can._daemon)))
|
|
||||||
can.runAction(event, "keyboard", [], 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]})
|
|
||||||
})
|
|
||||||
},
|
|
||||||
})
|
})
|
||||||
Volcanos(chat.ONEXPORT, {
|
Volcanos(chat.ONEXPORT, {
|
||||||
title: function(can, title) {},
|
|
||||||
output: function(can, msg) {},
|
|
||||||
action: function(can, button, line) {},
|
|
||||||
record: function(can, value, key, line) {},
|
|
||||||
statusHeight: function(can) { return can._status.style.display == html.NONE || can._status.innerHTML == "" || can._status.offsetHeight == 0? 0: html.ACTION_HEIGHT },
|
|
||||||
actionHeight: function(can) { return can._action.style.display == html.NONE || can._action.innerHTML == ""? 0: html.ACTION_HEIGHT },
|
|
||||||
link: function(can) { var meta = can.Conf(), args = can.Option()
|
link: function(can) { var meta = can.Conf(), args = can.Option()
|
||||||
args.cmd = meta.index||can.core.Keys(meta.ctx, meta.cmd), args.cmd == web.WIKI_WORD && (args.cmd = args.path)
|
args.cmd = meta.index||can.core.Keys(meta.ctx, meta.cmd), args.cmd == web.WIKI_WORD && (args.cmd = args.path)
|
||||||
return can.misc.MergePodCmd(can, args, true)
|
return can.misc.MergePodCmd(can, args, true)
|
||||||
},
|
},
|
||||||
|
title: function(can, title) {},
|
||||||
|
output: function(can, msg) {},
|
||||||
|
action: function(can, button, line) {},
|
||||||
|
record: function(can, value, key, line) {},
|
||||||
|
actionHeight: function(can) { return can._action.style.display == html.NONE || can._action.innerHTML == ""? 0: html.ACTION_HEIGHT },
|
||||||
|
statusHeight: function(can) { return can._status.style.display == html.NONE || can._status.innerHTML == "" || can._status.offsetHeight == 0? 0: html.ACTION_HEIGHT },
|
||||||
})
|
})
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb, target) {
|
Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb, target) {
|
||||||
can.requireDraw(function() {
|
can.page.requireDraw(can, function() {
|
||||||
can.onimport.layout(can), can.onmotion.clear(can, can.ui.project), can.onmotion.toggle(can, can.ui.project, true)
|
can.onimport.layout(can), can.onmotion.clear(can, can.ui.project), can.onmotion.toggle(can, can.ui.project, true)
|
||||||
can.onappend.table(can, msg, null, can.ui.project), can.page.Select(can, can.ui.project, html.TR, function(tr, index) {
|
can.onappend.table(can, msg, null, can.ui.project), can.page.Select(can, can.ui.project, html.TR, function(tr, index) {
|
||||||
can.page.Modify(can, tr, {onmouseenter: function(event) { can._draw(index-1) }})
|
can.page.Modify(can, tr, {onmouseenter: function(event) { can._draw(index-1) }})
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb) {
|
Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb) {
|
||||||
can.requireDraw(function() { can.ConfDefault({field: msg.append[0], split: ice.PS})
|
can.page.requireDraw(can, function() { can.ConfDefault({field: msg.append[0], split: ice.PS})
|
||||||
can.dir_root = can.Conf(nfs.ROOT)||msg.Option(nfs.DIR_ROOT), can._tree = can.onimport._tree(can, msg.Table(), can.Conf(mdb.FIELD), can.Conf(lex.SPLIT))
|
can.dir_root = can.Conf(nfs.DIR_ROOT)||msg.Option(nfs.DIR_ROOT), can._tree = can.onimport._tree(can, msg.Table(), can.Conf(mdb.FIELD), can.Conf(lex.SPLIT))
|
||||||
can.base.isFunc(cb) && cb(msg), can.onimport.layout(can)
|
can.base.isFunc(cb) && cb(msg), can.onimport.layout(can)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb) { can.requireDraw(function() {
|
Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb) { can.page.requireDraw(can, function() {
|
||||||
can.data = msg.Table(), can.base.isFunc(cb) && cb(msg), can.onimport.layout(can)
|
can.data = msg.Table(), can.base.isFunc(cb) && cb(msg), can.onimport.layout(can)
|
||||||
}) },
|
}) },
|
||||||
_sum: function(can) { if (can.list) { return can.list }
|
_sum: function(can) { if (can.list) { return can.list }
|
||||||
|
143
plugin/table.js
143
plugin/table.js
@ -1,81 +1,54 @@
|
|||||||
Volcanos(chat.ONIMPORT, {_init: function(can, msg, target) { can.onmotion.clear(can, target)
|
Volcanos(chat.ONIMPORT, {_init: function(can, msg, target) { can.onmotion.clear(can, target)
|
||||||
if (can.isCmdMode) {
|
if (can.Mode() == html.ZONE) { msg.Table(function(value) { var action = []
|
||||||
can.page.style(can, can._output, html.MAX_WIDTH, can.ConfWidth()||window.innerWidth)
|
can.page.Select(can, can.page.Create(can, html.DIV, value.action), html.INPUT, function(target) {
|
||||||
}
|
action.push(target.name), target.name != target.value && can.user.trans(can, kit.Dict(target.name, target.value))
|
||||||
if (can.Mode() == html.ZONE) {
|
|
||||||
msg.Table(function(value) { var action = []
|
|
||||||
can.page.Select(can, can.page.Create(can, html.DIV, value.action), html.INPUT, function(target) {
|
|
||||||
action.push(target.name), target.name != target.value && can.user.trans(can, kit.Dict(target.name, target.value))
|
|
||||||
})
|
|
||||||
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()
|
|
||||||
}, value) }) })
|
|
||||||
})
|
})
|
||||||
return
|
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()
|
||||||
|
}, value) }) })
|
||||||
|
}); return }
|
||||||
var cbs = can.onimport[can.Conf(ctx.STYLE)||msg.Option(ctx.STYLE)]; if (can.base.isFunc(cbs)) {
|
var cbs = can.onimport[can.Conf(ctx.STYLE)||msg.Option(ctx.STYLE)]; if (can.base.isFunc(cbs)) {
|
||||||
can.onappend.style(can, can._args[ctx.STYLE], target), can.core.CallFunc(cbs, {can: can, msg: msg, target: target})
|
can.onappend.style(can, can._args[ctx.STYLE], target), can.core.CallFunc(cbs, {can: can, msg: msg, target: target})
|
||||||
} else { can.onappend.table(can, msg, null, target), can.onappend.board(can, msg, target) } can.onmotion.story.auto(can, target)
|
} else { can.onappend.table(can, msg, null, target), can.onappend.board(can, msg, target) } can.onmotion.story.auto(can, target)
|
||||||
if (can.isCmdMode()) { can.page.style(can, can._output, html.MAX_HEIGHT, can.ConfHeight()) }
|
|
||||||
},
|
},
|
||||||
_system_app: function(can, msg, target) {
|
_system_app: function(can, msg, target) { can.page.Appends(can, target, msg.Table(function(item) { var name = item.name||item.text
|
||||||
can.page.Appends(can, target, msg.Table(function(item) { var name = item.name||item.text
|
return {view: html.ITEM, style: {"text-align": "center", margin: 10, width: 100, "float": "left"}, list: [
|
||||||
return {view: html.ITEM, style: {"text-align": "center", margin: 10, width: 100, "float": "left"}, list: [
|
{type: html.IMG, src: "/share/local/usr/icons/"+item.text, style: {display: html.BLOCK, width: 100}},
|
||||||
{type: html.IMG, src: "/share/local/usr/icons/"+item.text, style: {display: html.BLOCK, width: 100}},
|
{text: name.split(ice.PT)[0].replace(ice.SP, ice.NL), style: {display: html.BLOCK, height: 40}},
|
||||||
{text: name.split(ice.PT)[0].replace(ice.SP, ice.NL), style: {display: html.BLOCK, height: 40}},
|
], onclick: function(event) { can.runAction(can.request(event, item, can.Option()), "xterm", []) }}
|
||||||
], onclick: function(event) { can.runAction(can.request(event, item, can.Option()), "xterm", []) }}
|
})) },
|
||||||
}))
|
|
||||||
},
|
|
||||||
_open: function(can, msg, target) {
|
|
||||||
can.page.Appends(can, target, msg.Table(function(item) {
|
|
||||||
return {view: html.ITEM, style: {"text-align": "center", margin: 10, width: 100, "float": "left"}, list: [
|
|
||||||
{type: html.IMG, src: "/share/local/usr/icons/"+item.name, style: {display: html.BLOCK, width: 100}},
|
|
||||||
{text: item.name.split(ice.PT)[0].replace(ice.SP, ice.NL), style: {display: html.BLOCK, height: 40}},
|
|
||||||
], onclick: function(event) { can.runAction(can.request(event, item, can.Option()), "click", []) }}
|
|
||||||
}))
|
|
||||||
},
|
|
||||||
_zone: function(can, zone, index, cb, field) { zone._delay_show = function() { can.onimport.plug(can, {index: index, mode: html.ZONE, field: field}, function(sub) {
|
|
||||||
var action = can.core.List(sub.Conf(ctx.INPUTS), function(item) { if (item.type == html.BUTTON && [ice.LIST, ice.BACK].indexOf(item.name) == -1) { return item.name } })
|
|
||||||
sub.onexport.output = function(sub, msg) { zone._total(msg.Length()), cb(sub, msg)
|
|
||||||
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) } },
|
|
||||||
card: function(can, msg, target) { can.page.Appends(can, target||can._output, msg.Table(function(item) {
|
card: function(can, msg, target) { can.page.Appends(can, target||can._output, msg.Table(function(item) {
|
||||||
return {view: [[html.ITEM, item.status]], list: [{view: [wiki.TITLE, html.DIV, item.name]}, {view: [wiki.CONTENT, html.DIV, item.text]},
|
return {view: [[html.ITEM, item.status]], list: [{view: [wiki.TITLE, html.DIV, item.name]}, {view: [wiki.CONTENT, html.DIV, item.text]},
|
||||||
{view: html.ACTION, inner: item.action, onclick: function(event) { can.run(can.request(event, item), [ctx.ACTION, event.target.name]) }},
|
{view: html.ACTION, inner: item.action, onclick: function(event) { can.run(can.request(event, item), [ctx.ACTION, event.target.name]) }},
|
||||||
]}
|
]}
|
||||||
})) },
|
})) },
|
||||||
|
icon: function(can, name, button, target) { can.page.Append(can, target, [{text: [name, html.SPAN, html.ICON], onclick: function(event) {
|
||||||
tabs: function(can, list, cb, cbs, action) { action = action||can._action
|
can.base.isFunc(button)? button(event, button): can.onaction[button](event, can, button), can.onkeymap.prevent(event)
|
||||||
return can.page.Append(can, action, can.core.List(list, function(tabs) {
|
}}]) },
|
||||||
function close(target) { var next = target.nextSibling||target.previousSibling; if (!next) { return }
|
tabs: function(can, list, cb, cbs, action) { action = action||can._action; return can.page.Append(can, action, can.core.List(list, function(tabs) {
|
||||||
next.click(), can.onmotion.delay(can, function() { can.base.isFunc(cbs) && cbs(tabs), can.page.Remove(can, target) })
|
function close(target) { var next = target.nextSibling||target.previousSibling; if (!next) { return }
|
||||||
}
|
next.click(), can.onmotion.delay(can, function() { can.base.isFunc(cbs) && cbs(tabs), can.page.Remove(can, target) })
|
||||||
return {view: html.TABS, title: tabs.text, list: [{text: [tabs.name, html.SPAN]}, {text: [can.page.unicode.delete, html.SPAN, html.ICON], onclick: function(event) {
|
}
|
||||||
close(event.target.parentNode), can.onkeymap.prevent(event)
|
return {view: html.TABS, title: tabs.text, list: [{text: [tabs.name, html.SPAN]}, {text: [can.page.unicode.delete, html.SPAN, html.ICON], onclick: function(event) {
|
||||||
}}], onclick: function(event) {
|
close(tabs._target), can.onkeymap.prevent(event)
|
||||||
can.onmotion.select(can, action, html.DIV_TABS, tabs._target), can.base.isFunc(cb) && cb(event, tabs)
|
}}], onclick: function(event) {
|
||||||
}, _init: function(target) { tabs._target = target; var menu = tabs._menu||shy()
|
can.onmotion.select(can, action, html.DIV_TABS, tabs._target), can.base.isFunc(cb) && cb(event, tabs)
|
||||||
can.page.Modify(can, target, {draggable: true, _close: function() { close(target) },
|
}, _init: function(target) { tabs._target = target; var menu = tabs._menu||shy()
|
||||||
ondragstart: function(event) { action._drop = function(before) { before.parentNode == action && action.insertBefore(target, before) } },
|
can.page.Modify(can, target, {draggable: true, _close: function() { close(target) },
|
||||||
ondragover: function(event) { event.preventDefault(), action._drop(event.target) },
|
ondragstart: function(event) { action._drop = function(before) { before.parentNode == action && action.insertBefore(target, before) } },
|
||||||
oncontextmenu: function(event) { can.user.carte(event, can, kit.Dict("Close", function(event) { close(target) },
|
ondragover: function(event) { event.preventDefault(), action._drop(event.target) },
|
||||||
"Close Other", function(event) { can.page.Select(can, action, html.DIV_TABS, function(target) { target == tabs._target || close(target) }) },
|
oncontextmenu: function(event) { can.user.carte(event, can, kit.Dict("Close", function(event) { close(target) },
|
||||||
menu.meta
|
"Close Other", function(event) { can.page.SelectChild(can, action, html.DIV_TABS, function(target) { target == tabs._target || close(target) }) }, menu.meta
|
||||||
), ["Close", "Close Other", ""].concat(can.base.getValid(menu.list, can.core.Item(menu.meta))), function(event, button, meta) { (meta[button]||menu)(event, button, meta) }) },
|
), ["Close", "Close Other", ""].concat(can.base.getValid(menu.list, can.core.Item(menu.meta))), function(event, button, meta) { (meta[button]||menu)(event, button, meta) }) },
|
||||||
}), can.onmotion.delay(can, function() { target.click() })
|
}), can.onmotion.delay(can, function() { target.click() })
|
||||||
}}
|
}}
|
||||||
}))._target
|
}))._target },
|
||||||
},
|
|
||||||
tool: function(can, list, cb, target, status) { target = target||can._output, status = status||can._status
|
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.List(list.reverse(), function(meta) { can.base.isString(meta) && (meta = {index: meta}), meta.mode = html.FLOAT
|
||||||
can.onimport.plug(can, meta, function(sub) { can.onmotion.hidden(can, sub._target), sub._delay_init = true
|
can.onimport.plug(can, meta, function(sub) { can.onmotion.hidden(can, sub._target), sub._delay_init = true
|
||||||
sub.ConfHeight(can.ConfHeight()-4*html.ACTION_HEIGHT), sub.ConfWidth(can.ConfWidth()), can.page.style(can, sub._output, html.MAX_HEIGHT, sub.ConfHeight(), html.MAX_WIDTH, sub.ConfWidth())
|
can.page.style(can, sub._output, html.MAX_HEIGHT, sub.ConfHeight(can.ConfHeight()-4*html.ACTION_HEIGHT), html.MAX_WIDTH, sub.ConfWidth(can.ConfWidth()))
|
||||||
status.appendChild(sub._legend), sub._legend._fields = sub._target, sub._legend.onclick = function(event) { can.misc.Event(event, can, function(msg) {
|
status.appendChild(sub._legend), sub._legend._fields = sub._target, sub._legend.onclick = function(event) { can.misc.Event(event, can, function(msg) {
|
||||||
if (can.page.SelectOne(can, status, ice.PT+html.SELECT, function(target) { can.onmotion.hidden(can, target._fields), can.page.ClassList.del(can, target, html.SELECT) }) == sub._legend) { return }
|
if (can.page.SelectOne(can, status, ice.PT+html.SELECT, function(target) { can.onmotion.hidden(can, target._fields), can.page.ClassList.del(can, target, html.SELECT) }) == sub._legend) { return }
|
||||||
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.Update() }
|
||||||
@ -86,17 +59,20 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, target) { can.onmotion.clear(
|
|||||||
},
|
},
|
||||||
plug: function(can, meta, cb, target, field) { if (!meta || !meta.index) { return }
|
plug: function(can, meta, cb, target, field) { if (!meta || !meta.index) { return }
|
||||||
meta.type = meta.type||html.PLUG, meta.name = meta.index, can.onappend.plugin(can, meta, function(sub) { sub.sup = can
|
meta.type = meta.type||html.PLUG, meta.name = meta.index, can.onappend.plugin(can, meta, function(sub) { sub.sup = can
|
||||||
sub.ConfHeight(can.ConfHeight()-2*html.ACTION_HEIGHT), sub.ConfWidth(can.ConfWidth()), can.page.style(can, sub._output, html.MAX_HEIGHT, sub.ConfHeight(), html.MAX_WIDTH, sub.ConfWidth())
|
can.page.style(can, sub._output, html.MAX_HEIGHT, sub.ConfHeight(can.ConfHeight()-2*html.ACTION_HEIGHT), html.MAX_WIDTH, sub.ConfWidth(can.ConfWidth()))
|
||||||
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: "./"}) }
|
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()), meta.index, cmds, cb)
|
||||||
}, sub.onaction.close = function() { can.onmotion.hidden(can, target) }, can.base.isFunc(cb) && cb(sub)
|
}, sub.onaction.close = function() { can.onmotion.hidden(can, target) }, can.base.isFunc(cb) && cb(sub)
|
||||||
}, target, field)
|
}, target, field)
|
||||||
},
|
},
|
||||||
icon: function(can, name, button, target) {
|
_zone: function(can, zone, index, cb, field) { zone._delay_show = function() { can.onimport.plug(can, {index: index, style: html.OUTPUT, mode: mdb.ZONE, field: field}, function(sub) {
|
||||||
can.page.Append(can, target, [{text: [name, html.SPAN, html.ICON], onclick: function(event) {
|
var action = can.core.List(sub.Conf(ctx.INPUTS), function(item) { if (item.type == html.BUTTON && [ice.LIST, ice.BACK].indexOf(item.name) == -1) { return item.name } })
|
||||||
can.base.isFunc(button)? button(event, button): can.onaction[button](event, can, button), can.onkeymap.prevent(event)
|
sub.onexport.output = function(sub, msg) { zone._total(msg.Length()), cb(sub, msg)
|
||||||
}}])
|
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) } },
|
||||||
zone: function(can, list, 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: [
|
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: [
|
||||||
{view: html.ITEM, inner: can.user.trans(can, zone.name), _init: function(target) { zone._legend = target }, onclick: function() {
|
{view: html.ITEM, inner: can.user.trans(can, zone.name), _init: function(target) { zone._legend = target }, onclick: function() {
|
||||||
@ -108,31 +84,33 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, target) { can.onmotion.clear(
|
|||||||
}): can.onmotion.clearCarte(can)
|
}): can.onmotion.clearCarte(can)
|
||||||
}},
|
}},
|
||||||
{view: html.ACTION, _init: function(target) { zone._action = target
|
{view: html.ACTION, _init: function(target) { zone._action = target
|
||||||
can.onappend._action(can, [{input: html.TEXT, _init: function(target) { zone._search = target }, onkeyup: function(event) {
|
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.onkeymap.selectItems(event, can, zone._target), 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) })
|
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, "div.switch", function(target) { can.page.ClassList.del(can, target, cli.OPEN) })
|
can.page.Select(can, zone._target, html.DIV_EXPAND, function(target) { can.page.ClassList.del(can, target, cli.OPEN) })
|
||||||
}
|
}
|
||||||
}, onfocus: function(event) { var target = event.target; target.setSelectionRange && target.setSelectionRange(0, target.value.length) }}], target, {})
|
}, onfocus: function(event) { can.onmotion.selectRange(event.target) }}], target, {})
|
||||||
}},
|
}},
|
||||||
{view: html.LIST, _init: function(target) { can.ui.zone = can.ui.zone||{}, can.ui.zone[zone.name] = zone, zone._target = target, zone.refresh = function() { can.onmotion.clear(can, target), zone._init(target, zone) }
|
{view: html.LIST, _init: function(target) { can.ui.zone = can.ui.zone||{}, can.ui.zone[zone.name] = zone, zone._target = target
|
||||||
zone._total = function(total) { return can.page.Modify(can, zone._search, {placeholder: "search in "+total+" item"}), total }
|
zone._total = function(total) { return can.page.Modify(can, zone._search, {placeholder: "search in "+total+" item"}), total }
|
||||||
zone._icon = function(list) {
|
zone._icon = function(list) {
|
||||||
can.page.Select(can, zone._legend, "span.icon", function(target) { can.page.Remove(can, target) })
|
can.page.Select(can, zone._legend, html.SPAN_ICON, function(target) { can.page.Remove(can, target) })
|
||||||
can.core.Item(list, function(name, button) { can.onimport.icon(can, name, button, zone._legend) })
|
can.core.Item(list, function(name, button) { can.onimport.icon(can, name, button, zone._legend) })
|
||||||
}
|
}
|
||||||
can.base.isFunc(zone._init) && (zone._menu = zone._init(target, zone)||zone._menu); if (zone._delay_show) { can.onmotion.hidden(can, zone._action), can.onmotion.hidden(can, zone._target) }
|
zone.refresh = function() { can.onmotion.clear(can, target), zone._init(target, zone) }
|
||||||
}}
|
can.base.isFunc(zone._init) && (zone._menu = zone._init(target, zone)||zone._menu)
|
||||||
|
if (zone._delay_show) { can.onmotion.hidden(can, zone._action), can.onmotion.hidden(can, zone._target) }
|
||||||
|
}},
|
||||||
]} }))
|
]} }))
|
||||||
},
|
},
|
||||||
tree: function(can, list, field, split, cb, target, node) {
|
tree: function(can, list, field, split, cb, target, node) {
|
||||||
node = node||{"": target}; can.core.List(list, function(item) { item[field] && can.core.List(item[field].split(split), function(value, index, array) { if (!value) { return }
|
node = node||{"": target}; can.core.List(list, function(item) { item[field] && can.core.List(item[field].split(split), function(value, index, array) { if (!value) { return }
|
||||||
var last = array.slice(0, index).join(split), name = array.slice(0, index+1).join(split); if (node[name]) { return }
|
var last = array.slice(0, index).join(split), name = array.slice(0, index+1).join(split); if (node[name]) { return }
|
||||||
var ui = can.page.Append(can, node[last], [{view: html.ITEM, list: [
|
var ui = can.page.Append(can, node[last], [{view: html.ITEM, list: [
|
||||||
{view: [["switch", item.expand? cli.OPEN: ""], html.DIV, (index==array.length-1? "": can.page.unicode.close)]},
|
{view: [[html.EXPAND, item.expand? cli.OPEN: ""], html.DIV, (index==array.length-1? "": can.page.unicode.close)]},
|
||||||
{view: [mdb.NAME, html.DIV, value], _init: item._init},
|
{view: [mdb.NAME, html.DIV, value], _init: item._init},
|
||||||
], onclick: function(event) { if (node[name].childElementCount == 2) { node[name].firstChild.click() }
|
], onclick: function(event) { if (node[name].childElementCount == 2) { node[name].firstChild.click() }
|
||||||
index < array.length - 1? can.page.ClassList.set(can, ui["switch"], cli.OPEN, !can.page.ClassList.neg(can, node[name], html.HIDE)): can.base.isFunc(cb) && cb(event, item)
|
index < array.length - 1? can.page.ClassList.set(can, ui[html.EXPAND], cli.OPEN, !can.page.ClassList.neg(can, node[name], html.HIDE)): can.base.isFunc(cb) && cb(event, item)
|
||||||
}, oncontextmenu: function(event) { if (!item._menu) { return }
|
}, oncontextmenu: function(event) { if (!item._menu) { return }
|
||||||
var menu = item._menu; can.user.carteRight(event, can, menu.meta, menu.list, menu)
|
var menu = item._menu; can.user.carteRight(event, can, menu.meta, menu.list, menu)
|
||||||
}}, {view: [[html.LIST, item.expand? "": html.HIDE]]}]); node[name] = ui.list
|
}}, {view: [[html.LIST, item.expand? "": html.HIDE]]}]); node[name] = ui.list
|
||||||
@ -163,7 +141,10 @@ Volcanos(chat.ONLAYOUT, {
|
|||||||
output: function(can) { can.onlayout._init(can) },
|
output: function(can) { can.onlayout._init(can) },
|
||||||
float: function(can) { can.onlayout._init(can) },
|
float: function(can) { can.onlayout._init(can) },
|
||||||
full: function(can) { can.onlayout._init(can) },
|
full: function(can) { can.onlayout._init(can) },
|
||||||
cmd: function(can) { can.onlayout._init(can) },
|
cmd: function(can) { can.onlayout._init(can)
|
||||||
|
can.page.style(can, can._output, html.MAX_HEIGHT, can.ConfHeight()||window.innerHeight-2*html.ACTION_HEIGHT)
|
||||||
|
can.page.style(can, can._output, html.MAX_WIDTH, can.ConfWidth()||window.innerWidth)
|
||||||
|
},
|
||||||
})
|
})
|
||||||
Volcanos(chat.ONEXPORT, {
|
Volcanos(chat.ONEXPORT, {
|
||||||
table: function(can) { var msg = can._msg; if (msg.Length() == 0) { return }
|
table: function(can) { var msg = can._msg; if (msg.Length() == 0) { return }
|
||||||
|
132
proto.js
132
proto.js
@ -25,23 +25,19 @@ var ice = {
|
|||||||
MSG_DETAIL: "detail", MSG_OPTION: "option", MSG_APPEND: "append", MSG_RESULT: "result",
|
MSG_DETAIL: "detail", MSG_OPTION: "option", MSG_APPEND: "append", MSG_RESULT: "result",
|
||||||
MSG_SESSID: "sessid", MSG_FIELDS: "fields",
|
MSG_SESSID: "sessid", MSG_FIELDS: "fields",
|
||||||
|
|
||||||
MSG_SOURCE: "_source",
|
MSG_SOURCE: "_source", MSG_TARGET: "_target",
|
||||||
MSG_TARGET: "_target",
|
MSG_HANDLE: "_handle", MSG_UPLOAD: "_upload",
|
||||||
MSG_HANDLE: "_handle",
|
MSG_ACTION: "_action", MSG_STATUS: "_status",
|
||||||
MSG_UPLOAD: "_upload",
|
|
||||||
MSG_ACTION: "_action",
|
|
||||||
MSG_STATUS: "_status",
|
|
||||||
MSG_PREFIX: "_prefix",
|
|
||||||
|
|
||||||
MSG_DISPLAY: "_display",
|
MSG_DISPLAY: "_display",
|
||||||
MSG_TOOLKIT: "_toolkit",
|
MSG_TOOLKIT: "_toolkit",
|
||||||
MSG_PROCESS: "_process",
|
MSG_PROCESS: "_process",
|
||||||
PROCESS_AGAIN: "_again",
|
PROCESS_AGAIN: "_again",
|
||||||
|
MSG_PREFIX: "_prefix",
|
||||||
|
|
||||||
MSG_MODE: "sess.mode",
|
|
||||||
MSG_TITLE: "sess.title", MSG_TOPIC: "sess.topic", MSG_RIVER: "sess.river", MSG_STORM: "sess.storm", MSG_WIDTH: "sess.width", MSG_HEIGHT: "sess.height",
|
|
||||||
MSG_DAEMON: "sess.daemon",
|
|
||||||
MSG_USERNAME: "user.name", MSG_USERNICK: "user.nick",
|
MSG_USERNAME: "user.name", MSG_USERNICK: "user.nick",
|
||||||
|
MSG_TITLE: "sess.title", MSG_TOPIC: "sess.topic", MSG_RIVER: "sess.river", MSG_STORM: "sess.storm", MSG_WIDTH: "sess.width", MSG_HEIGHT: "sess.height",
|
||||||
|
MSG_MODE: "sess.mode", MSG_DAEMON: "sess.daemon",
|
||||||
LOG_DISABLE: "log.disable",
|
LOG_DISABLE: "log.disable",
|
||||||
|
|
||||||
ErrWarn: "warn: ", ErrNotLogin: "not login: ", ErrNotRight: "not right: ", ErrNotFound: "not found: ", ErrNotValid: "not valid: ",
|
ErrWarn: "warn: ", ErrNotLogin: "not login: ", ErrNotRight: "not right: ", ErrNotFound: "not found: ", ErrNotValid: "not valid: ",
|
||||||
@ -60,17 +56,14 @@ var ctx = {
|
|||||||
}
|
}
|
||||||
var mdb = {
|
var mdb = {
|
||||||
DICT: "dict", META: "meta", HASH: "hash", LIST: "list",
|
DICT: "dict", META: "meta", HASH: "hash", LIST: "list",
|
||||||
DATA: "data", VIEW: "view", ICON: "icon",
|
ID: "id", KEY: "key", TIME: "time", ZONE: "zone", TYPE: "type", NAME: "name", TEXT: "text",
|
||||||
|
DATA: "data", VIEW: "view", ICON: "icon", LINK: "link", SCAN: "scan", HELP: "help",
|
||||||
ID: "id", KEY: "key", TIME: "time", ZONE: "zone", TYPE: "type", NAME: "name", TEXT: "text", LINK: "link", SCAN: "scan", HELP: "help",
|
|
||||||
SHORT: "short", FIELD: "field", TOTAL: "total", COUNT: "count", LIMIT: "limit",
|
SHORT: "short", FIELD: "field", TOTAL: "total", COUNT: "count", LIMIT: "limit",
|
||||||
INDEX: "index", VALUE: "value", EXTRA: "extra", ALIAS: "alias", EXPIRE: "expire",
|
INDEX: "index", VALUE: "value", EXTRA: "extra", ALIAS: "alias", EXPIRE: "expire",
|
||||||
|
|
||||||
CREATE: "create", REMOVE: "remove", INSERT: "insert", DELETE: "delete", MODIFY: "modify", SELECT: "select",
|
CREATE: "create", REMOVE: "remove", INSERT: "insert", DELETE: "delete", MODIFY: "modify", SELECT: "select",
|
||||||
INPUTS: "inputs", PRUNES: "prunes", EXPORT: "export", IMPORT: "import",
|
INPUTS: "inputs", PRUNES: "prunes", EXPORT: "export", IMPORT: "import", REVERT: "revert", NORMAL: "normal",
|
||||||
SEARCH: "search", ENGINE: "engine", RENDER: "render", PLUGIN: "plugin",
|
SEARCH: "search", ENGINE: "engine", RENDER: "render", PLUGIN: "plugin",
|
||||||
REVERT: "revert",
|
|
||||||
NORMAL: "normal",
|
|
||||||
|
|
||||||
MAIN: "main", PAGE: "page", NEXT: "next", PREV: "prev", LIMIT: "limit", OFFEND: "offend",
|
MAIN: "main", PAGE: "page", NEXT: "next", PREV: "prev", LIMIT: "limit", OFFEND: "offend",
|
||||||
FOREACH: "*", RANDOMS: "%",
|
FOREACH: "*", RANDOMS: "%",
|
||||||
@ -107,22 +100,21 @@ var tcp = {
|
|||||||
HOST: "host", PORT: "port",
|
HOST: "host", PORT: "port",
|
||||||
}
|
}
|
||||||
var nfs = {
|
var nfs = {
|
||||||
PATH: "path", FILE: "file", LINE: "line", SIZE: "size", ROOT: "root",
|
|
||||||
COPY: "copy", EDIT: "edit", SAVE: "save", LOAD: "load", FIND: "find", GREP: "grep", TAGS: "tags",
|
|
||||||
DIR: "dir", CAT: "cat", DEFS: "defs", TRASH: "trash", DIR_ROOT: "dir_root", PWD: "./",
|
DIR: "dir", CAT: "cat", DEFS: "defs", TRASH: "trash", DIR_ROOT: "dir_root", PWD: "./",
|
||||||
CONTENT: "content", SOURCE: "source", SCRIPT: "script", TARGET: "target", MODULE: "module", RECENT: "recent",
|
COPY: "copy", EDIT: "edit", SAVE: "save", LOAD: "load", FIND: "find", GREP: "grep", TAGS: "tags",
|
||||||
|
CONTENT: "content", RECENT: "recent", SCRIPT: "script", MODULE: "module", SOURCE: "source", TARGET: "target", REPOS: "repos",
|
||||||
|
PATH: "path", FILE: "file", LINE: "line", SIZE: "size",
|
||||||
|
REPLACE: "replace", FROM: "from", TO: "to",
|
||||||
HTML: "html", CSS: "css", JS: "js", GO: "go", SH: "sh", CSV: "csv", JSON: "json",
|
HTML: "html", CSS: "css", JS: "js", GO: "go", SH: "sh", CSV: "csv", JSON: "json",
|
||||||
ZML: "zml", IML: "iml", TXT: "txt", PNG: "png", WEBM: "webm",
|
ZML: "zml", IML: "iml", TXT: "txt", PNG: "png", WEBM: "webm",
|
||||||
_CSS: ".css", _JS: ".js",
|
_CSS: ".css", _JS: ".js",
|
||||||
REPOS: "repos", REPLACE: "replace", FROM: "from", TO: "to",
|
|
||||||
SRC: "src/",
|
SRC: "src/",
|
||||||
}
|
}
|
||||||
var cli = {
|
var cli = {
|
||||||
PWD: "pwd", SYSTEM: "system", DAEMON: "daemon", ORDER: "order", BUILD: "build",
|
PWD: "pwd", SYSTEM: "system", DAEMON: "daemon", ORDER: "order", BUILD: "build",
|
||||||
BEGIN: "begin", START: "start", OPEN: "open", CLOSE: "close", STOP: "stop", END: "end", RESTART: "restart",
|
BEGIN: "begin", START: "start", OPEN: "open", CLOSE: "close", STOP: "stop", END: "end", RESTART: "restart",
|
||||||
COLOR: "color", WHITE: "white", BLACK: "black", RED: "red", GREEN: "green", BLUE: "blue",
|
COLOR: "color", BLACK: "black", WHITE: "white", BLUE: "blue", RED: "red", GRAY: "gray", CYAN: "cyan", GREEN: "green", PURPLE: "purple", YELLOW: "yellow",
|
||||||
YELLOW: "yellow", CYAN: "cyan", PURPLE: "purple", MAGENTA: "magenta", GLASS: "transparent",
|
MAGENTA: "magenta", SILVER: "silver", ALICEBLUE: "aliceblue", TRANSPARENT: "transparent",
|
||||||
GRAY: "gray", ALICEBLUE: "aliceblue",
|
|
||||||
MAKE: "make", MAIN: "main", EXEC: "exec", DONE: "done", COST: "cost", FROM: "from", CLEAR: "clear",
|
MAKE: "make", MAIN: "main", EXEC: "exec", DONE: "done", COST: "cost", FROM: "from", CLEAR: "clear",
|
||||||
}
|
}
|
||||||
var log = {
|
var log = {
|
||||||
@ -160,6 +152,7 @@ var chat = {
|
|||||||
"/plugin/table.js",
|
"/plugin/table.js",
|
||||||
"/plugin/input/key.js",
|
"/plugin/input/key.js",
|
||||||
"/plugin/input/date.js",
|
"/plugin/input/date.js",
|
||||||
|
"/plugin/story/json.js",
|
||||||
"/plugin/story/spide.js",
|
"/plugin/story/spide.js",
|
||||||
"/plugin/story/trend.js",
|
"/plugin/story/trend.js",
|
||||||
"/plugin/local/code/xterm.js",
|
"/plugin/local/code/xterm.js",
|
||||||
@ -176,11 +169,11 @@ var chat = {
|
|||||||
ONENGINE: "onengine", ONDAEMON: "ondaemon", ONAPPEND: "onappend", ONLAYOUT: "onlayout", ONMOTION: "onmotion", ONKEYMAP: "onkeymap",
|
ONENGINE: "onengine", ONDAEMON: "ondaemon", ONAPPEND: "onappend", ONLAYOUT: "onlayout", ONMOTION: "onmotion", ONKEYMAP: "onkeymap",
|
||||||
ONIMPORT: "onimport", ONSYNTAX: "onsyntax", ONFIGURE: "onfigure", ONACTION: "onaction", ONDETAIL: "ondetail", ONEXPORT: "onexport", ONPLUGIN: "onplugin",
|
ONIMPORT: "onimport", ONSYNTAX: "onsyntax", ONFIGURE: "onfigure", ONACTION: "onaction", ONDETAIL: "ondetail", ONEXPORT: "onexport", ONPLUGIN: "onplugin",
|
||||||
|
|
||||||
ONMAIN: "onmain", ONLOGIN: "onlogin", ONREMOTE: "onremote", ONSEARCH: "onsearch",
|
ONSIZE: "onsize", ONMAIN: "onmain", ONLOGIN: "onlogin", ONREMOTE: "onremote", ONSEARCH: "onsearch",
|
||||||
ONSIZE: "onsize", ONTOAST: "ontoast", ONDEBUG: "ondebug", ONSHARE: "onshare", ONPRINT: "onprint",
|
|
||||||
ONRESIZE: "onresize", ONKEYUP: "onkeyup", ONKEYDOWN: "onkeydown", ONMOUSEENTER: "onmouseenter", ORIENTATIONCHANGE: "orientationchange",
|
ONRESIZE: "onresize", ONKEYUP: "onkeyup", ONKEYDOWN: "onkeydown", ONMOUSEENTER: "onmouseenter", ORIENTATIONCHANGE: "orientationchange",
|
||||||
ONSTORM_SELECT: "onstorm_select", ONACTION_NOTOOL: "onaction_notool", ONACTION_TOUCH: "onaction_touch", ONACTION_CMD: "onaction_cmd",
|
ONSTORM_SELECT: "onstorm_select", ONACTION_NOTOOL: "onaction_notool", ONACTION_TOUCH: "onaction_touch", ONACTION_CMD: "onaction_cmd",
|
||||||
ONOPENSEARCH: "onopensearch", ONSEARCH_FOCUS: "onsearch_focus", ONCOMMAND_FOCUS: "oncommand_focus",
|
ONOPENSEARCH: "onopensearch", ONSEARCH_FOCUS: "onsearch_focus", ONCOMMAND_FOCUS: "oncommand_focus",
|
||||||
|
ONTOAST: "ontoast", ONDEBUG: "ondebug", ONSHARE: "onshare", ONPRINT: "onprint",
|
||||||
|
|
||||||
_INIT: "_init", _TRANS: "_trans", _STYLE: "_style", _ENGINE: "_engine", _SEARCH: "_search", _OUTPUTS_CURRENT: "_outputs.-1", _NAMES: "_names", _TOAST: "_toast",
|
_INIT: "_init", _TRANS: "_trans", _STYLE: "_style", _ENGINE: "_engine", _SEARCH: "_search", _OUTPUTS_CURRENT: "_outputs.-1", _NAMES: "_names", _TOAST: "_toast",
|
||||||
}
|
}
|
||||||
@ -195,22 +188,11 @@ var mall = {
|
|||||||
ASSET: "asset", SALARY: "salary",
|
ASSET: "asset", SALARY: "salary",
|
||||||
}
|
}
|
||||||
|
|
||||||
var svg = {
|
|
||||||
GROUP: "group", PID: "pid", GRID: "grid",
|
|
||||||
FIGURE: "figure", DATA: "data", SHIP: "ship", TRANS: "trans",
|
|
||||||
GO: "go",
|
|
||||||
SHAPE: "shape", TEXT: "text", RECT: "rect", LINE: "line", CIRCLE: "circle", ELLIPSE: "ellipse", BLOCK: "block",
|
|
||||||
STROKE_WIDTH: "stroke-width", STROKE: "stroke", FILL: "fill", FONT_SIZE: "font-size", FONT_FAMILY: "font-family", MONOSPACE: "monospace", TEXT_ANCHOR: "text-anchor",
|
|
||||||
G: "g", X: "x", Y: "y", R: "r", RX: "rx", RY: "ry", CX: "cx", CY: "cy", X1: "x1", Y1: "y1", X2: "x2", Y2: "y2",
|
|
||||||
PATH: "path", PATH2V: "path2v", PATH2H: "path2h",
|
|
||||||
M: "M", Q: "Q", T: "T",
|
|
||||||
TEXT_LENGTH: "textLength",
|
|
||||||
}
|
|
||||||
var html = {PLUGIN_MARGIN: 10, ACTION_HEIGHT: 31, ACTION_MARGIN: 200,
|
var html = {PLUGIN_MARGIN: 10, ACTION_HEIGHT: 31, ACTION_MARGIN: 200,
|
||||||
FIELDSET: "fieldset", LEGEND: "legend", OPTION: "option", ACTION: "action", OUTPUT: "output", STATUS: "status",
|
FIELDSET: "fieldset", LEGEND: "legend", OPTION: "option", ACTION: "action", OUTPUT: "output", STATUS: "status",
|
||||||
FORM_OPTION: "form.option", DIV_ACTION: "div.action", DIV_OUTPUT: "div.output", DIV_STATUS: "div.status",
|
FORM_OPTION: "form.option", DIV_ACTION: "div.action", DIV_OUTPUT: "div.output", DIV_STATUS: "div.status",
|
||||||
FIELDSET_PANEL: "fieldset.panel", FIELDSET_PLUGIN: "fieldset.plugin", FIELDSET_STORY: "fieldset.story", FIELDSET_INPUT: "fieldset.input", FIELDSET_FLOAT: "fieldset.float",
|
FIELDSET_PANEL: "fieldset.panel", FIELDSET_PLUGIN: "fieldset.plugin", FIELDSET_STORY: "fieldset.story", FIELDSET_INPUT: "fieldset.input", FIELDSET_PLUG: "fieldset.plug",
|
||||||
FIELDSET_HEAD: "fieldset.head", FIELDSET_FOOT: "fieldset.foot", FIELDSET_LEFT: "fieldset.left", FIELDSET_MAIN: "fieldset.main", FIELDSET_PLUG: "fieldset.plug",
|
FIELDSET_HEAD: "fieldset.head", FIELDSET_FOOT: "fieldset.foot", FIELDSET_LEFT: "fieldset.left", FIELDSET_MAIN: "fieldset.main", FIELDSET_FLOAT: "fieldset.float",
|
||||||
OPTION_ARGS: "select.args,input.args,textarea.args", INPUT_ARGS: "input.args,textarea.args", INPUT_BUTTON: "input[type=button]", INPUT_FILE: "input[type=file]",
|
OPTION_ARGS: "select.args,input.args,textarea.args", INPUT_ARGS: "input.args,textarea.args", INPUT_BUTTON: "input[type=button]", INPUT_FILE: "input[type=file]",
|
||||||
BODY: "body", FORM: "form", SELECT: "select", INPUT: "input", TEXT: "text", FILE: "file", BUTTON: "button", TEXTAREA: "textarea",
|
BODY: "body", FORM: "form", SELECT: "select", INPUT: "input", TEXT: "text", FILE: "file", BUTTON: "button", TEXTAREA: "textarea",
|
||||||
CLICK: "click", CANCEL: "cancel", SUBMIT: "submit", UPLOAD: "upload", USERNAME: "username", PASSWORD: "password",
|
CLICK: "click", CANCEL: "cancel", SUBMIT: "submit", UPLOAD: "upload", USERNAME: "username", PASSWORD: "password",
|
||||||
@ -222,32 +204,38 @@ var html = {PLUGIN_MARGIN: 10, ACTION_HEIGHT: 31, ACTION_MARGIN: 200,
|
|||||||
CLASS: "class", DISPLAY: "display", BLOCK: "block", NONE: "none", OVERFLOW: "overflow", HIDDEN: "hidden", SCROLL: "scroll", FLOAT: "float", CLEAR: "clear", BOTH: "both",
|
CLASS: "class", DISPLAY: "display", BLOCK: "block", NONE: "none", OVERFLOW: "overflow", HIDDEN: "hidden", SCROLL: "scroll", FLOAT: "float", CLEAR: "clear", BOTH: "both",
|
||||||
PADDING: "padding", BORDER: "border", MARGIN: "margin", MARGIN_TOP: "margin-top", MARGIN_X: "margin-x", MARGIN_Y: "margin-y",
|
PADDING: "padding", BORDER: "border", MARGIN: "margin", MARGIN_TOP: "margin-top", MARGIN_X: "margin-x", MARGIN_Y: "margin-y",
|
||||||
HEIGHT: "height", WIDTH: "width", MIN_HEIGHT: "min-height", MAX_HEIGHT: "max-height", MIN_WIDTH: "min-width", MAX_WIDTH: "max-width", LEFT: "left", TOP: "top", RIGHT: "right", BOTTOM: "bottom",
|
HEIGHT: "height", WIDTH: "width", MIN_HEIGHT: "min-height", MAX_HEIGHT: "max-height", MIN_WIDTH: "min-width", MAX_WIDTH: "max-width", LEFT: "left", TOP: "top", RIGHT: "right", BOTTOM: "bottom",
|
||||||
BACKGROUND_COLOR: "background-color", COLOR: "color", OPACITY: "opacity", TOGGLE: "toggle", SPEED: "speed", SIZE: "size",
|
BACKGROUND_COLOR: "background-color", COLOR: "color", SIZE: "size", OPACITY: "opacity",
|
||||||
HOVER: "hover", HOVER_SELECT: "hover,select",
|
FLOW: "flow", FLEX: "flex", LIGHT: "light", DARK: "dark",
|
||||||
LIGHT: "light", DARK: "dark",
|
FILTER: "filter", TOGGLE: "toggle", EXPAND: "expand", SPEED: "speed", HOVER: "hover", HOVER_SELECT: "hover,select",
|
||||||
|
|
||||||
PANEL: "panel",
|
PAGE: "page", TABS: "tabs", MENU: "menu", NODE: "node", PLUG: "plug",
|
||||||
FILTER: "filter",
|
ZONE: "zone", LIST: "list", ITEM: "item", NAME: "name", ICON: "icon", VIEW: "view",
|
||||||
VIEW: "view",
|
|
||||||
PLUG: "plug",
|
|
||||||
DIV_PLUG: "div.plug",
|
|
||||||
FLOW: "flow", FLEX: "flex",
|
|
||||||
PAGE: "page", TABS: "tabs", MENU: "menu", NODE: "node",
|
|
||||||
ZONE: "zone", LIST: "list", ITEM: "item", NAME: "name", ICON: "icon",
|
|
||||||
HEAD: "head", LEFT: "left", MAIN: "main", FOOT: "foot", AUTO: "auto", SHOW: "show", HIDE: "hide",
|
HEAD: "head", LEFT: "left", MAIN: "main", FOOT: "foot", AUTO: "auto", SHOW: "show", HIDE: "hide",
|
||||||
PLUGIN: "plugin", LAYOUT: "layout", PROJECT: "project", DISPLAY: "display", PROFILE: "profile", CONTENT: "content",
|
PLUGIN: "plugin", LAYOUT: "layout", PROJECT: "project", DISPLAY: "display", PROFILE: "profile", CONTENT: "content",
|
||||||
|
|
||||||
DIV_PAGE: "div.page", DIV_TABS: "div.tabs", DIV_PATH: "div.path", DIV_CODE: "div.code",
|
DIV_PAGE: "div.page", DIV_TABS: "div.tabs", DIV_PATH: "div.path", DIV_CODE: "div.code", DIV_PLUG: "div.plug",
|
||||||
DIV_ZONE: "div.zone", DIV_LIST: "div.list", DIV_ITEM: "div.item", DIV_NAME: "div.name",
|
DIV_ZONE: "div.zone", DIV_LIST: "div.list", DIV_ITEM: "div.item", DIV_NAME: "div.name", SPAN_ITEM: "span.item", SPAN_ICON: "span.icon",
|
||||||
DIV_CONTENT: "div.content", TABLE_CONTENT: "table.content", TABLE_LAYOUT: "table.layout", DIV_TOGGLE: "div.toggle",
|
DIV_CONTENT: "div.content", TABLE_CONTENT: "table.content", TABLE_LAYOUT: "table.layout", DIV_TOGGLE: "div.toggle",
|
||||||
DIV_LAYOUT_HEAD: "div.layout.head", DIV_LAYOUT_FOOT: "div.layout.foot", DIV_LAYOUT_LEFT: "div.layout.left",
|
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",
|
DIV_FLOAT: "div.float", DIV_TOAST: "div.toast", DIV_CARTE: "div.carte",
|
||||||
|
DIV_EXPAND: "div.expand",
|
||||||
}
|
}
|
||||||
var lang = {
|
var lang = {
|
||||||
SPACE: "space", UNDEFINED: "undefined", STRING: "string", NUMBER: "number", BOOLEAN: "boolean", FUNCTION: "function", OBJECT: "object", ARRAY: "array",
|
SPACE: "space", UNDEFINED: "undefined", STRING: "string", NUMBER: "number", BOOLEAN: "boolean", FUNCTION: "function", OBJECT: "object", ARRAY: "array",
|
||||||
META: "Meta", ALT: "Alt", CONTROL: "Control", SHIFT: "Shift", TAB: "Tab", ESCAPE: "Escape", ENTER: "Enter",
|
META: "Meta", ALT: "Alt", CONTROL: "Control", SHIFT: "Shift", TAB: "Tab", ESCAPE: "Escape", ENTER: "Enter",
|
||||||
CMD: "Cmd", CTRL: "Ctrl", SPACE: "Space", BACKSPACE: "Backspace", ESC: "Esc", PS: "/",
|
CMD: "Cmd", CTRL: "Ctrl", SPACE: "Space", BACKSPACE: "Backspace", ESC: "Esc", PS: "/",
|
||||||
}
|
}
|
||||||
|
var svg = {
|
||||||
|
GROUP: "group", PID: "pid", GRID: "grid",
|
||||||
|
FIGURE: "figure", DATA: "data", SHIP: "ship", TRANS: "trans",
|
||||||
|
GO: "go",
|
||||||
|
SHAPE: "shape", TEXT: "text", RECT: "rect", LINE: "line", CIRCLE: "circle", ELLIPSE: "ellipse", BLOCK: "block",
|
||||||
|
STROKE_WIDTH: "stroke-width", STROKE: "stroke", FILL: "fill", FONT_SIZE: "font-size", FONT_FAMILY: "font-family", MONOSPACE: "monospace", TEXT_ANCHOR: "text-anchor",
|
||||||
|
G: "g", X: "x", Y: "y", R: "r", RX: "rx", RY: "ry", CX: "cx", CY: "cy", X1: "x1", Y1: "y1", X2: "x2", Y2: "y2",
|
||||||
|
PATH: "path", PATH2V: "path2v", PATH2H: "path2h",
|
||||||
|
M: "M", Q: "Q", T: "T",
|
||||||
|
TEXT_LENGTH: "textLength",
|
||||||
|
}
|
||||||
|
|
||||||
function shy(help, meta, list, cb) { var arg = arguments, i = 0; function next(type) {
|
function shy(help, meta, list, cb) { var arg = arguments, i = 0; function next(type) {
|
||||||
if (type == lang.OBJECT) { if (typeof arg[i] == lang.OBJECT && arg[i].length == undefined) { return arg[i++] }
|
if (type == lang.OBJECT) { if (typeof arg[i] == lang.OBJECT && arg[i].length == undefined) { return arg[i++] }
|
||||||
@ -262,34 +250,22 @@ var Volcanos = shy({version: window._version||"", iceberg: "/chat/", volcano: "/
|
|||||||
meta.iceberg = Config.iceberg||meta.iceberg, meta.libs = Config.libs||chat.libs, panels = Config.panels||chat.panel_list, delete(Config.panels)
|
meta.iceberg = Config.iceberg||meta.iceberg, meta.libs = Config.libs||chat.libs, 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.plugin||chat.plugin_list)
|
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.plugin||chat.plugin_list)
|
||||||
cb = can||function(can) { can.onengine._init(can, can.Conf(Config), panels, Config._init||meta._init, can._target) }
|
cb = can||function(can) { can.onengine._init(can, can.Conf(Config), panels, Config._init||meta._init, can._target) }
|
||||||
can = Config, can._follow = name, can._target = Config.target||meta.target, can._height = Config.height||meta._height, can._width = Config.width||meta._width
|
can = Config, can._path = location.href, 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({_path: _can_path, _name: name, _load: function(name, cbs) { var cache = meta.cache[name]||[]
|
can = kit.proto(can||{}, kit.proto({_path: _can_path, _name: name, _load: function(name, cbs) { var cache = meta.cache[name]||[]
|
||||||
for (list.reverse(); list.length > 0; list) { var sub = list.pop(); sub != can && cache.push(sub), sub._path = name } meta.cache[name] = cache
|
for (list.reverse(); list.length > 0; list) { var sub = list.pop(); sub != can && cache.push(sub), sub._path = name } meta.cache[name] = cache
|
||||||
cache.forEach(function(sub) { var name = sub._name; if (typeof cbs == lang.FUNCTION && cbs(can, name, sub)) { return }
|
cache.forEach(function(sub) { var name = sub._name; if (typeof cbs == lang.FUNCTION && cbs(can, name, sub)) { return }
|
||||||
can[name] = can[name]||{}; for (var k in sub) {
|
can[name] = can[name]||{}; for (var k in sub) { can[name].hasOwnProperty(k) || sub.hasOwnProperty(k) && (can[name][k] = sub[k])
|
||||||
name == chat.ONIMPORT && k == chat._INIT && (can[name]._last_init = sub[k])
|
name == chat.ONIMPORT && k == chat._INIT && (can[name]._last_init = sub[k])
|
||||||
can[name].hasOwnProperty(k) || sub.hasOwnProperty(k) && (can[name][k] = sub[k])
|
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
requireModules: function(libs, cb, cbs) {
|
|
||||||
for (var i = 0; i < libs.length; i++) { if (libs[i].indexOf(ice.PS) == 0 || libs[i].indexOf(ice.HTTP) == 0) { continue }
|
|
||||||
if (libs[i].indexOf(nfs._CSS) == -1 && libs[i].indexOf(nfs._JS) == -1) { libs[i] = libs[i]+"/lib/"+libs[i]+nfs._JS }
|
|
||||||
libs[i] = "/require/node_modules/"+libs[i]
|
|
||||||
} can.require(libs, cb, cbs)
|
|
||||||
},
|
|
||||||
requireDraw: function(cb) { can.page.ClassList.add(can, can._fields, "draw")
|
|
||||||
can.require(["/plugin/local/wiki/draw.js", "/plugin/local/wiki/draw/path.js"], function() {
|
|
||||||
can.onmotion.clear(can), can.onimport._show(can, can._msg), cb()
|
|
||||||
})
|
|
||||||
},
|
|
||||||
require: function(libs, cb, cbs) {
|
require: function(libs, cb, cbs) {
|
||||||
if (!libs || libs.length == 0) { return typeof cb == lang.FUNCTION && setTimeout(function() { cb(can) }, 10) }
|
if (!libs || libs.length == 0) { return typeof cb == lang.FUNCTION && setTimeout(function() { cb(can) }, 10) }
|
||||||
if (libs[0] == undefined) { return can.require(libs.slice(1), cb, cbs) }
|
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] == "") { libs[0] = can._path.replace(nfs._JS, nfs._CSS) }
|
||||||
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] }
|
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("?")[0]).toLowerCase(); meta.debug == true && (name += "?_="+Date.now())
|
var name = (libs[0].indexOf(ice.HTTP) == 0? libs[0]: libs[0].split("?")[0]).toLowerCase()
|
||||||
function next() { can._load(name, cbs), can.require(libs.slice(1), cb, cbs) }
|
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]? next(): (_can_path = libs[0], meta._load(name, next))
|
||||||
},
|
},
|
||||||
@ -300,8 +276,7 @@ var Volcanos = shy({version: window._version||"", iceberg: "/chat/", volcano: "/
|
|||||||
can.base.isFunc(item.Option)? can.core.List(item.Option(), function(key) {
|
can.base.isFunc(item.Option)? can.core.List(item.Option(), function(key) {
|
||||||
key.indexOf("_") == 0 || key.indexOf("user.") == 0 || set(key, item.Option(key))
|
key.indexOf("_") == 0 || key.indexOf("user.") == 0 || set(key, item.Option(key))
|
||||||
}): can.core.Item(can.base.isFunc(item)? item(): item, set)
|
}): can.core.Item(can.base.isFunc(item)? item(): item, set)
|
||||||
});
|
}); set(ice.MSG_HEIGHT, can.ConfHeight()), set(ice.MSG_WIDTH, can.ConfWidth()), set(ice.MSG_MODE, can.Mode())
|
||||||
set(ice.MSG_MODE, can.Mode()), set(ice.MSG_HEIGHT, can.ConfHeight()), set(ice.MSG_WIDTH, can.ConfWidth())
|
|
||||||
return msg
|
return msg
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -309,8 +284,7 @@ var Volcanos = shy({version: window._version||"", iceberg: "/chat/", volcano: "/
|
|||||||
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 (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)) }
|
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)) })
|
||||||
}
|
} can.runAction(event, cmds[1], cmds.slice(2), cb, true)
|
||||||
can.runAction(event, cmds[1], cmds.slice(2), cb, true)
|
|
||||||
},
|
},
|
||||||
runActionCommand: function(event, index, args, cb) { can.request(event)._caller()
|
runActionCommand: function(event, index, args, cb) { can.request(event)._caller()
|
||||||
can.runAction(event, ice.RUN, can.misc.concat(can, [index], args), cb, true)
|
can.runAction(event, ice.RUN, can.misc.concat(can, [index], args), cb, true)
|
||||||
@ -337,7 +311,6 @@ var Volcanos = shy({version: window._version||"", iceberg: "/chat/", volcano: "/
|
|||||||
|
|
||||||
isStoryType: function(value) { return can.page.ClassList.has(can, can._fields, chat.STORY) },
|
isStoryType: function(value) { return can.page.ClassList.has(can, can._fields, chat.STORY) },
|
||||||
isSimpleMode: function(value) { return can.Mode() == chat.SIMPLE },
|
isSimpleMode: function(value) { return can.Mode() == chat.SIMPLE },
|
||||||
isOutputMode: function(value) { return can.Mode() == chat.OUTPUT },
|
|
||||||
isFloatMode: function(value) { return can.Mode() == chat.FLOAT },
|
isFloatMode: function(value) { return can.Mode() == chat.FLOAT },
|
||||||
isFullMode: function(value) { return can.Mode() == chat.FULL },
|
isFullMode: function(value) { return can.Mode() == chat.FULL },
|
||||||
isCmdMode: function(value) { return can.Mode() == chat.CMD },
|
isCmdMode: function(value) { return can.Mode() == chat.CMD },
|
||||||
@ -361,17 +334,16 @@ try { if (typeof(window) == lang.OBJECT) { // chrome
|
|||||||
case nfs.CSS: var item = document.createElement(mdb.LINK); item.href = url+Volcanos.meta.version, item.rel = "stylesheet", item.onload = cb, document.head.appendChild(item); break
|
case nfs.CSS: var item = document.createElement(mdb.LINK); item.href = url+Volcanos.meta.version, item.rel = "stylesheet", item.onload = cb, document.head.appendChild(item); break
|
||||||
case nfs.JS: var item = document.createElement(nfs.SCRIPT); item.src = url+Volcanos.meta.version, item.onerror = cb, item.onload = cb, document.body.appendChild(item); break
|
case nfs.JS: var item = document.createElement(nfs.SCRIPT); item.src = url+Volcanos.meta.version, item.onerror = cb, item.onload = cb, document.body.appendChild(item); break
|
||||||
} }
|
} }
|
||||||
Volcanos.meta._init = function(can) {
|
Volcanos.meta._init = function(can) { var last = can.page.width() < can.page.height(); window.onresize = function(event) { can.misc.Event(event, can, function(msg) {
|
||||||
var last = can.page.width() < can.page.height(); window.onresize = function(event) { can.misc.Event(event, can, function(msg) {
|
if (can.user.isMobile && last === can.page.width() < can.page.height()) { return } last = can.page.width() < can.page.height()
|
||||||
if (can.user.isMobile && last === can.page.width() < can.page.height()) { return } last = can.page.width() < can.page.height()
|
can.onengine.signal(can, chat.ONRESIZE, can.request(event, kit.Dict(html.HEIGHT, window.innerHeight, html.WIDTH, window.innerWidth)))
|
||||||
can.onengine.signal(can, chat.ONRESIZE, can.request(event, kit.Dict(html.HEIGHT, window.innerHeight, html.WIDTH, window.innerWidth)))
|
}) } }
|
||||||
}) }
|
|
||||||
}
|
|
||||||
} else { // nodejs
|
} else { // nodejs
|
||||||
global.kit = kit, global.ice = ice
|
global.kit = kit, global.ice = ice
|
||||||
global.ctx = ctx, global.cli = cli, global.aaa = aaa, global.web = web
|
global.ctx = ctx, global.mdb = mdb, global.web = web, global.aaa = aaa
|
||||||
global.mdb = mdb, global.ssh = ssh, global.nfs = nfs, global.tcp = tcp
|
global.lex = lex, global.yac = yac, global.ssh = ssh, global.gdb = gdb
|
||||||
|
global.tcp = tcp, global.nfs = nfs, global.cli = cli, global.log = log
|
||||||
global.code = code, global.wiki = wiki, global.chat = chat, global.team = team, global.mall = mall
|
global.code = code, global.wiki = wiki, global.chat = chat, global.team = team, global.mall = mall
|
||||||
global.svg = svg, global.html = html, global.lang = lang
|
global.html = html, global.lang = lang, global.svg = svg
|
||||||
global.shy = shy, global.Volcanos = Volcanos
|
global.shy = shy, global.Volcanos = Volcanos
|
||||||
} } catch (e) { console.log(e) }
|
} } catch (e) { console.log(e) }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user