0.99){b=1}if(d>0.99){d=1}a.fireEvent("handledrag",b,d)},onMouseDown:function(d){var c=this,b=c.getView(),a=b.down("#dragHandle");a.setY(d.getY());a.setX(d.getX());c.onHandleDrag();a.dd.onMouseDown(d,a.dd.el)},onDragStart:function(d){var c=this,b=c.getView(),a=b.down("#dragHandle");a.dd.onDragStart(d,a.dd.el)},onMapClick:function(h){var d=this,c=d.getView(),a=c.down("#dragHandle"),i=c.getXY(),b=h.getXY(),g,f;g=b[0]-i[0];f=b[1]-i[1];a.getEl().setStyle({left:g+"px",top:f+"px"});d.onHandleDrag()},onColorBindingChanged:function(a){var k=this,d=k.getViewModel(),f=d.get("selectedColor"),g,b=k.getView(),j=b.down("#dragHandle"),i=b.getEl(),m=i.getWidth(),n=i.getHeight(),c,h,e,l;g=Ext.ux.colorpick.ColorUtils.rgb2hsv(f.r,f.g,f.b);c=g.s;e=m*c;h=1-g.v;l=n*h;j.getEl().setStyle({left:e+"px",top:l+"px"})},onHueBindingChanged:function(b){var e=this,c=e.getViewModel(),a,d;a=Ext.ux.colorpick.ColorUtils.hsv2rgb(b,1,1);d=Ext.ux.colorpick.ColorUtils.rgb2hex(a.r,a.g,a.b);e.getView().getEl().applyStyles({"background-color":"#"+d})}});Ext.define("Ext.ux.colorpick.ColorMap",{extend:"Ext.container.Container",alias:"widget.colorpickercolormap",controller:"colorpickercolormapcontroller",requires:["Ext.ux.colorpick.ColorMapController"],cls:Ext.baseCSSPrefix+"colorpicker-colormap",items:[{xtype:"component",cls:Ext.baseCSSPrefix+"colorpicker-colormap-draghandle-container",itemId:"dragHandle",width:1,height:1,draggable:true,html:''}],listeners:{boxready:{single:true,fn:"onFirstBoxReady",scope:"controller"},colorbindingchanged:{fn:"onColorBindingChanged",scope:"controller"},huebindingchanged:{fn:"onHueBindingChanged",scope:"controller"}},afterRender:function(){var b=this,c=b.mapGradientUrl,a=b.el;b.callParent();if(!c){c=a.getStyle("background-image");c=c.substring(4,c.length-1);if(c.indexOf('"')===0){c=c.substring(1,c.length-1)}Ext.ux.colorpick.ColorMap.prototype.mapGradientUrl=c}a.setStyle("background-image","none");a=b.layout.getElementTarget();a.createChild({tag:"img",cls:Ext.baseCSSPrefix+"colorpicker-colormap-blender",src:c})},setPosition:function(c){var b=this,a=b.down("#dragHandle");if(!a.dd||!a.dd.constrain){return}if(typeof a.dd.dragEnded!=="undefined"&&!a.dd.dragEnded){return}b.fireEvent("colorbindingchanged",c)},setHue:function(a){var b=this;if(!b.getEl()){return}b.fireEvent("huebindingchanged",a)}});Ext.define("Ext.ux.colorpick.SelectorModel",{extend:"Ext.app.ViewModel",alias:"viewmodel.colorpick-selectormodel",requires:["Ext.ux.colorpick.ColorUtils"],data:{selectedColor:{r:255,g:255,b:255,h:0,s:1,v:1,a:1},previousColor:{r:0,g:0,b:0,h:0,s:1,v:1,a:1}},formulas:{hex:{get:function(d){var f=d("selectedColor.r").toString(16),e=d("selectedColor.g").toString(16),c=d("selectedColor.b").toString(16),a;a=Ext.ux.colorpick.ColorUtils.rgb2hex(f,e,c);return"#"+a},set:function(b){var a=Ext.ux.colorpick.ColorUtils.hex2rgb(b);this.changeRGB(a)}},red:{get:function(a){return a("selectedColor.r")},set:function(a){this.changeRGB({r:a})}},green:{get:function(a){return a("selectedColor.g")},set:function(a){this.changeRGB({g:a})}},blue:{get:function(a){return a("selectedColor.b")},set:function(a){this.changeRGB({b:a})}},hue:{get:function(a){return a("selectedColor.h")*360},set:function(a){this.changeHSV({h:a/360})}},saturation:{get:function(a){return a("selectedColor.s")*100},set:function(a){this.changeHSV({s:a/100})}},value:{get:function(b){var a=b("selectedColor.v");return a*100},set:function(a){this.changeHSV({v:a/100})}},alpha:{get:function(c){var b=c("selectedColor.a");return b*100},set:function(a){this.set("selectedColor",Ext.applyIf({a:a/100},this.data.selectedColor))}}},changeHSV:function(b){Ext.applyIf(b,this.data.selectedColor);var a=Ext.ux.colorpick.ColorUtils.hsv2rgb(b.h,b.s,b.v);b.r=a.r;b.g=a.g;b.b=a.b;this.set("selectedColor",b)},changeRGB:function(b){Ext.applyIf(b,this.data.selectedColor);var a=Ext.ux.colorpick.ColorUtils.rgb2hsv(b.r,b.g,b.b);b.h=a.h;b.s=a.s;b.v=a.v;this.set("selectedColor",b)}});Ext.define("Ext.ux.colorpick.SelectorController",{extend:"Ext.app.ViewController",alias:"controller.colorpick-selectorcontroller",requires:["Ext.ux.colorpick.ColorUtils"],destroy:function(){var c=this,b=c.getView(),a=b.childViewModel;if(a){a.destroy();b.childViewModel=null}c.callParent()},changeHSV:function(d){var a=this.getView(),b=a.getColor(),c;Ext.applyIf(d,b);c=Ext.ux.colorpick.ColorUtils.hsv2rgb(d.h,d.s,d.v);Ext.apply(d,c);a.setColor(d)},onColorMapHandleDrag:function(b,a){this.changeHSV({s:b,v:1-a})},onValueSliderHandleDrag:function(a){this.changeHSV({v:1-a})},onSaturationSliderHandleDrag:function(a){this.changeHSV({s:1-a})},onHueSliderHandleDrag:function(a){this.changeHSV({h:1-a})},onAlphaSliderHandleDrag:function(c){var a=this.getView(),b=a.getColor(),d=Ext.applyIf({a:1-c},b);a.setColor(d);a.el.repaint()},onPreviousColorSelected:function(c,b){var a=this.getView();a.setColor(b)},onOK:function(){var b=this,a=b.getView();a.fireEvent("ok",a,a.getValue())},onCancel:function(){this.fireViewEvent("cancel",this.getView())},onResize:function(){var j=this,c=j.getView(),i=c.childViewModel,e=j.getReferences(),g,f,d,b;if(!j.hasResizedOnce){j.hasResizedOnce=true;return}g=i.get("hue");f=i.get("saturation");d=i.get("value");b=i.get("alpha");e.colorMap.setPosition(i.getData());e.hueSlider.setHue(g);e.satSlider.setSaturation(f);e.valueSlider.setValue(d);e.alphaSlider.setAlpha(b)}});Ext.define("Ext.ux.colorpick.ColorPreview",{extend:"Ext.Component",alias:"widget.colorpickercolorpreview",requires:["Ext.util.Format"],style:"position: relative",html:'',cls:Ext.baseCSSPrefix+"colorpreview",height:256,onRender:function(){var a=this;a.callParent(arguments);a.mon(a.el.down(".btn"),"click",a.onClick,a)},onClick:function(){this.fireEvent("click",this,this.color)},setColor:function(a){var c=this,b=c.getEl();if(!b){return}c.color=a;c.applyBgStyle(a)},bgStyleTpl:Ext.create("Ext.XTemplate",Ext.isIE&&Ext.ieVersion<10?"filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr='#{hexAlpha}{hex}', endColorstr='#{hexAlpha}{hex}');":"background: {rgba};"),applyBgStyle:function(g){var i=this,a=Ext.ux.colorpick.ColorUtils,b="."+Ext.baseCSSPrefix+"colorpreview-filter",c=i.getEl().down(b),d,e,f,h;d=a.rgb2hex(g.r,g.g,g.b);e=Ext.util.Format.hex(Math.floor(g.a*255),2);f=a.getRGBAString(g);h=this.bgStyleTpl.apply({hex:d,hexAlpha:e,rgba:f});c.applyStyles(h)}});Ext.define("Ext.ux.colorpick.SliderController",{extend:"Ext.app.ViewController",alias:"controller.colorpick-slidercontroller",boxReady:function(d){var e=this,c=e.getDragContainer(),b=e.getDragHandle(),a=b.dd;a.constrain=true;a.constrainTo=c.getEl();a.initialConstrainTo=a.constrainTo;a.on("drag",e.onHandleDrag,e)},getDragHandle:function(){return this.view.lookupReference("dragHandle")},getDragContainer:function(){return this.view.lookupReference("dragHandleContainer")},onHandleDrag:function(d){var g=this,i=g.getView(),a=g.getDragContainer(),f=g.getDragHandle(),h=f.getY()-a.getY(),c=a.getEl(),j=c.getHeight(),b=h/j;if(b>0.99){b=1}i.fireEvent("handledrag",b)},onMouseDown:function(c){var b=this,a=b.getDragHandle(),d=c.getY();a.setY(d);b.onHandleDrag();a.el.repaint();a.dd.onMouseDown(c,a.dd.el)},onDragStart:function(c){var b=this,a=b.getDragHandle();a.dd.onDragStart(c,a.dd.el)},onMouseUp:function(){var a=this.getDragHandle();a.dd.dragEnded=true}});Ext.define("Ext.ux.colorpick.Slider",{extend:"Ext.container.Container",xtype:"colorpickerslider",controller:"colorpick-slidercontroller",afterRender:function(){this.callParent(arguments);var a=this.width,c=this.lookupReference("dragHandleContainer"),b=c.getWidth();c.el.setStyle("left",((a-b)/2)+"px")},baseCls:Ext.baseCSSPrefix+"colorpicker-slider",requires:["Ext.ux.colorpick.SliderController"],referenceHolder:true,listeners:{element:"el",mousedown:"onMouseDown",mouseup:"onMouseUp",dragstart:"onDragStart"},items:{xtype:"container",cls:Ext.baseCSSPrefix+"colorpicker-draghandle-container",reference:"dragHandleContainer",height:"100%",items:{xtype:"component",cls:Ext.baseCSSPrefix+"colorpicker-draghandle-outer",reference:"dragHandle",width:"100%",height:1,draggable:true,html:''}},getDragHandle:function(){return this.lookupReference("dragHandle")},getDragContainer:function(){return this.lookupReference("dragHandleContainer")}});Ext.define("Ext.ux.colorpick.SliderAlpha",{extend:"Ext.ux.colorpick.Slider",alias:"widget.colorpickerslideralpha",cls:Ext.baseCSSPrefix+"colorpicker-alpha",requires:["Ext.XTemplate"],gradientStyleTpl:Ext.create("Ext.XTemplate",Ext.isIE&&Ext.ieVersion<10?"filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr='#FF{hex}', endColorstr='#00{hex}');":"background: -moz-linear-gradient(top, rgba({r}, {g}, {b}, 1) 0%, rgba({r}, {g}, {b}, 0) 100%);background: -webkit-linear-gradient(top,rgba({r}, {g}, {b}, 1) 0%, rgba({r}, {g}, {b}, 0) 100%);background: -o-linear-gradient(top, rgba({r}, {g}, {b}, 1) 0%, rgba({r}, {g}, {b}, 0) 100%);background: -ms-linear-gradient(top, rgba({r}, {g}, {b}, 1) 0%, rgba({r}, {g}, {b}, 0) 100%);background: linear-gradient(to bottom, rgba({r}, {g}, {b}, 1) 0%, rgba({r}, {g}, {b}, 0) 100%);"),setAlpha:function(g){var d=this,b=d.getDragContainer(),a=d.getDragHandle(),f=b.getEl(),e=f.getHeight(),c,h;if(!a.dd||!a.dd.constrain){return}if(typeof a.dd.dragEnded!=="undefined"&&!a.dd.dragEnded){return}h=e*(1-(g/100));c=a.getEl();c.setStyle({top:h+"px"})},setColor:function(b){var e=this,a=e.getDragContainer(),d,c;if(!e.getEl()){return}d=Ext.ux.colorpick.ColorUtils.rgb2hex(b.r,b.g,b.b);c=a.getEl().first();c.applyStyles(e.gradientStyleTpl.apply({hex:d,r:b.r,g:b.g,b:b.b}))}});Ext.define("Ext.ux.colorpick.SliderSaturation",{extend:"Ext.ux.colorpick.Slider",alias:"widget.colorpickerslidersaturation",cls:Ext.baseCSSPrefix+"colorpicker-saturation",gradientStyleTpl:Ext.create("Ext.XTemplate",Ext.isIE&&Ext.ieVersion<10?"filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr='#{hex}', endColorstr='#ffffff');":"background: -mox-linear-gradient(top, #{hex} 0%, #ffffff 100%);background: -webkit-linear-gradient(top, #{hex} 0%,#ffffff 100%);background: -o-linear-gradient(top, #{hex} 0%,#ffffff 100%);background: -ms-linear-gradient(top, #{hex} 0%,#ffffff 100%);background: linear-gradient(to bottom, #{hex} 0%,#ffffff 100%);"),setSaturation:function(e){var d=this,b=d.getDragContainer(),a=d.getDragHandle(),g=b.getEl(),f=g.getHeight(),c,h;if(!a.dd||!a.dd.constrain){return}if(typeof a.dd.dragEnded!=="undefined"&&!a.dd.dragEnded){return}c=1-(e/100);h=f*c;a.getEl().setStyle({top:h+"px"})},setHue:function(b){var e=this,a=e.getDragContainer(),c,d;if(!e.getEl()){return}c=Ext.ux.colorpick.ColorUtils.hsv2rgb(b,1,1);d=Ext.ux.colorpick.ColorUtils.rgb2hex(c.r,c.g,c.b);a.getEl().applyStyles(e.gradientStyleTpl.apply({hex:d}))}});Ext.define("Ext.ux.colorpick.SliderValue",{extend:"Ext.ux.colorpick.Slider",alias:"widget.colorpickerslidervalue",cls:Ext.baseCSSPrefix+"colorpicker-value",requires:["Ext.XTemplate"],gradientStyleTpl:Ext.create("Ext.XTemplate",Ext.isIE&&Ext.ieVersion<10?"filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr='#{hex}', endColorstr='#000000');":"background: -mox-linear-gradient(top, #{hex} 0%, #000000 100%);background: -webkit-linear-gradient(top, #{hex} 0%,#000000 100%);background: -o-linear-gradient(top, #{hex} 0%,#000000 100%);background: -ms-linear-gradient(top, #{hex} 0%,#000000 100%);background: linear-gradient(to bottom, #{hex} 0%,#000000 100%);"),setValue:function(g){var d=this,b=d.getDragContainer(),a=d.getDragHandle(),f=b.getEl(),e=f.getHeight(),c,h;if(!a.dd||!a.dd.constrain){return}if(typeof a.dd.dragEnded!=="undefined"&&!a.dd.dragEnded){return}c=1-(g/100);h=e*c;a.getEl().setStyle({top:h+"px"})},setHue:function(b){var e=this,a=e.getDragContainer(),c,d;if(!e.getEl()){return}c=Ext.ux.colorpick.ColorUtils.hsv2rgb(b,1,1);d=Ext.ux.colorpick.ColorUtils.rgb2hex(c.r,c.g,c.b);a.getEl().applyStyles(e.gradientStyleTpl.apply({hex:d}))}});Ext.define("Ext.ux.colorpick.SliderHue",{extend:"Ext.ux.colorpick.Slider",alias:"widget.colorpickersliderhue",cls:Ext.baseCSSPrefix+"colorpicker-hue",afterRender:function(){var b=this,c=b.gradientUrl,a=b.el;b.callParent();if(!c){c=a.getStyle("background-image");c=c.substring(4,c.length-1);if(c.indexOf('"')===0){c=c.substring(1,c.length-1)}Ext.ux.colorpick.SliderHue.prototype.gradientUrl=c}a.setStyle("background-image","none");a=b.getDragContainer().layout.getElementTarget();a.createChild({tag:"img",cls:Ext.baseCSSPrefix+"colorpicker-hue-gradient",src:c})},setHue:function(c){var e=this,b=e.getDragContainer(),a=e.getDragHandle(),g=b.getEl(),f=g.getHeight(),d,h;if(!a.dd||!a.dd.constrain){return}if(typeof a.dd.dragEnded!=="undefined"&&!a.dd.dragEnded){return}h=f*(1-c);d=a.getEl();d.setStyle({top:h+"px"})}});Ext.define("Ext.ux.colorpick.Selector",{extend:"Ext.container.Container",xtype:"colorselector",mixins:["Ext.ux.colorpick.Selection"],controller:"colorpick-selectorcontroller",requires:["Ext.layout.container.HBox","Ext.form.field.Text","Ext.form.field.Number","Ext.ux.colorpick.ColorMap","Ext.ux.colorpick.SelectorModel","Ext.ux.colorpick.SelectorController","Ext.ux.colorpick.ColorPreview","Ext.ux.colorpick.Slider","Ext.ux.colorpick.SliderAlpha","Ext.ux.colorpick.SliderSaturation","Ext.ux.colorpick.SliderValue","Ext.ux.colorpick.SliderHue"],width:580,height:337,cls:Ext.baseCSSPrefix+"colorpicker",padding:10,layout:{type:"hbox",align:"stretch"},defaultBindProperty:"value",twoWayBindable:["value"],fieldWidth:50,fieldPad:5,showPreviousColor:false,showOkCancelButtons:false,listeners:{resize:"onResize"},constructor:function(b){var c=this,a=Ext.Factory.viewModel("colorpick-selectormodel");c.childViewModel=a;c.items=[c.getMapAndHexRGBFields(a),c.getSliderAndHField(a),c.getSliderAndSField(a),c.getSliderAndVField(a),c.getSliderAndAField(a),c.getPreviewAndButtons(a,b)];c.childViewModel.bind("{selectedColor}",function(d){c.setColor(d)});c.callParent(arguments)},updateColor:function(a){var b=this;b.mixins.colorselection.updateColor.call(b,a);b.childViewModel.set("selectedColor",a)},updatePreviousColor:function(a){this.childViewModel.set("previousColor",a)},getMapAndHexRGBFields:function(a){var c=this,d={top:0,right:c.fieldPad,bottom:0,left:0},b=c.fieldWidth;return{xtype:"container",viewModel:a,cls:Ext.baseCSSPrefix+"colorpicker-escape-overflow",flex:1,layout:{type:"vbox",align:"stretch"},margin:"0 10 0 0",items:[{xtype:"colorpickercolormap",reference:"colorMap",flex:1,bind:{position:{bindTo:"{selectedColor}",deep:true},hue:"{selectedColor.h}"},listeners:{handledrag:"onColorMapHandleDrag"}},{xtype:"container",layout:"hbox",defaults:{labelAlign:"top",labelSeparator:"",allowBlank:false,onChange:function(){if(this.isValid()){Ext.form.field.Base.prototype.onChange.apply(this,arguments)}}},items:[{xtype:"textfield",fieldLabel:"HEX",flex:1,bind:"{hex}",margin:d,readOnly:true},{xtype:"numberfield",fieldLabel:"R",bind:"{red}",width:b,hideTrigger:true,maxValue:255,minValue:0,margin:d},{xtype:"numberfield",fieldLabel:"G",bind:"{green}",width:b,hideTrigger:true,maxValue:255,minValue:0,margin:d},{xtype:"numberfield",fieldLabel:"B",bind:"{blue}",width:b,hideTrigger:true,maxValue:255,minValue:0,margin:0}]}]}},getSliderAndHField:function(a){var c=this,b=c.fieldWidth;return{xtype:"container",viewModel:a,cls:Ext.baseCSSPrefix+"colorpicker-escape-overflow",width:b,layout:{type:"vbox",align:"stretch"},items:[{xtype:"colorpickersliderhue",reference:"hueSlider",flex:1,bind:{hue:"{selectedColor.h}"},width:b,listeners:{handledrag:"onHueSliderHandleDrag"}},{xtype:"numberfield",fieldLabel:"H",labelAlign:"top",labelSeparator:"",bind:"{hue}",hideTrigger:true,maxValue:360,minValue:0,allowBlank:false,margin:0}]}},getSliderAndSField:function(a){var c=this,b=c.fieldWidth;return{xtype:"container",viewModel:a,cls:Ext.baseCSSPrefix+"colorpicker-escape-overflow",width:b,layout:{type:"vbox",align:"stretch"},margin:{right:c.fieldPad,left:c.fieldPad},items:[{xtype:"colorpickerslidersaturation",reference:"satSlider",flex:1,bind:{saturation:"{saturation}",hue:"{selectedColor.h}"},width:b,listeners:{handledrag:"onSaturationSliderHandleDrag"}},{xtype:"numberfield",fieldLabel:"S",labelAlign:"top",labelSeparator:"",bind:"{saturation}",hideTrigger:true,maxValue:100,minValue:0,allowBlank:false,margin:0}]}},getSliderAndVField:function(a){var c=this,b=c.fieldWidth;return{xtype:"container",viewModel:a,cls:Ext.baseCSSPrefix+"colorpicker-escape-overflow",width:b,layout:{type:"vbox",align:"stretch"},items:[{xtype:"colorpickerslidervalue",reference:"valueSlider",flex:1,bind:{value:"{value}",hue:"{selectedColor.h}"},width:b,listeners:{handledrag:"onValueSliderHandleDrag"}},{xtype:"numberfield",fieldLabel:"V",labelAlign:"top",labelSeparator:"",bind:"{value}",hideTrigger:true,maxValue:100,minValue:0,allowBlank:false,margin:0}]}},getSliderAndAField:function(a){var c=this,b=c.fieldWidth;return{xtype:"container",viewModel:a,cls:Ext.baseCSSPrefix+"colorpicker-escape-overflow",width:b,layout:{type:"vbox",align:"stretch"},margin:{left:c.fieldPad},items:[{xtype:"colorpickerslideralpha",reference:"alphaSlider",flex:1,bind:{alpha:"{alpha}",color:{bindTo:"{selectedColor}",deep:true}},width:b,listeners:{handledrag:"onAlphaSliderHandleDrag"}},{xtype:"numberfield",fieldLabel:"A",labelAlign:"top",labelSeparator:"",bind:"{alpha}",hideTrigger:true,maxValue:100,minValue:0,allowBlank:false,margin:0}]}},getPreviewAndButtons:function(a,c){var b=[{xtype:"colorpickercolorpreview",flex:1,bind:{color:{bindTo:"{selectedColor}",deep:true}}}];if(c.showPreviousColor){b.push({xtype:"colorpickercolorpreview",flex:1,bind:{color:{bindTo:"{previousColor}",deep:true}},listeners:{click:"onPreviousColorSelected"}})}if(c.showOkCancelButtons){b.push({xtype:"button",text:"OK",margin:"10 0 0 0",handler:"onOK"},{xtype:"button",text:"Cancel",margin:"10 0 0 0",handler:"onCancel"})}return{xtype:"container",viewModel:a,width:70,margin:"0 0 0 10",items:b,layout:{type:"vbox",align:"stretch"}}}});Ext.define("Ext.ux.colorpick.ButtonController",{extend:"Ext.app.ViewController",alias:"controller.colorpick-buttoncontroller",requires:["Ext.window.Window","Ext.layout.container.Fit","Ext.ux.colorpick.Selector","Ext.ux.colorpick.ColorUtils"],afterRender:function(a){a.updateColor(a.getColor())},destroy:function(){var a=this.getView(),b=a.colorPickerWindow;if(b){b.destroy();a.colorPickerWindow=a.colorPicker=null}this.callParent()},getPopup:function(){var c=this.getView(),b=c.colorPickerWindow,a;if(!b){b=Ext.create(c.getPopup());c.colorPickerWindow=b;b.colorPicker=c.colorPicker=a=b.lookupReference("selector");a.setFormat(c.getFormat());a.on({ok:"onColorPickerOK",cancel:"onColorPickerCancel",scope:this});b.on({close:"onColorPickerCancel",scope:this})}return b},onClick:function(){var e=this,c=e.getView(),d=c.getColor(),b=e.getPopup(),a=b.colorPicker;a.setColor(d);a.setPreviousColor(d);b.showBy(c,"tl-br?")},onColorPickerOK:function(c){var a=this.getView(),b=c.getColor(),d=a.colorPickerWindow;d.hide();a.setColor(b)},onColorPickerCancel:function(){var a=this.getView(),b=a.colorPickerWindow;b.hide()},syncColor:function(b){var a=this.getView();Ext.ux.colorpick.ColorUtils.setBackground(a.filterEl,b)}});Ext.define("Ext.ux.colorpick.Button",{extend:"Ext.Component",xtype:"colorbutton",controller:"colorpick-buttoncontroller",mixins:["Ext.ux.colorpick.Selection"],requires:["Ext.ux.colorpick.ButtonController"],baseCls:Ext.baseCSSPrefix+"colorpicker-button",width:20,height:20,childEls:["btnEl","filterEl"],config:{popup:{lazy:true,$value:{xtype:"window",closeAction:"hide",referenceHolder:true,minWidth:540,minHeight:200,layout:"fit",header:false,resizable:true,items:{xtype:"colorselector",reference:"selector",showPreviousColor:true,showOkCancelButtons:true}}}},defaultBindProperty:"value",twoWayBindable:"value",renderTpl:'',listeners:{click:"onClick",element:"btnEl"},updateColor:function(a){var b=this,c=b.colorPicker;b.mixins.colorselection.updateColor.call(b,a);Ext.ux.colorpick.ColorUtils.setBackground(b.filterEl,a);if(c){c.setColor(a)}},updateFormat:function(b){var a=this.colorPicker;if(a){a.setFormat(b)}}});Ext.define("Ext.ux.colorpick.Field",{extend:"Ext.form.field.Picker",xtype:"colorfield",mixins:["Ext.ux.colorpick.Selection"],requires:["Ext.window.Window","Ext.ux.colorpick.Selector","Ext.ux.colorpick.ColorUtils","Ext.layout.container.Fit"],editable:false,matchFieldWidth:false,beforeBodyEl:[''],cls:Ext.baseCSSPrefix+"colorpicker-field",childEls:["swatchEl"],config:{popup:{lazy:true,$value:{xtype:"window",closeAction:"hide",referenceHolder:true,minWidth:540,minHeight:200,layout:"fit",header:false,resizable:true,items:{xtype:"colorselector",reference:"selector",showPreviousColor:true,showOkCancelButtons:true}}}},afterRender:function(){this.callParent();this.updateValue(this.value)},createPicker:function(){var c=this,a=c.getPopup(),b;c.colorPickerWindow=a=Ext.create(a);c.colorPicker=b=a.lookupReference("selector");b.setFormat(c.getFormat());b.setColor(c.getColor());b.on({ok:"onColorPickerOK",cancel:"onColorPickerCancel",scope:c});a.on({close:"onColorPickerCancel",scope:c});return c.colorPickerWindow},onColorPickerOK:function(a){this.setColor(a.getColor());this.collapse()},onColorPickerCancel:function(){this.collapse()},onExpand:function(){var a=this.getColor();this.colorPicker.setPreviousColor(a)},setValue:function(a){var b=this,d=b.applyValue(a);b.callParent([d]);b.updateValue(d)},updateFormat:function(b){var a=this.colorPicker;if(a){a.setFormat(b)}},updateValue:function(a){var b=this,d;if(!b.syncing){b.syncing=true;b.setColor(a);b.syncing=false}d=b.getColor();Ext.ux.colorpick.ColorUtils.setBackground(b.swatchEl,d);if(b.colorPicker){b.colorPicker.setColor(d)}}});Ext.define("Ext.ux.data.PagingMemoryProxy",{extend:"Ext.data.proxy.Memory",alias:"proxy.pagingmemory",alternateClassName:"Ext.data.PagingMemoryProxy",constructor:function(){Ext.log.warn("Ext.ux.data.PagingMemoryProxy functionality has been merged into Ext.data.proxy.Memory by using the enablePaging flag.");this.callParent(arguments)},read:function(c,g,h){var d=this.getReader(),i=d.read(this.data),e,a,f,b;h=h||this;a=c.filters;if(a.length>0){b=[];Ext.each(i.records,function(j){var o=true,p=a.length,k;for(k=0;k0){f=function(l,k){var j=e[0].sort(l,k),n=e.length,m;for(m=1;m
',' ','{name}',"","",''],taskbarConfig:null,windowMenu:null,initComponent:function(){var b=this;b.windowMenu=new Ext.menu.Menu(b.createWindowMenu());b.bbar=b.taskbar=new Ext.ux.desktop.TaskBar(b.taskbarConfig);b.taskbar.windowMenu=b.windowMenu;b.windows=new Ext.util.MixedCollection();b.contextMenu=new Ext.menu.Menu(b.createDesktopMenu());b.items=[{xtype:"wallpaper",id:b.id+"_wallpaper"},b.createDataView()];b.callParent();b.shortcutsView=b.items.getAt(1);b.shortcutsView.on("itemclick",b.onShortcutItemClick,b);var a=b.wallpaper;b.wallpaper=b.items.getAt(0);if(a){b.setWallpaper(a,b.wallpaperStretch)}},afterRender:function(){var a=this;a.callParent();a.el.on("contextmenu",a.onDesktopMenu,a)},createDataView:function(){var a=this;return{xtype:"dataview",overItemCls:"x-view-over",trackOver:true,itemSelector:a.shortcutItemSelector,store:a.shortcuts,style:{position:"absolute"},x:0,y:0,tpl:new Ext.XTemplate(a.shortcutTpl)}},createDesktopMenu:function(){var b=this,a={items:b.contextMenuItems||[]};if(a.items.length){a.items.push("-")}a.items.push({text:"Tile",handler:b.tileWindows,scope:b,minWindows:1},{text:"Cascade",handler:b.cascadeWindows,scope:b,minWindows:1});return a},createWindowMenu:function(){var a=this;return{defaultAlign:"br-tr",items:[{text:"Restore",handler:a.onWindowMenuRestore,scope:a},{text:"Minimize",handler:a.onWindowMenuMinimize,scope:a},{text:"Maximize",handler:a.onWindowMenuMaximize,scope:a},"-",{text:"Close",handler:a.onWindowMenuClose,scope:a}],listeners:{beforeshow:a.onWindowMenuBeforeShow,hide:a.onWindowMenuHide,scope:a}}},onDesktopMenu:function(b){var a=this,c=a.contextMenu;b.stopEvent();if(!c.rendered){c.on("beforeshow",a.onDesktopMenuBeforeShow,a)}c.showAt(b.getXY());c.doConstrain()},onDesktopMenuBeforeShow:function(c){var b=this,a=b.windows.getCount();c.items.each(function(e){var d=e.minWindows||0;e.setDisabled(a ",'1)?c:a;e.windows.each(function(g){var f=g.dd,h=g.resizer;f.xTickSize=a;f.yTickSize=d;h.widthIncrement=a;h.heightIncrement=d})},setWallpaper:function(b,a){this.wallpaper.setWallpaper(b,a);return this},cascadeWindows:function(){var a=0,c=0,b=this.getDesktopZIndexManager();b.eachBottomUp(function(d){if(d.isWindow&&d.isVisible()&&!d.maximized){d.setPosition(a,c);a+=20;c+=20}})},createWindow:function(c,b){var d=this,e,a=Ext.applyIf(c||{},{stateful:false,isWindow:true,constrainHeader:true,minimizable:true,maximizable:true});b=b||Ext.window.Window;e=d.add(new b(a));d.windows.add(e);e.taskButton=d.taskbar.addTaskButton(e);e.animateTarget=e.taskButton.el;e.on({activate:d.updateActiveWindow,beforeshow:d.updateActiveWindow,deactivate:d.updateActiveWindow,minimize:d.minimizeWindow,destroy:d.onWindowClose,scope:d});e.on({boxready:function(){e.dd.xTickSize=d.xTickSize;e.dd.yTickSize=d.yTickSize;if(e.resizer){e.resizer.widthIncrement=d.xTickSize;e.resizer.heightIncrement=d.yTickSize}},single:true});e.doClose=function(){e.doClose=Ext.emptyFn;e.el.disableShadow();e.el.fadeOut({listeners:{afteranimate:function(){e.destroy()}}})};return e},getActiveWindow:function(){var b=null,a=this.getDesktopZIndexManager();if(a){a.eachTopDown(function(c){if(c.isWindow&&!c.hidden){b=c;return false}return true})}return b},getDesktopZIndexManager:function(){var a=this.windows;return(a.getCount()&&a.getAt(0).zIndexManager)||null},getWindow:function(a){return this.windows.get(a)},minimizeWindow:function(a){a.minimized=true;a.hide()},restoreWindow:function(a){if(a.isVisible()){a.restore();a.toFront()}else{a.show()}return a},tileWindows:function(){var b=this,e=b.body.getWidth(true);var a=b.xTickSize,d=b.yTickSize,c=d;b.windows.each(function(g){if(g.isVisible()&&!g.maximized){var f=g.el.getWidth();if(a>b.xTickSize&&a+f>e){a=b.xTickSize;d=c}g.setPosition(a,d);a+=f+b.xTickSize;c=Math.max(c,d+g.el.getHeight()+b.yTickSize)}})},updateActiveWindow:function(){var b=this,c=b.getActiveWindow(),a=b.lastActiveWindow;if(a&&a.destroyed){b.lastActiveWindow=null;return}if(c===a){return}if(a){if(a.el.dom){a.addCls(b.inactiveWindowCls);a.removeCls(b.activeWindowCls)}a.active=false}b.lastActiveWindow=c;if(c){c.addCls(b.activeWindowCls);c.removeCls(b.inactiveWindowCls);c.minimized=false;c.active=true}b.taskbar.setActiveButton(c&&c.taskButton)}});Ext.define("Ext.ux.desktop.App",{mixins:{observable:"Ext.util.Observable"},requires:["Ext.container.Viewport","Ext.ux.desktop.Desktop"],isReady:false,modules:null,useQuickTips:true,constructor:function(a){var b=this;b.mixins.observable.constructor.call(this,a);if(Ext.isReady){Ext.Function.defer(b.init,10,b)}else{Ext.onReady(b.init,b)}},init:function(){var b=this,a;if(b.useQuickTips){Ext.QuickTips.init()}b.modules=b.getModules();if(b.modules){b.initModules(b.modules)}a=b.getDesktopConfig();b.desktop=new Ext.ux.desktop.Desktop(a);b.viewport=new Ext.container.Viewport({layout:"fit",items:[b.desktop]});Ext.getWin().on("beforeunload",b.onUnload,b);b.isReady=true;b.fireEvent("ready",b)},getDesktopConfig:function(){var b=this,a={app:b,taskbarConfig:b.getTaskbarConfig()};Ext.apply(a,b.desktopConfig);return a},getModules:Ext.emptyFn,getStartConfig:function(){var b=this,a={app:b,menu:[]},c;Ext.apply(a,b.startConfig);Ext.each(b.modules,function(d){c=d.launcher;if(c){c.handler=c.handler||Ext.bind(b.createWindow,b,[d]);a.menu.push(d.launcher)}});return a},createWindow:function(a){var b=a.createWindow();b.show()},getTaskbarConfig:function(){var b=this,a={app:b,startConfig:b.getStartConfig()};Ext.apply(a,b.taskbarConfig);return a},initModules:function(a){var b=this;Ext.each(a,function(c){c.app=b})},getModule:function(d){var c=this.modules;for(var e=0,b=c.length;e',' ',''," ","{html}",""],initComponent:function(){var e=this,f,c,b,d;if(e.fallbackHTML){f=e.fallbackHTML}else{f="Your browser does not support HTML5 Video. ";if(Ext.isChrome){f+="Upgrade Chrome."}else{if(Ext.isGecko){f+="Upgrade to Firefox 3.5 or newer."}else{var a='Chrome';f+='Please try Firefox';if(Ext.isIE){f+=", "+a+' or Safari.'}else{f+=" or "+a+"."}}}}e.fallbackHTML=f;b=e.data=Ext.copyTo({tag:"video",html:f},e,"id,poster,start,loopstart,loopend,playcount,autobuffer,loop");if(e.autoplay){b.autoplay=1}if(e.controls){b.controls=1}if(Ext.isArray(e.src)){b.src=e.src}else{b.src=[{src:e.src}]}e.callParent()},afterRender:function(){var a=this;a.callParent();a.video=a.body.getById(a.id+"-video");el=a.video.dom;a.supported=(el&&el.tagName.toLowerCase()=="video");if(a.supported){a.video.on("error",a.onVideoError,a)}},getFallback:function(){return''+this.fallbackHTML+"
"},onVideoError:function(){var a=this;a.video.remove();a.supported=false;a.body.createChild(a.getFallback())},doDestroy:function(){var c=this;var b=c.video;if(c.supported&&b){var a=b.dom;if(a&&a.pause){a.pause()}b.remove();c.video=null}c.callParent()}}); /*! * Ext JS Library * Copyright(c) 2006-2014 Sencha Inc. * licensing@sencha.com * http://www.sencha.com/license */ Ext.define("Ext.ux.desktop.Wallpaper",{extend:"Ext.Component",alias:"widget.wallpaper",cls:"ux-wallpaper",html:'',stretch:false,wallpaper:null,stateful:true,stateId:"desk-wallpaper",afterRender:function(){var a=this;a.callParent();a.setWallpaper(a.wallpaper,a.stretch)},applyState:function(){var b=this,a=b.wallpaper;b.callParent(arguments);if(a!=b.wallpaper){b.setWallpaper(b.wallpaper)}},getState:function(){return this.wallpaper&&{wallpaper:this.wallpaper}},setWallpaper:function(b,a){var c=this,e,d;c.stretch=(a!==false);c.wallpaper=b;if(c.rendered){e=c.el.dom.firstChild;if(!b||b==Ext.BLANK_IMAGE_URL){Ext.fly(e).hide()}else{if(c.stretch){e.src=b;c.el.removeCls("ux-wallpaper-tiled");Ext.fly(e).setStyle({width:"100%",height:"100%"}).show()}else{Ext.fly(e).hide();d="url("+b+")";c.el.addCls("ux-wallpaper-tiled")}}c.el.setStyle({backgroundImage:d||""});if(c.stateful){c.saveState()}}return c}});Ext.define("Ext.ux.event.RecorderManager",{extend:"Ext.panel.Panel",alias:"widget.eventrecordermanager",uses:["Ext.ux.event.Recorder","Ext.ux.event.Player"],layout:"fit",buttonAlign:"left",eventsToIgnore:{mousemove:1,mouseover:1,mouseout:1},bodyBorder:false,playSpeed:1,initComponent:function(){var b=this;b.recorder=new Ext.ux.event.Recorder({attachTo:b.attachTo,listeners:{add:b.updateEvents,coalesce:b.updateEvents,buffer:200,scope:b}});b.recorder.eventsToRecord=Ext.apply({},b.recorder.eventsToRecord);function c(e,d){return{text:e,speed:d,group:"speed",checked:d==b.playSpeed,handler:b.onPlaySpeed,scope:b}}b.tbar=[{text:"Record",xtype:"splitbutton",whenIdle:true,handler:b.onRecord,scope:b,menu:b.makeRecordButtonMenu()},{text:"Play",xtype:"splitbutton",whenIdle:true,handler:b.onPlay,scope:b,menu:[c("Qarter Speed (0.25x)",0.25),c("Half Speed (0.5x)",0.5),c("3/4 Speed (0.75x)",0.75),"-",c("Recorded Speed (1x)",1),c("Double Speed (2x)",2),c("Quad Speed (4x)",4),"-",c("Full Speed",1000)]},{text:"Clear",whenIdle:true,handler:b.onClear,scope:b},"->",{text:"Stop",whenActive:true,disabled:true,handler:b.onStop,scope:b}];var a=b.attachTo&&b.attachTo.testEvents;b.items=[{xtype:"textarea",itemId:"eventView",fieldStyle:"font-family: monospace",selectOnFocus:true,emptyText:"Events go here!",value:a?b.stringifyEvents(a):"",scrollToBottom:function(){var d=this.inputEl.dom;d.scrollTop=d.scrollHeight}}];b.fbar=[{xtype:"tbtext",text:"Attached To: "+(b.attachTo&&b.attachTo.location.href)}];b.callParent()},makeRecordButtonMenu:function(){var b=[],c={},e=this.recorder.eventsToRecord,d=this.eventsToIgnore;Ext.Object.each(e,function(f,h){var g=c[h.kind];if(!g){c[h.kind]=g=[];b.push({text:h.kind,menu:g})}g.push({text:f,checked:true,handler:function(i){if(i.checked){e[f]=h}else{delete e[f]}}});if(d[f]){g[g.length-1].checked=false;Ext.Function.defer(function(){delete e[f]},1)}});function a(f,g){return(f.textb?d-b:0;a.setPosition(f,h)},onKeyPageDown:function(i){var h=this,b=h.pageSize,c=h.boundList,a=c.getNavigationModel(),g,d,f;g=c.getStore().getCount();d=a.recordIndex;f=d<(g-b)?d+b:g-1;a.setPosition(f,i)},isValid:function(){var b=this,a=b.disabled,c=b.forceValidation||!a;return c?b.validateValue(b.value):a},validateValue:function(b){var a=this,d=a.getErrors(b),c=Ext.isEmpty(d);if(!a.preventMark){if(c){a.clearInvalid()}else{a.markInvalid(d)}}return c},markInvalid:function(c){var b=this,a=b.getActiveError();b.setActiveErrors(Ext.Array.from(c));if(a!==b.getActiveError()){b.updateLayout()}},clearInvalid:function(){var b=this,a=b.hasActiveError();b.unsetActiveError();if(a){b.updateLayout()}},getSubmitData:function(){var a=this,b=null,c;if(!a.disabled&&a.submitValue&&!a.isFileUpload()){c=a.getSubmitValue();if(c!==null){b={};b[a.getName()]=c}}return b},getSubmitValue:function(){var b=this,a=b.delimiter,c=b.getValue();return Ext.isString(a)?c.join(a):c},getValue:function(){return this.value||[]},getRecordsForValue:function(g){var f=this,a=[],h=f.store.getRange(),l=f.valueField,d=0,k=h.length,b,c,e;for(e=g.length;d a.maxSelections){e.push(c(a.maxSelectionsText,a.maxSelections))}return e},doDestroy:function(){var a=this;a.bindStore(null);Ext.destroy(a.dragZone,a.dropZone,a.keyNav);a.callParent()},onBindStore:function(a){var c=this,b=this.boundList;if(a.autoCreated){c.resolveDisplayField()}if(!Ext.isDefined(c.valueField)){c.valueField=c.displayField}if(b){b.bindStore(a)}},resolveDisplayField:function(){var c=this,b=c.boundList,a=c.getStore();c.valueField=c.displayField="field1";if(!a.expanded){c.displayField="field2"}if(b){b.setDisplayField(c.displayField)}}});Ext.define("Ext.ux.form.ItemSelector",{extend:"Ext.ux.form.MultiSelect",alias:["widget.itemselectorfield","widget.itemselector"],alternateClassName:["Ext.ux.ItemSelector"],requires:["Ext.button.Button","Ext.ux.form.MultiSelect"],hideNavIcons:false,buttons:["top","up","add","remove","down","bottom"],buttonsText:{top:"Move to Top",up:"Move Up",add:"Add to Selected",remove:"Remove from Selected",down:"Move Down",bottom:"Move to Bottom"},layout:{type:"hbox",align:"stretch"},ariaRole:"group",initComponent:function(){var a=this;a.ddGroup=a.id+"-dd";a.ariaRenderAttributes=a.ariaRenderAttributes||{};a.ariaRenderAttributes["aria-labelledby"]=a.id+"-labelEl";a.callParent();a.bindStore(a.store)},createList:function(b){var a=this;return Ext.create("Ext.ux.form.MultiSelect",{submitValue:false,getSubmitData:function(){return null},getModelData:function(){return null},flex:1,dragGroup:a.ddGroup,dropGroup:a.ddGroup,title:b,store:{model:a.store.model,data:[]},displayField:a.displayField,valueField:a.valueField,disabled:a.disabled,listeners:{boundList:{scope:a,itemdblclick:a.onItemDblClick,drop:a.syncValue}}})},setupItems:function(){var a=this;a.fromField=a.createList(a.fromTitle);a.toField=a.createList(a.toTitle);return[a.fromField,{xtype:"toolbar",margin:"0 4",padding:0,layout:{type:"vbox",pack:"center"},items:a.createButtons()},a.toField]},createButtons:function(){var b=this,a=[];if(!b.hideNavIcons){Ext.Array.forEach(b.buttons,function(c){a.push({xtype:"button",ui:"default",tooltip:b.buttonsText[c],ariaLabel:b.buttonsText[c],handler:b["on"+Ext.String.capitalize(c)+"BtnClick"],cls:Ext.baseCSSPrefix+"form-itemselector-btn",iconCls:Ext.baseCSSPrefix+"form-itemselector-"+c,navBtn:true,scope:b,margin:"4 0 0 0"})})}return a},getSelections:function(b){var a=b.getStore();return Ext.Array.sort(b.getSelectionModel().getSelection(),function(d,c){d=a.indexOf(d);c=a.indexOf(c);if(d c){return 1}}return 0})},onTopBtnClick:function(){var c=this.toField.boundList,a=c.getStore(),b=this.getSelections(c);a.suspendEvents();a.remove(b,true);a.insert(0,b);a.resumeEvents();c.refresh();this.syncValue();c.getSelectionModel().select(b)},onBottomBtnClick:function(){var c=this.toField.boundList,a=c.getStore(),b=this.getSelections(c);a.suspendEvents();a.remove(b,true);a.add(b);a.resumeEvents();c.refresh();this.syncValue();c.getSelectionModel().select(b)},onUpBtnClick:function(){var f=this.toField.boundList,b=f.getStore(),e=this.getSelections(f),g,d=0,a=e.length,c=0;b.suspendEvents();for(;d-1;--c,b--){f=d[c];b=Math.min(b,a.indexOf(f)+1);a.remove(f,true);a.insert(b,f)}a.resumeEvents();e.refresh();this.syncValue();e.getSelectionModel().select(d)},onAddBtnClick:function(){var b=this,a=b.getSelections(b.fromField.boundList);b.moveRec(true,a);b.toField.boundList.getSelectionModel().select(a)},onRemoveBtnClick:function(){var b=this,a=b.getSelections(b.toField.boundList);b.moveRec(false,a);b.fromField.boundList.getSelectionModel().select(a)},moveRec:function(f,e){var c=this,g=c.fromField,a=c.toField,b=f?g.store:a.store,d=f?a.store:g.store;b.suspendEvents();d.suspendEvents();b.remove(e);d.add(e);b.resumeEvents();d.resumeEvents();if(g.boundList.containsFocus){g.boundList.focus()}g.boundList.refresh();a.boundList.refresh();c.syncValue()},syncValue:function(){var a=this;a.mixins.field.setValue.call(a,a.setupValue(a.toField.store.getRange()))},onItemDblClick:function(a,b){this.moveRec(a===this.fromField.boundList,b)},setValue:function(f){var d=this,g=d.fromField,a=d.toField,b=g.store,e=a.store,c;if(!d.fromStorePopulated){d.fromField.store.on({load:Ext.Function.bind(d.setValue,d,[f]),single:true});return}f=d.setupValue(f);d.mixins.field.setValue.call(d,f);c=d.getRecordsForValue(f);b.suspendEvents();e.suspendEvents();b.removeAll();e.removeAll();d.populateFromStore(d.store);Ext.Array.forEach(c,function(h){if(b.indexOf(h)>-1){b.remove(h)}e.add(h)});b.resumeEvents();e.resumeEvents();Ext.suspendLayouts();g.boundList.refresh();a.boundList.refresh();Ext.resumeLayouts(true)},onBindStore:function(b,c){var d=this,e=d.fromField,a=d.toField;if(e){e.store.removeAll();a.store.removeAll();if(b.autoCreated){e.resolveDisplayField();a.resolveDisplayField();d.resolveDisplayField()}if(!Ext.isDefined(d.valueField)){d.valueField=d.displayField}if(b.getCount()){d.populateFromStore(b)}else{d.store.on("load",d.populateFromStore,d)}}},populateFromStore:function(a){var b=this.fromField.store;this.fromStorePopulated=true;b.add(a.getRange());b.fireEvent("load",b)},onEnable:function(){var a=this;a.callParent();a.fromField.enable();a.toField.enable();Ext.Array.forEach(a.query("[navBtn]"),function(b){b.enable()})},onDisable:function(){var a=this;a.callParent();a.fromField.disable();a.toField.disable();Ext.Array.forEach(a.query("[navBtn]"),function(b){b.disable()})},doDestroy:function(){this.bindStore(null);this.callParent()}});Ext.define("Ext.ux.form.SearchField",{extend:"Ext.form.field.Text",alias:"widget.searchfield",triggers:{clear:{weight:0,cls:Ext.baseCSSPrefix+"form-clear-trigger",hidden:true,handler:"onClearClick",scope:"this"},search:{weight:1,cls:Ext.baseCSSPrefix+"form-search-trigger",handler:"onSearchClick",scope:"this"}},hasSearch:false,paramName:"query",initComponent:function(){var c=this,a=c.store,b;c.callParent(arguments);c.on("specialkey",function(d,g){if(g.getKey()==g.ENTER){c.onSearchClick()}});if(!a||!a.isStore){a=c.store=Ext.data.StoreManager.lookup(a)}a.setRemoteFilter(true);b=c.store.getProxy();b.setFilterParam(c.paramName);b.encodeFilters=function(d){return d[0].getValue()}},onClearClick:function(){var b=this,a=b.activeFilter;if(a){b.setValue("");b.store.getFilters().remove(a);b.activeFilter=null;b.getTrigger("clear").hide();b.updateLayout()}},onSearchClick:function(){var a=this,b=a.getValue();if(b.length>0){a.activeFilter=new Ext.util.Filter({property:a.paramName,value:b});a.store.getFilters().add(a.activeFilter);a.getTrigger("clear").show();a.updateLayout()}}});Ext.define("Ext.ux.grid.SubTable",{extend:"Ext.grid.plugin.RowExpander",alias:"plugin.subtable",rowBodyTpl:[' ',"{%","this.owner.renderTable(out, values);","%}","
"],init:function(d){var e=this,c=e.columns,a,b,f;e.callParent(arguments);e.columns=[];if(c){for(b=0,a=c.length;b");for(f=0;f',d[f].text,"")}g.push("");for(h=0;h");for(f=0;f ")},getRowBodyContentsFn:function(a){var b=this;return function(c){a.owner=b;return a.applyTemplate(c)}},getAssociatedRecords:function(a){return a[this.association]().getRange()}});Ext.define("Ext.ux.grid.TransformGrid",{extend:"Ext.grid.Panel",constructor:function(q,f){f=Ext.apply({},f);q=this.table=Ext.get(q);var j=f.fields||[],c=f.columns||[],k=[],m=[],e=q.query("thead th"),h=0,l=e.length,g=q.dom,b,p,n,d,o,a;for(;h',l,"")}g.push("")}g.push("a?a:c)}return c},onClick:function(a){var b=this.valueFromEvent(a);this.setValue(b)},onMouseEnter:function(){this.element.addCls(this.overCls)},onMouseLeave:function(){this.element.removeCls(this.overCls)},onMouseMove:function(a){var b=this.valueFromEvent(a);this.setTrackingValue(b)},updateFamily:function(a){this.element.setStyle("fontFamily","'"+a+"'")},updateGlyphs:function(){this.refreshGlyphs()},updateLimit:function(){this.refreshGlyphs()},updateScale:function(a){this.element.setStyle("fontSize",a)},updateTooltip:function(){this.refreshTooltip()},updateTooltipText:function(e){var d=this.innerEl,a=Ext.tip&&Ext.tip.QuickTipManager,b=a&&a.tip,c;if(a){d.dom.setAttribute("data-qtip",e);this.trackerEl.dom.setAttribute("data-qtip",e);c=b&&b.activeTarget;c=c&&c.el;if(c&&d.contains(c)){b.update(e)}}},updateTrackingValue:function(d){var c=this,a=c.trackerEl,b=c.valueToPercent(d);a.setStyle("width",b);c.refreshTooltip()},updateTrackOver:function(a){this.element[a?"addCls":"removeCls"](this.trackOverCls)},updateValue:function(h,c){var f=this,b=f.getAnimate(),g=f.valueEl,e=f.valueToPercent(h),d,a;if(f.isConfiguring||!b){g.setStyle("width",e)}else{g.stopAnimation();g.animate(Ext.merge({from:{width:f.valueToPercent(c)},to:{width:e}},b))}f.refreshTooltip();if(!f.isConfiguring){if(f.hasListeners.change){f.fireEvent("change",f,h,c)}d=f.getWidgetColumn&&f.getWidgetColumn();a=d&&f.getWidgetRecord&&f.getWidgetRecord();if(a&&d.dataIndex){a.set(d.dataIndex,h)}}},afterCachedConfig:function(){this.refresh();return this.callParent(arguments)},initConfig:function(a){this.isConfiguring=true;this.callParent([a]);this.refresh()},setConfig:function(){var a=this;a.isReconfiguring=true;a.callParent(arguments);a.isReconfiguring=false;a.refresh();return a},destroy:function(){this.tip=Ext.destroy(this.tip);this.callParent()},privates:{getGlyphTextNode:function(b){var a=b.lastChild;if(!a||a.nodeType!==3){a=b.ownerDocument.createTextNode("");b.appendChild(a)}return a},getTooltipData:function(){var a=this;return{component:a,tracking:a.getTrackingValue(),trackOver:a.getTrackOver(),value:a.getValue()}},refresh:function(){var a=this;if(a.invalidGlyphs){a.refreshGlyphs(true)}if(a.invalidTooltip){a.refreshTooltip(true)}},refreshGlyphs:function(a){var i=this,g=!a&&(i.isConfiguring||i.isReconfiguring),c,j,f,h,e,b,d;if(!g){c=i.getGlyphTextNode(i.innerEl.dom);d=i.getGlyphTextNode(i.valueEl.dom);b=i.getGlyphTextNode(i.trackerEl.dom);j=i.getGlyphs();f=i.getLimit();for(h=e="";f--;){e+=j[0];h+=j[1]}c.nodeValue=e;d.nodeValue=h;b.nodeValue=h}i.invalidGlyphs=g},refreshTooltip:function(b){var c=this,a=!b&&(c.isConfiguring||c.isReconfiguring),e=c.getTooltip(),d,f;if(!a){e=c.getTooltip();if(e){d=c.getTooltipData();f=e(d);c.setTooltipText(f)}}c.invalidTooltip=a},valueFromEvent:function(a){var f=this,b=f.innerEl,e=a.getX(),j=f.getRounding(),d=b.getX(),g=e-d,h=b.getWidth(),c=f.getLimit(),i;if(f.getInherited().rtl){g=h-g}i=g/h*c;i=Math.ceil(i/j)*j;return i},valueToPercent:function(a){a=(a/this.getLimit())*100;return a+"%"}}});Ext.define("Ext.ux.statusbar.ValidationStatus",{extend:"Ext.Component",alias:"plugin.validationstatus",requires:["Ext.util.MixedCollection"],errorIconCls:"x-status-error",errorListCls:"x-status-error-list",validIconCls:"x-status-valid",showText:"The form has errors (click for details...)",hideText:"Click again to hide the error list",submitText:"Saving...",init:function(b){var a=this;a.statusBar=b;b.on({single:true,scope:a,render:a.onStatusbarRender});b.on({click:{element:"el",fn:a.onStatusClick,scope:a,buffer:200}})},onStatusbarRender:function(c){var b=this,a=function(){b.monitor=true};b.monitor=true;b.errors=Ext.create("Ext.util.MixedCollection");b.listAlign=(c.statusAlign==="right"?"br-tr?":"bl-tl?");if(b.form){b.formPanel=Ext.getCmp(b.form)||b.statusBar.lookupController().lookupReference(b.form);b.basicForm=b.formPanel.getForm();b.startMonitoring();b.basicForm.on({beforeaction:function(e,d){if(d.type==="submit"){b.monitor=false}}});b.formPanel.on({beforedestroy:b.destroy,scope:b});b.basicForm.on("actioncomplete",a);b.basicForm.on("actionfailed",a)}},startMonitoring:function(){this.basicForm.getFields().each(function(a){a.on("validitychange",this.onFieldValidation,this)},this)},stopMonitoring:function(){var a=this.basicForm;if(!a.destroyed){a.getFields().each(function(b){b.un("validitychange",this.onFieldValidation,this)},this)}},doDestroy:function(){Ext.destroy(this.msgEl);this.stopMonitoring();this.statusBar.statusEl.un("click",this.onStatusClick,this);this.callParent()},onFieldValidation:function(b,c){var a=this,d;if(!a.monitor){return false}d=b.getErrors()[0];if(d){a.errors.add(b.id,{field:b,msg:d})}else{a.errors.removeAtKey(b.id)}this.updateErrorList();if(a.errors.getCount()>0){if(a.statusBar.getText()!==a.showText){a.statusBar.setStatus({text:a.showText,iconCls:a.errorIconCls})}}else{a.statusBar.clearStatus().setIcon(a.validIconCls)}},updateErrorList:function(){var b=this,c,a=b.getMsgEl();if(b.errors.getCount()>0){c=[" "];this.errors.each(function(d){c.push('
");a.update(c.join(""))}else{a.update("")}a.setSize("auto","auto")},getMsgEl:function(){var c=this,a=c.msgEl,b;if(!a){a=c.msgEl=Ext.DomHelper.append(Ext.getBody(),{cls:c.errorListCls},true);a.hide();a.on("click",function(d){b=d.getTarget("li",10,true);if(b){Ext.getCmp(b.id.split("x-err-")[1]).focus();c.hideErrors()}},null,{stopEvent:true})}return a},showErrors:function(){var a=this;a.updateErrorList();a.getMsgEl().alignTo(a.statusBar.getEl(),a.listAlign).slideIn("b",{duration:300,easing:"easeOut"});a.statusBar.setText(a.hideText);a.formPanel.body.on("click",a.hideErrors,a,{single:true})},hideErrors:function(){var a=this.getMsgEl();if(a.isVisible()){a.slideOut("b",{duration:300,easing:"easeIn"});this.statusBar.setText(this.showText)}this.formPanel.body.un("click",this.hideErrors,this)},onStatusClick:function(){if(this.getMsgEl().isVisible()){this.hideErrors()}else{if(this.errors.getCount()>0){this.showErrors()}}}});- ',d.msg,"
")});c.push("