Skip to content

Commit

Permalink
fixed wrong line commented for bootstrap.js and added functions to hi…
Browse files Browse the repository at this point in the history
…de token
  • Loading branch information
bigpapy committed Apr 25, 2016
1 parent bf2a10d commit 9551eab
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 4 deletions.
Binary file added 2016_04_25_20_02.xpi
Binary file not shown.
6 changes: 3 additions & 3 deletions bootstrap.js
Expand Up @@ -67,11 +67,11 @@ function loadIntoWindow(window) {
window.BrowserApp.addTab('chrome://htlivesight/content/htlivesight.html');
});}else{
//removed because XUL will be deprecated
/*
// load overlay file used in no-restart installation
window.document.loadOverlay('chrome://htlivesight/content/overlay.xul', null);
//window.document.loadOverlay('chrome://htlivesight/content/overlay.xul', null);

// add button to nav-bar to launch htls
HTLS.init(); */
HTLS.init();
};
}

Expand Down
36 changes: 35 additions & 1 deletion chrome/content/util/misc.js
Expand Up @@ -140,4 +140,38 @@ htlivesight.generateFromSeed=function(){
htlivesight.ApiProxy.consumerSecret = newString;
//return newString;
//alert("old string= "+oldString+"\nnew String= "+newString);
};
};
htlivesight.encrypt = function(stringToCrypt){
console.log("stringToCrypt = " + stringToCrypt);
var reverseStrin = new Array();
for(var i=0; i<stringToCrypt.length;i++){
reverseStrin.unshift(stringToCrypt[i]);
}
console.log("reverseStrin = " + reverseStrin);
var CharCodeIndexed = new Array();
for(var i=0; i<reverseStrin.length;i++){
CharCodeIndexed.push(reverseStrin[i].charCodeAt(0)+i);
}
console.log("CharCodeIndexed = "+CharCodeIndexed);
return ""+CharCodeIndexed
}
htlivesight.decrypt = function(stringToDecrypt){
console.log("stringToDecrypt = "+stringToDecrypt);
var arrayToDecrypt = stringToDecrypt.split(',');
var reverseString = new Array();
for(var i=0; i<arrayToDecrypt.length;i++){
reverseString.push(String.fromCharCode(parseInt(arrayToDecrypt[i])-i));
}
console.log("reverseString =" + reverseString);
var decryptedString = new Array();
for(var i=0; i<reverseString.length;i++){
decryptedString.unshift(reverseString[i]);
}
console.log("decryptedString = " + decryptedString.concat());
var lastString='';
for(var i=0; i<decryptedString.length;i++){
lastString += decryptedString[i];
}
console.log("lastString = " + lastString);
return lastString;
}

0 comments on commit 9551eab

Please sign in to comment.