1
0
forked from x/volcanos
This commit is contained in:
IT 老营长 @云轩领航-创始人 2023-04-24 16:02:06 +08:00
parent 019791e42f
commit 52a02bef40
5 changed files with 10 additions and 20 deletions

View File

@ -464,13 +464,11 @@ Volcanos(chat.ONAPPEND, {_init: function(can, meta, list, cb, target, field) {
sub._index = value.index||meta.index, can.base.isFunc(cb) && cb(sub, meta, skip)
}, target||can._output, field)
},
_float: function(can, index, args, cb) {
can.onappend.plugin(can, {index: index, args: args, mode: chat.FLOAT}, function(sub) {
can.getActionSize(function(left, top, width, height) { sub.onimport.size(sub, sub.ConfHeight(height/2), sub.ConfWidth(width), true)
can.onmotion.move(can, sub._target, {left: left||0, top: (top||0)+height/4}), can.base.isFunc(cb) && cb(sub)
}), sub.onaction.close = function() { can.page.Remove(can, sub._target) }
}, can._root._target)
},
_float: function(can, index, args, cb) { can.onappend.plugin(can, {index: index, args: args, mode: chat.FLOAT}, function(sub) {
can.getActionSize(function(left, top, width, height) { sub.onimport.size(sub, sub.ConfHeight(height*3/4)-html.ACTION_HEIGHT, sub.ConfWidth(width), true)
can.onmotion.move(can, sub._target, {left: left||0, top: (top||0)+height/4}), can.base.isFunc(cb) && cb(sub)
}), sub.onaction.close = function() { can.page.Remove(can, sub._target) }
}, can._root._target) },
figure: function(can, meta, target, cb) { if (meta.type == html.SELECT || meta.type == html.BUTTON) { return }
var input = meta.action||mdb.KEY, path = chat.PLUGIN_INPUT+input+nfs._JS; can.require([path], function(can) {
function _cb(sub, value, old) { if (value == old) { return } can.base.isFunc(cb)? cb(sub, value, old): target.value = value }

View File

@ -84,6 +84,7 @@ fieldset.input.date table.content { text-align:center; width:350px; }
fieldset.input.date div.output td { padding:2px 10px; }
fieldset.input.date div.output td.prev { color:gray; }
fieldset.input.date div.output td.next { color:gray; }
fieldset.input.date div.output td.select { background-color:#5066b945; }
fieldset.input.date div.output td span.lunar { font-size:8px; display:block; clear:both; }
fieldset.input.date div.output td span.lunar.term { color:green; }
fieldset.input.date div.output td span.lunar.fest { color:red; }

View File

@ -11,10 +11,7 @@ fieldset.word>div.output>fieldset.story:not(:hover)>form.option { display:none;
fieldset.word>div.output>fieldset.story:not(:hover)>div.action { display:none; }
fieldset.word a { word-break:break-all; }
fieldset.word img { word-break:break-all; }
fieldset.word svg.story.auto defs marker { stroke:red; fill:red; }
body.white fieldset.word svg.story.auto defs marker { stroke:red; fill:red; }
fieldset.word svg.story[data-index] text { cursor:pointer; }
fieldset.word.play.float { top:0; }
fieldset.word.play.float>div.action { display:contents; }
fieldset.word.play.float>div.status { clear:none; }
@ -25,10 +22,4 @@ fieldset.word.play.float div.content.grid div.page { background-color:#a4cbecb5;
fieldset.word.play.float h1 { text-align:center; }
fieldset.word.play.float h2 { text-align:center; }
fieldset.word.play.float h3 { text-align:center; }
fieldset.word.cmd>legend { display:none; }
fieldset.word.cmd>form.option { display:none; }
fieldset.word.cmd>div.action { display:none; }
fieldset.word.cmd>div.status { display:none; }
div.story[data-type=spark] label { user-select:none; }
div.story[data-type=spark] label { user-select:none; }

View File

@ -52,7 +52,7 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, target) { can.onmotion.clear(
can.page.style(can, target, html.MAX_WIDTH, can.ConfWidth(), html.OVERFLOW, ice.AUTO)
if (!meta.fg && !meta.bg) { target.className.baseVal = "story auto" }
target.onclick = function(event) { can.misc.Event(event, can, function(msg) {
meta.index && can.runActionCommand(can.request(event, meta), meta.index, [nfs.FIND, event.target.innerHTML])
meta.index && can.onappend._float(can, meta.index, [event.target.innerHTML])
}) }
target.oncontextmenu = function(event) { can.misc.Event(event, can, function(msg) {
var ui = can.user.carte(event, can, kit.Dict(mdb.EXPORT, function(event, can, button) {

View File

@ -16,7 +16,7 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb) { can.page.requireDraw(ca
return tree.width = can.onimport.draw(can, {shape: html.TEXT, points: [{x: 0, y: 0}], style: {inner: tree.name}}).Val(svg.TEXT_LENGTH)+can.margin
} can.core.List(tree.list, function(item) { tree.width += can.onimport._width(can, item) }); return tree.width },
_color: function(can, tree) { return tree.meta.color || (tree.list == 0? cli.PURPLE: cli.YELLOW) },
layout: function(can) { can.page.style(can, can._output, html.MAX_HEIGHT, "")
layout: function(can) { can.page.ClassList.has(can, can._fields, html.FLOAT) || can.page.style(can, can._output, html.MAX_HEIGHT, "")
can.svg && can.svg.Val(svg.FONT_SIZE, can.size = parseInt(can.Action(html.SIZE)||24)), can.margin = parseInt(can.Action(html.MARGIN)||10)
can.core.CallFunc(can.onaction[can.Action(ice.VIEW)||"横向"], [event, can, can.Action(ice.VIEW)])
},