1
0
mirror of https://shylinux.com/x/volcanos synced 2025-04-25 16:58:06 +08:00
This commit is contained in:
IT 老营长 @云轩领航-创始人 2023-07-12 22:47:14 +08:00
parent 065db9b1d6
commit 20ac545320
4 changed files with 16 additions and 24 deletions

View File

@ -1,4 +1,4 @@
fieldset.Footer>div.output { height:32px; font-style:italic; } fieldset.Footer>div.output { height:32px; font-style:italic; overflow:hidden; }
fieldset.Footer>div.output div.item { font-family:unset; padding:7px; float:left; } fieldset.Footer>div.output div.item { font-family:unset; padding:7px; float:left; }
fieldset.Footer>div.output div.title:first-child { text-align:center; width:230px; } fieldset.Footer>div.output div.title:first-child { text-align:center; width:230px; }
fieldset.Footer>div.output div.state { float:right; } fieldset.Footer>div.output div.state { float:right; }

View File

@ -1,6 +1,6 @@
(function() { var NTIP = "ntip", NLOG = "nlog", NCMD = "ncmd", NKEY = "nkey" (function() { var NTIP = "ntip", NLOG = "nlog", NCMD = "ncmd", NKEY = "nkey"
Volcanos(chat.ONIMPORT, {_init: function(can, msg, target) { can.Conf(NKEY, can.core.Item(can.misc.localStorage(can)).length) Volcanos(chat.ONIMPORT, {_init: function(can, msg, target) { can.Conf(NKEY, can.core.Item(can.misc.localStorage(can)).length)
can.ondaemon._init(can); if (can.user.mod.isCmd) { return } can.Conf("version", can.base.trimPrefix(window._version, "?")) can.ondaemon._init(can); if (can.user.mod.isCmd) { return } can.Conf("version", can.base.trimPrefix(window._version, "?_v="))
can.onimport._title(can, msg, target), can.onimport._command(can, msg, target) can.onimport._title(can, msg, target), can.onimport._command(can, msg, target)
can.onimport._state(can, msg, target), can.onimport._toast(can, msg, target) can.onimport._state(can, msg, target), can.onimport._toast(can, msg, target)
}, },

View File

@ -393,8 +393,7 @@ var Volcanos = shy({iceberg: "/chat/", volcano: "/frame.js", cache: {}, pack: {}
}) })
try { if (typeof(window) == lang.OBJECT) { var meta = Volcanos.meta try { if (typeof(window) == lang.OBJECT) { var meta = Volcanos.meta
meta.target = document.body, meta._height = window.innerHeight, meta._width = window.innerWidth meta.target = document.body, meta._height = window.innerHeight, meta._width = window.innerWidth
var debug = location.search.indexOf("debug=true") > 0 && (window.parent.outerWidth-window.parent.innerWidth < 100) meta.version = window._version, window.parent.outerWidth-window.parent.innerWidth > 100 && (meta.version = "")
meta.version = window._version+(debug? "&_tt="+(new Date()).getTime(): "")
meta._load = function(url, cb) { meta._load = function(url, cb) {
switch (url.split(ice.QS)[0].split(nfs.PT).pop().toLowerCase()) { switch (url.split(ice.QS)[0].split(nfs.PT).pop().toLowerCase()) {
case nfs.CSS: var item = document.createElement(mdb.LINK); item.href = url+meta.version, item.rel = "stylesheet", item.onload = cb, document.head.appendChild(item); break case nfs.CSS: var item = document.createElement(mdb.LINK); item.href = url+meta.version, item.rel = "stylesheet", item.onload = cb, document.head.appendChild(item); break

View File

@ -59,26 +59,19 @@ setTimeout(function() { Volcanos({
}) })
} }
}, },
field: function(can, msg, arg) { field: function(can, msg, arg) { can.onappend.plugin(can, {type: chat.CONTEXTS, index: arg[0], args: can.base.Obj(arg[1])}, function(sub, meta) {
can.onappend.plugin(can, {type: chat.CONTEXTS, index: arg[0], args: can.base.Obj(arg[1])}, function(sub, meta) { var height = can.base.Max(window.innerHeight-sub._target.offsetTop-2*html.ACTION_HEIGHT, 160), width = can.base.Max(window.innerWidth-sub._target.offsetLeft, 600)
var height = can.base.Max(window.innerHeight-sub._target.offsetTop-2*html.ACTION_HEIGHT, 200)
var width = can.base.Max(window.innerWidth-sub._target.offsetLeft, 800)
sub.Conf({height: height, width: width}), sub._legend.innerText = meta.help sub.Conf({height: height, width: width}), sub._legend.innerText = meta.help
sub.run = function(event, cmds, cb) { msg.RunAction(event, can, cmds) || can.runActionCommand(event, meta.index, cmds, function(msg) { sub.run = function(event, cmds, cb) { msg.RunAction(event, can, cmds) || can.runActionCommand(event, meta.index, cmds, function(msg) {
can.onmotion.toggle(can, sub._option, true), can.onmotion.toggle(can, sub._action, true), can.onmotion.toggle(can, sub._output, true), can.onmotion.toggle(can, sub._status, true) can.onmotion.toggle(can, sub._option, true), can.onmotion.toggle(can, sub._action, true), can.onmotion.toggle(can, sub._output, true), can.onmotion.toggle(can, sub._status, true)
can.page.style(can, sub._output, html.MAX_HEIGHT, height, html.MAX_WIDTH, width) can.onimport.size(sub, height, width, true), can.base.isFunc(cb) && cb(msg)
can.page.style(can, sub._target, html.LEFT, window.innerWidth-width, html.TOP, window.innerHeight-height-2*html.ACTION_HEIGHT)
can.base.isFunc(cb) && cb(msg)
}) } }) }
sub._target.onclick = function() { can.onmotion.move(can, sub._target, {left: msg.Option(html.LEFT)||window.innerWidth-width, top: msg.Option(html.TOP)||window.innerHeight-height-2*html.ACTION_HEIGHT, right: msg.Option(html.RIGHT), bottom: msg.Option(html.BOTTOM)})
can.page.Select(can, document.body, can.page.Keys("div.carte.float"), function(target) { can.page.Remove(can, target) }) sub._target.onclick = function() { can.page.Select(can, document.body, can.page.Keys("div.carte.float"), function(target) { can.page.Remove(can, target) }) }
} // sub._legend.onclick = function(event) { can.onmotion.toggle(can, sub._option), can.onmotion.toggle(can, sub._action), can.onmotion.toggle(can, sub._output), can.onmotion.toggle(can, sub._status) }
can.onmotion.move(can, sub._target, {left: msg.Option(html.LEFT), top: msg.Option(html.TOP), right: msg.Option(html.RIGHT), bottom: msg.Option(html.BOTTOM)}) msg.Option("selection") && can.onengine.listen(can, "onselection", function() { sub.Option(msg.Option("selection"), window.getSelection()), sub.Update() })
sub._legend.onclick = function(event) { can.onmotion.toggle(can, sub._option), can.onmotion.toggle(can, sub._action), can.onmotion.toggle(can, sub._output), can.onmotion.toggle(can, sub._status) }
msg.Option("selection")? can.onengine.listen(can, "onselection", function() { sub.Option(msg.Option("selection"), window.getSelection()), sub.Update() }): sub._legend.onclick()
sub.onaction["保存参数"] = function(event) { can.run(can.request(event, {domain: location.host, id: msg.Option(mdb.ID)}), [chat.FIELD, mdb.MODIFY, html.TOP, sub._target.offsetTop, html.LEFT, sub._target.offsetLeft, ctx.ARGS, JSON.stringify(sub.Input([], true))]) } sub.onaction["保存参数"] = function(event) { can.run(can.request(event, {domain: location.host, id: msg.Option(mdb.ID)}), [chat.FIELD, mdb.MODIFY, html.TOP, sub._target.offsetTop, html.LEFT, sub._target.offsetLeft, ctx.ARGS, JSON.stringify(sub.Input([], true))]) }
}, document.body) }, document.body) },
},
order: function(can, msg, arg) { order: function(can, msg, arg) {
var ui = can.user.input(event, can, [ctx.INDEX, ctx.ARGS, "selection", html.LEFT, html.TOP], function(args) { var ui = can.user.input(event, can, [ctx.INDEX, ctx.ARGS, "selection", html.LEFT, html.TOP], function(args) {