Changeset 2100

Show
Ignore:
Timestamp:
01/03/07 17:17:19 (2 years ago)
Author:
uta
Message:

#254

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • spinelz/trunk/compress/javascripts/spinelz_lib/spinelz_util_for_rubricks.js

    r2031 r2100  
    42794279}}; 
    42804280 
     4281var JSON=function(){ 
     4282var m={"\b":"\\b","\t":"\\t","\n":"\\n","\f":"\\f","\r":"\\r","\"":"\\\"","\\":"\\\\"},s={"boolean":function(x){ 
     4283return String(x); 
     4284},number:function(x){ 
     4285return isFinite(x)?String(x):"null"; 
     4286},string:function(x){ 
     4287if(/["\\\x00-\x1f]/.test(x)){ 
     4288x=x.replace(/([\x00-\x1f\\"])/g,function(a,b){ 
     4289var c=m[b]; 
     4290if(c){ 
     4291return c; 
     4292} 
     4293c=b.charCodeAt(); 
     4294return "\\u00"+Math.floor(c/16).toString(16)+(c%16).toString(16); 
     4295}); 
     4296} 
     4297return "\""+x+"\""; 
     4298},object:function(x){ 
     4299if(x){ 
     4300var a=[],b,f,i,l,v; 
     4301if(x instanceof Array){ 
     4302a[0]="["; 
     4303l=x.length; 
     4304for(i=0;i<l;i+=1){ 
     4305v=x[i]; 
     4306f=s[typeof v]; 
     4307if(f){ 
     4308v=f(v); 
     4309if(typeof v=="string"){ 
     4310if(b){ 
     4311a[a.length]=","; 
     4312} 
     4313a[a.length]=v; 
     4314b=true; 
     4315} 
     4316} 
     4317} 
     4318a[a.length]="]"; 
     4319}else{ 
     4320if(x instanceof Object){ 
     4321a[0]="{"; 
     4322for(i in x){ 
     4323v=x[i]; 
     4324f=s[typeof v]; 
     4325if(f){ 
     4326v=f(v); 
     4327if(typeof v=="string"){ 
     4328if(b){ 
     4329a[a.length]=","; 
     4330} 
     4331a.push(s.string(i),":",v); 
     4332b=true; 
     4333} 
     4334} 
     4335} 
     4336a[a.length]="}"; 
     4337}else{ 
     4338return; 
     4339} 
     4340} 
     4341return a.join(""); 
     4342} 
     4343return "null"; 
     4344}}; 
     4345return {copyright:"(c)2005 JSON.org",license:"http://www.crockford.com/JSON/license.html",stringify:function(v){ 
     4346var f=s[typeof v]; 
     4347if(f){ 
     4348v=f(v); 
     4349if(typeof v=="string"){ 
     4350return v; 
     4351} 
     4352} 
     4353return null; 
     4354},parse:function(_12){ 
     4355try{ 
     4356return !(/[^,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t]/.test(_12.replace(/"(\\.|[^"\\])*"/g,"")))&&eval("("+_12+")"); 
     4357} 
     4358catch(e){ 
     4359return false; 
     4360} 
     4361}}; 
     4362}(); 
     4363 
    42814364Object.extend(Element,{getTagNodes:function(_1,_2){ 
    42824365return this.getElementsByNodeType(_1,1,_2);