Home | History | Annotate | Download | only in test

Lines Matching refs:Row

1 h,e,f){if(!f){return}var g=this.element.retrieve("validator");if(h||(g&&!g.options.stopOnFailure)){f.stop();this.send()}},onSubmit:function(d){var c=this.element.retrieve("validator");if(c){this.element.removeEvent("submit",this.onSubmit);c.addEvent("onFormValidate",this.onFormValidate);c.validate(d);return}if(d){d.stop()}this.send()},saveClickedButton:function(d,f){var e=f.get("name");if(!e||!this.options.sendButtonClicked){return}this.options.extraData[e]=f.get("value")||true;this.clickedCleaner=function(){delete this.options.extraData[e];this.clickedCleaner=function(){}}.bind(this)},clickedCleaner:function(){},send:function(){var c=this.element.toQueryString().trim(),d=Object.toQueryString(this.options.extraData);if(c){c+="&"+d}else{c=d}this.fireEvent("send",[this.element,c.parseQueryString()]);this.request.send({data:c,url:this.options.requestOptions.url||this.element.get("action")});this.clickedCleaner();return this}});Element.implement("formUpdate",function(f,d){var e=this.retrieve("form.request");if(!e){e=new Form.Request(this,f,d)}else{if(f){e.setTarget(f)}if(d){e.setOptions(d).makeRequest()}}e.send();return this})})();(function(){var b=function(e){var a=e.options.hideInputs;if(window.OverText){var f=[null];OverText.each(function(c){f.include("."+c.options.labelClass)});if(f){a+=f.join(", ")}}return(a)?e.element.getElements(a):null};Fx.Reveal=new Class({Extends:Fx.Morph,options:{link:"cancel",styles:["padding","border","margin"],transitionOpacity:"opacity" in document.documentElement,mode:"vertical",display:function(){return this.element.get("tag")!="tr"?"block":"table-rowturn""});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