added indexedDB functions
This commit is contained in:
parent
7940c94c87
commit
d7ff21f1e4
@ -10,7 +10,17 @@
|
||||
|
||||
<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 -->
|
||||
<script type="text/javascript">
|
||||
@ -8025,7 +8035,7 @@
|
||||
var output;
|
||||
|
||||
function init() {
|
||||
output = document.getElementById("output");
|
||||
output = document.getElementById("output_div");
|
||||
testWebSocket();
|
||||
}
|
||||
|
||||
@ -8144,6 +8154,7 @@
|
||||
var request = window.indexedDB.open("localbitcoinDB", 1);
|
||||
|
||||
request.onerror = function (event) {
|
||||
//https://stackoverflow.com/questions/13972385/invalidstateerror-while-opening-indexeddb-in-firefox
|
||||
event.preventDefault();
|
||||
var error = event.target.error;
|
||||
console.log("IndexedDB database open error:", error.name, error.message);
|
||||
@ -8151,7 +8162,7 @@
|
||||
|
||||
request.onsuccess = function (event) {
|
||||
db = request.result;
|
||||
console.log("success: " + db);
|
||||
console.log(db);
|
||||
};
|
||||
|
||||
request.onupgradeneeded = function (event) {
|
||||
@ -8203,19 +8214,19 @@
|
||||
.add(localbitcoinplusplusObj);
|
||||
|
||||
request.onsuccess = function (event) {
|
||||
alert("Kenny has been added to your database.");
|
||||
alert("Data has been added to your database.");
|
||||
};
|
||||
|
||||
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")
|
||||
.objectStore("localbitcoinUser")
|
||||
.put(localbitcoinplusplusObj, key);
|
||||
.put(Obj);
|
||||
|
||||
request.onsuccess = function (event) {
|
||||
alert("Data has been updated to your database.");
|
||||
@ -8279,14 +8290,10 @@
|
||||
"buyer_key_signature", "order_validator_public_key");
|
||||
doSend(buytrade);
|
||||
}
|
||||
document.getElementById("output").appendChild(trade_btn);
|
||||
document.getElementById("output_div").appendChild(trade_btn);
|
||||
})()
|
||||
</script>
|
||||
|
||||
<script>
|
||||
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
||||
Loading…
Reference in New Issue
Block a user