mirror of
https://shylinux.com/x/volcanos
synced 2025-04-25 16:58:06 +08:00
opt some
This commit is contained in:
parent
675dc57b69
commit
290a04b08b
13
frame.js
13
frame.js
@ -9,8 +9,6 @@ Volcanos(chat.ONENGINE, {help: "搜索引擎", _init: function(can, meta, list,
|
||||
}, Volcanos.meta.args = can.user.args(can)
|
||||
can.user.title(can.misc.Search(can, chat.TITLE)||can.misc.Search(can, ice.POD)||location.host)
|
||||
|
||||
window.onunload = function() { can.onengine.signal(can, "onunload") }
|
||||
|
||||
can.core.Next(list, function(item, next) { item.type = chat.PANEL
|
||||
can.onappend._init(can, can.base.Copy(item, can.core.Value(can, [chat.RIVER, item.name])), item.list, function(panel) {
|
||||
panel.run = function(event, cmds, cb) { var msg = panel.request(event); cmds = cmds||[]
|
||||
@ -602,12 +600,18 @@ Volcanos(chat.ONLAYOUT, {help: "页面布局", _init: function(can, target) { ta
|
||||
})
|
||||
Volcanos(chat.ONMOTION, {help: "动态特效", _init: function(can, target) {
|
||||
var last = window.innerWidth < window.innerHeight
|
||||
window.onbeforeunload = function(event) {
|
||||
can.onengine.signal(can, "onunload")
|
||||
}
|
||||
window.onunload = function() {
|
||||
can.onengine.signal(can, "onunload")
|
||||
}
|
||||
window.onresize = function(event) {
|
||||
window.setsize && window.setsize(window.innerWidth, window.innerHeight)
|
||||
if (can.user.isMobile) {
|
||||
if (last === window.innerWidth < window.innerHeight) { return }
|
||||
last = window.innerWidth < window.innerHeight
|
||||
}
|
||||
window.setsize && window.setsize(window.innerWidth, window.innerHeight)
|
||||
can.onengine.signal(can, chat.ONRESIZE)
|
||||
}
|
||||
can.onmotion.float.auto(can, target)
|
||||
@ -905,7 +909,8 @@ Volcanos(chat.ONKEYMAP, {help: "键盘交互", _focus: [], _init: function(can,
|
||||
})
|
||||
},
|
||||
_parse: function(event, can, mode, list, target) { list = list||[]
|
||||
if (["Control", "Shift"].indexOf(event.key) > -1) { return list }
|
||||
if (event.metaKey && !can.user.isWebview) { return }
|
||||
if (["Control", "Shift", "Meta"].indexOf(event.key) > -1) { return list }
|
||||
list.push(event.key); for (var pre = 0; pre < list.length; pre++) {
|
||||
if ("0" <= list[pre] && list[pre] <= "9") { continue } break
|
||||
}; var count = parseInt(list.slice(0, pre).join(""))||1
|
||||
|
@ -56,9 +56,7 @@ Volcanos(chat.ONACTION, {help: "操作数据", list: [mdb.CREATE, web.SHARE, web
|
||||
can.onmotion.toggle(can, can._target, true)
|
||||
})
|
||||
},
|
||||
onresize: function(can, msg) {
|
||||
can.onmotion.hidden(can, can._target)
|
||||
},
|
||||
onresize: function(can, msg) { can.user.isMobile && can.onmotion.hidden(can, can._target) },
|
||||
onsearch: function(can, msg, word) { if (word[0] == mdb.FOREACH || word[0] == chat.STORM) { can.onexport.storm(can, msg, word) } },
|
||||
onaction_notool: function(can, msg, river, storm) { can.ondetail["添加工具"](msg._event, can, "添加工具", river, storm) },
|
||||
onaction_touch: function(can, msg) { can.user.isMobile && can.onmotion.hidden(can) },
|
||||
|
@ -331,10 +331,8 @@ Volcanos(chat.ONACTION, {help: "控件交互", _trans: {link: "链接", width: "
|
||||
Volcanos(chat.ONIMPORT, {help: "导入数据",
|
||||
_keydown: function(can) { if (!can.isCmdMode()) { return }
|
||||
can.onkeymap._build(can), can._root.onengine.listen(can, chat.ONKEYDOWN, function(event) {
|
||||
if ((event.ctrlKey || event.metaKey) && event.key >= "0" && event.key <= "9") {
|
||||
return can.page.Select(can, can.ui._tabs, "div.tabs", function(target, index) {
|
||||
if (index+1 == event.key) { target.click() }
|
||||
})
|
||||
if (event.ctrlKey && event.key >= "0" && event.key <= "9") {
|
||||
return can.page.Select(can, can.ui._tabs, "div.tabs", function(target, index) { index+1 == event.key && target.click() })
|
||||
}
|
||||
can._key_list = can.onkeymap._parse(event, can, mdb.PLUGIN, can._key_list, can.ui.content)
|
||||
})
|
||||
|
@ -110,8 +110,10 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, target) { can.onmotion.clear(
|
||||
can.onimport._content(can, msg, head, list, key, get, set)
|
||||
},
|
||||
layout: function(can) {
|
||||
can.onmotion.toggle(can, can._action, !can.isFloatMode() && !(can.user.isMobile && window.innerHeight < window.innerWidth))
|
||||
can.onmotion.toggle(can, can._status, !can.isFloatMode() && !(can.user.isMobile && window.innerHeight < window.innerWidth))
|
||||
can.page.styleWidth(can, can.ui.content, can.ConfWidth()-can.ui.project.offsetWidth-can.ui.profile.offsetWidth)
|
||||
if (can.isCmdMode() || can.isFullMode() || can.isPlugType()) { can.page.styleHeight(can, can._output, can.ConfHeight())
|
||||
if (can.isCmdMode() || can.isFullMode() || can.isFloatMode() || can.isPlugType()) { can.page.styleHeight(can, can._output, can.ConfHeight())
|
||||
var height = can._display_heights[can.sup.task? [can.sup.task.zone, can.sup.task.id].join(ice.FS): ""]||200
|
||||
if (can.ui.display.innerHTML && can.ui.display.style.display != html.NONE) {
|
||||
can.page.style(can, can.ui.content, html.HEIGHT, can.ConfHeight()-height)
|
||||
|
6
proto.js
6
proto.js
@ -193,13 +193,15 @@ var chat = {
|
||||
"/plugin/input/date.js",
|
||||
"/plugin/story/spide.js",
|
||||
"/plugin/story/trend.js",
|
||||
"/plugin/local/code/inner.js",
|
||||
"/plugin/local/code/vimer.js",
|
||||
"/plugin/local/code/xterm.js",
|
||||
"/plugin/local/code/vimer.js",
|
||||
"/plugin/local/code/inner.js",
|
||||
"/plugin/local/code/inner/syntax.js",
|
||||
"/plugin/local/wiki/draw/path.js",
|
||||
"/plugin/local/wiki/draw.js",
|
||||
"/plugin/local/wiki/word.js",
|
||||
"/plugin/local/team/plan.js",
|
||||
"/plugin/local/mall/goods.js",
|
||||
],
|
||||
PLUGIN_STATE_JS: "/plugin/state.js",
|
||||
PLUGIN_INPUT_JS: "/plugin/input.js",
|
||||
|
Loading…
x
Reference in New Issue
Block a user