Fix Opera "$.get is not defined"

This commit is contained in:
Zixaphir 2013-04-25 23:53:35 -07:00
parent 0b861a3cbb
commit 7cd2db46e3
2 changed files with 85 additions and 82 deletions

View File

@ -755,10 +755,12 @@
};
(function() {
var cb, items, key, keys, scriptStorage, _i, _len;
var scriptStorage;
scriptStorage = opera.scriptStorage;
$["delete"] = function(keys) {};
$["delete"] = function(keys) {
var key, _i, _len;
if (!(keys instanceof Array)) {
keys = [keys];
}
@ -768,8 +770,10 @@
localStorage.removeItem(key);
delete scriptStorage[key];
}
return;
$.get = function(key, val, cb) {};
};
$.get = function(key, val, cb) {
var items;
if (typeof cb === 'function') {
items = $.item(key, val);
} else {
@ -777,8 +781,6 @@
cb = val;
}
return $.queueTask(function() {
var val;
for (key in items) {
if (val = scriptStorage[g.NAMESPACE + key]) {
items[key] = JSON.parse(val);
@ -786,8 +788,7 @@
}
return cb(items);
});
})();
};
$.set = (function() {
var set;
@ -812,6 +813,7 @@
}
};
})();
})();
$$ = function(selector, root) {
if (root == null) {

View File

@ -374,6 +374,7 @@ $.set = do ->
for key, val of keys
set key, val
return
return
<% } else { %>
# http://wiki.greasespot.net/Main_Page