From d4a6f818a5c427156636ee013354f2e0085392f8 Mon Sep 17 00:00:00 2001 From: James Campos Date: Mon, 9 May 2011 22:09:37 -0700 Subject: [PATCH] fix menu for opera --- 4chan_x.js | 11 +++++++++++ script.coffee | 5 +++++ 2 files changed, 16 insertions(+) diff --git a/4chan_x.js b/4chan_x.js index 6968a8c8b..44a93d862 100644 --- a/4chan_x.js +++ b/4chan_x.js @@ -446,6 +446,17 @@ } }); } + if (!Object.keys) { + Object.keys = function(o) { + var key, _i, _len, _results; + _results = []; + for (_i = 0, _len = o.length; _i < _len; _i++) { + key = o[_i]; + _results.push(key); + } + return _results; + }; + } $$ = function(selector, root) { if (root == null) { root = d.body; diff --git a/script.coffee b/script.coffee index a469d31a9..a361eae70 100644 --- a/script.coffee +++ b/script.coffee @@ -315,6 +315,11 @@ else name = NAMESPACE + name localStorage[name] = JSON.stringify value +# XXX opera cannot into Object.keys +if not Object.keys + Object.keys = (o) -> + key for key in o + $$ = (selector, root=d.body) -> Array::slice.call root.querySelectorAll selector