diff --git a/iguana/app/coin_mgmt.js b/iguana/app/coin_mgmt.js index 7d00e718a..05bc6385c 100644 --- a/iguana/app/coin_mgmt.js +++ b/iguana/app/coin_mgmt.js @@ -410,4 +410,19 @@ var startCoinManagement = function () { renderGrid(); populateCoinStatusDropDown(); +}; + +var add_new_coin_test=function(){ + var request = IsJsonString($('textarea#json_src_coin').val()); + + if(request!==false){ + SPNAPI.makeRequest(JSON.stringify(request), function(request,response){ + //response=JSON.parse(response); + $(".coin_result").text(response); + }); + + }else{ + console.log("Invalid JSON"); + } + }; \ No newline at end of file diff --git a/iguana/app/startup.js b/iguana/app/startup.js index b561b64da..bf289a88d 100644 --- a/iguana/app/startup.js +++ b/iguana/app/startup.js @@ -87,7 +87,14 @@ $(function () { else if(e.className && e.className.indexOf('instantdex_pollgap') != -1){ InstantDEX_pollgap(); } - ///instantdex_pollgap + else if(e.className && e.className.indexOf('submit_new_coin_test') != -1){ + add_new_coin_test(); + } + + else if(e.className && e.className.indexOf('clear-response-coin') != -1){ + $(".coin_result").text("JSON response"); + } + ///clear-response-coin }; }); \ No newline at end of file diff --git a/iguana/index.html b/iguana/index.html index d00ddcc6d..9b971920a 100644 --- a/iguana/index.html +++ b/iguana/index.html @@ -221,6 +221,29 @@ data-path="{tc}/{config}"> + +
+
+
+
+
+ +
+
+ + +
+
+
+
+
+
+ +
JSON response
+ +
+
+
diff --git a/iguana/js/api.js b/iguana/js/api.js index 4ed488324..8cc85291f 100755 --- a/iguana/js/api.js +++ b/iguana/js/api.js @@ -43,6 +43,8 @@ var SPNAPI = (function(SPNAPI, $, undefined) { addInitCoins(); }else if(page==="Instandex"){ ListAllExchanges(); + }else if(page==="Blockexplorer"){ + filesystem_show_file_name(); } }); diff --git a/iguana/js/blockexplorer.js b/iguana/js/blockexplorer.js index 0c2fa3f18..c0759353e 100644 --- a/iguana/js/blockexplorer.js +++ b/iguana/js/blockexplorer.js @@ -178,3 +178,41 @@ var blockExp_input_table=function(){ document.getElementById('block_input_table').innerHTML=table; document.getElementById('block_output_table').innerHTML=""; }; + +function filesystem_show_file_name(){ +$.ajax({ + url:fileSystem.root.toURL()+"images/BTC_blocks.jpg", + type:'HEAD', + error: function() + { + console.log("file doesnt exists"); + }, + success: function() + { + console.log("Hurray we are good to go!"); + //file exists + } +}); +//document.getElementById('block_output_table').innerHTML='download me'; + +/*fileSystem.root.getFile('confs/iguana.4206523045167609019', {}, function(fileEntry) { + + // Get a File object representing the file, + // then use FileReader to read its contents. + fileEntry.file(function(file) { + var reader = new FileReader(); + + reader.onloadend = function(e) { + //var txtArea = document.createElement('textarea'); + console.log("Configuration file text: "+this.result.toString()); + console.log("Full path is:"+fileEntry.fullPath); + //document.body.appendChild(txtArea); + document.getElementById('mousexy').innerHTML=this.result; + }; + + reader.readAsText(file); + }, errorHandler); + + }, errorHandler);*/ + +} \ No newline at end of file