register OK

This commit is contained in:
Gnieark 2019-12-27 11:14:05 +01:00
parent be6618588b
commit d0a7b38d86
1 changed files with 7 additions and 8 deletions

View File

@ -1,5 +1,4 @@
function showHideMenu()
{
function showHideMenu(){
var doc = document.getElementById("moreoptions");
if(doc.className == "hidden-by-default")
{
@ -8,6 +7,7 @@ function showHideMenu()
doc.className = "hidden-by-default";
}
}
function truncateCryptFields(){
getEncFieldsListIntegers().forEach( element=> {
document.getElementById("form_crypt_" + element).value = "";
@ -19,11 +19,12 @@ function truncateCryptFields(){
function getEncFieldsListStrings(){
return ['iv','mode','adata','cipher','salt'];
}
function getEncFieldsListIntegers(){
return ['v','iter','ks','ts'];
}
function crypt()
{
function crypt(){
var key = document.getElementById("key").value;
var enc = JSON.parse(sjcl.encrypt(key,document.getElementById("form_content").value));
var encFields = getEncFieldsListStrings();
@ -38,10 +39,7 @@ function crypt()
document.getElementById("form_content").value = enc["ct"];
}
function uncrypt()
{
function uncrypt(){
var key = document.getElementById("key").value;
if( document.getElementById("form_content") ){
@ -80,6 +78,7 @@ function uncrypt()
}
}
}
function ready(){
document.getElementById("showOptions").addEventListener("click",showHideMenu);
if(document.getElementById("buttonCrypt")){