]> hackdaworld.org Git - outofuni/jsutils.git/commitdiff
store sname fix
authorhackbard <hackbard@hackdaworld.org>
Thu, 12 Oct 2017 16:11:29 +0000 (18:11 +0200)
committerhackbard <hackbard@hackdaworld.org>
Thu, 12 Oct 2017 16:11:29 +0000 (18:11 +0200)
idb.js

diff --git a/idb.js b/idb.js
index f574688ea241eb78465222c14d67976971f5e04d..d69b9532053ac3be19a66d6cff50eac6a9c898ae 100644 (file)
--- a/idb.js
+++ b/idb.js
@@ -95,18 +95,18 @@ var idb = {
                req.onerror=idb.onerror;
                req.onblocked=idb.onblocked;
        },
-       del_store: function(store,callback) {
-               var tx=db.handle.transaction(store,'readwrite');
-               var store=tx.objectStore(store);
+       del_store: function(sname,callback) {
+               var tx=db.handle.transaction(sname,'readwrite');
+               var store=tx.objectStore(sname);
                var req=store.clear();
                req.onsuccess=function() {
                        cl("db: store "+store.name+" deleted");
                        callback();
                };
        },
-       add_store_item: function(store,item,callback) {
-               var tx=idb.handle.transaction(store,'readwrite');
-               var store=tx.objectStore(store);
+       add_store_item: function(sname,item,callback) {
+               var tx=idb.handle.transaction(sname,'readwrite');
+               var store=tx.objectStore(sname);
                var req=store.add(item);
                req.onsuccess=function(event) {
                        callback(event);
@@ -115,9 +115,9 @@ var idb = {
                        cl("idb: add item error, "+error);
                };
        },
-       del_store_item: function(store,num,callback) {
-               var tx=db.handle.transaction(store,'readwrite');
-               var store=tx.objectStore(store);
+       del_store_item: function(sname,num,callback) {
+               var tx=db.handle.transaction(sname,'readwrite');
+               var store=tx.objectStore(sname);
 
                var kr=IDBKeyRange.bound(num,num,false,false);
                var req=store.openCursor(kr);
@@ -141,9 +141,9 @@ var idb = {
 
                };
        },
-       update_store_item: function(store,num,nitem,callback) {
-               var tx=idb.handle.transaction(store,'readwrite');
-               var store=tx.objectStore(store);
+       update_store_item: function(sname,num,nitem,callback) {
+               var tx=idb.handle.transaction(sname,'readwrite');
+               var store=tx.objectStore(sname);
 
                var kr=IDBKeyRange.bound(num,num,false,false);
                var req=store.openCursor(kr);
@@ -190,7 +190,7 @@ var idb = {
 
                };
        },
-       get_store_items: function(store,callback,low,up) {
+       get_store_items: function(sname,callback,low,up) {
                // if low and up are undefined, all items are considered
                var kr;
                var last=false;
@@ -219,8 +219,8 @@ var idb = {
                        kr=IDBKeyRange.upperBound(up,true);
                }
 
-               var tx=idb.handle.transaction(store,'readonly');
-               var store=tx.objectStore(store);
+               var tx=idb.handle.transaction(sname,'readonly');
+               var store=tx.objectStore(sname);
 
                var obj={};
                obj.cnt_objs=0;
@@ -251,9 +251,9 @@ var idb = {
                        }
                };
        },
-       get_item_by_key: function(store,key,callback) {
-               var tx=idb.handle.transaction(store,'readonly')
-               var store=tx.objectStore(store);
+       get_item_by_key: function(sname,key,callback) {
+               var tx=idb.handle.transaction(sname,'readonly')
+               var store=tx.objectStore(sname);
                var req=store.get(key);
                req.onerror=function(event) {
                        cl("idb: get key error - "+event.target.errorCode);
@@ -264,9 +264,9 @@ var idb = {
                        }
                }
        },
-       get_item_by_index: function(store,index,val,callback) {
-               var tx=db.handle.transaction(store,'readonly')
-               var store=tx.objectStore(store);
+       get_item_by_index: function(sname,index,val,callback) {
+               var tx=db.handle.transaction(sname,'readonly')
+               var store=tx.objectStore(sname);
                var idx=store.index(index);
                var req=idx.get(val);
                req.onerror=function(event) {
@@ -278,9 +278,9 @@ var idb = {
                        }
                }
        },
-       del_item_by_key: function(store,key,callback) {
-               var tx=idb.handle.transaction(store,'readwrite');
-               var store=tx.objectStore(store);
+       del_item_by_key: function(sname,key,callback) {
+               var tx=idb.handle.transaction(sname,'readwrite');
+               var store=tx.objectStore(sname);
 
                var kr=IDBKeyRange.bound(key,key,false,false);
                var req=store.openCursor(kr);