Home | History | Annotate | Download | only in test

Lines Matching refs:onHide

1 isActive:function(){return this._manager?(this._manager._activeKB==this):(g.manager==this)},deactivate:function(a){if(a){if(a===this._activeKB){this._activeKB=null;a.fireEvent("deactivate");g.manager.fireEvent("changed")}}else{if(this._manager){this._manager.deactivate(this)}}return this},relinquish:function(){if(this.isActive()&&this._manager&&this._manager.previous){this._manager.activate(this._manager.previous)}else{this.deactivate()}return this},manage:function(a){if(a._manager){a._manager.drop(a)}this._instances.push(a);a._manager=this;if(!this._activeKB){this.activate(a)}return this},drop:function(a){a.relinquish();this._instances.erase(a);if(this._activeKB==a){if(this.previous&&this._instances.contains(this.previous)){this.activate(this.previous)}else{this._activeKB=this._instances[0]}}return this},trace:function(){g.trace(this)},each:function(a){g.each(this,a)},_instances:[],_disable:function(a){if(this._activeKB==a){this._activeKB=null}},_setup:function(){this.addEvents(this.options.events);if(g.manager&&!this._manager){g.manager.manage(this)}if(this.options.active){this.activate()}else{this.relinquish()}},_handle:function(a,b){if(a.preventKeyboardPropagation){return}var c=!!this._manager;if(c&&this._activeKB){this._activeKB._handle(a,b);if(a.preventKeyboardPropagation){return}}this.fireEvent(b,a);if(!c&&this._activeKB){this._activeKB._handle(a,b)}}});var f={};var j=["shift","control","alt","meta"];var h=/^(?:shift|control|ctrl|alt|meta)$/;g.parse=function(d,e,a){if(a&&a.contains(d.toLowerCase())){return d}d=d.toLowerCase().replace(/^(keyup|keydown):/,function(k,n){e=n;return""});if(!f[d]){if(d!="+"){var l,b={};d.split("+").each(function(k){if(h.test(k)){b[k]=true}else{l=k}});b.control=b.control||b.ctrl;var c=[];j.each(function(k){if(b[k]){c.push(k)}});if(l){c.push(l)}f[d]=c.join("+")}else{f[d]=d}}return e+":keys("+f[d]+")"};g.each=function(c,b){var a=c||g.manager;while(a){b(a);a=a._activeKB}};g.stop=function(a){a.preventKeyboardPropagation=true};g.manager=new g({active:true});g.trace=function(b){b=b||g.manager;var a=window.console&&console.log;if(a){console.log("the following items have focus: ")}g.each(b,function(c){if(a){console.log(document.id(c.widget)||c.wiget||c)}})};var i=function(a){var b=[];j.each(function(c){if(a[c]){b.push(c)}});if(!h.test(a.key)){b.push(a.key)}g.manager._handle(a,a.type+":keys("+b.join("+")+")")};document.addEvents({keyup:i,keydown:i})})();Keyboard.prototype.options.nonParsedEvents.combine(["rebound","onrebound"]);Keyboard.implement({addShortcut:function(c,d){this._shortcuts=this._shortcuts||[];this._shortcutIndex=this._shortcutIndex||{};d.getKeyboard=Function.from(this);d.name=c;this._shortcutIndex[c]=d;this._shortcuts.push(d);if(d.keys){this.addEvent(d.keys,d.handler)}return this},addShortcuts:function(c){for(var d in c){this.addShortcut(d,c[d])}return this},removeShortcut:function(c){var d=this.getShortcut(c);if(d&&d.keys){this.removeEvent(d.keys,d.handler);delete this._shortcutIndex[c];this._shortcuts.erase(d)}return this},removeShortcuts:function(b){b.each(this.removeShortcut,this);return this},getShortcuts:function(){return this._shortcuts||[]},getShortcut:function(b){return(this._shortcutIndex||{})[b]}});Keyboard.rebind=function(c,d){Array.from(d).each(function(a){a.getKeyboard().removeEvent(a.keys,a.handler);a.getKeyboard().addEvent(c,a.handler);a.keys=c;a.getKeyboard().fireEvent("rebound")})};Keyboard.getActiveShortcuts=function(d){var e=[],f=[];Keyboard.each(d,[].push.bind(e));e.each(function(a){f.extend(a.getShortcuts())});return f};Keyboard.getShortcut=function(j,f,i){i=i||{};var g=i.many?[]:null,h=i.many?function(a){var b=a.getShortcut(j);if(b){g.push(b)}}:function(a){if(!g){g=a.getShortcut(j)}};Keyboard.each(f,h);return g};Keyboard.getShortcuts=function(c,d){return Keyboard.getShortcut(c,d,{many:true})};HtmlTable=Class.refactor(HtmlTable,{options:{useKeyboard:true,classRowSelected:"table-tr-selected",classRowHovered:"table-tr-hovered",classSelectable:"table-selectable",shiftForMultiSelect:true,allowMultiSelect:true,selectable:false,selectHiddenRows:false},initialize:function(){this.previous.apply(this,arguments);if(this.occluded){return this.occluded}this.selectedRows=new Elements();if(!this.bound){this.bound={}}this.bound.mouseleave=this.mouseleave.bind(this);this.bound.clickRow=this.clickRow.bind(this);this.bound.activateKeyboard=function(){if(this.keyboard&&this.selectEnabled){this.keyboard.activate()}}.bind(this);if(this.options.selectable){this.enableSelect()}},empty:function(){if(this.body.rows.length){this.selectNone()}return this.previous()},enableSelect:function(){this.selectEnabled=true;this.attachSelects();this.element.addClass(this.options.classSelectable);return this},disableSelect:function(){this.selectEnabled=false;this.attachSelects(false);this.element.removeClass(this.options.classSelectable);return this},push:function(){var b=this.previous.apply(this,arguments);this.updateSelects();return b},toggleRow:function(b){return this[(this.isSelected(b)?"de":"")+"selectRow"](b)},selectRow:function(c,d){if(this.isSelected(c)||(!d&&!this.body.getChildren().contains(c))){return}if(!this.options.allowMultiSelect){this.selectNone()}if(!this.isSelected(c)){this.selectedRows.push(c);c.addClass(this.options.classRowSelected);this.fireEvent("rowFocus",[c,this.selectedRows]);this.fireEvent("stateChanged")}this.focused=c;document.clearSelection();return this},isSelected:function(b){return this.selectedRows.contains(b)},getSelected:function(){return this.selectedRows},serialize:function(){var b=this.previous.apply(this,arguments)||{};if(this.options.selectable){b.selectedRows=this.selectedRows.map(function(a){return Array.indexOf(this.body.rows,a)}.bind(this))}return b},restore:function(b){if(this.options.selectable&&b.selectedRows){b.selectedRows.each(function(a){this.selectRow(this.body.rows[a])}.bind(this))}this.previous.apply(this,arguments)},deselectRow:function(c,d){if(!this.isSelected(c)||(!d&&!this.body.getChildren().contains(c))){return}this.selectedRows=new Elements(Array.from(this.selectedRows).erase(c));c.removeClass(this.options.classRowSelected);this.fireEvent("rowUnfocus",[c,this.selectedRows]);this.fireEvent("stateChanged");return this},selectAll:function(b){if(!b&&!this.options.allowMultiSelect){return}this.selectRange(0,this.body.rows.length,b);return this},selectNone:function(){return this.selectAll(true)},selectRange:function(h,i,k){if(!this.options.allowMultiSelect&&!k){return}var j=k?"deselectRow":"selectRow",l=Array.clone(this.body.rows);if(typeOf(h)=="element"){h=l.indexOf(h)}if(typeOf(i)=="element"){i=l.indexOf(i)}i=i<l.length-1?i:l.length-1;if(i<h){var m=h;h=i;i=m}for(var n=h;n<=i;n++){if(this.options.selectHiddenRows||l[n].isDisplayed()){this[j](l[n],true)}}return this},deselectRange:function(c,d){this.selectRange(c,d,true)},enterRow:function(b){if(this.hovered){this.hovered=this.leaveRow(this.hovered)}this.hovered=b.addClass(this.options.classRowHovered)},leaveRow:function(b){b.removeClass(this.options.classRowHovered)},updateSelects:function(){Array.each(this.body.rows,function(d){var c=d.retrieve("binders");if(!c&&!this.selectEnabled){return}if(!c){c={mouseenter:this.enterRow.pass([d],this),mouseleave:this.leaveRow.pass([d],this)};d.store("binders",c)}if(this.selectEnabled){d.addEvents(c)}else{d.removeEvents(c)}},this)},shiftFocus:function(d,e){if(!this.focused){return this.selectRow(this.body.rows[0],e)}var f=this.getRowByOffset(d,this.options.selectHiddenRows);if(f===null||this.focused==this.body.rows[f]){return this}this.toggleRow(this.body.rows[f],e)},clickRow:function(e,d){var f=(e.shift||e.meta||e.control)&&this.options.shiftForMultiSelect;if(!f&&!(e.rightClick&&this.isSelected(d)&&this.options.allowMultiSelect)){this.selectNone()}if(e.rightClick){this.selectRow(d)}else{this.toggleRow(d)}if(e.shift){this.selectRange(this.rangeStart||this.body.rows[0],d,this.rangeStart?!this.isSelected(d):true);this.focused=d}this.rangeStart=d},getRowByOffset:function(h,i){if(!this.focused){return 0}var f=Array.indexOf(this.body.rows,this.focused);if((f==0&&h<0)||(f==this.body.rows.length-1&&h>0)){return null}if(i){f+=h}else{var g=0,j=0;if(h>0){while(j<h&&f<this.body.rows.length-1){if(this.body.rows[++f].isDisplayed()){j++}}}else{while(j>h&&f>0){if(this.body.rows[--f].isDisplayed()){j--}}}}return f},attachSelects:function(m){m=m!=null?m:true;var j=m?"addEvents":"removeEvents";this.element[j]({mouseleave:this.bound.mouseleave,click:this.bound.activateKeyboard});this.body[j]({"click:relay(tr)":this.bound.clickRow,"contextmenu:relay(tr)":this.bound.clickRow});if(this.options.useKeyboard||this.keyboard){if(!this.keyboard){this.keyboard=new Keyboard()}if(!this.selectKeysDefined){this.selectKeysDefined=true;var k,l;var n=function(a){var b=function(d){clearTimeout(k);d.preventDefault();var c=this.body.rows[this.getRowByOffset(a,this.options.selectHiddenRows)];if(d.shift&&c&&this.isSelected(c)){this.deselectRow(this.focused);this.focused=c}else{if(c&&(!this.options.allowMultiSelect||!d.shift)){this.selectNone()}this.shiftFocus(a,d)}if(l){k=b.delay(100,this,d)}else{k=(function(){l=true;b(d)}).delay(400)}}.bind(this);return b}.bind(this);var h=function(){clearTimeout(k);l=false};this.keyboard.addEvents({"keydown:shift+up":n(-1),"keydown:shift+down":n(1),"keyup:shift+up":h,"keyup:shift+down":h,"keyup:up":h,"keyup:down":h});var i="";if(this.options.allowMultiSelect&&this.options.shiftForMultiSelect&&this.options.useKeyboard){i=" (Shift multi-selects)."}this.keyboard.addShortcuts({"Select Previous Row":{keys:"up",shortcut:"up arrow",handler:n(-1),description:"Select the previous row in the table."+i},"Select Next Row":{keys:"down",shortcut:"down arrow",handler:n(1),description:"Select the next row in the table."+i}})}this.keyboard[m?"activate":"deactivate"]()}this.updateSelects()},mouseleave:function(){if(this.hovered){this.leaveRow(this.hovered)}}});var Scroller=new Class({Implements:[Events,Options],options:{area:20,velocity:1,onChange:function(d,c){this.element.scrollTo(d,c)},fps:50},initialize:function(c,d){this.setOptions(d);this.element=document.id(c);this.docBody=document.id(this.element.getDocument().body);this.listener=(typeOf(this.element)!="element")?this.docBody:this.element;this.timer=null;this.bound={attach:this.attach.bind(this),detach:this.detach.bind(this),getCoords:this.getCoords.bind(this)}},start:function(){this.listener.addEvents({mouseover:this.bound.attach,mouseleave:this.bound.detach});return this},stop:function(){this.listener.removeEvents({mouseover:this.bound.attach,mouseleave:this.bound.detach});this.detach();this.timer=clearInterval(this.timer);return this},attach:function(){this.listener.addEvent("mousemove",this.bound.getCoords)},detach:function(){this.listener.removeEvent("mousemove",this.bound.getCoords);this.timer=clearInterval(this.timer)},getCoords:function(b){this.page=(this.listener.get("tag")=="body")?b.client:b.page;if(!this.timer){this.timer=this.scroll.periodical(Math.round(1000/this.options.fps),this)}},scroll:function(){var p=this.element.getSize(),j=this.element.getScroll(),k=this.element!=this.docBody?this.element.getOffsets():{x:0,y:0},o=this.element.getScrollSize(),l={x:0,y:0},n=this.options.area.top||this.options.area,i=this.options.area.bottom||this.options.area;for(var m in this.page){if(this.page[m]<(n+k[m])&&j[m]!=0){l[m]=(this.page[m]-n-k[m])*this.options.velocity}else{if(this.page[m]+i>(p[m]+k[m])&&j[m]+p[m]!=o[m]){l[m]=(this.page[m]-p[m]+i-k[m])*this.options.velocity}}l[m]=l[m].round()}if(l.y||l.x){this.fireEvent("change",[j.x+l.x,j.y+l.y])}}});(function(){var b=function(d,a){return(d)?(typeOf(d)=="function"?d(a):a.get(d)):""};this.Tips=new Class({Implements:[Events,Options],options:{onShow:function(){this.tip.setStyle("display","block")},onHide