Mudanças entre as edições de "Widget:Item"

De Wiki Gla
Ir para navegação Ir para pesquisar
m
m
Linha 307: Linha 307:
                 decodeLog.push(now);
                 decodeLog.push(now);
                 return true;
                 return true;
            }
            function hexToUtf8String(hex) {
                var bytes = [];
                for (var i = 0; i < hex.length; i += 2) {
                    bytes.push(parseInt(hex.substr(i, 2), 16) ^ XOR_KEY);
                }
                if (typeof TextDecoder !== "undefined") {
                    return new TextDecoder("utf-8").decode(new Uint8Array(bytes));
                }
                var bin = "";
                for (var j = 0; j < bytes.length; j++) {
                    bin += String.fromCharCode(bytes[j]);
                }
                try {
                    return decodeURIComponent(escape(bin));
                } catch (e) {
                    return bin;
                }
             }
             }


Linha 313: Linha 332:
                 if (decodeCache[hex]) return decodeCache[hex];
                 if (decodeCache[hex]) return decodeCache[hex];
                 try {
                 try {
                     var json = "";
                     var obj = JSON.parse(hexToUtf8String(hex));
                    for (var i = 0; i < hex.length; i += 2) {
                        json += String.fromCharCode(parseInt(hex.substr(i, 2), 16) ^ XOR_KEY);
                    }
                    var obj = JSON.parse(json);
                     decodeCache[hex] = obj;
                     decodeCache[hex] = obj;
                     return obj;
                     return obj;

Edição das 21h57min de 28 de maio de 2026