fixed error when browser is updated

This commit is contained in:
Kasper Rynning-Tønnesen
2015-11-24 11:32:51 +01:00
parent 2fc3efdc2b
commit f0ffc3d763
3 changed files with 16 additions and 12 deletions

File diff suppressed because one or more lines are too long

View File

@@ -3,9 +3,14 @@ var Crypt = {
conf_arr: {},
init: function(){
conf_arr = Crypt.decrypt(Crypt.getCookie("_opt"), "_opt");
conf_pass = Crypt.decrypt(Crypt.getCookie(chan.toLowerCase()), chan.toLowerCase());
try{
conf_arr = Crypt.decrypt(Crypt.getCookie("_opt"), "_opt");
conf_pass = Crypt.decrypt(Crypt.getCookie(chan.toLowerCase()), chan.toLowerCase());
}catch(err){
console.log("err")
conf_arr = Crypt.decrypt(Crypt.create_cookie("_opt"), "_opt");
conf_pass = Crypt.decrypt(Crypt.create_cookie(chan.toLowerCase()), chan.toLowerCase());
}
Hostcontroller.change_enabled(conf_arr.remote);
},
@@ -15,12 +20,12 @@ var Crypt = {
}
var decrypted = CryptoJS.AES.decrypt(
cookie,navigator.userAgent+navigator.languages,
{
mode: CryptoJS.mode.CBC,
padding: CryptoJS.pad.Pkcs7
}
);
cookie,navigator.userAgent+navigator.languages,
{
mode: CryptoJS.mode.CBC,
padding: CryptoJS.pad.Pkcs7
}
);
return $.parseJSON(decrypted.toString(CryptoJS.enc.Utf8));
},

View File

@@ -45,7 +45,6 @@ var connection_options = {
if(window.location.hostname == "zoff.no") add = "dev.zoff.no";
else add = "localhost";
var socket = io.connect('http://'+add+':8880', connection_options);
socket.on("get_list", function(){
socket.emit('list', chan.toLowerCase());