mirror of
https://shylinux.com/x/volcanos
synced 2025-04-25 08:48:06 +08:00
opt icon
This commit is contained in:
parent
ff590400ba
commit
b72d067451
32
const.js
32
const.js
@ -354,31 +354,23 @@ var icon = {
|
||||
CHEVRON_DOWN: "bi bi-chevron-down", SEARCH: "bi bi-search", TERMINAL: "bi bi-terminal",
|
||||
SUN: "bi bi-sun", MOON: "bi bi-moon-stars",
|
||||
|
||||
help: "bi bi-question-square", doc: "bi bi-question-square",
|
||||
search: "bi bi-search", favor: "bi bi-star", save: "bi bi-floppy",
|
||||
admin: "bi bi-window-sidebar", login: "bi bi-person-check",
|
||||
|
||||
vimer: "bi bi-keyboard", build: "bi bi-tools", repos: "bi bi-git",
|
||||
xterm: "bi bi-terminal", cmds: "bi bi-terminal", cmd: "bi bi-terminal",
|
||||
cat: "bi bi-file-earmark-code",
|
||||
|
||||
record1: "bi bi-images", record2: "bi bi-record-circle",
|
||||
spide: "bi bi-diagram-3", travel: "bi bi-list-ol",
|
||||
upload: "bi bi-cloud-upload", download: "bi bi-cloud-download",
|
||||
configs: "bi bi-gear", conf: "bi bi-gear", logs: "bi bi-calendar4-week",
|
||||
help: "bi bi-question-square", doc: "bi bi-question-square",
|
||||
play: "bi bi-play-circle", full: "bi bi-arrows-fullscreen", app: "bi bi-box-arrow-up-right",
|
||||
open: "bi bi-box-arrow-up-right", main: "bi bi-box-arrow-up-right", portal: "bi bi-box-arrow-up-right",
|
||||
push: "bi bi-cloud-upload", pull: "bi bi-cloud-download",
|
||||
autogen: "bi bi-tools", preview: "bi bi-window-stack", show: "bi bi-window-stack",
|
||||
start: "bi bi-play-circle", stop: "bi bi-stop-circle",
|
||||
startall: "bi bi-play-circle", stopall: "bi bi-stop-circle",
|
||||
play: "bi bi-play-circle",
|
||||
conf: "bi bi-gear", configs: "bi bi-gear",
|
||||
inspect: "bi bi-window-stack",
|
||||
logs: "bi bi-calendar4-week",
|
||||
tag: "bi bi-tags",
|
||||
|
||||
open: "bi bi-box-arrow-up-right",
|
||||
main: "bi bi-box-arrow-up-right",
|
||||
portal: "bi bi-box-arrow-up-right",
|
||||
trash: "bi bi-trash", remove: "bi bi-trash",
|
||||
record1: "bi bi-images", record2: "bi bi-record-circle",
|
||||
upload: "bi bi-cloud-upload", download: "bi bi-cloud-download",
|
||||
more: "bi bi-three-dots-vertical", actions: "bi bi-three-dots",
|
||||
preview: "bi bi-window-stack", show: "bi bi-window-stack",
|
||||
display: "bi bi-window-desktop", exec: "bi bi-window-desktop",
|
||||
compile: "bi bi-tools", publish: "bi bi-send-check", version: "bi bi-tags", upgrade: "bi bi-rocket-takeoff",
|
||||
vimer: "bi bi-keyboard", repos: "bi bi-git", build: "bi bi-tools", tag: "bi bi-tags",
|
||||
xterm: "bi bi-terminal", cmds: "bi bi-terminal",
|
||||
}
|
||||
var svg = {
|
||||
GROUP: "group", PID: "pid", GRID: "grid",
|
||||
|
11
frame.js
11
frame.js
@ -160,8 +160,8 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) {
|
||||
back: {name: "goback", cb: function(event) { can.onimport.back(event, can) }},
|
||||
prev: {name: mdb.PREV, cb: function(event) { var sub = can.sub; sub.onaction && sub.onaction.prev? sub.onaction.prev(event, sub): can.onaction.prev(event, can) }},
|
||||
next: {name: mdb.NEXT, cb: function(event) { var sub = can.sub; sub.onaction && sub.onaction.next? sub.onaction.next(event, sub): can.onaction.next(event, can) }},
|
||||
play: {name: web.PLAY},
|
||||
favor: {name: "favor"},
|
||||
// play: {name: web.PLAY},
|
||||
// favor: {name: "favor"},
|
||||
}[item.name||""]; if (!icon) { return } item.style = "icons"
|
||||
can.page.Append(can, option, [{view: [[html.ITEM, html.ICON, icon.name, item.name], html.DIV, can.page.unicode[icon.name]], title: can.user.trans(can, item.name), onclick: icon.cb||function(event) {
|
||||
var msg = can.request(event), cmds = [ctx.ACTION, item.name]; msg.RunAction(event, can.sub, cmds) || msg.RunAction(event, can, cmds) || can.Update(event, cmds)
|
||||
@ -178,9 +178,10 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) {
|
||||
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.page.isIconInput(can, 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)))
|
||||
})
|
||||
}
|
||||
// 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
|
||||
|
@ -170,6 +170,8 @@ body>div.toast div.progress { border:var(--box-notice); margin-left:0px; height:
|
||||
body>div.toast div.progress div.current { background-color:var(--progress-bg-color); height:18px; }
|
||||
body>div.toast div.action:not(.hide) { width:100%; display:block; display:flex; flex-direction:row-reverse; gap:10px; }
|
||||
body>div.toast div.action>div.item { float:right; }
|
||||
body>div.toast div.action>div.item i { display:none; }
|
||||
body>div.toast div.action>div.item span { display:none; }
|
||||
body>div.toast div.action>div.item input { padding:0 20px; }
|
||||
body>div.toast div.action>div.item.danger input { border:var(--danger-bg-color) solid 1px; }
|
||||
body>div.toast div.action>div.item.notice input { border:var(--notice-bg-color) solid 1px; }
|
||||
@ -245,7 +247,7 @@ fieldset>div.action>div.cmds { font-style:italic; padding:var(--input-padding) v
|
||||
fieldset>div.output>div.code { font-size:var(--code-font-size); }
|
||||
fieldset>div.status { font-family:var(--status-font-family); font-size:var(--status-font-size); 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>label { font-size:var(--status-font-size); cursor:pointer; }
|
||||
fieldset>div.status>div.item>span { margin-left:var(--input-padding); }
|
||||
fieldset>div.status>legend { font-style:italic; height:31px; }
|
||||
body.mobile.landscape>div.input.login { padding:0; }
|
||||
|
13
lib/page.js
13
lib/page.js
@ -100,7 +100,7 @@ Volcanos("page", {
|
||||
}); return value
|
||||
},
|
||||
Appends: function(can, target, key, value) { return target.innerHTML = "", can.page.Append(can, target, key, value) },
|
||||
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.opens, close = can.page.unicode.closes
|
||||
function short(value, length) {
|
||||
if (length == undefined) {
|
||||
value.indexOf(lex.NL) > -1 && (value = value.trim().split(lex.NL)[0]+can.page.unicode.inner)
|
||||
@ -152,14 +152,14 @@ Volcanos("page", {
|
||||
var inner = list || target.children.length > 0 && target.innerText != target.innerHTML? can.page.unicode.inner: ""
|
||||
return {view: mdb.VIEW, list: [
|
||||
{view: [[html.ITEM, target.tagName && target.tagName.toLowerCase()]], list: [
|
||||
{text: [(inner? can.page.unicode.close: ""), "", html.TOGGLE], _init: function(target) { ui.toggle = target }},
|
||||
{text: [(inner? can.page.unicode.closes: ""), "", html.TOGGLE], _init: function(target) { ui.toggle = target }},
|
||||
{className: code.KEYWORD, text: can.page.trans(can, ice.LT)}, {className: code.KEYWORD, text: tag}, {type: html.SPAN, list: _field}, {className: code.KEYWORD, text: can.page.trans(can, ice.GT)},
|
||||
inner? {text: [inner, "", code.INNER], _init: function(target) { ui.inner = target }}:
|
||||
target.innerText? {text: target.innerText, _init: function(target) { ui.inner = target }}:
|
||||
null,
|
||||
{className: code.KEYWORD, text: can.page.trans(can, ice.LT+nfs.PS+tag+ice.GT), _init: function(target) { ui._close = target }},
|
||||
], onclick: inner && function(event) {
|
||||
ui.toggle.innerText = (can.onmotion.toggle(can, ui.list)? can.page.unicode.open: can.page.unicode.close)+lex.SP
|
||||
ui.toggle.innerText = (can.onmotion.toggle(can, ui.list)? can.page.unicode.opens: can.page.unicode.closes)+lex.SP
|
||||
if (target.children.length == 0 && !list) { return }
|
||||
ui.inner && can.onmotion.toggle(can, ui.inner), can.onmotion.toggle(can, ui.close), can.onmotion.toggle(can, ui._close)
|
||||
if (!loaded) { if (can.page.tagis(target, ctx.STYLE, nfs.SCRIPT)) { can.page.Append(can, ui.list, [{text: target.innerHTML}]) } else {
|
||||
@ -299,7 +299,7 @@ Volcanos("page", {
|
||||
tagClass: function(target) { return target.tagName.toLowerCase()+(target.className? nfs.PT+target.className.replaceAll(lex.SP, nfs.PT): "") },
|
||||
isDisplay: function(target) { return target && target.style.display != html.NONE && target.className.indexOf(html.HIDE) == -1 },
|
||||
isIconInput: function(can, name) {
|
||||
return can.base.isIn(name, mdb.CREATE, mdb.INSERT, mdb.PRUNES, mdb.PRUNE, ice.HELP, cli.START, web.REFRESH) || icon[name] || can.Conf("feature._icons."+name)
|
||||
return can.base.isIn(name, mdb.CREATE, mdb.INSERT, mdb.PRUNES, mdb.PRUNE, ice.HELP, cli.START, cli.CLOSE, web.REFRESH) || icon[name] || can.Conf("feature._icons."+name)
|
||||
},
|
||||
editable: function(can, item, ok) { item.setAttribute("contenteditable", ok) },
|
||||
draggable: function(can, item, ok) { item.setAttribute("draggable", ok) },
|
||||
@ -308,8 +308,9 @@ Volcanos("page", {
|
||||
ismodkey: function(event) { return [code.META, code.ALT, code.CONTROL, code.SHIFT].indexOf(event.key) > -1 },
|
||||
unicode: { // https://symbl.cc/cn/
|
||||
refresh: "↻", goback: "↺", play: "▶", create: "+", insert: "+", prunes: "♻︎", prune: "♻︎",
|
||||
select: "▿", remove: "✕", delete: "✕",
|
||||
menu: "☰", open: "▾", close: "▸",
|
||||
select: "▿", remove: "✕", delete: "✕", close: "✕",
|
||||
menu: "☰",
|
||||
opens: "▾", closes: "▸",
|
||||
prev: "❮", next: "❯",
|
||||
|
||||
start: "+", // play: "▸",
|
||||
|
@ -87,7 +87,7 @@ Volcanos(chat.ONPLUGIN, {
|
||||
]}].concat(can.core.List(can.misc._list, function(list) { stat[list[2]] = ((stat[list[2]]||0)+1); return (!arg || !arg[0] || arg[0] == "log" || arg[0] == list[2]) && {type: html.TR, list: [
|
||||
{type: html.TD, list: can.core.List(list, function(item, index) { var vimer
|
||||
if (index == 1) { var _ls = new RegExp("(https*://[^/]+)*/*([^:]+):([0-9]+):([0-9]+)").exec(list[1])||[]; _ls[2] = (_ls[2]||"").split(ice.QS)[0]||""
|
||||
return {view: [html.ITEM, html.SPAN], list: [{text: lex.SP+can.page.unicode.close+lex.SP}, {text: [(_ls[1] == location.origin? "": _ls[1]||"")+_ls[2]+nfs.DF+_ls[3], "", nfs.PATH], onclick: function(event) {
|
||||
return {view: [html.ITEM, html.SPAN], list: [{text: lex.SP+can.page.unicode.closes+lex.SP}, {text: [(_ls[1] == location.origin? "": _ls[1]||"")+_ls[2]+nfs.DF+_ls[3], "", nfs.PATH], onclick: function(event) {
|
||||
if (can.onexport.record(can, list[1], web.LINK, {time: list[0], link: list[1], type: list[2], path: nfs.USR_VOLCANOS, file: _ls[2], line: _ls[3]})) { return }
|
||||
if (vimer) { return can.page.Remove(can, vimer._target), vimer = null }
|
||||
vimer = can.onappend.plugin(_can, {index: web.CODE_INNER, args: [nfs.USR_VOLCANOS, _ls[2], _ls[3]]}, function(sub) {}, event.target.parentNode)
|
||||
@ -95,10 +95,10 @@ Volcanos(chat.ONPLUGIN, {
|
||||
} if (!can.base.isObject(item)) { return item && {text: (index > 0? lex.SP: "")+item} }
|
||||
return {view: [mdb.DATA, html.SPAN], _init: function(target) {
|
||||
if (item.tagName) { var detail; var ui = can.page.Append(can, target, [{text: lex.SP},
|
||||
{text: can.page.unicode.close+lex.SP, _init: function(target) { can.onmotion.delay(can, function() { ui.toggle = target }) }},
|
||||
{text: can.page.unicode.closes+lex.SP, _init: function(target) { can.onmotion.delay(can, function() { ui.toggle = target }) }},
|
||||
{view: [[html.ITEM, nfs.TARGET], html.SPAN, can.page.tagClass(item)], onclick: function() {
|
||||
if (detail) { return can.page.Remove(can, detail), detail = null, can.page.Modify(can, ui.toggle, can.page.unicode.close+lex.SP) }
|
||||
detail = can.page.AppendData(can, target, "", "", item)._target, detail.click(), can.page.Modify(can, ui.toggle, can.page.unicode.open+lex.SP)
|
||||
if (detail) { return can.page.Remove(can, detail), detail = null, can.page.Modify(can, ui.toggle, can.page.unicode.closes+lex.SP) }
|
||||
detail = can.page.AppendData(can, target, "", "", item)._target, detail.click(), can.page.Modify(can, ui.toggle, can.page.unicode.opens+lex.SP)
|
||||
}},
|
||||
]) } else { can.page.Append(can, target, [{text: lex.SP}]), can.page.AppendData(can, target, "", "", item) }
|
||||
}}
|
||||
|
@ -91,7 +91,7 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, target) { can.onmotion.clear(
|
||||
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 ui = can.page.Append(can, node[last], [{view: html.ITEM, list: [
|
||||
{view: [[html.EXPAND, 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.closes)]},
|
||||
{view: [mdb.NAME, html.DIV, value], _init: item._init},
|
||||
], onclick: function(event) { if (node[name].childElementCount == 2) { node[name].firstChild.click() }
|
||||
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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user