source: sandbox/webservice/restclient/libs/jquery.json-2.3.min.js @ 6312

Revision 6312, 2.1 KB checked in by niltonneto, 12 years ago (diff)

Ticket #2507 - Implementado em RestClient? teste de download de anexo.

Line 
1
2(function($){var escapeable=/["\\\x00-\x1f\x7f-\x9f]/g,meta={'\b':'\\b','\t':'\\t','\n':'\\n','\f':'\\f','\r':'\\r','"':'\\"','\\':'\\\\'};$.toJSON=typeof JSON==='object'&&JSON.stringify?JSON.stringify:function(o){if(o===null){return'null';}
3var type=typeof o;if(type==='undefined'){return undefined;}
4if(type==='number'||type==='boolean'){return''+o;}
5if(type==='string'){return $.quoteString(o);}
6if(type==='object'){if(typeof o.toJSON==='function'){return $.toJSON(o.toJSON());}
7if(o.constructor===Date){var month=o.getUTCMonth()+1,day=o.getUTCDate(),year=o.getUTCFullYear(),hours=o.getUTCHours(),minutes=o.getUTCMinutes(),seconds=o.getUTCSeconds(),milli=o.getUTCMilliseconds();if(month<10){month='0'+month;}
8if(day<10){day='0'+day;}
9if(hours<10){hours='0'+hours;}
10if(minutes<10){minutes='0'+minutes;}
11if(seconds<10){seconds='0'+seconds;}
12if(milli<100){milli='0'+milli;}
13if(milli<10){milli='0'+milli;}
14return'"'+year+'-'+month+'-'+day+'T'+
15hours+':'+minutes+':'+seconds+'.'+milli+'Z"';}
16if(o.constructor===Array){var ret=[];for(var i=0;i<o.length;i++){ret.push($.toJSON(o[i])||'null');}
17return'['+ret.join(',')+']';}
18var name,val,pairs=[];for(var k in o){type=typeof k;if(type==='number'){name='"'+k+'"';}else if(type==='string'){name=$.quoteString(k);}else{continue;}
19type=typeof o[k];if(type==='function'||type==='undefined'){continue;}
20val=$.toJSON(o[k]);pairs.push(name+':'+val);}
21return'{'+pairs.join(',')+'}';}};$.evalJSON=typeof JSON==='object'&&JSON.parse?JSON.parse:function(src){return eval('('+src+')');};$.secureEvalJSON=typeof JSON==='object'&&JSON.parse?JSON.parse:function(src){var filtered=src.replace(/\\["\\\/bfnrtu]/g,'@').replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,']').replace(/(?:^|:|,)(?:\s*\[)+/g,'');if(/^[\],:{}\s]*$/.test(filtered)){return eval('('+src+')');}else{throw new SyntaxError('Error parsing JSON, source is not valid.');}};$.quoteString=function(string){if(string.match(escapeable)){return'"'+string.replace(escapeable,function(a){var c=meta[a];if(typeof c==='string'){return c;}
22c=a.charCodeAt();return'\\u00'+Math.floor(c/16).toString(16)+(c%16).toString(16);})+'"';}
23return'"'+string+'"';};})(jQuery);
Note: See TracBrowser for help on using the repository browser.