mirror of
https://shylinux.com/x/volcanos
synced 2025-04-28 10:02:00 +08:00
opt inner.go
This commit is contained in:
parent
ed653d7ae3
commit
dd822acf8a
6
frame.js
6
frame.js
@ -529,9 +529,9 @@ Volcanos("onlayout", {help: "页面布局", list: [], _init: function(can) {
|
|||||||
{type: "td", list: [
|
{type: "td", list: [
|
||||||
{type: "tr", list: [{type: "tr", list: [
|
{type: "tr", list: [{type: "tr", list: [
|
||||||
{view: ["content", "td"], list: [{view: ["content"]}]},
|
{view: ["content", "td"], list: [{view: ["content"]}]},
|
||||||
{view: ["profile", "td"], list: [{view: ["profile"]}]},
|
{view: ["profile", "td"], list: [{view: ["profile"], style: {display: "none"}}]},
|
||||||
]}]},
|
]}]},
|
||||||
{view: ["display", "tr"], list: [{view: ["display"]}]}
|
{view: ["display", "tr"], list: [{view: ["display"], style: {display: "none"}}]}
|
||||||
]}
|
]}
|
||||||
] }])
|
] }])
|
||||||
},
|
},
|
||||||
@ -548,7 +548,7 @@ Volcanos("onlayout", {help: "页面布局", list: [], _init: function(can) {
|
|||||||
display: function(can, target) { target = target || can._target
|
display: function(can, target) { target = target || can._target
|
||||||
return can.page.Appends(can, target, [{view: ["layout", "table"], list: [
|
return can.page.Appends(can, target, [{view: ["layout", "table"], list: [
|
||||||
{type: "tr", list: [{view: "content"}]},
|
{type: "tr", list: [{view: "content"}]},
|
||||||
{type: "tr", list: [{view: "display"}]},
|
{type: "tr", list: [{view: "display", style: {display: "none"}}]},
|
||||||
]}])
|
]}])
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
@ -210,17 +210,17 @@ fieldset>form.option>div.item.textarea {
|
|||||||
clear:both;
|
clear:both;
|
||||||
}
|
}
|
||||||
|
|
||||||
fieldset>div.action>div.item {
|
fieldset div.action>div.item {
|
||||||
float:left; margin-right:3px;
|
float:left; margin-right:3px;
|
||||||
height:25px; vertical-align:middle;
|
height:25px; vertical-align:middle;
|
||||||
}
|
}
|
||||||
fieldset>div.action>div.item.space {
|
fieldset div.action>div.item.space {
|
||||||
width:10px;
|
width:10px;
|
||||||
}
|
}
|
||||||
fieldset>div.action>div.item label {
|
fieldset div.action>div.item label {
|
||||||
display:none;
|
display:none;
|
||||||
}
|
}
|
||||||
fieldset>div.action>div.item select {
|
fieldset div.action>div.item select {
|
||||||
height:25px; font-size:14px;
|
height:25px; font-size:14px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -231,6 +231,9 @@ fieldset>div.status>div.item>label {
|
|||||||
font-size:10px; color:gray;
|
font-size:10px; color:gray;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fieldset div.output {
|
||||||
|
clear:both;
|
||||||
|
}
|
||||||
fieldset>div.output td.project {
|
fieldset>div.output td.project {
|
||||||
background-color:#435f8c8c;
|
background-color:#435f8c8c;
|
||||||
}
|
}
|
||||||
|
@ -12,9 +12,11 @@ Volcanos("onimport", {help: "导入数据", list: [], _init: function(can, msg)
|
|||||||
})
|
})
|
||||||
},
|
},
|
||||||
_plugin: function(can, river, storm, sub, item) {
|
_plugin: function(can, river, storm, sub, item) {
|
||||||
|
|
||||||
sub.run = function(event, cmds, cb) { var msg = sub.request(event)
|
sub.run = function(event, cmds, cb) { var msg = sub.request(event)
|
||||||
|
var toast = msg.Option("_toast") && can.user.toast(can, msg.Option("_toast"), "", 1000000)
|
||||||
return can.run(event, (can.onengine[cmds[0]]? []: [river, storm, item.id||item.index||item.key+"."+item.name]).concat(cmds), function(msg) {
|
return can.run(event, (can.onengine[cmds[0]]? []: [river, storm, item.id||item.index||item.key+"."+item.name]).concat(cmds), function(msg) {
|
||||||
typeof cb == "function" && cb(msg)
|
toast && toast.Close(), typeof cb == "function" && cb(msg)
|
||||||
})
|
})
|
||||||
}, can._plugins = (can._plugins||[]).concat([sub])
|
}, can._plugins = (can._plugins||[]).concat([sub])
|
||||||
|
|
||||||
|
@ -6,13 +6,25 @@ Volcanos("onimport", {help: "导入数据", _init: function(can, msg, list, cb,
|
|||||||
can.page.Modify(can, can.ui.content, {style: {"min-width": can.Conf("width")-170}})
|
can.page.Modify(can, can.ui.content, {style: {"min-width": can.Conf("width")-170}})
|
||||||
can.page.Modify(can, can.ui.display, {style: {display: "none"}})
|
can.page.Modify(can, can.ui.display, {style: {display: "none"}})
|
||||||
|
|
||||||
|
var ui = can.page.Append(can, can.ui.display, [
|
||||||
|
{view: "action"}, {view: "output"},
|
||||||
|
]); can.ui.output = ui.output
|
||||||
|
can.onappend._action(can, ["关闭", "清空", "运行"], ui.action, {
|
||||||
|
"关闭": function(event) { can.onmotion.hidden(can, can.ui.display) },
|
||||||
|
"清空": function(event) { can.onmotion.clear(can, can.ui.output) },
|
||||||
|
"运行": function(event) { can.onaction["运行"](event, can) },
|
||||||
|
})
|
||||||
|
|
||||||
msg.Option({path: can.Option("path"), file: can.Option("file"), line: can.Option("line")||1})
|
msg.Option({path: can.Option("path"), file: can.Option("file"), line: can.Option("line")||1})
|
||||||
can.tabview = can.tabview || {}, can.tabview[can.Option("path")+can.Option("file")] = msg
|
can.tabview = can.tabview || {}, can.tabview[can.Option("path")+can.Option("file")] = msg
|
||||||
|
|
||||||
can.onimport.tabview(can, msg.Option("path"), msg.Option("file"), msg.Option("line")||1)
|
can.onimport.tabview(can, msg.Option("path"), msg.Option("file"), msg.Option("line")||1)
|
||||||
can.onimport.project(can, msg.Option("path"))
|
can.onimport.project(can, msg.Option("path"))
|
||||||
typeof cb == "function" && cb(msg)
|
typeof cb == "function" && cb(msg)
|
||||||
|
can.onimport._search(can, target)
|
||||||
|
can.onimport._favor(can, target)
|
||||||
|
},
|
||||||
|
_search: function(can, target) {
|
||||||
var ui = can.page.Append(can, target, [
|
var ui = can.page.Append(can, target, [
|
||||||
{view: "search", style: {display: "none"}, list: [
|
{view: "search", style: {display: "none"}, list: [
|
||||||
{view: "action", list: [
|
{view: "action", list: [
|
||||||
@ -21,15 +33,27 @@ Volcanos("onimport", {help: "导入数据", _init: function(can, msg, list, cb,
|
|||||||
}], value: "main", onfocus: function(event) { event.target.setSelectionRange(0, -1) }},
|
}], value: "main", onfocus: function(event) { event.target.setSelectionRange(0, -1) }},
|
||||||
{button: ["搜索", function(event) { can.onaction.searchLine(event, can, ui.word.value) }]},
|
{button: ["搜索", function(event) { can.onaction.searchLine(event, can, ui.word.value) }]},
|
||||||
{button: ["返回", function(event) { can.onaction["返回"](event, can) }]},
|
{button: ["返回", function(event) { can.onaction["返回"](event, can) }]},
|
||||||
{button: ["关闭", function(event) { can.onaction.searchShow(event, can) }]},
|
{button: ["关闭", function(event) { can.onaction["搜索"](event, can) }]},
|
||||||
]},
|
]},
|
||||||
{view: "tags", style: {"max-height": 160}},
|
{view: "tags", style: {"max-height": 160}},
|
||||||
]},
|
]},
|
||||||
]); can.core.Copy(can.ui, ui, "search", "word", "tags")
|
]); can.core.Copy(can.ui, ui, "search", "word", "tags")
|
||||||
},
|
},
|
||||||
|
_favor: function(can, target) {
|
||||||
|
can.onappend.plugin(can, {index: "web.code.favor"}, function(sub) {
|
||||||
|
sub.run = function(event, cmds, cb) {
|
||||||
|
can.run(event, ["action", "favor"].concat(cmds), cb, true)
|
||||||
|
}, can.ui.favor = sub
|
||||||
|
|
||||||
|
sub.Select = function(line) {
|
||||||
|
line.path == can.Option("path") && can.onimport.tabview(can, line.path, line.file, line.line)
|
||||||
|
}
|
||||||
|
can.onmotion.hidden(sub, sub._target)
|
||||||
|
}, target)
|
||||||
|
},
|
||||||
project: function(can, path) { can.Option({path: path})
|
project: function(can, path) { can.Option({path: path})
|
||||||
var msg = can.request({}, {dir_root: path, dir_deep: true})
|
var msg = can.request({}, {dir_root: path, dir_deep: true})
|
||||||
can.run(msg._event, ["action", "dir", "./"], function(msg) {
|
can.run(msg._event, ["./"], function(msg) {
|
||||||
can.onmotion.clear(can, can.ui.project)
|
can.onmotion.clear(can, can.ui.project)
|
||||||
can.onappend.tree(can, msg.Table(), "path", "/", function(event, item) {
|
can.onappend.tree(can, msg.Table(), "path", "/", function(event, item) {
|
||||||
can.onimport.tabview(can, path, item.path)
|
can.onimport.tabview(can, path, item.path)
|
||||||
@ -42,10 +66,11 @@ Volcanos("onimport", {help: "导入数据", _init: function(can, msg, list, cb,
|
|||||||
can._msg = can.tabview[path+file]
|
can._msg = can.tabview[path+file]
|
||||||
|
|
||||||
can.Option({path: path, file: file, line: line||parseInt(can._msg.Option("line"))||1})
|
can.Option({path: path, file: file, line: line||parseInt(can._msg.Option("line"))||1})
|
||||||
|
can._msg.Option("line", can.Option("line"))
|
||||||
return can.onsyntax._init(can, can._msg), typeof cb == "function" && cb()
|
return can.onsyntax._init(can, can._msg), typeof cb == "function" && cb()
|
||||||
}
|
}
|
||||||
|
|
||||||
can.run({}, ["action", "render", can.base.Ext(file||path), file, path], function(msg) {
|
can.run({}, [path, file], function(msg) {
|
||||||
msg.Option({path: path, file: file, line: line||1})
|
msg.Option({path: path, file: file, line: line||1})
|
||||||
can.tabview[path+file] = msg
|
can.tabview[path+file] = msg
|
||||||
|
|
||||||
@ -62,7 +87,7 @@ Volcanos("onimport", {help: "导入数据", _init: function(can, msg, list, cb,
|
|||||||
}, ["/plugin/local/code/inner.css"])
|
}, ["/plugin/local/code/inner.css"])
|
||||||
Volcanos("onsyntax", {help: "语法高亮", list: ["keyword", "prefix", "line"], _init: function(can, msg) {
|
Volcanos("onsyntax", {help: "语法高亮", list: ["keyword", "prefix", "line"], _init: function(can, msg) {
|
||||||
// caches save
|
// caches save
|
||||||
can.file && can.core.List(["content", "profile", "display"], function(item) { can.page.Cache(can.file, can.ui[item], {
|
can.file && can.core.List(["content", "profile", "output"], function(item) { can.page.Cache(can.file, can.ui[item], {
|
||||||
scrollTop: can.ui.content.scrollTop, current: can.current, max: can.max,
|
scrollTop: can.ui.content.scrollTop, current: can.current, max: can.max,
|
||||||
}) })
|
}) })
|
||||||
|
|
||||||
@ -72,9 +97,9 @@ Volcanos("onsyntax", {help: "语法高亮", list: ["keyword", "prefix", "line"],
|
|||||||
|
|
||||||
// caches load
|
// caches load
|
||||||
can.onmotion.select(can, can._action, "div.file", msg._tab)
|
can.onmotion.select(can, can._action, "div.file", msg._tab)
|
||||||
var cache = false; can.core.List(["content", "profile", "display"], function(item) {
|
var cache = false; can.core.List(["content", "profile", "output"], function(item) {
|
||||||
var p = can.page.Cache(can.file, can.ui[item]); if (p != undefined && !cache) { cache = true
|
var p = can.page.Cache(can.file, can.ui[item]); if (p != undefined && !cache) { cache = true
|
||||||
can.onaction.selectLine(can, p.current.line)
|
can.onaction.selectLine(can, parseInt(msg.Option("line")))
|
||||||
can.ui.content.scrollTo(0, p.scrollTop)
|
can.ui.content.scrollTo(0, p.scrollTop)
|
||||||
can.max = p.max
|
can.max = p.max
|
||||||
}
|
}
|
||||||
@ -116,14 +141,23 @@ Volcanos("onsyntax", {help: "语法高亮", list: ["keyword", "prefix", "line"],
|
|||||||
return p.line? p.line(can, line): line
|
return p.line? p.line(can, line): line
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
Volcanos("onaction", {help: "控件交互", list: [],
|
Volcanos("onaction", {help: "控件交互", list: ["项目", "运行", "搜索"],
|
||||||
"返回": function(event, can) {
|
"返回": function(event, can) {
|
||||||
var last = can.history.pop(); last = can.history.pop()
|
var last = can.history.pop(); last = can.history.pop()
|
||||||
last && can.onimport.tabview(can, last.path, last.file, last.line)
|
last && can.onimport.tabview(can, last.path, last.file, last.line)
|
||||||
can.Status("跳转数", can.history.length)
|
can.Status("跳转数", can.history.length)
|
||||||
},
|
},
|
||||||
project: function(event, can) { can.onmotion.toggle(can, can.ui.project) },
|
"运行": function(event, can) {
|
||||||
searchShow: function(event, can) { can.onmotion.toggle(can, can.ui.search) },
|
var msg = can.request(event, {_toast: "运行中..."})
|
||||||
|
can.run(event, ["action", "engine", can.parse, can.Option("file"), can.Option("path")], function(msg) {
|
||||||
|
can.onappend.table(can, msg, function(value, key, index) { return {text: [value, "td"]} }, can.ui.output||can.ui.display)
|
||||||
|
can.onappend.board(can, msg.Result(), can.ui.output||can.ui.display)
|
||||||
|
can.page.Modify(can, can.ui.display, {style: {display: "block"}})
|
||||||
|
}, true)
|
||||||
|
},
|
||||||
|
"项目": function(event, can) { can.onmotion.toggle(can, can.ui.project) },
|
||||||
|
"搜索": function(event, can) { can.onmotion.toggle(can, can.ui.search) },
|
||||||
|
"收藏": function(event, can) { can.onmotion.toggle(can, can.ui.favor._target) },
|
||||||
|
|
||||||
appendLine: function(can, value) {
|
appendLine: function(can, value) {
|
||||||
var ui = can.page.Append(can, can.ui.content, [{type: "tr", list: [
|
var ui = can.page.Append(can, can.ui.content, [{type: "tr", list: [
|
||||||
@ -201,8 +235,8 @@ Volcanos("onaction", {help: "控件交互", list: [],
|
|||||||
can.page.Modify(can, can.ui.search, {style: {display: ""}})
|
can.page.Modify(can, can.ui.search, {style: {display: ""}})
|
||||||
value = can.ui.word.value = value || can.ui.word.value || "main"
|
value = can.ui.word.value = value || can.ui.word.value || "main"
|
||||||
|
|
||||||
var toast = can.user.toast(can, "搜索中...", value, 1000000)
|
var msg = can.request(event, {_toast: "搜索中..."})
|
||||||
can.run(event, ["action", "search", can.parse, value, can.Option("path")], function(msg) { toast.Close()
|
can.run(event, ["action", "search", can.parse, value, can.Option("path")], function(msg) {
|
||||||
|
|
||||||
can.onmotion.clear(can, can.ui.tags)
|
can.onmotion.clear(can, can.ui.tags)
|
||||||
can.onappend.table(can, msg, function(value, key, index, line) {
|
can.onappend.table(can, msg, function(value, key, index, line) {
|
||||||
@ -247,7 +281,8 @@ Volcanos("onaction", {help: "控件交互", list: [],
|
|||||||
{_input: "text", name: "name", value: "@key"},
|
{_input: "text", name: "name", value: "@key"},
|
||||||
], function(event, button, meta, list) {
|
], function(event, button, meta, list) {
|
||||||
can.run(event, [
|
can.run(event, [
|
||||||
"favor", "topic", meta.topic||"some",
|
"action", "favor",
|
||||||
|
"action", "insert", "topic", meta.topic||"some",
|
||||||
"type", can.parse, "name", meta.name||"some", "text", value,
|
"type", can.parse, "name", meta.name||"some", "text", value,
|
||||||
"path", can.Option("path"), "file", can.Option("file"), "line", can.Option("line"),
|
"path", can.Option("path"), "file", can.Option("file"), "line", can.Option("line"),
|
||||||
], function(msg) {
|
], function(msg) {
|
||||||
|
@ -28,12 +28,13 @@ Volcanos("onimport", {help: "导入数据", list: [], _merge: function(can, sub)
|
|||||||
}},
|
}},
|
||||||
]); can.core.Copy(can.ui, ui, "current", "command")
|
]); can.core.Copy(can.ui, ui, "current", "command")
|
||||||
|
|
||||||
var ui = can.page.Append(can, can.ui.display, [
|
var ui = can.page.Appends(can, can.ui.display, [
|
||||||
{view: "action", list: [
|
{view: "action", list: [
|
||||||
{input: ["cmd", function(event) {
|
{input: ["cmd", function(event) {
|
||||||
can.onkeymap.parse(event, can, "command")
|
can.onkeymap.parse(event, can, "command")
|
||||||
}], value: "", onfocus: function(event) {
|
}], value: "", onfocus: function(event) {
|
||||||
event.target.setSelectionRange(0, -1)
|
event.target.setSelectionRange(0, -1)
|
||||||
|
can.onkeymap._command(can)
|
||||||
}},
|
}},
|
||||||
{button: ["执行", function(event) {
|
{button: ["执行", function(event) {
|
||||||
can.onkeymap.command.Enter(event, can, can.ui.cmd.value)
|
can.onkeymap.command.Enter(event, can, can.ui.cmd.value)
|
||||||
@ -86,8 +87,8 @@ Volcanos("onkeymap", {help: "键盘交互", list: ["command", "normal", "insert"
|
|||||||
},
|
},
|
||||||
_engine: {
|
_engine: {
|
||||||
e: function(event, can, line, ls) { can.onimport.tabview(can, can.Option("path"), ls[1]) },
|
e: function(event, can, line, ls) { can.onimport.tabview(can, can.Option("path"), ls[1]) },
|
||||||
p: function(event, can) { can.onaction.project(event, can) },
|
p: function(event, can) { can.onaction["项目"](event, can) },
|
||||||
q: function(event, can) { can.onaction.display(event, can) },
|
q: function(event, can) { can.onmotion.hidden(can, can.ui.display) },
|
||||||
w: function(event, can) { can.onaction.save(event, can) },
|
w: function(event, can) { can.onaction.save(event, can) },
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -121,17 +122,19 @@ Volcanos("onkeymap", {help: "键盘交互", list: ["command", "normal", "insert"
|
|||||||
Escape: function(event, can) { can.onkeymap._normal(can) },
|
Escape: function(event, can) { can.onkeymap._normal(can) },
|
||||||
Enter: function(event, can) { can.onmotion.hidden(can, can.ui.command)
|
Enter: function(event, can) { can.onmotion.hidden(can, can.ui.command)
|
||||||
can.page.Modify(can, can.ui.display, {style: {display: "block"}})
|
can.page.Modify(can, can.ui.display, {style: {display: "block"}})
|
||||||
|
var line = can.ui.command.value || can.ui.cmd.value
|
||||||
can.ui.cmd.value = line, can.ui.cmd.focus()
|
can.ui.cmd.value = line, can.ui.cmd.focus()
|
||||||
can.ui.cmd.setSelectionRange(0, -1)
|
can.ui.cmd.setSelectionRange(0, -1)
|
||||||
|
can.ui.command.value = ""
|
||||||
|
|
||||||
can.onmotion.clear(can, can.ui.output)
|
can.onmotion.clear(can, can.ui.output)
|
||||||
var line = can.ui.command.value || can.ui.cmd.value ; var ls = can.core.Split(line, " ", ",")
|
var ls = can.core.Split(line, " ", ",")
|
||||||
var cb = can.onkeymap._engine[ls[0]]; if (typeof cb == "function") {
|
var cb = can.onkeymap._engine[ls[0]]; if (typeof cb == "function") {
|
||||||
can.onmotion.hidden(can, can.ui.display)
|
can.onmotion.hidden(can, can.ui.display)
|
||||||
can.onkeymap._normal(can)
|
can.onkeymap._normal(can)
|
||||||
cb(event, can, line, ls)
|
cb(event, can, line, ls)
|
||||||
} else {
|
} else {
|
||||||
can.onkeymap._remote(event, can, line, ["action", "command"].concat(ls))
|
can.onkeymap._remote(event, can, line, ["action", "command", "run"].concat(ls))
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
jk: function(event, can) { can.keylist = can.keylist.slice(0, -1)
|
jk: function(event, can) { can.keylist = can.keylist.slice(0, -1)
|
||||||
@ -162,15 +165,9 @@ Volcanos("onkeymap", {help: "键盘交互", list: ["command", "normal", "insert"
|
|||||||
},
|
},
|
||||||
j: function(event, can) {
|
j: function(event, can) {
|
||||||
can.onaction.selectLine(can, can.current.next())
|
can.onaction.selectLine(can, can.current.next())
|
||||||
// var pos = can.current.offset()+can.current.window()-can.ui.current.offsetTop; if (pos < 5*can.current.height()) {
|
|
||||||
// can.current.scroll(0, can.current.height())
|
|
||||||
// }
|
|
||||||
},
|
},
|
||||||
k: function(event, can) {
|
k: function(event, can) {
|
||||||
can.onaction.selectLine(can, can.current.prev())
|
can.onaction.selectLine(can, can.current.prev())
|
||||||
// var pos = can.ui.current.offsetTop-can.current.offset(); if (pos < can.current.height()*5) {
|
|
||||||
// can.current.scroll(0, -can.current.height())
|
|
||||||
// }
|
|
||||||
},
|
},
|
||||||
|
|
||||||
gg: function(event, can, count) { count = count || 1
|
gg: function(event, can, count) { count = count || 1
|
||||||
@ -291,14 +288,11 @@ Volcanos("onkeymap", {help: "键盘交互", list: ["command", "normal", "insert"
|
|||||||
can.onaction.rerankLine(can)
|
can.onaction.rerankLine(can)
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
Volcanos("onaction", {help: "控件交互", list: [],
|
Volcanos("onaction", {help: "控件交互", list: ["项目", "搜索", "收藏"],
|
||||||
display: function(event, can) { can.onmotion.toggle(can, can.ui.display) },
|
save: function(event, can) { var msg = can.request(event, {content: can.onexport.content(can)})
|
||||||
|
|
||||||
save: function(event, can) {
|
|
||||||
var msg = can.request(event); msg.Option("content", can.onexport.content(can))
|
|
||||||
can.run(event, ["action", "save", can.parse, can.Option("file"), can.Option("path")], function(msg) {
|
can.run(event, ["action", "save", can.parse, can.Option("file"), can.Option("path")], function(msg) {
|
||||||
can.user.toast(can, "保存成功")
|
can.user.toast(can, "保存成功")
|
||||||
}, true)
|
}, true)
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
Volcanos("onexport", {help: "导出数据", list: ["文件数", "模式", "按键", "解析器", "文件名", "当前行", "跳转数", "标签数"]})
|
Volcanos("onexport", {help: "导出数据", list: ["文件数", "模式", "按键", "解析器", "文件名", "当前行", "跳转数"]})
|
||||||
|
@ -47,9 +47,10 @@ Volcanos("onimport", {help: "导入数据", list: [], _init: function(can, conf,
|
|||||||
Volcanos("onaction", {help: "交互操作", list: [], _init: function(can, msg, list, cb, target) {
|
Volcanos("onaction", {help: "交互操作", list: [], _init: function(can, msg, list, cb, target) {
|
||||||
},
|
},
|
||||||
change: function(event, can, name, value, cb) {
|
change: function(event, can, name, value, cb) {
|
||||||
can.page.Select(can, can._option, "input.args", function(input) {
|
return can.page.Select(can, can._option, "input.args", function(input) {
|
||||||
if (input.name == name && value != input.value) { input.value = value
|
if (input.name == name && value != input.value) { input.value = value
|
||||||
var data = input.dataset || {}; data.action == "auto" && can.run(event, can.Pack(), cb)
|
var data = input.dataset || {}; data.action == "auto" && can.run(event, can.Pack(), cb)
|
||||||
|
return input
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
@ -20,7 +20,10 @@ Volcanos("onimport", {help: "导入数据", list: [], _init: function(can, msg,
|
|||||||
key == "value"? can.core.List(array, function(item, index) { msg.Option(item.key, item.value) }): msg.Option(line)
|
key == "value"? can.core.List(array, function(item, index) { msg.Option(item.key, item.value) }): msg.Option(line)
|
||||||
return can.run(event, ["action", target.name], function(msg) { can.run() }, true)
|
return can.run(event, ["action", target.name], function(msg) { can.run() }, true)
|
||||||
}
|
}
|
||||||
can.sup.onaction.change(event, can.sup, key, value, function(msg) { can.onimport._init(can, msg) })
|
|
||||||
|
if (can.sup.onaction.change(event, can.sup, key, value, function(msg) { can.onimport._init(can, msg) }).length > 0) { return }
|
||||||
|
|
||||||
|
can.sup.Select && can.sup.Select(line)
|
||||||
|
|
||||||
}, ondblclick: function(event) {
|
}, ondblclick: function(event) {
|
||||||
can.onmotion.modify(can, event.target, function(event, value, old) {
|
can.onmotion.modify(can, event.target, function(event, value, old) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user