mirror of
https://shylinux.com/x/volcanos
synced 2025-04-25 16:58:06 +08:00
opt some
This commit is contained in:
parent
065db9b1d6
commit
20ac545320
@ -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.title:first-child { text-align:center; width:230px; }
|
||||
fieldset.Footer>div.output div.state { float:right; }
|
||||
|
@ -1,6 +1,6 @@
|
||||
(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)
|
||||
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._state(can, msg, target), can.onimport._toast(can, msg, target)
|
||||
},
|
||||
|
3
proto.js
3
proto.js
@ -393,8 +393,7 @@ var Volcanos = shy({iceberg: "/chat/", volcano: "/frame.js", cache: {}, pack: {}
|
||||
})
|
||||
try { if (typeof(window) == lang.OBJECT) { var meta = Volcanos.meta
|
||||
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+(debug? "&_tt="+(new Date()).getTime(): "")
|
||||
meta.version = window._version, window.parent.outerWidth-window.parent.innerWidth > 100 && (meta.version = "")
|
||||
meta._load = function(url, cb) {
|
||||
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
|
||||
|
@ -59,26 +59,19 @@ setTimeout(function() { Volcanos({
|
||||
})
|
||||
}
|
||||
},
|
||||
field: function(can, msg, arg) {
|
||||
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, 200)
|
||||
var width = can.base.Max(window.innerWidth-sub._target.offsetLeft, 800)
|
||||
field: function(can, msg, arg) { 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)
|
||||
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) {
|
||||
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.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)
|
||||
can.onimport.size(sub, height, width, true), can.base.isFunc(cb) && cb(msg)
|
||||
}) }
|
||||
sub._target.onclick = function() {
|
||||
can.page.Select(can, document.body, can.page.Keys("div.carte.float"), function(target) { can.page.Remove(can, target) })
|
||||
}
|
||||
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)})
|
||||
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()
|
||||
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)})
|
||||
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) }
|
||||
msg.Option("selection") && can.onengine.listen(can, "onselection", function() { sub.Option(msg.Option("selection"), window.getSelection()), sub.Update() })
|
||||
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) {
|
||||
var ui = can.user.input(event, can, [ctx.INDEX, ctx.ARGS, "selection", html.LEFT, html.TOP], function(args) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user