aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authormrmr19932014-11-23 11:53:22 +0000
committermrmr19932014-11-23 11:57:47 +0000
commit176ea28aecc446be0c9788e6a59677fa94c51fee (patch)
treecf3111acc887210b1f7ab75b0302a69ece91073e /lib
parent70cb13bfbd39eba5f2ca06bba35ea5a69dd16fc8 (diff)
downloadvimium-176ea28aecc446be0c9788e6a59677fa94c51fee.tar.bz2
Monitor a tab's frames as a list with the current frame at its head
Diffstat (limited to 'lib')
-rw-r--r--lib/utils.coffee7
1 files changed, 7 insertions, 0 deletions
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