mirror of
https://shylinux.com/x/volcanos
synced 2025-04-25 16:58:06 +08:00
opt some
This commit is contained in:
parent
e88b01b3e8
commit
521e25fe6d
16
frame.js
16
frame.js
@ -117,7 +117,7 @@ Volcanos("ondaemon", {help: "推荐引擎", list: [], _init: function(can, name)
|
|||||||
exit: function(can, msg, sub) { can.user.close() },
|
exit: function(can, msg, sub) { can.user.close() },
|
||||||
refresh: function(can, msg, sub) { sub.Update() },
|
refresh: function(can, msg, sub) { sub.Update() },
|
||||||
pwd: function(can, msg, arg) { can.ondaemon._list[0] = arg[0] },
|
pwd: function(can, msg, arg) { can.ondaemon._list[0] = arg[0] },
|
||||||
grow: function(can, msg, sub, arg) { sub.onimport._grow(sub, can.page.Color(arg.join(""))) },
|
grow: function(can, msg, sub, arg) { sub.onimport._grow(sub, msg, can.page.Color(arg.join(""))) },
|
||||||
toast: function(can, msg, arg) { can.core.CallFunc(can.user.toast, {can: can, msg: msg, cmds: arg}) },
|
toast: function(can, msg, arg) { can.core.CallFunc(can.user.toast, {can: can, msg: msg, cmds: arg}) },
|
||||||
})
|
})
|
||||||
Volcanos("onappend", {help: "渲染引擎", list: [], _init: function(can, meta, list, cb, target, field) {
|
Volcanos("onappend", {help: "渲染引擎", list: [], _init: function(can, meta, list, cb, target, field) {
|
||||||
@ -964,10 +964,14 @@ Volcanos("onmotion", {help: "动态特效", list: [], _init: function(can, targe
|
|||||||
}}])
|
}}])
|
||||||
},
|
},
|
||||||
toimage: function(event, can, name, target) {
|
toimage: function(event, can, name, target) {
|
||||||
can.user.input(event, can, [{name: "name", value: name}], function(ev, button, data) {
|
can.require(["https://cdn.jsdelivr.net/npm/html2canvas@1.0.0-rc.5/dist/html2canvas.min.js"], function() {
|
||||||
can.require(["https://cdn.jsdelivr.net/npm/html2canvas@1.0.0-rc.5/dist/html2canvas.min.js"], function() {
|
html2canvas(target||can._target).then(function (canvas) { var url = canvas.toDataURL("image/png")
|
||||||
html2canvas(target||can._target).then(function (canvas) {
|
var toast = can.user.toast(can, {content: {img: url, style: {"max-height": 240, display: "block"}}, duration: -1,
|
||||||
can.page.Create(can, html.A, {href: canvas.toDataURL("image/png"), download: data.name}).click()
|
action: shy({}, [cli.CLOSE, "download"], function(event, button) {
|
||||||
|
can.user.input(event, can, [{name: "name", value: name}], function(ev, button, data) { toast.close()
|
||||||
|
can.page.Create(can, html.A, {href: url, download: data.name}).click()
|
||||||
|
})
|
||||||
|
}),
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
@ -1175,4 +1179,4 @@ Volcanos("onkeymap", {help: "键盘交互", list: [], _focus: [], _init: functio
|
|||||||
cursorMove: function(can, target, count, begin) { begin != undefined && target.setSelectionRange(begin, begin)
|
cursorMove: function(can, target, count, begin) { begin != undefined && target.setSelectionRange(begin, begin)
|
||||||
target.setSelectionRange(target.selectionStart+count, target.selectionStart+count)
|
target.setSelectionRange(target.selectionStart+count, target.selectionStart+count)
|
||||||
},
|
},
|
||||||
}); _can_name = ""
|
})
|
||||||
|
@ -238,4 +238,3 @@ Volcanos("base", {help: "数据类型", Int: function(val, def) { return parseIn
|
|||||||
return list.join(outer||ice.SP)
|
return list.join(outer||ice.SP)
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -229,4 +229,3 @@ Volcanos("core", {help: "数据结构",
|
|||||||
return timer
|
return timer
|
||||||
}),
|
}),
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -207,6 +207,7 @@ Volcanos("misc", {help: "通信协议", Message: function(event, can) { var msg
|
|||||||
MergeURL: shy("地址链接", function(can, objs, clear) {
|
MergeURL: shy("地址链接", function(can, objs, clear) {
|
||||||
var path = location.pathname; objs._path && (path = objs._path, delete(objs._path))
|
var path = location.pathname; objs._path && (path = objs._path, delete(objs._path))
|
||||||
objs && objs.pod && (path = "/chat/pod/"+objs.pod, delete(objs.pod))
|
objs && objs.pod && (path = "/chat/pod/"+objs.pod, delete(objs.pod))
|
||||||
|
objs && objs.cmd && (path = (path.indexOf("/chat/pod/") == 0)? path+"/cmd/"+objs.cmd: "/chat/cmd/"+objs.cmd, delete(objs.cmd))
|
||||||
return can.base.MergeURL(location.origin+path+(clear?"":location.search), objs)
|
return can.base.MergeURL(location.origin+path+(clear?"":location.search), objs)
|
||||||
}),
|
}),
|
||||||
|
|
||||||
@ -265,4 +266,3 @@ Volcanos("misc", {help: "通信协议", Message: function(event, can) { var msg
|
|||||||
return hour+":"+minute+":"+second
|
return hour+":"+minute+":"+second
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -433,4 +433,3 @@ Volcanos("page", {help: "用户界面", ClassList: {
|
|||||||
return item
|
return item
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
42
lib/user.js
42
lib/user.js
@ -74,6 +74,7 @@ Volcanos("user", {help: "用户操作", info: {}, agent: {
|
|||||||
"list": "查看", "back": "返回", "run": "执行", "done": "完成", "share": "共享",
|
"list": "查看", "back": "返回", "run": "执行", "done": "完成", "share": "共享",
|
||||||
"edit": "编辑", "save": "保存", "copy": "复制", "show": "显示", "hide": "隐藏",
|
"edit": "编辑", "save": "保存", "copy": "复制", "show": "显示", "hide": "隐藏",
|
||||||
"project": "项目", "profile": "详情", "actions": "参数",
|
"project": "项目", "profile": "详情", "actions": "参数",
|
||||||
|
"download": "下载",
|
||||||
"plugin": "插件",
|
"plugin": "插件",
|
||||||
"prev": "上一页", "next": "下一页",
|
"prev": "上一页", "next": "下一页",
|
||||||
|
|
||||||
@ -85,11 +86,15 @@ Volcanos("user", {help: "用户操作", info: {}, agent: {
|
|||||||
"label": "标签", "exec": "执行",
|
"label": "标签", "exec": "执行",
|
||||||
}[text]||text
|
}[text]||text
|
||||||
},
|
},
|
||||||
toastConfirm: function(can, title, content, action) {
|
toastScript: function(can, content, title) {
|
||||||
|
var ui = can.user.toast(can, {title: title, duration: -1, width: -300, content: content, action: [cli.CLOSE]})
|
||||||
|
can.onmotion.story.auto(can, ui._target)
|
||||||
|
},
|
||||||
|
toastConfirm: function(can, content, title, action) {
|
||||||
return can.user.toast(can, {title: title, content: content, action: action||[cli.CLOSE], duration: -1, width: -300})
|
return can.user.toast(can, {title: title, content: content, action: action||[cli.CLOSE], duration: -1, width: -300})
|
||||||
},
|
},
|
||||||
toastProcess: function(can, title) { return can.user.toast(can, ice.PROCESS, title, -1) },
|
toastProcess: function(can, content, title) { return can.user.toast(can, content, title||ice.PROCESS, -1) },
|
||||||
toastSuccess: function(can, title) { return can.user.toast(can, ice.SUCCESS, title) },
|
toastSuccess: function(can, content, title) { return can.user.toast(can, content, title||ice.SUCCESS) },
|
||||||
toast: function(can, content, title, duration, progress) {
|
toast: function(can, content, title, duration, progress) {
|
||||||
var meta = can.base.isObject(content)? content: {content: content, title: title||can._help, duration: duration, progress: progress}
|
var meta = can.base.isObject(content)? content: {content: content, title: title||can._help, duration: duration, progress: progress}
|
||||||
var width = meta.width||400, height = meta.height||100; if (width < 0) { width = window.innerWidth + width }
|
var width = meta.width||400, height = meta.height||100; if (width < 0) { width = window.innerWidth + width }
|
||||||
@ -108,7 +113,14 @@ Volcanos("user", {help: "用户操作", info: {}, agent: {
|
|||||||
]},
|
]},
|
||||||
] }])
|
] }])
|
||||||
|
|
||||||
var action = can.onappend._action(can, meta.action||[""], ui.action, {
|
var action = can.onappend._action(can, meta.action && meta.action.list? meta.action.list: meta.action||[""], ui.action, {
|
||||||
|
_engine: function(event, button) {
|
||||||
|
var cb = meta.action[button]||meta.action; can.base.isFunc(cb) && cb(event, button)
|
||||||
|
},
|
||||||
|
open: function(event) {
|
||||||
|
if (meta.content.indexOf("http") == 0) { can.user.open(meta.content) }
|
||||||
|
if (meta.title.indexOf("http") == 0) { can.user.open(meta.title) }
|
||||||
|
},
|
||||||
close: function(event) { can.page.Remove(can, action._target), action.timer.stop = true },
|
close: function(event) { can.page.Remove(can, action._target), action.timer.stop = true },
|
||||||
timer: can.core.Timer({interval: 100, length: (parseInt(meta.duration||1000))/100}, function(event, interval, index) {
|
timer: can.core.Timer({interval: 100, length: (parseInt(meta.duration||1000))/100}, function(event, interval, index) {
|
||||||
if (index > 30) { ui.duration.innerHTML = parseInt(index/10)+ice.PT+(index%10)+"s..." }
|
if (index > 30) { ui.duration.innerHTML = parseInt(index/10)+ice.PT+(index%10)+"s..." }
|
||||||
@ -122,7 +134,7 @@ Volcanos("user", {help: "用户操作", info: {}, agent: {
|
|||||||
can.run(msg._event, cmd||[ctx.ACTION, chat.SHARE], function(msg) {
|
can.run(msg._event, cmd||[ctx.ACTION, chat.SHARE], function(msg) {
|
||||||
can.user.toast(can, {height: 300, width: 500,
|
can.user.toast(can, {height: 300, width: 500,
|
||||||
title: msg.Append(mdb.NAME), duration: -1,
|
title: msg.Append(mdb.NAME), duration: -1,
|
||||||
content: msg.Append(mdb.TEXT), action: [cli.CLOSE],
|
content: msg.Append(mdb.TEXT), action: [cli.CLOSE, cli.OPEN],
|
||||||
}), can.user.copy(msg._event, can, msg.Append(mdb.NAME))
|
}), can.user.copy(msg._event, can, msg.Append(mdb.NAME))
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@ -187,17 +199,17 @@ Volcanos("user", {help: "用户操作", info: {}, agent: {
|
|||||||
a.download = name, a.click()
|
a.download = name, a.click()
|
||||||
}, img.src = "data:image/svg+xml,"+encodeURIComponent(text)
|
}, img.src = "data:image/svg+xml,"+encodeURIComponent(text)
|
||||||
},
|
},
|
||||||
copy: function(event, can, text) {
|
copy: function(event, can, text) { if (!text) { return }
|
||||||
if (navigator.clipboard) { var ok = false
|
if (navigator.clipboard) { var ok = false
|
||||||
navigator.clipboard.writeText(text).then(function() { ok = true })
|
navigator.clipboard.writeText(text).then(function() { ok = true }); if (ok) {
|
||||||
if (ok) { return can.user.toastSuccess(can) }
|
can.user.toastSuccess(can, text, "copy success"), can.misc.Log("copy", text)
|
||||||
|
return text
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var input = can.page.Append(can, event.target.parentNode, [{type: html.TEXTAREA, value: text}]).first
|
var input = can.page.Append(can, event.target.parentNode, [{type: html.TEXTAREA, value: text}]).first
|
||||||
can.onmotion.focus(can, input), document.execCommand("Copy")
|
can.onmotion.focus(can, input), document.execCommand("Copy"), can.page.Remove(can, input)
|
||||||
can.page.Remove(can, input), can.user.toastSuccess(can)
|
can.user.toastSuccess(can, text, "copy success"), can.misc.Log("copy", text)
|
||||||
can.onkeymap.prevent(event)
|
|
||||||
can.misc.Log("copy", text)
|
|
||||||
return text
|
return text
|
||||||
},
|
},
|
||||||
carte: function(event, can, meta, list, cb, parent) { // event item meta
|
carte: function(event, can, meta, list, cb, parent) { // event item meta
|
||||||
@ -345,12 +357,14 @@ Volcanos("user", {help: "用户操作", info: {}, agent: {
|
|||||||
download: function(can, path, name) {
|
download: function(can, path, name) {
|
||||||
var a = can.page.Append(can, document.body, [{type: html.A, href: path, download: name||path.split(ice.PS).pop()}]).first
|
var a = can.page.Append(can, document.body, [{type: html.A, href: path, download: name||path.split(ice.PS).pop()}]).first
|
||||||
a.click(), can.page.Remove(can, a)
|
a.click(), can.page.Remove(can, a)
|
||||||
|
return path
|
||||||
|
},
|
||||||
|
downloads: function(can, text, name) { if (!text) { return }
|
||||||
|
return can.user.download(can, URL.createObjectURL(new Blob([text])), name)
|
||||||
},
|
},
|
||||||
downloads: function(can, text, name) { can.user.download(can, URL.createObjectURL(new Blob([text])), name) },
|
|
||||||
camera: function(can, msg, cb) {
|
camera: function(can, msg, cb) {
|
||||||
navigator.getUserMedia({video: true}, cb, function(error) {
|
navigator.getUserMedia({video: true}, cb, function(error) {
|
||||||
can.misc.Log(error)
|
can.misc.Log(error)
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -102,6 +102,7 @@ body>div.toast div.duration { color:gray; float:right; }
|
|||||||
body>div.toast div.content { text-align:center; }
|
body>div.toast div.content { text-align:center; }
|
||||||
body>div.toast div.progress { border:solid 2px green; margin-left:-2px; height:10px; clear:both; }
|
body>div.toast div.progress { border:solid 2px green; margin-left:-2px; height:10px; clear:both; }
|
||||||
body>div.toast div.progress div.current { background-color:red; height:10px; }
|
body>div.toast div.progress div.current { background-color:red; height:10px; }
|
||||||
|
body>div.toast div.action { display:block; }
|
||||||
|
|
||||||
body>div.carte { background-color:#295b61; color:white; padding:4px; min-width:80px; }
|
body>div.carte { background-color:#295b61; color:white; padding:4px; min-width:80px; }
|
||||||
body>div.carte div.item { padding:3px 12px; }
|
body>div.carte div.item { padding:3px 12px; }
|
||||||
|
@ -214,7 +214,7 @@ Volcanos("onaction", {help: "交互操作", list: [], _init: function(can, cb, t
|
|||||||
help: function(can, button) { can.user.open("/help/"+button+".shy") },
|
help: function(can, button) { can.user.open("/help/"+button+".shy") },
|
||||||
layout: function(can, button, silent) {
|
layout: function(can, button, silent) {
|
||||||
if (button == "toimage") {
|
if (button == "toimage") {
|
||||||
can.onmotion.toimage(event, can, document.title, can._output)
|
can.onmotion.toimage(event, can, can.Conf(chat.STORM), can._output)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
can.page.ClassList.del(can, can._target, can.Conf(chat.LAYOUT))
|
can.page.ClassList.del(can, can._target, can.Conf(chat.LAYOUT))
|
||||||
@ -321,4 +321,3 @@ Volcanos("onexport", {help: "导出数据", list: [],
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -110,4 +110,3 @@ Volcanos("onaction", {help: "交互数据", list: [], _init: function(can, cb, t
|
|||||||
Volcanos("onexport", {help: "导出数据", list: [],
|
Volcanos("onexport", {help: "导出数据", list: [],
|
||||||
height: function(can) { return can._target.offsetHeight },
|
height: function(can) { return can._target.offsetHeight },
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -265,4 +265,3 @@ Volcanos("onexport", {help: "导出数据", list: [],
|
|||||||
height: function(can) { return can._target.offsetHeight },
|
height: function(can) { return can._target.offsetHeight },
|
||||||
topic: function(can) { return can._topic },
|
topic: function(can) { return can._topic },
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -284,4 +284,3 @@ Volcanos("onexport", {help: "导出数据", list: [],
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -124,4 +124,3 @@ Volcanos("onexport", {help: "导出数据", list: [],
|
|||||||
}).slice(1)
|
}).slice(1)
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -29,4 +29,3 @@ Volcanos("onaction", {help: "控件交互", list: [], _init: function(can, meta,
|
|||||||
} can.onkeymap.prevent(event)
|
} can.onkeymap.prevent(event)
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -58,4 +58,3 @@ Volcanos("onfigure", {help: "控件详情", list: [], date: {onclick: function(e
|
|||||||
return now
|
return now
|
||||||
} show(now), can.onlayout.figure(event, can), can.base.isFunc(cbs) && cbs(can)
|
} show(now), can.onlayout.figure(event, can), can.base.isFunc(cbs) && cbs(can)
|
||||||
})}} }, [""])
|
})}} }, [""])
|
||||||
|
|
||||||
|
@ -48,4 +48,3 @@ Volcanos("onfigure", {help: "控件详情", list: [], key: {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
}})
|
}})
|
||||||
|
|
||||||
|
@ -6,4 +6,3 @@ Volcanos("onfigure", {help: "控件详情", list: [], province: {onclick: functi
|
|||||||
}), can.Status(mdb.TOTAL, 34), can.onlayout.figure(event, can), can.base.isFunc(cbs) && cbs(can)
|
}), can.Status(mdb.TOTAL, 34), can.onlayout.figure(event, can), can.base.isFunc(cbs) && cbs(can)
|
||||||
})
|
})
|
||||||
}) }}, })
|
}) }}, })
|
||||||
|
|
||||||
|
@ -92,4 +92,3 @@ Volcanos("onaction", {help: "操作数据", list: [],
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
Volcanos("onexport", {help: "导出数据", list: []})
|
Volcanos("onexport", {help: "导出数据", list: []})
|
||||||
|
|
||||||
|
@ -33,4 +33,3 @@ Volcanos("onaction", {help: "操作数据", list: [], _init: function(can, msg,
|
|||||||
})
|
})
|
||||||
Volcanos("onexport", {help: "导出数据", list: [],
|
Volcanos("onexport", {help: "导出数据", list: [],
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -635,4 +635,3 @@ Volcanos("onexport", {help: "导出数据", list: ["文件数", "解析器", "
|
|||||||
return can.page.Select(can, can.ui.content, "td.text", function(item) { return item.innerText }).join(ice.NL)
|
return can.page.Select(can, can.ui.content, "td.text", function(item) { return item.innerText }).join(ice.NL)
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -28,4 +28,3 @@ Volcanos("onimport", {help: "导入数据", _init: function(can, args, cb) {
|
|||||||
}, can.base.isFunc(cb) && cb(sub)
|
}, can.base.isFunc(cb) && cb(sub)
|
||||||
})
|
})
|
||||||
}})
|
}})
|
||||||
|
|
||||||
|
@ -56,4 +56,3 @@ Volcanos("onimport", {help: "导入数据", _init: function(can, args, cb) { var
|
|||||||
can.ui.search._show = show
|
can.ui.search._show = show
|
||||||
})
|
})
|
||||||
}})
|
}})
|
||||||
|
|
||||||
|
@ -19,4 +19,3 @@ Volcanos("onimport", {help: "导入数据", _init: function(can, args, cb) { var
|
|||||||
}, can.base.isFunc(cb) && cb(sub)
|
}, can.base.isFunc(cb) && cb(sub)
|
||||||
})
|
})
|
||||||
}})
|
}})
|
||||||
|
|
||||||
|
@ -21,5 +21,3 @@ Volcanos("onimport", {help: "导入数据", _init: function(can, args, cb) {
|
|||||||
}, can.base.isFunc(cb) && cb(sub)
|
}, can.base.isFunc(cb) && cb(sub)
|
||||||
})
|
})
|
||||||
}})
|
}})
|
||||||
|
|
||||||
|
|
||||||
|
@ -29,4 +29,3 @@ Volcanos("onaction", {help: "操作数据", list: [], _init: function(can, msg,
|
|||||||
})
|
})
|
||||||
Volcanos("onexport", {help: "导出数据", list: [], _init: function(can, msg, list, cb, target) {
|
Volcanos("onexport", {help: "导出数据", list: [], _init: function(can, msg, list, cb, target) {
|
||||||
}})
|
}})
|
||||||
|
|
||||||
|
@ -205,7 +205,7 @@ Volcanos("onaction", {help: "控件交互", list: [nfs.SAVE, code.AUTOGEN, code.
|
|||||||
can.onaction._runs(event, can, button)
|
can.onaction._runs(event, can, button)
|
||||||
},
|
},
|
||||||
publish: function(event, can, button) {
|
publish: function(event, can, button) {
|
||||||
can.runAction(event, button, [], function(msg) { can.user.toastConfirm(can, button, msg.Result()) })
|
can.runAction(event, button, [], function(msg) { can.user.toastConfirm(can, msg.Result(), button) })
|
||||||
},
|
},
|
||||||
|
|
||||||
listTags: function(event, can, button) { var list = []
|
listTags: function(event, can, button) { var list = []
|
||||||
@ -336,4 +336,3 @@ Volcanos("onaction", {help: "控件交互", list: [nfs.SAVE, code.AUTOGEN, code.
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
Volcanos("onexport", {help: "导出数据", list: ["文件数", "模式", "按键", "解析器", "文件名", "当前行", "跳转数"]})
|
Volcanos("onexport", {help: "导出数据", list: ["文件数", "模式", "按键", "解析器", "文件名", "当前行", "跳转数"]})
|
||||||
|
|
||||||
|
@ -196,4 +196,3 @@ Volcanos("onexport", {help: "导出数据", list: ["count", "begin_time", "zone"
|
|||||||
title: function(can, task) { return task.zone+": "+(task.type||"") },
|
title: function(can, task) { return task.zone+": "+(task.type||"") },
|
||||||
style: function(can, task) { return ["item", task.status, "id"+task.id, "l"+(task.level||""), "s"+(task.score||"")].join(" ") },
|
style: function(can, task) { return ["item", task.status, "id"+task.id, "l"+(task.level||""), "s"+(task.score||"")].join(" ") },
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -140,4 +140,3 @@ Volcanos("onexport", {help: "导出数据", list: [],
|
|||||||
}).join("\n")
|
}).join("\n")
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -587,4 +587,3 @@ Volcanos("onexport", {help: "导出数据", list: ["group", "figure", "index", "
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -57,4 +57,3 @@ Volcanos("heart", {help: "心形", list: [],
|
|||||||
return "heart " + target.Value("tt")
|
return "heart " + target.Value("tt")
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -149,4 +149,3 @@ Volcanos("onfigure", {help: "图形绘制", list: [],
|
|||||||
show: function(can, target) { return target.tagName + " " + target.Value("d") },
|
show: function(can, target) { return target.tagName + " " + target.Value("d") },
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -147,4 +147,3 @@ Volcanos("onimport", {help: "导入数据", list: [],
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -122,4 +122,3 @@ Volcanos("onexport", {help: "导出数据", list: ["begin", "limit", "total", "p
|
|||||||
return parseInt((index+1)*100/total)+"%"+" = "+(parseInt(index)+1)+ice.PS+parseInt(total)
|
return parseInt((index+1)*100/total)+"%"+" = "+(parseInt(index)+1)+ice.PS+parseInt(total)
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -260,4 +260,3 @@ Volcanos("ondetail", {help: "交互操作", list: ["删除"], _init: function(ca
|
|||||||
"结束": function(event, can) { can.page.Remove(can, can._target) },
|
"结束": function(event, can) { can.page.Remove(can, can._target) },
|
||||||
"删除": function(event, sub) { sub.page.Remove(sub, sub._target) },
|
"删除": function(event, sub) { sub.page.Remove(sub, sub._target) },
|
||||||
})
|
})
|
||||||
|
|
||||||
|
193
plugin/state.js
193
plugin/state.js
@ -1,36 +1,28 @@
|
|||||||
Volcanos("onimport", {help: "导入数据", list: [], _init: function(can, conf, list, cb, target) {},
|
Volcanos("onimport", {help: "导入数据", list: [], _init: function(can, conf, list, cb, target) {},
|
||||||
_process: function(can, msg) {
|
_process: function(can, msg) {
|
||||||
msg.OptionStatus() && can.onmotion.clear(can, can._status) && can.onappend._status(can, can.base.Obj(msg.OptionStatus()))
|
msg.OptionStatus() && can.onmotion.clear(can, can._status) && can.onappend._status(can, can.base.Obj(msg.OptionStatus()))
|
||||||
return can.core.CallFunc([can.onimport, msg.OptionProcess()], [can, msg])
|
return can.core.CallFunc([can.onimport, msg.OptionProcess()], {can: can, msg: msg})
|
||||||
},
|
},
|
||||||
|
|
||||||
_confirm: function(can, msg, _arg) { var sub = can.request({}, can.Option())
|
_location: function(can, msg, _arg) { location.href = _arg; return true },
|
||||||
if (can.user.confirm(_arg)) { can.run(sub._event, [ctx.ACTION, "confirm"], function() {}, true) }
|
_replace: function(can, msg, _arg) { location.replace(_arg); return true },
|
||||||
|
_history: function(can, msg) { history.back(); return true },
|
||||||
|
_confirm: function(can, msg, _arg) { can.user.confirm(_arg) && can.runAction(can.request({}, msg)._event, "confirm"); return true },
|
||||||
|
_refresh: function(can, msg) {
|
||||||
|
can.core.Timer(parseInt(msg.Option("_delay")||"500"), function() {
|
||||||
|
can.Update(can.request({}, {_count: parseInt(msg.Option("_count"))-1})._event)
|
||||||
|
})
|
||||||
|
return true
|
||||||
},
|
},
|
||||||
_location: function(can, msg) { location.href = msg._arg[0] },
|
|
||||||
_replace: function(can, msg) { location.replace(msg._arg[0]) },
|
|
||||||
_history: function(can, msg) { history.back() },
|
|
||||||
_rewrite: function(can, msg) {
|
_rewrite: function(can, msg) {
|
||||||
for (var i = 0; i < msg._arg.length; i += 2) {
|
for (var i = 0; i < msg._arg.length; i += 2) {
|
||||||
can.Option(msg._arg[i], msg._arg[i+1])
|
can.Option(msg._arg[i], msg._arg[i+1])
|
||||||
can.Action(msg._arg[i], msg._arg[i+1])
|
can.Action(msg._arg[i], msg._arg[i+1])
|
||||||
}
|
}
|
||||||
can.Update()
|
return can.Update()
|
||||||
return true
|
|
||||||
},
|
|
||||||
_refresh: function(can, msg) {
|
|
||||||
can.core.Timer(parseInt(msg.Option("_delay")||"500"), function() {
|
|
||||||
var sub = can.request({}, {_count: parseInt(msg.Option("_count"))-1})
|
|
||||||
can.Update()
|
|
||||||
})
|
|
||||||
return true
|
|
||||||
},
|
},
|
||||||
_display: function(can, msg) {
|
_display: function(can, msg) {
|
||||||
Volcanos("some", {}, [msg.Option(ice.MSG_DISPLAY)].concat(Volcanos.meta.libs, Volcanos.meta.volcano), function(sub) {
|
can.onappend._output(can, msg, msg.Option(ice.MSG_DISPLAY))
|
||||||
sub.Conf(can.Conf()), sub.run = can.run
|
|
||||||
sub._option = can._option, sub._action = can._action
|
|
||||||
sub.onimport._init(sub, msg, [], function() {}, can._output)
|
|
||||||
})
|
|
||||||
return true
|
return true
|
||||||
},
|
},
|
||||||
_field: function(can, msg) {
|
_field: function(can, msg) {
|
||||||
@ -58,129 +50,107 @@ Volcanos("onimport", {help: "导入数据", list: [], _init: function(can, conf,
|
|||||||
can.onappend.table(can, msg)
|
can.onappend.table(can, msg)
|
||||||
can.onappend.board(can, msg)
|
can.onappend.board(can, msg)
|
||||||
can.onmotion.story.auto(can)
|
can.onmotion.story.auto(can)
|
||||||
can.page.Modify(can, can._output, {style: {display: html.BLOCK}})
|
can.page.style(can, can._output, "display", html.BLOCK)
|
||||||
return true
|
return true
|
||||||
},
|
},
|
||||||
|
|
||||||
_open: function(can, msg) {
|
|
||||||
can.user.open(msg.Option("_arg")), can.Update()
|
|
||||||
return true
|
|
||||||
},
|
|
||||||
_hold: function(can, msg) { return true },
|
_hold: function(can, msg) { return true },
|
||||||
_back: function(can) {
|
_back: function(can) { can._history.pop()
|
||||||
can._history.pop(); for (var his = can._history.pop(); his; his = can._history.pop()) { if (his[0] == ctx.ACTION) { continue }
|
for (var his = can._history.pop(); his; his = can._history.pop()) { if (his[0] == ctx.ACTION) { continue }
|
||||||
var index = 0
|
var index = 0
|
||||||
can.page.SelectArgs(can, can._option, "", function(item) { item.value = his[index++]||"" })
|
can.page.SelectArgs(can, can._option, "", function(item) { item.value = his[index++]||"" })
|
||||||
can.page.SelectArgs(can, can._action, "", function(item) { item.value = his[index++]||"" })
|
can.page.SelectArgs(can, can._action, "", function(item) { item.value = his[index++]||"" })
|
||||||
can.Update()
|
can.Update(); break
|
||||||
break
|
|
||||||
}
|
}
|
||||||
!his && can.Update()
|
!his && can.Update()
|
||||||
return true
|
return true
|
||||||
},
|
},
|
||||||
|
_rich: function(can, msg, _arg) {
|
||||||
_grow: function(can, str) {
|
if (can.page.Select(can, can._output, [html.TABLE_CONTENT, "tbody"], function(table) {
|
||||||
if (can.page.Select(can, can._output, "div.code", function(div) {
|
var head = can.page.Select(can, can._output, [html.TABLE_CONTENT, "th"], function(th) { return th.innerText })
|
||||||
can.page.Modify(can, div, {style: {"max-height": 400}})
|
can.page.Append(can, table, msg.Table(function(value) {
|
||||||
can.page.Append(can, div, [{text: [str]}])
|
return {row: can.core.List(head, function(key) { return value[key] })}
|
||||||
|
}))
|
||||||
|
return true
|
||||||
|
}).length == 0) { can.onappend.table(can, msg) }
|
||||||
|
return true
|
||||||
|
},
|
||||||
|
_grow: function(can, msg, _arg) {
|
||||||
|
if (can.page.Select(can, can._output, html.DIV_CODE, function(div) {
|
||||||
|
can.page.style(can, div, html.MAX_HEIGHT, 400)
|
||||||
|
can.page.Append(can, div, [{text: _arg}])
|
||||||
div.scrollBy(0, 10000)
|
div.scrollBy(0, 10000)
|
||||||
return true
|
return true
|
||||||
}).length == 0) {
|
}).length == 0) { can.onappend.board(can, _arg) }
|
||||||
can.onappend.board(can, str)
|
return true
|
||||||
}
|
},
|
||||||
|
_open: function(can, msg, _arg) {
|
||||||
|
return can.user.open(_arg), can.Update()
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
Volcanos("onaction", {help: "交互操作", list: [
|
Volcanos("onaction", {help: "交互操作", list: [
|
||||||
"共享工具", "刷新数据", "切换全屏", "打开链接", "生成链接", "生成图片", "生成脚本", [
|
"刷新数据", "切换全屏", "共享工具", "打开链接", "生成链接", "生成脚本", "生成图片", [
|
||||||
"其它", "扩展参数", "清空参数", "复制数据", "下载数据", "清空数据", "删除工具",
|
"其它", "清空参数", "扩展参数", "复制数据", "下载数据", "清空数据", "删除工具",
|
||||||
],
|
],
|
||||||
], _init: function(can, msg, list, cb, target) {},
|
], _init: function(can, msg, list, cb, target) {},
|
||||||
_engine: function(event, can, button) { can.Update(event, [ctx.ACTION, button].concat(can.Input([], true))) },
|
_engine: function(event, can, button) { can.Update(event, [ctx.ACTION, button].concat(can.Input([], true))) },
|
||||||
|
|
||||||
"扩展参数": function(event, can) {
|
"刷新数据": function(event, can) { can.Update({}, can.Input([], true)) },
|
||||||
can.onmotion.toggle(can, can._action)
|
"切换全屏": function(event, can) { var sub = can._outputs[can._outputs.length-1]
|
||||||
|
if (can.page.ClassList.neg(can, can._target, "Full")) {
|
||||||
|
sub._height_bak = sub.ConfHeight(), sub._width_bak = sub.ConfWidth()
|
||||||
|
var height = window.innerHeight-(can._status.innerText? 2: 1)*html.ACTION_HEIGHT
|
||||||
|
can.user.isMobile && (height -= 2*html.ACTION_HEIGHT)
|
||||||
|
can.page.style(can, can._output, html.HEIGHT, sub.ConfHeight(height), html.MIN_WIDTH, sub.ConfWidth(window.innerWidth))
|
||||||
|
can.core.CallFunc([sub, "onimport.layout"], {can: sub})
|
||||||
|
} else {
|
||||||
|
sub.ConfHeight(sub._height_bak), sub.ConfWidth(sub._width_bak)
|
||||||
|
can.core.CallFunc([sub, "onimport.layout"], {can: sub})
|
||||||
|
can.page.style(can, can._output, html.HEIGHT, "", html.MIN_WIDTH, "")
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"共享工具": function(event, can) { var meta = can.Conf()
|
"共享工具": function(event, can) { var meta = can.Conf()
|
||||||
can.onmotion.share(event, can, [{name: chat.TITLE, value: meta.name}, {name: chat.TOPIC, values: [cli.WHITE, cli.BLACK]}], [
|
can.onmotion.share(event, can, [{name: chat.TITLE, value: meta.name}, {name: chat.TOPIC, values: [cli.WHITE, cli.BLACK]}], [
|
||||||
mdb.NAME, meta.index, mdb.TEXT, JSON.stringify(can.Input([], true)),
|
mdb.NAME, meta.index, mdb.TEXT, JSON.stringify(can.Input([], true)),
|
||||||
])
|
])
|
||||||
},
|
},
|
||||||
"切换全屏": function(event, can) { var sub = can._outputs[can._outputs.length-1]
|
"打开链接": function(event, can) { var meta = can.Conf(), args = can.Option()
|
||||||
if (can.page.ClassList.neg(can, can._target, "Full")) {
|
args.cmd = meta.index||can.core.Keys(meta.ctx, meta.cmd), args.cmd == "web.wiki.word" && (args.cmd = args.path)
|
||||||
sub._height_bak = sub.ConfHeight(), sub._width_bak = sub.ConfWidth()
|
|
||||||
var height = window.innerHeight-(can._status.innerText? 2: 1)*html.ACTION_HEIGHT
|
|
||||||
can.user.isMobile && (height -= 2*html.ACTION_HEIGHT)
|
|
||||||
can.page.style(can, can._output, "height", sub.ConfHeight(height), "min-width", sub.ConfWidth(window.innerWidth))
|
|
||||||
can.core.CallFunc([sub, "onimport.layout"], {can: sub})
|
|
||||||
} else {
|
|
||||||
sub.ConfHeight(sub._height_bak), sub.ConfWidth(sub._width_bak)
|
|
||||||
can.core.CallFunc([sub, "onimport.layout"], {can: sub})
|
|
||||||
can.page.style(can, can._output, "height", "", "min-width", "")
|
|
||||||
}
|
|
||||||
},
|
|
||||||
"打开链接": function(event, can) { var meta = can.Conf()
|
|
||||||
var pre = "/chat/cmd/"; if (can.user.mod.isPod) { pre = "/chat/pod/"+can.misc.Search(can, ice.POD)+"/cmd/" }
|
|
||||||
var args = can.Option(); args._path = pre+(meta.index||can.core.Keys(meta.ctx, meta.cmd))
|
|
||||||
args._path.indexOf("/cmd/web.wiki.word") > -1 && (args = {_path: pre+args.path})
|
|
||||||
|
|
||||||
can.user.isWeiXin? can.user.jumps(can.misc.MergeURL(can, args)): can.user.open(can.misc.MergeURL(can, args))
|
can.user.isWeiXin? can.user.jumps(can.misc.MergeURL(can, args)): can.user.open(can.misc.MergeURL(can, args))
|
||||||
},
|
},
|
||||||
"生成链接": function(event, can) { var meta = can.Conf()
|
"生成链接": function(event, can) { var meta = can.Conf(), args = can.Option()
|
||||||
var pre = "/chat/cmd/"; if (can.user.mod.isPod) { pre = "/chat/pod/"+can.misc.Search(can, ice.POD)+"/cmd/" }
|
args.cmd = meta.index||can.core.Keys(meta.ctx, meta.cmd), args.cmd == "web.wiki.word" && (args.cmd = args.path)
|
||||||
var args = can.Option(); args._path = pre+(meta.index||can.core.Keys(meta.ctx, meta.cmd))
|
can.onmotion.share(event, can, [], [mdb.LINK, can.user.copy(event, can, can.misc.MergeURL(can, args))])
|
||||||
args._path.indexOf("/cmd/web.wiki.word") > -1 && (args = {_path: pre+args.path})
|
|
||||||
var url = can.misc.MergeURL(can, args)
|
|
||||||
can.user.copy(event, can, url)
|
|
||||||
can.onmotion.share(event, can, [], [mdb.LINK, url])
|
|
||||||
},
|
},
|
||||||
"生成图片": function(event, can) { can.onmotion.toimage(event, can, can._name) },
|
"生成脚本": function(event, can) { var conf = can.Conf()
|
||||||
// "生成图片": function(event, can) {
|
var args = can.Input("", true).join(ice.SP), list = [
|
||||||
// can.user.toPNG(can, "hi.png", can._target.outerHTML, can.Conf(html.HEIGHT), can.Conf(html.WIDTH))
|
"export ctx_dev="+location.origin+"; ctx_temp=$(mktemp); curl -o $ctx_temp -fsSL $ctx_dev;"+" source $ctx_temp "+(conf.index||"")+ice.SP+args,
|
||||||
// },
|
|
||||||
|
|
||||||
"生成脚本": function(event, can, button) { var conf = can.Conf()
|
|
||||||
var args = can.Input("", true).join(ice.SP); var list = [
|
|
||||||
"export ctx_dev="+location.origin+"; ctx_temp=$(mktemp); curl -fsSL $ctx_dev -o $ctx_temp;"+" source $ctx_temp "+(conf.index||"")+ice.SP+args,
|
|
||||||
"ish_sys_dev_run_command "+args, "ish_sys_dev_run_action", "ish_sys_dev_run_source",
|
"ish_sys_dev_run_command "+args, "ish_sys_dev_run_action", "ish_sys_dev_run_source",
|
||||||
]
|
]
|
||||||
var ui = can.user.toast(can, {title: button, duration: -1, width: -300,
|
can.user.toastScript(can, '<div class="story" data-type="spark", data-name="shell">'+
|
||||||
content: '<div class="story" data-type="spark", data-name="shell">'+
|
'<label>$ </label>'+'<span>'+list.join("</span><br/><label>$ </label><span>")+'</span>'+'</div>', conf.index+ice.SP+args)
|
||||||
'<label>$ </label>'+'<span>'+list.join("</span><br/><label>$ </label><span>")+'</span>'+'</div>',
|
|
||||||
action: [cli.CLOSE],
|
|
||||||
})
|
|
||||||
can.onmotion.story.auto(can, ui._target)
|
|
||||||
can.user.copy(event, can, list[0])
|
can.user.copy(event, can, list[0])
|
||||||
},
|
},
|
||||||
"刷新数据": function(event, can) { can.Update({}, can.Input([], true)) },
|
"生成图片": function(event, can) { can.onmotion.toimage(event, can, can._name) },
|
||||||
"打包页面": function(event, can) { can.onengine.signal(can, "onwebpack", can.request(event)) },
|
|
||||||
"刷新页面": function(event, can) {
|
|
||||||
var sub = can.core.Value(can._outputs, "-1"), msg = sub._msg
|
|
||||||
can.core.CallFunc([sub, chat.ONIMPORT, "_init"], {can: sub, msg: msg, list: msg.result||msg.append||[], cb: function(msg) {
|
|
||||||
}, target: can._output})
|
|
||||||
},
|
|
||||||
"保存参数": function(event, can) { can.search(event, ["River.ondetail.保存参数"]) },
|
|
||||||
|
|
||||||
"清空参数": function(event, can) {
|
"清空参数": function(event, can) { can.page.SelectArgs(can, can._option, "", function(item) { return item.value = "" }) },
|
||||||
can.page.SelectArgs(can, can._option, "", function(item) { return item.value = "" })
|
"扩展参数": function(event, can) { can.onmotion.toggle(can, can._action) },
|
||||||
},
|
"复制数据": function(event, can) { can.user.copy(event, can, can.onexport.table(can)||can.onexport.board(can)) },
|
||||||
"复制数据": function(event, can) { var meta = can.Conf(), msg = can._msg
|
"下载数据": function(event, can) { var meta = can.Conf()
|
||||||
var res = [msg.append && msg.append.join(",")]; msg.Table(function(line, index, array) {
|
can.user.input(event, can, [{name: "filename", value: meta.name}], function(ev, button, data, list) {
|
||||||
res.push(can.core.Item(line, function(key, value) { return value }).join(","))
|
can.user.downloads(can, can.onexport.table(can), list[0]+".csv")||can.user.downloads(can, can.onexport.board(can), meta.name+".txt")
|
||||||
})
|
})
|
||||||
|
|
||||||
res.length > 1 && can.user.copy(event, can, res.join(ice.SP))
|
|
||||||
msg.result && can.user.copy(event, can, msg.Result())
|
|
||||||
},
|
|
||||||
"下载数据": function(event, can) { var meta = can.Conf(), msg = can._msg
|
|
||||||
var res = [msg.append && msg.append.join(",")]; msg.Table(function(line, index, array) {
|
|
||||||
res.push(can.core.Item(line, function(key, value) { return value }).join(","))
|
|
||||||
})
|
|
||||||
|
|
||||||
res.length > 1 && can.user.downloads(can, res.join("\n"), meta.name+".csv")
|
|
||||||
msg.result && can.user.downloads(can, msg.Result(), meta.name+".txt")
|
|
||||||
},
|
},
|
||||||
"清空数据": function(event, can) { can.onmotion.clear(can, can._output) },
|
"清空数据": function(event, can) { can.onmotion.clear(can, can._output) },
|
||||||
"删除工具": function(event, can) { can.page.Remove(can, can._target) },
|
"删除工具": function(event, can) { can.page.Remove(can, can._target) },
|
||||||
|
|
||||||
|
"保存参数": function(event, can) { can.search(event, ["River.ondetail.保存参数"]) },
|
||||||
|
"打包页面": function(event, can) { can.onengine.signal(can, "onwebpack", can.request(event)) },
|
||||||
|
"刷新页面": function(event, can) { var sub = can.core.Value(can._outputs, "-1"), msg = sub._msg
|
||||||
|
can.core.CallFunc([sub, chat.ONIMPORT, "_init"], {can: sub, msg: msg, list: msg.result||msg.append||[], cb: function(msg) {
|
||||||
|
}, target: can._output})
|
||||||
|
},
|
||||||
|
|
||||||
"摄像头": function(event, can) {
|
"摄像头": function(event, can) {
|
||||||
var constraints = {audio: false, video: {width: 200, height: 200}}
|
var constraints = {audio: false, video: {width: 200, height: 200}}
|
||||||
var ui = can.page.Append(can, can._output, [{view: ctx.ACTION}, {view: "capture", list: [{type: "video", _init: function(item) {
|
var ui = can.page.Append(can, can._output, [{view: ctx.ACTION}, {view: "capture", list: [{type: "video", _init: function(item) {
|
||||||
@ -251,5 +221,14 @@ Volcanos("onaction", {help: "交互操作", list: [
|
|||||||
openLocation: function(event, can) { can.user.agent.openLocation(can.request(event)) },
|
openLocation: function(event, can) { can.user.agent.openLocation(can.request(event)) },
|
||||||
|
|
||||||
})
|
})
|
||||||
Volcanos("onexport", {help: "导出数据", list: []})
|
Volcanos("onexport", {help: "导出数据", list: [],
|
||||||
|
table: function(can) { var msg = can._msg; if (msg.Length() == 0) { return }
|
||||||
|
var res = [msg.append && msg.append.join(ice.FS)]; msg.Table(function(line, index, array) {
|
||||||
|
res.push(can.core.Item(line, function(key, value) { return value }).join(ice.FS))
|
||||||
|
})
|
||||||
|
return res.join(ice.NL)
|
||||||
|
},
|
||||||
|
board: function(can) { var msg = can._msg
|
||||||
|
return msg.Result()
|
||||||
|
},
|
||||||
|
})
|
||||||
|
@ -58,5 +58,3 @@ Volcanos("onimport", {help: "导入数据", list: [], _init: function(can, msg,
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
}, [""])
|
}, [""])
|
||||||
|
|
||||||
|
|
||||||
|
@ -58,4 +58,3 @@ Volcanos("onaction", {help: "组件菜单", list: ["展开", "折叠", "复制"]
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
Volcanos("onexport", {help: "导出数据", list: []})
|
Volcanos("onexport", {help: "导出数据", list: []})
|
||||||
|
|
||||||
|
@ -43,4 +43,3 @@ Volcanos("onimport", {help: "导入数据", list: [], _init: function(can, msg,
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -185,4 +185,3 @@ Volcanos("ondetail", {help: "用户交互", list: [],
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -134,4 +134,3 @@ Volcanos("ondetail", {help: "用户交互", list: [],
|
|||||||
onmouseenter: function(event, can, line) { can.Status(line, ["date", "text", "add", "del"]) },
|
onmouseenter: function(event, can, line) { can.Status(line, ["date", "text", "add", "del"]) },
|
||||||
})
|
})
|
||||||
Volcanos("onexport", {help: "导出数据", list: []})
|
Volcanos("onexport", {help: "导出数据", list: []})
|
||||||
|
|
||||||
|
@ -45,4 +45,3 @@ Volcanos("onaction", {help: "控件交互", list: [],
|
|||||||
},
|
},
|
||||||
})
|
})
|
||||||
Volcanos("onexport", {help: "导出数据", list: []})
|
Volcanos("onexport", {help: "导出数据", list: []})
|
||||||
|
|
||||||
|
@ -30,4 +30,3 @@ Volcanos("onimport", {help: "导入数据", list: [], _init: function(can, msg,
|
|||||||
})
|
})
|
||||||
Volcanos("onaction", {help: "控件交互", list: []})
|
Volcanos("onaction", {help: "控件交互", list: []})
|
||||||
Volcanos("onexport", {help: "导出数据", list: []})
|
Volcanos("onexport", {help: "导出数据", list: []})
|
||||||
|
|
||||||
|
14
proto.js
14
proto.js
@ -242,12 +242,14 @@ var html = {
|
|||||||
HIDE: "hide",
|
HIDE: "hide",
|
||||||
LAYOUT: "layout",
|
LAYOUT: "layout",
|
||||||
PLUGIN: "plugin",
|
PLUGIN: "plugin",
|
||||||
|
DIV_CODE: "div.code",
|
||||||
DIV_PAGE: "div.page",
|
DIV_PAGE: "div.page",
|
||||||
DIV_LIST: "div.list",
|
DIV_LIST: "div.list",
|
||||||
DIV_ITEM: "div.item",
|
DIV_ITEM: "div.item",
|
||||||
DIV_LAYOUT_HEAD: "div.layout.head",
|
DIV_LAYOUT_HEAD: "div.layout.head",
|
||||||
DIV_LAYOUT_LEFT: "div.layout.left",
|
DIV_LAYOUT_LEFT: "div.layout.left",
|
||||||
DIV_LAYOUT_FOOT: "div.layout.foot",
|
DIV_LAYOUT_FOOT: "div.layout.foot",
|
||||||
|
TABLE_CONTENT: "table.content",
|
||||||
|
|
||||||
ESCAPE: "Escape", ENTER: "Enter", TAB: "Tab",
|
ESCAPE: "Escape", ENTER: "Enter", TAB: "Tab",
|
||||||
ONMOUSEENTER: "onmouseenter",
|
ONMOUSEENTER: "onmouseenter",
|
||||||
@ -261,6 +263,7 @@ var lang = {
|
|||||||
CONTROL: "Control", SHIFT: "Shift",
|
CONTROL: "Control", SHIFT: "Shift",
|
||||||
PS: "/",
|
PS: "/",
|
||||||
}
|
}
|
||||||
|
|
||||||
function shy(help, meta, list, cb) {
|
function shy(help, meta, list, cb) {
|
||||||
var index = 0, args = arguments; function next(type) {
|
var index = 0, args = arguments; function next(type) {
|
||||||
if (index < args.length && (!type || type == typeof args[index])) { return args[index++] }
|
if (index < args.length && (!type || type == typeof args[index])) { return args[index++] }
|
||||||
@ -286,12 +289,9 @@ var Volcanos = shy("火山架", {iceberg: "/chat/", volcano: "/frame.js", args:
|
|||||||
// 根模块
|
// 根模块
|
||||||
_can_name = "", name = Config.name||"chat", cb = can||function(can) {
|
_can_name = "", name = Config.name||"chat", cb = can||function(can) {
|
||||||
can.onengine._init(can, can.Conf(Config), Config.panels, Config._init, can._target)
|
can.onengine._init(can, can.Conf(Config), Config.panels, Config._init, can._target)
|
||||||
}, can = {
|
}, can = {_follow: name, _target: Config.target||meta.target, _height: Config.height||window.innerHeight, _width: Config.width||window.innerWidth}
|
||||||
_follow: name, _target: Config.target||meta.target,
|
|
||||||
_height: Config.height||window.innerHeight,
|
|
||||||
_width: Config.width||window.innerWidth,
|
|
||||||
}, can._root = can
|
|
||||||
for (var k in Config) { can[k] = Config[k] }
|
for (var k in Config) { can[k] = Config[k] }
|
||||||
|
can._root = can
|
||||||
}
|
}
|
||||||
|
|
||||||
var proto = {__proto__: meta, _path: _can_path, _name: name, _load: function(name, each) {
|
var proto = {__proto__: meta, _path: _can_path, _name: name, _load: function(name, each) {
|
||||||
@ -337,6 +337,8 @@ var Volcanos = shy("火山架", {iceberg: "/chat/", volcano: "/frame.js", args:
|
|||||||
// 添加参数
|
// 添加参数
|
||||||
can.core.List(arguments, function(option, index) { if (!option || index == 0) { return }
|
can.core.List(arguments, function(option, index) { if (!option || index == 0) { return }
|
||||||
can.base.isFunc(option.Option)? can.core.List(option.Option(), function(key) {
|
can.base.isFunc(option.Option)? can.core.List(option.Option(), function(key) {
|
||||||
|
if (key.indexOf("user.") == 0) { return }
|
||||||
|
if (key.indexOf("_") == 0) { return }
|
||||||
set(key, option.Option(key))
|
set(key, option.Option(key))
|
||||||
}): can.core.Item(can.base.isFunc(option)? option(): option, set)
|
}): can.core.Item(can.base.isFunc(option)? option(): option, set)
|
||||||
}); return msg
|
}); return msg
|
||||||
@ -441,6 +443,7 @@ try { if (typeof(global) == lang.OBJECT) {
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
|
Volcanos.meta.target = document.body
|
||||||
Volcanos.meta._load = function(url, cb) {
|
Volcanos.meta._load = function(url, cb) {
|
||||||
switch (url.split("?")[0].split(ice.PT).pop().toLowerCase()) {
|
switch (url.split("?")[0].split(ice.PT).pop().toLowerCase()) {
|
||||||
case nfs.CSS:
|
case nfs.CSS:
|
||||||
@ -454,5 +457,4 @@ try { if (typeof(global) == lang.OBJECT) {
|
|||||||
return document.body.appendChild(item), item
|
return document.body.appendChild(item), item
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Volcanos.meta.target = document.body
|
|
||||||
} } catch (e) { console.log(e) }
|
} } catch (e) { console.log(e) }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user