| 933 | } |
| 934 | |
| 935 | function encodeString (connectionId, key) { |
| 936 | $.post('apiv2/encodeString/' + encodeURIComponent($('#stringValue').val()), function (data, status) { |
| 937 | if (status !== 'success') { |
| 938 | return alert('Could not encode key'); |
| 939 | } |
| 940 | |
| 941 | // needed to debounce |
| 942 | setTimeout(function() { |
| 943 | $('#base64Button').html('Decode <small>base64</small>') |
| 944 | .off('click') |
| 945 | .on('click', function() { |
| 946 | decodeKey(connectionId,key) |
| 947 | }); |
| 948 | $('#stringValue').val(data); |
| 949 | }, 100); |
| 950 | }); |
| 951 | } |
| 952 | |
| 953 | function deleteBranch (connectionId, branchPrefix) { |
| 954 | const node = getKeyTree().get_node(connectionId); |