mirror of
https://shylinux.com/x/volcanos
synced 2025-04-25 08:48:06 +08:00
opt favor
This commit is contained in:
parent
15837b45f6
commit
a8ab134d8e
8
const.js
8
const.js
@ -38,6 +38,7 @@ var ice = {
|
||||
MSG_PREFIX: "_prefix",
|
||||
MSG_METHOD: "_method",
|
||||
|
||||
MSG_BG: "sess.bg", MSG_FG: "sess.fg",
|
||||
MSG_USERNICK: "user.nick", MSG_USERNAME: "user.name", MSG_USERROLE: "user.role", MSG_LANGUAGE: "user.lang",
|
||||
MSG_MODE: "sess.mode", MSG_THEME: "sess.theme", MSG_TITLE: "sess.title", MSG_RIVER: "sess.river", MSG_STORM: "sess.storm",
|
||||
MSG_DAEMON: "sess.daemon", LOG_DISABLE: "log.disable", LOG_TRACEID: "log.id",
|
||||
@ -77,8 +78,9 @@ var web = {CHAT: "chat", PORTAL: "portal", STUDIO: "studio", SERVICE: "service",
|
||||
SHARE_CACHE: "/share/cache/", SHARE_LOCAL: "/share/local/",
|
||||
AT: ice.AT, QS: ice.QS,
|
||||
|
||||
DRAW: "draw", PLAY: "play", CLEAR: "clear", REFRESH: "refresh", RESIZE: "resize", FILTER: "filter",
|
||||
CANCEL: "cancel", SUBMIT: "submit", UPLOAD: "upload", DOWNLOAD: "download", TOIMAGE: "toimage", CONFIRM: "confirm",
|
||||
DRAW: "draw", PLAY: "play", CLEAR: "clear", RESIZE: "resize", FILTER: "filter",
|
||||
CANCEL: "cancel", SUBMIT: "submit", CONFIRM: "confirm", REFRESH: "refresh",
|
||||
UPLOAD: "upload", DOWNLOAD: "download", PREVIEW: "preview", TOIMAGE: "toimage",
|
||||
|
||||
CHAT_SSO: "/chat/sso/",
|
||||
CHAT_POD: "/chat/pod/",
|
||||
@ -267,7 +269,7 @@ var html = {RIVER_MARGIN: 80, PLUGIN_MARGIN: 10, PLUGIN_PADDING: 10, ACTION_MARG
|
||||
|
||||
H1: "h1", H2: "h2", H3: "h3", UL: "ul", OL: "ol", LI: "li", BR: "br", HR: "hr",
|
||||
A: "a", SPAN: "span", CODE: "code", DIV: "div",
|
||||
SVG: "svg", IMG: "img", VIDEO: "video", AUDIO: "audio", CANVAS: "canvas", IFRAME: "iframe",
|
||||
SVG: "svg", IMG: "img", IMAGE: "image", VIDEO: "video", AUDIO: "audio", CANVAS: "canvas", IFRAME: "iframe",
|
||||
WSS: "wss", WEBVIEW: "webview", CHROME: "chrome", MOBILE: "mobile", LANDSCAPE: "landscape",
|
||||
BODY: "body", FORM: "form", LABEL: "label", TITLE: "title", INNER: "inner", SPACE: "space", CLICK: "click",
|
||||
SELECT: "select", INPUT: "input", TEXT: "text", FILE: "file", TEXTAREA: "textarea", BUTTON: "button",
|
||||
|
31
frame.js
31
frame.js
@ -24,7 +24,7 @@ Volcanos(chat.ONENGINE, {_init: function(can, meta, list, cb, target) {
|
||||
var toast, _toast = msg.Option(chat._TOAST); if (_toast) { can.onmotion.delay(can, function() { if (msg._can && msg._can._toast) { return } toast = toast||can.user.toastProcess(msg._can, _toast) }, 500) }
|
||||
if (can.base.isUndefined(msg[ice.MSG_DAEMON])) { 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)) }
|
||||
} can.base.isIn(sub.ConfIndex(), "qrcode", "cli.qrcode") && can.page.exportValue(sub, msg)
|
||||
} can.page.exportValue(sub, msg)
|
||||
if (!can.misc.CookieSessid(can) && can.user.info.sessid) { msg.Option(ice.MSG_SESSID, can.user.info.sessid) }
|
||||
msg.OptionDefault(ice.MSG_THEME, can.getHeaderTheme())
|
||||
var names = msg.Option(chat._NAMES)||panel._names||((can.Conf("iceberg")||Volcanos.meta.iceberg)+"/chat/"+panel._name+"/")
|
||||
@ -124,7 +124,8 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) {
|
||||
return can.page.SelectArgs(can, option, key, value)[0] },
|
||||
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 },
|
||||
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 && cmds[0] != ctx.ACTION && (cmds = can.base.trim(cmds))
|
||||
Input: function(cmds, save, opts) { cmds = cmds && cmds.length > 0? cmds: can.page.SelectArgs(sub), cmds && cmds[0] != ctx.ACTION && (cmds = can.base.trim(cmds))
|
||||
cmds._opts = opts
|
||||
return !save || cmds[0] == ctx.ACTION || can.base.Eq(sub._history[sub._history.length-1], cmds) || sub._history.push(cmds), cmds
|
||||
},
|
||||
Clone: function() { meta.args = can.page.SelectArgs(can), can.onappend._init(can, meta, list, function(sub) { can.base.isFunc(cb) && cb(sub, true), can.onmotion.delay(can, sub.Focus) }, target) },
|
||||
@ -171,8 +172,12 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) {
|
||||
}, [item.display, chat.PLUGIN_INPUT_JS], function(sub) { sub.Conf(item)
|
||||
if (item.type == html.TEXT) { can.page.Append(can, sub._target.parentNode, [{text: [sub._target.value, html.SPAN, mdb.VALUE]}]) }
|
||||
if (item.type == html.BUTTON && can.base.isIn(item.name, mdb.CREATE, mdb.INSERT, mdb.PRUNES, mdb.PRUNE)) {
|
||||
can.onappend.icons(can, sub._target, item.name)
|
||||
} item.type == html.BUTTON && can.onappend.icons(can, sub._target, can.Conf(["_icons", item.name]), item.name)
|
||||
can.onappend.icons(can, sub._target, item.name, function(event) {
|
||||
can.Update(event, [ctx.ACTION, item.name].concat(can.page.SelectArgs(sub)))
|
||||
})
|
||||
} item.type == html.BUTTON && can.onappend.icons(can, sub._target, can.Conf(["_icons", item.name]), function(event) {
|
||||
can.Update(event, [ctx.ACTION, item.name].concat(can.page.SelectArgs(sub)))
|
||||
})
|
||||
sub.run = function(event, cmds, cb, silent) { var msg = can.requestAction(event, item.name)._caller()
|
||||
msg.RunAction(event, sub, cmds) || msg.RunAction(event, can.sub, cmds) || can.Update(event, can.Input(cmds, !silent), cb, silent)
|
||||
}, can._inputs = can._inputs||{}, can._inputs[item.name] = sub, sub.sup = can
|
||||
@ -215,6 +220,7 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) {
|
||||
}): can.core.CallFunc(action, {sup: meta.can, can: can, msg: can.request(event), arg: cmds.slice(2), cb: cb})
|
||||
} return can.user.input(event, can, meta.feature[cmds[1]], function(args) { can.Update(can.request(event, {_handle: ice.TRUE}, msg, can.Option()), cmds.slice(0, 2).concat(args), cb) })
|
||||
}
|
||||
var p = can._history[can._history.length-1]; p && p._opts && can.request(event, p._opts)
|
||||
return can.onengine._plugin(event, can, msg, can, cmds, cb) || can.run(event, cmds, function(msg) { if (can.base.isFunc(cb)) { return cb(msg) } if (silent) { return }
|
||||
var _can = can._fields? can.sup: can; if (_can == (msg._can._fields? msg._can.sup: msg._can)) { if (can.core.CallFunc([_can, chat.ONIMPORT, ice.MSG_PROCESS], {can: _can, msg: msg})) { return } }
|
||||
if (cmds && cmds[0] == ctx.ACTION) { if (can.base.isIn(cmds[1], mdb.CREATE, mdb.INSERT, mdb.PRUNES, mdb.EXPORT, mdb.IMPORT, "exports", "imports", nfs.TRASH) || msg.Length() == 0 && !msg.Result()) { return can.user.toastSuccess(can, cmds[1]), can.Update() } }
|
||||
@ -268,7 +274,7 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) {
|
||||
field: function(can, type, item, target) { type = type||html.STORY, item = item||{}
|
||||
var name = can.core.Split(item.nick||item.name||"").pop()||""; can.base.isIn(name,
|
||||
tcp.SERVER, tcp.CLIENT, web.STUDIO, web.SERVICE, mdb.SEARCH,
|
||||
) && (name = (item.index||"").split(".").slice(-2).join(".")), name = can.core.Keys(item.space, name)
|
||||
) && (name = (item.index||"").split(".").slice(-2).join(".")), name = can.core.Keys(item._space||item.space, name)
|
||||
var title = item.title || (item.help && item.help != name && !can.user.isEnglish(can)? name+"("+can.core.Split(item.help)[0]+")": name)
|
||||
target = can.base.isFunc(target)? target(): target
|
||||
return can.page.Append(can, target||can._output, [{view: [type, html.FIELDSET], list: [{type: html.LEGEND, list: [item.icon && {icon: item.icon}, {text: title}]}, {view: [html.OPTION, html.FORM]}, html.ACTION, html.OUTPUT, html.STATUS]}])
|
||||
@ -358,8 +364,8 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) {
|
||||
return {text: [msg.IsDetail() && key == mdb.KEY? can.user.trans(can, value, null, html.INPUT): can.user.trans(can, value, null, html.VALUE), html.TD], onclick: function(event) { var target = event.target
|
||||
if (key == cli.QRCODE && can.page.tagis(event.target, html.IMG)) { can.user.opens(event.target.title) }
|
||||
if (can.page.tagis(target, html.INPUT) && target.type == html.BUTTON) { can.requestAction(event, target.name)
|
||||
meta && meta[target.name]? can.user.input(event, can, meta[target.name], function(args) { run(event, target.name, args) }): run(event, target.name)
|
||||
} else { can.sup.onimport.change(event, can.sup, key, event.target.innerText) || can.sup.onexport.record(can.sup, value, key, data, event) }
|
||||
meta && meta[target.name]? can.user.input(event, can, meta[target.name], function(args) { run(event, target.name, args) }, data): run(event, target.name)
|
||||
} else { can.sup.onimport.change(event, can.sup, key, event.target.innerText, null, data) || can.sup.onexport.record(can.sup, value, key, data, event) }
|
||||
}, ondblclick: function(event) { if (can.base.isIn(key, mdb.KEY, mdb.HASH, mdb.ID)) { return }
|
||||
var item = can.core.List(can.Conf([ctx.FEATURE, mdb.INSERT]), function(item) { if (item.name == key) { return item } })[0]||{name: key, value: value}
|
||||
item.run = function(event, cmds, cb) { can.run(can.request(event, data, can.Option()), cmds, cb, true) }
|
||||
@ -549,11 +555,18 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) {
|
||||
Volcanos(chat.ONLAYOUT, {_init: function(can, target) { target = target||can._root._target; var height = can.page.height(), width = can.page.width()
|
||||
can.page.SelectChild(can, target, can.page.Keys(html.FIELDSET_HEAD, html.FIELDSET_FOOT), function(field) { height -= field.offsetHeight })
|
||||
can.page.SelectChild(can, target, html.FIELDSET_LEFT, function(field) { can.user.isMobile || can.page.isDisplay(field) && (width -= field.offsetWidth)
|
||||
var h = height; can.page.SelectChild(can, field, html.DIV_ACTION, function(action) { h -= action.offsetHeight }), can.user.isMobile || (h -= 2*html.RIVER_MARGIN-html.ACTION_HEIGHT)
|
||||
var h = height; can.page.SelectChild(can, field, html.DIV_ACTION, function(action) {
|
||||
h -= action.offsetHeight
|
||||
if (action.offsetHeight == 0 && html.RIVER_MARGIN > 0) {
|
||||
h -= html.ACTION_HEIGHT
|
||||
}
|
||||
}), can.user.isMobile || (h -= 2*html.RIVER_MARGIN-html.ACTION_HEIGHT)
|
||||
can.page.SelectChild(can, field, html.DIV_OUTPUT, function(output) { can.page.styleHeight(can, output, h) })
|
||||
})
|
||||
can.page.SelectChild(can, target, html.FIELDSET_MAIN, function(field) {
|
||||
can.page.SelectChild(can, field, html.DIV_ACTION, function(action) { height -= action.offsetHeight })
|
||||
can.page.SelectChild(can, field, html.DIV_ACTION, function(action) {
|
||||
height -= action.offsetHeight
|
||||
})
|
||||
if (can.user.isMobile && can.user.isLandscape()) { return }
|
||||
can.page.SelectChild(can, field, html.DIV_OUTPUT, function(output) { can.page.styleHeight(can, output, height) })
|
||||
}), can.onengine.signal(can, chat.ONSIZE, can.request({}, {height: height, width: width}))
|
||||
|
88
index.css
88
index.css
@ -24,7 +24,10 @@ body {
|
||||
--code-comment:green; --code-keyword:royalblue;
|
||||
--code-function:lightgreen; --code-constant:gray; --code-string:orange;
|
||||
--code-object:silver; --code-datatype:lavender; --code-package:blue;
|
||||
--code-font-family:monospace;
|
||||
--code-font-family:monospace; --svg-font-family:var(--code-font-family);
|
||||
--body-font-family:sans-serif;
|
||||
--legend-font-family:var(--input-font-family); --status-font-family:var(--input-font-family);
|
||||
--input-font-family:cursive; --table-font-family:var(--body-font-family);
|
||||
|
||||
--body-font-size:16px; --legend-font-size:20px; --icon-font-size:20px;
|
||||
--code-font-size:14px; --code-line-height:20px; --code-tabs-height:48px;
|
||||
@ -38,6 +41,8 @@ body {
|
||||
--plugin-padding:10px; --button-padding:var(--plugin-padding); --input-padding:5px; --table-padding:var(--button-padding);
|
||||
--plugin-radius:var(--plugin-padding); --button-radius:var(--input-padding);
|
||||
}
|
||||
body { font-family:var(--body-font-family); }
|
||||
input { font-family:var(--input-font-family); }
|
||||
body.width1 { /* 320-640 手机竖屏 */
|
||||
--footer-height:60px; --input-width:80px;
|
||||
--river-margin:0; --plugin-margin:0; --button-margin:5px;
|
||||
@ -62,7 +67,7 @@ body.windows { --code-font-family:"Courier New"; }
|
||||
|
||||
/* element */
|
||||
* { tab-size:4; box-sizing:border-box; padding:0; border:0; margin:0; }
|
||||
legend { padding:0 var(--legend-padding); }
|
||||
legend { font-family:var(--legend-font-family); padding:0 var(--legend-padding); }
|
||||
select { padding:0 var(--button-padding); }
|
||||
input:not([type=file]) { padding:0 var(--button-padding); }
|
||||
input:not([type=button]) { padding:0 var(--input-padding); border-radius:0; outline:none; }
|
||||
@ -70,7 +75,7 @@ table.content.full { width:100%; }
|
||||
table.content thead { position:sticky; top:2px; }
|
||||
table.content tr.offline { color:var(--disable-fg-color); }
|
||||
table.content tr.offline a { color:var(--disable-fg-color); }
|
||||
table.content th { padding:var(--input-padding) var(--table-padding); box-shadow:var(--box-shadow); }
|
||||
table.content th { font-family:var(--input-font-family); padding:var(--input-padding) var(--table-padding); box-shadow:var(--box-shadow); }
|
||||
table.content td { padding:var(--table-padding); }
|
||||
table.content.detail td:first-child { width:var(--input-width); }
|
||||
table.content.action th:last-child { position:sticky; right:2px; }
|
||||
@ -178,19 +183,21 @@ body>div.input input[name=cancel]:hover { background-color:var(--danger-bg-color
|
||||
body>div.input div.action { padding:0 var(--table-padding); width:100%; position:sticky; bottom:0; flex-direction:row-reverse; }
|
||||
body>div.input div.action>div.item { margin-left:var(--button-margin); float:right; }
|
||||
body>div.input div.action>div.item>input[type=button] { width:112px; }
|
||||
body>div.input.login { box-shadow:unset; }
|
||||
body>div.input.login { box-shadow:unset; display:flex; flex-direction:column; align-items:center; }
|
||||
body>div.input.login>div.action { display:flex; align-items:center; justify-content:center; border-bottom:var(--box-border); }
|
||||
body>div.input.login>div.action>div.tabs { padding:var(--button-padding); }
|
||||
body>div.input.login>div.output { text-align:center; clear:both; }
|
||||
body>div.input.login>div.output { height:var(--qrcode-height); width:var(--iframe-height); overflow:hidden; }
|
||||
body>div.input.login>div.output>fieldset { box-shadow:none; }
|
||||
body>div.input.login>div.output>fieldset>div.output { background-color:transparent; }
|
||||
body>div.input.login>div.display>span.item { font-style:italic; word-break:break-all; padding-left:var(--button-padding); border-left:var(--notice-bg-color) solid 5px; }
|
||||
body>div.input.login>div.display { display:flex; flex-direction:column; align-items:center; padding-top:var(--button-padding); width:100%; }
|
||||
body>div.input.login>div.display>label { color:var(--disable-fg-color); font-size:var(--status-font-size); font-style:italic; }
|
||||
body>div.input.login>div.display>span.item { font-style:italic; word-break:break-all; padding-left:var(--button-padding); border-left:var(--notice-bg-color) solid 5px; margin:var(--button-margin) 0; }
|
||||
body>div.input.login>div.display div.sso { display:flex; justify-content:center; cursor:pointer; }
|
||||
body>div.input.login>div.display div.sso div.item { display:flex; align-items:center; justify-content:center; padding:var(--button-padding); }
|
||||
body>div.input.login>div.display div.sso div.item { display:flex; align-items:center; justify-content:center; padding:var(--input-padding); }
|
||||
body>div.input.login>div.display div.sso div.item:hover { background-color:var(--hover-bg-color); }
|
||||
body>div.input.login>div.display div.sso div.item>img { height:var(--action-height); width:var(--action-height); }
|
||||
body>div.input.login>div.display div.sso div.item>span { line-height:var(--action-height); padding:var(--table-padding); }
|
||||
body>div.input.login>div.display div.sso div.item>span { line-height:var(--action-height); padding:var(--input-padding); }
|
||||
body>div.input.simple td:first-child { display:none; }
|
||||
body>div.upload div.action input[type=file] { width:var(--river-width); }
|
||||
body>div.upload div.output { border:var(--box-notice); }
|
||||
@ -201,14 +208,14 @@ body>div.upload div.status div.size { text-align:center; }
|
||||
/* font */
|
||||
body { font-size:var(--body-font-size); }
|
||||
legend { font-size:var(--legend-font-size); line-height:30px; height:var(--action-height); }
|
||||
select, input { font-size:var(--body-font-size); height:var(--action-height); } input::placeholder, textarea::placeholder { font-style:italic; }
|
||||
select, input { font-size:var(--body-font-size); height:var(--action-height); } input::placeholder, textarea::placeholder { font-style:italic; color:var(--disable-fg-color); }
|
||||
textarea { font-size:var(--body-font-size); padding:var(--input-padding); height:var(--textarea-height); width:100%; outline:none; resize:vertical; }
|
||||
table.content, div.code, div.story[data-type=spark] { white-space:pre; margin:0; }
|
||||
div.story[data-type=spark] { padding:0 var(--table-padding); border-left:var(--notice-bg-color) solid 5px; }
|
||||
fieldset>div.action>div.tabs { font-style:italic; padding:var(--input-padding) var(--button-padding); margin-left:var(--input-margin); box-shadow:var(--box-shadow); height:var(--action-height); }
|
||||
fieldset>div.action>div.cmds { font-style:italic; padding:var(--input-padding) var(--button-padding); margin-left:var(--input-margin); box-shadow:var(--box-shadow); height:var(--action-height); }
|
||||
fieldset>div.output>div.code { font-size:var(--code-font-size); }
|
||||
fieldset>div.status { font-style:italic; line-height:20px; max-height:var(--action-height); }
|
||||
fieldset>div.status { font-family:var(--status-font-family); font-style:italic; line-height:20px; max-height:var(--action-height); }
|
||||
fieldset>div.status>div.item { padding:var(--input-padding); height:31px; }
|
||||
fieldset>div.status>div.item>label { font-size:var(--status-font-size); }
|
||||
fieldset>div.status>div.item>span { margin-left:var(--input-padding); }
|
||||
@ -223,8 +230,8 @@ body.en fieldset.input.date>div.action>div.item.select.month select { width:100p
|
||||
body.zh fieldset.input.date>div.action>div.item.select select { width:58px; }
|
||||
body.zh fieldset.input.date>div.action>div.item.select.year select { width:81px; }
|
||||
body.zh fieldset.input.date>div.action>div.item.select.month select { width:81px; }
|
||||
body table.content { font-family:var(--code-font-family); }
|
||||
body div.code { font-family:var(--code-font-family); }
|
||||
body table.content { font-family:var(--table-font-family); }
|
||||
body div.code { font-family:var(--table-font-family); }
|
||||
body div.tabs { font-family:var(--code-font-family); }
|
||||
body div.path { font-family:var(--code-font-family); }
|
||||
body div.carte { font-family:var(--code-font-family); }
|
||||
@ -244,12 +251,15 @@ div.item.text.path>input { width:var(--project-width); }
|
||||
div.item.text.line>input { width:var(--button-width) !important; }
|
||||
div.item.text.limit>input { width:var(--button-width); }
|
||||
div.item.text.offend>input { width:var(--button-width); }
|
||||
div.item.text.will>input { border:var(--box-notice); }
|
||||
div.item.text>i:first-child { position:absolute; padding:7px; }
|
||||
div.item.text>span.icon { font-size:var(--icon-font-size); padding:0 var(--input-padding); position:absolute; right:0; visibility:hidden; }
|
||||
div.item.text:hover>span.icon { visibility:visible; }
|
||||
div.item.button { position:relative; display:flex; align-items:center; height:var(--action-height); }
|
||||
div.item.button>span.icon { font-size:var(--icon-font-size); padding:0 var(--input-padding); position:absolute; right:0; visibility:hidden; }
|
||||
div.item.button>span.icon { font-size:var(--icon-font-size); padding:0 var(--input-padding); }
|
||||
div.item.button.select>span.icon { visibility:hidden; position:absolute; right:0; }
|
||||
div.item.button.select:hover>span.icon { visibility:visible; }
|
||||
div.item.button.icons>i { font-size:20px; padding:var(--input-padding); }
|
||||
div.item.button.create>span.icon { font-size:30px; margin-top:-5px; }
|
||||
div.item.button.insert>span.icon { font-size:30px; margin-top:-5px; }
|
||||
div.tabs:not(.hide) { display:flex; align-items:center; }
|
||||
@ -257,46 +267,31 @@ div.tabs>span { font-style:italic; }
|
||||
div.tabs>span.icon { font-size:var(--icon-font-size); font-style:normal; padding-left:var(--input-padding); visibility:hidden; }
|
||||
div.tabs.select>span.icon { visibility:visible; }
|
||||
div.tabs:hover>span.icon { visibility:visible; }
|
||||
/* form.option>div.icons>i { font-size:21px; } */
|
||||
/* div.action>div.item.icons>i { font-size:21px; line-height:var(--action-height); padding:var(--input-padding); } */
|
||||
/* div.action>div.item.icons.start>span.icon { font-size:30px; line-height:28px; } */
|
||||
/* div.item.text.will input { border:var(--box-notice); } */
|
||||
fieldset.plugin>legend { font-style:italic; font-weight:bold; }
|
||||
fieldset.plugin>form.option>div.button.icons>input { display:none; }
|
||||
fieldset.plugin>div.action>div.button.icons>input { display:none; }
|
||||
fieldset.plugin:not(.float):not(.full):not(.cmd)>form.option>div.icon { display:none; }
|
||||
fieldset.plugin.float>form.option>div.button.icons>input { display:none; }
|
||||
fieldset.plugin.float>form.option>div.button.icons>span.icon { visibility:visible; }
|
||||
fieldset.plugin.float>div.action>div.button.icons>input { display:none; }
|
||||
fieldset.plugin.float>div.action>div.button.icons>span.icon { visibility:visible; position:unset; }
|
||||
fieldset.plugin.full>form.option>div.button.icons>input { display:none; }
|
||||
fieldset.plugin.full>form.option>div.button.icons>span.icon { visibility:visible; }
|
||||
fieldset.plugin.full>div.action>div.button.icons>input { display:none; }
|
||||
fieldset.plugin.full>div.action>div.button.icons>span.icon { visibility:visible; position:unset; }
|
||||
body:not(.mobile) fieldset.plugin:not(.float):not(.full):not(.cmd)>form.option>div.button.icons>input { display:unset; }
|
||||
body:not(.mobile) fieldset.plugin:not(.float):not(.full):not(.cmd)>form.option>div.button.icons>span.icon { display:none; }
|
||||
body:not(.mobile) fieldset.plugin:not(.float):not(.full):not(.cmd)>form.option>div.button.icons>i { display:none; }
|
||||
body:not(.mobile) fieldset.plugin:not(.float):not(.full):not(.cmd)>div.action>div.button.icons>input { display:unset; }
|
||||
body:not(.mobile) fieldset.plugin:not(.float):not(.full):not(.cmd)>div.action>div.button.icons>span.icon { display:none; }
|
||||
body:not(.mobile) fieldset.plugin:not(.float):not(.full):not(.cmd)>div.aciton>div.button.icons>i { display:none; }
|
||||
fieldset.panel>div.action>div.button.icons>span.icon { display:none; }
|
||||
fieldset.plugin.cmd>form.option>div.icon.delete { display:none; }
|
||||
|
||||
fieldset.plugin.cmd>form.option>div.button.icons>input { display:none; }
|
||||
fieldset.plugin.cmd>form.option>div.button.icons>span.icon { visibility:visible; position:unset; }
|
||||
fieldset.plugin.cmd>div.action>div.button.icons>input { display:none; }
|
||||
fieldset.plugin.cmd>div.action>div.button.icons>span.icon { visibility:visible; position:unset; }
|
||||
|
||||
fieldset.story>form.option>div.button.icons>input { display:none; }
|
||||
fieldset.story>div.action>div.button.icons>input { display:none; }
|
||||
fieldset.plug>form.option>div.icon:first-child { margin-left:var(--input-margin); }
|
||||
fieldset.plug>form.option>div.button.icons>input { display:none; }
|
||||
fieldset.plug>div.action>div.button.icons>input { display:none; }
|
||||
fieldset.plug>div.action>div.button.icons>span.icon { visibility:visible; position:unset; }
|
||||
fieldset.plug>form.option>div.icon:first-child { margin-left:var(--input-margin); }
|
||||
fieldset>form.option>div.text>span.value { white-space:pre; padding:var(--input-padding) var(--button-padding); max-width:200px; height:var(--action-height); overflow:auto; }
|
||||
fieldset.plug>form.option>div.text>span.value { display:none; }
|
||||
fieldset:not(.float)>form.option>div.text>span.value { display:none; }
|
||||
fieldset.float.plug>form.option>div.text>span.value { display:none; }
|
||||
fieldset.float:not(.plug)>form.option>div.text>input { display:none; }
|
||||
fieldset.float:not(.plug)>form.option>div.text>span.icon { display:none; }
|
||||
fieldset>form.option>div.text>span.value { white-space:pre; padding:var(--input-padding); max-width:200px; height:var(--action-height); overflow:auto; }
|
||||
body.mobile:not(.landscape) fieldset.float>form.option>div.text>span.value { display:none; }
|
||||
body.mobile:not(.landscape) fieldset.plugin>form.option>div.button.icons>input { display:none; }
|
||||
body.mobile:not(.landscape) fieldset.plugin>form.option>div.button.icons>span.icon { visibility:visible; position:unset; }
|
||||
body.mobile:not(.landscape) fieldset.plugin>div.action>div.button.icons>input { display:none; }
|
||||
body.mobile:not(.landscape) fieldset.plugin>div.action>div.button.icons>span.icon { visibility:visible; position:unset; }
|
||||
body.windows form.option>div.icon { font-size:21px; line-height:var(--action-height); }
|
||||
/* svg */
|
||||
svg text { font-size:var(--svg-font-size); font-family:var(--code-font-family); stroke:var(--body-fg-color); fill:var(--body-fg-color); cursor:pointer; }
|
||||
svg text { font-size:var(--svg-font-size); font-family:var(--svg-font-family); stroke:var(--body-fg-color); fill:var(--body-fg-color); cursor:pointer; }
|
||||
svg text.offline { stroke:var(--disable-fg-color); fill:var(--disable-fg-color); }
|
||||
svg text:hover { stroke:var(--hover-fg-color); fill:var(--hover-fg-color); cursor:pointer; }
|
||||
svg rect { stroke-width:var(--svg-stroke-width); stroke:var(--body-fg-color); fill:var(--output-bg-color); }
|
||||
@ -366,7 +361,7 @@ div.output.stats { display:flex; justify-content:center; flex-wrap:wrap; }
|
||||
div.output.stats>div.item { text-align:center; padding:var(--plugin-padding); margin:var(--plugin-padding); float:left; display:flex; flex-direction:column; justify-content:center; flex-grow:1; }
|
||||
div.output.stats>div.item>div.value span:first-child { font-size:32px; }
|
||||
div.output.stats>div.item>div.value span.units { color:var(--disable-fg-color); font-style:italic; }
|
||||
div.output.stats>div.item>div.name { color:var(--disable-fg-color); font-size:var(--status-font-size); font-style:italic; }
|
||||
div.output.stats>div.item>div.name { color:var(--disable-fg-color); font-size:var(--status-font-size); font-family:var(--status-font-family); font-style:italic; }
|
||||
/* display */
|
||||
fieldset.panel>legend, fieldset.panel>div.status { display:none; }
|
||||
fieldset.output>legend, fieldset.output>form.option, fieldset.output>div.action, fieldset.output>div.status, fieldset.output>div.item { display:none; }
|
||||
@ -382,6 +377,7 @@ div.output { position:relative; }
|
||||
div.layout.flex>* { float:left; clear:none; }
|
||||
div.output.flex { display:flex; overflow:hidden; }
|
||||
div.output>div.code { position:sticky; left:0; }
|
||||
div.output>div.code video { max-width:100%; }
|
||||
fieldset>div.status>legend {
|
||||
border-radius:0; border-bottom-left-radius:var(--button-margin); border-bottom-right-radius:var(--button-margin); box-shadow:var(--box-shadow);
|
||||
margin-right:var(--button-margin); float:right; clear:none;
|
||||
@ -458,7 +454,7 @@ fieldset.panel:not(.main):not(.auto) div.item:hover { background-color:var(--pan
|
||||
fieldset.panel:not(.main):not(.auto) div.item.select { background-color:var(--panel-hover-bg-color); color:var(--panel-hover-fg-color); }
|
||||
fieldset.panel:not(.main):not(.auto) input { background-color:var(--panel-input-bg-color); color:var(--panel-input-fg-color); }
|
||||
fieldset.panel:not(.main):not(.auto) input:hover { background-color:var(--panel-hover-bg-color); color:var(--panel-hover-fg-color); }
|
||||
fieldset.panel:not(.main):not(.auto) input::placeholder { background-color:var(--panel-input-bg-color); color:var(--panel-fg-color); }
|
||||
fieldset.panel:not(.main):not(.auto) input::placeholder { background-color:var(--panel-input-bg-color); color:var(--disable-fg-color); }
|
||||
fieldset.panel.auto { background-color:var(--panel-bg-color); color:var(--panel-fg-color); }
|
||||
fieldset.panel.auto>div.output { background-color:var(--panel-bg-color); color:var(--panel-fg-color); }
|
||||
fieldset:not(.panel) { background-color:var(--plugin-bg-color); color:var(--plugin-fg-color); }
|
||||
@ -481,8 +477,9 @@ body.mobile fieldset.plugin:not(.float):not(.full):not(.cmd)>form.option>div.but
|
||||
body.mobile fieldset.plugin:not(.float):not(.full):not(.cmd)>div.action>div.button>span.icon { display:inline-block; }
|
||||
body.mobile fieldset.Header { padding:0; width:100%; position:fixed; top:0; }
|
||||
body.mobile fieldset.Header>div.output { font-size:1.4rem; line-height:var(--header-height); }
|
||||
body.mobile fieldset.Header div.output div.item:not(.avatar) { padding:0px var(--button-padding); }
|
||||
body.mobile fieldset.Header div.output div.item.text.title.search { display:none; }
|
||||
body.mobile fieldset.Header>div.output div.item { padding:0px var(--plugin-padding); }
|
||||
body.mobile fieldset.Header>div.output div.item.title>span { display:none; }
|
||||
body.mobile fieldset.Header>div.output div.item.text.title.search { display:none; }
|
||||
body.mobile fieldset.Search>div.action>div.item.filter>input { width:100%; }
|
||||
body.mobile fieldset.Search>div.action>div.item.filter>span { position:absolute; }
|
||||
body.mobile fieldset.Search>div.action>div.item.filter { width:100%; position:relative; }
|
||||
@ -534,6 +531,7 @@ fieldset.xterm>div.action>div.tabs:only-child { display:none; }
|
||||
fieldset.xterm>div.layout { clear:both; }
|
||||
fieldset.xterm div.layout div.output { border-left:var(--box-border); border-top:var(--box-border); }
|
||||
fieldset.xterm div.layout div.output.select { border:var(--box-border)}
|
||||
fieldset.dream>div.output.card>div.item.begin>div.title { color:var(--disable-fg-color); font-style:italic; text-decoration:line-through; }
|
||||
fieldset.trans>form.option>div.item.text>input { width:var(--project-width); }
|
||||
fieldset.trans>div.output>fieldset { margin:var(--button-margin); }
|
||||
fieldset.config form.option input[name=key] { width:var(--project-width); }
|
||||
@ -581,7 +579,7 @@ fieldset.can.data { font-size:14px; }
|
||||
fieldset.Search div.story[data-type=spark] { margin:0; }
|
||||
fieldset.Search>div.output>div.profile { border-left:none; width:unset; }
|
||||
fieldset.Action.tabs table.content { width:100%; }
|
||||
fieldset.Action>div.output>fieldset.plugin:not(.output):not(.float):not(.full):not(.cmd) { padding:var(--plugin-padding); margin:var(--plugin-margin); box-shadow:var(--box-shadow); }
|
||||
fieldset.Action>div.output>fieldset.plugin:not(.float):not(.full):not(.cmd) { padding:var(--plugin-padding); margin:var(--plugin-margin); box-shadow:var(--box-shadow); }
|
||||
fieldset.Action>div.output>fieldset.plugin:not(.float):not(.full):not(.cmd)>legend { float:none; }
|
||||
fieldset.cmd>div.item.time { line-height:22px; padding:var(--input-padding) var(--button-padding); float:right; }
|
||||
fieldset.cmd>div.item.usernick { line-height:22px; padding:var(--input-padding) var(--button-padding); float:right; }
|
||||
|
@ -29,7 +29,9 @@ Volcanos("base", {
|
||||
Eq: function(to, from, skip) { var call = arguments.callee; if (typeof to != typeof from) { return false }
|
||||
if (typeof to == code.OBJECT) { if (to.length != from.length) { return false }
|
||||
for (var i = 0; i < to.length; i++) { if (!call(to[i], from[i])) { return false } }
|
||||
for (var k in to) { if (k != skip && !call(to[k], from[k])) { return false } } return true
|
||||
for (var k in to) { if (k.indexOf("_") == 0) { continue }
|
||||
if (k != skip && !call(to[k], from[k])) { return false }
|
||||
} return true
|
||||
} return to === from
|
||||
},
|
||||
|
||||
|
@ -379,7 +379,8 @@ Volcanos("page", {
|
||||
can.base.isIn(name, mdb.REMOVE, mdb.DELETE, mdb.PRUNES, mdb.PRUNE, nfs.TRASH, "drop", cli.STOP, "stopall")? "danger": ""
|
||||
},
|
||||
exportValue: function(can, msg) {
|
||||
const styles = getComputedStyle(document.body); can.core.List(["--plugin-bg-color", "--plugin-fg-color"].concat(can.core.List(arguments).slice(2)), function(key) { msg.Option(key, styles.getPropertyValue(key)) })
|
||||
msg.OptionDefault(ice.MSG_BG, can.page.styleValue(can, "--plugin-bg-color", can._output))
|
||||
msg.OptionDefault(ice.MSG_FG, can.page.styleValue(can, "--plugin-fg-color", can._output))
|
||||
return msg
|
||||
},
|
||||
styleValue: function(can, key, target) { const styles = getComputedStyle(target||document.body); return styles.getPropertyValue(key) },
|
||||
|
@ -9,6 +9,8 @@ Volcanos("user", {
|
||||
window.open("https://map.baidu.com/search/"+encodeURIComponent(msg.Option(mdb.TEXT))
|
||||
+"/@12958750.085,4825785.55,16z?querytype=s&da_src=shareurl&wd="+encodeURIComponent(msg.Option(mdb.TEXT)))
|
||||
},
|
||||
connectWifi: function(can, ssid, password, cb, cbs) {},
|
||||
getClipboard: function(can, cb) {},
|
||||
scanQRCode: function(can, cb) { can.user.input(event, can, [{type: html.TEXTAREA, name: mdb.TEXT, text: ""}], function(list) { cb(can.base.ParseJSON(list[0])) }) },
|
||||
chooseImage: function(can, cb) { can.base.isFunc(cb) && cb([]) },
|
||||
}, info: {},
|
||||
@ -272,13 +274,12 @@ Volcanos("user", {
|
||||
var ui = can.onappend.tabview(can, list, can.core.Item(list), can.page.Append(can, document.body, [{view: "input login float"}])._target)
|
||||
can.page.style(can, ui._target, {left: (window.innerWidth-ui._target.offsetWidth)/2, top: can.user.isMobile? can.user.isLandscape()? 0 :48 :window.innerHeight/8})
|
||||
var _cmd = "space login "+arg[0]; ui.display = can.page.Append(can, ui._target, [html.DISPLAY])._target
|
||||
can.page.Appends(can, ui.display, [{text: "<br/>或命令授权: "}, {text: [_cmd, "", html.ITEM], title: "点击复制,并后台执行此命令,即可登录", style: {cursor: "copy"}, onclick: function() { can.user.copy(event, can, _cmd) }}])
|
||||
can.page.Append(can, ui.display, [{view: "sso", list: msg.Table(function(value) {
|
||||
can.page.Appends(can, ui.display, [{text: ["或命令行授权: ", html.LABEL]}, {text: ["$ "+_cmd, "", html.ITEM], title: "点击复制,并后台执行此命令,即可登录", style: {cursor: "copy"}, onclick: function() { can.user.copy(event, can, _cmd) }}])
|
||||
can.page.Append(can, ui.display, [{text: ["或第三方授权: ", html.LABEL]}, {view: "sso", list: msg.Table(function(value) {
|
||||
return value.type == "oauth" && {view: html.ITEM, title: "点击跳转,授权登录", list: [{img: can.misc.Resource(can, value.icons)}, {text: value.name}], onclick: function() { can.user.jumps(value.link) }}
|
||||
}) }])
|
||||
} else if (cmd == ice.MSG_SESSID) {
|
||||
if (!can.misc.CookieSessid(can, arg[0])) { can.user.info.sessid = arg[0] }
|
||||
check()
|
||||
if (!can.misc.CookieSessid(can, arg[0])) { can.user.info.sessid = arg[0] } check()
|
||||
}
|
||||
}) },
|
||||
logout: function(can) { can.user.toastConfirm(can, aaa.LOGOUT, "", function() { can.runAction({}, aaa.LOGOUT, [], function(msg) {
|
||||
|
@ -1,7 +1,9 @@
|
||||
(function() { const TABS = "tabs", TABVIEW = "tabview", HORIZON = "horizon", VERTICAL = "vertical", GRID = "grid", FREE = "free", FLOW = "flow", PAGE = "page", CAN_LAYOUT = "can.layout"
|
||||
Volcanos(chat.ONIMPORT, {_init: function(can, msg) { var river = can.Conf(chat.RIVER), storm = can.Conf(chat.STORM), list = can.misc.SearchHash(can)
|
||||
can.onmotion.clear(can), can.core.Next(msg.Table(), function(item, next) { item.type = chat.PLUGIN, item.mode = can.Mode(); if (item.deleted == ice.TRUE) { return next() }
|
||||
item.width = can.ConfWidth()-can.Conf(html.MARGIN_X); if (item.style == html.OUTPUT) { item.width = can.ConfWidth() }
|
||||
item.width = can.ConfWidth()-can.Conf(html.MARGIN_X); if (item.style == html.OUTPUT) {
|
||||
item.width = can.ConfWidth()-2*html.PLUGIN_MARGIN-2*html.PLUGIN_PADDING
|
||||
}
|
||||
if (msg.Length() == 1) { item.height = can.ConfHeight()-(can.user.isMobile? 2: 1)*html.ACTION_HEIGHT-can.Conf(html.MARGIN_Y) }
|
||||
can.onappend.plugin(can, item, function(sub, meta, skip) { can._plugins = (can._plugins||[]).concat([sub]), can.onimport._tabs(can, sub, meta), skip || next()
|
||||
sub.onaction._close = function() { can.onengine.signal(can, chat.ONACTION_REMOVE, can.request({river: river, storm: storm}, item)), can.page.Remove(can, sub._target) }
|
||||
@ -39,8 +41,7 @@ Volcanos(chat.ONACTION, {_init: function(can, target) {
|
||||
can.Conf(html.MARGIN_Y, 2*html.PLUGIN_PADDING+2*html.PLUGIN_MARGIN+html.ACTION_HEIGHT)
|
||||
can.Conf(html.MARGIN_X, 2*html.PLUGIN_PADDING+2*html.PLUGIN_MARGIN)
|
||||
can.onimport._menu(can, msg), can.onkeymap._build(can)
|
||||
can._root.River && can.onmotion.delay(can, function() {
|
||||
if (can.Mode()) { return }
|
||||
can._root.River && can.onmotion.delay(can, function() { if (can.Mode()) { return }
|
||||
var gt = can.page.unicode.next, lt = can.page.unicode.prev, river = can._root.River._target
|
||||
var target = can.page.Append(can, can._target, [{view: [[html.TOGGLE, chat.PROJECT], "", can.page.isDisplay(river)? lt: gt], onclick: function(event) {
|
||||
can.page.Modify(can, target, (can._river_show = can.onmotion.toggle(can, river))? lt: gt), can.onaction.layout(can)
|
||||
@ -134,7 +135,11 @@ Volcanos(chat.ONLAYOUT, {
|
||||
flow: function(can) { can.getActionSize(function(height, width) { can.ConfHeight(height-html.ACTION_MARGIN), can.ConfWidth(width) }) },
|
||||
page: function(can) { can.page.styleHeight(can, can._output, ""), can.page.style(can, document.body, kit.Dict(html.OVERFLOW, "")) },
|
||||
_plugin: function(can, button) { can.core.List(can._plugins, function(sub) {
|
||||
if (can.page.ClassList.has(can, sub._target, html.OUTPUT)) { return sub.onimport.size(sub, can.ConfHeight(), can.ConfWidth(), true) }
|
||||
if (can.page.ClassList.has(can, sub._target, html.OUTPUT)) {
|
||||
return sub.onimport.size(sub,
|
||||
can.ConfHeight()-2*html.PLUGIN_MARGIN-2*html.PLUGIN_PADDING,
|
||||
can.ConfWidth()-2*html.PLUGIN_MARGIN-2*html.PLUGIN_PADDING,
|
||||
true) }
|
||||
if (can._plugins.length == 1) { return sub.onimport.size(sub, can.ConfHeight()-(can.user.isMobile? 2: 1)*html.ACTION_HEIGHT-can.Conf(html.MARGIN_Y), can.ConfWidth()-can.Conf(html.MARGIN_X), false) }
|
||||
sub.onimport.size(sub, can.ConfHeight()-can.Conf(html.MARGIN_Y)-(button || sub.isCmdMode()? 0: html.ACTION_MARGIN), can.ConfWidth()-can.Conf(html.MARGIN_X), can.onexport.isauto(can)) && can.page.style(can, sub._output, html.MAX_HEIGHT, "")
|
||||
}) },
|
||||
|
@ -1,9 +1,9 @@
|
||||
fieldset.Footer>div.output { font-style:italic; height:var(--footer-height); overflow:hidden; }
|
||||
fieldset.Footer>div.output div.item { padding:7px; height:var(--footer-height); float:left; }
|
||||
fieldset.Footer>div.output div.title:first-child { font-weight:bold; text-align:center; width:var(--river-width); overflow:auto; }
|
||||
fieldset.Footer>div.output div.state { float:right; }
|
||||
fieldset.Footer>div.output div.state { font-family:var(--status-font-family); float:right; line-height:18px; }
|
||||
fieldset.Footer>div.output div.state label { font-size:var(--status-font-size); }
|
||||
fieldset.Footer>div.output div.toast { float:right; line-height:18px; }
|
||||
fieldset.Footer>div.output div.toast { font-family:var(--status-font-family); float:right; line-height:18px; }
|
||||
fieldset.Footer>div.output div.cmd { padding:0; margin-left:20px; }
|
||||
fieldset.Footer>div.output div.cmd>i { padding:7px; }
|
||||
fieldset.Footer>div.output div.cmd>input[name=cmd] { padding-left:30px; }
|
||||
|
@ -1,7 +1,7 @@
|
||||
fieldset.Header>div.output { line-height:21px; height:var(--header-height); overflow:hidden; }
|
||||
fieldset.Header>div.output div.item { background-color:var(--panel-output-bg-color); padding:13.5px; height:var(--header-height); float:left; }
|
||||
fieldset.Header>div.output div.title:first-child { font-size:var(--legend-font-size); font-style:italic; font-weight:bold; width:var(--river-width); display:flex; align-items:center; justify-content:center; overflow:hidden; }
|
||||
fieldset.Header>div.output div.title img { margin-right:var(--button-margin); height:var(--action-height); width:var(--action-height); }
|
||||
fieldset.Header>div.output div.title:first-child { font-size:var(--legend-font-size); font-style:italic; font-weight:bold; display:flex; align-items:center; justify-content:center; overflow:hidden; }
|
||||
fieldset.Header>div.output div.title img { height:var(--action-height); width:var(--action-height); }
|
||||
fieldset.Header>div.output div.state { float:right; }
|
||||
fieldset.Header>div.output div.state.avatar { padding:0; }
|
||||
fieldset.Header>div.output div.state.avatar>img { height:var(--header-height); clip-path:circle(40%); }
|
||||
@ -9,4 +9,5 @@ fieldset.Header>div.output div.search.title { padding:7px 5px; margin-left:15px;
|
||||
fieldset.Header>div.output div.search>i { padding:7px; }
|
||||
fieldset.Header>div.output div.search>input { padding-left:25px; }
|
||||
fieldset.Header>div.output div.search>span.icon { padding:var(--input-padding) var(--button-padding); }
|
||||
body.mobile fieldset.Header>div.output div.state.avatar { margin-right:var(--button-margin); }
|
||||
body:not(.mobile) fieldset.Header>div.output div.title:first-child { width:var(--river-width); }
|
||||
body:not(.mobile) fieldset.Header>div.output div.title img { margin-right:var(--button-margin); }
|
||||
|
@ -1,9 +1,11 @@
|
||||
Volcanos(chat.ONIMPORT, {_init: function(can, msg, target) {
|
||||
can.onimport._title(can, msg, target), can.onimport._state(can, msg, target), can.onimport._avatar(can, msg, target), can.onimport._background(can, msg, target), can.onimport._search(can, msg, target)
|
||||
},
|
||||
_title: function(can, msg, target) { can.user.isMobile || can.core.List(can.base.getValid(can.Conf(chat.TITLE)||(can.user.isExtension? "contexts": location.host)||msg.result, [location.host]), function(item) {
|
||||
_title: function(can, msg, target) {
|
||||
can.core.List(can.base.getValid(can.Conf(chat.TITLE)||(can.user.isExtension? "contexts": location.host)||msg.result, [location.host]), function(item) {
|
||||
can.page.Append(can, target, [{view: [[html.ITEM, chat.TITLE]], list: [{img: "/volcanos/favicon.ico"}, {text: item}], title: "返回主页", onclick: function(event) { can.onaction.title(event, can) }}])
|
||||
}) },
|
||||
})
|
||||
},
|
||||
_state: function(can, msg, target) { can.core.List(can.base.Obj(can.Conf(chat.STATE)||msg.Option(chat.STATE), [aaa.USERNICK, aaa.AVATAR, mdb.TIME]).reverse(), function(item) {
|
||||
if (item == aaa.AVATAR ) { can.user.isLocalFile || can.page.Append(can, target, [{view: [[html.ITEM, chat.STATE, item]], list: [{img: lex.SP}], onclick: function(event) {
|
||||
can.core.CallFunc([can.onaction, item], [event, can, item])
|
||||
|
@ -1,8 +1,12 @@
|
||||
fieldset.River { width:var(--river-width); float:left; }
|
||||
fieldset.River>div.action { margin-top:var(--plugin-margin); width:100%; display:flex; justify-content:center; }
|
||||
fieldset.River>div.output div.item { padding:var(--legend-padding); border-left:#00ffae solid 3px; }
|
||||
fieldset.River { width:var(--river-width); float:left; position:relative; }
|
||||
fieldset.River>div.action:not(.hide) { margin-top:var(--plugin-margin); width:100%; display:flex; justify-content:center; }
|
||||
fieldset.River>div.output { transition:all .3s; }
|
||||
fieldset.River>div.output div.item { font-family:var(--legend-font-family); padding:var(--legend-padding); border-left:#00ffae solid 3px; }
|
||||
fieldset.River>div.output div.item:hover { color:var(--panel-hover-fg-color); }
|
||||
fieldset.River>div.output div.item.select { color:var(--panel-hover-fg-color); }
|
||||
fieldset.River>div.output div.list div.item { border-left:#ccdc4c solid 3px; }
|
||||
fieldset.River>div.output div.list { margin-left:var(--legend-padding); }
|
||||
fieldset.River>div.output { margin:var(--river-margin) 0; }
|
||||
fieldset.River>div.toggle { rotate:90deg; right:calc(50% - 5px); }
|
||||
fieldset.River>div.toggle.prev { top:-10px; }
|
||||
fieldset.River>div.toggle.next { bottom:-50px; }
|
||||
|
@ -15,11 +15,24 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg) { can.onimport._main(can, msg
|
||||
_storm: function(can, meta, river) { return {view: html.ITEM, list: [{icon: meta.icon}, {text: meta.name}], _init: function(target) { can.ui.storm_list[can.core.Keys(river, meta.hash)] = target },
|
||||
onclick: function(event) { can.onaction.action(event, can, river, meta.hash) }, oncontextmenu: function(event) { can.onaction.carte(event, can, can.ondetail._menu, river, meta.hash) },
|
||||
} },
|
||||
_menu: function(can, msg) { can.user.isMobile || can.user.mod.isPod || can.onappend._action(can, can.onaction.list, can._action) },
|
||||
_menu: function(can, msg) {
|
||||
if (can.user.isMobile || can.user.mod.isPod) {
|
||||
can.onmotion.hidden(can, can._action)
|
||||
} else {
|
||||
can.onappend._action(can, can.onaction.list, can._action)
|
||||
}
|
||||
},
|
||||
})
|
||||
Volcanos(chat.ONACTION, {list: [mdb.CREATE, web.SHARE, web.REFRESH], _init: function(can) {
|
||||
can.db.storm_list = {}
|
||||
can.onmotion.hidden(can)
|
||||
can.db.storm_list = {}, can.onmotion.hidden(can)
|
||||
var next = can.page.unicode.next, prev = can.page.unicode.prev
|
||||
can._prev = can.page.Append(can, can._target, [{view: [[html.TOGGLE, mdb.PREV], "", prev], onclick: function(event) {
|
||||
can._output.scrollBy && can._output.scrollBy(0, -10000)
|
||||
}}])._target
|
||||
can._next = can.page.Append(can, can._target, [{view: [[html.TOGGLE, mdb.NEXT], "", next], onclick: function(event) {
|
||||
can._output.scrollBy && can._output.scrollBy(0, 10000)
|
||||
}}])._target
|
||||
can._output.onscroll = function() { can.onexport.scroll(can) }
|
||||
},
|
||||
onlogin: function(can, msg) { can.run(can.request({}, {_method: http.GET}), [], function(msg) { if (msg.Option(ice.MSG_RIVER)) { return can.page.Remove(can, can._target) }
|
||||
can.onimport._init(can, msg); if (can.user.isMobile || can.user.isExtension) { return can.page.ClassList.add(can, can._target, ice.AUTO) }
|
||||
@ -39,27 +52,33 @@ Volcanos(chat.ONACTION, {list: [mdb.CREATE, web.SHARE, web.REFRESH], _init: func
|
||||
can.runAction(event, mdb.CREATE, args, function(msg) { can.misc.Search(can, {river: msg.Result()}) })
|
||||
}) },
|
||||
share: function(event, can) { can.core.CallFunc(can.ondetail.share, {event: event, can: can}) },
|
||||
onsize: function(can, height) { var margin = "0px", _margin = 0; can.page.style(can, can._output, html.MARGIN, "0px", html.HEIGHT, "")
|
||||
if (can.page.isDisplay(can._action)) { _margin = can._action.offsetHeight + html.PLUGIN_MARGIN }
|
||||
if (can._output.offsetHeight < height) { margin = can.base.Min((height-can._output.offsetHeight)/2, _margin)+"px 0px" }
|
||||
height && can.page.style(can, can._output, html.MARGIN, margin, html.HEIGHT, can.base.Max(can._output.offsetHeight, height-_margin))
|
||||
can.onexport.scroll(can)
|
||||
},
|
||||
refresh: function(event, can) { can.misc.Search(can, {river: can.Conf(chat.RIVER), storm: can.Conf(chat.STORM)}) },
|
||||
storm: function(event, can, river) {
|
||||
can.onmotion.select(can, can._output, html.DIV_ITEM, can.ui.river_list[river])
|
||||
function _menu() { can.user.isMobile && can.onmotion.delay(can, function() { var list = can.db.storm_list[river]
|
||||
function _menu(list) { can.onlayout._init(can)
|
||||
can.page.ClassList.set(can, can.ui.river_list[river], "open", can.page.isDisplay(list))
|
||||
can.user.isMobile && can.onmotion.delay(can, function() { var list = can.db.storm_list[river]
|
||||
can.onmotion.hidden(can, can._root.Footer._target, list.length > 1)
|
||||
var menu = can.setFooterMenu(list, function(event, button, list) { can.onaction.action(event, can, river, button) })
|
||||
can.page.SelectChild(can, menu, html.DIV_ITEM, function(target, index) { can.page.ClassList.set(can, target, html.SELECT, list[index].hash == can.Conf("storm")) })
|
||||
}) }
|
||||
var list = can.ui.sublist[river]; if (list) {
|
||||
return can.page.ClassList.set(can, can.ui.river_list[river], "open", can.onmotion.toggle(can, list)), _menu()
|
||||
})
|
||||
}
|
||||
var list = can.ui.sublist[river]; if (list) { return can.onmotion.toggle(can, list), _menu(list) }
|
||||
can.run({}, [river, chat.STORM], function(msg) { var next = can.ui.river_list[river].nextSibling
|
||||
can.page.ClassList.set(can, can.ui.river_list[river], "open", true)
|
||||
if (msg.Length() == 0) { return can.user.isLocalFile? can.user.toastFailure(can, "miss data"): can.onengine.signal(can, chat.ONACTION_NOSTORM, can.request({}, {river: river})) }
|
||||
can.db.storm_list[river] = msg.Table()
|
||||
var select = 0; list = can.page.Append(can, can._output, [{view: html.LIST, list: msg.Table(function(item, index) {
|
||||
return river == can._main_river && item.hash == can._main_storm && (select = index), can.onimport._storm(can, item, river)
|
||||
}) }])._target, next && can._output.insertBefore(list, next), can.ui.sublist[river] = list, _menu(), list.children.length > 0 && list.children[select].click()
|
||||
}) }])._target, next && can._output.insertBefore(list, next), can.ui.sublist[river] = list, _menu(list), list.children.length > 0 && list.children[select].click()
|
||||
})
|
||||
},
|
||||
action: function(event, can, river, storm) { can.user.isMobile || can.misc.SearchHash(can, river, storm)
|
||||
action: function(event, can, river, storm) { can.misc.SearchHash(can, river, storm)
|
||||
can.page.Select(can, can._output, [html.DIV_LIST, html.DIV_ITEM], function(target) { can.page.ClassList.del(can, target, html.SELECT) })
|
||||
can.onmotion.select(can, can.ui.sublist[river], html.DIV_ITEM, can.ui.storm_list[can.core.Keys(river, storm)])
|
||||
can.onaction.storm({target: can.ui.river_list[river]}, can, river)
|
||||
@ -125,6 +144,17 @@ Volcanos(chat.ONEXPORT, {width: function(can) { return can._target.offsetWidth }
|
||||
storm: function(can, msg, arg) { can.core.Item(can._root.river, function(river, value) { can.core.Item(value.storm, function(storm, item) { if (arg[1] != "" && storm.indexOf(arg[1]) == -1 && item.name.indexOf(arg[1]) == -1) { return }
|
||||
msg.Push({ctx: ice.CAN, cmd: can._name, type: river, name: storm, text: shy("跳转", function(event) { can.onaction.action(event, can, river, storm) })})
|
||||
}) }) },
|
||||
scroll: function(can) {
|
||||
can.onmotion.delayOnce(can, function() {
|
||||
if (can._output.offsetHeight == can._output.scrollHeight) {
|
||||
can.onmotion.hidden(can, can._prev)
|
||||
can.onmotion.hidden(can, can._next)
|
||||
} else {
|
||||
can.onmotion.toggle(can, can._prev, can._output.scrollTop > 10)
|
||||
can.onmotion.toggle(can, can._next, can._output.scrollTop+can._output.offsetHeight < can._output.scrollHeight-10)
|
||||
}
|
||||
})
|
||||
},
|
||||
})
|
||||
Volcanos(chat.ONENGINE, {_engine: function(event, can, msg, panel, cmds, cb) { var list = can.river
|
||||
cmds.length == 0 && can.core.ItemOrder(list, "order", function(key, value) {
|
||||
|
@ -21,7 +21,7 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb) { can.ui = can.onappend.l
|
||||
can.onimport.layout(can), can.onmotion.scrollIntoView(can, target), can.onmotion.clear(can, can.ui.content)
|
||||
var _target = can.onimport.file(can, item.path, item, index, can.ui.content, can.ui.content.offsetHeight, true)
|
||||
_target.focus(), _target.onclick = function() { can.ondetail._init(can, index) }
|
||||
can.isCmdMode() && can.misc.SearchHash(can, item.path)
|
||||
can.onimport.layout(can), can.isCmdMode() && can.misc.SearchHash(can, item.path)
|
||||
can.onappend._toggle(can, can.ui.content, function() {
|
||||
index == 0? can.user.toast(can, "已经是第一页了"): _event.target.previousSibling.click()
|
||||
}, function() {
|
||||
@ -52,7 +52,8 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb) { can.ui = can.onappend.l
|
||||
can.Status({begin: begin, limit: limit, total: list.length})
|
||||
},
|
||||
layout: function(can) { can.ui.layout(can.ConfHeight(), can.ConfWidth(), 0, function(height, width) {
|
||||
can.page.Select(can, can.ui.content, html.VIDEO, function(target) {
|
||||
can.page.Select(can, can.ui.content, can.page.Keys(html.IMG, html.VIDEO), function(target) {
|
||||
can.user.isMobile && !can.user.isLandscape()? can.page.style(can, target, html.HEIGHT, "", html.MAX_HEIGHT, height, html.WIDTH, width):
|
||||
can.page.style(can, target, html.HEIGHT, height, html.MAX_WIDTH, width)
|
||||
})
|
||||
}) },
|
||||
@ -61,7 +62,7 @@ Volcanos(chat.ONFIGURE, {
|
||||
png: function(can, path, item, index, height) { return can.onfigure.image(can, path, item, index, height) },
|
||||
jpg: function(can, path, item, index, height) { return can.onfigure.image(can, path, item, index, height) },
|
||||
jpeg: function(can, path, item, index, height) { return can.onfigure.image(can, path, item, index, height) },
|
||||
image: function(can, path, item, index, height) { return {img: path, height: height||can.onexport.height(can),
|
||||
image: function(can, path, item, index, height) { return {img: path,
|
||||
onmouseover: function(event) { can.Status(nfs.FILE, path), can.Status(item) },
|
||||
onclick: function(event) { item._target.click() },
|
||||
} },
|
||||
|
@ -1,5 +1,6 @@
|
||||
Volcanos(chat.ONIMPORT, {
|
||||
_process: function(can, msg) { msg.OptionStatus() && can.onmotion.clear(can, can._status) && can.onappend._status(can, msg.OptionStatus())
|
||||
_process: function(can, msg) {
|
||||
// msg.OptionStatus() && can.onmotion.clear(can, can._status) && can.onappend._status(can, msg.OptionStatus())
|
||||
if (can.onimport[msg.OptionProcess()]) { return can.core.CallFunc([can.onimport, msg.OptionProcess()], {can: can, sub: can.sub, msg: msg, arg: msg.Option("_arg")}), true }
|
||||
},
|
||||
_location: function(can, msg, arg) { can.user.jumps(arg) },
|
||||
@ -38,9 +39,9 @@ Volcanos(chat.ONIMPORT, {
|
||||
},
|
||||
_open: function(can, msg, arg) { can.user.opens(arg), can.Update() },
|
||||
_close: function(can, msg) { can.user.close() || history.back() },
|
||||
change: function(event, can, name, value, cb) { return can.page.SelectArgs(can, can._option, "", function(input) { if (input.name != name || value == input.value) { return }
|
||||
change: function(event, can, name, value, cb, data) { return can.page.SelectArgs(can, can._option, "", function(input) { if (input.name != name || value == input.value) { return }
|
||||
can.page.Select(can, input.parentNode, "span.value", function(target) { target.innerText = value })
|
||||
return input.value = value, can.Update(event, can.Input([], true), cb), input
|
||||
return input.value = value, can.Update(event, can.Input([], true, data), cb), input
|
||||
})[0] },
|
||||
_size: function(can, height, width, auto, mode) {},
|
||||
size: function(can, height, width, auto, mode) {
|
||||
|
@ -12,6 +12,17 @@ Volcanos("user", {
|
||||
})
|
||||
}})
|
||||
},
|
||||
connectWifi: function(can, ssid, password, cb, cbs) { wx.showLoading()
|
||||
wx.startWifi({success: function(res) {
|
||||
wx.connectWifi({SSID: ssid, password: password, success: function(res) { wx.hideLoading()
|
||||
console.log("wifi", res), cb && cb(res)
|
||||
}, fail: function(res) {
|
||||
console.log("wifi", res), cbs && cbs(res)
|
||||
}})
|
||||
}, fail: function(res) {
|
||||
console.log("wifi", res), cbs && cbs(res)
|
||||
}})
|
||||
},
|
||||
getClipboard: function(can, cb) {
|
||||
wx.getClipboardData({success: function(res) {
|
||||
cb && cb(can.base.ParseJSON(res.data))
|
||||
@ -45,17 +56,6 @@ Volcanos("user", {
|
||||
}
|
||||
}})
|
||||
},
|
||||
connectWifi: function(can, ssid, password, cb, cbs) { wx.showLoading()
|
||||
wx.startWifi({success: function(res) {
|
||||
wx.connectWifi({SSID: ssid, password: password, success: function(res) { wx.hideLoading()
|
||||
console.log("wifi", res), cb && cb(res)
|
||||
}, fail: function(res) {
|
||||
console.log("wifi", res), cbs && cbs(res)
|
||||
}})
|
||||
}, fail: function(res) {
|
||||
console.log("wifi", res), cbs && cbs(res)
|
||||
}})
|
||||
},
|
||||
}, info: {},
|
||||
jumps: function(url, cb) { wx.navigateTo({url: url, success: cb}) },
|
||||
title: function(text, cb) { text && wx.setNavigationBarTitle({title: text, success: cb}) },
|
||||
|
Loading…
x
Reference in New Issue
Block a user