mirror of
https://shylinux.com/x/volcanos
synced 2025-04-25 16:58:06 +08:00
opt some
This commit is contained in:
parent
dabcaa5421
commit
5917a5f752
3
frame.js
3
frame.js
@ -57,7 +57,8 @@ Volcanos(chat.ONENGINE, {_init: function(can, meta, list, cb, target) { can.requ
|
||||
}),
|
||||
listen: shy(function(can, name, cb) { arguments.callee.meta[name] = (arguments.callee.meta[name]||[]).concat(cb) }),
|
||||
signal: function(can, name, msg) { msg = msg||can.request(); var _msg = name == chat.ONREMOTE? msg.Option("_msg"): msg
|
||||
_msg.Option(ice.LOG_DISABLE) == ice.TRUE || can.misc.Log(name, can._name, (msg._cmds||[]).join(ice.SP), name == chat.ONMAIN? can: _msg, _msg._can._target)
|
||||
_msg.Option(ice.LOG_DISABLE) == ice.TRUE || can.misc.Log(name, can._name, (msg._cmds||[]).join(ice.SP), name == chat.ONMAIN? can: _msg)
|
||||
// _msg.Option(ice.LOG_DISABLE) == ice.TRUE || can.misc.Log(name, can._name, (msg._cmds||[]).join(ice.SP), name == chat.ONMAIN? can: _msg, _msg._can._target)
|
||||
return can.core.List(can.onengine.listen.meta[name], function(cb) { can.core.CallFunc(cb, {event: msg._event, msg: msg}) }).length, msg
|
||||
},
|
||||
})
|
||||
|
@ -68,11 +68,10 @@ Volcanos(chat.ONPLUGIN, {
|
||||
toast: shy("提示", [wiki.CONTENT, wiki.TITLE], function(can, msg, arg) { arg && arg.length > 0 && can.user.toast(can, arg[0], arg[1]), msg.Copy(can[NTIP]), msg.StatusTimeCount() }),
|
||||
debug: shy("网页日志", {
|
||||
"prune": shy("清空", function(can) { while(can.misc._list.pop()) {} can.onmotion.clear(can) }),
|
||||
"debug": shy("调试", function(can) { can.user.opens(location.href.replace("debug=true", "")) }),
|
||||
"w3schools": shy("教程", function(can) { can.user.open("https://www.w3schools.com/colors/colors_names.asp") }),
|
||||
"mozilla": shy("文档", function(can) { can.user.open("https://developer.mozilla.org/en-US/") }),
|
||||
"w3": shy("标准", function(can) { can.user.open("https://www.w3.org/TR/?tag=css") }),
|
||||
}, ["type:select=log,info,warn,error,debug,wss,onremote", "filter", "list", "prune", "debug", "w3schools", "mozilla", "w3"], function(can, msg, arg) { can.onmotion.delay(can, function() { var _can = can, can = msg._can
|
||||
}, ["type:select=log,info,warn,error,debug,wss,onremote", "filter", "list", "prune", "w3schools", "mozilla", "w3"], function(can, msg, arg) { can.onmotion.delay(can, function() { var _can = can, can = msg._can
|
||||
var stat = {}
|
||||
var ui = can.page.Appends(can, can._output, [{type: html.TABLE, className: html.CONTENT, list: [{type: html.TR, list: [
|
||||
{type: html.TH, inner: mdb.TEXT},
|
||||
@ -97,29 +96,20 @@ Volcanos(chat.ONPLUGIN, {
|
||||
})},
|
||||
]} })) }]); arg && arg[1] && can.page.Select(can, can._output, html.TR, function(tr) { can.page.ClassList.set(can, tr, html.HIDE, tr.innerText.indexOf(arg[1]) == -1) })
|
||||
can.onappend._status(can, [
|
||||
{name: mdb.TIME, value: can.base.Time()},
|
||||
{name: mdb.COUNT, value: can.page.Select(can, can._output, html.TR+":not(.hide)").length+"x1"},
|
||||
].concat(can.core.List(["onremote", "wss", "info", "warn", "error"], function(item) {
|
||||
return {name: item, value: stat[item]||"0"}
|
||||
})))
|
||||
{name: mdb.TIME, value: can.base.Time()}, {name: mdb.COUNT, value: can.page.Select(can, can._output, html.TR+html.NOT_HIDE).length+"x1"},
|
||||
].concat(can.core.List(["onremote", "wss", "info", "warn", "error"], function(item) { return {name: item, value: stat[item]||"0"} })))
|
||||
}) }),
|
||||
localStorage: shy("本地存储", [mdb.NAME, mdb.VALUE, ice.LIST, ice.BACK], function(can, msg, arg) {
|
||||
if (arg.length == 0) {
|
||||
can.core.Item(localStorage, function(name, value) { if (can.base.isFunc(value) || name == "length") { return }
|
||||
msg.Push(mdb.NAME, name).Push(mdb.VALUE, value)
|
||||
}); return msg.StatusTimeCount()
|
||||
}
|
||||
if (arg.length > 1) { localStorage.setItem(arg[0], arg[1]) }
|
||||
msg.Echo(localStorage.getItem(arg[0]))
|
||||
if (arg.length == 0) { can.core.Item(localStorage, function(name, value) { if (can.base.isFunc(value) || name == "length") { return }
|
||||
msg.Push(mdb.NAME, name).Push(mdb.VALUE, value)
|
||||
}); return msg.StatusTimeCount() }
|
||||
if (arg.length > 1) { localStorage.setItem(arg[0], arg[1]) } msg.Echo(localStorage.getItem(arg[0]))
|
||||
}),
|
||||
sessionStorage: shy("会话存储", [mdb.NAME, mdb.VALUE, ice.LIST, ice.BACK], function(can, msg, arg) {
|
||||
if (arg.length == 0) {
|
||||
can.core.Item(sessionStorage, function(name, value) { if (can.base.isFunc(value) || name == "length") { return }
|
||||
msg.Push(mdb.NAME, name).Push(mdb.VALUE, value)
|
||||
}); return msg.StatusTimeCount()
|
||||
}
|
||||
if (arg.length > 1) { sessionStorage.setItem(arg[0], arg[1]) }
|
||||
msg.Echo(sessionStorage.getItem(arg[0]))
|
||||
if (arg.length == 0) { can.core.Item(sessionStorage, function(name, value) { if (can.base.isFunc(value) || name == "length") { return }
|
||||
msg.Push(mdb.NAME, name).Push(mdb.VALUE, value)
|
||||
}); return msg.StatusTimeCount() }
|
||||
if (arg.length > 1) { sessionStorage.setItem(arg[0], arg[1]) } msg.Echo(sessionStorage.getItem(arg[0]))
|
||||
}),
|
||||
data: shy("网页数据", [mdb.KEY], function(can, msg, arg) { can.onmotion.delay(can, function() { var can = msg._can
|
||||
if (can.Option(mdb.KEY)) {
|
||||
@ -127,9 +117,7 @@ Volcanos(chat.ONPLUGIN, {
|
||||
can.Option(mdb.KEY, prefix)
|
||||
})._target.click()
|
||||
} else {
|
||||
can.page.AppendData(can, can._output, "", can._root._name, can._root, function(prefix, value) {
|
||||
can.Option(mdb.KEY, prefix)
|
||||
})._target.click()
|
||||
can.page.AppendData(can, can._output, "", can._root._name, can._root, function(prefix, value) { can.Option(mdb.KEY, prefix) })._target.click()
|
||||
}
|
||||
}) }),
|
||||
view: shy("网页标签", [mdb.KEY], function(can, msg, arg) { can.onmotion.delay(can, function() { var can = msg._can
|
||||
@ -143,9 +131,7 @@ Volcanos(chat.ONPLUGIN, {
|
||||
} can.Option(mdb.KEY, list.reverse().join(ice.SP+ice.GT+ice.SP))
|
||||
}),
|
||||
], true)])
|
||||
can.onmotion.delay(can, function() {
|
||||
can.page.Select(can, ui._target, "div.item.head,div.item.body", function(target) { target.click() })
|
||||
})
|
||||
can.onmotion.delay(can, function() { can.page.Select(can, ui._target, "div.item.head,div.item.body", function(target) { target.click() }) })
|
||||
}
|
||||
}) }),
|
||||
})
|
||||
|
@ -8,6 +8,7 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb, target) { can.onmotion.cl
|
||||
var files = can.core.Split(can.Option(nfs.FILE), ice.FS); can.Option(nfs.FILE, files[0])
|
||||
var paths = can.core.Split(can.Option(nfs.PATH), ice.FS); can.Option(nfs.PATH, paths[0])
|
||||
can.core.List(paths.concat(can.core.Split(msg.Option(nfs.REPOS))), function(p) {
|
||||
if (can.base.endWith(p, "-story/", "-dict/")) { return }
|
||||
if (p && paths.indexOf(p) == -1 && p[0] != ice.PS) { paths.push(p) }
|
||||
})
|
||||
can.db = {paths: paths, tabview: {}, _history: [], history: [], profile_size: {}, display_size: {}, toolkit: {}}, can.onengine.plugin(can, can.onplugin)
|
||||
@ -83,7 +84,6 @@ Volcanos(chat.ONIMPORT, {_init: function(can, msg, cb, target) { can.onmotion.cl
|
||||
"\u2756": !can.user.isMobile && shy({"font-size": "20px", translate: "0 2px"}, function(event) { can.onaction.plug(event, can) }),
|
||||
"\u271A": !can.user.isMobile && shy({"font-size": "20px", translate: "0 2px"}, function(event) { can.onaction.open(event, can) }),
|
||||
}, function(text, cb) { return cb && {text: [text, html.SPAN, html.VIEW], style: cb.meta, onclick: cb} }))
|
||||
// if (can.user.isMobile) { return }
|
||||
var func = can.onexport.func(can); if (func.list.length == 0) { return } can.db.tabFunc = can.db.tabFunc||{}
|
||||
var last = can.db.tabFunc[can.Option(nfs.PATH)+can.Option(nfs.FILE)]||{}; can.db.tabFunc[can.Option(nfs.PATH)+can.Option(nfs.FILE)] = last
|
||||
var carte, list = [{input: [html.FILTER, function(event) { if (event.key == lang.ESCAPE) { return carte.close() } can.onkeymap.selectItems(event, can, carte._target)
|
||||
|
@ -119,9 +119,9 @@ Volcanos(chat.ONACTION, {
|
||||
"官网": function(event, can) { can.user.open("https://shylinux.com/") },
|
||||
"调试": function(event, can) { can.user.opens(location.href.replace("debug=true", "debug=false")) },
|
||||
"百度": function(event, can) { can.user.opens("https://baidu.com/") },
|
||||
"录屏": function(event, can) { window.isWebview && window.openapp("QuickTime Player") },
|
||||
"编辑器": function(event, can) { window.isWebview && window.opencmd("cd ~/contexts; vim +"+can.Option(nfs.LINE)+" "+can.Option(nfs.PATH)+can.Option(nfs.FILE)) },
|
||||
"浏览器": function(event, can) { window.isWebview && window.openurl(location.href) },
|
||||
"录屏": function(event, can) { can.user.isWebview && window.openapp("QuickTime Player") },
|
||||
"编辑器": function(event, can) { can.user.isWebview && window.opencmd("cd ~/contexts; vim +"+can.Option(nfs.LINE)+" "+can.Option(nfs.PATH)+can.Option(nfs.FILE)) },
|
||||
"浏览器": function(event, can) { can.user.isWebview && window.openurl(location.href) },
|
||||
|
||||
_complete: function(event, can, target) { if (event == undefined || event.type == "click") { return } target = target||can.ui.complete
|
||||
var pre = can.ui.current.value.slice(0, can.ui.current.selectionStart), key = can.core.Split(pre, "\t .[]", ice.SP).pop()||"", end = can.ui.current.value.slice(can.ui.current.selectionStart)
|
||||
|
Loading…
x
Reference in New Issue
Block a user