From 176ea28aecc446be0c9788e6a59677fa94c51fee Mon Sep 17 00:00:00 2001 From: mrmr1993 Date: Sun, 23 Nov 2014 11:53:22 +0000 Subject: Monitor a tab's frames as a list with the current frame at its head --- lib/utils.coffee | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'lib') diff --git a/lib/utils.coffee b/lib/utils.coffee index b7f8731a..428112c8 100644 --- a/lib/utils.coffee +++ b/lib/utils.coffee @@ -147,6 +147,13 @@ Array.copy = (array) -> Array.prototype.slice.call(array, 0) String::startsWith = (str) -> @indexOf(str) == 0 +Array::rotate = (count) -> + return this if @length == 0 + count = count % @length + count = count + @length if count < 0 + Array::push.apply(this, @splice(0, count)) + this + globalRoot = window ? global globalRoot.extend = (hash1, hash2) -> for key of hash2 -- cgit v1.2.3