X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=jappixmini%2Flib.js;h=31302732874ea9c6bf186c4e981442f34ec2cd57;hb=4c4a8da6126cb6ff04f9e52bcab62129b6c5cd63;hp=dd95695f151ac27dc2b66db510374a53e7c6e06a;hpb=60a7952688aa41c25106b2a05cad1f9ecf223e48;p=friendica-addons.git diff --git a/jappixmini/lib.js b/jappixmini/lib.js index dd95695f..31302732 100644 --- a/jappixmini/lib.js +++ b/jappixmini/lib.js @@ -1,9 +1,15 @@ +// +// Copyright 2012 "Leberwurscht" +// +// This file is dual-licensed under the MIT license (see MIT.txt) and the AGPL license (see jappix/COPYING). +// + function jappixmini_addon_xor(str1, str2) { if (str1.length != str2.length) throw "not same length"; - encoded = ""; + var encoded = ""; - for (i=0; iReintroduce your Friendica password for chatting:'); - div.append($("
")); - input = $('') - div.append(input); - button = $(''); + var div = document.getElementById("#jappixmini-password-query-div"); + + if (!div) { + div = $('
Retype your Friendica password for chatting:
'); + + var input = $('') + div.append(input); + + var button = $(''); + div.append(button); + + $("body").append(div); + } + button.click(function(){ - password = input.val(); + var password = $("#jappixmini-password-query-input").val(); jappixmini_addon_set_client_secret(password); div.remove(); + + var client_secret = getPersistent('jappix-mini', 'client-secret'); + callback(client_secret); }); - div.append(button); - $("body").append(div); } - - return client_secret; + else { + callback(client_secret); + } } -function jappixmini_addon_encrypt_password(password) { - client_secret = jappixmini_addon_get_client_secret(); - - // add \0 to password until it has the same length as secret - if (client_secret.lengthclient_secret.length-1) throw "password too long"; + while (password.length