1
0
mirror of https://shylinux.com/x/volcanos synced 2025-04-25 08:48:06 +08:00
This commit is contained in:
IT 老营长 @云轩领航-创始人 2024-05-05 17:32:29 +08:00
parent 05049d36a8
commit c515c8229f
5 changed files with 21 additions and 10 deletions

View File

@ -202,6 +202,9 @@ div.project div.list fieldset { position:static; }
div.project div.item.select {
border-right:var(--box-notice3);
}
div.project div.item:not(.hide) i:first-child {
margin-right:var(--input-margin);
}
div.project div.item:not(.hide) {
// white-space:pre;
line-height:24px;

View File

@ -243,7 +243,7 @@ Volcanos("user", {
html.ACTION, {view: html.OUTPUT, list: ["progress"]}, {view: html.STATUS, list: [html.SHOW, cli.COST, nfs.SIZE]},
]}]); can.onlayout.figure(event, can, ui._target)
var action = can.onappend._action(can, [{type: html.UPLOAD, onchange: function(event) { action.show(event, 0, event.target.files[0].size, 0) }}, {type: html.BUTTON, name: cli.CLOSE}], ui.action, {
begin: function(event) { begin = new Date()
begin: function() { begin = new Date()
var upload = can.page.Select(can, ui.action, html.INPUT_FILE)[0]; if (upload.files.length == 0) { return upload.focus() }
var msg = can.request(event, can.Option(), {_handle: ice.TRUE}); msg._upload = upload.files[0], msg._progress = action.show
can.runAction(event, html.UPLOAD, [], function(msg) { can.base.isFunc(cb)? cb(msg): can.Update(), action.close(), can.user.toastSuccess(can) })

View File

@ -54,10 +54,7 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb) { var paths = can.core.Sp
link.cmd == web.CODE_VIMER? can.onimport.tabview(can, link.path, link.file, link.line): can.onimport.tabview(can, link.path, link.cmd, ctx.INDEX)
} }, can.base.isFunc(cb) && cb(msg)
},
_tabs: function(can) {
if (!can.isCmdMode()) {
return can.ui._tabs = can._action
}
_tabs: function(can) { if (!can.isCmdMode()) { return can.ui._tabs = can._action }
var ui = can.page.Append(can, can.ui.tabs, ["icon", "tabs", "head"]); can.ui._tabs = ui.tabs
can.page.Append(can, ui.icon, can.core.List([
{name: can.page.unicode.menu, onclick: function() { can.user.carte(event, can, can.onaction, can.onaction.list) }},
@ -188,7 +185,12 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb) { var paths = can.core.Sp
history: function(can, record) { can.base.Eq(record, can.db.history[can.db.history.length-1], mdb.TEXT) || can.db.history.push(record)
return can.Status(ice.BACK, can.db.history.length), record
},
project: function(can, path) { can.onmotion.clear(can, can.ui.project), can.onimport.zone(can, can.core.Item(can.onfigure, function(name, cb) {
project: function(can, path) {
if (can.Conf("style") == "output") {
can.onmotion.hidden(can, can.ui.project)
return
}
can.onmotion.clear(can, can.ui.project), can.onimport.zone(can, can.core.Item(can.onfigure, function(name, cb) {
if (can.base.isFunc(cb)) { return {name: name, icon: cb.meta? cb.meta.icon: "", _trans: can.onfigure._trans? can.onfigure._trans[name]||"": "", _toggle: function() { can.onimport.layout(can) }, _init: function(target, zone) { return cb(can, target, zone, path) }} }
}), can.ui.project) },
profile: function(can, msg) { var _msg = can.db.tabview[can.onexport.keys(can)]; _msg.Option(html.WIDTH, msg.Option(html.WIDTH)), border = 1

View File

@ -19,7 +19,7 @@ fieldset.word>div.navmenu div.list { margin-left:var(--title-margin); }
fieldset.word>div.navmenu div.item { font-size:1.4em; font-weight:bold; font-family:cursive; padding:var(--input-padding) var(--title-margin); }
fieldset.word>div.navmenu>div.item { font-size:1.6em; }
div.story[data-type=spark] label { user-select:none; }
div.story[data-type=spark] label { -webkit-user-select:none; }
div.story[data-type=spark_tabs] { margin-top:var(--title-margin); }
div.story[data-type=spark_tabs]>div.tabs>div.item { font-style:italic; padding:var(--input-padding) var(--button-padding); height:var(--action-height); float:left; }
div.story[data-type=spark_tabs]>div.tabs>div.item.select { border-bottom:var(--box-notice3); }

View File

@ -124,9 +124,11 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, target) {
icon && (can.base.contains(icon, ice.HTTP, ".ico", ".png", ".jpg")? {img: can.misc.Resource(can, icon)}: {icon: icon}),
{text: nick}], title: item.title||nick, onclick: function(event) {
can.onmotion.select(can, target, html.DIV_ITEM, event.currentTarget)
cb(event, item, event.currentTarget._list && can.onmotion.toggle(can, event.currentTarget._list))
cb(event, item, event.currentTarget._list && can.onmotion.toggle(can, event.currentTarget._list), ui._target)
}, oncontextmenu: oncontextmenu,
}]); return ui._target
}])
item._select && ui._target.click()
return ui._target
},
itemtabs: function(can, list, cb, cbs, target) { can.db._list = {}
function savetabs() { can.misc.sessionStorage(can, [can.ConfIndex(), html.TABS], can.page.Select(can, can._action, html.DIV_TABS, function(target) { return target._item.hash })) }
@ -149,6 +151,7 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, target) {
})
},
itemlist: function(can, list, cb, cbs, target) { if (!list || list.length == 0) { return }
if (!target) { return can.core.List(list, function(value) { can.onimport.item(can, value, cb, cbs) }) }
var _select
target._list = can.page.insertBefore(can, [{view: html.LIST, list: can.core.List(list, function(item) { var icon = item.icon||item.icons
return {view: html.ITEM, list: [
@ -156,7 +159,9 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, target) {
{text: item.nick||item.name||item.zone}
], _init: function(target) {
item._select && (_select = target)
}, onclick: function(event) {
}, onclick: function(event) { var target = event.currentTarget
target && can.page.Select(can, can.ui.project, html.DIV_ITEM, function(target) { can.page.ClassList.del(can, target, html.SELECT) })
for (var p = target; p; p = p.parentNode.previousElementSibling) { can.page.ClassList.add(can, p, html.SELECT) }
cb(event, item, event.currentTarget._list && can.onmotion.toggle(can, event.currentTarget._list), event.currentTarget)
}, oncontextmenu: function(event) {
if (can.base.isFunc(cbs)) { var menu = cbs(event, event.currentTarget); if (menu) { return can.user.carteRight(event, can, menu.meta, menu.list, menu) } }
@ -199,6 +204,7 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, target) {
return {view: [[html.TABS, tabs.type, tabs.role, tabs.status]], title: tabs.title||tabs.text, list: [tabs.icon && {icon: tabs.icon}, {text: [tabs.nick||tabs.name, html.SPAN, mdb.NAME]}, {icon: mdb.DELETE, onclick: function(event) {
tabs._target._close(), can.onkeymap.prevent(event)
}}], onclick: function(event) {
if (can.page.ClassList.has(can, tabs._target, html.SELECT)) { return }
can.onmotion.select(can, action, html.DIV_TABS, tabs._target), can.base.isFunc(cb) && cb(event, tabs)
}, _init: function(target) {
if (action == can._action) {