Issue fixed

This commit is contained in:
Simon Vieille 2016-10-03 19:11:26 +02:00
parent 67c674c52e
commit 41fefddc16

View file

@ -140,6 +140,8 @@ var viewerEvents = function() {
var $cipherEditor = $('.cipher-editor'); var $cipherEditor = $('.cipher-editor');
var $embedInput = $('#embed-input'); var $embedInput = $('#embed-input');
var to = ' ';
if (key) { if (key) {
$('.cipher-link').each(function() { $('.cipher-link').each(function() {
var href = $(this).attr('href'); var href = $(this).attr('href');
@ -148,10 +150,7 @@ var viewerEvents = function() {
$(this).attr('href', href); $(this).attr('href', href);
}); });
var to = ' ';
if (0 !== $render.length || $cipherEditor.length !== 0) { if (0 !== $render.length || $cipherEditor.length !== 0) {
if ($render.length !== 0) { if ($render.length !== 0) {
var decrypted = CryptoJS.AES.decrypt($render.html(), key, { var decrypted = CryptoJS.AES.decrypt($render.html(), key, {
format: JsonFormatter format: JsonFormatter
@ -169,10 +168,10 @@ var viewerEvents = function() {
$cipherEditor.val(decrypted.toString(CryptoJS.enc.Utf8)); $cipherEditor.val(decrypted.toString(CryptoJS.enc.Utf8));
} }
} }
}
if ($embedInput.length) { if ($embedInput.length) {
$embedInput.val($embedInput.val().replace('%key%', to)); $embedInput.val($embedInput.val().replace('%key%', to));
}
} }
}); });
} }