mirror of
https://shylinux.com/x/volcanos
synced 2025-04-26 01:04:06 +08:00
opt island
This commit is contained in:
parent
63144fe733
commit
6d07bd045f
12
index.css
12
index.css
@ -1,3 +1,10 @@
|
|||||||
|
@media (prefers-color-scheme: light) {
|
||||||
|
body { --plugin-bg-color:white; --plugin-fg-color:black; }
|
||||||
|
}
|
||||||
|
@media (prefers-color-scheme: dark) {
|
||||||
|
body { --plugin-bg-color:black; --plugin-fg-color:silver; }
|
||||||
|
body { background-color:var(--plugin-bg-color); color:var(--plugin-fg-color); }
|
||||||
|
}
|
||||||
body {
|
body {
|
||||||
--notice-bg-color:blue; --notice-fg-color:white;
|
--notice-bg-color:blue; --notice-fg-color:white;
|
||||||
--danger-bg-color:red; --danger-fg-color:var(--notice-fg-color);
|
--danger-bg-color:red; --danger-fg-color:var(--notice-fg-color);
|
||||||
@ -6,10 +13,10 @@ body {
|
|||||||
--hover-bg-color:#5066b945; --hover-fg-color:var(--notice-fg-color);
|
--hover-bg-color:#5066b945; --hover-fg-color:var(--notice-fg-color);
|
||||||
--progress-bg-color:red; --disable-fg-color:gray;
|
--progress-bg-color:red; --disable-fg-color:gray;
|
||||||
--body-bg-color:var(--plugin-bg-color); --body-fg-color:var(--plugin-fg-color);
|
--body-bg-color:var(--plugin-bg-color); --body-fg-color:var(--plugin-fg-color);
|
||||||
--plugin-bg-color:black; --plugin-fg-color:silver; --plugin-border-color:var(--box-border);
|
--plugin-border-color:var(--box-border);
|
||||||
|
|
||||||
--legend-bg-color:var(--plugin-bg-color);
|
--legend-bg-color:var(--plugin-bg-color);
|
||||||
--input-bg-color:var(--plugin-fg-color); --input-fg-color: var(--plugin-fg-color); --input-border:var(--box-border);
|
--input-bg-color:var(--plugin-bg-color); --input-fg-color: var(--plugin-fg-color); --input-border:var(--box-border);
|
||||||
--output-bg-color:var(--input-bg-color); --output-fg-color:var(--input-fg-color); --status-border:var(--box-border);
|
--output-bg-color:var(--input-bg-color); --output-fg-color:var(--input-fg-color); --status-border:var(--box-border);
|
||||||
--th-bg-color:var(--plugin-bg-color); --th-fg-color:var(--plugin-fg-color);
|
--th-bg-color:var(--plugin-bg-color); --th-fg-color:var(--plugin-fg-color);
|
||||||
--tr-hover-bg-color:var(--hover-bg-color); --td-hover-bg-color:var(--hover-bg-color);
|
--tr-hover-bg-color:var(--hover-bg-color); --td-hover-bg-color:var(--hover-bg-color);
|
||||||
@ -49,7 +56,6 @@ body {
|
|||||||
}
|
}
|
||||||
input { font-family:var(--input-font-family); }
|
input { font-family:var(--input-font-family); }
|
||||||
body { font-family:var(--body-font-family); }
|
body { font-family:var(--body-font-family); }
|
||||||
body { background-color:var(--body-bg-color); color:var(--body-fg-color); }
|
|
||||||
body.windows { --code-font-family:"Courier New"; }
|
body.windows { --code-font-family:"Courier New"; }
|
||||||
body.mobile { --qrcode-height:284px; }
|
body.mobile { --qrcode-height:284px; }
|
||||||
body.cmd { background-color:var(--plugin-bg-color); }
|
body.cmd { background-color:var(--plugin-bg-color); }
|
||||||
|
@ -88,7 +88,7 @@ Volcanos("user", {
|
|||||||
content = {"success": "✅ success", "failure": "❌ failure", "process": "🕑 process"}[content]||content
|
content = {"success": "✅ success", "failure": "❌ failure", "process": "🕑 process"}[content]||content
|
||||||
var meta = can.base.isObject(content)? content: {content: content, duration: duration, progress: progress, caller: caller}
|
var meta = can.base.isObject(content)? content: {content: content, duration: duration, progress: progress, caller: caller}
|
||||||
meta.title = meta.title||can.core.Keys(can.Conf(web.SPACE), can.Conf(ctx.INDEX))||can._name.split(nfs.PS).slice(-2).join(nfs.PS)
|
meta.title = meta.title||can.core.Keys(can.Conf(web.SPACE), can.Conf(ctx.INDEX))||can._name.split(nfs.PS).slice(-2).join(nfs.PS)
|
||||||
var width = meta.width||400; if (width < 0) { width = window.innerWidth + width } meta.action = meta.action||[""]
|
var width = meta.width||380; if (width < 0) { width = window.innerWidth + width } meta.action = meta.action||[""]
|
||||||
var ui = can.page.Append(can, document.body, [{view: [[chat.TOAST, chat.FLOAT]], style: {left: (window.innerWidth-width)/2, width: width, top: can.page.height()/2}, list: [
|
var ui = can.page.Append(can, document.body, [{view: [[chat.TOAST, chat.FLOAT]], style: {left: (window.innerWidth-width)/2, width: width, top: can.page.height()/2}, list: [
|
||||||
{text: [meta.title||"", html.DIV, html.TITLE], title: "点击复制", onclick: function(event) { can.user.copy(event, can, meta.title) }},
|
{text: [meta.title||"", html.DIV, html.TITLE], title: "点击复制", onclick: function(event) { can.user.copy(event, can, meta.title) }},
|
||||||
{view: ["delete", "", can.page.unicode.delete], title: "点击关闭", onclick: function() { action.close() }},
|
{view: ["delete", "", can.page.unicode.delete], title: "点击关闭", onclick: function() { action.close() }},
|
||||||
|
@ -82,8 +82,9 @@ Volcanos(chat.ONACTION, {_init: function(can) {},
|
|||||||
lang(msg, function() { can.onmotion.clear(can), can.onimport._init(can, can.request(), can._output), can.onengine.signal(can, chat.ONLOGIN) })
|
lang(msg, function() { can.onmotion.clear(can), can.onimport._init(can, can.request(), can._output), can.onengine.signal(can, chat.ONLOGIN) })
|
||||||
}
|
}
|
||||||
can.run(can.request({}, {_method: http.GET}), [], function(msg) { lang(msg), can.page.requireModules(can, [msg.Option("icon.lib")])
|
can.run(can.request({}, {_method: http.GET}), [], function(msg) { lang(msg), can.page.requireModules(can, [msg.Option("icon.lib")])
|
||||||
can.ui.diy = can.base.Obj(msg.Option("diy"))||{}, can.__theme = can.onimport._theme(can, can.onexport.theme(can)), can.onimport.theme(can)
|
can.ui.diy = can.base.Obj(msg.Option("diy"))||{}, can.__theme = can.onimport._theme(can, can.page.theme(function(theme) {
|
||||||
can.page.theme(function(theme) { can.onengine.signal(can, chat.ONTHEMECHANGE, can.request(event, {theme: can.__theme = can.ui.diy&&can.ui.diy[theme]||theme})) })
|
can.onengine.signal(can, chat.ONTHEMECHANGE, can.request(event, {theme: can.__theme = can.onimport._theme(can, theme)}))
|
||||||
|
})), can.onimport.theme(can)
|
||||||
can.onaction._menus[3] = [aaa.LANGUAGE, ice.AUTO].concat(can.core.List(msg["language.list"], function(item) { return can.base.trimSuffix(item, nfs._JS) }))
|
can.onaction._menus[3] = [aaa.LANGUAGE, ice.AUTO].concat(can.core.List(msg["language.list"], function(item) { return can.base.trimSuffix(item, nfs._JS) }))
|
||||||
can.onaction._menus[2] = [chat.THEME, ice.AUTO].concat(can.core.List(msg["theme.list"], function(item) { return can.base.trimSuffix(item, nfs._CSS) }))
|
can.onaction._menus[2] = [chat.THEME, ice.AUTO].concat(can.core.List(msg["theme.list"], function(item) { return can.base.trimSuffix(item, nfs._CSS) }))
|
||||||
can.require(can.core.List(msg["theme.list"], function(item) { return nfs.SRC_TEMPLATE+web.CHAT_HEADER+"/theme/"+item }), function() {
|
can.require(can.core.List(msg["theme.list"], function(item) { return nfs.SRC_TEMPLATE+web.CHAT_HEADER+"/theme/"+item }), function() {
|
||||||
@ -124,7 +125,8 @@ Volcanos(chat.ONACTION, {_init: function(can) {},
|
|||||||
}) },
|
}) },
|
||||||
qrcode: function(event, can) {
|
qrcode: function(event, can) {
|
||||||
can.runAction(event, cli.QRCODE, [], function(msg) {
|
can.runAction(event, cli.QRCODE, [], function(msg) {
|
||||||
can.user.toast(can, {title: msg.Append(web.LINK), duration: -1, content: msg.Result(), action: [cli.CLOSE, cli.OPEN], resize: html.IMG})
|
var ui = can.user.toast(can, {title: msg.Append(web.LINK), duration: -1, content: msg.Result(), action: [cli.CLOSE, cli.OPEN], resize: html.IMG})
|
||||||
|
can.page.style(can, ui._target, html.TOP, (can.page.height() - 360)/2)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
language: function(event, can) { can.onimport.language(can, can.user.info.language.indexOf("zh") == 0? "en-us": "zh-cn") },
|
language: function(event, can) { can.onimport.language(can, can.user.info.language.indexOf("zh") == 0? "en-us": "zh-cn") },
|
||||||
|
@ -25,9 +25,12 @@ Volcanos(chat.ONFIGURE, {key: {
|
|||||||
onclick: function(event, can, meta, target, cbs) { cbs(function(sub, cb) { if (sub.Status(mdb.TOTAL) > 0) { return }
|
onclick: function(event, can, meta, target, cbs) { cbs(function(sub, cb) { if (sub.Status(mdb.TOTAL) > 0) { return }
|
||||||
meta.msg && meta.msg.Length() > 0? sub._show(sub, meta.msg, cb, target, meta.name): sub._load(event, sub, cb, target, meta.name, target.value)
|
meta.msg && meta.msg.Length() > 0? sub._show(sub, meta.msg, cb, target, meta.name): sub._load(event, sub, cb, target, meta.name, target.value)
|
||||||
}) },
|
}) },
|
||||||
onfocus: function(event, can, meta, target, cbs) { cbs(function(sub, cb) { if (sub.Status(mdb.TOTAL) > 0) { return }
|
onfocus: function(event, can, meta, target, cbs) {
|
||||||
|
return
|
||||||
|
cbs(function(sub, cb) { if (sub.Status(mdb.TOTAL) > 0) { return }
|
||||||
meta.msg && meta.msg.Length() > 0? sub._show(sub, meta.msg, cb, target, meta.name): sub._load(event, sub, cb, target, meta.name, target.value)
|
meta.msg && meta.msg.Length() > 0? sub._show(sub, meta.msg, cb, target, meta.name): sub._load(event, sub, cb, target, meta.name, target.value)
|
||||||
}) },
|
})
|
||||||
|
},
|
||||||
onblur: function(event, can, sub, cb) { sub && can.onmotion.delay(can, sub.close, 300) },
|
onblur: function(event, can, sub, cb) { sub && can.onmotion.delay(can, sub.close, 300) },
|
||||||
onkeydown: function(event, can, meta, cb, target, sub, last) { if (event.key == code.TAB) { return }
|
onkeydown: function(event, can, meta, cb, target, sub, last) { if (event.key == code.TAB) { return }
|
||||||
if (event.key == code.ENTER) { return meta._enter && (!can.page.tagis(event.target, html.TEXTAREA) || event.ctrlKey) && meta._enter(event, target.value)? sub.close(): last(event) }
|
if (event.key == code.ENTER) { return meta._enter && (!can.page.tagis(event.target, html.TEXTAREA) || event.ctrlKey) && meta._enter(event, target.value)? sub.close(): last(event) }
|
||||||
|
@ -72,7 +72,7 @@ Volcanos(chat.ONIMPORT, {
|
|||||||
can.page.Append(can, div, [{text: arg}]), can._output.scrollTop = div.offsetTop, div.scrollBy(0, 10000), true
|
can.page.Append(can, div, [{text: arg}]), can._output.scrollTop = div.offsetTop, div.scrollBy(0, 10000), true
|
||||||
})) { can.onappend.board(can, arg) }
|
})) { can.onappend.board(can, arg) }
|
||||||
},
|
},
|
||||||
_open: function(can, msg, arg) { can.user.opens(arg); if (can.ConfIndex() == "web.dream") { can.Update() } },
|
_open: function(can, msg, arg) { can.user.open(arg); if (can.ConfIndex() == "web.dream") { can.Update() } },
|
||||||
_close: function(can, msg) { can.user.close() || history.back() },
|
_close: function(can, msg) { can.user.close() || history.back() },
|
||||||
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 }
|
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 })
|
can.page.Select(can, input.parentNode, "span.value", function(target) { target.innerText = value })
|
||||||
|
Loading…
x
Reference in New Issue
Block a user