1
0
mirror of https://shylinux.com/x/volcanos synced 2025-04-25 16:58:06 +08:00
This commit is contained in:
harveyshao 2022-12-15 10:46:39 +08:00
parent 5e516f3b86
commit 6d38dfdfa4
3 changed files with 7 additions and 1 deletions

View File

@ -95,6 +95,11 @@ Volcanos("core", {
for (var k in obj) { var res = typeof cb == lang.FUNCTION? cb(k, obj[k]): k; res != undefined && list.push(res) }
return list
},
ItemKeys: function(obj, cb) { var list = []
var keys = []; for (var k in obj) { keys.push(k) } keys.sort()
for (var i in keys) { var k = keys[i]; var res = typeof cb == lang.FUNCTION? cb(k, obj[k]): k; res != undefined && list.push(res) }
return list
},
Items: function(obj, cb) { var list = []
for (var k in obj) { list = list.concat(this.List(obj[k], function(v, i) { return typeof cb == lang.FUNCTION && cb(v, i, k, obj) })) }
return list

View File

@ -359,6 +359,7 @@ Volcanos(chat.ONSYNTAX, {
"if": code.KEYWORD,
"else": code.KEYWORD,
"for": code.KEYWORD,
"in": code.KEYWORD,
"while": code.KEYWORD,
"break": code.KEYWORD,
"continue": code.KEYWORD,

View File

@ -106,7 +106,7 @@ Volcanos(chat.ONFIGURE, {
))
},
plugin: function(can, target, zone) { var total = 0
can.onimport.tree(can, can.core.Item(can.onengine.plugin.meta, function(key) { return total++, {index: key} }), ctx.INDEX, ice.PT, function(event, item) {
can.onimport.tree(can, can.core.ItemKeys(can.onengine.plugin.meta, function(key) { return total++, {index: key} }), ctx.INDEX, ice.PT, function(event, item) {
can.onimport.tabview(can, can.Option(nfs.PATH), can.core.Keys("can", item.index), ctx.INDEX)
}, target), zone._total(total)
},