function.js: fix compatibility with Safari

This commit is contained in:
Benjamin Renard 2020-06-03 11:53:37 +02:00
parent ff3ca35bed
commit 49656cd6f6

View file

@ -289,13 +289,12 @@ function generate_uuid() {
* *
* Source : http://ntt.cc/2008/01/19/base64-encoder-decoder-with-javascript.html * Source : http://ntt.cc/2008/01/19/base64-encoder-decoder-with-javascript.html
*/ */
if ($type(atob) != 'function') {
var B64keyStr = "ABCDEFGHIJKLMNOP" + var B64keyStr = "ABCDEFGHIJKLMNOP" +
"QRSTUVWXYZabcdef" + "QRSTUVWXYZabcdef" +
"ghijklmnopqrstuv" + "ghijklmnopqrstuv" +
"wxyz0123456789+/" + "wxyz0123456789+/" +
"="; "=";
if ($type(atob) != 'function') {
function btoa(input) { function btoa(input) {
input = escape(input); input = escape(input);
var output = ""; var output = "";