-
Notifications
You must be signed in to change notification settings - Fork 0
/
ext-neptune.js
18 lines (12 loc) · 7.37 KB
/
ext-neptune.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/*
This file is part of Ext JS 4.2
Copyright (c) 2011-2013 Sencha Inc
Contact: http://www.sencha.com/contact
Pre-release code in the Ext repository is intended for development purposes only and will
not always be stable.
Use of pre-release code is permitted with your application at your own risk under standard
Ext license terms. Public redistribution is prohibited.
For early licensing, please contact us at [email protected]
Build date: 2013-01-08 23:25:56 (f0a3d96f987988f3e7bc5b0c0a7355723a686090)
*/
Ext.define("Ext.Neptune.button.Button",{override:"Ext.button.Button",setScale:function(a){this.callParent(arguments);this.removeCls(this.allowedScales);this.addCls(a)}});Ext.define("Ext.Neptune.container.ButtonGroup",{override:"Ext.container.ButtonGroup",beforeRender:function(){var a=this;a.callParent();if(a.header){delete a.header.items.items[0].flex}a.callParent(arguments)}});Ext.define("Ext.Neptune.layout.component.field.Trigger",{override:"Ext.layout.component.field.Trigger",sizeBodyContents:function(c,b,f){var d=this,a=d.owner,e=a.getTriggerWidth();if(a.hideTrigger||a.readOnly||e>0){f.inputContext.setProp("width",c,true)}}});Ext.define("Ext.Neptune.menu.Menu",{override:"Ext.menu.Menu",baseCls:Ext.baseCSSPrefix+"menu",initComponent:function(){var a=this;a.addEvents("click","mouseenter","mouseleave","mouseover");Ext.menu.Manager.register(a);if(a.plain){a.cls=Ext.baseCSSPrefix+"menu-plain"}if(!a.layout){a.layout={type:"vbox",align:"stretchmax",overflowHandler:"Scroller"};if(!a.floating){a.layout.align="stretch"}}if(a.floating===false&&a.initialConfig.hidden!==true){a.hidden=false}a.callParent(arguments);a.on("beforeshow",function(){var b=!!a.items.length;if(b&&a.rendered){a.el.setStyle("visibility",null)}return b})}});Ext.define("Ext.Neptune.panel.Tool",{override:"Ext.panel.Tool",renderTpl:['<div id="{id}-toolEl" class="{baseCls}-{type}" role="presentation"></div>']});Ext.define("Ext.Neptune.window.MessageBox",{override:"Ext.window.MessageBox",initComponent:function(){var c=this,b,a;c.title=" ";c.topContainer=new Ext.container.Container({anchor:"100%",style:{padding:"10px",overflow:"hidden"},items:[c.iconComponent=new Ext.Component({cls:c.baseCls+"-icon",width:50,height:c.iconHeight,style:{"float":"left"}}),c.promptContainer=new Ext.container.Container({layout:{type:"anchor"},items:[c.msg=new Ext.Component({autoEl:{tag:"span"},cls:c.baseCls+"-text"}),c.textField=new Ext.form.field.Text({anchor:"100%",enableKeyEvents:true,listeners:{keydown:c.onPromptKey,scope:c}}),c.textArea=new Ext.form.field.TextArea({anchor:"100%",height:75})]})]});c.progressBar=new Ext.ProgressBar({anchor:"-10",style:"margin-left:10px"});c.items=[c.topContainer,c.progressBar];c.msgButtons=[];for(b=0;b<4;b++){a=c.makeButton(b);c.msgButtons[a.itemId]=a;c.msgButtons.push(a)}c.bottomTb=new Ext.toolbar.Toolbar({ui:"footer",dock:"bottom",layout:{pack:"end"},items:[c.msgButtons[0],c.msgButtons[1],c.msgButtons[2],c.msgButtons[3]]});c.dockedItems=[c.bottomTb];c.callParent()}});Ext.define("Ext.Neptune.grid.column.Column",{override:"Ext.grid.column.Column",initComponent:function(){var d=this,b,a,c;if(Ext.isDefined(d.header)){d.text=d.header;delete d.header}if(d.flex){d.minWidth=d.minWidth||Ext.grid.plugin.HeaderResizer.prototype.minColWidth}if(!d.triStateSort){d.possibleSortStates.length=2}if(Ext.isDefined(d.columns)){d.isGroupHeader=true;if(d.dataIndex){Ext.Error.raise("Ext.grid.column.Column: Group header may not accept a dataIndex")}if((d.width&&d.width!==Ext.grid.header.Container.prototype.defaultWidth)||d.flex){Ext.Error.raise("Ext.grid.column.Column: Group header does not support setting explicit widths or flexs. The group header width is calculated by the sum of its children.")}d.items=d.columns;delete d.columns;delete d.flex;delete d.width;d.cls=(d.cls||"")+" "+Ext.baseCSSPrefix+"group-header";d.sortable=false;d.resizable=false;d.align="center"}else{d.isContainer=false}d.addCls(Ext.baseCSSPrefix+"column-header-align-"+d.align);if(d.sortable){d.addCls(Ext.baseCSSPrefix+"column-header-sortable")}Ext.grid.column.Column.superclass.initComponent.call(this,arguments);d.on({element:"el",click:d.onElClick,dblclick:d.onElDblClick,scope:d});d.on({element:"titleEl",mouseenter:d.onTitleMouseOver,mouseleave:d.onTitleMouseOut,scope:d})}});Ext.define("Ext.Neptune.Shadow",{override:"Ext.Shadow",offset:3});Ext.define("Ext.Neptune.resizer.Splitter",{override:"Ext.resizer.Splitter",onRender:function(){var a=this;a.callParent(arguments);if(a.performCollapse!==false){if(a.renderData.collapsible){a.mon(a.collapseEl,"click",a.toggleTargetCmp,a)}if(a.collapseOnDblClick){a.mon(a.el,"dblclick",a.toggleTargetCmp,a)}}a.mon(a.getCollapseTarget(),{collapse:a.onTargetCollapse,expand:a.onTargetExpand,scope:a});a.mon(a.el,"mouseover",a.onMouseOver,a);a.mon(a.el,"mouseout",a.onMouseOut,a);a.el.unselectable();a.tracker=Ext.create(a.getTrackerConfig());a.relayEvents(a.tracker,["beforedragstart","dragstart","dragend"])},onMouseOver:function(){this.el.addCls(this.baseCls+"-over")},onMouseOut:function(){this.el.removeCls(this.baseCls+"-over")}});Ext.define("Ext.Neptune.tree.Panel",{override:"Ext.tree.Panel",initComponent:function(){var c=this,b=[c.treeCls],a;if(c.useArrows){b.push(Ext.baseCSSPrefix+"tree-arrows")}else{b.push(Ext.baseCSSPrefix+"tree-no-arrows")}if(c.lines){b.push(Ext.baseCSSPrefix+"tree-lines")}else{b.push(Ext.baseCSSPrefix+"tree-no-lines")}if(Ext.isString(c.store)){c.store=Ext.StoreMgr.lookup(c.store)}else{if(!c.store||Ext.isObject(c.store)&&!c.store.isStore){c.store=new Ext.data.TreeStore(Ext.apply({},c.store||{},{root:c.root,fields:c.fields,model:c.model,folderSort:c.folderSort}))}else{if(c.root){c.store=Ext.data.StoreManager.lookup(c.store);c.store.setRootNode(c.root);if(c.folderSort!==undefined){c.store.folderSort=c.folderSort;c.store.sort()}}}}c.viewConfig=Ext.applyIf(c.viewConfig||{},{rootVisible:c.rootVisible,animate:c.enableAnimations,singleExpand:c.singleExpand,node:c.store.getRootNode(),hideHeaders:c.hideHeaders});c.mon(c.store,{scope:c,rootchange:c.onRootChange,clear:c.onClear});c.relayEvents(c.store,["beforeload","load"]);c.store.on({append:c.createRelayer("itemappend"),remove:c.createRelayer("itemremove"),move:c.createRelayer("itemmove"),insert:c.createRelayer("iteminsert"),beforeappend:c.createRelayer("beforeitemappend"),beforeremove:c.createRelayer("beforeitemremove"),beforemove:c.createRelayer("beforeitemmove"),beforeinsert:c.createRelayer("beforeiteminsert"),expand:c.createRelayer("itemexpand"),collapse:c.createRelayer("itemcollapse"),beforeexpand:c.createRelayer("beforeitemexpand"),beforecollapse:c.createRelayer("beforeitemcollapse")});if(!c.columns){if(c.initialConfig.hideHeaders===undefined){c.hideHeaders=true}c.autoWidth=true;c.addCls(Ext.baseCSSPrefix+"autowidth-table");c.columns=[{xtype:"treecolumn",text:"Name",width:Ext.isIE6?null:10000,dataIndex:c.displayField}]}if(c.cls){b.push(c.cls)}c.cls=b.join(" ");Ext.tree.Panel.superclass.initComponent.apply(c,arguments);c.selModel.treeStore=c.store;a=c.getView();if(Ext.isIE6&&c.autoWidth){a.afterRender=Ext.Function.createSequence(a.afterRender,function(){this.stretcher=a.el.down("th").createChild({style:"height:0px;width:"+(this.getWidth()-Ext.getScrollbarSize().width)+"px"})});a.afterComponentLayout=Ext.Function.createSequence(a.afterComponentLayout,function(){this.stretcher.setWidth((this.getWidth()-Ext.getScrollbarSize().width))})}c.relayEvents(a,["checkchange","afteritemexpand","afteritemcollapse"]);if(!a.rootVisible&&!c.getRootNode()){c.setRootNode({expanded:true})}}});