Browse Source

Coin management modification and BTC_blocks.jpg check for blockexplorer

release/v0.1
vineetbhargav86 9 years ago
parent
commit
6355ac5edc
  1. 15
      iguana/app/coin_mgmt.js
  2. 9
      iguana/app/startup.js
  3. 23
      iguana/index.html
  4. 2
      iguana/js/api.js
  5. 38
      iguana/js/blockexplorer.js

15
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");
}
};

9
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
};
});

23
iguana/index.html

@ -221,6 +221,29 @@ data-path="{tc}/{config}">
</div>
</div>
<!--Modal Ends-->
<div class="row">
<div class="col-xs-9 col-sm-10 col-md-8">
<div class="panel panel-default">
<div class="panel-body">
<div class="form-group">
<textarea id="json_src_coin" cols="30" rows="5" class="result form-control" placeholder='Paste json here'></textarea>
</div>
<div class="form-group">
<button class="btn btn-primary submit_new_coin_test" >Add coin</button>
</div>
</div>
</div>
</div>
<div class="col-xs-6 col-md-4 col-lg-4">
<div class="panel-body">
<h5 class='uri-link'>Response</h5>
<pre class="hljs json coin_result">JSON response</pre>
<button class="btn btn-default clear-response-coin">Clear response</button>
</div>
</div>
</div>
</div>
</div>
</div>

2
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();
}
});

38
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='<a href="'+fileSystem.root.toURL()+"images/BTC_blocks.jpg"+'" download="MyGoogleLogo">download me</a>';
/*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);*/
}
Loading…
Cancel
Save