Skip to content
This repository was archived by the owner on Apr 17, 2023. It is now read-only.

Commit 94237a6

Browse files
Merge pull request #294 from feedhenry/RHMAP-22114
Rhmap 22114 - Upgrade the fh-sync-js from 1.3.2 to 1.4.0
2 parents 4a90b8a + 1c5df2b commit 94237a6

9 files changed

+528
-508
lines changed

CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Changelog - FeedHenry Javascript SDK
22

3+
## 3.1.0 - 2019-04-15
4+
### Change
5+
- Upgrade version of fh-sync-js from 1.3.2 to 1.4.0
6+
- Add lawnchair files changed at the version 1.4.0 of fh-sync-js
7+
38
## 3.0.12 - 2018-11-30
49
### Fix
510
- Add default result for init requests across domains when the result is not successful which is expected when the connection tag is disable.

libs/lawnchair/lawnchair.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ Lawnchair.adapter = function (id, obj) {
8585
// ugly here for a cleaner dsl for implementing adapters
8686
obj['adapter'] = id
8787
// methods required to implement a lawnchair adapter
88-
var implementing = 'adapter valid init keys save batch get exists all remove nuke'.split(' ')
88+
var implementing = 'adapter valid init keys close save batch get exists all remove nuke'.split(' ')
8989
, indexOf = this.prototype.indexOf
9090
// mix in the adapter
9191
for (var i in obj) {
@@ -162,4 +162,4 @@ Lawnchair.prototype = {
162162
return this
163163
}
164164
// --
165-
};
165+
};

libs/lawnchair/lawnchairIndexDbAdapter.js

+26-15
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,14 @@ Lawnchair.adapter('indexed-db', (function(){
1111

1212

1313
return {
14+
valid: function () { return !!getIDB(); },
1415

15-
valid: function() { return !!getIDB(); },
16+
close: function () {
17+
if (this.db) {
18+
this.db.close();
19+
}
20+
return this;
21+
},
1622

1723
init:function(options, callback) {
1824
this.idb = getIDB();
@@ -24,34 +30,33 @@ Lawnchair.adapter('indexed-db', (function(){
2430
//FEEDHENRY CHANGE TO ALLOW ERROR CALLBACK
2531
if(options && 'function' === typeof options.fail) fail = options.fail
2632
//END CHANGE
27-
request.onupgradeneeded = function(event){
28-
self.store = request.result.createObjectStore("teststore", { autoIncrement: true} );
33+
request.onupgradeneeded = function (event) {
34+
self.store = request.result.createObjectStore("teststore", { autoIncrement: true });
2935
for (var i = 0; i < self.waiting.length; i++) {
3036
self.waiting[i].call(self);
3137
}
3238
self.waiting = [];
3339
win();
34-
}
40+
};
3541

36-
request.onsuccess = function(event) {
42+
request.onsuccess = function (event) {
3743
self.db = request.result;
3844

39-
40-
if(self.db.version != "2.0") {
41-
if(typeof self.db.setVersion == 'function'){
45+
if (self.db.version != "2.0") {
46+
if (typeof self.db.setVersion == 'function') {
4247

4348
var setVrequest = self.db.setVersion("2.0");
4449
// onsuccess is the only place we can create Object Stores
45-
setVrequest.onsuccess = function(e) {
46-
self.store = self.db.createObjectStore("teststore", { autoIncrement: true} );
50+
setVrequest.onsuccess = function (e) {
51+
self.store = self.db.createObjectStore("teststore", { autoIncrement: true });
4752
for (var i = 0; i < self.waiting.length; i++) {
4853
self.waiting[i].call(self);
4954
}
5055
self.waiting = [];
5156
win();
5257
};
53-
setVrequest.onerror = function(e) {
54-
// console.log("Failed to create objectstore " + e);
58+
setVrequest.onerror = function (e) {
59+
// console.log("Failed to create objectstore " + e);
5560
fail(e);
5661
}
5762

@@ -64,7 +69,8 @@ Lawnchair.adapter('indexed-db', (function(){
6469
self.waiting = [];
6570
win();
6671
}
67-
}
72+
};
73+
6874
request.onerror = fail;
6975
},
7076

@@ -77,7 +83,12 @@ Lawnchair.adapter('indexed-db', (function(){
7783
}
7884

7985
var self = this;
80-
var win = function (e) { if (callback) { obj.key = e.target.result; self.lambda(callback).call(self, obj) }};
86+
var win = function (e) {
87+
if (callback) {
88+
obj.key = e.target.result;
89+
self.lambda(callback).call(self, obj)
90+
}
91+
};
8192
var accessType = "readwrite";
8293
var trans = this.db.transaction(["teststore"],accessType);
8394
var store = trans.objectStore("teststore");
@@ -232,4 +243,4 @@ Lawnchair.adapter('indexed-db', (function(){
232243

233244
};
234245

235-
})());
246+
})());

licenses/ACORN_MIT.TXT

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (C) 2012-2018 by various contributors (see AUTHORS)
1+
Copyright (C) 2012-2014 by various contributors (see AUTHORS)
22

33
Permission is hereby granted, free of charge, to any person obtaining a copy
44
of this software and associated documentation files (the "Software"), to deal

licenses/XTEND_MIT.TXT

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2012-2014 Raynos.
1+
Copyright (c) 2012 Raynos.
22

33
Permission is hereby granted, free of charge, to any person obtaining a copy
44
of this software and associated documentation files (the "Software"), to deal
@@ -16,4 +16,4 @@ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
1616
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
1717
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
1818
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19-
THE SOFTWARE.
19+
THE SOFTWARE.WARE.

licenses/licenses.html

+2-2
Original file line numberDiff line numberDiff line change
@@ -394,14 +394,14 @@ <h2>fh-js-sdk</h2>
394394
<tr>
395395
<td>N/A</td>
396396
<td>fh-js-sdk</td>
397-
<td>3.0.9</td>
397+
<td>3.1.0</td>
398398
<td>UNKNOWN</td>
399399
<td><a href=FH-JS-SDK_APACHE*.TXT>FH-JS-SDK_APACHE*.TXT</a></td>
400400
</tr>
401401
<tr>
402402
<td>N/A</td>
403403
<td>fh-sync-js</td>
404-
<td>1.3.2</td>
404+
<td>1.4.0</td>
405405
<td>UNKNOWN</td>
406406
<td><a href=FH-SYNC-JS_APACHE*.TXT>FH-SYNC-JS_APACHE*.TXT</a></td>
407407
</tr>

licenses/licenses.xml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<?xml version='1.0'?>
22
<licenseSummary>
33
<project>fh-js-sdk</project>
4-
<version>3.0.9</version>
4+
<version>3.1.0</version>
55
<license>Copyright (c) 2014 FeedHenry Ltd, All Rights Reserved.</license>
66
<dependencies>
77
<dependency>
@@ -560,7 +560,7 @@
560560
</dependency>
561561
<dependency>
562562
<packageName>fh-js-sdk</packageName>
563-
<version>3.0.9</version>
563+
<version>3.1.0</version>
564564
<licenses>
565565
<license>
566566
<name>UNKNOWN</name>
@@ -570,7 +570,7 @@
570570
</dependency>
571571
<dependency>
572572
<packageName>fh-sync-js</packageName>
573-
<version>1.3.2</version>
573+
<version>1.4.0</version>
574574
<licenses>
575575
<license>
576576
<name>UNKNOWN</name>

0 commit comments

Comments
 (0)