1
0
forked from x/volcanos
This commit is contained in:
IT 老营长 @云轩领航-创始人 2025-01-25 15:15:52 +08:00
parent d409358c30
commit 4d59ba0b77
3 changed files with 14 additions and 10 deletions

View File

@ -166,13 +166,8 @@ Volcanos(chat.ONAPPEND, {
return can.base.isUndefined(value)? (value = target.innerText): (target.innerHTML = value.trim? value.trim(): value+"") return can.base.isUndefined(value)? (value = target.innerText): (target.innerHTML = value.trim? value.trim(): value+"")
}); return value }); return value
} catch (e) {} }, } catch (e) {} },
Action: function(key, value) { Action: function(key, value) { return can.page.SelectArgs(can, action, key, value)[0] },
// value && (value = can.user.trans(sub, value, null, html.INPUT)) Option: function(key, value) { return can.page.SelectArgs(can, option, key, value)[0] },
return can.page.SelectArgs(can, action, key, value)[0]
},
Option: function(key, value) {
// value && (value = can.user.trans(sub, value, null, html.INPUT));
return can.page.SelectArgs(can, option, key, value)[0] },
Update: function(event, cmds, cb, silent) { event = event||{}, sub.request(event)._caller(), event.metaKey && sub.request(event, {metaKey: ice.TRUE}) Update: function(event, cmds, cb, silent) { event = event||{}, sub.request(event)._caller(), event.metaKey && sub.request(event, {metaKey: ice.TRUE})
var msg = sub.request(event), list = can.core.Value(sub, "sub.db._checkbox"); can.core.Item(list, function(key, value) { msg.Option(key, value) }) var msg = sub.request(event), list = can.core.Value(sub, "sub.db._checkbox"); can.core.Item(list, function(key, value) { msg.Option(key, value) })
sub.request(event, sub.Option()) sub.request(event, sub.Option())

View File

@ -5,8 +5,10 @@ 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" const VIEW_CREATE = "tabview.view.create", VIEW_REMOVE = "tabview.view.remove", LINE_SELECT = "tabview.line.select"
Volcanos(chat.ONIMPORT, { Volcanos(chat.ONIMPORT, {
_init: function(can, msg, cb) { can.onappend.style(can, code.INNER), can.Mode(msg.Option("mode")||can.Mode()) _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.base.Max(can.ConfWidth(), window.innerWidth-12)) 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) msg.result = msg.result||[can._output.innerHTML], can.Mode(chat.SIMPLE), can.sup.Mode(chat.SIMPLE)
can.Option(nfs.FILE, can.Conf(nfs.FILE)||can.Option(nfs.FILE))
} }
can.onmotion.clear(can, can._output), msg.result = msg.result||[""] can.onmotion.clear(can, can._output), msg.result = msg.result||[""]
var paths = can.core.Split(can.Option(nfs.PATH)); can.Option(nfs.PATH, paths[0]) var paths = can.core.Split(can.Option(nfs.PATH)); can.Option(nfs.PATH, paths[0])
@ -579,7 +581,9 @@ Volcanos(chat.ONEXPORT, {
selection: function(can, str) { var s = document.getSelection().toString(), begin = str.indexOf(s), end = begin+s.length selection: function(can, str) { var s = document.getSelection().toString(), begin = str.indexOf(s), end = begin+s.length
for (var i = begin; i >= 0; i--) { if (str[i].match(/[a-zA-Z0-9_.]/)) { s = str.slice(i, end) } else { break } } return s for (var i = begin; i >= 0; i--) { if (str[i].match(/[a-zA-Z0-9_.]/)) { s = str.slice(i, end) } else { break } } return s
}, },
parse: function(can) { return can._msg.Option(lex.PARSE)||can.base.Ext(can.Option(nfs.FILE)) }, parse: function(can) {
return can._msg.Option(lex.PARSE)||can.base.Ext(can.Option(nfs.FILE))
},
split: function(can, file) { var ls = file.split(nfs.PS); if (ls.length == 1) { return [nfs.PWD, ls[0]] } split: function(can, file) { var ls = file.split(nfs.PS); if (ls.length == 1) { return [nfs.PWD, ls[0]] }
if (ls[0] == ice.USR) { return [ls.slice(0, 2).join(nfs.PS)+nfs.PS, ls.slice(2).join(nfs.PS)] } if (ls[0] == ice.USR) { return [ls.slice(0, 2).join(nfs.PS)+nfs.PS, ls.slice(2).join(nfs.PS)] }
return [ls.slice(0, 1).join(nfs.PS)+nfs.PS, ls.slice(1).join(nfs.PS)] return [ls.slice(0, 1).join(nfs.PS)+nfs.PS, ls.slice(1).join(nfs.PS)]

View File

@ -2,7 +2,12 @@ fieldset.word>div.output { padding:var(--plugin-padding); }
fieldset.word>div.output p { margin:var(--title-margin) auto; } fieldset.word>div.output p { margin:var(--title-margin) auto; }
fieldset.word>div.output h3 { margin-top:var(--title-margin); } fieldset.word>div.output h3 { margin-top:var(--title-margin); }
fieldset.word>div.output h2.story[data-type=spark][data-name=title] { text-align:center; } fieldset.word>div.output h2.story[data-type=spark][data-name=title] { text-align:center; }
fieldset.word>div.output ul { margin:20px; } fieldset.word>div.output code {
font-style: italic;
}
fieldset.word>div.output ul {
margin:20px; font-family:var(--code-font-family);
}
fieldset.word>div.output ul>li:hover { background-color:var(--hover-bg-color); color:var(--hover-fg-color); cursor:pointer; } fieldset.word>div.output ul>li:hover { background-color:var(--hover-bg-color); color:var(--hover-fg-color); cursor:pointer; }
fieldset.word>div.output img { display:block; margin:auto; max-height:100%; max-width:100%; } fieldset.word>div.output img { display:block; margin:auto; max-height:100%; max-width:100%; }
fieldset.word>div.output div.project img { margin:unset; } fieldset.word>div.output div.project img { margin:unset; }