chore(zip) UTF8 -> UTF8Proto

This commit is contained in:
coderaiser 2014-03-31 09:03:51 -04:00
parent c79ef4efeb
commit 03a255285e

View file

@ -3,13 +3,9 @@ var Util, Zip, pako;
(function () {
'use strict';
/*jshint nonstandard:false */
var UTF8 = {
unescape: typeof unescape === 'function' ? unescape : decode
};
/*jshint nonstandard:true */
Zip = new ZipProto();
var UTF8 = new UTF8Proto();
Zip = new ZipProto();
function ZipProto() {
this.pack = function(str, callback) {
@ -44,13 +40,23 @@ var Util, Zip, pako;
return arr;
}
}
}
/* jshint bitwise:false */
/* unescape polyfill
function UTF8Proto() {
/*jshint nonstandard:true */
var isUnescape = typeof unescape === 'function',
func = isUnescape ? unescape : decode;
this.unescape = func;
}
/*
* unescape polyfill
* http://unixpapa.com/js/querystring.html
*/
function decode(s) {
/*jshint bitwise:false */
s = s.replace(/%([EF][0-9A-F])%([89AB][0-9A-F])%([89AB][0-9A-F])/gi,
function(code,hex1,hex2,hex3) {
var n, n3,
@ -88,5 +94,4 @@ var Util, Zip, pako;
return s;
}
/* jshint bitwise:true */
})();