Changeset 5689

Show
Ignore:
Timestamp:
03/03/08 08:12:30 (9 months ago)
Author:
uta
Message:

3732

Files:

Legend:

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

    r5671 r5689  
    324324} 
    325325},selectEffect:function(_2b,_2c){ 
    326 if($(_2b)){ 
    327326if(!this.flagAllowMultiple||!_2c){ 
    328327this.unselectAll(); 
    329328} 
    330 this.classNames.addClassNames($(_2b),"trSelected"); 
     329var el=$(_2b); 
     330if(el){ 
     331this.classNames.addClassNames(el,"trSelected"); 
    331332this.selected[_2b]=true; 
    332333} 
    333 },selectOrUnselect:function(_2d,_2e){ 
    334 if(!this.flagAvailable){ 
    335 return; 
    336 } 
    337 if(_2d==null){ 
    338 return; 
    339 } 
    340 if(_2e&&this.selected[_2d]){ 
     334},selectOrUnselect:function(_2e,_2f){ 
     335if(!this.flagAvailable){ 
     336return; 
     337} 
     338if(_2e==null){ 
     339return; 
     340} 
     341if(_2f&&this.selected[_2e]){ 
    341342if(!this.flagAllowMultiple&&!this.options.flagAllowUnselect){ 
    342343return; 
    343344} 
    344 this.unselect(_2d); 
    345 }else{ 
    346 this.select(_2d,_2e); 
    347 if(_2e){ 
     345this.unselect(_2e); 
     346}else{ 
     347this.select(_2e,_2f); 
     348if(_2f){ 
    348349SpinelzUtil.clearBrowserSelection(); 
    349350} 
    350351} 
    351 },selectOrUnselectRange:function(_2f){ 
    352 if(!this.flagAvailable){ 
    353 return; 
    354 } 
    355 if(_2f==null){ 
    356 return; 
    357 } 
    358 if(this.lastSelected==null||this.lastSelected==_2f){ 
    359 this.selectOrUnselect(_2f); 
    360 return; 
    361 } 
    362 var _30=false; 
    363 var _31=this.element.tBodies[0].rows; 
    364 var _32=this.lastSelected; 
    365 for(var i=0;i<_31.length;i++){ 
    366 if(_31[i].id==_2f||_31[i].id==_32){ 
    367 _30=(_30)?false:true; 
    368 }else{ 
    369 if(!_30){ 
     352},selectOrUnselectRange:function(_30){ 
     353if(!this.flagAvailable){ 
     354return; 
     355} 
     356if(_30==null){ 
     357return; 
     358} 
     359if(this.lastSelected==null||this.lastSelected==_30){ 
     360this.selectOrUnselect(_30); 
     361return; 
     362} 
     363var _31=false; 
     364var _32=this.element.tBodies[0].rows; 
     365var _33=this.lastSelected; 
     366for(var i=0;i<_32.length;i++){ 
     367if(_32[i].id==_30||_32[i].id==_33){ 
     368_31=(_31)?false:true; 
     369}else{ 
     370if(!_31){ 
    370371continue; 
    371372} 
    372373} 
    373 if(this.selected[_32]){ 
    374 this.select(_31[i].id,true); 
    375 }else{ 
    376 this.unselect(_31[i].id); 
     374if(this.selected[_33]){ 
     375this.select(_32[i].id,true); 
     376}else{ 
     377this.unselect(_32[i].id); 
    377378} 
    378379} 
    379380SpinelzUtil.clearBrowserSelection(); 
    380 },submit:function(_34){ 
    381 if(!this.flagAvailable){ 
    382 return; 
    383 } 
    384 var _35=this.getSelected(); 
    385 this.options.functionSubmit(_35[0]); 
    386 },unselect:function(_36){ 
    387 if(!this.flagAvailable){ 
    388 return; 
    389 } 
    390 this.classNames.removeClassNames($(_36),"trSelected"); 
    391 delete this.selected[_36]; 
    392 this.lastSelected=_36
     381},submit:function(_35){ 
     382if(!this.flagAvailable){ 
     383return; 
     384} 
     385var _36=this.getSelected(); 
     386this.options.functionSubmit(_36[0]); 
     387},unselect:function(_37){ 
     388if(!this.flagAvailable){ 
     389return; 
     390} 
     391this.classNames.removeClassNames($(_37),"trSelected"); 
     392delete this.selected[_37]; 
     393this.lastSelected=_37
    393394this.options.functionPostUnselect(this); 
    394395},unselectAll:function(){ 
     
    396397return; 
    397398} 
    398 var _37=this.element.tBodies[0].rows; 
    399 for(var i=0;i<_37.length;i++){ 
    400 this.unselect(_37[i].id); 
     399var _38=this.element.tBodies[0].rows; 
     400for(var i=0;i<_38.length;i++){ 
     401this.unselect(_38[i].id); 
    401402} 
    402403}}; 
    403 var SelectableTableLib={navi:function(_39,_3a){ 
    404 var _3b=_3a||(SelectableTableManager.active||"")+"_navigation_top"; 
    405 var _3a=$(_3b+"_"+_39); 
    406 if(_3a!=null){ 
     404var SelectableTableLib={navi:function(_3a,_3b){ 
     405var _3c=_3b||(SelectableTableManager.active||"")+"_navigation_top"; 
     406var _3b=$(_3c+"_"+_3a); 
     407if(_3b!=null){ 
    407408if(UserAgent.isIE()){ 
    408 _3a.fireEvent("onclick"); 
     409_3b.fireEvent("onclick"); 
    409410}else{ 
    410411var evt=document.createEvent("MouseEvents"); 
    411412evt.initEvent("click",true,true); 
    412 _3a.dispatchEvent(evt); 
     413_3b.dispatchEvent(evt); 
    413414} 
    414415} 
     
    416417var SelectableTableCreator={create:function(){ 
    417418var key=arguments[0]; 
    418 var _3e=arguments[1]||{}; 
    419 var _3f=arguments[2]||null; 
    420 var _40=arguments[3]||false; 
    421 if(_3f){ 
     419var _3f=arguments[1]||{}; 
     420var _40=arguments[2]||null; 
     421var _41=arguments[3]||false; 
     422if(_40){ 
    422423try{ 
    423 _3f.destroy(); 
     424_40.destroy(); 
    424425} 
    425426catch(e){ 
    426427} 
    427428} 
    428 var _41=new SelectableTable(key,_3e); 
    429 if(_40){ 
    430 SelectableTableManager.push(key,_41); 
    431 } 
    432 return _41
     429var _42=new SelectableTable(key,_3f); 
     430if(_41){ 
     431SelectableTableManager.push(key,_42); 
     432} 
     433return _42
    433434}}; 
    434435var SelectableTableManager={active:null,list:$H({}),activate:function(key){ 
     
    446447this.deactivate(); 
    447448this.list=$H({}); 
    448 },push:function(key,_44){ 
     449},push:function(key,_45){ 
    449450if(this.list[key]){ 
    450451this.list[key].makeUnavailable(); 
    451452} 
    452 this.list[key]=_44
     453this.list[key]=_45
    453454this.activate(key); 
    454455},start:function(){ 
    455 var _45=this.active; 
    456 if(_45){ 
    457 this.list[_45].makeAvailable(); 
     456var _46=this.active; 
     457if(_46){ 
     458this.list[_46].makeAvailable(); 
    458459} 
    459460},stop:function(){ 
  • spinelz/trunk/compress/javascripts/spinelz/spinelz_for_rubricks.js

    r5686 r5689  
    35693569} 
    35703570},selectEffect:function(_2b,_2c){ 
    3571 if($(_2b)){ 
    35723571if(!this.flagAllowMultiple||!_2c){ 
    35733572this.unselectAll(); 
    35743573} 
    3575 this.classNames.addClassNames($(_2b),"trSelected"); 
     3574var el=$(_2b); 
     3575if(el){ 
     3576this.classNames.addClassNames(el,"trSelected"); 
    35763577this.selected[_2b]=true; 
    35773578} 
    3578 },selectOrUnselect:function(_2d,_2e){ 
     3579},selectOrUnselect:function(_2e,_2f){ 
    35793580if(!this.flagAvailable){ 
    35803581return; 
    35813582} 
    3582 if(_2d==null){ 
    3583 return; 
    3584 } 
    3585 if(_2e&&this.selected[_2d]){ 
     3583if(_2e==null){ 
     3584return; 
     3585} 
     3586if(_2f&&this.selected[_2e]){ 
    35863587if(!this.flagAllowMultiple&&!this.options.flagAllowUnselect){ 
    35873588return; 
    35883589} 
    3589 this.unselect(_2d); 
    3590 }else{ 
    3591 this.select(_2d,_2e); 
    3592 if(_2e){ 
     3590this.unselect(_2e); 
     3591}else{ 
     3592this.select(_2e,_2f); 
     3593if(_2f){ 
    35933594SpinelzUtil.clearBrowserSelection(); 
    35943595} 
    35953596} 
    3596 },selectOrUnselectRange:function(_2f){ 
     3597},selectOrUnselectRange:function(_30){ 
    35973598if(!this.flagAvailable){ 
    35983599return; 
    35993600} 
    3600 if(_2f==null){ 
    3601 return; 
    3602 } 
    3603 if(this.lastSelected==null||this.lastSelected==_2f){ 
    3604 this.selectOrUnselect(_2f); 
    3605 return; 
    3606 } 
    3607 var _30=false; 
    3608 var _31=this.element.tBodies[0].rows; 
    3609 var _32=this.lastSelected; 
    3610 for(var i=0;i<_31.length;i++){ 
    3611 if(_31[i].id==_2f||_31[i].id==_32){ 
    3612 _30=(_30)?false:true; 
    3613 }else{ 
    3614 if(!_30){ 
     3601if(_30==null){ 
     3602return; 
     3603} 
     3604if(this.lastSelected==null||this.lastSelected==_30){ 
     3605this.selectOrUnselect(_30); 
     3606return; 
     3607} 
     3608var _31=false; 
     3609var _32=this.element.tBodies[0].rows; 
     3610var _33=this.lastSelected; 
     3611for(var i=0;i<_32.length;i++){ 
     3612if(_32[i].id==_30||_32[i].id==_33){ 
     3613_31=(_31)?false:true; 
     3614}else{ 
     3615if(!_31){ 
    36153616continue; 
    36163617} 
    36173618} 
    3618 if(this.selected[_32]){ 
    3619 this.select(_31[i].id,true); 
    3620 }else{ 
    3621 this.unselect(_31[i].id); 
     3619if(this.selected[_33]){ 
     3620this.select(_32[i].id,true); 
     3621}else{ 
     3622this.unselect(_32[i].id); 
    36223623} 
    36233624} 
    36243625SpinelzUtil.clearBrowserSelection(); 
    3625 },submit:function(_34){ 
     3626},submit:function(_35){ 
    36263627if(!this.flagAvailable){ 
    36273628return; 
    36283629} 
    3629 var _35=this.getSelected(); 
    3630 this.options.functionSubmit(_35[0]); 
    3631 },unselect:function(_36){ 
     3630var _36=this.getSelected(); 
     3631this.options.functionSubmit(_36[0]); 
     3632},unselect:function(_37){ 
    36323633if(!this.flagAvailable){ 
    36333634return; 
    36343635} 
    3635 this.classNames.removeClassNames($(_36),"trSelected"); 
    3636 delete this.selected[_36]; 
    3637 this.lastSelected=_36
     3636this.classNames.removeClassNames($(_37),"trSelected"); 
     3637delete this.selected[_37]; 
     3638this.lastSelected=_37
    36383639this.options.functionPostUnselect(this); 
    36393640},unselectAll:function(){ 
     
    36413642return; 
    36423643} 
    3643 var _37=this.element.tBodies[0].rows; 
    3644 for(var i=0;i<_37.length;i++){ 
    3645 this.unselect(_37[i].id); 
     3644var _38=this.element.tBodies[0].rows; 
     3645for(var i=0;i<_38.length;i++){ 
     3646this.unselect(_38[i].id); 
    36463647} 
    36473648}}; 
    3648 var SelectableTableLib={navi:function(_39,_3a){ 
    3649 var _3b=_3a||(SelectableTableManager.active||"")+"_navigation_top"; 
    3650 var _3a=$(_3b+"_"+_39); 
    3651 if(_3a!=null){ 
     3649var SelectableTableLib={navi:function(_3a,_3b){ 
     3650var _3c=_3b||(SelectableTableManager.active||"")+"_navigation_top"; 
     3651var _3b=$(_3c+"_"+_3a); 
     3652if(_3b!=null){ 
    36523653if(UserAgent.isIE()){ 
    3653 _3a.fireEvent("onclick"); 
     3654_3b.fireEvent("onclick"); 
    36543655}else{ 
    36553656var evt=document.createEvent("MouseEvents"); 
    36563657evt.initEvent("click",true,true); 
    3657 _3a.dispatchEvent(evt); 
     3658_3b.dispatchEvent(evt); 
    36583659} 
    36593660} 
     
    36613662var SelectableTableCreator={create:function(){ 
    36623663var key=arguments[0]; 
    3663 var _3e=arguments[1]||{}; 
    3664 var _3f=arguments[2]||null; 
    3665 var _40=arguments[3]||false; 
    3666 if(_3f){ 
     3664var _3f=arguments[1]||{}; 
     3665var _40=arguments[2]||null; 
     3666var _41=arguments[3]||false; 
     3667if(_40){ 
    36673668try{ 
    3668 _3f.destroy(); 
     3669_40.destroy(); 
    36693670} 
    36703671catch(e){ 
    36713672} 
    36723673} 
    3673 var _41=new SelectableTable(key,_3e); 
    3674 if(_40){ 
    3675 SelectableTableManager.push(key,_41); 
    3676 } 
    3677 return _41
     3674var _42=new SelectableTable(key,_3f); 
     3675if(_41){ 
     3676SelectableTableManager.push(key,_42); 
     3677} 
     3678return _42
    36783679}}; 
    36793680var SelectableTableManager={active:null,list:$H({}),activate:function(key){ 
     
    36913692this.deactivate(); 
    36923693this.list=$H({}); 
    3693 },push:function(key,_44){ 
     3694},push:function(key,_45){ 
    36943695if(this.list[key]){ 
    36953696this.list[key].makeUnavailable(); 
    36963697} 
    3697 this.list[key]=_44
     3698this.list[key]=_45
    36983699this.activate(key); 
    36993700},start:function(){ 
    3700 var _45=this.active; 
    3701 if(_45){ 
    3702 this.list[_45].makeAvailable(); 
     3701var _46=this.active; 
     3702if(_46){ 
     3703this.list[_46].makeAvailable(); 
    37033704} 
    37043705},stop:function(){ 
  • spinelz/trunk/src/javascripts/spinelz/selectableTable.js

    r5671 r5689  
    372372  }, 
    373373  selectEffect: function(trId, ctrl) { 
    374     if($(trId)) { 
    375       if(!this.flagAllowMultiple || !ctrl) { 
    376         this.unselectAll(); 
    377       } 
    378       this.classNames.addClassNames($(trId), 'trSelected'); 
     374    if(!this.flagAllowMultiple || !ctrl) { 
     375      this.unselectAll(); 
     376    } 
     377    var el = $(trId); 
     378    if(el) { 
     379      this.classNames.addClassNames(el, 'trSelected'); 
    379380      this.selected[trId] = true; 
    380381    }