Browse Source

debug tab | encrypt/decrypt json finished

release/v0.1
mirrt 9 years ago
committed by vineetbhargav86
parent
commit
7f58d37d54
  1. 6
      iguana/index.html
  2. 25
      iguana/js/debugJson.js

6
iguana/index.html

@ -397,8 +397,10 @@ data-path="{tc}/{config}">
Permanentfile
</label>
<div class="col-sm-7 col-md-7">
<input type="text" class="form-control" id='debug_permanentfile'>
<span class='material-input'></span>
<div>
<input type="file" id='debug_permanentfile'>
<input type="text" readonly class="form-control" >
</div>
</div>
</div>
<div class="form-group">

25
iguana/js/debugJson.js

@ -23,16 +23,16 @@ dJson._checkJson = function(json) {
return false;
};
return ogj;
return obj;
};
//{"agent":"SuperNET","method":"encryptjson","passphrase":"<passphrase>","permanentfile":"<filename>","fromform":"valuefromform","fromform2":"valuefromform2",...rest of form at top level}
//{"agent":"SuperNET","method":"encryptjson","passphrase":"<passphrase>","permanentfile":"<filename>","fromform":"valuefromform", "fromform2":"valuefromform2",...rest of form at top level}
dJson.encrypt = function(credentials, json, cb) {
this._init(credentials);
var jsonObj;
if(jsonObj = this._checkJson) {
if(jsonObj = this._checkJson(json)) {
this.ENCRYPTED = true;
this.request.method = "encryptjson";
@ -54,7 +54,7 @@ dJson.encrypt = function(credentials, json, cb) {
cb(null);
};
//{"agent":"SuperNET","method":"encryptjson","passphrase":"<passphrase>","permanentfile":"<filename>"}
//{"agent":"SuperNET","method":"decryptjson","passphrase":"<passphrase>","permanentfile":"<filename>"}
dJson.decrypt = function(credentials, cb) {
this._init(credentials);
@ -78,20 +78,19 @@ $(document).ready(function() {
permFile = $('#debug_permanentfile'),
jsonSrc = $('#debug_json_src');
$(encryptBtn).click(function(e) {
e.preventDefault();
debugJsonResult.text('');
dJson.encrypt({
passphrase: pass.val(),
permanentfile: permFile.val()
},
jsonSrc.val(),
function(response) {
debugJsonResult.text(response || 'wrong json');
}
);
passphrase: pass.val(),
permanentfile: permFile.val()
},
jsonSrc.val(),
function(response) {
debugJsonResult.text(response || 'wrong json');
});
});
$(decryptBtn).click(function(e) {

Loading…
Cancel
Save