forked from x/volcanos
add some
This commit is contained in:
parent
b6dc209117
commit
655b11ac77
@ -118,6 +118,7 @@ Volcanos("core", {
|
|||||||
})(k) } } return list
|
})(k) } } return list
|
||||||
},
|
},
|
||||||
Timer: shy("定时器, value, [1,2,3,4], {delay, interval, length}", function(interval, cb, cbs) { var timer = {stop: false}
|
Timer: shy("定时器, value, [1,2,3,4], {delay, interval, length}", function(interval, cb, cbs) { var timer = {stop: false}
|
||||||
|
if (interval == "0") { return cb && cb(), cbs && cbs() }
|
||||||
function loop(i) { timer.stop || i >= interval.length && interval.length >= 0 || cb(timer, interval.interval||interval[i], i, interval)?
|
function loop(i) { timer.stop || i >= interval.length && interval.length >= 0 || cb(timer, interval.interval||interval[i], i, interval)?
|
||||||
typeof cbs == code.FUNCTION && cbs(timer, interval): setTimeout(function() { loop(i+1) }, interval.interval||interval[i+1])
|
typeof cbs == code.FUNCTION && cbs(timer, interval): setTimeout(function() { loop(i+1) }, interval.interval||interval[i+1])
|
||||||
} interval = typeof interval == code.OBJECT? interval: [interval]; if (interval.interval == 0) { return cb(), timer }
|
} interval = typeof interval == code.OBJECT? interval: [interval]; if (interval.interval == 0) { return cb(), timer }
|
||||||
|
@ -35,7 +35,10 @@ Volcanos(chat.ONIMPORT, {
|
|||||||
if (msg.Option(ctx.DISPLAY)) {
|
if (msg.Option(ctx.DISPLAY)) {
|
||||||
function _grow() { if (can.sub._grow_list.length == 0) { return } if (can.sub._grow_running) { return } can.sub._grow_running = true
|
function _grow() { if (can.sub._grow_list.length == 0) { return } if (can.sub._grow_running) { return } can.sub._grow_running = true
|
||||||
var msg = can.sub._grow_list.shift(), list = [], text = msg.detail[1]; for (var i = 0; i < text.length; i++) { list.push(text[i]) }
|
var msg = can.sub._grow_list.shift(), list = [], text = msg.detail[1]; for (var i = 0; i < text.length; i++) { list.push(text[i]) }
|
||||||
can.core.Next(list, function(text, next) { can.core.Timer(30, next), can.sub._grow.onimport.grow(can.sub._grow, msg, "only", text) }, function() { can.sub._grow_running = false, _grow() })
|
can.core.Next(list, function(text, next) {
|
||||||
|
can.sub._grow.onimport.grow(can.sub._grow, msg, "only", text)
|
||||||
|
can.core.Timer(msg.Option("delay")||30, next)
|
||||||
|
}, function() { can.sub._grow_running = false, _grow() })
|
||||||
}
|
}
|
||||||
if (can.sub._grow) {
|
if (can.sub._grow) {
|
||||||
(can.sub._grow_list = can.sub._grow_list||[]).push(msg); return _grow()
|
(can.sub._grow_list = can.sub._grow_list||[]).push(msg); return _grow()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user