Changeset 5746

Show
Ignore:
Timestamp:
04/23/08 15:59:26 (7 months ago)
Author:
shouta
Message:

4303

Files:

Legend:

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

    r5735 r5746  
    243243},cutSpaces:function(){ 
    244244return this.normalizeSpaces().gsub(/[\s]/,""); 
    245 },getPrefix:function(_50){ 
    246 if(!_50){ 
    247 _50="_"; 
    248 
    249 return this.split(_50)[0]; 
    250 },getSuffix:function(_51){ 
    251 if(!_51){ 
    252 _51="_"; 
    253 
    254 return this.split(_51).pop(); 
     245},getSmartLength:function(){ 
     246var r=0; 
     247for(var i=0;i<this.length;i++){ 
     248var c=this.charCodeAt(i); 
     249r+=(((c>=0&&c<129)||(c==63728)||(c>=65377&&c<65440)||(c>=63729&&c<63732))?1:2); 
     250
     251return r; 
     252},getPrefix:function(_53){ 
     253if(!_53){ 
     254_53="_"; 
     255
     256return this.split(_53)[0]; 
     257},getSuffix:function(_54){ 
     258if(!_54){ 
     259_54="_"; 
     260
     261return this.split(_54).pop(); 
    255262},normalizeSpaces:function(){ 
    256263return this.gsub(this._mb_space," "); 
     
    258265return this.strip().gsub(this._rf,"").gsub(this._rb,""); 
    259266},toElement:function(){ 
    260 var _52=document.createElement("div"); 
    261 _52.innerHTML=this; 
    262 return _52.firstChild; 
     267var _55=document.createElement("div"); 
     268_55.innerHTML=this; 
     269return _55.firstChild; 
    263270}}); 
    264271var CssUtil=Class.create(); 
    265 CssUtil.getInstance=function(_53,_54){ 
    266 var _55=CssUtil.appendPrefix(_53,_54); 
    267 return new CssUtil([_54,_55]); 
     272CssUtil.getInstance=function(_56,_57){ 
     273var _58=CssUtil.appendPrefix(_56,_57); 
     274return new CssUtil([_57,_58]); 
    268275}; 
    269 CssUtil.appendPrefix=function(_56,_57){ 
    270 var _58={}; 
    271 $H(_57).each(function(_59){ 
    272 _58[_59[0]]=_56+_57[_59[0]]; 
    273 }); 
    274 return _58
     276CssUtil.appendPrefix=function(_59,_5a){ 
     277var _5b={}; 
     278$H(_5a).each(function(_5c){ 
     279_5b[_5c[0]]=_59+_5a[_5c[0]]; 
     280}); 
     281return _5b
    275282}; 
    276 CssUtil.getCssRules=function(_5a){ 
    277 return _5a.rules||_5a.cssRules; 
     283CssUtil.getCssRules=function(_5d){ 
     284return _5d.rules||_5d.cssRules; 
    278285}; 
    279 CssUtil.getCssRuleBySelectorText=function(_5b){ 
    280 var _5c=null; 
     286CssUtil.getCssRuleBySelectorText=function(_5e){ 
     287var _5f=null; 
    281288$A(document.styleSheets).each(function(s){ 
    282 var _5e=CssUtil.getCssRules(s); 
    283 _5c=$A(_5e).detect(function(r){ 
     289var _61=CssUtil.getCssRules(s); 
     290_5f=$A(_61).detect(function(r){ 
    284291if(!r.selectorText){ 
    285292return false; 
    286293} 
    287 return r.selectorText.toLowerCase()==_5b.toLowerCase(); 
    288 }); 
    289 if(_5c){ 
     294return r.selectorText.toLowerCase()==_5e.toLowerCase(); 
     295}); 
     296if(_5f){ 
    290297throw $break; 
    291298} 
    292299}); 
    293 return _5c
     300return _5f
    294301}; 
    295 CssUtil.prototype={initialize:function(_60){ 
    296 if(!((typeof (_60)=="object")&&(_60.constructor==Array))){ 
     302CssUtil.prototype={initialize:function(_63){ 
     303if(!((typeof (_63)=="object")&&(_63.constructor==Array))){ 
    297304throw "CssUtil#initialize: argument must be a Array object!"; 
    298305} 
    299 this.styles=_60
     306this.styles=_63
    300307},getClasses:function(key){ 
    301308return this.styles.collect(function(s){ 
     
    305312return this.getClasses(key).join(" "); 
    306313},allJoinClassNames:function(){ 
    307 var _64={}; 
    308 $H(this.styles.first()).each(function(_65){ 
    309 _64[_65.key]=this.joinClassNames(_65.key); 
     314var _67={}; 
     315$H(this.styles.first()).each(function(_68){ 
     316_67[_68.key]=this.joinClassNames(_68.key); 
    310317}.bind(this)); 
    311 return _64
    312 },addClassNames:function(_66,key){ 
     318return _67
     319},addClassNames:function(_69,key){ 
    313320this.styles.each(function(s){ 
    314 Element.addClassName(_66,s[key]); 
    315 }); 
    316 },removeClassNames:function(_69,key){ 
     321Element.addClassName(_69,s[key]); 
     322}); 
     323},removeClassNames:function(_6c,key){ 
    317324this.styles.each(function(s){ 
    318 Element.removeClassName(_69,s[key]); 
    319 }); 
    320 },refreshClassNames:function(_6c,key){ 
    321 _6c.className=""; 
    322 this.addClassNames(_6c,key); 
    323 },hasClassName:function(_6e,key){ 
     325Element.removeClassName(_6c,s[key]); 
     326}); 
     327},refreshClassNames:function(_6f,key){ 
     328_6f.className=""; 
     329this.addClassNames(_6f,key); 
     330},hasClassName:function(_71,key){ 
    324331return this.styles.any(function(s){ 
    325 return Element.hasClassName(_6e,s[key]); 
     332return Element.hasClassName(_71,s[key]); 
    326333}); 
    327334}}; 
    328335var Hover=Class.create(); 
    329 Hover.prototype={initialize:function(_71){ 
     336Hover.prototype={initialize:function(_74){ 
    330337this.options=Object.extend({defaultClass:"",hoverClass:"",cssUtil:"",list:false,beforeToggle:function(){ 
    331338return true; 
    332339}},arguments[1]||{}); 
    333 var _71=$(_71); 
     340var _74=$(_74); 
    334341if(this.options.list){ 
    335 var _72=_71.childNodes; 
    336 for(var i=0;i<_72.length;i++){ 
    337 if(Element.isElementNode(_72[i])){ 
    338 this.build(_72[i]); 
    339 } 
    340 } 
    341 }else{ 
    342 this.build(_71); 
    343 } 
    344 this.element=_71
    345 },build:function(_74){ 
    346 this.normal=this.getNormalClass(_74); 
     342var _75=_74.childNodes; 
     343for(var i=0;i<_75.length;i++){ 
     344if(Element.isElementNode(_75[i])){ 
     345this.build(_75[i]); 
     346} 
     347} 
     348}else{ 
     349this.build(_74); 
     350} 
     351this.element=_74
     352},build:function(_77){ 
     353this.normal=this.getNormalClass(_77); 
    347354this.hover=this.getHoverClass(this.normal); 
    348355if(this.options.cssUtil){ 
     
    350357this.hover=this.options.cssUtil.joinClassNames(hover); 
    351358} 
    352 this.setHoverEvent(_74); 
    353 },setHoverEvent:function(_75){ 
    354 this.mouseout=this.toggle.bindAsEventListener(this,_75,this.normal); 
    355 this.mouseover=this.toggle.bindAsEventListener(this,_75,this.hover); 
    356 Event.observe(_75,"mouseout",this.mouseout); 
    357 Event.observe(_75,"mouseover",this.mouseover); 
    358 },toggle:function(_76,_77,_78){ 
    359 Event.stop(_76); 
     359this.setHoverEvent(_77); 
     360},setHoverEvent:function(_78){ 
     361this.mouseout=this.toggle.bindAsEventListener(this,_78,this.normal); 
     362this.mouseover=this.toggle.bindAsEventListener(this,_78,this.hover); 
     363Event.observe(_78,"mouseout",this.mouseout); 
     364Event.observe(_78,"mouseover",this.mouseover); 
     365},toggle:function(_79,_7a,_7b){ 
     366Event.stop(_79); 
    360367if(this.options.beforeToggle()){ 
    361 _77.className=_78
    362 } 
    363 },getNormalClass:function(_79){ 
    364 var _7a=(this.options.defaultClass||_79.className); 
    365 return (_7a||""); 
    366 },getHoverClass:function(_7b){ 
    367 var _7c=this.options.hoverClass; 
    368 if(!_7c){ 
    369 _7c=_7b.split(" ").collect(function(c){ 
     368_7a.className=_7b
     369} 
     370},getNormalClass:function(_7c){ 
     371var _7d=(this.options.defaultClass||_7c.className); 
     372return (_7d||""); 
     373},getHoverClass:function(_7e){ 
     374var _7f=this.options.hoverClass; 
     375if(!_7f){ 
     376_7f=_7e.split(" ").collect(function(c){ 
    370377return c+"Hover"; 
    371378}).join(" "); 
    372379} 
    373 return _7c
     380return _7f
    374381},destroy:function(){ 
    375382Event.stopObserving(this.element,"mouseout",this.mouseout); 
     
    383390Object.extend(Date.prototype,{msPerDay:function(){ 
    384391return 24*60*60*1000; 
    385 },advance:function(_7e){ 
    386 return new Date(this.getTime()+this.msPerDay()*_7e.days); 
     392},advance:function(_81){ 
     393return new Date(this.getTime()+this.msPerDay()*_81.days); 
    387394},days:function(){ 
    388 var _7f=new Date(this.getFullYear(),this.getMonth(),this.getDate(),0,0,0); 
    389 return Math.round(_7f.getTime()/this.msPerDay()); 
     395var _82=new Date(this.getFullYear(),this.getMonth(),this.getDate(),0,0,0); 
     396return Math.round(_82.getTime()/this.msPerDay()); 
    390397},toHash:function(){ 
    391398return {year:this.getFullYear(),month:this.getMonth(),day:this.getDate(),hour:this.getHours(),min:this.getMinutes(),sec:this.getSeconds()}; 
    392 },sameYear:function(_80){ 
    393 return this.getFullYear()==_80.getFullYear(); 
    394 },sameMonth:function(_81){ 
    395 return this.sameYear(_81)&&this.getMonth()==_81.getMonth(); 
    396 },sameDate:function(_82){ 
    397 return this.sameYear(_82)&&this.sameMonth(_82)&&this.getDate()==_82.getDate(); 
    398 },betweenDate:function(_83,_84){ 
    399 var _85=this.days(); 
    400 return (_83.days()<=_85&&_85<=_84.days()); 
    401 },betweenTime:function(_86,_87){ 
    402 var _88=this.getTime(); 
    403 return (_86.getTime()<=_88&&_88<=_87.getTime()); 
    404 },strftime:function(_89){ 
    405 return DateUtil.simpleFormat(_89)(this); 
     399},sameYear:function(_83){ 
     400return this.getFullYear()==_83.getFullYear(); 
     401},sameMonth:function(_84){ 
     402return this.sameYear(_84)&&this.getMonth()==_84.getMonth(); 
     403},sameDate:function(_85){ 
     404return this.sameYear(_85)&&this.sameMonth(_85)&&this.getDate()==_85.getDate(); 
     405},betweenDate:function(_86,_87){ 
     406var _88=this.days(); 
     407return (_86.days()<=_88&&_88<=_87.days()); 
     408},betweenTime:function(_89,_8a){ 
     409var _8b=this.getTime(); 
     410return (_89.getTime()<=_8b&&_8b<=_8a.getTime()); 
     411},strftime:function(_8c){ 
     412return DateUtil.simpleFormat(_8c)(this); 
    406413}}); 
    407 var DateUtil={dayOfWeek:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],daysOfMonth:[31,28,31,30,31,30,31,31,30,31,30,31],numberOfDays:function(_8a,_8b){ 
    408 return _8b.days()-_8a.days(); 
    409 },isLeapYear:function(_8c){ 
    410 if(((_8c%4==0)&&(_8c%100!=0))||(_8c%400==0)){ 
     414var DateUtil={dayOfWeek:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],daysOfMonth:[31,28,31,30,31,30,31,31,30,31,30,31],numberOfDays:function(_8d,_8e){ 
     415return _8e.days()-_8d.days(); 
     416},isLeapYear:function(_8f){ 
     417if(((_8f%4==0)&&(_8f%100!=0))||(_8f%400==0)){ 
    411418return true; 
    412419} 
    413420return false; 
    414 },nextDate:function(_8d){ 
    415 return new Date(_8d.getFullYear(),_8d.getMonth(),_8d.getDate()+1); 
    416 },previousDate:function(_8e){ 
    417 return new Date(_8e.getFullYear(),_8e.getMonth(),_8e.getDate()-1); 
    418 },afterDays:function(_8f,_90){ 
    419 return new Date(_8f.getFullYear(),_8f.getMonth(),_8f.getDate()+_90); 
    420 },getLastDate:function(_91,_92){ 
    421 var _93=this.daysOfMonth[_92]; 
    422 if((_92==1)&&this.isLeapYear(_91)){ 
    423 return new Date(_91,_92,_93+1); 
    424 } 
    425 return new Date(_91,_92,_93); 
    426 },getFirstDate:function(_94,_95){ 
    427 if(_94.constructor==Date){ 
    428 return new Date(_94.getFullYear(),_94.getMonth(),1); 
    429 } 
    430 return new Date(_94,_95,1); 
    431 },getWeekTurn:function(_96,_97){ 
    432 var _98=6-_97+1; 
    433 var _99=0; 
    434 while(_98<_96){ 
    435 _96-=7; 
    436 _99++; 
    437 } 
    438 return _99
    439 },toDateString:function(_9a){ 
    440 return _9a.toDateString(); 
    441 },toLocaleDateString:function(_9b){ 
    442 return _9b.toLocaleDateString(); 
    443 },simpleFormat:function(_9c){ 
    444 return function(_9d){ 
    445 var _9e=_9c.replace(/M+/g,DateUtil.zerofill((_9d.getMonth()+1).toString(),2)); 
    446 _9e=_9e.replace(/d+/g,DateUtil.zerofill(_9d.getDate().toString(),2)); 
    447 _9e=_9e.replace(/y{4}/g,_9d.getFullYear()); 
    448 _9e=_9e.replace(/y{1,3}/g,new String(_9d.getFullYear()).substr(2)); 
    449 _9e=_9e.replace(/E+/g,DateUtil.dayOfWeek[_9d.getDay()]); 
    450 return _9e
     421},nextDate:function(_90){ 
     422return new Date(_90.getFullYear(),_90.getMonth(),_90.getDate()+1); 
     423},previousDate:function(_91){ 
     424return new Date(_91.getFullYear(),_91.getMonth(),_91.getDate()-1); 
     425},afterDays:function(_92,_93){ 
     426return new Date(_92.getFullYear(),_92.getMonth(),_92.getDate()+_93); 
     427},getLastDate:function(_94,_95){ 
     428var _96=this.daysOfMonth[_95]; 
     429if((_95==1)&&this.isLeapYear(_94)){ 
     430return new Date(_94,_95,_96+1); 
     431} 
     432return new Date(_94,_95,_96); 
     433},getFirstDate:function(_97,_98){ 
     434if(_97.constructor==Date){ 
     435return new Date(_97.getFullYear(),_97.getMonth(),1); 
     436} 
     437return new Date(_97,_98,1); 
     438},getWeekTurn:function(_99,_9a){ 
     439var _9b=6-_9a+1; 
     440var _9c=0; 
     441while(_9b<_99){ 
     442_99-=7; 
     443_9c++; 
     444} 
     445return _9c
     446},toDateString:function(_9d){ 
     447return _9d.toDateString(); 
     448},toLocaleDateString:function(_9e){ 
     449return _9e.toLocaleDateString(); 
     450},simpleFormat:function(_9f){ 
     451return function(_a0){ 
     452var _a1=_9f.replace(/M+/g,DateUtil.zerofill((_a0.getMonth()+1).toString(),2)); 
     453_a1=_a1.replace(/d+/g,DateUtil.zerofill(_a0.getDate().toString(),2)); 
     454_a1=_a1.replace(/y{4}/g,_a0.getFullYear()); 
     455_a1=_a1.replace(/y{1,3}/g,new String(_a0.getFullYear()).substr(2)); 
     456_a1=_a1.replace(/E+/g,DateUtil.dayOfWeek[_a0.getDay()]); 
     457return _a1
    451458}; 
    452 },zerofill:function(_9f,_a0){ 
    453 var _a1=_9f
    454 if(_9f.length<_a0){ 
    455 var tmp=_a0-_9f.length; 
     459},zerofill:function(_a2,_a3){ 
     460var _a4=_a2
     461if(_a2.length<_a3){ 
     462var tmp=_a3-_a2.length; 
    456463for(i=0;i<tmp;i++){ 
    457 _a1="0"+_a1
    458 } 
    459 } 
    460 return _a1
    461 },toDate:function(_a3){ 
    462 return new Date(_a3.year,_a3.month,_a3.day,_a3.hour||0,_a3.min||0,_a3.sec||0); 
     464_a4="0"+_a4
     465} 
     466} 
     467return _a4
     468},toDate:function(_a6){ 
     469return new Date(_a6.year,_a6.month,_a6.day,_a6.hour||0,_a6.min||0,_a6.sec||0); 
    463470}}; 
    464 var ZindexManager={zIndex:1000,getIndex:function(_a4){ 
    465 if(_a4){ 
    466 if(isNaN(_a4)){ 
    467 _a4=Element.getMaxZindex()+1; 
    468 }else{ 
    469 if(ZindexManager.zIndex>_a4){ 
    470 _a4=ZindexManager.zIndex; 
    471 } 
    472 } 
    473 }else{ 
    474 _a4=ZindexManager.zIndex; 
    475 } 
    476 ZindexManager.zIndex=_a4+1; 
    477 return _a4
     471var ZindexManager={zIndex:1000,getIndex:function(_a7){ 
     472if(_a7){ 
     473if(isNaN(_a7)){ 
     474_a7=Element.getMaxZindex()+1; 
     475}else{ 
     476if(ZindexManager.zIndex>_a7){ 
     477_a7=ZindexManager.zIndex; 
     478} 
     479} 
     480}else{ 
     481_a7=ZindexManager.zIndex; 
     482} 
     483ZindexManager.zIndex=_a7+1; 
     484return _a7
    478485}}; 
    479 var Modal={maskId:"modalMask",maskClass:"modal_mask",maskClassIE:"modal_mask_ie",element:null,snaps:null,listener:null,resizeListener:null,cover:null,excepteds:null,maskCallbacks:[],unmaskCallbacks:[],count:0,tabKey:9,timer:null,mask:function(_a5,_a6,_a7){ 
    480 this._mask.callAfterLoading(this,_a5,_a6,_a7); 
     486var Modal={maskId:"modalMask",maskClass:"modal_mask",maskClassIE:"modal_mask_ie",element:null,snaps:null,listener:null,resizeListener:null,cover:null,excepteds:null,maskCallbacks:[],unmaskCallbacks:[],count:0,tabKey:9,timer:null,mask:function(_a8,_a9,_aa){ 
     487this._mask.callAfterLoading(this,_a8,_a9,_aa); 
    481488this._control_tab_key(); 
    482489},unmask:function(){ 
     
    485492},unmaskAll:function(){ 
    486493var max=10; 
    487 var _a9=0; 
    488 while(this._isMasked()&&(_a9<max)){ 
     494var _ac=0; 
     495while(this._isMasked()&&(_ac<max)){ 
    489496this._unmask(); 
    490 _a9++; 
     497_ac++; 
    491498} 
    492499this._control_tab_key(); 
    493 },addMaskCallback:function(_aa){ 
     500},addMaskCallback:function(_ad){ 
    494501if(!this.maskCallbacks.any(function(c){ 
    495 return c==_aa
     502return c==_ad
    496503})){ 
    497 this.maskCallbacks.push(_aa); 
    498 } 
    499 },removeMaskCallback:function(_ac){ 
     504this.maskCallbacks.push(_ad); 
     505} 
     506},removeMaskCallback:function(_af){ 
    500507this.maskCallbacks=this.maskCallbacks.reject(function(c){ 
    501 return c==_ac
     508return c==_af
    502509}); 
    503510},clearMaskCallback:function(){ 
    504511this.maskCallbacks=[]; 
    505 },addUnmaskCallback:function(_ae){ 
     512},addUnmaskCallback:function(_b1){ 
    506513if(!this.unmaskCallbacks.any(function(c){ 
    507 return c==_ae
     514return c==_b1
    508515})){ 
    509 this.unmaskCallbacks.push(_ae); 
    510 } 
    511 },removeUnmaskCallback:function(_b0){ 
     516this.unmaskCallbacks.push(_b1); 
     517} 
     518},removeUnmaskCallback:function(_b3){ 
    512519this.unmaskCallbacks=this.unmaskCallbacks.reject(function(c){ 
    513 return c==_b0
     520return c==_b3
    514521}); 
    515522},clearUnmaskCallback:function(){ 
    516523this.unmaskCallbacks=[]; 
    517 },_mask:function(_b2){ 
    518 var _b3=Object.extend({cssPrefix:"custom_",zIndex:null},arguments[1]||{}); 
    519 var _b4=arguments[2]; 
     524},_mask:function(_b5){ 
     525var _b6=Object.extend({cssPrefix:"custom_",zIndex:null},arguments[1]||{}); 
     526var _b7=arguments[2]; 
    520527if(Modal.element){ 
    521 Modal._snap(_b2); 
     528Modal._snap(_b5); 
    522529Modal._rebuildMask(); 
    523530}else{ 
    524531Modal.snaps=[]; 
    525532Modal.excepteds=[]; 
    526 Modal._buildMask(_b3.cssPrefix); 
     533Modal._buildMask(_b6.cssPrefix); 
    527534Modal.cover=new IECover(Modal.element,{transparent:true}); 
    528535} 
    529 if(_b4){ 
     536if(_b7){ 
    530537Element.setStyle(Modal.element,{position:"absolute"}); 
    531538this._setModalPosition(); 
     
    534541} 
    535542} 
    536 Modal._setZindex(_b2,_b3.zIndex); 
     543Modal._setZindex(_b5,_b6.zIndex); 
    537544Modal._setFullSize(); 
    538 if(!Modal.hasExcepted(_b2)){ 
    539 Modal.excepteds.push(_b2); 
     545if(!Modal.hasExcepted(_b5)){ 
     546Modal.excepteds.push(_b5); 
    540547} 
    541548this.count++; 
    542 this.maskCallbacks.each(function(_b5){ 
    543 _b5(_b2); 
     549this.maskCallbacks.each(function(_b8){ 
     550_b8(_b5); 
    544551}); 
    545552},_unmask:function(){ 
     
    557564} 
    558565this.count++; 
    559 this.unmaskCallbacks.each(function(_b6){ 
    560 _b6(); 
     566this.unmaskCallbacks.each(function(_b9){ 
     567_b9(); 
    561568}); 
    562569},_setModalPosition:function(){ 
     
    588595},_isMasked:function(){ 
    589596return Modal.element&&Element.visible(Modal.element); 
    590 },_snap:function(_b7){ 
    591 var _b8=Element.getStyle(Modal.element,"zIndex"); 
    592 if(_b8&&Modal._isMasked()&&!Modal.hasExcepted(_b7)){ 
    593 Modal.snaps.push(_b8); 
    594 } 
    595 },_setZindex:function(_b9,_ba){ 
    596 _ba=ZindexManager.getIndex(_ba); 
    597 Element.setStyle(Modal.element,{zIndex:_ba}); 
    598 _b9=Element.makePositioned($(_b9)); 
    599 Element.setStyle(_b9,{zIndex:++_ba}); 
     597},_snap:function(_ba){ 
     598var _bb=Element.getStyle(Modal.element,"zIndex"); 
     599if(_bb&&Modal._isMasked()&&!Modal.hasExcepted(_ba)){ 
     600Modal.snaps.push(_bb); 
     601} 
     602},_setZindex:function(_bc,_bd){ 
     603_bd=ZindexManager.getIndex(_bd); 
     604Element.setStyle(Modal.element,{zIndex:_bd}); 
     605_bc=Element.makePositioned($(_bc)); 
     606Element.setStyle(_bc,{zIndex:++_bd}); 
    600607},_setFullSize:function(){ 
    601608Modal.element.setStyle({width:Element.getWindowWidth()+"px",height:Element.getWindowHeight()+"px"}); 
     
    603610Modal.cover.resetSize(); 
    604611} 
    605 },_buildMask:function(_bb){ 
    606 var _bc=Builder.node("div",{id:Modal.maskId}); 
    607 Modal._setClassNames(_bc,_bb); 
    608 document.body.appendChild(_bc); 
    609 Modal.element=_bc
     612},_buildMask:function(_be){ 
     613var _bf=Builder.node("div",{id:Modal.maskId}); 
     614Modal._setClassNames(_bf,_be); 
     615document.body.appendChild(_bf); 
     616Modal.element=_bf
    610617Modal._addEvent(); 
    611 },_setClassNames:function(_bd,_be){ 
    612 var _bf=(UserAgent.isIE())?Modal.maskClassIE:Modal.maskClass; 
    613 Element.addClassName(_bd,_bf); 
    614 Element.addClassName(_bd,_be+_bf); 
     618},_setClassNames:function(_c0,_c1){ 
     619var _c2=(UserAgent.isIE())?Modal.maskClassIE:Modal.maskClass; 
     620Element.addClassName(_c0,_c2); 
     621Element.addClassName(_c0,_c1+_c2); 
    615622},_rebuildMask:function(){ 
    616623document.body.appendChild(Modal.element); 
     
    623630return src.spinelzMaskResult; 
    624631} 
    625 var _c1=false; 
    626 var _c2=this.excepteds.last(); 
    627 var _c3=src; 
    628 if(_c2&&Element.descendantOf(src,_c2)){ 
    629 _c1=true; 
    630 }else{ 
    631 var _c4=Element.getStyle(Modal.element,"zIndex"); 
    632 var _c5=null; 
     632var _c4=false; 
     633var _c5=this.excepteds.last(); 
     634var _c6=src; 
     635if(_c5&&Element.descendantOf(src,_c5)){ 
     636_c4=true; 
     637}else{ 
     638var _c7=Element.getStyle(Modal.element,"zIndex"); 
     639var _c8=null; 
    633640while((src=src.parentNode)&&src!=document.body){ 
    634 if(src.style&&(_c5=Element.getStyle(src,"zIndex"))){ 
    635 _c1=(_c5>_c4); 
     641if(src.style&&(_c8=Element.getStyle(src,"zIndex"))){ 
     642_c4=(_c8>_c7); 
    636643break; 
    637644} 
    638645} 
    639646} 
    640 _c3.spinelzMaskCount=this.count; 
    641 _c3.spinelzMaskResult=_c1
    642 return _c1
    643 },_handleEvent:function(_c6){ 
    644 var src=Event.element(_c6); 
    645 if(!(Modal._isOutOfModal(src)||(_c6.keyCode&&(_c6.keyCode==this.tabKey)))){ 
    646 Event.stop(_c6); 
    647 } 
    648 },_onResize:function(_c8){ 
     647_c6.spinelzMaskCount=this.count; 
     648_c6.spinelzMaskResult=_c4
     649return _c4
     650},_handleEvent:function(_c9){ 
     651var src=Event.element(_c9); 
     652if(!(Modal._isOutOfModal(src)||(_c9.keyCode&&(_c9.keyCode==this.tabKey)))){ 
     653Event.stop(_c9); 
     654} 
     655},_onResize:function(_cb){ 
    649656Modal._setFullSize(); 
    650 },hasExcepted:function(_c9){ 
    651 return (Modal.excepteds||[]).any(function(_ca){ 
    652 return _ca.id==_c9.id; 
    653 }); 
    654 },_control_tab_key:function(_cb){ 
    655 if(!_cb){ 
    656 _cb=$A(document.body.getElementsByTagName("form")); 
    657 } 
    658 _cb.each(function(_cc){ 
    659 if(!Modal._isOutOfModal(_cc)){ 
    660 Form.getElements(_cc).each(function(el){ 
     657},hasExcepted:function(_cc){ 
     658return (Modal.excepteds||[]).any(function(_cd){ 
     659return _cd.id==_cc.id; 
     660}); 
     661},_control_tab_key:function(_ce){ 
     662if(!_ce){ 
     663_ce=$A(document.body.getElementsByTagName("form")); 
     664} 
     665_ce.each(function(_cf){ 
     666if(!Modal._isOutOfModal(_cf)){ 
     667Form.getElements(_cf).each(function(el){ 
    661668el.tabIndex=-1; 
    662669}); 
    663670}else{ 
    664 Form.getElements(_cc).each(function(el){ 
     671Form.getElements(_cf).each(function(el){ 
    665672el.tabIndex=null; 
    666673}); 
     
    670677var IECover=Class.create(); 
    671678IECover.src="javascript:false;"; 
    672 IECover.prototype={idSuffix:"iecover",initialize:function(_cf){ 
     679IECover.prototype={idSuffix:"iecover",initialize:function(_d2){ 
    673680this.options=Object.extend({transparent:false,padding:0},arguments[1]||{}); 
    674681if(document.all){ 
    675 _cf=$(_cf); 
    676 this.id=_cf.id.appendSuffix(this.idSuffix); 
    677 this._build(_cf); 
     682_d2=$(_d2); 
     683this.id=_d2.id.appendSuffix(this.idSuffix); 
     684this._build(_d2); 
    678685this.resetSize(); 
    679686} 
    680687},resetSize:function(){ 
    681688if(this.element){ 
    682 var _d0=this.element.parentNode; 
    683 var _d1=this.options.padding; 
    684 this.element.width=_d0.offsetWidth-_d1+"px"; 
    685 this.element.height=Element.getHeight(_d0)-_d1+"px"; 
    686 } 
    687 },_build:function(_d2){ 
    688 var _d3=this.options.padding/2; 
    689 var _d4={position:"absolute",top:_d3+"px",left:_d3+"px"}; 
     689var _d3=this.element.parentNode; 
     690var _d4=this.options.padding; 
     691this.element.width=_d3.offsetWidth-_d4+"px"; 
     692this.element.height=Element.getHeight(_d3)-_d4+"px"; 
     693} 
     694},_build:function(_d5){ 
     695var _d6=this.options.padding/2; 
     696var _d7={position:"absolute",top:_d6+"px",left:_d6+"px"}; 
    690697if(this.options.transparent){ 
    691 _d4.filter="alpha(opacity=0)"; 
    692 } 
    693 if(_d2.buildedIECover&&$(this.id)){ 
     698_d7.filter="alpha(opacity=0)"; 
     699} 
     700if(_d5.buildedIECover&&$(this.id)){ 
    694701this.element=$(this.id); 
    695702}else{ 
    696703this.element=Builder.node("iframe",{src:IECover.src,id:this.id,frameborder:0}); 
    697704} 
    698 Element.setStyle(this.element,_d4); 
    699 var _d5=Element.down(_d2,0); 
    700 if(_d5){ 
    701 Element.makePositioned(_d5); 
    702 } 
    703 _d2.insertBefore(this.element,_d2.firstChild); 
    704 _d2.buildedIECover=true; 
     705Element.setStyle(this.element,_d7); 
     706var _d8=Element.down(_d5,0); 
     707if(_d8){ 
     708Element.makePositioned(_d8); 
     709} 
     710_d5.insertBefore(this.element,_d5.firstChild); 
     711_d5.buildedIECover=true; 
    705712}}; 
    706713var UserAgent={getUserAgent:function(){ 
     
    717724var ShortcutManager=Class.create(); 
    718725ShortcutManager.prototype={initialize:function(){ 
    719 var _d6={detectKeyup:false,initialStarted:true,preventDefault:true}; 
    720 this.options=Object.extend(_d6,arguments[0]||{}); 
     726var _d9={detectKeyup:false,initialStarted:true,preventDefault:true}; 
     727this.options=Object.extend(_d9,arguments[0]||{}); 
    721728this.keydownListener=this.eventKeydown.bindAsEventListener(this); 
    722729if(this.options.detectKeyup){ 
     
    744751Event.observe(document,"keyup",this.keyupListener); 
    745752} 
    746 },add:function(c1,c2,_d9){ 
     753},add:function(c1,c2,_dc){ 
    747754if(c1.constructor==Array){ 
    748 var _da=this; 
    749 c1.each(function(_db){ 
    750 _da._add_or_remove_function(_db[0],_db[1],_d9); 
    751 }); 
    752 }else{ 
    753 this._add_or_remove_function(c1,c2,_d9); 
     755var _dd=this; 
     756c1.each(function(_de){ 
     757_dd._add_or_remove_function(_de[0],_de[1],_dc); 
     758}); 
     759}else{ 
     760this._add_or_remove_function(c1,c2,_dc); 
    754761} 
    755762},destroy:function(){ 
     
    758765Event.stopObserving(document,"keyup",this.keyupListener); 
    759766} 
    760 },eventKeydown:function(_dc){ 
     767},eventKeydown:function(_df){ 
    761768if(this.executable){ 
    762 var _dd
     769var _e0
    763770var key=""; 
    764 _dc=_dc||window.event; 
    765 if(_dc.keyCode){ 
    766 if(_dc.altKey){ 
     771_df=_df||window.event; 
     772if(_df.keyCode){ 
     773if(_df.altKey){ 
    767774key+="a"; 
    768775} 
    769 if(_dc.ctrlKey){ 
     776if(_df.ctrlKey){ 
    770777key+="c"; 
    771778} 
    772 if(_dc.shiftKey){ 
     779if(_df.shiftKey){ 
    773780key+="s"; 
    774781} 
     
    776783key="n"; 
    777784} 
    778 _dd=this._mergeNumKey(_dc.keyCode); 
    779 if(this.keydownFunc[key][_dd]){ 
    780 this.keydownFunc[key][_dd](); 
    781 if(this.options.preventDefault){ 
    782 Event.stop(_dc); 
    783 } 
    784 } 
    785 } 
    786 } 
    787 },eventKeyup:function(_df){ 
    788 if(this.executable){ 
    789 var _e0; 
    790 _df=_df||window.event; 
    791 if(_df.keyCode){ 
    792785_e0=this._mergeNumKey(_df.keyCode); 
    793 if(this.keyupFunc[_e0]){ 
    794 this.keyupFunc[_e0](); 
     786if(this.keydownFunc[key][_e0]){ 
     787this.keydownFunc[key][_e0](); 
    795788if(this.options.preventDefault){ 
    796789Event.stop(_df); 
     
    799792} 
    800793} 
    801 },remove:function(_e1){ 
    802 this._add_or_remove_function(_e1); 
     794},eventKeyup:function(_e2){ 
     795if(this.executable){ 
     796var _e3; 
     797_e2=_e2||window.event; 
     798if(_e2.keyCode){ 
     799_e3=this._mergeNumKey(_e2.keyCode); 
     800if(this.keyupFunc[_e3]){ 
     801this.keyupFunc[_e3](); 
     802if(this.options.preventDefault){ 
     803Event.stop(_e2); 
     804
     805
     806
     807
     808},remove:function(_e4){ 
     809this._add_or_remove_function(_e4); 
    803810},start:function(){ 
    804811this.executable=true; 
    805812},stop:function(){ 
    806813this.executable=false; 
    807 },_add_or_remove_function:function(_e2,_e3,_e4){ 
    808 var _e5
    809 var _e6=new Array(); 
    810 var _e7=this; 
    811 $A(_e2.toLowerCase().split("+")).each(function(key){ 
     814},_add_or_remove_function:function(_e5,_e6,_e7){ 
     815var _e8
     816var _e9=new Array(); 
     817var _ea=this; 
     818$A(_e5.toLowerCase().split("+")).each(function(key){ 
    812819if(key=="alt"){ 
    813 _e6.push("a"); 
     820_e9.push("a"); 
    814821}else{ 
    815822if(key=="ctrl"){ 
    816 _e6.push("c"); 
     823_e9.push("c"); 
    817824}else{ 
    818825if(key=="shift"){ 
    819 _e6.push("s"); 
    820 }else{ 
    821 _e5=_e7.keyCode[key]; 
    822 } 
    823 } 
    824 } 
    825 }); 
    826 var key=_e6.sortBy(function(_ea,_eb){ 
    827 return _ea
     826_e9.push("s"); 
     827}else{ 
     828_e8=_ea.keyCode[key]; 
     829} 
     830} 
     831} 
     832}); 
     833var key=_e9.sortBy(function(_ed,_ee){ 
     834return _ed
    828835}).join(""); 
    829836if(key==""){ 
    830837key="n"; 
    831838} 
    832 if(_e3){ 
    833 if(_e4){ 
    834 this.keyupFunc[_e5]=_e3
    835 }else{ 
    836 this.keydownFunc[key][_e5]=_e3
    837 } 
    838 }else{ 
    839 if(_e4){ 
    840 this.keyupFunc[_e5]=null; 
    841 }else{ 
    842 this.keydownFunc[key][_e5]=null; 
    843 } 
    844 } 
    845 },_mergeNumKey:function(_ec){ 
    846 return (this.numKeys[_ec])?this.numKeys[_ec]:_ec
     839if(_e6){ 
     840if(_e7){ 
     841this.keyupFunc[_e8]=_e6
     842}else{ 
     843this.keydownFunc[key][_e8]=_e6
     844} 
     845}else{ 
     846if(_e7){ 
     847this.keyupFunc[_e8]=null; 
     848}else{ 
     849this.keydownFunc[key][_e8]=null; 
     850} 
     851} 
     852},_mergeNumKey:function(_ef){ 
     853return (this.numKeys[_ef])?this.numKeys[_ef]:_ef
    847854}}; 
    848855Function.prototype.callAfterLoading=function(){ 
    849 var _ed=$A(arguments); 
    850 var _ee=this; 
    851 var _ef=_ed.shift()||this; 
     856var _f0=$A(arguments); 
     857var _f1=this; 
     858var _f2=_f0.shift()||this; 
    852859if(UserAgent.isIE()&&(document.readyState!="complete")){ 
    853860Event.observe(window,"load",function(){ 
    854 _ee.apply(_ef,_ed); 
    855 }); 
    856 }else{ 
    857 this.apply(_ef,_ed); 
     861_f1.apply(_f2,_f0); 
     862}); 
     863}else{ 
     864this.apply(_f2,_f0); 
    858865} 
    859866}; 
     
    870877document.body.focus(); 
    871878} 
    872 },concat:function(_f0,_f1){ 
    873 var _f2={}; 
    874 _f1.each(function(_f3){ 
    875 _f2[_f3]=_f0.appendSuffix(_f3); 
    876 }); 
    877 return _f2
    878 },getId:function(_f4){ 
    879 _f4=_f4||""; 
    880 return _f4.appendSuffix(++SpinelzUtil.idCount); 
    881 },toAttriteString:function(_f5,_f6){ 
    882 var _f7=_f5.map(function(_f8){ 
    883 return _f8.key+"='"+_f8.value+"'"; 
     879},concat:function(_f3,_f4){ 
     880var _f5={}; 
     881_f4.each(function(_f6){ 
     882_f5[_f6]=_f3.appendSuffix(_f6); 
     883}); 
     884return _f5
     885},getId:function(_f7){ 
     886_f7=_f7||""; 
     887return _f7.appendSuffix(++SpinelzUtil.idCount); 
     888},toAttriteString:function(_f8,_f9){ 
     889var _fa=_f8.map(function(_fb){ 
     890return _fb.key+"='"+_fb.value+"'"; 
    884891}).join(" "); 
    885 if(_f6&&(_f7.length>0)){ 
    886 _f7=" "+_f7
    887 } 
    888 return _f7
    889 },_redrawForIE:function(_f9){ 
     892if(_f9&&(_fa.length>0)){ 
     893_fa=" "+_fa
     894} 
     895return _fa
     896},_redrawForIE:function(_fc){ 
    890897if(UserAgent.isIE()){ 
    891 _f9=$(_f9); 
    892 if(_f9){ 
     898_fc=$(_fc); 
     899if(_fc){ 
    893900setTimeout(function(){ 
    894 Element.classNames(_f9).set("dummy"); 
     901Element.classNames(_fc).set("dummy"); 
    895902},200); 
    896903} 
     
    903910}); 
    904911} 
    905 var $A=Array.from=function(_fa){ 
    906 if(!_fa){ 
     912var $A=Array.from=function(_fd){ 
     913if(!_fd){ 
    907914return []; 
    908915} 
    909 if(_fa.toArray){ 
    910 return _fa.toArray(); 
    911 }else{ 
    912 var _fb=[]; 
    913 for(var i=0,len=_fa.length;i<len;i++){ 
    914 _fb.push(_fa[i]); 
    915 } 
    916 return _fb
     916if(_fd.toArray){ 
     917return _fd.toArray(); 
     918}else{ 
     919var _fe=[]; 
     920for(var i=0,len=_fd.length;i<len;i++){ 
     921_fe.push(_fd[i]); 
     922} 
     923return _fe
    917924} 
    918925}; 
    919926var Color=Class.create(); 
    920 Color.prototype={initialize:function(_fe){ 
    921 this.color=this.parse(_fe); 
    922 },toHex:function(_ff){ 
    923 _ff=_ff||this.color; 
    924 return _ff.invoke("toColorPart"); 
     927Color.prototype={initialize:function(_101){ 
     928this.color=this.parse(_101); 
     929},toHex:function(_102){ 
     930_102=_102||this.color; 
     931return _102.invoke("toColorPart"); 
    925932},invert:function(){ 
    926933return this.toCssStyle(this.color.map(function(c){ 
    927934return 255-c; 
    928935})); 
    929 },toCssStyle:function(_101){ 
    930 _101=_101||this.color; 
    931 return "#"+this.toHex(_101).join(""); 
    932 },parse:function(_102){ 
    933 _102=_102||this.color; 
    934 if(_102.match(/rgb\(\d+,\s*\d+,\s*\d+\)/)){ 
    935 return _102.match(/\d+/g).map(function(c){ 
     936},toCssStyle:function(_104){ 
     937_104=_104||this.color; 
     938return "#"+this.toHex(_104).join(""); 
     939},parse:function(_105){ 
     940_105=_105||this.color; 
     941if(_105.match(/rgb\(\d+,\s*\d+,\s*\d+\)/)){ 
     942return _105.match(/\d+/g).map(function(c){ 
    936943return parseInt(c,10); 
    937944}); 
    938945}else{ 
    939 if(_102.match(/#[a-fA-F0-9]{6}/)){ 
    940 return _102.match(/([a-fA-F0-9]){2}/g).map(function(c){ 
     946if(_105.match(/#[a-fA-F0-9]{6}/)){ 
     947return _105.match(/([a-fA-F0-9]){2}/g).map(function(c){ 
    941948return parseInt(c,16); 
    942949}); 
    943950} 
    944951} 
    945 throw "parse error: "+_102
     952throw "parse error: "+_105
    946953}}; 
    947954var DebugConsole={_active:false,_basetime:null,_messages:null,activate:function(){ 
    948955this._active=true; 
    949 },dump:function(_105){ 
    950 _105=_105||{}; 
    951 switch(_105.type){ 
     956},dump:function(_108){ 
     957_108=_108||{}; 
     958switch(_108.type){ 
    952959case "alert": 
    953960this._dump_alert(); 
     
    960967break; 
    961968case "update": 
    962 this._dump_update(_105.target); 
     969this._dump_update(_108.target); 
    963970break; 
    964971default: 
     
    975982this._messages=[]; 
    976983} 
    977 },log:function(_106){ 
     984},log:function(_109){ 
    978985if(this._active){ 
    979 var _107=("00000000"+(new Date()-this._basetime)).slice(-8); 
    980 this._messages.push(_107+" : "+_106); 
     986var _10a=("00000000"+(new Date()-this._basetime)).slice(-8); 
     987this._messages.push(_10a+" : "+_109); 
    981988} 
    982989},_dump_alert:function(){ 
    983 this._messages.each(function(_108){ 
    984 alert(_108); 
     990this._messages.each(function(_10b){ 
     991alert(_10b); 
    985992}); 
    986993},_dump_clipboard:function(){ 
    987994var dump=""; 
    988 this._messages.each(function(_10a){ 
    989 dump+=_10a+"\n"; 
     995this._messages.each(function(_10d){ 
     996dump+=_10d+"\n"; 
    990997}); 
    991998clipboardData.setData("Text",dump); 
    992999},_dump_console:function(){ 
    993 this._messages.each(function(_10b){ 
    994 console.log(_10b); 
    995 }); 
    996 },_dump_update:function(_10c){ 
     1000this._messages.each(function(_10e){ 
     1001console.log(_10e); 
     1002}); 
     1003},_dump_update:function(_10f){ 
    9971004var html=""; 
    998 this._messages.each(function(_10e){ 
    999 html+="<p>"+_10e+"</p>"; 
    1000 }); 
    1001 Element.update(_10c,html); 
     1005this._messages.each(function(_111){ 
     1006html+="<p>"+_111+"</p>"; 
     1007}); 
     1008Element.update(_10f,html); 
    10021009}}; 
    10031010 
  • spinelz/trunk/compress/javascripts/spinelz_lib/spinelz_util_for_rubricks.js

    r5735 r5746  
    49094909},cutSpaces:function(){ 
    49104910return this.normalizeSpaces().gsub(/[\s]/,""); 
    4911 },getPrefix:function(_50){ 
    4912 if(!_50){ 
    4913 _50="_"; 
    4914 
    4915 return this.split(_50)[0]; 
    4916 },getSuffix:function(_51){ 
    4917 if(!_51){ 
    4918 _51="_"; 
    4919 
    4920 return this.split(_51).pop(); 
     4911},getSmartLength:function(){ 
     4912var r=0; 
     4913for(var i=0;i<this.length;i++){ 
     4914var c=this.charCodeAt(i); 
     4915r+=(((c>=0&&c<129)||(c==63728)||(c>=65377&&c<65440)||(c>=63729&&c<63732))?1:2); 
     4916
     4917return r; 
     4918},getPrefix:function(_53){ 
     4919if(!_53){ 
     4920_53="_"; 
     4921
     4922return this.split(_53)[0]; 
     4923},getSuffix:function(_54){ 
     4924if(!_54){ 
     4925_54="_"; 
     4926
     4927return this.split(_54).pop(); 
    49214928},normalizeSpaces:function(){ 
    49224929return this.gsub(this._mb_space," "); 
     
    49244931return this.strip().gsub(this._rf,"").gsub(this._rb,""); 
    49254932},toElement:function(){ 
    4926 var _52=document.createElement("div"); 
    4927 _52.innerHTML=this; 
    4928 return _52.firstChild; 
     4933var _55=document.createElement("div"); 
     4934_55.innerHTML=this; 
     4935return _55.firstChild; 
    49294936}}); 
    49304937var CssUtil=Class.create(); 
    4931 CssUtil.getInstance=function(_53,_54){ 
    4932 var _55=CssUtil.appendPrefix(_53,_54); 
    4933 return new CssUtil([_54,_55]); 
    4934 }; 
    4935 CssUtil.appendPrefix=function(_56,_57){ 
    4936 var _58={}; 
    4937 $H(_57).each(function(_59){ 
    4938 _58[_59[0]]=_56+_57[_59[0]]; 
    4939 }); 
    4940 return _58
    4941 }; 
    4942 CssUtil.getCssRules=function(_5a){ 
    4943 return _5a.rules||_5a.cssRules; 
    4944 }; 
    4945 CssUtil.getCssRuleBySelectorText=function(_5b){ 
    4946 var _5c=null; 
     4938CssUtil.getInstance=function(_56,_57){ 
     4939var _58=CssUtil.appendPrefix(_56,_57); 
     4940return new CssUtil([_57,_58]); 
     4941}; 
     4942CssUtil.appendPrefix=function(_59,_5a){ 
     4943var _5b={}; 
     4944$H(_5a).each(function(_5c){ 
     4945_5b[_5c[0]]=_59+_5a[_5c[0]]; 
     4946}); 
     4947return _5b
     4948}; 
     4949CssUtil.getCssRules=function(_5d){ 
     4950return _5d.rules||_5d.cssRules; 
     4951}; 
     4952CssUtil.getCssRuleBySelectorText=function(_5e){ 
     4953var _5f=null; 
    49474954$A(document.styleSheets).each(function(s){ 
    4948 var _5e=CssUtil.getCssRules(s); 
    4949 _5c=$A(_5e).detect(function(r){ 
     4955var _61=CssUtil.getCssRules(s); 
     4956_5f=$A(_61).detect(function(r){ 
    49504957if(!r.selectorText){ 
    49514958return false; 
    49524959} 
    4953 return r.selectorText.toLowerCase()==_5b.toLowerCase(); 
    4954 }); 
    4955 if(_5c){ 
     4960return r.selectorText.toLowerCase()==_5e.toLowerCase(); 
     4961}); 
     4962if(_5f){ 
    49564963throw $break; 
    49574964} 
    49584965}); 
    4959 return _5c
    4960 }; 
    4961 CssUtil.prototype={initialize:function(_60){ 
    4962 if(!((typeof (_60)=="object")&&(_60.constructor==Array))){ 
     4966return _5f
     4967}; 
     4968CssUtil.prototype={initialize:function(_63){ 
     4969if(!((typeof (_63)=="object")&&(_63.constructor==Array))){ 
    49634970throw "CssUtil#initialize: argument must be a Array object!"; 
    49644971} 
    4965 this.styles=_60
     4972this.styles=_63
    49664973},getClasses:function(key){ 
    49674974return this.styles.collect(function(s){ 
     
    49714978return this.getClasses(key).join(" "); 
    49724979},allJoinClassNames:function(){ 
    4973 var _64={}; 
    4974 $H(this.styles.first()).each(function(_65){ 
    4975 _64[_65.key]=this.joinClassNames(_65.key); 
     4980var _67={}; 
     4981$H(this.styles.first()).each(function(_68){ 
     4982_67[_68.key]=this.joinClassNames(_68.key); 
    49764983}.bind(this)); 
    4977 return _64
    4978 },addClassNames:function(_66,key){ 
     4984return _67
     4985},addClassNames:function(_69,key){ 
    49794986this.styles.each(function(s){ 
    4980 Element.addClassName(_66,s[key]); 
    4981 }); 
    4982 },removeClassNames:function(_69,key){ 
     4987Element.addClassName(_69,s[key]); 
     4988}); 
     4989},removeClassNames:function(_6c,key){ 
    49834990this.styles.each(function(s){ 
    4984 Element.removeClassName(_69