added indexedDB functions
This commit is contained in:
parent
7940c94c87
commit
d7ff21f1e4
@ -10,7 +10,17 @@
|
|||||||
|
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
<div id="output"></div>
|
<div class="container">
|
||||||
|
|
||||||
|
<div id="output_div"></div>
|
||||||
|
|
||||||
|
<div class="box">
|
||||||
|
<label for="ask_flo_addr">Enter Your FLO Address: </label>
|
||||||
|
<input type="text" id="ask_flo_addr" class="form-control">
|
||||||
|
|
||||||
|
<input type="button" id="ask_flo_addr_btn" value="Submit">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- SHA1 -->
|
<!-- SHA1 -->
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
@ -8025,7 +8035,7 @@
|
|||||||
var output;
|
var output;
|
||||||
|
|
||||||
function init() {
|
function init() {
|
||||||
output = document.getElementById("output");
|
output = document.getElementById("output_div");
|
||||||
testWebSocket();
|
testWebSocket();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -8144,6 +8154,7 @@
|
|||||||
var request = window.indexedDB.open("localbitcoinDB", 1);
|
var request = window.indexedDB.open("localbitcoinDB", 1);
|
||||||
|
|
||||||
request.onerror = function (event) {
|
request.onerror = function (event) {
|
||||||
|
//https://stackoverflow.com/questions/13972385/invalidstateerror-while-opening-indexeddb-in-firefox
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
var error = event.target.error;
|
var error = event.target.error;
|
||||||
console.log("IndexedDB database open error:", error.name, error.message);
|
console.log("IndexedDB database open error:", error.name, error.message);
|
||||||
@ -8151,7 +8162,7 @@
|
|||||||
|
|
||||||
request.onsuccess = function (event) {
|
request.onsuccess = function (event) {
|
||||||
db = request.result;
|
db = request.result;
|
||||||
console.log("success: " + db);
|
console.log(db);
|
||||||
};
|
};
|
||||||
|
|
||||||
request.onupgradeneeded = function (event) {
|
request.onupgradeneeded = function (event) {
|
||||||
@ -8203,19 +8214,19 @@
|
|||||||
.add(localbitcoinplusplusObj);
|
.add(localbitcoinplusplusObj);
|
||||||
|
|
||||||
request.onsuccess = function (event) {
|
request.onsuccess = function (event) {
|
||||||
alert("Kenny has been added to your database.");
|
alert("Data has been added to your database.");
|
||||||
};
|
};
|
||||||
|
|
||||||
request.onerror = function (event) {
|
request.onerror = function (event) {
|
||||||
alert("Unable to add data\r\nKenny is aready exist in your database! ");
|
alert("Unable to add data\r\Data aready exists in your database! ");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateinDB(localbitcoinplusplusObj, key) {
|
function updateinDB(Obj, key) {
|
||||||
|
|
||||||
var request = db.transaction(["localbitcoinUser"], "readwrite")
|
var request = db.transaction(["localbitcoinUser"], "readwrite")
|
||||||
.objectStore("localbitcoinUser")
|
.objectStore("localbitcoinUser")
|
||||||
.put(localbitcoinplusplusObj, key);
|
.put(Obj);
|
||||||
|
|
||||||
request.onsuccess = function (event) {
|
request.onsuccess = function (event) {
|
||||||
alert("Data has been updated to your database.");
|
alert("Data has been updated to your database.");
|
||||||
@ -8279,14 +8290,10 @@
|
|||||||
"buyer_key_signature", "order_validator_public_key");
|
"buyer_key_signature", "order_validator_public_key");
|
||||||
doSend(buytrade);
|
doSend(buytrade);
|
||||||
}
|
}
|
||||||
document.getElementById("output").appendChild(trade_btn);
|
document.getElementById("output_div").appendChild(trade_btn);
|
||||||
})()
|
})()
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script>
|
|
||||||
|
|
||||||
</script>
|
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|
||||||
</html>
|
</html>
|
||||||
Loading…
Reference in New Issue
Block a user