mirror of
https://shylinux.com/x/volcanos
synced 2025-04-25 08:48:06 +08:00
add some
This commit is contained in:
parent
4f80806c45
commit
a158908876
13
lib/misc.js
13
lib/misc.js
@ -129,11 +129,8 @@ Volcanos("misc", {
|
||||
_caller: function(skip) { msg.Option("log.caller") || msg.Option("log.caller", can.misc.fileLine((skip||2)+3).link); return msg },
|
||||
isDebug: function() { return msg.Option(log.DEBUG) == ice.TRUE },
|
||||
}); return msg },
|
||||
Inputs: function(can, msg, cmds, cb, meta) {
|
||||
var event = msg._event
|
||||
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]})
|
||||
msg.Option(ctx.ACTION, cmds[1])
|
||||
Inputs: function(can, msg, cmds, cb, meta) { var event = msg._event
|
||||
if (msg.Option(ice.MSG_HANDLE) != ice.TRUE && cmds && cmds[0] == ctx.ACTION && meta.feature[cmds[1]]) { msg.Option(ctx.ACTION, cmds[1])
|
||||
var action = meta.feature[cmds[1]]; if (can.base.isFunc(action)) { cb = cb||function() { can.Update() }
|
||||
return action.list && action.list.length > 0? can.user.input(event, can, action.list, function(data) {
|
||||
can.core.CallFunc(action, {can: can, msg: can.request(event, data), arg: cmds.slice(2), cb: cb})
|
||||
@ -143,11 +140,9 @@ Volcanos("misc", {
|
||||
can.onmotion.delay(can, function() { can.page.ClassList.add(can, input._target, html.PROCESS) })
|
||||
can.Update(can.request(event, can.Option(), {_handle: ice.TRUE, _cancel: function(event) {
|
||||
can.page.ClassList.del(can, input._target, html.PROCESS)
|
||||
}}, msg), cmds.slice(0, 2).concat(args), function(msg) {
|
||||
can.page.ClassList.del(can, input._target, html.PROCESS)
|
||||
if (msg.IsErr()) {
|
||||
}}, msg), cmds.slice(0, 2).concat(args), function(msg) { can.page.ClassList.del(can, input._target, html.PROCESS)
|
||||
if (msg.IsErr()) { input.focus()
|
||||
can.onappend.style(can, "warn", can.user.toastFailure(can, msg.Result())._target)
|
||||
input.focus()
|
||||
} else {
|
||||
if (cb && cb(msg)) { return }
|
||||
input.cancel({}, can)
|
||||
|
@ -5,7 +5,7 @@ const CURRENT_FILE = "web.code.inner:currentFile", SELECT_LINE = "selectLine"
|
||||
const VIEW_CREATE = "tabview.view.create", VIEW_REMOVE = "tabview.view.remove", LINE_SELECT = "tabview.line.select"
|
||||
Volcanos(chat.ONIMPORT, {
|
||||
_init: function(can, msg, cb) { can.onappend.style(can, code.INNER), can.Mode(msg.Option("mode")||can.Mode())
|
||||
if (can.Mode() == ice.MSG_RESULT) { can.Conf("_width", can.ConfWidth())
|
||||
if (can.Mode() == ice.MSG_RESULT) { can.Conf("_width", can.base.Max(can.ConfWidth(), window.innerWidth-12))
|
||||
msg.result = msg.result||[can._output.innerHTML], can.Mode(chat.SIMPLE), can.sup.Mode(chat.SIMPLE)
|
||||
}
|
||||
can.onmotion.clear(can, can._output), msg.result = msg.result||[""]
|
||||
|
@ -12,17 +12,20 @@ Volcanos(chat.ONIMPORT, {
|
||||
},
|
||||
card: function(can, msg, target, filter) { target = target||can.ui.content||can._output
|
||||
can.page.Append(can, target, msg.Table(function(value) { if (filter && filter(value)) { return }
|
||||
var img = can.misc.Resource(can, value.icon = value.icons||value.icon||value.image)
|
||||
var img = can.misc.ResourceIcons(can, value.icon = value.icons||value.icon||value.image)
|
||||
return {view: [[html.ITEM, value.type, value.status, "s-"+value.name]], list: [
|
||||
{view: [wiki.TITLE, html.DIV], list: [
|
||||
value.icon && {className: can.base.contains(img, ".jpg")? "jpg": "", img: img},
|
||||
img && {className: can.base.contains(img, ".jpg")? "jpg": "", img: img},
|
||||
{view: wiki.TITLE, list: [{text: value.name}, value.exists == "true" && {text: ["●", "", "exists"]}, can.onappend.label(can, value)]},
|
||||
]}, {view: [wiki.CONTENT, html.DIV, value.text]},
|
||||
{view: html.ACTION, inner: value.action, _init: function(target) { can.onappend.mores(can, target, value, html.CARD_BUTTON)
|
||||
can.page.Select(can, target, html.INPUT, function(target) { can.onappend.style(can, target.name, target) })
|
||||
}},
|
||||
]}
|
||||
})), can.onimport.layout = can.onimport.layout||function() { var height = can.onlayout.expand(can, target); can.sup.onexport.outputMargin = function() { return height } }
|
||||
})), can.onimport.layout = can.onimport.layout||function() {
|
||||
var height = can.onlayout.expand(can, target); can.sup.onexport.outputMargin = function() { return height }
|
||||
can.onmotion.delay(can, function() { can.onlayout.expand(can, target) })
|
||||
}
|
||||
},
|
||||
icon: function(can, msg, target, cb) { msg.Table(function(value) {
|
||||
var icon = can.misc.Resource(can, value.icons||value.icon||can.page.drawText(can, value.name, 80), value.space||msg.Option(ice.MSG_USERPOD), msg.Option(ice.MSG_USERWEB))
|
||||
|
Loading…
x
Reference in New Issue
Block a user