initial import
authorwww-data <www-data@newweb2.(none)>
Tue, 6 Apr 2010 07:39:29 +0000 (15:39 +0800)
committerwww-data <www-data@newweb2.(none)>
Tue, 6 Apr 2010 07:39:29 +0000 (15:39 +0800)
675 files changed:
Array.js [new file with mode: 0644]
CHANGES.txt [new file with mode: 0644]
Date.js [new file with mode: 0644]
Function.js [new file with mode: 0644]
Number.js [new file with mode: 0644]
Roo.js [new file with mode: 0644]
Roo/Ajax.js [new file with mode: 0644]
Roo/BasicDialog.js [new file with mode: 0644]
Roo/BasicLayoutRegion.js [new file with mode: 0644]
Roo/BorderLayout.js [new file with mode: 0644]
Roo/BoxComponent.js [new file with mode: 0644]
Roo/Button.js [new file with mode: 0644]
Roo/CenterLayoutRegion.js [new file with mode: 0644]
Roo/ColorPalette.js [new file with mode: 0644]
Roo/Component.js [new file with mode: 0644]
Roo/ComponentMgr.js [new file with mode: 0644]
Roo/CompositeElement.js [new file with mode: 0644]
Roo/CompositeElementLite.js [new file with mode: 0644]
Roo/ContentPanel.js [new file with mode: 0644]
Roo/DDView.js [new file with mode: 0644]
Roo/DatePicker.js [new file with mode: 0644]
Roo/DomHelper.js [new file with mode: 0644]
Roo/DomQuery.js [new file with mode: 0644]
Roo/Editor.js [new file with mode: 0644]
Roo/Element.js [new file with mode: 0644]
Roo/EventManager.js [new file with mode: 0644]
Roo/Fx.js [new file with mode: 0644]
Roo/JsonView.js [new file with mode: 0644]
Roo/KeyMap.js [new file with mode: 0644]
Roo/KeyNav.js [new file with mode: 0644]
Roo/Layer.js [new file with mode: 0644]
Roo/LayoutManager.js [new file with mode: 0644]
Roo/LayoutRegion.js [new file with mode: 0644]
Roo/LayoutStateManager.js [new file with mode: 0644]
Roo/LoadMask.js [new file with mode: 0644]
Roo/MasterTemplate.js [new file with mode: 0644]
Roo/MessageBox.js [new file with mode: 0644]
Roo/PagingToolbar.js [new file with mode: 0644]
Roo/QuickTips.js [new file with mode: 0644]
Roo/ReaderLayout.js [new file with mode: 0644]
Roo/Resizable.js [new file with mode: 0644]
Roo/Shadow.js [new file with mode: 0644]
Roo/SplitBar.js [new file with mode: 0644]
Roo/SplitButton.js [new file with mode: 0644]
Roo/SplitLayoutRegion.js [new file with mode: 0644]
Roo/TabPanel.js [new file with mode: 0644]
Roo/Template.js [new file with mode: 0644]
Roo/Toolbar.js [new file with mode: 0644]
Roo/UpdateManager.js [new file with mode: 0644]
Roo/View.js [new file with mode: 0644]
Roo/XTemplate.js [new file with mode: 0644]
Roo/data/ArrayReader.js [new file with mode: 0644]
Roo/data/Connection.js [new file with mode: 0644]
Roo/data/DataProxy.js [new file with mode: 0644]
Roo/data/DataReader.js [new file with mode: 0644]
Roo/data/Field.js [new file with mode: 0644]
Roo/data/HttpProxy.js [new file with mode: 0644]
Roo/data/JsonReader.js [new file with mode: 0644]
Roo/data/JsonStore.js [new file with mode: 0644]
Roo/data/MemoryProxy.js [new file with mode: 0644]
Roo/data/Record.js [new file with mode: 0644]
Roo/data/ScriptTagProxy.js [new file with mode: 0644]
Roo/data/SimpleStore.js [new file with mode: 0644]
Roo/data/SortTypes.js [new file with mode: 0644]
Roo/data/Store.js [new file with mode: 0644]
Roo/data/Tree.js [new file with mode: 0644]
Roo/data/XmlReader.js [new file with mode: 0644]
Roo/dd/DD.js [new file with mode: 0644]
Roo/dd/DDProxy.js [new file with mode: 0644]
Roo/dd/DDTarget.js [new file with mode: 0644]
Roo/dd/DragDrop.js [new file with mode: 0644]
Roo/dd/DragDropMgr.js [new file with mode: 0644]
Roo/dd/DragSource.js [new file with mode: 0644]
Roo/dd/DragZone.js [new file with mode: 0644]
Roo/dd/DropTarget.js [new file with mode: 0644]
Roo/dd/DropZone.js [new file with mode: 0644]
Roo/dd/Registry.js [new file with mode: 0644]
Roo/dd/ScrollManager.js [new file with mode: 0644]
Roo/dd/StatusProxy.js [new file with mode: 0644]
Roo/form/Action.js [new file with mode: 0644]
Roo/form/BasicForm.js [new file with mode: 0644]
Roo/form/Checkbox.js [new file with mode: 0644]
Roo/form/ComboBox.js [new file with mode: 0644]
Roo/form/DateField.js [new file with mode: 0644]
Roo/form/FCKeditor.js [new file with mode: 0644]
Roo/form/Field.js [new file with mode: 0644]
Roo/form/Form.js [new file with mode: 0644]
Roo/form/GridField.js [new file with mode: 0644]
Roo/form/Hidden.js [new file with mode: 0644]
Roo/form/HtmlEditor.js [new file with mode: 0644]
Roo/form/HtmlEditor/ToolbarContext.js [new file with mode: 0644]
Roo/form/HtmlEditor/ToolbarStandard.js [new file with mode: 0644]
Roo/form/Layout.js [new file with mode: 0644]
Roo/form/NumberField.js [new file with mode: 0644]
Roo/form/Radio.js [new file with mode: 0644]
Roo/form/TextArea.js [new file with mode: 0644]
Roo/form/TextField.js [new file with mode: 0644]
Roo/form/TriggerField.js [new file with mode: 0644]
Roo/form/VTypes.js [new file with mode: 0644]
Roo/grid/AbstractGridView.js [new file with mode: 0644]
Roo/grid/AbstractSelectionModel.js [new file with mode: 0644]
Roo/grid/CellSelectionModel.js [new file with mode: 0644]
Roo/grid/ColumnModel.js [new file with mode: 0644]
Roo/grid/EditorGrid.js [new file with mode: 0644]
Roo/grid/Grid.js [new file with mode: 0644]
Roo/grid/GridDragZone.js [new file with mode: 0644]
Roo/grid/GridEditor.js [new file with mode: 0644]
Roo/grid/GridView.js [new file with mode: 0644]
Roo/grid/HeaderDragZone.js [new file with mode: 0644]
Roo/grid/HeaderDropZone.js [new file with mode: 0644]
Roo/grid/PropertyGrid.js [new file with mode: 0644]
Roo/grid/RowSelectionModel.js [new file with mode: 0644]
Roo/grid/SplitDragZone.js [new file with mode: 0644]
Roo/lib/Ajax.js [new file with mode: 0644]
Roo/lib/Anim.js [new file with mode: 0644]
Roo/lib/AnimBase.js [new file with mode: 0644]
Roo/lib/AnimMgr.js [new file with mode: 0644]
Roo/lib/Beizer.js [new file with mode: 0644]
Roo/lib/ColorAnim.js [new file with mode: 0644]
Roo/lib/Dom.js [new file with mode: 0644]
Roo/lib/Easing.js [new file with mode: 0644]
Roo/lib/Event.js [new file with mode: 0644]
Roo/lib/Motion.js [new file with mode: 0644]
Roo/lib/Point.js [new file with mode: 0644]
Roo/lib/Region.js [new file with mode: 0644]
Roo/lib/Scroll.js [new file with mode: 0644]
Roo/menu/Adapter.js [new file with mode: 0644]
Roo/menu/BaseItem.js [new file with mode: 0644]
Roo/menu/CheckItem.js [new file with mode: 0644]
Roo/menu/ColorItem.js [new file with mode: 0644]
Roo/menu/ColorMenu.js [new file with mode: 0644]
Roo/menu/DateItem.js [new file with mode: 0644]
Roo/menu/DateMenu.js [new file with mode: 0644]
Roo/menu/Item.js [new file with mode: 0644]
Roo/menu/Menu.js [new file with mode: 0644]
Roo/menu/MenuMgr.js [new file with mode: 0644]
Roo/menu/Separator.js [new file with mode: 0644]
Roo/menu/TextItem.js [new file with mode: 0644]
Roo/state/CookieProvider.js [new file with mode: 0644]
Roo/state/Manager.js [new file with mode: 0644]
Roo/state/Provider.js [new file with mode: 0644]
Roo/tree/AsyncTreeNode.js [new file with mode: 0644]
Roo/tree/ColumnNodeUI.js [new file with mode: 0644]
Roo/tree/ColumnTree.js [new file with mode: 0644]
Roo/tree/TreeDragZone.js [new file with mode: 0644]
Roo/tree/TreeDropZone.js [new file with mode: 0644]
Roo/tree/TreeEditor.js [new file with mode: 0644]
Roo/tree/TreeFilter.js [new file with mode: 0644]
Roo/tree/TreeLoader.js [new file with mode: 0644]
Roo/tree/TreeNode.js [new file with mode: 0644]
Roo/tree/TreeNodeUI.js [new file with mode: 0644]
Roo/tree/TreePanel.js [new file with mode: 0644]
Roo/tree/TreeSelectionModel.js [new file with mode: 0644]
Roo/tree/TreeSorter.js [new file with mode: 0644]
Roo/util/CSS.js [new file with mode: 0644]
Roo/util/ClickRepeater.js [new file with mode: 0644]
Roo/util/DelayedTask.js [new file with mode: 0644]
Roo/util/Format.js [new file with mode: 0644]
Roo/util/JSON.js [new file with mode: 0644]
Roo/util/MixedCollection.js [new file with mode: 0644]
Roo/util/Observable.js [new file with mode: 0644]
Roo/util/TaskRunner.js [new file with mode: 0644]
Roo/util/TextMetrics.js [new file with mode: 0644]
String.js [new file with mode: 0644]
buildSDK/bundle_build.js [new file with mode: 0644]
buildSDK/cssmini.js [new file with mode: 0644]
buildSDK/cssminiX.js [new file with mode: 0644]
buildSDK/debugLoader.js [new file with mode: 0644]
buildSDK/dependancy_order.txt [new file with mode: 0644]
buildSDK/doc_build.txt [new file with mode: 0644]
buildSDK/doc_templates/allclasses.tmpl [new file with mode: 0644]
buildSDK/doc_templates/allfiles.tmpl [new file with mode: 0644]
buildSDK/doc_templates/class.tmpl [new file with mode: 0644]
buildSDK/doc_templates/class.tmpl_original [new file with mode: 0644]
buildSDK/doc_templates/index.tmpl [new file with mode: 0644]
buildSDK/doc_templates/publish.js [new file with mode: 0644]
buildSDK/doc_templates/static/default.css [new file with mode: 0644]
buildSDK/doc_templates/static/doc.js [new file with mode: 0644]
buildSDK/doc_templates/static/header.html [new file with mode: 0644]
buildSDK/doc_templates/static/index.html [new file with mode: 0644]
buildSDK/doc_templates/static/page.js [new file with mode: 0644]
buildSDK/doc_templates/symbol.tmpl [new file with mode: 0644]
buildSDK/docs_build.js [new file with mode: 0644]
buildSDK/doctree.txt [new file with mode: 0644]
buildSDK/indexPage.html [new file with mode: 0644]
buildSDK/logo_ideas.svg [new file with mode: 0644]
buildSDK/make_src_highlighted.js [new file with mode: 0644]
buildSDK/rect14671.png [new file with mode: 0644]
buildSDK/release.sh [new file with mode: 0644]
buildSDK/renderWiki.php [new file with mode: 0644]
buildSDK/roojs_logo.jpg [new file with mode: 0644]
buildSDK/wiki_index.txt [new file with mode: 0644]
buildSDK/~doctree.txt [new file with mode: 0644]
css/basic-dialog.css [new file with mode: 0644]
css/button.css [new file with mode: 0644]
css/combo.css [new file with mode: 0644]
css/copyright_status.txt [new file with mode: 0644]
css/core.css [new file with mode: 0644]
css/date.css [new file with mode: 0644]
css/dd.css [new file with mode: 0644]
css/form.css [new file with mode: 0644]
css/form_design.svg [new file with mode: 0644]
css/grid.css [new file with mode: 0644]
css/highlight-js.css [new file with mode: 0644]
css/inline-editor.css [new file with mode: 0644]
css/layout.css [new file with mode: 0644]
css/license.txt [new file with mode: 0644]
css/menu_design.svg [new file with mode: 0644]
css/qtips.css [new file with mode: 0644]
css/reset-min.css [new file with mode: 0644]
css/resizable.css [new file with mode: 0644]
css/roojs-debug.css [new file with mode: 0644]
css/tabs.css [new file with mode: 0644]
css/toolbar.css [new file with mode: 0644]
css/tree.css [new file with mode: 0644]
css/ytheme-aero.css [new file with mode: 0644]
css/ytheme-gray.css [new file with mode: 0644]
css/ytheme-vista.css [new file with mode: 0644]
cssX/roojs-all.css [new file with mode: 0644]
cssX/xtheme-slate.css [new file with mode: 0644]
examples/dialog/blog.html [new file with mode: 0644]
examples/dialog/hello.html [new file with mode: 0644]
examples/dialog/hello.js [new file with mode: 0644]
examples/dialog/images/comment-bg.gif [new file with mode: 0644]
examples/dialog/images/comment.gif [new file with mode: 0644]
examples/dialog/images/warning.gif [new file with mode: 0644]
examples/dialog/layout.html [new file with mode: 0644]
examples/dialog/layout.js [new file with mode: 0644]
examples/dialog/msg-box.html [new file with mode: 0644]
examples/dialog/msg-box.js [new file with mode: 0644]
examples/dialog/post.css [new file with mode: 0644]
examples/dialog/post.js [new file with mode: 0644]
examples/dialog/post.php [new file with mode: 0644]
examples/examples.css [new file with mode: 0644]
examples/examples.js [new file with mode: 0644]
examples/form/combos.html [new file with mode: 0644]
examples/form/combos.js [new file with mode: 0644]
examples/form/custom.html [new file with mode: 0644]
examples/form/custom.js [new file with mode: 0644]
examples/form/dynamic.html [new file with mode: 0644]
examples/form/dynamic.js [new file with mode: 0644]
examples/form/fck.html [new file with mode: 0644]
examples/form/fck.js [new file with mode: 0644]
examples/form/fckconfig.js [new file with mode: 0644]
examples/form/forms.html [new file with mode: 0644]
examples/form/forms.js [new file with mode: 0644]
examples/form/forum-search.html [new file with mode: 0644]
examples/form/forum-search.js [new file with mode: 0644]
examples/form/roojs_icon.jpg [new file with mode: 0644]
examples/form/states.js [new file with mode: 0644]
examples/form/xml-errors.xml [new file with mode: 0644]
examples/form/xml-form.html [new file with mode: 0644]
examples/form/xml-form.js [new file with mode: 0644]
examples/form/xml-form.xml [new file with mode: 0644]
examples/grid/array-grid.html [new file with mode: 0644]
examples/grid/array-grid.js [new file with mode: 0644]
examples/grid/custom-grid.html [new file with mode: 0644]
examples/grid/custom-grid.js [new file with mode: 0644]
examples/grid/edit-grid.html [new file with mode: 0644]
examples/grid/edit-grid.js [new file with mode: 0644]
examples/grid/from-markup.html [new file with mode: 0644]
examples/grid/from-markup.js [new file with mode: 0644]
examples/grid/paging.html [new file with mode: 0644]
examples/grid/paging.js [new file with mode: 0644]
examples/grid/plants.xml [new file with mode: 0644]
examples/grid/sheldon.xml [new file with mode: 0644]
examples/grid/xml-grid.html [new file with mode: 0644]
examples/grid/xml-grid.js [new file with mode: 0644]
examples/layout/complex.html [new file with mode: 0644]
examples/layout/feed-viewer.html [new file with mode: 0644]
examples/layout/nested.html [new file with mode: 0644]
examples/layout/simple.html [new file with mode: 0644]
examples/layout/simple.js [new file with mode: 0644]
examples/menu/menus.html [new file with mode: 0644]
examples/menu/menus.js [new file with mode: 0644]
examples/resizable/basic.html [new file with mode: 0644]
examples/resizable/basic.js [new file with mode: 0644]
examples/tabs/ajax1.htm [new file with mode: 0644]
examples/tabs/ajax2.htm [new file with mode: 0644]
examples/tabs/tabs-adv.html [new file with mode: 0644]
examples/tabs/tabs-adv.js [new file with mode: 0644]
examples/tabs/tabs-example.css [new file with mode: 0644]
examples/tabs/tabs-example.js [new file with mode: 0644]
examples/tabs/tabs.html [new file with mode: 0644]
examples/tree/ColumnTree.js [new file with mode: 0644]
examples/tree/coltree.html [new file with mode: 0644]
examples/tree/coltree.js [new file with mode: 0644]
examples/tree/dep-tree.json [new file with mode: 0644]
examples/tree/dependency.html [new file with mode: 0644]
examples/tree/dependency.js [new file with mode: 0644]
examples/tree/get-nodes.php [new file with mode: 0644]
examples/tree/organizer.html [new file with mode: 0644]
examples/tree/organizer.js [new file with mode: 0644]
examples/tree/reorder.html [new file with mode: 0644]
examples/tree/reorder.js [new file with mode: 0644]
examples/tree/two-trees.html [new file with mode: 0644]
examples/tree/two-trees.js [new file with mode: 0644]
examples/view/chooser-example.js [new file with mode: 0644]
examples/view/chooser.css [new file with mode: 0644]
examples/view/chooser.html [new file with mode: 0644]
examples/view/chooser.js [new file with mode: 0644]
examples/view/ddview.html [new file with mode: 0644]
examples/view/get-images.php [new file with mode: 0644]
examples/view/images/thumbs/dance_fever.jpg [new file with mode: 0644]
examples/view/images/thumbs/gangster_zack.jpg [new file with mode: 0644]
examples/view/images/thumbs/kids_hug.jpg [new file with mode: 0644]
examples/view/images/thumbs/kids_hug2.jpg [new file with mode: 0644]
examples/view/images/thumbs/sara_pink.jpg [new file with mode: 0644]
examples/view/images/thumbs/sara_pumpkin.jpg [new file with mode: 0644]
examples/view/images/thumbs/sara_smile.jpg [new file with mode: 0644]
examples/view/images/thumbs/up_to_something.jpg [new file with mode: 0644]
examples/view/images/thumbs/zack.jpg [new file with mode: 0644]
examples/view/images/thumbs/zack_dress.jpg [new file with mode: 0644]
examples/view/images/thumbs/zack_hat.jpg [new file with mode: 0644]
examples/view/images/thumbs/zack_sink.jpg [new file with mode: 0644]
examples/view/images/thumbs/zacks_grill.jpg [new file with mode: 0644]
images/aero/basic-dialog/aero-close-over.gif [new file with mode: 0644]
images/aero/basic-dialog/aero-close.gif [new file with mode: 0644]
images/aero/basic-dialog/bg-center.gif [new file with mode: 0644]
images/aero/basic-dialog/bg-left.gif [new file with mode: 0644]
images/aero/basic-dialog/bg-right.gif [new file with mode: 0644]
images/aero/basic-dialog/close.gif [new file with mode: 0644]
images/aero/basic-dialog/dlg-bg.gif [new file with mode: 0644]
images/aero/basic-dialog/e-handle.gif [new file with mode: 0644]
images/aero/basic-dialog/hd-sprite.gif [new file with mode: 0644]
images/aero/basic-dialog/s-handle.gif [new file with mode: 0644]
images/aero/basic-dialog/se-handle.gif [new file with mode: 0644]
images/aero/basic-dialog/w-handle.gif [new file with mode: 0644]
images/aero/gradient-bg.gif [new file with mode: 0644]
images/aero/grid/grid-blue-split.gif [new file with mode: 0644]
images/aero/grid/grid-hrow.gif [new file with mode: 0644]
images/aero/grid/grid-split.gif [new file with mode: 0644]
images/aero/grid/grid-vista-hd.gif [new file with mode: 0644]
images/aero/grid/sort-col-bg.gif [new file with mode: 0644]
images/aero/grid/sort_asc.gif [new file with mode: 0644]
images/aero/grid/sort_desc.gif [new file with mode: 0644]
images/aero/layout/collapse.gif [new file with mode: 0644]
images/aero/layout/expand.gif [new file with mode: 0644]
images/aero/layout/gradient-bg.gif [new file with mode: 0644]
images/aero/layout/layout-sprite.gif [new file with mode: 0644]
images/aero/layout/ns-collapse.gif [new file with mode: 0644]
images/aero/layout/ns-expand.gif [new file with mode: 0644]
images/aero/layout/panel-close.gif [new file with mode: 0644]
images/aero/layout/panel-title-bg.gif [new file with mode: 0644]
images/aero/layout/panel-title-light-bg.gif [new file with mode: 0644]
images/aero/layout/tab-close-on.gif [new file with mode: 0644]
images/aero/layout/tab-close.gif [new file with mode: 0644]
images/aero/qtip/bg.gif [new file with mode: 0644]
images/aero/s.gif [new file with mode: 0644]
images/aero/sizer/e-handle-dark.gif [new file with mode: 0644]
images/aero/sizer/e-handle.gif [new file with mode: 0644]
images/aero/sizer/ne-handle-dark.gif [new file with mode: 0644]
images/aero/sizer/ne-handle.gif [new file with mode: 0644]
images/aero/sizer/nw-handle-dark.gif [new file with mode: 0644]
images/aero/sizer/nw-handle.gif [new file with mode: 0644]
images/aero/sizer/s-handle-dark.gif [new file with mode: 0644]
images/aero/sizer/s-handle.gif [new file with mode: 0644]
images/aero/sizer/se-handle-dark.gif [new file with mode: 0644]
images/aero/sizer/se-handle.gif [new file with mode: 0644]
images/aero/sizer/sw-handle-dark.gif [new file with mode: 0644]
images/aero/sizer/sw-handle.gif [new file with mode: 0644]
images/aero/tabs/tab-btm-inactive-left-bg.gif [new file with mode: 0644]
images/aero/tabs/tab-btm-inactive-right-bg.gif [new file with mode: 0644]
images/aero/tabs/tab-btm-left-bg.gif [new file with mode: 0644]
images/aero/tabs/tab-btm-right-bg.gif [new file with mode: 0644]
images/aero/tabs/tab-sprite.gif [new file with mode: 0644]
images/aero/tabs/tab-strip-bg.gif [new file with mode: 0644]
images/aero/tabs/tab-strip-bg.png [new file with mode: 0644]
images/aero/tabs/tab-strip-btm-bg.gif [new file with mode: 0644]
images/aero/toolbar/bg.gif [new file with mode: 0644]
images/default/basic-dialog/btn-clear.gif [new file with mode: 0644]
images/default/basic-dialog/btn-sprite.gif [new file with mode: 0644]
images/default/basic-dialog/close.gif [new file with mode: 0644]
images/default/basic-dialog/collapse.gif [new file with mode: 0644]
images/default/basic-dialog/e-handle.gif [new file with mode: 0644]
images/default/basic-dialog/hd-sprite.gif [new file with mode: 0644]
images/default/basic-dialog/progress.gif [new file with mode: 0644]
images/default/basic-dialog/progress2.gif [new file with mode: 0644]
images/default/basic-dialog/s-handle.gif [new file with mode: 0644]
images/default/basic-dialog/se-handle.gif [new file with mode: 0644]
images/default/combo/arrow.gif [new file with mode: 0644]
images/default/dd/dd-sprite.gif [new file with mode: 0644]
images/default/dd/drop-add.gif [new file with mode: 0644]
images/default/dd/drop-no.gif [new file with mode: 0644]
images/default/dd/drop-sub.gif [new file with mode: 0644]
images/default/dd/drop-yes.gif [new file with mode: 0644]
images/default/form/bg.gif [new file with mode: 0644]
images/default/form/date-trigger.gif [new file with mode: 0644]
images/default/form/exclamation.gif [new file with mode: 0644]
images/default/form/htmleditor.gif [new file with mode: 0644]
images/default/form/text-bg.gif [new file with mode: 0644]
images/default/form/trigger.gif [new file with mode: 0644]
images/default/gradient-bg.gif [new file with mode: 0644]
images/default/grid/arrow-left-white.gif [new file with mode: 0644]
images/default/grid/arrow-right-white.gif [new file with mode: 0644]
images/default/grid/dirty.gif [new file with mode: 0644]
images/default/grid/done.gif [new file with mode: 0644]
images/default/grid/drop-no.gif [new file with mode: 0644]
images/default/grid/drop-yes.gif [new file with mode: 0644]
images/default/grid/footer-bg.gif [new file with mode: 0644]
images/default/grid/grid-blue-hd.gif [new file with mode: 0644]
images/default/grid/grid-blue-split.gif [new file with mode: 0644]
images/default/grid/grid-hrow.gif [new file with mode: 0644]
images/default/grid/grid-loading.gif [new file with mode: 0644]
images/default/grid/grid-split.gif [new file with mode: 0644]
images/default/grid/grid-vista-hd.gif [new file with mode: 0644]
images/default/grid/invalid_line.gif [new file with mode: 0644]
images/default/grid/loading.gif [new file with mode: 0644]
images/default/grid/mso-hd.gif [new file with mode: 0644]
images/default/grid/nowait.gif [new file with mode: 0644]
images/default/grid/page-first-disabled.gif [new file with mode: 0644]
images/default/grid/page-first.gif [new file with mode: 0644]
images/default/grid/page-last-disabled.gif [new file with mode: 0644]
images/default/grid/page-last.gif [new file with mode: 0644]
images/default/grid/page-next-disabled.gif [new file with mode: 0644]
images/default/grid/page-next.gif [new file with mode: 0644]
images/default/grid/page-prev-disabled.gif [new file with mode: 0644]
images/default/grid/page-prev.gif [new file with mode: 0644]
images/default/grid/pick-button.gif [new file with mode: 0644]
images/default/grid/refresh.gif [new file with mode: 0644]
images/default/grid/sort_asc.gif [new file with mode: 0644]
images/default/grid/sort_desc.gif [new file with mode: 0644]
images/default/grid/wait.gif [new file with mode: 0644]
images/default/layout/collapse.gif [new file with mode: 0644]
images/default/layout/expand.gif [new file with mode: 0644]
images/default/layout/gradient-bg.gif [new file with mode: 0644]
images/default/layout/layout-sprite.gif [new file with mode: 0644]
images/default/layout/ns-collapse.gif [new file with mode: 0644]
images/default/layout/ns-expand.gif [new file with mode: 0644]
images/default/layout/panel-close.gif [new file with mode: 0644]
images/default/layout/panel-title-bg.gif [new file with mode: 0644]
images/default/layout/panel-title-light-bg.gif [new file with mode: 0644]
images/default/layout/tab-close-on.gif [new file with mode: 0644]
images/default/layout/tab-close.gif [new file with mode: 0644]
images/default/layout/tool-sprites.gif [new file with mode: 0644]
images/default/menu/chk-sprite.gif [new file with mode: 0644]
images/default/menu/menu-bg.gif [new file with mode: 0644]
images/default/qtip/bg.gif [new file with mode: 0644]
images/default/s.gif [new file with mode: 0644]
images/default/sizer/corners-dark-sprite.gif [new file with mode: 0644]
images/default/sizer/corners-sprite.gif [new file with mode: 0644]
images/default/sizer/e-handle-dark.gif [new file with mode: 0644]
images/default/sizer/e-handle.gif [new file with mode: 0644]
images/default/sizer/ne-handle-dark.gif [new file with mode: 0644]
images/default/sizer/ne-handle.gif [new file with mode: 0644]
images/default/sizer/nw-handle-dark.gif [new file with mode: 0644]
images/default/sizer/nw-handle.gif [new file with mode: 0644]
images/default/sizer/s-handle-dark.gif [new file with mode: 0644]
images/default/sizer/s-handle.gif [new file with mode: 0644]
images/default/sizer/se-handle-dark.gif [new file with mode: 0644]
images/default/sizer/se-handle.gif [new file with mode: 0644]
images/default/sizer/square.gif [new file with mode: 0644]
images/default/sizer/sw-handle-dark.gif [new file with mode: 0644]
images/default/sizer/sw-handle.gif [new file with mode: 0644]
images/default/tabs/tab-btm-inactive-left-bg.gif [new file with mode: 0644]
images/default/tabs/tab-btm-inactive-right-bg.gif [new file with mode: 0644]
images/default/tabs/tab-btm-left-bg.gif [new file with mode: 0644]
images/default/tabs/tab-btm-right-bg.gif [new file with mode: 0644]
images/default/tabs/tab-sprite.gif [new file with mode: 0644]
images/default/toolbar/btn-arrow.gif [new file with mode: 0644]
images/default/toolbar/btn-over-bg.gif [new file with mode: 0644]
images/default/toolbar/gray-bg.gif [new file with mode: 0644]
images/default/tree/drop-add.gif [new file with mode: 0644]
images/default/tree/drop-between.gif [new file with mode: 0644]
images/default/tree/drop-no.gif [new file with mode: 0644]
images/default/tree/drop-over.gif [new file with mode: 0644]
images/default/tree/drop-sprite.gif [new file with mode: 0644]
images/default/tree/drop-under.gif [new file with mode: 0644]
images/default/tree/drop-yes.gif [new file with mode: 0644]
images/default/tree/elbow-end-minus-nl.gif [new file with mode: 0644]
images/default/tree/elbow-end-minus.gif [new file with mode: 0644]
images/default/tree/elbow-end-plus-nl.gif [new file with mode: 0644]
images/default/tree/elbow-end-plus.gif [new file with mode: 0644]
images/default/tree/elbow-end.gif [new file with mode: 0644]
images/default/tree/elbow-line.gif [new file with mode: 0644]
images/default/tree/elbow-minus-nl.gif [new file with mode: 0644]
images/default/tree/elbow-minus.gif [new file with mode: 0644]
images/default/tree/elbow-plus-nl.gif [new file with mode: 0644]
images/default/tree/elbow-plus.gif [new file with mode: 0644]
images/default/tree/elbow-sprite.gif [new file with mode: 0644]
images/default/tree/elbow.gif [new file with mode: 0644]
images/default/tree/folder-open.gif [new file with mode: 0644]
images/default/tree/folder.gif [new file with mode: 0644]
images/default/tree/leaf.gif [new file with mode: 0644]
images/default/tree/loading.gif [new file with mode: 0644]
images/default/tree/node-sprite.gif [new file with mode: 0644]
images/default/tree/s.gif [new file with mode: 0644]
images/gray/basic-dialog/close.gif [new file with mode: 0644]
images/gray/basic-dialog/dlg-bg.gif [new file with mode: 0644]
images/gray/basic-dialog/e-handle.gif [new file with mode: 0644]
images/gray/basic-dialog/hd-sprite.gif [new file with mode: 0644]
images/gray/basic-dialog/s-handle.gif [new file with mode: 0644]
images/gray/basic-dialog/se-handle.gif [new file with mode: 0644]
images/gray/gradient-bg.gif [new file with mode: 0644]
images/gray/layout/collapse.gif [new file with mode: 0644]
images/gray/layout/expand.gif [new file with mode: 0644]
images/gray/layout/gradient-bg.gif [new file with mode: 0644]
images/gray/layout/layout-sprite.gif [new file with mode: 0644]
images/gray/layout/ns-collapse.gif [new file with mode: 0644]
images/gray/layout/ns-expand.gif [new file with mode: 0644]
images/gray/layout/panel-close.gif [new file with mode: 0644]
images/gray/layout/panel-title-bg.gif [new file with mode: 0644]
images/gray/layout/panel-title-light-bg.gif [new file with mode: 0644]
images/gray/layout/tab-close-on.gif [new file with mode: 0644]
images/gray/layout/tab-close.gif [new file with mode: 0644]
images/gray/qtip/bg.gif [new file with mode: 0644]
images/gray/s.gif [new file with mode: 0644]
images/gray/sizer/e-handle-dark.gif [new file with mode: 0644]
images/gray/sizer/e-handle.gif [new file with mode: 0644]
images/gray/sizer/ne-handle-dark.gif [new file with mode: 0644]
images/gray/sizer/ne-handle.gif [new file with mode: 0644]
images/gray/sizer/nw-handle-dark.gif [new file with mode: 0644]
images/gray/sizer/nw-handle.gif [new file with mode: 0644]
images/gray/sizer/s-handle-dark.gif [new file with mode: 0644]
images/gray/sizer/s-handle.gif [new file with mode: 0644]
images/gray/sizer/se-handle-dark.gif [new file with mode: 0644]
images/gray/sizer/se-handle.gif [new file with mode: 0644]
images/gray/sizer/sw-handle-dark.gif [new file with mode: 0644]
images/gray/sizer/sw-handle.gif [new file with mode: 0644]
images/gray/tabs/tab-btm-inactive-left-bg.gif [new file with mode: 0644]
images/gray/tabs/tab-btm-inactive-right-bg.gif [new file with mode: 0644]
images/gray/tabs/tab-btm-left-bg.gif [new file with mode: 0644]
images/gray/tabs/tab-btm-right-bg.gif [new file with mode: 0644]
images/gray/tabs/tab-sprite.gif [new file with mode: 0644]
images/gray/toolbar/gray-bg.gif [new file with mode: 0644]
images/license.txt [new file with mode: 0644]
images/roojs_logo.jpg [new file with mode: 0644]
images/slate/button/btn-arrow.gif [new file with mode: 0644]
images/slate/button/btn-sprite.gif [new file with mode: 0644]
images/slate/editor/tb-sprite.gif [new file with mode: 0644]
images/slate/form/clear-trigger.gif [new file with mode: 0644]
images/slate/form/date-trigger.gif [new file with mode: 0644]
images/slate/form/search-trigger.gif [new file with mode: 0644]
images/slate/form/trigger-tpl.gif [new file with mode: 0644]
images/slate/form/trigger.gif [new file with mode: 0644]
images/slate/gradient-bg.gif [new file with mode: 0644]
images/slate/grid/arrow-left-white.gif [new file with mode: 0644]
images/slate/grid/arrow-right-white.gif [new file with mode: 0644]
images/slate/grid/col-move-bottom.gif [new file with mode: 0644]
images/slate/grid/col-move-top.gif [new file with mode: 0644]
images/slate/grid/footer-bg.gif [new file with mode: 0644]
images/slate/grid/grid-blue-hd.gif [new file with mode: 0644]
images/slate/grid/grid-blue-split.gif [new file with mode: 0644]
images/slate/grid/grid-hrow.gif [new file with mode: 0644]
images/slate/grid/grid-split.gif [new file with mode: 0644]
images/slate/grid/grid-vista-hd.gif [new file with mode: 0644]
images/slate/grid/grid3-hd-btn.gif [new file with mode: 0644]
images/slate/grid/grid3-hrow-over.gif [new file with mode: 0644]
images/slate/grid/grid3-hrow.gif [new file with mode: 0644]
images/slate/grid/grid3-special-col-bg.gif [new file with mode: 0644]
images/slate/grid/grid3-special-col-sel-bg.gif [new file with mode: 0644]
images/slate/grid/group-expand-sprite.gif [new file with mode: 0644]
images/slate/grid/mso-hd.gif [new file with mode: 0644]
images/slate/grid/page-first-disabled.gif [new file with mode: 0644]
images/slate/grid/page-first.gif [new file with mode: 0644]
images/slate/grid/page-last-disabled.gif [new file with mode: 0644]
images/slate/grid/page-last.gif [new file with mode: 0644]
images/slate/grid/page-next-disabled.gif [new file with mode: 0644]
images/slate/grid/page-next.gif [new file with mode: 0644]
images/slate/grid/page-prev-disabled.gif [new file with mode: 0644]
images/slate/grid/page-prev.gif [new file with mode: 0644]
images/slate/grid/row-over.gif [new file with mode: 0644]
images/slate/grid/row-sel.gif [new file with mode: 0644]
images/slate/grid/sort_asc.gif [new file with mode: 0644]
images/slate/grid/sort_desc.gif [new file with mode: 0644]
images/slate/menu/item-over - Copy.gif [new file with mode: 0644]
images/slate/menu/item-over.gif [new file with mode: 0644]
images/slate/menu/menu-parent.gif [new file with mode: 0644]
images/slate/menu/menu.gif [new file with mode: 0644]
images/slate/panel/corners-sprite.gif [new file with mode: 0644]
images/slate/panel/left-right.gif [new file with mode: 0644]
images/slate/panel/light-hd.gif [new file with mode: 0644]
images/slate/panel/tool-sprite-tpl.gif [new file with mode: 0644]
images/slate/panel/tool-sprites.gif [new file with mode: 0644]
images/slate/panel/tools-sprites-trans.gif [new file with mode: 0644]
images/slate/panel/top-bottom.gif [new file with mode: 0644]
images/slate/panel/top-bottom.png [new file with mode: 0644]
images/slate/panel/white-corners-sprite.gif [new file with mode: 0644]
images/slate/panel/white-left-right.gif [new file with mode: 0644]
images/slate/panel/white-top-bottom.gif [new file with mode: 0644]
images/slate/progress/progress-bg.gif [new file with mode: 0644]
images/slate/qtip/bg.gif [new file with mode: 0644]
images/slate/qtip/close.gif [new file with mode: 0644]
images/slate/qtip/tip-sprite.gif [new file with mode: 0644]
images/slate/s.gif [new file with mode: 0644]
images/slate/shared/glass-bg.gif [new file with mode: 0644]
images/slate/shared/hd-sprite.gif [new file with mode: 0644]
images/slate/shared/left-btn.gif [new file with mode: 0644]
images/slate/shared/right-btn.gif [new file with mode: 0644]
images/slate/sizer/e-handle-dark.gif [new file with mode: 0644]
images/slate/sizer/e-handle.gif [new file with mode: 0644]
images/slate/sizer/ne-handle-dark.gif [new file with mode: 0644]
images/slate/sizer/ne-handle.gif [new file with mode: 0644]
images/slate/sizer/nw-handle-dark.gif [new file with mode: 0644]
images/slate/sizer/nw-handle.gif [new file with mode: 0644]
images/slate/sizer/s-handle-dark.gif [new file with mode: 0644]
images/slate/sizer/s-handle.gif [new file with mode: 0644]
images/slate/sizer/se-handle-dark.gif [new file with mode: 0644]
images/slate/sizer/se-handle.gif [new file with mode: 0644]
images/slate/sizer/square.gif [new file with mode: 0644]
images/slate/sizer/sw-handle-dark.gif [new file with mode: 0644]
images/slate/sizer/sw-handle.gif [new file with mode: 0644]
images/slate/tabs/scroll-left.gif [new file with mode: 0644]
images/slate/tabs/scroll-right.gif [new file with mode: 0644]
images/slate/tabs/scroller-bg.gif [new file with mode: 0644]
images/slate/tabs/tab-btm-inactive-left-bg.gif [new file with mode: 0644]
images/slate/tabs/tab-btm-inactive-right-bg.gif [new file with mode: 0644]
images/slate/tabs/tab-btm-left-bg.gif [new file with mode: 0644]
images/slate/tabs/tab-btm-right-bg.gif [new file with mode: 0644]
images/slate/tabs/tab-close.gif [new file with mode: 0644]
images/slate/tabs/tab-strip-bg.gif [new file with mode: 0644]
images/slate/tabs/tab-strip-bg.png [new file with mode: 0644]
images/slate/tabs/tab-strip-btm-bg.gif [new file with mode: 0644]
images/slate/tabs/tabs-sprite.gif [new file with mode: 0644]
images/slate/toolbar/bg.gif [new file with mode: 0644]
images/slate/toolbar/btn-arrow-light.gif [new file with mode: 0644]
images/slate/toolbar/btn-arrow.gif [new file with mode: 0644]
images/slate/toolbar/btn-over-bg.gif [new file with mode: 0644]
images/slate/toolbar/gray-bg.gif [new file with mode: 0644]
images/slate/toolbar/tb-bg.gif [new file with mode: 0644]
images/slate/toolbar/tb-btn-sprite.gif [new file with mode: 0644]
images/slate/window/icon-error.gif [new file with mode: 0644]
images/slate/window/icon-info.gif [new file with mode: 0644]
images/slate/window/icon-question.gif [new file with mode: 0644]
images/slate/window/icon-warning.gif [new file with mode: 0644]
images/slate/window/left-corners.png [new file with mode: 0644]
images/slate/window/left-right.png [new file with mode: 0644]
images/slate/window/right-corners.png [new file with mode: 0644]
images/slate/window/top-bottom.png [new file with mode: 0644]
images/vista/basic-dialog/bg-center.gif [new file with mode: 0644]
images/vista/basic-dialog/bg-left.gif [new file with mode: 0644]
images/vista/basic-dialog/bg-right.gif [new file with mode: 0644]
images/vista/basic-dialog/close.gif [new file with mode: 0644]
images/vista/basic-dialog/dlg-bg.gif [new file with mode: 0644]
images/vista/basic-dialog/e-handle.gif [new file with mode: 0644]
images/vista/basic-dialog/hd-sprite.gif [new file with mode: 0644]
images/vista/basic-dialog/s-handle.gif [new file with mode: 0644]
images/vista/basic-dialog/se-handle.gif [new file with mode: 0644]
images/vista/basic-dialog/w-handle.gif [new file with mode: 0644]
images/vista/gradient-bg.gif [new file with mode: 0644]
images/vista/grid/grid-split.gif [new file with mode: 0644]
images/vista/grid/grid-vista-hd.gif [new file with mode: 0644]
images/vista/layout/collapse.gif [new file with mode: 0644]
images/vista/layout/expand.gif [new file with mode: 0644]
images/vista/layout/gradient-bg.gif [new file with mode: 0644]
images/vista/layout/layout-sprite.gif [new file with mode: 0644]
images/vista/layout/ns-collapse.gif [new file with mode: 0644]
images/vista/layout/ns-expand.gif [new file with mode: 0644]
images/vista/layout/panel-close.gif [new file with mode: 0644]
images/vista/layout/panel-title-bg.gif [new file with mode: 0644]
images/vista/layout/panel-title-light-bg.gif [new file with mode: 0644]
images/vista/layout/tab-close-on.gif [new file with mode: 0644]
images/vista/layout/tab-close.gif [new file with mode: 0644]
images/vista/qtip/bg.gif [new file with mode: 0644]
images/vista/s.gif [new file with mode: 0644]
images/vista/sizer/e-handle-dark.gif [new file with mode: 0644]
images/vista/sizer/e-handle.gif [new file with mode: 0644]
images/vista/sizer/ne-handle-dark.gif [new file with mode: 0644]
images/vista/sizer/ne-handle.gif [new file with mode: 0644]
images/vista/sizer/nw-handle-dark.gif [new file with mode: 0644]
images/vista/sizer/nw-handle.gif [new file with mode: 0644]
images/vista/sizer/s-handle-dark.gif [new file with mode: 0644]
images/vista/sizer/s-handle.gif [new file with mode: 0644]
images/vista/sizer/se-handle-dark.gif [new file with mode: 0644]
images/vista/sizer/se-handle.gif [new file with mode: 0644]
images/vista/sizer/sw-handle-dark.gif [new file with mode: 0644]
images/vista/sizer/sw-handle.gif [new file with mode: 0644]
images/vista/tabs/tab-btm-inactive-left-bg.gif [new file with mode: 0644]
images/vista/tabs/tab-btm-inactive-right-bg.gif [new file with mode: 0644]
images/vista/tabs/tab-btm-left-bg.gif [new file with mode: 0644]
images/vista/tabs/tab-btm-right-bg.gif [new file with mode: 0644]
images/vista/tabs/tab-sprite.gif [new file with mode: 0644]
images/vista/toolbar/gray-bg.gif [new file with mode: 0644]
licence.txt [new file with mode: 0644]
resources_licence.txt [new file with mode: 0644]

diff --git a/Array.js b/Array.js
new file mode 100644 (file)
index 0000000..18c3aaa
--- /dev/null
+++ b/Array.js
@@ -0,0 +1,37 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+ /**
+ * @class Array
+ */
+Roo.applyIf(Array.prototype, {
+    /**
+     * Checks whether or not the specified object exists in the array.
+     * @param {Object} o The object to check for
+     * @return {Number} The index of o in the array (or -1 if it is not found)
+     */
+    indexOf : function(o){
+       for (var i = 0, len = this.length; i < len; i++){
+             if(this[i] == o) return i;
+       }
+          return -1;
+    },
+
+    /**
+     * Removes the specified object from the array.  If the object is not found nothing happens.
+     * @param {Object} o The object to remove
+     */
+    remove : function(o){
+       var index = this.indexOf(o);
+       if(index != -1){
+           this.splice(index, 1);
+       }
+    }
+});
\ No newline at end of file
diff --git a/CHANGES.txt b/CHANGES.txt
new file mode 100644 (file)
index 0000000..ff95243
--- /dev/null
@@ -0,0 +1,58 @@
+Changes since 1.1.1
+
+* Doc comments (to help doctool & compressor)
+Core
+* new Roo.factory method, honours xtype's, 
+* Quicktips no longer use semi-transparent shadows (need CSS/images)
+* Fixed issues with Safari DomHelper
+
+Tree
+* TreeLoader - New root property, to Make loader comaptible to return values for Stores
+* TreeLoader - if uiProvider.default is available it is used as the default provider
+* TreeLoader - queryPararm - value to query node on (default is  ?node=XXXX), you can set this to parent_id etc.
+* Column Tree - fixed up example Columned Tree and added it to Roo.
+
+Menus
+* Menu - new config item 'registerMenu' (default true) - enables you to turn off registering of menus
+  So they can stay open even if someone clicks elsewhere on the page.
+  
+Data
+* JsonReader - now has default values 'total', 'success', 'data' and 'id'
+* Store - supports xtype for reader, proxy
+* Store - can handle Json decoding / failure better, by issuing loadExceptions
+
+Grid
+* Grid - supports xtypes for selModel and dataSource
+* Grid - accepts a JS Object for colmodel, and calls new on ColumnModel for you.
+* EditorGrid - Allways fires afterEdit, even when content not changed.
+* ColumnModel - fixed CSS bugs by using Ext.id(), rather than column number for grid width CSS
+* ColumnModel -  findColumnIndex now public and documented.
+
+Form
+* ComboBox - supports xtype for store.
+* ComboBox - new property blockFocus - (used by borked HTML Editor at present)
+* FCKeditor - Added to core (requires installing FCK editor seperatly, no extra includes required though)
+* HTML Editor - currently rather broken in everything but firefox, but supports  
+       extra toolbars etc.
+* Hidden - new standard form element type.
+* Form - allItems property contains everything added to form
+* Form - findById - finds a form element by name.
+* Form - addxtype - add's xtype elements.
+
+Toolbar
+* Toolbar - fix layout in Chrome / Safari
+* Toolbar - new hide/show methods.
+* Toolbar fields property added so Form fields added to toolbars and found.
+
+
+CSS
+* Fixes for width of Calendar in Firefox
+
+
+FIXME's
+- Column Tree - needs better docs.
+- HTML Editor - is broken in IE/Safari - needs better solution than FCK
+
+
diff --git a/Date.js b/Date.js
new file mode 100644 (file)
index 0000000..7c5418b
--- /dev/null
+++ b/Date.js
@@ -0,0 +1,777 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+
+/**
+ * @class Date
+ *
+ * The date parsing and format syntax is a subset of
+ * <a href="http://www.php.net/date">PHP's date() function</a>, and the formats that are
+ * supported will provide results equivalent to their PHP versions.
+ *
+ * Following is the list of all currently supported formats:
+ *<pre>
+Sample date:
+'Wed Jan 10 2007 15:05:01 GMT-0600 (Central Standard Time)'
+
+Format  Output      Description
+------  ----------  --------------------------------------------------------------
+  d      10         Day of the month, 2 digits with leading zeros
+  D      Wed        A textual representation of a day, three letters
+  j      10         Day of the month without leading zeros
+  l      Wednesday  A full textual representation of the day of the week
+  S      th         English ordinal day of month suffix, 2 chars (use with j)
+  w      3          Numeric representation of the day of the week
+  z      9          The julian date, or day of the year (0-365)
+  W      01         ISO-8601 2-digit week number of year, weeks starting on Monday (00-52)
+  F      January    A full textual representation of the month
+  m      01         Numeric representation of a month, with leading zeros
+  M      Jan        Month name abbreviation, three letters
+  n      1          Numeric representation of a month, without leading zeros
+  t      31         Number of days in the given month
+  L      0          Whether it's a leap year (1 if it is a leap year, else 0)
+  Y      2007       A full numeric representation of a year, 4 digits
+  y      07         A two digit representation of a year
+  a      pm         Lowercase Ante meridiem and Post meridiem
+  A      PM         Uppercase Ante meridiem and Post meridiem
+  g      3          12-hour format of an hour without leading zeros
+  G      15         24-hour format of an hour without leading zeros
+  h      03         12-hour format of an hour with leading zeros
+  H      15         24-hour format of an hour with leading zeros
+  i      05         Minutes with leading zeros
+  s      01         Seconds, with leading zeros
+  O      -0600      Difference to Greenwich time (GMT) in hours
+  T      CST        Timezone setting of the machine running the code
+  Z      -21600     Timezone offset in seconds (negative if west of UTC, positive if east)
+</pre>
+ *
+ * Example usage (note that you must escape format specifiers with '\\' to render them as character literals):
+ * <pre><code>
+var dt = new Date('1/10/2007 03:05:01 PM GMT-0600');
+document.write(dt.format('Y-m-d'));                         //2007-01-10
+document.write(dt.format('F j, Y, g:i a'));                 //January 10, 2007, 3:05 pm
+document.write(dt.format('l, \\t\\he dS of F Y h:i:s A'));  //Wednesday, the 10th of January 2007 03:05:01 PM
+ </code></pre>
+ *
+ * Here are some standard date/time patterns that you might find helpful.  They
+ * are not part of the source of Date.js, but to use them you can simply copy this
+ * block of code into any script that is included after Date.js and they will also become
+ * globally available on the Date object.  Feel free to add or remove patterns as needed in your code.
+ * <pre><code>
+Date.patterns = {
+    ISO8601Long:"Y-m-d H:i:s",
+    ISO8601Short:"Y-m-d",
+    ShortDate: "n/j/Y",
+    LongDate: "l, F d, Y",
+    FullDateTime: "l, F d, Y g:i:s A",
+    MonthDay: "F d",
+    ShortTime: "g:i A",
+    LongTime: "g:i:s A",
+    SortableDateTime: "Y-m-d\\TH:i:s",
+    UniversalSortableDateTime: "Y-m-d H:i:sO",
+    YearMonth: "F, Y"
+};
+</code></pre>
+ *
+ * Example usage:
+ * <pre><code>
+var dt = new Date();
+document.write(dt.format(Date.patterns.ShortDate));
+ </code></pre>
+ */
+
+/*
+ * Most of the date-formatting functions below are the excellent work of Baron Schwartz.
+ * They generate precompiled functions from date formats instead of parsing and
+ * processing the pattern every time you format a date.  These functions are available
+ * on every Date object (any javascript function).
+ *
+ * The original article and download are here:
+ * http://www.xaprb.com/blog/2005/12/12/javascript-closures-for-runtime-efficiency/
+ *
+ */
+ // was in core
+/**
+ Returns the number of milliseconds between this date and date
+ @param {Date} date (optional) Defaults to now
+ @return {Number} The diff in milliseconds
+ @member Date getElapsed
+ */
+Date.prototype.getElapsed = function(date) {
+       return Math.abs((date || new Date()).getTime()-this.getTime());
+};
+// was in date file..
+
+
+// private
+Date.parseFunctions = {count:0};
+// private
+Date.parseRegexes = [];
+// private
+Date.formatFunctions = {count:0};
+
+// private
+Date.prototype.dateFormat = function(format) {
+    if (Date.formatFunctions[format] == null) {
+        Date.createNewFormat(format);
+    }
+    var func = Date.formatFunctions[format];
+    return this[func]();
+};
+
+
+/**
+ * Formats a date given the supplied format string
+ * @param {String} format The format string
+ * @return {String} The formatted date
+ * @method
+ */
+Date.prototype.format = Date.prototype.dateFormat;
+
+// private
+Date.createNewFormat = function(format) {
+    var funcName = "format" + Date.formatFunctions.count++;
+    Date.formatFunctions[format] = funcName;
+    var code = "Date.prototype." + funcName + " = function(){return ";
+    var special = false;
+    var ch = '';
+    for (var i = 0; i < format.length; ++i) {
+        ch = format.charAt(i);
+        if (!special && ch == "\\") {
+            special = true;
+        }
+        else if (special) {
+            special = false;
+            code += "'" + String.escape(ch) + "' + ";
+        }
+        else {
+            code += Date.getFormatCode(ch);
+        }
+    }
+    /** eval:var:zzzzzzzzzzzzz */
+    eval(code.substring(0, code.length - 3) + ";}");
+};
+
+// private
+Date.getFormatCode = function(character) {
+    switch (character) {
+    case "d":
+        return "String.leftPad(this.getDate(), 2, '0') + ";
+    case "D":
+        return "Date.dayNames[this.getDay()].substring(0, 3) + ";
+    case "j":
+        return "this.getDate() + ";
+    case "l":
+        return "Date.dayNames[this.getDay()] + ";
+    case "S":
+        return "this.getSuffix() + ";
+    case "w":
+        return "this.getDay() + ";
+    case "z":
+        return "this.getDayOfYear() + ";
+    case "W":
+        return "this.getWeekOfYear() + ";
+    case "F":
+        return "Date.monthNames[this.getMonth()] + ";
+    case "m":
+        return "String.leftPad(this.getMonth() + 1, 2, '0') + ";
+    case "M":
+        return "Date.monthNames[this.getMonth()].substring(0, 3) + ";
+    case "n":
+        return "(this.getMonth() + 1) + ";
+    case "t":
+        return "this.getDaysInMonth() + ";
+    case "L":
+        return "(this.isLeapYear() ? 1 : 0) + ";
+    case "Y":
+        return "this.getFullYear() + ";
+    case "y":
+        return "('' + this.getFullYear()).substring(2, 4) + ";
+    case "a":
+        return "(this.getHours() < 12 ? 'am' : 'pm') + ";
+    case "A":
+        return "(this.getHours() < 12 ? 'AM' : 'PM') + ";
+    case "g":
+        return "((this.getHours() % 12) ? this.getHours() % 12 : 12) + ";
+    case "G":
+        return "this.getHours() + ";
+    case "h":
+        return "String.leftPad((this.getHours() % 12) ? this.getHours() % 12 : 12, 2, '0') + ";
+    case "H":
+        return "String.leftPad(this.getHours(), 2, '0') + ";
+    case "i":
+        return "String.leftPad(this.getMinutes(), 2, '0') + ";
+    case "s":
+        return "String.leftPad(this.getSeconds(), 2, '0') + ";
+    case "O":
+        return "this.getGMTOffset() + ";
+    case "T":
+        return "this.getTimezone() + ";
+    case "Z":
+        return "(this.getTimezoneOffset() * -60) + ";
+    default:
+        return "'" + String.escape(character) + "' + ";
+    }
+};
+
+/**
+ * Parses the passed string using the specified format. Note that this function expects dates in normal calendar
+ * format, meaning that months are 1-based (1 = January) and not zero-based like in JavaScript dates.  Any part of
+ * the date format that is not specified will default to the current date value for that part.  Time parts can also
+ * be specified, but default to 0.  Keep in mind that the input date string must precisely match the specified format
+ * string or the parse operation will fail.
+ * Example Usage:
+<pre><code>
+//dt = Fri May 25 2007 (current date)
+var dt = new Date();
+
+//dt = Thu May 25 2006 (today's month/day in 2006)
+dt = Date.parseDate("2006", "Y");
+
+//dt = Sun Jan 15 2006 (all date parts specified)
+dt = Date.parseDate("2006-1-15", "Y-m-d");
+
+//dt = Sun Jan 15 2006 15:20:01 GMT-0600 (CST)
+dt = Date.parseDate("2006-1-15 3:20:01 PM", "Y-m-d h:i:s A" );
+</code></pre>
+ * @param {String} input The unparsed date as a string
+ * @param {String} format The format the date is in
+ * @return {Date} The parsed date
+ * @static
+ */
+Date.parseDate = function(input, format) {
+    if (Date.parseFunctions[format] == null) {
+        Date.createParser(format);
+    }
+    var func = Date.parseFunctions[format];
+    return Date[func](input);
+};
+
+// private
+Date.createParser = function(format) {
+    var funcName = "parse" + Date.parseFunctions.count++;
+    var regexNum = Date.parseRegexes.length;
+    var currentGroup = 1;
+    Date.parseFunctions[format] = funcName;
+
+    var code = "Date." + funcName + " = function(input){\n"
+        + "var y = -1, m = -1, d = -1, h = -1, i = -1, s = -1, o, z, v;\n"
+        + "var d = new Date();\n"
+        + "y = d.getFullYear();\n"
+        + "m = d.getMonth();\n"
+        + "d = d.getDate();\n"
+        + "var results = input.match(Date.parseRegexes[" + regexNum + "]);\n"
+        + "if (results && results.length > 0) {";
+    var regex = "";
+
+    var special = false;
+    var ch = '';
+    for (var i = 0; i < format.length; ++i) {
+        ch = format.charAt(i);
+        if (!special && ch == "\\") {
+            special = true;
+        }
+        else if (special) {
+            special = false;
+            regex += String.escape(ch);
+        }
+        else {
+            var obj = Date.formatCodeToRegex(ch, currentGroup);
+            currentGroup += obj.g;
+            regex += obj.s;
+            if (obj.g && obj.c) {
+                code += obj.c;
+            }
+        }
+    }
+
+    code += "if (y >= 0 && m >= 0 && d > 0 && h >= 0 && i >= 0 && s >= 0)\n"
+        + "{v = new Date(y, m, d, h, i, s);}\n"
+        + "else if (y >= 0 && m >= 0 && d > 0 && h >= 0 && i >= 0)\n"
+        + "{v = new Date(y, m, d, h, i);}\n"
+        + "else if (y >= 0 && m >= 0 && d > 0 && h >= 0)\n"
+        + "{v = new Date(y, m, d, h);}\n"
+        + "else if (y >= 0 && m >= 0 && d > 0)\n"
+        + "{v = new Date(y, m, d);}\n"
+        + "else if (y >= 0 && m >= 0)\n"
+        + "{v = new Date(y, m);}\n"
+        + "else if (y >= 0)\n"
+        + "{v = new Date(y);}\n"
+        + "}return (v && (z || o))?\n" // favour UTC offset over GMT offset
+        + "    ((z)? v.add(Date.SECOND, (v.getTimezoneOffset() * 60) + (z*1)) :\n" // reset to UTC, then add offset
+        + "        v.add(Date.HOUR, (v.getGMTOffset() / 100) + (o / -100))) : v\n" // reset to GMT, then add offset
+        + ";}";
+
+    Date.parseRegexes[regexNum] = new RegExp("^" + regex + "$");
+     /** eval:var:zzzzzzzzzzzzz */
+    eval(code);
+};
+
+// private
+Date.formatCodeToRegex = function(character, currentGroup) {
+    switch (character) {
+    case "D":
+        return {g:0,
+        c:null,
+        s:"(?:Sun|Mon|Tue|Wed|Thu|Fri|Sat)"};
+    case "j":
+        return {g:1,
+            c:"d = parseInt(results[" + currentGroup + "], 10);\n",
+            s:"(\\d{1,2})"}; // day of month without leading zeroes
+    case "d":
+        return {g:1,
+            c:"d = parseInt(results[" + currentGroup + "], 10);\n",
+            s:"(\\d{2})"}; // day of month with leading zeroes
+    case "l":
+        return {g:0,
+            c:null,
+            s:"(?:" + Date.dayNames.join("|") + ")"};
+    case "S":
+        return {g:0,
+            c:null,
+            s:"(?:st|nd|rd|th)"};
+    case "w":
+        return {g:0,
+            c:null,
+            s:"\\d"};
+    case "z":
+        return {g:0,
+            c:null,
+            s:"(?:\\d{1,3})"};
+    case "W":
+        return {g:0,
+            c:null,
+            s:"(?:\\d{2})"};
+    case "F":
+        return {g:1,
+            c:"m = parseInt(Date.monthNumbers[results[" + currentGroup + "].substring(0, 3)], 10);\n",
+            s:"(" + Date.monthNames.join("|") + ")"};
+    case "M":
+        return {g:1,
+            c:"m = parseInt(Date.monthNumbers[results[" + currentGroup + "]], 10);\n",
+            s:"(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)"};
+    case "n":
+        return {g:1,
+            c:"m = parseInt(results[" + currentGroup + "], 10) - 1;\n",
+            s:"(\\d{1,2})"}; // Numeric representation of a month, without leading zeros
+    case "m":
+        return {g:1,
+            c:"m = parseInt(results[" + currentGroup + "], 10) - 1;\n",
+            s:"(\\d{2})"}; // Numeric representation of a month, with leading zeros
+    case "t":
+        return {g:0,
+            c:null,
+            s:"\\d{1,2}"};
+    case "L":
+        return {g:0,
+            c:null,
+            s:"(?:1|0)"};
+    case "Y":
+        return {g:1,
+            c:"y = parseInt(results[" + currentGroup + "], 10);\n",
+            s:"(\\d{4})"};
+    case "y":
+        return {g:1,
+            c:"var ty = parseInt(results[" + currentGroup + "], 10);\n"
+                + "y = ty > Date.y2kYear ? 1900 + ty : 2000 + ty;\n",
+            s:"(\\d{1,2})"};
+    case "a":
+        return {g:1,
+            c:"if (results[" + currentGroup + "] == 'am') {\n"
+                + "if (h == 12) { h = 0; }\n"
+                + "} else { if (h < 12) { h += 12; }}",
+            s:"(am|pm)"};
+    case "A":
+        return {g:1,
+            c:"if (results[" + currentGroup + "] == 'AM') {\n"
+                + "if (h == 12) { h = 0; }\n"
+                + "} else { if (h < 12) { h += 12; }}",
+            s:"(AM|PM)"};
+    case "g":
+    case "G":
+        return {g:1,
+            c:"h = parseInt(results[" + currentGroup + "], 10);\n",
+            s:"(\\d{1,2})"}; // 12/24-hr format  format of an hour without leading zeroes
+    case "h":
+    case "H":
+        return {g:1,
+            c:"h = parseInt(results[" + currentGroup + "], 10);\n",
+            s:"(\\d{2})"}; //  12/24-hr format  format of an hour with leading zeroes
+    case "i":
+        return {g:1,
+            c:"i = parseInt(results[" + currentGroup + "], 10);\n",
+            s:"(\\d{2})"};
+    case "s":
+        return {g:1,
+            c:"s = parseInt(results[" + currentGroup + "], 10);\n",
+            s:"(\\d{2})"};
+    case "O":
+        return {g:1,
+            c:[
+                "o = results[", currentGroup, "];\n",
+                "var sn = o.substring(0,1);\n", // get + / - sign
+                "var hr = o.substring(1,3)*1 + Math.floor(o.substring(3,5) / 60);\n", // get hours (performs minutes-to-hour conversion also)
+                "var mn = o.substring(3,5) % 60;\n", // get minutes
+                "o = ((-12 <= (hr*60 + mn)/60) && ((hr*60 + mn)/60 <= 14))?\n", // -12hrs <= GMT offset <= 14hrs
+                "    (sn + String.leftPad(hr, 2, 0) + String.leftPad(mn, 2, 0)) : null;\n"
+            ].join(""),
+            s:"([+\-]\\d{4})"};
+    case "T":
+        return {g:0,
+            c:null,
+            s:"[A-Z]{1,4}"}; // timezone abbrev. may be between 1 - 4 chars
+    case "Z":
+        return {g:1,
+            c:"z = results[" + currentGroup + "];\n" // -43200 <= UTC offset <= 50400
+                  + "z = (-43200 <= z*1 && z*1 <= 50400)? z : null;\n",
+            s:"([+\-]?\\d{1,5})"}; // leading '+' sign is optional for UTC offset
+    default:
+        return {g:0,
+            c:null,
+            s:String.escape(character)};
+    }
+};
+
+/**
+ * Get the timezone abbreviation of the current date (equivalent to the format specifier 'T').
+ * @return {String} The abbreviated timezone name (e.g. 'CST')
+ */
+Date.prototype.getTimezone = function() {
+    return this.toString().replace(/^.*? ([A-Z]{1,4})[\-+][0-9]{4} .*$/, "$1");
+};
+
+/**
+ * Get the offset from GMT of the current date (equivalent to the format specifier 'O').
+ * @return {String} The 4-character offset string prefixed with + or - (e.g. '-0600')
+ */
+Date.prototype.getGMTOffset = function() {
+    return (this.getTimezoneOffset() > 0 ? "-" : "+")
+        + String.leftPad(Math.abs(Math.floor(this.getTimezoneOffset() / 60)), 2, "0")
+        + String.leftPad(this.getTimezoneOffset() % 60, 2, "0");
+};
+
+/**
+ * Get the numeric day number of the year, adjusted for leap year.
+ * @return {Number} 0 through 364 (365 in leap years)
+ */
+Date.prototype.getDayOfYear = function() {
+    var num = 0;
+    Date.daysInMonth[1] = this.isLeapYear() ? 29 : 28;
+    for (var i = 0; i < this.getMonth(); ++i) {
+        num += Date.daysInMonth[i];
+    }
+    return num + this.getDate() - 1;
+};
+
+/**
+ * Get the string representation of the numeric week number of the year
+ * (equivalent to the format specifier 'W').
+ * @return {String} '00' through '52'
+ */
+Date.prototype.getWeekOfYear = function() {
+    // Skip to Thursday of this week
+    var now = this.getDayOfYear() + (4 - this.getDay());
+    // Find the first Thursday of the year
+    var jan1 = new Date(this.getFullYear(), 0, 1);
+    var then = (7 - jan1.getDay() + 4);
+    return String.leftPad(((now - then) / 7) + 1, 2, "0");
+};
+
+/**
+ * Whether or not the current date is in a leap year.
+ * @return {Boolean} True if the current date is in a leap year, else false
+ */
+Date.prototype.isLeapYear = function() {
+    var year = this.getFullYear();
+    return ((year & 3) == 0 && (year % 100 || (year % 400 == 0 && year)));
+};
+
+/**
+ * Get the first day of the current month, adjusted for leap year.  The returned value
+ * is the numeric day index within the week (0-6) which can be used in conjunction with
+ * the {@link #monthNames} array to retrieve the textual day name.
+ * Example:
+ *<pre><code>
+var dt = new Date('1/10/2007');
+document.write(Date.dayNames[dt.getFirstDayOfMonth()]); //output: 'Monday'
+</code></pre>
+ * @return {Number} The day number (0-6)
+ */
+Date.prototype.getFirstDayOfMonth = function() {
+    var day = (this.getDay() - (this.getDate() - 1)) % 7;
+    return (day < 0) ? (day + 7) : day;
+};
+
+/**
+ * Get the last day of the current month, adjusted for leap year.  The returned value
+ * is the numeric day index within the week (0-6) which can be used in conjunction with
+ * the {@link #monthNames} array to retrieve the textual day name.
+ * Example:
+ *<pre><code>
+var dt = new Date('1/10/2007');
+document.write(Date.dayNames[dt.getLastDayOfMonth()]); //output: 'Wednesday'
+</code></pre>
+ * @return {Number} The day number (0-6)
+ */
+Date.prototype.getLastDayOfMonth = function() {
+    var day = (this.getDay() + (Date.daysInMonth[this.getMonth()] - this.getDate())) % 7;
+    return (day < 0) ? (day + 7) : day;
+};
+
+
+/**
+ * Get the first date of this date's month
+ * @return {Date}
+ */
+Date.prototype.getFirstDateOfMonth = function() {
+    return new Date(this.getFullYear(), this.getMonth(), 1);
+};
+
+/**
+ * Get the last date of this date's month
+ * @return {Date}
+ */
+Date.prototype.getLastDateOfMonth = function() {
+    return new Date(this.getFullYear(), this.getMonth(), this.getDaysInMonth());
+};
+/**
+ * Get the number of days in the current month, adjusted for leap year.
+ * @return {Number} The number of days in the month
+ */
+Date.prototype.getDaysInMonth = function() {
+    Date.daysInMonth[1] = this.isLeapYear() ? 29 : 28;
+    return Date.daysInMonth[this.getMonth()];
+};
+
+/**
+ * Get the English ordinal suffix of the current day (equivalent to the format specifier 'S').
+ * @return {String} 'st, 'nd', 'rd' or 'th'
+ */
+Date.prototype.getSuffix = function() {
+    switch (this.getDate()) {
+        case 1:
+        case 21:
+        case 31:
+            return "st";
+        case 2:
+        case 22:
+            return "nd";
+        case 3:
+        case 23:
+            return "rd";
+        default:
+            return "th";
+    }
+};
+
+// private
+Date.daysInMonth = [31,28,31,30,31,30,31,31,30,31,30,31];
+
+/**
+ * An array of textual month names.
+ * Override these values for international dates, for example...
+ * Date.monthNames = ['JanInYourLang', 'FebInYourLang', ...];
+ * @type Array
+ * @static
+ */
+Date.monthNames =
+   ["January",
+    "February",
+    "March",
+    "April",
+    "May",
+    "June",
+    "July",
+    "August",
+    "September",
+    "October",
+    "November",
+    "December"];
+
+/**
+ * An array of textual day names.
+ * Override these values for international dates, for example...
+ * Date.dayNames = ['SundayInYourLang', 'MondayInYourLang', ...];
+ * @type Array
+ * @static
+ */
+Date.dayNames =
+   ["Sunday",
+    "Monday",
+    "Tuesday",
+    "Wednesday",
+    "Thursday",
+    "Friday",
+    "Saturday"];
+
+// private
+Date.y2kYear = 50;
+// private
+Date.monthNumbers = {
+    Jan:0,
+    Feb:1,
+    Mar:2,
+    Apr:3,
+    May:4,
+    Jun:5,
+    Jul:6,
+    Aug:7,
+    Sep:8,
+    Oct:9,
+    Nov:10,
+    Dec:11};
+
+/**
+ * Creates and returns a new Date instance with the exact same date value as the called instance.
+ * Dates are copied and passed by reference, so if a copied date variable is modified later, the original
+ * variable will also be changed.  When the intention is to create a new variable that will not
+ * modify the original instance, you should create a clone.
+ *
+ * Example of correctly cloning a date:
+ * <pre><code>
+//wrong way:
+var orig = new Date('10/1/2006');
+var copy = orig;
+copy.setDate(5);
+document.write(orig);  //returns 'Thu Oct 05 2006'!
+
+//correct way:
+var orig = new Date('10/1/2006');
+var copy = orig.clone();
+copy.setDate(5);
+document.write(orig);  //returns 'Thu Oct 01 2006'
+</code></pre>
+ * @return {Date} The new Date instance
+ */
+Date.prototype.clone = function() {
+       return new Date(this.getTime());
+};
+
+/**
+ * Clears any time information from this date
+ @param {Boolean} clone true to create a clone of this date, clear the time and return it
+ @return {Date} this or the clone
+ */
+Date.prototype.clearTime = function(clone){
+    if(clone){
+        return this.clone().clearTime();
+    }
+    this.setHours(0);
+    this.setMinutes(0);
+    this.setSeconds(0);
+    this.setMilliseconds(0);
+    return this;
+};
+
+// private
+// safari setMonth is broken
+if(Roo.isSafari){
+    Date.brokenSetMonth = Date.prototype.setMonth;
+       Date.prototype.setMonth = function(num){
+               if(num <= -1){
+                       var n = Math.ceil(-num);
+                       var back_year = Math.ceil(n/12);
+                       var month = (n % 12) ? 12 - n % 12 : 0 ;
+                       this.setFullYear(this.getFullYear() - back_year);
+                       return Date.brokenSetMonth.call(this, month);
+               } else {
+                       return Date.brokenSetMonth.apply(this, arguments);
+               }
+       };
+}
+
+/** Date interval constant 
+* @static 
+* @type String */
+Date.MILLI = "ms";
+/** Date interval constant 
+* @static 
+* @type String */
+Date.SECOND = "s";
+/** Date interval constant 
+* @static 
+* @type String */
+Date.MINUTE = "mi";
+/** Date interval constant 
+* @static 
+* @type String */
+Date.HOUR = "h";
+/** Date interval constant 
+* @static 
+* @type String */
+Date.DAY = "d";
+/** Date interval constant 
+* @static 
+* @type String */
+Date.MONTH = "mo";
+/** Date interval constant 
+* @static 
+* @type String */
+Date.YEAR = "y";
+
+/**
+ * Provides a convenient method of performing basic date arithmetic.  This method
+ * does not modify the Date instance being called - it creates and returns
+ * a new Date instance containing the resulting date value.
+ *
+ * Examples:
+ * <pre><code>
+//Basic usage:
+var dt = new Date('10/29/2006').add(Date.DAY, 5);
+document.write(dt); //returns 'Fri Oct 06 2006 00:00:00'
+
+//Negative values will subtract correctly:
+var dt2 = new Date('10/1/2006').add(Date.DAY, -5);
+document.write(dt2); //returns 'Tue Sep 26 2006 00:00:00'
+
+//You can even chain several calls together in one line!
+var dt3 = new Date('10/1/2006').add(Date.DAY, 5).add(Date.HOUR, 8).add(Date.MINUTE, -30);
+document.write(dt3); //returns 'Fri Oct 06 2006 07:30:00'
+ </code></pre>
+ *
+ * @param {String} interval   A valid date interval enum value
+ * @param {Number} value      The amount to add to the current date
+ * @return {Date} The new Date instance
+ */
+Date.prototype.add = function(interval, value){
+  var d = this.clone();
+  if (!interval || value === 0) return d;
+  switch(interval.toLowerCase()){
+    case Date.MILLI:
+      d.setMilliseconds(this.getMilliseconds() + value);
+      break;
+    case Date.SECOND:
+      d.setSeconds(this.getSeconds() + value);
+      break;
+    case Date.MINUTE:
+      d.setMinutes(this.getMinutes() + value);
+      break;
+    case Date.HOUR:
+      d.setHours(this.getHours() + value);
+      break;
+    case Date.DAY:
+      d.setDate(this.getDate() + value);
+      break;
+    case Date.MONTH:
+      var day = this.getDate();
+      if(day > 28){
+          day = Math.min(day, this.getFirstDateOfMonth().add('mo', value).getLastDateOfMonth().getDate());
+      }
+      d.setDate(day);
+      d.setMonth(this.getMonth() + value);
+      break;
+    case Date.YEAR:
+      d.setFullYear(this.getFullYear() + value);
+      break;
+  }
+  return d;
+};
\ No newline at end of file
diff --git a/Function.js b/Function.js
new file mode 100644 (file)
index 0000000..0abf55f
--- /dev/null
@@ -0,0 +1,136 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+
+(function() {    
+    // wrappedn so fnCleanup is not in global scope...
+    if(Roo.isIE) {
+        function fnCleanUp() {
+            var p = Function.prototype;
+            delete p.createSequence;
+            delete p.defer;
+            delete p.createDelegate;
+            delete p.createCallback;
+            delete p.createInterceptor;
+
+            window.detachEvent("onunload", fnCleanUp);
+        }
+        window.attachEvent("onunload", fnCleanUp);
+    }
+})();
+
+
+/**
+ * @class Function
+ * These functions are available on every Function object (any JavaScript function).
+ */
+Roo.apply(Function.prototype, {
+     /**
+     * Creates a callback that passes arguments[0], arguments[1], arguments[2], ...
+     * Call directly on any function. Example: <code>myFunction.createCallback(myarg, myarg2)</code>
+     * Will create a function that is bound to those 2 args.
+     * @return {Function} The new function
+    */
+    createCallback : function(/*args...*/){
+        // make args available, in function below
+        var args = arguments;
+        var method = this;
+        return function() {
+            return method.apply(window, args);
+        };
+    },
+
+    /**
+     * Creates a delegate (callback) that sets the scope to obj.
+     * Call directly on any function. Example: <code>this.myFunction.createDelegate(this)</code>
+     * Will create a function that is automatically scoped to this.
+     * @param {Object} obj (optional) The object for which the scope is set
+     * @param {Array} args (optional) Overrides arguments for the call. (Defaults to the arguments passed by the caller)
+     * @param {Boolean/Number} appendArgs (optional) if True args are appended to call args instead of overriding,
+     *                                             if a number the args are inserted at the specified position
+     * @return {Function} The new function
+     */
+    createDelegate : function(obj, args, appendArgs){
+        var method = this;
+        return function() {
+            var callArgs = args || arguments;
+            if(appendArgs === true){
+                callArgs = Array.prototype.slice.call(arguments, 0);
+                callArgs = callArgs.concat(args);
+            }else if(typeof appendArgs == "number"){
+                callArgs = Array.prototype.slice.call(arguments, 0); // copy arguments first
+                var applyArgs = [appendArgs, 0].concat(args); // create method call params
+                Array.prototype.splice.apply(callArgs, applyArgs); // splice them in
+            }
+            return method.apply(obj || window, callArgs);
+        };
+    },
+
+    /**
+     * Calls this function after the number of millseconds specified.
+     * @param {Number} millis The number of milliseconds for the setTimeout call (if 0 the function is executed immediately)
+     * @param {Object} obj (optional) The object for which the scope is set
+     * @param {Array} args (optional) Overrides arguments for the call. (Defaults to the arguments passed by the caller)
+     * @param {Boolean/Number} appendArgs (optional) if True args are appended to call args instead of overriding,
+     *                                             if a number the args are inserted at the specified position
+     * @return {Number} The timeout id that can be used with clearTimeout
+     */
+    defer : function(millis, obj, args, appendArgs){
+        var fn = this.createDelegate(obj, args, appendArgs);
+        if(millis){
+            return setTimeout(fn, millis);
+        }
+        fn();
+        return 0;
+    },
+    /**
+     * Create a combined function call sequence of the original function + the passed function.
+     * The resulting function returns the results of the original function.
+     * The passed fcn is called with the parameters of the original function
+     * @param {Function} fcn The function to sequence
+     * @param {Object} scope (optional) The scope of the passed fcn (Defaults to scope of original function or window)
+     * @return {Function} The new function
+     */
+    createSequence : function(fcn, scope){
+        if(typeof fcn != "function"){
+            return this;
+        }
+        var method = this;
+        return function() {
+            var retval = method.apply(this || window, arguments);
+            fcn.apply(scope || this || window, arguments);
+            return retval;
+        };
+    },
+
+    /**
+     * Creates an interceptor function. The passed fcn is called before the original one. If it returns false, the original one is not called.
+     * The resulting function returns the results of the original function.
+     * The passed fcn is called with the parameters of the original function.
+     * @addon
+     * @param {Function} fcn The function to call before the original
+     * @param {Object} scope (optional) The scope of the passed fcn (Defaults to scope of original function or window)
+     * @return {Function} The new function
+     */
+    createInterceptor : function(fcn, scope){
+        if(typeof fcn != "function"){
+            return this;
+        }
+        var method = this;
+        return function() {
+            fcn.target = this;
+            fcn.method = method;
+            if(fcn.apply(scope || this || window, arguments) === false){
+                return;
+            }
+            return method.apply(this || window, arguments);
+        };
+    }
+});
diff --git a/Number.js b/Number.js
new file mode 100644 (file)
index 0000000..d039a66
--- /dev/null
+++ b/Number.js
@@ -0,0 +1,27 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+
+ /**
+ * @class Number
+ */
+Roo.applyIf(Number.prototype, {
+    /**
+     * Checks whether or not the current number is within a desired range.  If the number is already within the
+     * range it is returned, otherwise the min or max value is returned depending on which side of the range is
+     * exceeded.  Note that this method returns the constrained value but does not change the current number.
+     * @param {Number} min The minimum number in the range
+     * @param {Number} max The maximum number in the range
+     * @return {Number} The constrained value if outside the range, otherwise the current value
+     */
+    constrain : function(min, max){
+        return Math.min(Math.max(this, min), max);
+    }
+});
\ No newline at end of file
diff --git a/Roo.js b/Roo.js
new file mode 100644 (file)
index 0000000..eb03477
--- /dev/null
+++ b/Roo.js
@@ -0,0 +1,557 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+
+
+
+
+// for old browsers
+window["undefined"] = window["undefined"];
+
+/**
+ * @class Roo
+ * Roo core utilities and functions.
+ * @singleton
+ */
+var Roo = {}; 
+/**
+ * Copies all the properties of config to obj.
+ * @param {Object} obj The receiver of the properties
+ * @param {Object} config The source of the properties
+ * @param {Object} defaults A different object that will also be applied for default values
+ * @return {Object} returns obj
+ * @member Roo apply
+ */
+
+Roo.apply = function(o, c, defaults){
+    if(defaults){
+        // no "this" reference for friendly out of scope calls
+        Roo.apply(o, defaults);
+    }
+    if(o && c && typeof c == 'object'){
+        for(var p in c){
+            o[p] = c[p];
+        }
+    }
+    return o;
+};
+
+
+(function(){
+    var idSeed = 0;
+    var ua = navigator.userAgent.toLowerCase();
+
+    var isStrict = document.compatMode == "CSS1Compat",
+        isOpera = ua.indexOf("opera") > -1,
+        isSafari = (/webkit|khtml/).test(ua),
+        isIE = ua.indexOf("msie") > -1,
+        isIE7 = ua.indexOf("msie 7") > -1,
+        isGecko = !isSafari && ua.indexOf("gecko") > -1,
+        isBorderBox = isIE && !isStrict,
+        isWindows = (ua.indexOf("windows") != -1 || ua.indexOf("win32") != -1),
+        isMac = (ua.indexOf("macintosh") != -1 || ua.indexOf("mac os x") != -1),
+        isLinux = (ua.indexOf("linux") != -1),
+        isSecure = window.location.href.toLowerCase().indexOf("https") === 0;
+
+    // remove css image flicker
+       if(isIE && !isIE7){
+        try{
+            document.execCommand("BackgroundImageCache", false, true);
+        }catch(e){}
+    }
+
+    Roo.apply(Roo, {
+        /**
+         * True if the browser is in strict mode
+         * @type Boolean
+         */
+        isStrict : isStrict,
+        /**
+         * True if the page is running over SSL
+         * @type Boolean
+         */
+        isSecure : isSecure,
+        /**
+         * True when the document is fully initialized and ready for action
+         * @type Boolean
+         */
+        isReady : false,
+
+        /**
+         * True to automatically uncache orphaned Roo.Elements periodically (defaults to true)
+         * @type Boolean
+         */
+        enableGarbageCollector : true,
+
+        /**
+         * True to automatically purge event listeners after uncaching an element (defaults to false).
+         * Note: this only happens if enableGarbageCollector is true.
+         * @type Boolean
+         */
+        enableListenerCollection:false,
+
+        /**
+         * URL to a blank file used by Roo when in secure mode for iframe src and onReady src to prevent
+         * the IE insecure content warning (defaults to javascript:false).
+         * @type String
+         */
+        SSL_SECURE_URL : "javascript:false",
+
+        /**
+         * URL to a 1x1 transparent gif image used by Roo to create inline icons with CSS background images. (Defaults to
+         * "http://Roojs.com/s.gif" and you should change this to a URL on your server).
+         * @type String
+         */
+        BLANK_IMAGE_URL : "http:/"+"/localhost/s.gif",
+
+        emptyFn : function(){},
+
+        /**
+         * Copies all the properties of config to obj if they don't already exist.
+         * @param {Object} obj The receiver of the properties
+         * @param {Object} config The source of the properties
+         * @return {Object} returns obj
+         */
+        applyIf : function(o, c){
+            if(o && c){
+                for(var p in c){
+                    if(typeof o[p] == "undefined"){ o[p] = c[p]; }
+                }
+            }
+            return o;
+        },
+
+        /**
+         * Applies event listeners to elements by selectors when the document is ready.
+         * The event name is specified with an @ suffix.
+<pre><code>
+Roo.addBehaviors({
+   // add a listener for click on all anchors in element with id foo
+   '#foo a@click' : function(e, t){
+       // do something
+   },
+
+   // add the same listener to multiple selectors (separated by comma BEFORE the @)
+   '#foo a, #bar span.some-class@mouseover' : function(){
+       // do something
+   }
+});
+</code></pre>
+         * @param {Object} obj The list of behaviors to apply
+         */
+        addBehaviors : function(o){
+            if(!Roo.isReady){
+                Roo.onReady(function(){
+                    Roo.addBehaviors(o);
+                });
+                return;
+            }
+            var cache = {}; // simple cache for applying multiple behaviors to same selector does query multiple times
+            for(var b in o){
+                var parts = b.split('@');
+                if(parts[1]){ // for Object prototype breakers
+                    var s = parts[0];
+                    if(!cache[s]){
+                        cache[s] = Roo.select(s);
+                    }
+                    cache[s].on(parts[1], o[b]);
+                }
+            }
+            cache = null;
+        },
+
+        /**
+         * Generates unique ids. If the element already has an id, it is unchanged
+         * @param {String/HTMLElement/Element} el (optional) The element to generate an id for
+         * @param {String} prefix (optional) Id prefix (defaults "Roo-gen")
+         * @return {String} The generated Id.
+         */
+        id : function(el, prefix){
+            prefix = prefix || "roo-gen";
+            el = Roo.getDom(el);
+            var id = prefix + (++idSeed);
+            return el ? (el.id ? el.id : (el.id = id)) : id;
+        },
+         
+       
+        /**
+         * Extends one class with another class and optionally overrides members with the passed literal. This class
+         * also adds the function "override()" to the class that can be used to override
+         * members on an instance.
+         * @param {Object} subclass The class inheriting the functionality
+         * @param {Object} superclass The class being extended
+         * @param {Object} overrides (optional) A literal with members
+         * @method extend
+         */
+        extend : function(){
+            // inline overrides
+            var io = function(o){
+                for(var m in o){
+                    this[m] = o[m];
+                }
+            };
+            return function(sb, sp, overrides){
+                if(typeof sp == 'object'){ // eg. prototype, rather than function constructor..
+                    overrides = sp;
+                    sp = sb;
+                    sb = function(){sp.apply(this, arguments);};
+                }
+                var F = function(){}, sbp, spp = sp.prototype;
+                F.prototype = spp;
+                sbp = sb.prototype = new F();
+                sbp.constructor=sb;
+                sb.superclass=spp;
+                
+                if(spp.constructor == Object.prototype.constructor){
+                    spp.constructor=sp;
+                   
+                }
+                
+                sb.override = function(o){
+                    Roo.override(sb, o);
+                };
+                sbp.override = io;
+                Roo.override(sb, overrides);
+                return sb;
+            };
+        }(),
+
+        /**
+         * Adds a list of functions to the prototype of an existing class, overwriting any existing methods with the same name.
+         * Usage:<pre><code>
+Roo.override(MyClass, {
+    newMethod1: function(){
+        // etc.
+    },
+    newMethod2: function(foo){
+        // etc.
+    }
+});
+ </code></pre>
+         * @param {Object} origclass The class to override
+         * @param {Object} overrides The list of functions to add to origClass.  This should be specified as an object literal
+         * containing one or more methods.
+         * @method override
+         */
+        override : function(origclass, overrides){
+            if(overrides){
+                var p = origclass.prototype;
+                for(var method in overrides){
+                    p[method] = overrides[method];
+                }
+            }
+        },
+        /**
+         * Creates namespaces to be used for scoping variables and classes so that they are not global.  Usage:
+         * <pre><code>
+Roo.namespace('Company', 'Company.data');
+Company.Widget = function() { ... }
+Company.data.CustomStore = function(config) { ... }
+</code></pre>
+         * @param {String} namespace1
+         * @param {String} namespace2
+         * @param {String} etc
+         * @method namespace
+         */
+        namespace : function(){
+            var a=arguments, o=null, i, j, d, rt;
+            for (i=0; i<a.length; ++i) {
+                d=a[i].split(".");
+                rt = d[0];
+                /** eval:var:o */
+                eval('if (typeof ' + rt + ' == "undefined"){' + rt + ' = {};} o = ' + rt + ';');
+                for (j=1; j<d.length; ++j) {
+                    o[d[j]]=o[d[j]] || {};
+                    o=o[d[j]];
+                }
+            }
+        },
+        /**
+         * Creates namespaces to be used for scoping variables and classes so that they are not global.  Usage:
+         * <pre><code>
+Roo.factory({ xns: Roo.data, xtype : 'Store', .....});
+Roo.factory(conf, Roo.data);
+</code></pre>
+         * @param {String} classname
+         * @param {String} namespace (optional)
+         * @method factory
+         */
+         
+        factory : function(c, ns)
+        {
+            // no xtype, no ns or c.xns - or forced off by c.xns
+            if (!c.xtype   || (!ns && !c.xns) ||  (c.xns === false)) { // not enough info...
+                return c;
+            }
+            ns = c.xns ? c.xns : ns; // if c.xns is set, then use that..
+            if (c.constructor == ns[c.xtype]) {// already created...
+                return c;
+            }
+            if (ns[c.xtype]) {
+                var ret = new ns[c.xtype](c);
+                ret.xns = false;
+                return ret;
+            }
+            c.xns = false; // prevent recursion..
+            return c;
+        },
+         
+        /**
+         * Takes an object and converts it to an encoded URL. e.g. Roo.urlEncode({foo: 1, bar: 2}); would return "foo=1&bar=2".  Optionally, property values can be arrays, instead of keys and the resulting string that's returned will contain a name/value pair for each array value.
+         * @param {Object} o
+         * @return {String}
+         */
+        urlEncode : function(o){
+            if(!o){
+                return "";
+            }
+            var buf = [];
+            for(var key in o){
+                var ov = o[key], k = encodeURIComponent(key);
+                var type = typeof ov;
+                if(type == 'undefined'){
+                    buf.push(k, "=&");
+                }else if(type != "function" && type != "object"){
+                    buf.push(k, "=", encodeURIComponent(ov), "&");
+                }else if(ov instanceof Array){
+                    if (ov.length) {
+                           for(var i = 0, len = ov.length; i < len; i++) {
+                               buf.push(k, "=", encodeURIComponent(ov[i] === undefined ? '' : ov[i]), "&");
+                           }
+                       } else {
+                           buf.push(k, "=&");
+                       }
+                }
+            }
+            buf.pop();
+            return buf.join("");
+        },
+
+        /**
+         * Takes an encoded URL and and converts it to an object. e.g. Roo.urlDecode("foo=1&bar=2"); would return {foo: 1, bar: 2} or Roo.urlDecode("foo=1&bar=2&bar=3&bar=4", true); would return {foo: 1, bar: [2, 3, 4]}.
+         * @param {String} string
+         * @param {Boolean} overwrite (optional) Items of the same name will overwrite previous values instead of creating an an array (Defaults to false).
+         * @return {Object} A literal with members
+         */
+        urlDecode : function(string, overwrite){
+            if(!string || !string.length){
+                return {};
+            }
+            var obj = {};
+            var pairs = string.split('&');
+            var pair, name, value;
+            for(var i = 0, len = pairs.length; i < len; i++){
+                pair = pairs[i].split('=');
+                name = decodeURIComponent(pair[0]);
+                value = decodeURIComponent(pair[1]);
+                if(overwrite !== true){
+                    if(typeof obj[name] == "undefined"){
+                        obj[name] = value;
+                    }else if(typeof obj[name] == "string"){
+                        obj[name] = [obj[name]];
+                        obj[name].push(value);
+                    }else{
+                        obj[name].push(value);
+                    }
+                }else{
+                    obj[name] = value;
+                }
+            }
+            return obj;
+        },
+
+        /**
+         * Iterates an array calling the passed function with each item, stopping if your function returns false. If the
+         * passed array is not really an array, your function is called once with it.
+         * The supplied function is called with (Object item, Number index, Array allItems).
+         * @param {Array/NodeList/Mixed} array
+         * @param {Function} fn
+         * @param {Object} scope
+         */
+        each : function(array, fn, scope){
+            if(typeof array.length == "undefined" || typeof array == "string"){
+                array = [array];
+            }
+            for(var i = 0, len = array.length; i < len; i++){
+                if(fn.call(scope || array[i], array[i], i, array) === false){ return i; };
+            }
+        },
+
+        // deprecated
+        combine : function(){
+            var as = arguments, l = as.length, r = [];
+            for(var i = 0; i < l; i++){
+                var a = as[i];
+                if(a instanceof Array){
+                    r = r.concat(a);
+                }else if(a.length !== undefined && !a.substr){
+                    r = r.concat(Array.prototype.slice.call(a, 0));
+                }else{
+                    r.push(a);
+                }
+            }
+            return r;
+        },
+
+        /**
+         * Escapes the passed string for use in a regular expression
+         * @param {String} str
+         * @return {String}
+         */
+        escapeRe : function(s) {
+            return s.replace(/([.*+?^${}()|[\]\/\\])/g, "\\$1");
+        },
+
+        // internal
+        callback : function(cb, scope, args, delay){
+            if(typeof cb == "function"){
+                if(delay){
+                    cb.defer(delay, scope, args || []);
+                }else{
+                    cb.apply(scope, args || []);
+                }
+            }
+        },
+
+        /**
+         * Return the dom node for the passed string (id), dom node, or Roo.Element
+         * @param {String/HTMLElement/Roo.Element} el
+         * @return HTMLElement
+         */
+        getDom : function(el){
+            if(!el){
+                return null;
+            }
+            return el.dom ? el.dom : (typeof el == 'string' ? document.getElementById(el) : el);
+        },
+
+        /**
+        * Shorthand for {@link Roo.ComponentMgr#get}
+        * @param {String} id
+        * @return Roo.Component
+        */
+        getCmp : function(id){
+            return Roo.ComponentMgr.get(id);
+        },
+
+        num : function(v, defaultValue){
+            if(typeof v != 'number'){
+                return defaultValue;
+            }
+            return v;
+        },
+
+        destroy : function(){
+            for(var i = 0, a = arguments, len = a.length; i < len; i++) {
+                var as = a[i];
+                if(as){
+                    if(as.dom){
+                        as.removeAllListeners();
+                        as.remove();
+                        continue;
+                    }
+                    if(typeof as.purgeListeners == 'function'){
+                        as.purgeListeners();
+                    }
+                    if(typeof as.destroy == 'function'){
+                        as.destroy();
+                    }
+                }
+            }
+        },
+
+        // inpired by a similar function in mootools library
+        /**
+         * Returns the type of object that is passed in. If the object passed in is null or undefined it
+         * return false otherwise it returns one of the following values:<ul>
+         * <li><b>string</b>: If the object passed is a string</li>
+         * <li><b>number</b>: If the object passed is a number</li>
+         * <li><b>boolean</b>: If the object passed is a boolean value</li>
+         * <li><b>function</b>: If the object passed is a function reference</li>
+         * <li><b>object</b>: If the object passed is an object</li>
+         * <li><b>array</b>: If the object passed is an array</li>
+         * <li><b>regexp</b>: If the object passed is a regular expression</li>
+         * <li><b>element</b>: If the object passed is a DOM Element</li>
+         * <li><b>nodelist</b>: If the object passed is a DOM NodeList</li>
+         * <li><b>textnode</b>: If the object passed is a DOM text node and contains something other than whitespace</li>
+         * <li><b>whitespace</b>: If the object passed is a DOM text node and contains only whitespace</li>
+         * @param {Mixed} object
+         * @return {String}
+         */
+        type : function(o){
+            if(o === undefined || o === null){
+                return false;
+            }
+            if(o.htmlElement){
+                return 'element';
+            }
+            var t = typeof o;
+            if(t == 'object' && o.nodeName) {
+                switch(o.nodeType) {
+                    case 1: return 'element';
+                    case 3: return (/\S/).test(o.nodeValue) ? 'textnode' : 'whitespace';
+                }
+            }
+            if(t == 'object' || t == 'function') {
+                switch(o.constructor) {
+                    case Array: return 'array';
+                    case RegExp: return 'regexp';
+                }
+                if(typeof o.length == 'number' && typeof o.item == 'function') {
+                    return 'nodelist';
+                }
+            }
+            return t;
+        },
+
+        /**
+         * Returns true if the passed value is null, undefined or an empty string (optional).
+         * @param {Mixed} value The value to test
+         * @param {Boolean} allowBlank (optional) Pass true if an empty string is not considered empty
+         * @return {Boolean}
+         */
+        isEmpty : function(v, allowBlank){
+            return v === null || v === undefined || (!allowBlank ? v === '' : false);
+        },
+        
+        /** @type Boolean */
+        isOpera : isOpera,
+        /** @type Boolean */
+        isSafari : isSafari,
+        /** @type Boolean */
+        isIE : isIE,
+        /** @type Boolean */
+        isIE7 : isIE7,
+        /** @type Boolean */
+        isGecko : isGecko,
+        /** @type Boolean */
+        isBorderBox : isBorderBox,
+        /** @type Boolean */
+        isWindows : isWindows,
+        /** @type Boolean */
+        isLinux : isLinux,
+        /** @type Boolean */
+        isMac : isMac,
+
+        /**
+         * By default, Ext intelligently decides whether floating elements should be shimmed. If you are using flash,
+         * you may want to set this to true.
+         * @type Boolean
+         */
+        useShims : ((isIE && !isIE7) || (isGecko && isMac))
+    });
+
+
+})();
+
+Roo.namespace("Roo", "Roo.util", "Roo.grid", "Roo.dd", "Roo.tree", "Roo.data",
+                "Roo.form", "Roo.menu", "Roo.state", "Roo.lib", "Roo.layout", "Roo.app", "Roo.ux");
diff --git a/Roo/Ajax.js b/Roo/Ajax.js
new file mode 100644 (file)
index 0000000..814b859
--- /dev/null
@@ -0,0 +1,97 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+/**
+ * @class Roo.Ajax
+ * @extends Roo.data.Connection
+ * Global Ajax request class.
+ *
+ * @instanceOf  Roo.data.Connection
+ */
+Roo.Ajax = new Roo.data.Connection({
+    // fix up the docs
+    
+    /**
+     * fix up scoping
+     * @scope Roo.Ajax
+     */
+    
+   /**
+     * @cfg {String} url @hide
+     */
+    /**
+     * @cfg {Object} extraParams @hide
+     */
+    /**
+     * @cfg {Object} defaultHeaders @hide
+     */
+    /**
+     * @cfg {String} method (Optional) @hide
+     */
+    /**
+     * @cfg {Number} timeout (Optional) @hide
+     */
+    /**
+     * @cfg {Boolean} autoAbort (Optional) @hide
+     */
+
+    /**
+     * @cfg {Boolean} disableCaching (Optional) @hide
+     */
+
+    /**
+     * @property  disableCaching
+     * True to add a unique cache-buster param to GET requests. (defaults to true)
+     * @type Boolean
+     */
+    /**
+     * @property  url
+     * The default URL to be used for requests to the server. (defaults to undefined)
+     * @type String
+     */
+    /**
+     * @property  extraParams
+     * An object containing properties which are used as
+     * extra parameters to each request made by this object. (defaults to undefined)
+     * @type Object
+     */
+    /**
+     * @property  defaultHeaders
+     * An object containing request headers which are added to each request made by this object. (defaults to undefined)
+     * @type Object
+     */
+    /**
+     * @property  method
+     * The default HTTP method to be used for requests. (defaults to undefined; if not set but parms are present will use POST, otherwise GET)
+     * @type String
+     */
+    /**
+     * @property  timeout
+     * The timeout in milliseconds to be used for requests. (defaults to 30000)
+     * @type Number
+     */
+
+    /**
+     * @property  autoAbort
+     * Whether a new request should abort any pending requests. (defaults to false)
+     * @type Boolean
+     */
+    autoAbort : false,
+
+    /**
+     * Serialize the passed form into a url encoded string
+     * @param {String/HTMLElement} form
+     * @return {String}
+     */
+    serializeForm : function(form){
+        return Roo.lib.Ajax.serializeForm(form);
+    }
+});
\ No newline at end of file
diff --git a/Roo/BasicDialog.js b/Roo/BasicDialog.js
new file mode 100644 (file)
index 0000000..589390a
--- /dev/null
@@ -0,0 +1,1245 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+/**
+ * @class Roo.BasicDialog
+ * @extends Roo.util.Observable
+ * Lightweight Dialog Class.  The code below shows the creation of a typical dialog using existing HTML markup:
+ * <pre><code>
+var dlg = new Roo.BasicDialog("my-dlg", {
+    height: 200,
+    width: 300,
+    minHeight: 100,
+    minWidth: 150,
+    modal: true,
+    proxyDrag: true,
+    shadow: true
+});
+dlg.addKeyListener(27, dlg.hide, dlg); // ESC can also close the dialog
+dlg.addButton('OK', dlg.hide, dlg);    // Could call a save function instead of hiding
+dlg.addButton('Cancel', dlg.hide, dlg);
+dlg.show();
+</code></pre>
+  <b>A Dialog should always be a direct child of the body element.</b>
+ * @cfg {Boolean/DomHelper} autoCreate True to auto create from scratch, or using a DomHelper Object (defaults to false)
+ * @cfg {String} title Default text to display in the title bar (defaults to null)
+ * @cfg {Number} width Width of the dialog in pixels (can also be set via CSS).  Determined by browser if unspecified.
+ * @cfg {Number} height Height of the dialog in pixels (can also be set via CSS).  Determined by browser if unspecified.
+ * @cfg {Number} x The default left page coordinate of the dialog (defaults to center screen)
+ * @cfg {Number} y The default top page coordinate of the dialog (defaults to center screen)
+ * @cfg {String/Element} animateTarget Id or element from which the dialog should animate while opening
+ * (defaults to null with no animation)
+ * @cfg {Boolean} resizable False to disable manual dialog resizing (defaults to true)
+ * @cfg {String} resizeHandles Which resize handles to display - see the {@link Roo.Resizable} handles config
+ * property for valid values (defaults to 'all')
+ * @cfg {Number} minHeight The minimum allowable height for a resizable dialog (defaults to 80)
+ * @cfg {Number} minWidth The minimum allowable width for a resizable dialog (defaults to 200)
+ * @cfg {Boolean} modal True to show the dialog modally, preventing user interaction with the rest of the page (defaults to false)
+ * @cfg {Boolean} autoScroll True to allow the dialog body contents to overflow and display scrollbars (defaults to false)
+ * @cfg {Boolean} closable False to remove the built-in top-right corner close button (defaults to true)
+ * @cfg {Boolean} collapsible False to remove the built-in top-right corner collapse button (defaults to true)
+ * @cfg {Boolean} constraintoviewport True to keep the dialog constrained within the visible viewport boundaries (defaults to true)
+ * @cfg {Boolean} syncHeightBeforeShow True to cause the dimensions to be recalculated before the dialog is shown (defaults to false)
+ * @cfg {Boolean} draggable False to disable dragging of the dialog within the viewport (defaults to true)
+ * @cfg {Boolean} autoTabs If true, all elements with class 'x-dlg-tab' will get automatically converted to tabs (defaults to false)
+ * @cfg {String} tabTag The tag name of tab elements, used when autoTabs = true (defaults to 'div')
+ * @cfg {Boolean} proxyDrag True to drag a lightweight proxy element rather than the dialog itself, used when
+ * draggable = true (defaults to false)
+ * @cfg {Boolean} fixedcenter True to ensure that anytime the dialog is shown or resized it gets centered (defaults to false)
+ * @cfg {Boolean/String} shadow True or "sides" for the default effect, "frame" for 4-way shadow, and "drop" for bottom-right
+ * shadow (defaults to false)
+ * @cfg {Number} shadowOffset The number of pixels to offset the shadow if displayed (defaults to 5)
+ * @cfg {String} buttonAlign Valid values are "left," "center" and "right" (defaults to "right")
+ * @cfg {Number} minButtonWidth Minimum width of all dialog buttons (defaults to 75)
+ * @cfg {Array} buttons Array of buttons
+ * @cfg {Boolean} shim True to create an iframe shim that prevents selects from showing through (defaults to false)
+ * @constructor
+ * Create a new BasicDialog.
+ * @param {String/HTMLElement/Roo.Element} el The container element or DOM node, or its id
+ * @param {Object} config Configuration options
+ */
+Roo.BasicDialog = function(el, config){
+    this.el = Roo.get(el);
+    var dh = Roo.DomHelper;
+    if(!this.el && config && config.autoCreate){
+        if(typeof config.autoCreate == "object"){
+            if(!config.autoCreate.id){
+                config.autoCreate.id = el;
+            }
+            this.el = dh.append(document.body,
+                        config.autoCreate, true);
+        }else{
+            this.el = dh.append(document.body,
+                        {tag: "div", id: el, style:'visibility:hidden;'}, true);
+        }
+    }
+    el = this.el;
+    el.setDisplayed(true);
+    el.hide = this.hideAction;
+    this.id = el.id;
+    el.addClass("x-dlg");
+
+    Roo.apply(this, config);
+
+    this.proxy = el.createProxy("x-dlg-proxy");
+    this.proxy.hide = this.hideAction;
+    this.proxy.setOpacity(.5);
+    this.proxy.hide();
+
+    if(config.width){
+        el.setWidth(config.width);
+    }
+    if(config.height){
+        el.setHeight(config.height);
+    }
+    this.size = el.getSize();
+    if(typeof config.x != "undefined" && typeof config.y != "undefined"){
+        this.xy = [config.x,config.y];
+    }else{
+        this.xy = el.getCenterXY(true);
+    }
+    /** The header element @type Roo.Element */
+    this.header = el.child("> .x-dlg-hd");
+    /** The body element @type Roo.Element */
+    this.body = el.child("> .x-dlg-bd");
+    /** The footer element @type Roo.Element */
+    this.footer = el.child("> .x-dlg-ft");
+
+    if(!this.header){
+        this.header = el.createChild({tag: "div", cls:"x-dlg-hd", html: "&#160;"}, this.body ? this.body.dom : null);
+    }
+    if(!this.body){
+        this.body = el.createChild({tag: "div", cls:"x-dlg-bd"});
+    }
+
+    this.header.unselectable();
+    if(this.title){
+        this.header.update(this.title);
+    }
+    // this element allows the dialog to be focused for keyboard event
+    this.focusEl = el.createChild({tag: "a", href:"#", cls:"x-dlg-focus", tabIndex:"-1"});
+    this.focusEl.swallowEvent("click", true);
+
+    this.header.wrap({cls:"x-dlg-hd-right"}).wrap({cls:"x-dlg-hd-left"}, true);
+
+    // wrap the body and footer for special rendering
+    this.bwrap = this.body.wrap({tag: "div", cls:"x-dlg-dlg-body"});
+    if(this.footer){
+        this.bwrap.dom.appendChild(this.footer.dom);
+    }
+
+    this.bg = this.el.createChild({
+        tag: "div", cls:"x-dlg-bg",
+        html: '<div class="x-dlg-bg-left"><div class="x-dlg-bg-right"><div class="x-dlg-bg-center">&#160;</div></div></div>'
+    });
+    this.centerBg = this.bg.child("div.x-dlg-bg-center");
+
+
+    if(this.autoScroll !== false && !this.autoTabs){
+        this.body.setStyle("overflow", "auto");
+    }
+
+    this.toolbox = this.el.createChild({cls: "x-dlg-toolbox"});
+
+    if(this.closable !== false){
+        this.el.addClass("x-dlg-closable");
+        this.close = this.toolbox.createChild({cls:"x-dlg-close"});
+        this.close.on("click", this.closeClick, this);
+        this.close.addClassOnOver("x-dlg-close-over");
+    }
+    if(this.collapsible !== false){
+        this.collapseBtn = this.toolbox.createChild({cls:"x-dlg-collapse"});
+        this.collapseBtn.on("click", this.collapseClick, this);
+        this.collapseBtn.addClassOnOver("x-dlg-collapse-over");
+        this.header.on("dblclick", this.collapseClick, this);
+    }
+    if(this.resizable !== false){
+        this.el.addClass("x-dlg-resizable");
+        this.resizer = new Roo.Resizable(el, {
+            minWidth: this.minWidth || 80,
+            minHeight:this.minHeight || 80,
+            handles: this.resizeHandles || "all",
+            pinned: true
+        });
+        this.resizer.on("beforeresize", this.beforeResize, this);
+        this.resizer.on("resize", this.onResize, this);
+    }
+    if(this.draggable !== false){
+        el.addClass("x-dlg-draggable");
+        if (!this.proxyDrag) {
+            var dd = new Roo.dd.DD(el.dom.id, "WindowDrag");
+        }
+        else {
+            var dd = new Roo.dd.DDProxy(el.dom.id, "WindowDrag", {dragElId: this.proxy.id});
+        }
+        dd.setHandleElId(this.header.id);
+        dd.endDrag = this.endMove.createDelegate(this);
+        dd.startDrag = this.startMove.createDelegate(this);
+        dd.onDrag = this.onDrag.createDelegate(this);
+        dd.scroll = false;
+        this.dd = dd;
+    }
+    if(this.modal){
+        this.mask = dh.append(document.body, {tag: "div", cls:"x-dlg-mask"}, true);
+        this.mask.enableDisplayMode("block");
+        this.mask.hide();
+        this.el.addClass("x-dlg-modal");
+    }
+    if(this.shadow){
+        this.shadow = new Roo.Shadow({
+            mode : typeof this.shadow == "string" ? this.shadow : "sides",
+            offset : this.shadowOffset
+        });
+    }else{
+        this.shadowOffset = 0;
+    }
+    if(Roo.useShims && this.shim !== false){
+        this.shim = this.el.createShim();
+        this.shim.hide = this.hideAction;
+        this.shim.hide();
+    }else{
+        this.shim = false;
+    }
+    if(this.autoTabs){
+        this.initTabs();
+    }
+    if (this.buttons) { 
+        var bts= this.buttons;
+        this.buttons = [];
+        Roo.each(bts, function(b) {
+            this.addButton(b);
+        }, this);
+    }
+    
+    
+    this.addEvents({
+        /**
+         * @event keydown
+         * Fires when a key is pressed
+         * @param {Roo.BasicDialog} this
+         * @param {Roo.EventObject} e
+         */
+        "keydown" : true,
+        /**
+         * @event move
+         * Fires when this dialog is moved by the user.
+         * @param {Roo.BasicDialog} this
+         * @param {Number} x The new page X
+         * @param {Number} y The new page Y
+         */
+        "move" : true,
+        /**
+         * @event resize
+         * Fires when this dialog is resized by the user.
+         * @param {Roo.BasicDialog} this
+         * @param {Number} width The new width
+         * @param {Number} height The new height
+         */
+        "resize" : true,
+        /**
+         * @event beforehide
+         * Fires before this dialog is hidden.
+         * @param {Roo.BasicDialog} this
+         */
+        "beforehide" : true,
+        /**
+         * @event hide
+         * Fires when this dialog is hidden.
+         * @param {Roo.BasicDialog} this
+         */
+        "hide" : true,
+        /**
+         * @event beforeshow
+         * Fires before this dialog is shown.
+         * @param {Roo.BasicDialog} this
+         */
+        "beforeshow" : true,
+        /**
+         * @event show
+         * Fires when this dialog is shown.
+         * @param {Roo.BasicDialog} this
+         */
+        "show" : true
+    });
+    el.on("keydown", this.onKeyDown, this);
+    el.on("mousedown", this.toFront, this);
+    Roo.EventManager.onWindowResize(this.adjustViewport, this, true);
+    this.el.hide();
+    Roo.DialogManager.register(this);
+    Roo.BasicDialog.superclass.constructor.call(this);
+};
+
+Roo.extend(Roo.BasicDialog, Roo.util.Observable, {
+    shadowOffset: Roo.isIE ? 6 : 5,
+    minHeight: 80,
+    minWidth: 200,
+    minButtonWidth: 75,
+    defaultButton: null,
+    buttonAlign: "right",
+    tabTag: 'div',
+    firstShow: true,
+
+    /**
+     * Sets the dialog title text
+     * @param {String} text The title text to display
+     * @return {Roo.BasicDialog} this
+     */
+    setTitle : function(text){
+        this.header.update(text);
+        return this;
+    },
+
+    // private
+    closeClick : function(){
+        this.hide();
+    },
+
+    // private
+    collapseClick : function(){
+        this[this.collapsed ? "expand" : "collapse"]();
+    },
+
+    /**
+     * Collapses the dialog to its minimized state (only the title bar is visible).
+     * Equivalent to the user clicking the collapse dialog button.
+     */
+    collapse : function(){
+        if(!this.collapsed){
+            this.collapsed = true;
+            this.el.addClass("x-dlg-collapsed");
+            this.restoreHeight = this.el.getHeight();
+            this.resizeTo(this.el.getWidth(), this.header.getHeight());
+        }
+    },
+
+    /**
+     * Expands a collapsed dialog back to its normal state.  Equivalent to the user
+     * clicking the expand dialog button.
+     */
+    expand : function(){
+        if(this.collapsed){
+            this.collapsed = false;
+            this.el.removeClass("x-dlg-collapsed");
+            this.resizeTo(this.el.getWidth(), this.restoreHeight);
+        }
+    },
+
+    /**
+     * Reinitializes the tabs component, clearing out old tabs and finding new ones.
+     * @return {Roo.TabPanel} The tabs component
+     */
+    initTabs : function(){
+        var tabs = this.getTabs();
+        while(tabs.getTab(0)){
+            tabs.removeTab(0);
+        }
+        this.el.select(this.tabTag+'.x-dlg-tab').each(function(el){
+            var dom = el.dom;
+            tabs.addTab(Roo.id(dom), dom.title);
+            dom.title = "";
+        });
+        tabs.activate(0);
+        return tabs;
+    },
+
+    // private
+    beforeResize : function(){
+        this.resizer.minHeight = Math.max(this.minHeight, this.getHeaderFooterHeight(true)+40);
+    },
+
+    // private
+    onResize : function(){
+        this.refreshSize();
+        this.syncBodyHeight();
+        this.adjustAssets();
+        this.focus();
+        this.fireEvent("resize", this, this.size.width, this.size.height);
+    },
+
+    // private
+    onKeyDown : function(e){
+        if(this.isVisible()){
+            this.fireEvent("keydown", this, e);
+        }
+    },
+
+    /**
+     * Resizes the dialog.
+     * @param {Number} width
+     * @param {Number} height
+     * @return {Roo.BasicDialog} this
+     */
+    resizeTo : function(width, height){
+        this.el.setSize(width, height);
+        this.size = {width: width, height: height};
+        this.syncBodyHeight();
+        if(this.fixedcenter){
+            this.center();
+        }
+        if(this.isVisible()){
+            this.constrainXY();
+            this.adjustAssets();
+        }
+        this.fireEvent("resize", this, width, height);
+        return this;
+    },
+
+
+    /**
+     * Resizes the dialog to fit the specified content size.
+     * @param {Number} width
+     * @param {Number} height
+     * @return {Roo.BasicDialog} this
+     */
+    setContentSize : function(w, h){
+        h += this.getHeaderFooterHeight() + this.body.getMargins("tb");
+        w += this.body.getMargins("lr") + this.bwrap.getMargins("lr") + this.centerBg.getPadding("lr");
+        //if(!this.el.isBorderBox()){
+            h +=  this.body.getPadding("tb") + this.bwrap.getBorderWidth("tb") + this.body.getBorderWidth("tb") + this.el.getBorderWidth("tb");
+            w += this.body.getPadding("lr") + this.bwrap.getBorderWidth("lr") + this.body.getBorderWidth("lr") + this.bwrap.getPadding("lr") + this.el.getBorderWidth("lr");
+        //}
+        if(this.tabs){
+            h += this.tabs.stripWrap.getHeight() + this.tabs.bodyEl.getMargins("tb") + this.tabs.bodyEl.getPadding("tb");
+            w += this.tabs.bodyEl.getMargins("lr") + this.tabs.bodyEl.getPadding("lr");
+        }
+        this.resizeTo(w, h);
+        return this;
+    },
+
+    /**
+     * Adds a key listener for when this dialog is displayed.  This allows you to hook in a function that will be
+     * executed in response to a particular key being pressed while the dialog is active.
+     * @param {Number/Array/Object} key Either the numeric key code, array of key codes or an object with the following options:
+     *                                  {key: (number or array), shift: (true/false), ctrl: (true/false), alt: (true/false)}
+     * @param {Function} fn The function to call
+     * @param {Object} scope (optional) The scope of the function
+     * @return {Roo.BasicDialog} this
+     */
+    addKeyListener : function(key, fn, scope){
+        var keyCode, shift, ctrl, alt;
+        if(typeof key == "object" && !(key instanceof Array)){
+            keyCode = key["key"];
+            shift = key["shift"];
+            ctrl = key["ctrl"];
+            alt = key["alt"];
+        }else{
+            keyCode = key;
+        }
+        var handler = function(dlg, e){
+            if((!shift || e.shiftKey) && (!ctrl || e.ctrlKey) &&  (!alt || e.altKey)){
+                var k = e.getKey();
+                if(keyCode instanceof Array){
+                    for(var i = 0, len = keyCode.length; i < len; i++){
+                        if(keyCode[i] == k){
+                          fn.call(scope || window, dlg, k, e);
+                          return;
+                        }
+                    }
+                }else{
+                    if(k == keyCode){
+                        fn.call(scope || window, dlg, k, e);
+                    }
+                }
+            }
+        };
+        this.on("keydown", handler);
+        return this;
+    },
+
+    /**
+     * Returns the TabPanel component (creates it if it doesn't exist).
+     * Note: If you wish to simply check for the existence of tabs without creating them,
+     * check for a null 'tabs' property.
+     * @return {Roo.TabPanel} The tabs component
+     */
+    getTabs : function(){
+        if(!this.tabs){
+            this.el.addClass("x-dlg-auto-tabs");
+            this.body.addClass(this.tabPosition == "bottom" ? "x-tabs-bottom" : "x-tabs-top");
+            this.tabs = new Roo.TabPanel(this.body.dom, this.tabPosition == "bottom");
+        }
+        return this.tabs;
+    },
+
+    /**
+     * Adds a button to the footer section of the dialog.
+     * @param {String/Object} config A string becomes the button text, an object can either be a Button config
+     * object or a valid Roo.DomHelper element config
+     * @param {Function} handler The function called when the button is clicked
+     * @param {Object} scope (optional) The scope of the handler function (accepts position as a property)
+     * @return {Roo.Button} The new button
+     */
+    addButton : function(config, handler, scope){
+        var dh = Roo.DomHelper;
+        if(!this.footer){
+            this.footer = dh.append(this.bwrap, {tag: "div", cls:"x-dlg-ft"}, true);
+        }
+        if(!this.btnContainer){
+            var tb = this.footer.createChild({
+
+                cls:"x-dlg-btns x-dlg-btns-"+this.buttonAlign,
+                html:'<table cellspacing="0"><tbody><tr></tr></tbody></table><div class="x-clear"></div>'
+            }, null, true);
+            this.btnContainer = tb.firstChild.firstChild.firstChild;
+        }
+        var bconfig = {
+            handler: handler,
+            scope: scope,
+            minWidth: this.minButtonWidth,
+            hideParent:true
+        };
+        if(typeof config == "string"){
+            bconfig.text = config;
+        }else{
+            if(config.tag){
+                bconfig.dhconfig = config;
+            }else{
+                Roo.apply(bconfig, config);
+            }
+        }
+        var fc = false;
+        if ((typeof(bconfig.position) != 'undefined') && bconfig.position < this.btnContainer.childNodes.length-1) {
+            bconfig.position = Math.max(0, bconfig.position);
+            fc = this.btnContainer.childNodes[bconfig.position];
+        }
+         
+        var btn = new Roo.Button(
+            fc ? 
+                this.btnContainer.insertBefore(document.createElement("td"),fc)
+                : this.btnContainer.appendChild(document.createElement("td")),
+            //Roo.get(this.btnContainer).createChild( { tag: 'td'},  fc ),
+            bconfig
+        );
+        this.syncBodyHeight();
+        if(!this.buttons){
+            /**
+             * Array of all the buttons that have been added to this dialog via addButton
+             * @type Array
+             */
+            this.buttons = [];
+        }
+        this.buttons.push(btn);
+        return btn;
+    },
+
+    /**
+     * Sets the default button to be focused when the dialog is displayed.
+     * @param {Roo.BasicDialog.Button} btn The button object returned by {@link #addButton}
+     * @return {Roo.BasicDialog} this
+     */
+    setDefaultButton : function(btn){
+        this.defaultButton = btn;
+        return this;
+    },
+
+    // private
+    getHeaderFooterHeight : function(safe){
+        var height = 0;
+        if(this.header){
+           height += this.header.getHeight();
+        }
+        if(this.footer){
+           var fm = this.footer.getMargins();
+            height += (this.footer.getHeight()+fm.top+fm.bottom);
+        }
+        height += this.bwrap.getPadding("tb")+this.bwrap.getBorderWidth("tb");
+        height += this.centerBg.getPadding("tb");
+        return height;
+    },
+
+    // private
+    syncBodyHeight : function(){
+        var bd = this.body, cb = this.centerBg, bw = this.bwrap;
+        var height = this.size.height - this.getHeaderFooterHeight(false);
+        bd.setHeight(height-bd.getMargins("tb"));
+        var hh = this.header.getHeight();
+        var h = this.size.height-hh;
+        cb.setHeight(h);
+        bw.setLeftTop(cb.getPadding("l"), hh+cb.getPadding("t"));
+        bw.setHeight(h-cb.getPadding("tb"));
+        bw.setWidth(this.el.getWidth(true)-cb.getPadding("lr"));
+        bd.setWidth(bw.getWidth(true));
+        if(this.tabs){
+            this.tabs.syncHeight();
+            if(Roo.isIE){
+                this.tabs.el.repaint();
+            }
+        }
+    },
+
+    /**
+     * Restores the previous state of the dialog if Roo.state is configured.
+     * @return {Roo.BasicDialog} this
+     */
+    restoreState : function(){
+        var box = Roo.state.Manager.get(this.stateId || (this.el.id + "-state"));
+        if(box && box.width){
+            this.xy = [box.x, box.y];
+            this.resizeTo(box.width, box.height);
+        }
+        return this;
+    },
+
+    // private
+    beforeShow : function(){
+        this.expand();
+        if(this.fixedcenter){
+            this.xy = this.el.getCenterXY(true);
+        }
+        if(this.modal){
+            Roo.get(document.body).addClass("x-body-masked");
+            this.mask.setSize(Roo.lib.Dom.getViewWidth(true), Roo.lib.Dom.getViewHeight(true));
+            this.mask.show();
+        }
+        this.constrainXY();
+    },
+
+    // private
+    animShow : function(){
+        var b = Roo.get(this.animateTarget, true).getBox();
+        this.proxy.setSize(b.width, b.height);
+        this.proxy.setLocation(b.x, b.y);
+        this.proxy.show();
+        this.proxy.setBounds(this.xy[0], this.xy[1], this.size.width, this.size.height,
+                    true, .35, this.showEl.createDelegate(this));
+    },
+
+    /**
+     * Shows the dialog.
+     * @param {String/HTMLElement/Roo.Element} animateTarget (optional) Reset the animation target
+     * @return {Roo.BasicDialog} this
+     */
+    show : function(animateTarget){
+        if (this.fireEvent("beforeshow", this) === false){
+            return;
+        }
+        if(this.syncHeightBeforeShow){
+            this.syncBodyHeight();
+        }else if(this.firstShow){
+            this.firstShow = false;
+            this.syncBodyHeight(); // sync the height on the first show instead of in the constructor
+        }
+        this.animateTarget = animateTarget || this.animateTarget;
+        if(!this.el.isVisible()){
+            this.beforeShow();
+            if(this.animateTarget){
+                this.animShow();
+            }else{
+                this.showEl();
+            }
+        }
+        return this;
+    },
+
+    // private
+    showEl : function(){
+        this.proxy.hide();
+        this.el.setXY(this.xy);
+        this.el.show();
+        this.adjustAssets(true);
+        this.toFront();
+        this.focus();
+        // IE peekaboo bug - fix found by Dave Fenwick
+        if(Roo.isIE){
+            this.el.repaint();
+        }
+        this.fireEvent("show", this);
+    },
+
+    /**
+     * Focuses the dialog.  If a defaultButton is set, it will receive focus, otherwise the
+     * dialog itself will receive focus.
+     */
+    focus : function(){
+        if(this.defaultButton){
+            this.defaultButton.focus();
+        }else{
+            this.focusEl.focus();
+        }
+    },
+
+    // private
+    constrainXY : function(){
+        if(this.constraintoviewport !== false){
+            if(!this.viewSize){
+                if(this.container){
+                    var s = this.container.getSize();
+                    this.viewSize = [s.width, s.height];
+                }else{
+                    this.viewSize = [Roo.lib.Dom.getViewWidth(),Roo.lib.Dom.getViewHeight()];
+                }
+            }
+            var s = Roo.get(this.container||document).getScroll();
+
+            var x = this.xy[0], y = this.xy[1];
+            var w = this.size.width, h = this.size.height;
+            var vw = this.viewSize[0], vh = this.viewSize[1];
+            // only move it if it needs it
+            var moved = false;
+            // first validate right/bottom
+            if(x + w > vw+s.left){
+                x = vw - w;
+                moved = true;
+            }
+            if(y + h > vh+s.top){
+                y = vh - h;
+                moved = true;
+            }
+            // then make sure top/left isn't negative
+            if(x < s.left){
+                x = s.left;
+                moved = true;
+            }
+            if(y < s.top){
+                y = s.top;
+                moved = true;
+            }
+            if(moved){
+                // cache xy
+                this.xy = [x, y];
+                if(this.isVisible()){
+                    this.el.setLocation(x, y);
+                    this.adjustAssets();
+                }
+            }
+        }
+    },
+
+    // private
+    onDrag : function(){
+        if(!this.proxyDrag){
+            this.xy = this.el.getXY();
+            this.adjustAssets();
+        }
+    },
+
+    // private
+    adjustAssets : function(doShow){
+        var x = this.xy[0], y = this.xy[1];
+        var w = this.size.width, h = this.size.height;
+        if(doShow === true){
+            if(this.shadow){
+                this.shadow.show(this.el);
+            }
+            if(this.shim){
+                this.shim.show();
+            }
+        }
+        if(this.shadow && this.shadow.isVisible()){
+            this.shadow.show(this.el);
+        }
+        if(this.shim && this.shim.isVisible()){
+            this.shim.setBounds(x, y, w, h);
+        }
+    },
+
+    // private
+    adjustViewport : function(w, h){
+        if(!w || !h){
+            w = Roo.lib.Dom.getViewWidth();
+            h = Roo.lib.Dom.getViewHeight();
+        }
+        // cache the size
+        this.viewSize = [w, h];
+        if(this.modal && this.mask.isVisible()){
+            this.mask.setSize(w, h); // first make sure the mask isn't causing overflow
+            this.mask.setSize(Roo.lib.Dom.getViewWidth(true), Roo.lib.Dom.getViewHeight(true));
+        }
+        if(this.isVisible()){
+            this.constrainXY();
+        }
+    },
+
+    /**
+     * Destroys this dialog and all its supporting elements (including any tabs, shim,
+     * shadow, proxy, mask, etc.)  Also removes all event listeners.
+     * @param {Boolean} removeEl (optional) true to remove the element from the DOM
+     */
+    destroy : function(removeEl){
+        if(this.isVisible()){
+            this.animateTarget = null;
+            this.hide();
+        }
+        Roo.EventManager.removeResizeListener(this.adjustViewport, this);
+        if(this.tabs){
+            this.tabs.destroy(removeEl);
+        }
+        Roo.destroy(
+             this.shim,
+             this.proxy,
+             this.resizer,
+             this.close,
+             this.mask
+        );
+        if(this.dd){
+            this.dd.unreg();
+        }
+        if(this.buttons){
+           for(var i = 0, len = this.buttons.length; i < len; i++){
+               this.buttons[i].destroy();
+           }
+        }
+        this.el.removeAllListeners();
+        if(removeEl === true){
+            this.el.update("");
+            this.el.remove();
+        }
+        Roo.DialogManager.unregister(this);
+    },
+
+    // private
+    startMove : function(){
+        if(this.proxyDrag){
+            this.proxy.show();
+        }
+        if(this.constraintoviewport !== false){
+            this.dd.constrainTo(document.body, {right: this.shadowOffset, bottom: this.shadowOffset});
+        }
+    },
+
+    // private
+    endMove : function(){
+        if(!this.proxyDrag){
+            Roo.dd.DD.prototype.endDrag.apply(this.dd, arguments);
+        }else{
+            Roo.dd.DDProxy.prototype.endDrag.apply(this.dd, arguments);
+            this.proxy.hide();
+        }
+        this.refreshSize();
+        this.adjustAssets();
+        this.focus();
+        this.fireEvent("move", this, this.xy[0], this.xy[1]);
+    },
+
+    /**
+     * Brings this dialog to the front of any other visible dialogs
+     * @return {Roo.BasicDialog} this
+     */
+    toFront : function(){
+        Roo.DialogManager.bringToFront(this);
+        return this;
+    },
+
+    /**
+     * Sends this dialog to the back (under) of any other visible dialogs
+     * @return {Roo.BasicDialog} this
+     */
+    toBack : function(){
+        Roo.DialogManager.sendToBack(this);
+        return this;
+    },
+
+    /**
+     * Centers this dialog in the viewport
+     * @return {Roo.BasicDialog} this
+     */
+    center : function(){
+        var xy = this.el.getCenterXY(true);
+        this.moveTo(xy[0], xy[1]);
+        return this;
+    },
+
+    /**
+     * Moves the dialog's top-left corner to the specified point
+     * @param {Number} x
+     * @param {Number} y
+     * @return {Roo.BasicDialog} this
+     */
+    moveTo : function(x, y){
+        this.xy = [x,y];
+        if(this.isVisible()){
+            this.el.setXY(this.xy);
+            this.adjustAssets();
+        }
+        return this;
+    },
+
+    /**
+     * Aligns the dialog to the specified element
+     * @param {String/HTMLElement/Roo.Element} element The element to align to.
+     * @param {String} position The position to align to (see {@link Roo.Element#alignTo} for more details).
+     * @param {Array} offsets (optional) Offset the positioning by [x, y]
+     * @return {Roo.BasicDialog} this
+     */
+    alignTo : function(element, position, offsets){
+        this.xy = this.el.getAlignToXY(element, position, offsets);
+        if(this.isVisible()){
+            this.el.setXY(this.xy);
+            this.adjustAssets();
+        }
+        return this;
+    },
+
+    /**
+     * Anchors an element to another element and realigns it when the window is resized.
+     * @param {String/HTMLElement/Roo.Element} element The element to align to.
+     * @param {String} position The position to align to (see {@link Roo.Element#alignTo} for more details)
+     * @param {Array} offsets (optional) Offset the positioning by [x, y]
+     * @param {Boolean/Number} monitorScroll (optional) true to monitor body scroll and reposition. If this parameter
+     * is a number, it is used as the buffer delay (defaults to 50ms).
+     * @return {Roo.BasicDialog} this
+     */
+    anchorTo : function(el, alignment, offsets, monitorScroll){
+        var action = function(){
+            this.alignTo(el, alignment, offsets);
+        };
+        Roo.EventManager.onWindowResize(action, this);
+        var tm = typeof monitorScroll;
+        if(tm != 'undefined'){
+            Roo.EventManager.on(window, 'scroll', action, this,
+                {buffer: tm == 'number' ? monitorScroll : 50});
+        }
+        action.call(this);
+        return this;
+    },
+
+    /**
+     * Returns true if the dialog is visible
+     * @return {Boolean}
+     */
+    isVisible : function(){
+        return this.el.isVisible();
+    },
+
+    // private
+    animHide : function(callback){
+        var b = Roo.get(this.animateTarget).getBox();
+        this.proxy.show();
+        this.proxy.setBounds(this.xy[0], this.xy[1], this.size.width, this.size.height);
+        this.el.hide();
+        this.proxy.setBounds(b.x, b.y, b.width, b.height, true, .35,
+                    this.hideEl.createDelegate(this, [callback]));
+    },
+
+    /**
+     * Hides the dialog.
+     * @param {Function} callback (optional) Function to call when the dialog is hidden
+     * @return {Roo.BasicDialog} this
+     */
+    hide : function(callback){
+        if (this.fireEvent("beforehide", this) === false){
+            return;
+        }
+        if(this.shadow){
+            this.shadow.hide();
+        }
+        if(this.shim) {
+          this.shim.hide();
+        }
+        if(this.animateTarget){
+           this.animHide(callback);
+        }else{
+            this.el.hide();
+            this.hideEl(callback);
+        }
+        return this;
+    },
+
+    // private
+    hideEl : function(callback){
+        this.proxy.hide();
+        if(this.modal){
+            this.mask.hide();
+            Roo.get(document.body).removeClass("x-body-masked");
+        }
+        this.fireEvent("hide", this);
+        if(typeof callback == "function"){
+            callback();
+        }
+    },
+
+    // private
+    hideAction : function(){
+        this.setLeft("-10000px");
+        this.setTop("-10000px");
+        this.setStyle("visibility", "hidden");
+    },
+
+    // private
+    refreshSize : function(){
+        this.size = this.el.getSize();
+        this.xy = this.el.getXY();
+        Roo.state.Manager.set(this.stateId || this.el.id + "-state", this.el.getBox());
+    },
+
+    // private
+    // z-index is managed by the DialogManager and may be overwritten at any time
+    setZIndex : function(index){
+        if(this.modal){
+            this.mask.setStyle("z-index", index);
+        }
+        if(this.shim){
+            this.shim.setStyle("z-index", ++index);
+        }
+        if(this.shadow){
+            this.shadow.setZIndex(++index);
+        }
+        this.el.setStyle("z-index", ++index);
+        if(this.proxy){
+            this.proxy.setStyle("z-index", ++index);
+        }
+        if(this.resizer){
+            this.resizer.proxy.setStyle("z-index", ++index);
+        }
+
+        this.lastZIndex = index;
+    },
+
+    /**
+     * Returns the element for this dialog
+     * @return {Roo.Element} The underlying dialog Element
+     */
+    getEl : function(){
+        return this.el;
+    }
+});
+
+/**
+ * @class Roo.DialogManager
+ * Provides global access to BasicDialogs that have been created and
+ * support for z-indexing (layering) multiple open dialogs.
+ */
+Roo.DialogManager = function(){
+    var list = {};
+    var accessList = [];
+    var front = null;
+
+    // private
+    var sortDialogs = function(d1, d2){
+        return (!d1._lastAccess || d1._lastAccess < d2._lastAccess) ? -1 : 1;
+    };
+
+    // private
+    var orderDialogs = function(){
+        accessList.sort(sortDialogs);
+        var seed = Roo.DialogManager.zseed;
+        for(var i = 0, len = accessList.length; i < len; i++){
+            var dlg = accessList[i];
+            if(dlg){
+                dlg.setZIndex(seed + (i*10));
+            }
+        }
+    };
+
+    return {
+        /**
+         * The starting z-index for BasicDialogs (defaults to 9000)
+         * @type Number The z-index value
+         */
+        zseed : 9000,
+
+        // private
+        register : function(dlg){
+            list[dlg.id] = dlg;
+            accessList.push(dlg);
+        },
+
+        // private
+        unregister : function(dlg){
+            delete list[dlg.id];
+            var i=0;
+            var len=0;
+            if(!accessList.indexOf){
+                for(  i = 0, len = accessList.length; i < len; i++){
+                    if(accessList[i] == dlg){
+                        accessList.splice(i, 1);
+                        return;
+                    }
+                }
+            }else{
+                 i = accessList.indexOf(dlg);
+                if(i != -1){
+                    accessList.splice(i, 1);
+                }
+            }
+        },
+
+        /**
+         * Gets a registered dialog by id
+         * @param {String/Object} id The id of the dialog or a dialog
+         * @return {Roo.BasicDialog} this
+         */
+        get : function(id){
+            return typeof id == "object" ? id : list[id];
+        },
+
+        /**
+         * Brings the specified dialog to the front
+         * @param {String/Object} dlg The id of the dialog or a dialog
+         * @return {Roo.BasicDialog} this
+         */
+        bringToFront : function(dlg){
+            dlg = this.get(dlg);
+            if(dlg != front){
+                front = dlg;
+                dlg._lastAccess = new Date().getTime();
+                orderDialogs();
+            }
+            return dlg;
+        },
+
+        /**
+         * Sends the specified dialog to the back
+         * @param {String/Object} dlg The id of the dialog or a dialog
+         * @return {Roo.BasicDialog} this
+         */
+        sendToBack : function(dlg){
+            dlg = this.get(dlg);
+            dlg._lastAccess = -(new Date().getTime());
+            orderDialogs();
+            return dlg;
+        },
+
+        /**
+         * Hides all dialogs
+         */
+        hideAll : function(){
+            for(var id in list){
+                if(list[id] && typeof list[id] != "function" && list[id].isVisible()){
+                    list[id].hide();
+                }
+            }
+        }
+    };
+}();
+
+/**
+ * @class Roo.LayoutDialog
+ * @extends Roo.BasicDialog
+ * Dialog which provides adjustments for working with a layout in a Dialog.
+ * Add your necessary layout config options to the dialog's config.<br>
+ * Example usage (including a nested layout):
+ * <pre><code>
+if(!dialog){
+    dialog = new Roo.LayoutDialog("download-dlg", {
+        modal: true,
+        width:600,
+        height:450,
+        shadow:true,
+        minWidth:500,
+        minHeight:350,
+        autoTabs:true,
+        proxyDrag:true,
+        // layout config merges with the dialog config
+        center:{
+            tabPosition: "top",
+            alwaysShowTabs: true
+        }
+    });
+    dialog.addKeyListener(27, dialog.hide, dialog);
+    dialog.setDefaultButton(dialog.addButton("Close", dialog.hide, dialog));
+    dialog.addButton("Build It!", this.getDownload, this);
+
+    // we can even add nested layouts
+    var innerLayout = new Roo.BorderLayout("dl-inner", {
+        east: {
+            initialSize: 200,
+            autoScroll:true,
+            split:true
+        },
+        center: {
+            autoScroll:true
+        }
+    });
+    innerLayout.beginUpdate();
+    innerLayout.add("east", new Roo.ContentPanel("dl-details"));
+    innerLayout.add("center", new Roo.ContentPanel("selection-panel"));
+    innerLayout.endUpdate(true);
+
+    var layout = dialog.getLayout();
+    layout.beginUpdate();
+    layout.add("center", new Roo.ContentPanel("standard-panel",
+                        {title: "Download the Source", fitToFrame:true}));
+    layout.add("center", new Roo.NestedLayoutPanel(innerLayout,
+               {title: "Build your own roo.js"}));
+    layout.getRegion("center").showPanel(sp);
+    layout.endUpdate();
+}
+</code></pre>
+    * @constructor
+    * @param {String/HTMLElement/Roo.Element} el The id of or container element, or config
+    * @param {Object} config configuration options
+  */
+Roo.LayoutDialog = function(el, cfg){
+    
+    var config=  cfg;
+    if (typeof(cfg) == 'undefined') {
+        config = Roo.apply({}, el);
+        el = Roo.get( document.documentElement || document.body).createChild();
+        //config.autoCreate = true;
+    }
+    
+    
+    config.autoTabs = false;
+    Roo.LayoutDialog.superclass.constructor.call(this, el, config);
+    this.body.setStyle({overflow:"hidden", position:"relative"});
+    this.layout = new Roo.BorderLayout(this.body.dom, config);
+    this.layout.monitorWindowResize = false;
+    this.el.addClass("x-dlg-auto-layout");
+    // fix case when center region overwrites center function
+    this.center = Roo.BasicDialog.prototype.center;
+    this.on("show", this.layout.layout, this.layout, true);
+    if (config.items) {
+        var xitems = config.items;
+        delete config.items;
+        Roo.each(xitems, this.addxtype, this);
+    }
+    
+    
+};
+Roo.extend(Roo.LayoutDialog, Roo.BasicDialog, {
+    /**
+     * Ends update of the layout <strike>and resets display to none</strike>. Use standard beginUpdate/endUpdate on the layout.
+     * @deprecated
+     */
+    endUpdate : function(){
+        this.layout.endUpdate();
+    },
+
+    /**
+     * Begins an update of the layout <strike>and sets display to block and visibility to hidden</strike>. Use standard beginUpdate/endUpdate on the layout.
+     *  @deprecated
+     */
+    beginUpdate : function(){
+        this.layout.beginUpdate();
+    },
+
+    /**
+     * Get the BorderLayout for this dialog
+     * @return {Roo.BorderLayout}
+     */
+    getLayout : function(){
+        return this.layout;
+    },
+
+    showEl : function(){
+        Roo.LayoutDialog.superclass.showEl.apply(this, arguments);
+        if(Roo.isIE7){
+            this.layout.layout();
+        }
+    },
+
+    // private
+    // Use the syncHeightBeforeShow config option to control this automatically
+    syncBodyHeight : function(){
+        Roo.LayoutDialog.superclass.syncBodyHeight.call(this);
+        if(this.layout){this.layout.layout();}
+    },
+    
+      /**
+     * Add an xtype element (actually adds to the layout.)
+     * @return {Object} xdata xtype object data.
+     */
+    
+    addxtype : function(c) {
+        return this.layout.addxtype(c);
+    }
+});
\ No newline at end of file
diff --git a/Roo/BasicLayoutRegion.js b/Roo/BasicLayoutRegion.js
new file mode 100644 (file)
index 0000000..7881f35
--- /dev/null
@@ -0,0 +1,309 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+/**
+ * @class Roo.BasicLayoutRegion
+ * @extends Roo.util.Observable
+ * This class represents a lightweight region in a layout manager. This region does not move dom nodes
+ * and does not have a titlebar, tabs or any other features. All it does is size and position 
+ * panels. To create a BasicLayoutRegion, add lightweight:true or basic:true to your regions config.
+ */
+Roo.BasicLayoutRegion = function(mgr, config, pos, skipConfig){
+    this.mgr = mgr;
+    this.position  = pos;
+    this.events = {
+        /**
+         * @scope Roo.BasicLayoutRegion
+         */
+        
+        /**
+         * @event beforeremove
+         * Fires before a panel is removed (or closed). To cancel the removal set "e.cancel = true" on the event argument.
+         * @param {Roo.LayoutRegion} this
+         * @param {Roo.ContentPanel} panel The panel
+         * @param {Object} e The cancel event object
+         */
+        "beforeremove" : true,
+        /**
+         * @event invalidated
+         * Fires when the layout for this region is changed.
+         * @param {Roo.LayoutRegion} this
+         */
+        "invalidated" : true,
+        /**
+         * @event visibilitychange
+         * Fires when this region is shown or hidden 
+         * @param {Roo.LayoutRegion} this
+         * @param {Boolean} visibility true or false
+         */
+        "visibilitychange" : true,
+        /**
+         * @event paneladded
+         * Fires when a panel is added. 
+         * @param {Roo.LayoutRegion} this
+         * @param {Roo.ContentPanel} panel The panel
+         */
+        "paneladded" : true,
+        /**
+         * @event panelremoved
+         * Fires when a panel is removed. 
+         * @param {Roo.LayoutRegion} this
+         * @param {Roo.ContentPanel} panel The panel
+         */
+        "panelremoved" : true,
+        /**
+         * @event collapsed
+         * Fires when this region is collapsed.
+         * @param {Roo.LayoutRegion} this
+         */
+        "collapsed" : true,
+        /**
+         * @event expanded
+         * Fires when this region is expanded.
+         * @param {Roo.LayoutRegion} this
+         */
+        "expanded" : true,
+        /**
+         * @event slideshow
+         * Fires when this region is slid into view.
+         * @param {Roo.LayoutRegion} this
+         */
+        "slideshow" : true,
+        /**
+         * @event slidehide
+         * Fires when this region slides out of view. 
+         * @param {Roo.LayoutRegion} this
+         */
+        "slidehide" : true,
+        /**
+         * @event panelactivated
+         * Fires when a panel is activated. 
+         * @param {Roo.LayoutRegion} this
+         * @param {Roo.ContentPanel} panel The activated panel
+         */
+        "panelactivated" : true,
+        /**
+         * @event resized
+         * Fires when the user resizes this region. 
+         * @param {Roo.LayoutRegion} this
+         * @param {Number} newSize The new size (width for east/west, height for north/south)
+         */
+        "resized" : true
+    };
+    /** A collection of panels in this region. @type Roo.util.MixedCollection */
+    this.panels = new Roo.util.MixedCollection();
+    this.panels.getKey = this.getPanelId.createDelegate(this);
+    this.box = null;
+    this.activePanel = null;
+    // ensure listeners are added...
+    
+    if (config.listeners || config.events) {
+        Roo.BasicLayoutRegion.superclass.constructor.call(this, {
+            listeners : config.listeners || {},
+            events : config.events || {}
+        });
+    }
+    
+    if(skipConfig !== true){
+        this.applyConfig(config);
+    }
+};
+
+Roo.extend(Roo.BasicLayoutRegion, Roo.util.Observable, {
+    getPanelId : function(p){
+        return p.getId();
+    },
+    
+    applyConfig : function(config){
+        this.margins = config.margins || this.margins || {top: 0, left: 0, right:0, bottom: 0};
+        this.config = config;
+        
+    },
+    
+    /**
+     * Resizes the region to the specified size. For vertical regions (west, east) this adjusts 
+     * the width, for horizontal (north, south) the height.
+     * @param {Number} newSize The new width or height
+     */
+    resizeTo : function(newSize){
+        var el = this.el ? this.el :
+                 (this.activePanel ? this.activePanel.getEl() : null);
+        if(el){
+            switch(this.position){
+                case "east":
+                case "west":
+                    el.setWidth(newSize);
+                    this.fireEvent("resized", this, newSize);
+                break;
+                case "north":
+                case "south":
+                    el.setHeight(newSize);
+                    this.fireEvent("resized", this, newSize);
+                break;                
+            }
+        }
+    },
+    
+    getBox : function(){
+        return this.activePanel ? this.activePanel.getEl().getBox(false, true) : null;
+    },
+    
+    getMargins : function(){
+        return this.margins;
+    },
+    
+    updateBox : function(box){
+        this.box = box;
+        var el = this.activePanel.getEl();
+        el.dom.style.left = box.x + "px";
+        el.dom.style.top = box.y + "px";
+        this.activePanel.setSize(box.width, box.height);
+    },
+    
+    /**
+     * Returns the container element for this region.
+     * @return {Roo.Element}
+     */
+    getEl : function(){
+        return this.activePanel;
+    },
+    
+    /**
+     * Returns true if this region is currently visible.
+     * @return {Boolean}
+     */
+    isVisible : function(){
+        return this.activePanel ? true : false;
+    },
+    
+    setActivePanel : function(panel){
+        panel = this.getPanel(panel);
+        if(this.activePanel && this.activePanel != panel){
+            this.activePanel.setActiveState(false);
+            this.activePanel.getEl().setLeftTop(-10000,-10000);
+        }
+        this.activePanel = panel;
+        panel.setActiveState(true);
+        if(this.box){
+            panel.setSize(this.box.width, this.box.height);
+        }
+        this.fireEvent("panelactivated", this, panel);
+        this.fireEvent("invalidated");
+    },
+    
+    /**
+     * Show the specified panel.
+     * @param {Number/String/ContentPanel} panelId The panels index, id or the panel itself
+     * @return {Roo.ContentPanel} The shown panel or null
+     */
+    showPanel : function(panel){
+        if(panel = this.getPanel(panel)){
+            this.setActivePanel(panel);
+        }
+        return panel;
+    },
+    
+    /**
+     * Get the active panel for this region.
+     * @return {Roo.ContentPanel} The active panel or null
+     */
+    getActivePanel : function(){
+        return this.activePanel;
+    },
+    
+    /**
+     * Add the passed ContentPanel(s)
+     * @param {ContentPanel...} panel The ContentPanel(s) to add (you can pass more than one)
+     * @return {Roo.ContentPanel} The panel added (if only one was added)
+     */
+    add : function(panel){
+        if(arguments.length > 1){
+            for(var i = 0, len = arguments.length; i < len; i++) {
+               this.add(arguments[i]);
+            }
+            return null;
+        }
+        if(this.hasPanel(panel)){
+            this.showPanel(panel);
+            return panel;
+        }
+        var el = panel.getEl();
+        if(el.dom.parentNode != this.mgr.el.dom){
+            this.mgr.el.dom.appendChild(el.dom);
+        }
+        if(panel.setRegion){
+            panel.setRegion(this);
+        }
+        this.panels.add(panel);
+        el.setStyle("position", "absolute");
+        if(!panel.background){
+            this.setActivePanel(panel);
+            if(this.config.initialSize && this.panels.getCount()==1){
+                this.resizeTo(this.config.initialSize);
+            }
+        }
+        this.fireEvent("paneladded", this, panel);
+        return panel;
+    },
+    
+    /**
+     * Returns true if the panel is in this region.
+     * @param {Number/String/ContentPanel} panel The panels index, id or the panel itself
+     * @return {Boolean}
+     */
+    hasPanel : function(panel){
+        if(typeof panel == "object"){ // must be panel obj
+            panel = panel.getId();
+        }
+        return this.getPanel(panel) ? true : false;
+    },
+    
+    /**
+     * Removes the specified panel. If preservePanel is not true (either here or in the config), the panel is destroyed.
+     * @param {Number/String/ContentPanel} panel The panels index, id or the panel itself
+     * @param {Boolean} preservePanel Overrides the config preservePanel option
+     * @return {Roo.ContentPanel} The panel that was removed
+     */
+    remove : function(panel, preservePanel){
+        panel = this.getPanel(panel);
+        if(!panel){
+            return null;
+        }
+        var e = {};
+        this.fireEvent("beforeremove", this, panel, e);
+        if(e.cancel === true){
+            return null;
+        }
+        var panelId = panel.getId();
+        this.panels.removeKey(panelId);
+        return panel;
+    },
+    
+    /**
+     * Returns the panel specified or null if it's not in this region.
+     * @param {Number/String/ContentPanel} panel The panels index, id or the panel itself
+     * @return {Roo.ContentPanel}
+     */
+    getPanel : function(id){
+        if(typeof id == "object"){ // must be panel obj
+            return id;
+        }
+        return this.panels.get(id);
+    },
+    
+    /**
+     * Returns this regions position (north/south/east/west/center).
+     * @return {String} 
+     */
+    getPosition: function(){
+        return this.position;    
+    }
+});
\ No newline at end of file
diff --git a/Roo/BorderLayout.js b/Roo/BorderLayout.js
new file mode 100644 (file)
index 0000000..141d726
--- /dev/null
@@ -0,0 +1,570 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+/**
+ * @class Roo.BorderLayout
+ * @extends Roo.LayoutManager
+ * This class represents a common layout manager used in desktop applications. For screenshots and more details,
+ * please see: <br><br>
+ * <a href="http://www.jackslocum.com/yui/2006/10/19/cross-browser-web-20-layouts-with-yahoo-ui/">Cross Browser Layouts - Part 1</a><br>
+ * <a href="http://www.jackslocum.com/yui/2006/10/28/cross-browser-web-20-layouts-part-2-ajax-feed-viewer-20/">Cross Browser Layouts - Part 2</a><br><br>
+ * Example:
+ <pre><code>
+ var layout = new Roo.BorderLayout(document.body, {
+    north: {
+        initialSize: 25,
+        titlebar: false
+    },
+    west: {
+        split:true,
+        initialSize: 200,
+        minSize: 175,
+        maxSize: 400,
+        titlebar: true,
+        collapsible: true
+    },
+    east: {
+        split:true,
+        initialSize: 202,
+        minSize: 175,
+        maxSize: 400,
+        titlebar: true,
+        collapsible: true
+    },
+    south: {
+        split:true,
+        initialSize: 100,
+        minSize: 100,
+        maxSize: 200,
+        titlebar: true,
+        collapsible: true
+    },
+    center: {
+        titlebar: true,
+        autoScroll:true,
+        resizeTabs: true,
+        minTabWidth: 50,
+        preferredTabWidth: 150
+    }
+});
+
+// shorthand
+var CP = Roo.ContentPanel;
+
+layout.beginUpdate();
+layout.add("north", new CP("north", "North"));
+layout.add("south", new CP("south", {title: "South", closable: true}));
+layout.add("west", new CP("west", {title: "West"}));
+layout.add("east", new CP("autoTabs", {title: "Auto Tabs", closable: true}));
+layout.add("center", new CP("center1", {title: "Close Me", closable: true}));
+layout.add("center", new CP("center2", {title: "Center Panel", closable: false}));
+layout.getRegion("center").showPanel("center1");
+layout.endUpdate();
+</code></pre>
+
+<b>The container the layout is rendered into can be either the body element or any other element.
+If it is not the body element, the container needs to either be an absolute positioned element,
+or you will need to add "position:relative" to the css of the container.  You will also need to specify
+the container size if it is not the body element.</b>
+
+* @constructor
+* Create a new BorderLayout
+* @param {String/HTMLElement/Element} container The container this layout is bound to
+* @param {Object} config Configuration options
+ */
+Roo.BorderLayout = function(container, config){
+    config = config || {};
+    Roo.BorderLayout.superclass.constructor.call(this, container, config);
+    this.factory = config.factory || Roo.BorderLayout.RegionFactory;
+    for(var i = 0, len = this.factory.validRegions.length; i < len; i++) {
+       var target = this.factory.validRegions[i];
+       if(config[target]){
+           this.addRegion(target, config[target]);
+       }
+    }
+};
+
+Roo.extend(Roo.BorderLayout, Roo.LayoutManager, {
+    /**
+     * Creates and adds a new region if it doesn't already exist.
+     * @param {String} target The target region key (north, south, east, west or center).
+     * @param {Object} config The regions config object
+     * @return {BorderLayoutRegion} The new region
+     */
+    addRegion : function(target, config){
+        if(!this.regions[target]){
+            var r = this.factory.create(target, this, config);
+           this.bindRegion(target, r);
+        }
+        return this.regions[target];
+    },
+
+    // private (kinda)
+    bindRegion : function(name, r){
+        this.regions[name] = r;
+        r.on("visibilitychange", this.layout, this);
+        r.on("paneladded", this.layout, this);
+        r.on("panelremoved", this.layout, this);
+        r.on("invalidated", this.layout, this);
+        r.on("resized", this.onRegionResized, this);
+        r.on("collapsed", this.onRegionCollapsed, this);
+        r.on("expanded", this.onRegionExpanded, this);
+    },
+
+    /**
+     * Performs a layout update.
+     */
+    layout : function(){
+        if(this.updating) return;
+        var size = this.getViewSize();
+        var w = size.width;
+        var h = size.height;
+        var centerW = w;
+        var centerH = h;
+        var centerY = 0;
+        var centerX = 0;
+        //var x = 0, y = 0;
+
+        var rs = this.regions;
+        var north = rs["north"];
+        var south = rs["south"]; 
+        var west = rs["west"];
+        var east = rs["east"];
+        var center = rs["center"];
+        //if(this.hideOnLayout){ // not supported anymore
+            //c.el.setStyle("display", "none");
+        //}
+        if(north && north.isVisible()){
+            var b = north.getBox();
+            var m = north.getMargins();
+            b.width = w - (m.left+m.right);
+            b.x = m.left;
+            b.y = m.top;
+            centerY = b.height + b.y + m.bottom;
+            centerH -= centerY;
+            north.updateBox(this.safeBox(b));
+        }
+        if(south && south.isVisible()){
+            var b = south.getBox();
+            var m = south.getMargins();
+            b.width = w - (m.left+m.right);
+            b.x = m.left;
+            var totalHeight = (b.height + m.top + m.bottom);
+            b.y = h - totalHeight + m.top;
+            centerH -= totalHeight;
+            south.updateBox(this.safeBox(b));
+        }
+        if(west && west.isVisible()){
+            var b = west.getBox();
+            var m = west.getMargins();
+            b.height = centerH - (m.top+m.bottom);
+            b.x = m.left;
+            b.y = centerY + m.top;
+            var totalWidth = (b.width + m.left + m.right);
+            centerX += totalWidth;
+            centerW -= totalWidth;
+            west.updateBox(this.safeBox(b));
+        }
+        if(east && east.isVisible()){
+            var b = east.getBox();
+            var m = east.getMargins();
+            b.height = centerH - (m.top+m.bottom);
+            var totalWidth = (b.width + m.left + m.right);
+            b.x = w - totalWidth + m.left;
+            b.y = centerY + m.top;
+            centerW -= totalWidth;
+            east.updateBox(this.safeBox(b));
+        }
+        if(center){
+            var m = center.getMargins();
+            var centerBox = {
+                x: centerX + m.left,
+                y: centerY + m.top,
+                width: centerW - (m.left+m.right),
+                height: centerH - (m.top+m.bottom)
+            };
+            //if(this.hideOnLayout){
+                //center.el.setStyle("display", "block");
+            //}
+            center.updateBox(this.safeBox(centerBox));
+        }
+        this.el.repaint();
+        this.fireEvent("layout", this);
+    },
+
+    // private
+    safeBox : function(box){
+        box.width = Math.max(0, box.width);
+        box.height = Math.max(0, box.height);
+        return box;
+    },
+
+    /**
+     * Adds a ContentPanel (or subclass) to this layout.
+     * @param {String} target The target region key (north, south, east, west or center).
+     * @param {Roo.ContentPanel} panel The panel to add
+     * @return {Roo.ContentPanel} The added panel
+     */
+    add : function(target, panel){
+         
+        target = target.toLowerCase();
+        return this.regions[target].add(panel);
+    },
+
+    /**
+     * Remove a ContentPanel (or subclass) to this layout.
+     * @param {String} target The target region key (north, south, east, west or center).
+     * @param {Number/String/Roo.ContentPanel} panel The index, id or panel to remove
+     * @return {Roo.ContentPanel} The removed panel
+     */
+    remove : function(target, panel){
+        target = target.toLowerCase();
+        return this.regions[target].remove(panel);
+    },
+
+    /**
+     * Searches all regions for a panel with the specified id
+     * @param {String} panelId
+     * @return {Roo.ContentPanel} The panel or null if it wasn't found
+     */
+    findPanel : function(panelId){
+        var rs = this.regions;
+        for(var target in rs){
+            if(typeof rs[target] != "function"){
+                var p = rs[target].getPanel(panelId);
+                if(p){
+                    return p;
+                }
+            }
+        }
+        return null;
+    },
+
+    /**
+     * Searches all regions for a panel with the specified id and activates (shows) it.
+     * @param {String/ContentPanel} panelId The panels id or the panel itself
+     * @return {Roo.ContentPanel} The shown panel or null
+     */
+    showPanel : function(panelId) {
+      var rs = this.regions;
+      for(var target in rs){
+         var r = rs[target];
+         if(typeof r != "function"){
+            if(r.hasPanel(panelId)){
+               return r.showPanel(panelId);
+            }
+         }
+      }
+      return null;
+   },
+
+   /**
+     * Restores this layout's state using Roo.state.Manager or the state provided by the passed provider.
+     * @param {Roo.state.Provider} provider (optional) An alternate state provider
+     */
+    restoreState : function(provider){
+        if(!provider){
+            provider = Roo.state.Manager;
+        }
+        var sm = new Roo.LayoutStateManager();
+        sm.init(this, provider);
+    },
+
+    /**
+     * Adds a batch of multiple ContentPanels dynamically by passing a special regions config object.  This config
+     * object should contain properties for each region to add ContentPanels to, and each property's value should be
+     * a valid ContentPanel config object.  Example:
+     * <pre><code>
+// Create the main layout
+var layout = new Roo.BorderLayout('main-ct', {
+    west: {
+        split:true,
+        minSize: 175,
+        titlebar: true
+    },
+    center: {
+        title:'Components'
+    }
+}, 'main-ct');
+
+// Create and add multiple ContentPanels at once via configs
+layout.batchAdd({
+   west: {
+       id: 'source-files',
+       autoCreate:true,
+       title:'Ext Source Files',
+       autoScroll:true,
+       fitToFrame:true
+   },
+   center : {
+       el: cview,
+       autoScroll:true,
+       fitToFrame:true,
+       toolbar: tb,
+       resizeEl:'cbody'
+   }
+});
+</code></pre>
+     * @param {Object} regions An object containing ContentPanel configs by region name
+     */
+    batchAdd : function(regions){
+        this.beginUpdate();
+        for(var rname in regions){
+            var lr = this.regions[rname];
+            if(lr){
+                this.addTypedPanels(lr, regions[rname]);
+            }
+        }
+        this.endUpdate();
+    },
+
+    // private
+    addTypedPanels : function(lr, ps){
+        if(typeof ps == 'string'){
+            lr.add(new Roo.ContentPanel(ps));
+        }
+        else if(ps instanceof Array){
+            for(var i =0, len = ps.length; i < len; i++){
+                this.addTypedPanels(lr, ps[i]);
+            }
+        }
+        else if(!ps.events){ // raw config?
+            var el = ps.el;
+            delete ps.el; // prevent conflict
+            lr.add(new Roo.ContentPanel(el || Roo.id(), ps));
+        }
+        else {  // panel object assumed!
+            lr.add(ps);
+        }
+    },
+    /**
+     * Adds a xtype elements to the layout.
+     * <pre><code>
+
+layout.addxtype({
+       xtype : 'ContentPanel',
+       region: 'west',
+       items: [ .... ]
+   }
+);
+
+layout.addxtype({
+        xtype : 'NestedLayoutPanel',
+        region: 'west',
+        layout: {
+           center: { },
+           west: { }   
+        },
+        items : [ ... list of content panels or nested layout panels.. ]
+   }
+);
+</code></pre>
+     * @param {Object} cfg Xtype definition of item to add.
+     */
+    addxtype : function(cfg)
+    {
+        // basically accepts a pannel...
+        // can accept a layout region..!?!?
+        if (!cfg.xtype.match(/Panel$/)) {
+            return false;
+        }
+        var ret = false;
+        var region = cfg.region;
+        delete cfg.region;
+        
+          
+        var xitems = [];
+        if (cfg.items) {
+            xitems = cfg.items;
+            delete cfg.items;
+        }
+        
+        
+        switch(cfg.xtype) 
+        {
+            case 'ContentPanel':  // ContentPanel (el, cfg)
+            
+                var el = this.el.createChild();
+                ret = new Roo[cfg.xtype](el, cfg); // new panel!!!!!
+                this.add(region, ret);
+                break;
+            
+            
+            case 'TreePanel': // our new panel!
+                cfg.el = this.el.createChild();
+                ret = new Roo[cfg.xtype](cfg); // new panel!!!!!
+                this.add(region, ret);
+                break;
+            
+            case 'NestedLayoutPanel': 
+                // create a new Layout (which is  a Border Layout...
+                var el = this.el.createChild();
+                var clayout = cfg.layout;
+                delete cfg.layout;
+                
+                
+                if (region == 'center' && this.active && this.getRegion('center').panels.length < 1) {
+                    cfg.background = false;
+                }
+                var layout = new Roo.BorderLayout(el, clayout);
+                
+                ret = new Roo[cfg.xtype](layout, cfg); // new panel!!!!!
+                //console.log('adding nested layout panel '  + cfg.toSource());
+                this.add(region, ret);
+                
+                break;
+                
+            case 'GridPanel': 
+            
+                // needs grid and region
+                
+                //var el = this.getRegion(region).el.createChild();
+                var el = this.el.createChild();
+                var grid = new Roo.grid[cfg.grid.xtype](el, cfg.grid);
+                delete cfg.grid;
+                if (region == 'center' && this.active ) {
+                    cfg.background = false;
+                }
+                ret = new Roo[cfg.xtype](grid, cfg); // new panel!!!!!
+                
+                this.add(region, ret);
+                if (cfg.background) {
+                    ret.on('activate', function(gp) {
+                        if (!gp.grid.rendered) {
+                            gp.grid.render();
+                        }
+                    });
+                } else {
+                    grid.render();
+                }
+                break;
+           
+               
+                
+                
+            default: 
+                alert("Can not add '" + cfg.xtype + "' to BorderLayout");
+                return;
+             // GridPanel (grid, cfg)
+            
+        }
+        this.beginUpdate();
+        // add children..
+        Roo.each(xitems, function(i)  {
+            ret.addxtype(i);
+        });
+        this.endUpdate();
+        return ret;
+        
+    }
+});
+
+/**
+ * Shortcut for creating a new BorderLayout object and adding one or more ContentPanels to it in a single step, handling
+ * the beginUpdate and endUpdate calls internally.  The key to this method is the <b>panels</b> property that can be
+ * provided with each region config, which allows you to add ContentPanel configs in addition to the region configs
+ * during creation.  The following code is equivalent to the constructor-based example at the beginning of this class:
+ * <pre><code>
+// shorthand
+var CP = Roo.ContentPanel;
+
+var layout = Roo.BorderLayout.create({
+    north: {
+        initialSize: 25,
+        titlebar: false,
+        panels: [new CP("north", "North")]
+    },
+    west: {
+        split:true,
+        initialSize: 200,
+        minSize: 175,
+        maxSize: 400,
+        titlebar: true,
+        collapsible: true,
+        panels: [new CP("west", {title: "West"})]
+    },
+    east: {
+        split:true,
+        initialSize: 202,
+        minSize: 175,
+        maxSize: 400,
+        titlebar: true,
+        collapsible: true,
+        panels: [new CP("autoTabs", {title: "Auto Tabs", closable: true})]
+    },
+    south: {
+        split:true,
+        initialSize: 100,
+        minSize: 100,
+        maxSize: 200,
+        titlebar: true,
+        collapsible: true,
+        panels: [new CP("south", {title: "South", closable: true})]
+    },
+    center: {
+        titlebar: true,
+        autoScroll:true,
+        resizeTabs: true,
+        minTabWidth: 50,
+        preferredTabWidth: 150,
+        panels: [
+            new CP("center1", {title: "Close Me", closable: true}),
+            new CP("center2", {title: "Center Panel", closable: false})
+        ]
+    }
+}, document.body);
+
+layout.getRegion("center").showPanel("center1");
+</code></pre>
+ * @param config
+ * @param targetEl
+ */
+Roo.BorderLayout.create = function(config, targetEl){
+    var layout = new Roo.BorderLayout(targetEl || document.body, config);
+    layout.beginUpdate();
+    var regions = Roo.BorderLayout.RegionFactory.validRegions;
+    for(var j = 0, jlen = regions.length; j < jlen; j++){
+        var lr = regions[j];
+        if(layout.regions[lr] && config[lr].panels){
+            var r = layout.regions[lr];
+            var ps = config[lr].panels;
+            layout.addTypedPanels(r, ps);
+        }
+    }
+    layout.endUpdate();
+    return layout;
+};
+
+// private
+Roo.BorderLayout.RegionFactory = {
+    // private
+    validRegions : ["north","south","east","west","center"],
+
+    // private
+    create : function(target, mgr, config){
+        target = target.toLowerCase();
+        if(config.lightweight || config.basic){
+            return new Roo.BasicLayoutRegion(mgr, config, target);
+        }
+        switch(target){
+            case "north":
+                return new Roo.NorthLayoutRegion(mgr, config);
+            case "south":
+                return new Roo.SouthLayoutRegion(mgr, config);
+            case "east":
+                return new Roo.EastLayoutRegion(mgr, config);
+            case "west":
+                return new Roo.WestLayoutRegion(mgr, config);
+            case "center":
+                return new Roo.CenterLayoutRegion(mgr, config);
+        }
+        throw 'Layout region "'+target+'" not supported.';
+    }
+};
\ No newline at end of file
diff --git a/Roo/BoxComponent.js b/Roo/BoxComponent.js
new file mode 100644 (file)
index 0000000..ef86fa5
--- /dev/null
@@ -0,0 +1,283 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+
+/**
+ * @class Roo.BoxComponent
+ * @extends Roo.Component
+ * Base class for any visual {@link Roo.Component} that uses a box container.  BoxComponent provides automatic box
+ * model adjustments for sizing and positioning and will work correctly withnin the Component rendering model.  All
+ * container classes should subclass BoxComponent so that they will work consistently when nested within other Ext
+ * layout containers.
+ * @constructor
+ * @param {Roo.Element/String/Object} config The configuration options.
+ */
+Roo.BoxComponent = function(config){
+    Roo.Component.call(this, config);
+    this.addEvents({
+        /**
+         * @event resize
+         * Fires after the component is resized.
+            * @param {Roo.Component} this
+            * @param {Number} adjWidth The box-adjusted width that was set
+            * @param {Number} adjHeight The box-adjusted height that was set
+            * @param {Number} rawWidth The width that was originally specified
+            * @param {Number} rawHeight The height that was originally specified
+            */
+        resize : true,
+        /**
+         * @event move
+         * Fires after the component is moved.
+            * @param {Roo.Component} this
+            * @param {Number} x The new x position
+            * @param {Number} y The new y position
+            */
+        move : true
+    });
+};
+
+Roo.extend(Roo.BoxComponent, Roo.Component, {
+    // private, set in afterRender to signify that the component has been rendered
+    boxReady : false,
+    // private, used to defer height settings to subclasses
+    deferHeight: false,
+    /** @cfg {Number} width
+     * width (optional) size of component
+     */
+     /** @cfg {Number} height
+     * height (optional) size of component
+     */
+     
+    /**
+     * Sets the width and height of the component.  This method fires the resize event.  This method can accept
+     * either width and height as separate numeric arguments, or you can pass a size object like {width:10, height:20}.
+     * @param {Number/Object} width The new width to set, or a size object in the format {width, height}
+     * @param {Number} height The new height to set (not required if a size object is passed as the first arg)
+     * @return {Roo.BoxComponent} this
+     */
+    setSize : function(w, h){
+        // support for standard size objects
+        if(typeof w == 'object'){
+            h = w.height;
+            w = w.width;
+        }
+        // not rendered
+        if(!this.boxReady){
+            this.width = w;
+            this.height = h;
+            return this;
+        }
+
+        // prevent recalcs when not needed
+        if(this.lastSize && this.lastSize.width == w && this.lastSize.height == h){
+            return this;
+        }
+        this.lastSize = {width: w, height: h};
+
+        var adj = this.adjustSize(w, h);
+        var aw = adj.width, ah = adj.height;
+        if(aw !== undefined || ah !== undefined){ // this code is nasty but performs better with floaters
+            var rz = this.getResizeEl();
+            if(!this.deferHeight && aw !== undefined && ah !== undefined){
+                rz.setSize(aw, ah);
+            }else if(!this.deferHeight && ah !== undefined){
+                rz.setHeight(ah);
+            }else if(aw !== undefined){
+                rz.setWidth(aw);
+            }
+            this.onResize(aw, ah, w, h);
+            this.fireEvent('resize', this, aw, ah, w, h);
+        }
+        return this;
+    },
+
+    /**
+     * Gets the current size of the component's underlying element.
+     * @return {Object} An object containing the element's size {width: (element width), height: (element height)}
+     */
+    getSize : function(){
+        return this.el.getSize();
+    },
+
+    /**
+     * Gets the current XY position of the component's underlying element.
+     * @param {Boolean} local (optional) If true the element's left and top are returned instead of page XY (defaults to false)
+     * @return {Array} The XY position of the element (e.g., [100, 200])
+     */
+    getPosition : function(local){
+        if(local === true){
+            return [this.el.getLeft(true), this.el.getTop(true)];
+        }
+        return this.xy || this.el.getXY();
+    },
+
+    /**
+     * Gets the current box measurements of the component's underlying element.
+     * @param {Boolean} local (optional) If true the element's left and top are returned instead of page XY (defaults to false)
+     * @returns {Object} box An object in the format {x, y, width, height}
+     */
+    getBox : function(local){
+        var s = this.el.getSize();
+        if(local){
+            s.x = this.el.getLeft(true);
+            s.y = this.el.getTop(true);
+        }else{
+            var xy = this.xy || this.el.getXY();
+            s.x = xy[0];
+            s.y = xy[1];
+        }
+        return s;
+    },
+
+    /**
+     * Sets the current box measurements of the component's underlying element.
+     * @param {Object} box An object in the format {x, y, width, height}
+     * @returns {Roo.BoxComponent} this
+     */
+    updateBox : function(box){
+        this.setSize(box.width, box.height);
+        this.setPagePosition(box.x, box.y);
+        return this;
+    },
+
+    // protected
+    getResizeEl : function(){
+        return this.resizeEl || this.el;
+    },
+
+    // protected
+    getPositionEl : function(){
+        return this.positionEl || this.el;
+    },
+
+    /**
+     * Sets the left and top of the component.  To set the page XY position instead, use {@link #setPagePosition}.
+     * This method fires the move event.
+     * @param {Number} left The new left
+     * @param {Number} top The new top
+     * @returns {Roo.BoxComponent} this
+     */
+    setPosition : function(x, y){
+        this.x = x;
+        this.y = y;
+        if(!this.boxReady){
+            return this;
+        }
+        var adj = this.adjustPosition(x, y);
+        var ax = adj.x, ay = adj.y;
+
+        var el = this.getPositionEl();
+        if(ax !== undefined || ay !== undefined){
+            if(ax !== undefined && ay !== undefined){
+                el.setLeftTop(ax, ay);
+            }else if(ax !== undefined){
+                el.setLeft(ax);
+            }else if(ay !== undefined){
+                el.setTop(ay);
+            }
+            this.onPosition(ax, ay);
+            this.fireEvent('move', this, ax, ay);
+        }
+        return this;
+    },
+
+    /**
+     * Sets the page XY position of the component.  To set the left and top instead, use {@link #setPosition}.
+     * This method fires the move event.
+     * @param {Number} x The new x position
+     * @param {Number} y The new y position
+     * @returns {Roo.BoxComponent} this
+     */
+    setPagePosition : function(x, y){
+        this.pageX = x;
+        this.pageY = y;
+        if(!this.boxReady){
+            return;
+        }
+        if(x === undefined || y === undefined){ // cannot translate undefined points
+            return;
+        }
+        var p = this.el.translatePoints(x, y);
+        this.setPosition(p.left, p.top);
+        return this;
+    },
+
+    // private
+    onRender : function(ct, position){
+        Roo.BoxComponent.superclass.onRender.call(this, ct, position);
+        if(this.resizeEl){
+            this.resizeEl = Roo.get(this.resizeEl);
+        }
+        if(this.positionEl){
+            this.positionEl = Roo.get(this.positionEl);
+        }
+    },
+
+    // private
+    afterRender : function(){
+        Roo.BoxComponent.superclass.afterRender.call(this);
+        this.boxReady = true;
+        this.setSize(this.width, this.height);
+        if(this.x || this.y){
+            this.setPosition(this.x, this.y);
+        }
+        if(this.pageX || this.pageY){
+            this.setPagePosition(this.pageX, this.pageY);
+        }
+    },
+
+    /**
+     * Force the component's size to recalculate based on the underlying element's current height and width.
+     * @returns {Roo.BoxComponent} this
+     */
+    syncSize : function(){
+        delete this.lastSize;
+        this.setSize(this.el.getWidth(), this.el.getHeight());
+        return this;
+    },
+
+    /**
+     * Called after the component is resized, this method is empty by default but can be implemented by any
+     * subclass that needs to perform custom logic after a resize occurs.
+     * @param {Number} adjWidth The box-adjusted width that was set
+     * @param {Number} adjHeight The box-adjusted height that was set
+     * @param {Number} rawWidth The width that was originally specified
+     * @param {Number} rawHeight The height that was originally specified
+     */
+    onResize : function(adjWidth, adjHeight, rawWidth, rawHeight){
+
+    },
+
+    /**
+     * Called after the component is moved, this method is empty by default but can be implemented by any
+     * subclass that needs to perform custom logic after a move occurs.
+     * @param {Number} x The new x position
+     * @param {Number} y The new y position
+     */
+    onPosition : function(x, y){
+
+    },
+
+    // private
+    adjustSize : function(w, h){
+        if(this.autoWidth){
+            w = 'auto';
+        }
+        if(this.autoHeight){
+            h = 'auto';
+        }
+        return {width : w, height: h};
+    },
+
+    // private
+    adjustPosition : function(x, y){
+        return {x : x, y: y};
+    }
+});
\ No newline at end of file
diff --git a/Roo/Button.js b/Roo/Button.js
new file mode 100644 (file)
index 0000000..39747e0
--- /dev/null
@@ -0,0 +1,536 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+
+/**
+ * @class Roo.Button
+ * @extends Roo.util.Observable
+ * Simple Button class
+ * @cfg {String} text The button text
+ * @cfg {String} icon The path to an image to display in the button (the image will be set as the background-image
+ * CSS property of the button by default, so if you want a mixed icon/text button, set cls:"x-btn-text-icon")
+ * @cfg {Function} handler A function called when the button is clicked (can be used instead of click event)
+ * @cfg {Object} scope The scope of the handler
+ * @cfg {Number} minWidth The minimum width for this button (used to give a set of buttons a common width)
+ * @cfg {String/Object} tooltip The tooltip for the button - can be a string or QuickTips config object
+ * @cfg {Boolean} hidden True to start hidden (defaults to false)
+ * @cfg {Boolean} disabled True to start disabled (defaults to false)
+ * @cfg {Boolean} pressed True to start pressed (only if enableToggle = true)
+ * @cfg {String} toggleGroup The group this toggle button is a member of (only 1 per group can be pressed, only
+   applies if enableToggle = true)
+ * @cfg {String/HTMLElement/Element} renderTo The element to append the button to
+ * @cfg {Boolean/Object} repeat True to repeat fire the click event while the mouse is down. This can also be
+  an {@link Roo.util.ClickRepeater} config object (defaults to false).
+ * @constructor
+ * Create a new button
+ * @param {Object} config The config object
+ */
+Roo.Button = function(renderTo, config)
+{
+    if (!config) {
+        config = renderTo;
+        renderTo = config.renderTo || false;
+    }
+    
+    Roo.apply(this, config);
+    this.addEvents({
+        /**
+            * @event click
+            * Fires when this button is clicked
+            * @param {Button} this
+            * @param {EventObject} e The click event
+            */
+           "click" : true,
+        /**
+            * @event toggle
+            * Fires when the "pressed" state of this button changes (only if enableToggle = true)
+            * @param {Button} this
+            * @param {Boolean} pressed
+            */
+           "toggle" : true,
+        /**
+            * @event mouseover
+            * Fires when the mouse hovers over the button
+            * @param {Button} this
+            * @param {Event} e The event object
+            */
+        'mouseover' : true,
+        /**
+            * @event mouseout
+            * Fires when the mouse exits the button
+            * @param {Button} this
+            * @param {Event} e The event object
+            */
+        'mouseout': true,
+         /**
+            * @event render
+            * Fires when the button is rendered
+            * @param {Button} this
+            */
+        'render': true
+    });
+    if(this.menu){
+        this.menu = Roo.menu.MenuMgr.get(this.menu);
+    }
+    if(renderTo){
+        this.render(renderTo);
+    }
+    
+    Roo.util.Observable.call(this);
+};
+
+Roo.extend(Roo.Button, Roo.util.Observable, {
+    /**
+     * 
+     */
+    
+    /**
+     * Read-only. True if this button is hidden
+     * @type Boolean
+     */
+    hidden : false,
+    /**
+     * Read-only. True if this button is disabled
+     * @type Boolean
+     */
+    disabled : false,
+    /**
+     * Read-only. True if this button is pressed (only if enableToggle = true)
+     * @type Boolean
+     */
+    pressed : false,
+
+    /**
+     * @cfg {Number} tabIndex 
+     * The DOM tabIndex for this button (defaults to undefined)
+     */
+    tabIndex : undefined,
+
+    /**
+     * @cfg {Boolean} enableToggle
+     * True to enable pressed/not pressed toggling (defaults to false)
+     */
+    enableToggle: false,
+    /**
+     * @cfg {Mixed} menu
+     * Standard menu attribute consisting of a reference to a menu object, a menu id or a menu config blob (defaults to undefined).
+     */
+    menu : undefined,
+    /**
+     * @cfg {String} menuAlign
+     * The position to align the menu to (see {@link Roo.Element#alignTo} for more details, defaults to 'tl-bl?').
+     */
+    menuAlign : "tl-bl?",
+
+    /**
+     * @cfg {String} iconCls
+     * A css class which sets a background image to be used as the icon for this button (defaults to undefined).
+     */
+    iconCls : undefined,
+    /**
+     * @cfg {String} type
+     * The button's type, corresponding to the DOM input element type attribute.  Either "submit," "reset" or "button" (default).
+     */
+    type : 'button',
+
+    // private
+    menuClassTarget: 'tr',
+
+    /**
+     * @cfg {String} clickEvent
+     * The type of event to map to the button's event handler (defaults to 'click')
+     */
+    clickEvent : 'click',
+
+    /**
+     * @cfg {Boolean} handleMouseEvents
+     * False to disable visual cues on mouseover, mouseout and mousedown (defaults to true)
+     */
+    handleMouseEvents : true,
+
+    /**
+     * @cfg {String} tooltipType
+     * The type of tooltip to use. Either "qtip" (default) for QuickTips or "title" for title attribute.
+     */
+    tooltipType : 'qtip',
+
+    /**
+     * @cfg {String} cls
+     * A CSS class to apply to the button's main element.
+     */
+    
+    /**
+     * @cfg {Roo.Template} template (Optional)
+     * An {@link Roo.Template} with which to create the Button's main element. This Template must
+     * contain numeric substitution parameter 0 if it is to display the tRoo property. Changing the template could
+     * require code modifications if required elements (e.g. a button) aren't present.
+     */
+
+    // private
+    render : function(renderTo){
+        var btn;
+        if(this.hideParent){
+            this.parentEl = Roo.get(renderTo);
+        }
+        if(!this.dhconfig){
+            if(!this.template){
+                if(!Roo.Button.buttonTemplate){
+                    // hideous table template
+                    Roo.Button.buttonTemplate = new Roo.Template(
+                        '<table border="0" cellpadding="0" cellspacing="0" class="x-btn-wrap"><tbody><tr>',
+                        '<td class="x-btn-left"><i>&#160;</i></td><td class="x-btn-center"><em unselectable="on"><button class="x-btn-text" type="{1}">{0}</button></em></td><td class="x-btn-right"><i>&#160;</i></td>',
+                        "</tr></tbody></table>");
+                }
+                this.template = Roo.Button.buttonTemplate;
+            }
+            btn = this.template.append(renderTo, [this.text || '&#160;', this.type], true);
+            var btnEl = btn.child("button:first");
+            btnEl.on('focus', this.onFocus, this);
+            btnEl.on('blur', this.onBlur, this);
+            if(this.cls){
+                btn.addClass(this.cls);
+            }
+            if(this.icon){
+                btnEl.setStyle('background-image', 'url(' +this.icon +')');
+            }
+            if(this.iconCls){
+                btnEl.addClass(this.iconCls);
+                if(!this.cls){
+                    btn.addClass(this.text ? 'x-btn-text-icon' : 'x-btn-icon');
+                }
+            }
+            if(this.tabIndex !== undefined){
+                btnEl.dom.tabIndex = this.tabIndex;
+            }
+            if(this.tooltip){
+                if(typeof this.tooltip == 'object'){
+                    Roo.QuickTips.tips(Roo.apply({
+                          target: btnEl.id
+                    }, this.tooltip));
+                } else {
+                    btnEl.dom[this.tooltipType] = this.tooltip;
+                }
+            }
+        }else{
+            btn = Roo.DomHelper.append(Roo.get(renderTo).dom, this.dhconfig, true);
+        }
+        this.el = btn;
+        if(this.id){
+            this.el.dom.id = this.el.id = this.id;
+        }
+        if(this.menu){
+            this.el.child(this.menuClassTarget).addClass("x-btn-with-menu");
+            this.menu.on("show", this.onMenuShow, this);
+            this.menu.on("hide", this.onMenuHide, this);
+        }
+        btn.addClass("x-btn");
+        if(Roo.isIE && !Roo.isIE7){
+            this.autoWidth.defer(1, this);
+        }else{
+            this.autoWidth();
+        }
+        if(this.handleMouseEvents){
+            btn.on("mouseover", this.onMouseOver, this);
+            btn.on("mouseout", this.onMouseOut, this);
+            btn.on("mousedown", this.onMouseDown, this);
+        }
+        btn.on(this.clickEvent, this.onClick, this);
+        //btn.on("mouseup", this.onMouseUp, this);
+        if(this.hidden){
+            this.hide();
+        }
+        if(this.disabled){
+            this.disable();
+        }
+        Roo.ButtonToggleMgr.register(this);
+        if(this.pressed){
+            this.el.addClass("x-btn-pressed");
+        }
+        if(this.repeat){
+            var repeater = new Roo.util.ClickRepeater(btn,
+                typeof this.repeat == "object" ? this.repeat : {}
+            );
+            repeater.on("click", this.onClick,  this);
+        }
+        this.fireEvent('render', this);
+        
+    },
+    /**
+     * Returns the button's underlying element
+     * @return {Roo.Element} The element
+     */
+    getEl : function(){
+        return this.el;  
+    },
+    
+    /**
+     * Destroys this Button and removes any listeners.
+     */
+    destroy : function(){
+        Roo.ButtonToggleMgr.unregister(this);
+        this.el.removeAllListeners();
+        this.purgeListeners();
+        this.el.remove();
+    },
+
+    // private
+    autoWidth : function(){
+        if(this.el){
+            this.el.setWidth("auto");
+            if(Roo.isIE7 && Roo.isStrict){
+                var ib = this.el.child('button');
+                if(ib && ib.getWidth() > 20){
+                    ib.clip();
+                    ib.setWidth(Roo.util.TextMetrics.measure(ib, this.text).width+ib.getFrameWidth('lr'));
+                }
+            }
+            if(this.minWidth){
+                if(this.hidden){
+                    this.el.beginMeasure();
+                }
+                if(this.el.getWidth() < this.minWidth){
+                    this.el.setWidth(this.minWidth);
+                }
+                if(this.hidden){
+                    this.el.endMeasure();
+                }
+            }
+        }
+    },
+
+    /**
+     * Assigns this button's click handler
+     * @param {Function} handler The function to call when the button is clicked
+     * @param {Object} scope (optional) Scope for the function passed in
+     */
+    setHandler : function(handler, scope){
+        this.handler = handler;
+        this.scope = scope;  
+    },
+    
+    /**
+     * Sets this button's text
+     * @param {String} text The button text
+     */
+    setText : function(text){
+        this.text = text;
+        if(this.el){
+            this.el.child("td.x-btn-center button.x-btn-text").update(text);
+        }
+        this.autoWidth();
+    },
+    
+    /**
+     * Gets the text for this button
+     * @return {String} The button text
+     */
+    getText : function(){
+        return this.text;  
+    },
+    
+    /**
+     * Show this button
+     */
+    show: function(){
+        this.hidden = false;
+        if(this.el){
+            this[this.hideParent? 'parentEl' : 'el'].setStyle("display", "");
+        }
+    },
+    
+    /**
+     * Hide this button
+     */
+    hide: function(){
+        this.hidden = true;
+        if(this.el){
+            this[this.hideParent? 'parentEl' : 'el'].setStyle("display", "none");
+        }
+    },
+    
+    /**
+     * Convenience function for boolean show/hide
+     * @param {Boolean} visible True to show, false to hide
+     */
+    setVisible: function(visible){
+        if(visible) {
+            this.show();
+        }else{
+            this.hide();
+        }
+    },
+    
+    /**
+     * If a state it passed, it becomes the pressed state otherwise the current state is toggled.
+     * @param {Boolean} state (optional) Force a particular state
+     */
+    toggle : function(state){
+        state = state === undefined ? !this.pressed : state;
+        if(state != this.pressed){
+            if(state){
+                this.el.addClass("x-btn-pressed");
+                this.pressed = true;
+                this.fireEvent("toggle", this, true);
+            }else{
+                this.el.removeClass("x-btn-pressed");
+                this.pressed = false;
+                this.fireEvent("toggle", this, false);
+            }
+            if(this.toggleHandler){
+                this.toggleHandler.call(this.scope || this, this, state);
+            }
+        }
+    },
+    
+    /**
+     * Focus the button
+     */
+    focus : function(){
+        this.el.child('button:first').focus();
+    },
+    
+    /**
+     * Disable this button
+     */
+    disable : function(){
+        if(this.el){
+            this.el.addClass("x-btn-disabled");
+        }
+        this.disabled = true;
+    },
+    
+    /**
+     * Enable this button
+     */
+    enable : function(){
+        if(this.el){
+            this.el.removeClass("x-btn-disabled");
+        }
+        this.disabled = false;
+    },
+
+    /**
+     * Convenience function for boolean enable/disable
+     * @param {Boolean} enabled True to enable, false to disable
+     */
+    setDisabled : function(v){
+        this[v !== true ? "enable" : "disable"]();
+    },
+
+    // private
+    onClick : function(e){
+        if(e){
+            e.preventDefault();
+        }
+        if(e.button != 0){
+            return;
+        }
+        if(!this.disabled){
+            if(this.enableToggle){
+                this.toggle();
+            }
+            if(this.menu && !this.menu.isVisible()){
+                this.menu.show(this.el, this.menuAlign);
+            }
+            this.fireEvent("click", this, e);
+            if(this.handler){
+                this.el.removeClass("x-btn-over");
+                this.handler.call(this.scope || this, this, e);
+            }
+        }
+    },
+    // private
+    onMouseOver : function(e){
+        if(!this.disabled){
+            this.el.addClass("x-btn-over");
+            this.fireEvent('mouseover', this, e);
+        }
+    },
+    // private
+    onMouseOut : function(e){
+        if(!e.within(this.el,  true)){
+            this.el.removeClass("x-btn-over");
+            this.fireEvent('mouseout', this, e);
+        }
+    },
+    // private
+    onFocus : function(e){
+        if(!this.disabled){
+            this.el.addClass("x-btn-focus");
+        }
+    },
+    // private
+    onBlur : function(e){
+        this.el.removeClass("x-btn-focus");
+    },
+    // private
+    onMouseDown : function(e){
+        if(!this.disabled && e.button == 0){
+            this.el.addClass("x-btn-click");
+            Roo.get(document).on('mouseup', this.onMouseUp, this);
+        }
+    },
+    // private
+    onMouseUp : function(e){
+        if(e.button == 0){
+            this.el.removeClass("x-btn-click");
+            Roo.get(document).un('mouseup', this.onMouseUp, this);
+        }
+    },
+    // private
+    onMenuShow : function(e){
+        this.el.addClass("x-btn-menu-active");
+    },
+    // private
+    onMenuHide : function(e){
+        this.el.removeClass("x-btn-menu-active");
+    }   
+});
+
+// Private utility class used by Button
+Roo.ButtonToggleMgr = function(){
+   var groups = {};
+   
+   function toggleGroup(btn, state){
+       if(state){
+           var g = groups[btn.toggleGroup];
+           for(var i = 0, l = g.length; i < l; i++){
+               if(g[i] != btn){
+                   g[i].toggle(false);
+               }
+           }
+       }
+   }
+   
+   return {
+       register : function(btn){
+           if(!btn.toggleGroup){
+               return;
+           }
+           var g = groups[btn.toggleGroup];
+           if(!g){
+               g = groups[btn.toggleGroup] = [];
+           }
+           g.push(btn);
+           btn.on("toggle", toggleGroup);
+       },
+       
+       unregister : function(btn){
+           if(!btn.toggleGroup){
+               return;
+           }
+           var g = groups[btn.toggleGroup];
+           if(g){
+               g.remove(btn);
+               btn.un("toggle", toggleGroup);
+           }
+       }
+   };
+}();
\ No newline at end of file
diff --git a/Roo/CenterLayoutRegion.js b/Roo/CenterLayoutRegion.js
new file mode 100644 (file)
index 0000000..64119e3
--- /dev/null
@@ -0,0 +1,203 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+/*
+ * These classes are private internal classes
+ */
+Roo.CenterLayoutRegion = function(mgr, config){
+    Roo.LayoutRegion.call(this, mgr, config, "center");
+    this.visible = true;
+    this.minWidth = config.minWidth || 20;
+    this.minHeight = config.minHeight || 20;
+};
+
+Roo.extend(Roo.CenterLayoutRegion, Roo.LayoutRegion, {
+    hide : function(){
+        // center panel can't be hidden
+    },
+    
+    show : function(){
+        // center panel can't be hidden
+    },
+    
+    getMinWidth: function(){
+        return this.minWidth;
+    },
+    
+    getMinHeight: function(){
+        return this.minHeight;
+    }
+});
+
+
+Roo.NorthLayoutRegion = function(mgr, config){
+    Roo.LayoutRegion.call(this, mgr, config, "north", "n-resize");
+    if(this.split){
+        this.split.placement = Roo.SplitBar.TOP;
+        this.split.orientation = Roo.SplitBar.VERTICAL;
+        this.split.el.addClass("x-layout-split-v");
+    }
+    var size = config.initialSize || config.height;
+    if(typeof size != "undefined"){
+        this.el.setHeight(size);
+    }
+};
+Roo.extend(Roo.NorthLayoutRegion, Roo.SplitLayoutRegion, {
+    orientation: Roo.SplitBar.VERTICAL,
+    getBox : function(){
+        if(this.collapsed){
+            return this.collapsedEl.getBox();
+        }
+        var box = this.el.getBox();
+        if(this.split){
+            box.height += this.split.el.getHeight();
+        }
+        return box;
+    },
+    
+    updateBox : function(box){
+        if(this.split && !this.collapsed){
+            box.height -= this.split.el.getHeight();
+            this.split.el.setLeft(box.x);
+            this.split.el.setTop(box.y+box.height);
+            this.split.el.setWidth(box.width);
+        }
+        if(this.collapsed){
+            this.updateBody(box.width, null);
+        }
+        Roo.LayoutRegion.prototype.updateBox.call(this, box);
+    }
+});
+
+Roo.SouthLayoutRegion = function(mgr, config){
+    Roo.SplitLayoutRegion.call(this, mgr, config, "south", "s-resize");
+    if(this.split){
+        this.split.placement = Roo.SplitBar.BOTTOM;
+        this.split.orientation = Roo.SplitBar.VERTICAL;
+        this.split.el.addClass("x-layout-split-v");
+    }
+    var size = config.initialSize || config.height;
+    if(typeof size != "undefined"){
+        this.el.setHeight(size);
+    }
+};
+Roo.extend(Roo.SouthLayoutRegion, Roo.SplitLayoutRegion, {
+    orientation: Roo.SplitBar.VERTICAL,
+    getBox : function(){
+        if(this.collapsed){
+            return this.collapsedEl.getBox();
+        }
+        var box = this.el.getBox();
+        if(this.split){
+            var sh = this.split.el.getHeight();
+            box.height += sh;
+            box.y -= sh;
+        }
+        return box;
+    },
+    
+    updateBox : function(box){
+        if(this.split && !this.collapsed){
+            var sh = this.split.el.getHeight();
+            box.height -= sh;
+            box.y += sh;
+            this.split.el.setLeft(box.x);
+            this.split.el.setTop(box.y-sh);
+            this.split.el.setWidth(box.width);
+        }
+        if(this.collapsed){
+            this.updateBody(box.width, null);
+        }
+        Roo.LayoutRegion.prototype.updateBox.call(this, box);
+    }
+});
+
+Roo.EastLayoutRegion = function(mgr, config){
+    Roo.SplitLayoutRegion.call(this, mgr, config, "east", "e-resize");
+    if(this.split){
+        this.split.placement = Roo.SplitBar.RIGHT;
+        this.split.orientation = Roo.SplitBar.HORIZONTAL;
+        this.split.el.addClass("x-layout-split-h");
+    }
+    var size = config.initialSize || config.width;
+    if(typeof size != "undefined"){
+        this.el.setWidth(size);
+    }
+};
+Roo.extend(Roo.EastLayoutRegion, Roo.SplitLayoutRegion, {
+    orientation: Roo.SplitBar.HORIZONTAL,
+    getBox : function(){
+        if(this.collapsed){
+            return this.collapsedEl.getBox();
+        }
+        var box = this.el.getBox();
+        if(this.split){
+            var sw = this.split.el.getWidth();
+            box.width += sw;
+            box.x -= sw;
+        }
+        return box;
+    },
+
+    updateBox : function(box){
+        if(this.split && !this.collapsed){
+            var sw = this.split.el.getWidth();
+            box.width -= sw;
+            this.split.el.setLeft(box.x);
+            this.split.el.setTop(box.y);
+            this.split.el.setHeight(box.height);
+            box.x += sw;
+        }
+        if(this.collapsed){
+            this.updateBody(null, box.height);
+        }
+        Roo.LayoutRegion.prototype.updateBox.call(this, box);
+    }
+});
+
+Roo.WestLayoutRegion = function(mgr, config){
+    Roo.SplitLayoutRegion.call(this, mgr, config, "west", "w-resize");
+    if(this.split){
+        this.split.placement = Roo.SplitBar.LEFT;
+        this.split.orientation = Roo.SplitBar.HORIZONTAL;
+        this.split.el.addClass("x-layout-split-h");
+    }
+    var size = config.initialSize || config.width;
+    if(typeof size != "undefined"){
+        this.el.setWidth(size);
+    }
+};
+Roo.extend(Roo.WestLayoutRegion, Roo.SplitLayoutRegion, {
+    orientation: Roo.SplitBar.HORIZONTAL,
+    getBox : function(){
+        if(this.collapsed){
+            return this.collapsedEl.getBox();
+        }
+        var box = this.el.getBox();
+        if(this.split){
+            box.width += this.split.el.getWidth();
+        }
+        return box;
+    },
+    
+    updateBox : function(box){
+        if(this.split && !this.collapsed){
+            var sw = this.split.el.getWidth();
+            box.width -= sw;
+            this.split.el.setLeft(box.x+box.width);
+            this.split.el.setTop(box.y);
+            this.split.el.setHeight(box.height);
+        }
+        if(this.collapsed){
+            this.updateBody(null, box.height);
+        }
+        Roo.LayoutRegion.prototype.updateBox.call(this, box);
+    }
+});
diff --git a/Roo/ColorPalette.js b/Roo/ColorPalette.js
new file mode 100644 (file)
index 0000000..7269e18
--- /dev/null
@@ -0,0 +1,148 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+
+/**
+ * @class Roo.ColorPalette
+ * @extends Roo.Component
+ * Simple color palette class for choosing colors.  The palette can be rendered to any container.<br />
+ * Here's an example of typical usage:
+ * <pre><code>
+var cp = new Roo.ColorPalette({value:'993300'});  // initial selected color
+cp.render('my-div');
+
+cp.on('select', function(palette, selColor){
+    // do something with selColor
+});
+</code></pre>
+ * @constructor
+ * Create a new ColorPalette
+ * @param {Object} config The config object
+ */
+Roo.ColorPalette = function(config){
+    Roo.ColorPalette.superclass.constructor.call(this, config);
+    this.addEvents({
+        /**
+            * @event select
+            * Fires when a color is selected
+            * @param {ColorPalette} this
+            * @param {String} color The 6-digit color hex code (without the # symbol)
+            */
+        select: true
+    });
+
+    if(this.handler){
+        this.on("select", this.handler, this.scope, true);
+    }
+};
+Roo.extend(Roo.ColorPalette, Roo.Component, {
+    /**
+     * @cfg {String} itemCls
+     * The CSS class to apply to the containing element (defaults to "x-color-palette")
+     */
+    itemCls : "x-color-palette",
+    /**
+     * @cfg {String} value
+     * The initial color to highlight (should be a valid 6-digit color hex code without the # symbol).  Note that
+     * the hex codes are case-sensitive.
+     */
+    value : null,
+    clickEvent:'click',
+    // private
+    ctype: "Roo.ColorPalette",
+
+    /**
+     * @cfg {Boolean} allowReselect If set to true then reselecting a color that is already selected fires the selection event
+     */
+    allowReselect : false,
+
+    /**
+     * <p>An array of 6-digit color hex code strings (without the # symbol).  This array can contain any number
+     * of colors, and each hex code should be unique.  The width of the palette is controlled via CSS by adjusting
+     * the width property of the 'x-color-palette' class (or assigning a custom class), so you can balance the number
+     * of colors with the width setting until the box is symmetrical.</p>
+     * <p>You can override individual colors if needed:</p>
+     * <pre><code>
+var cp = new Roo.ColorPalette();
+cp.colors[0] = "FF0000";  // change the first box to red
+</code></pre>
+
+Or you can provide a custom array of your own for complete control:
+<pre><code>
+var cp = new Roo.ColorPalette();
+cp.colors = ["000000", "993300", "333300"];
+</code></pre>
+     * @type Array
+     */
+    colors : [
+        "000000", "993300", "333300", "003300", "003366", "000080", "333399", "333333",
+        "800000", "FF6600", "808000", "008000", "008080", "0000FF", "666699", "808080",
+        "FF0000", "FF9900", "99CC00", "339966", "33CCCC", "3366FF", "800080", "969696",
+        "FF00FF", "FFCC00", "FFFF00", "00FF00", "00FFFF", "00CCFF", "993366", "C0C0C0",
+        "FF99CC", "FFCC99", "FFFF99", "CCFFCC", "CCFFFF", "99CCFF", "CC99FF", "FFFFFF"
+    ],
+
+    // private
+    onRender : function(container, position){
+        var t = new Roo.MasterTemplate(
+            '<tpl><a href="#" class="color-{0}" hidefocus="on"><em><span style="background:#{0}" unselectable="on">&#160;</span></em></a></tpl>'
+        );
+        var c = this.colors;
+        for(var i = 0, len = c.length; i < len; i++){
+            t.add([c[i]]);
+        }
+        var el = document.createElement("div");
+        el.className = this.itemCls;
+        t.overwrite(el);
+        container.dom.insertBefore(el, position);
+        this.el = Roo.get(el);
+        this.el.on(this.clickEvent, this.handleClick,  this, {delegate: "a"});
+        if(this.clickEvent != 'click'){
+            this.el.on('click', Roo.emptyFn,  this, {delegate: "a", preventDefault:true});
+        }
+    },
+
+    // private
+    afterRender : function(){
+        Roo.ColorPalette.superclass.afterRender.call(this);
+        if(this.value){
+            var s = this.value;
+            this.value = null;
+            this.select(s);
+        }
+    },
+
+    // private
+    handleClick : function(e, t){
+        e.preventDefault();
+        if(!this.disabled){
+            var c = t.className.match(/(?:^|\s)color-(.{6})(?:\s|$)/)[1];
+            this.select(c.toUpperCase());
+        }
+    },
+
+    /**
+     * Selects the specified color in the palette (fires the select event)
+     * @param {String} color A valid 6-digit color hex code (# will be stripped if included)
+     */
+    select : function(color){
+        color = color.replace("#", "");
+        if(color != this.value || this.allowReselect){
+            var el = this.el;
+            if(this.value){
+                el.child("a.color-"+this.value).removeClass("x-color-palette-sel");
+            }
+            el.child("a.color-"+color).addClass("x-color-palette-sel");
+            this.value = color;
+            this.fireEvent("select", this, color);
+        }
+    }
+});
\ No newline at end of file
diff --git a/Roo/Component.js b/Roo/Component.js
new file mode 100644 (file)
index 0000000..a8f01e2
--- /dev/null
@@ -0,0 +1,418 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+/**
+ * @class Roo.Component
+ * @extends Roo.util.Observable
+ * Base class for all major Ext components.  All subclasses of Component can automatically participate in the standard
+ * Ext component lifecycle of creation, rendering and destruction.  They also have automatic support for basic hide/show
+ * and enable/disable behavior.  Component allows any subclass to be lazy-rendered into any {@link Roo.Container} and
+ * to be automatically registered with the {@link Roo.ComponentMgr} so that it can be referenced at any time via {@link Roo.getCmp}.
+ * All visual components (widgets) that require rendering into a layout should subclass Component.
+ * @constructor
+ * @param {Roo.Element/String/Object} config The configuration options.  If an element is passed, it is set as the internal
+ * element and its id used as the component id.  If a string is passed, it is assumed to be the id of an existing element
+ * and is used as the component id.  Otherwise, it is assumed to be a standard config object and is applied to the component.
+ */
+Roo.Component = function(config){
+    config = config || {};
+    if(config.tagName || config.dom || typeof config == "string"){ // element object
+        config = {el: config, id: config.id || config};
+    }
+    this.initialConfig = config;
+
+    Roo.apply(this, config);
+    this.addEvents({
+        /**
+         * @event disable
+         * Fires after the component is disabled.
+            * @param {Roo.Component} this
+            */
+        disable : true,
+        /**
+         * @event enable
+         * Fires after the component is enabled.
+            * @param {Roo.Component} this
+            */
+        enable : true,
+        /**
+         * @event beforeshow
+         * Fires before the component is shown.  Return false to stop the show.
+            * @param {Roo.Component} this
+            */
+        beforeshow : true,
+        /**
+         * @event show
+         * Fires after the component is shown.
+            * @param {Roo.Component} this
+            */
+        show : true,
+        /**
+         * @event beforehide
+         * Fires before the component is hidden. Return false to stop the hide.
+            * @param {Roo.Component} this
+            */
+        beforehide : true,
+        /**
+         * @event hide
+         * Fires after the component is hidden.
+            * @param {Roo.Component} this
+            */
+        hide : true,
+        /**
+         * @event beforerender
+         * Fires before the component is rendered. Return false to stop the render.
+            * @param {Roo.Component} this
+            */
+        beforerender : true,
+        /**
+         * @event render
+         * Fires after the component is rendered.
+            * @param {Roo.Component} this
+            */
+        render : true,
+        /**
+         * @event beforedestroy
+         * Fires before the component is destroyed. Return false to stop the destroy.
+            * @param {Roo.Component} this
+            */
+        beforedestroy : true,
+        /**
+         * @event destroy
+         * Fires after the component is destroyed.
+            * @param {Roo.Component} this
+            */
+        destroy : true
+    });
+    if(!this.id){
+        this.id = "ext-comp-" + (++Roo.Component.AUTO_ID);
+    }
+    Roo.ComponentMgr.register(this);
+    Roo.Component.superclass.constructor.call(this);
+    this.initComponent();
+    if(this.renderTo){ // not supported by all components yet. use at your own risk!
+        this.render(this.renderTo);
+        delete this.renderTo;
+    }
+};
+
+// private
+Roo.Component.AUTO_ID = 1000;
+
+Roo.extend(Roo.Component, Roo.util.Observable, {
+    /**
+     * @property {Boolean} hidden
+     * true if this component is hidden. Read-only.
+     */
+    hidden : false,
+    /**
+     * true if this component is disabled. Read-only.
+     */
+    disabled : false,
+    /**
+     * true if this component has been rendered. Read-only.
+     */
+    rendered : false,
+    
+    /** @cfg {String} disableClass
+     * CSS class added to the component when it is disabled (defaults to "x-item-disabled").
+     */
+    disabledClass : "x-item-disabled",
+       /** @cfg {Boolean} allowDomMove
+        * Whether the component can move the Dom node when rendering (defaults to true).
+        */
+    allowDomMove : true,
+    /** @cfg {String} hideMode
+     * How this component should hidden. Supported values are
+     * "visibility" (css visibility), "offsets" (negative offset position) and
+     * "display" (css display) - defaults to "display".
+     */
+    hideMode: 'display',
+
+    // private
+    ctype : "Roo.Component",
+
+    /** @cfg {String} actionMode 
+     * which property holds the element that used for  hide() / show() / disable() / enable()
+     * default is 'el' 
+     */
+    actionMode : "el",
+
+    // private
+    getActionEl : function(){
+        return this[this.actionMode];
+    },
+
+    initComponent : Roo.emptyFn,
+    /**
+     * If this is a lazy rendering component, render it to its container element.
+     * @param {String/HTMLElement/Element} container (optional) The element this component should be rendered into. If it is being applied to existing markup, this should be left off.
+     */
+    render : function(container, position){
+        if(!this.rendered && this.fireEvent("beforerender", this) !== false){
+            if(!container && this.el){
+                this.el = Roo.get(this.el);
+                container = this.el.dom.parentNode;
+                this.allowDomMove = false;
+            }
+            this.container = Roo.get(container);
+            this.rendered = true;
+            if(position !== undefined){
+                if(typeof position == 'number'){
+                    position = this.container.dom.childNodes[position];
+                }else{
+                    position = Roo.getDom(position);
+                }
+            }
+            this.onRender(this.container, position || null);
+            if(this.cls){
+                this.el.addClass(this.cls);
+                delete this.cls;
+            }
+            if(this.style){
+                this.el.applyStyles(this.style);
+                delete this.style;
+            }
+            this.fireEvent("render", this);
+            this.afterRender(this.container);
+            if(this.hidden){
+                this.hide();
+            }
+            if(this.disabled){
+                this.disable();
+            }
+        }
+        return this;
+    },
+
+    // private
+    // default function is not really useful
+    onRender : function(ct, position){
+        if(this.el){
+            this.el = Roo.get(this.el);
+            if(this.allowDomMove !== false){
+                ct.dom.insertBefore(this.el.dom, position);
+            }
+        }
+    },
+
+    // private
+    getAutoCreate : function(){
+        var cfg = typeof this.autoCreate == "object" ?
+                      this.autoCreate : Roo.apply({}, this.defaultAutoCreate);
+        if(this.id && !cfg.id){
+            cfg.id = this.id;
+        }
+        return cfg;
+    },
+
+    // private
+    afterRender : Roo.emptyFn,
+
+    /**
+     * Destroys this component by purging any event listeners, removing the component's element from the DOM,
+     * removing the component from its {@link Roo.Container} (if applicable) and unregistering it from {@link Roo.ComponentMgr}.
+     */
+    destroy : function(){
+        if(this.fireEvent("beforedestroy", this) !== false){
+            this.purgeListeners();
+            this.beforeDestroy();
+            if(this.rendered){
+                this.el.removeAllListeners();
+                this.el.remove();
+                if(this.actionMode == "container"){
+                    this.container.remove();
+                }
+            }
+            this.onDestroy();
+            Roo.ComponentMgr.unregister(this);
+            this.fireEvent("destroy", this);
+        }
+    },
+
+       // private
+    beforeDestroy : function(){
+
+    },
+
+       // private
+       onDestroy : function(){
+
+    },
+
+    /**
+     * Returns the underlying {@link Roo.Element}.
+     * @return {Roo.Element} The element
+     */
+    getEl : function(){
+        return this.el;
+    },
+
+    /**
+     * Returns the id of this component.
+     * @return {String}
+     */
+    getId : function(){
+        return this.id;
+    },
+
+    /**
+     * Try to focus this component.
+     * @param {Boolean} selectText True to also select the text in this component (if applicable)
+     * @return {Roo.Component} this
+     */
+    focus : function(selectText){
+        if(this.rendered){
+            this.el.focus();
+            if(selectText === true){
+                this.el.dom.select();
+            }
+        }
+        return this;
+    },
+
+    // private
+    blur : function(){
+        if(this.rendered){
+            this.el.blur();
+        }
+        return this;
+    },
+
+    /**
+     * Disable this component.
+     * @return {Roo.Component} this
+     */
+    disable : function(){
+        if(this.rendered){
+            this.onDisable();
+        }
+        this.disabled = true;
+        this.fireEvent("disable", this);
+        return this;
+    },
+
+       // private
+    onDisable : function(){
+        this.getActionEl().addClass(this.disabledClass);
+        this.el.dom.disabled = true;
+    },
+
+    /**
+     * Enable this component.
+     * @return {Roo.Component} this
+     */
+    enable : function(){
+        if(this.rendered){
+            this.onEnable();
+        }
+        this.disabled = false;
+        this.fireEvent("enable", this);
+        return this;
+    },
+
+       // private
+    onEnable : function(){
+        this.getActionEl().removeClass(this.disabledClass);
+        this.el.dom.disabled = false;
+    },
+
+    /**
+     * Convenience function for setting disabled/enabled by boolean.
+     * @param {Boolean} disabled
+     */
+    setDisabled : function(disabled){
+        this[disabled ? "disable" : "enable"]();
+    },
+
+    /**
+     * Show this component.
+     * @return {Roo.Component} this
+     */
+    show: function(){
+        if(this.fireEvent("beforeshow", this) !== false){
+            this.hidden = false;
+            if(this.rendered){
+                this.onShow();
+            }
+            this.fireEvent("show", this);
+        }
+        return this;
+    },
+
+    // private
+    onShow : function(){
+        var ae = this.getActionEl();
+        if(this.hideMode == 'visibility'){
+            ae.dom.style.visibility = "visible";
+        }else if(this.hideMode == 'offsets'){
+            ae.removeClass('x-hidden');
+        }else{
+            ae.dom.style.display = "";
+        }
+    },
+
+    /**
+     * Hide this component.
+     * @return {Roo.Component} this
+     */
+    hide: function(){
+        if(this.fireEvent("beforehide", this) !== false){
+            this.hidden = true;
+            if(this.rendered){
+                this.onHide();
+            }
+            this.fireEvent("hide", this);
+        }
+        return this;
+    },
+
+    // private
+    onHide : function(){
+        var ae = this.getActionEl();
+        if(this.hideMode == 'visibility'){
+            ae.dom.style.visibility = "hidden";
+        }else if(this.hideMode == 'offsets'){
+            ae.addClass('x-hidden');
+        }else{
+            ae.dom.style.display = "none";
+        }
+    },
+
+    /**
+     * Convenience function to hide or show this component by boolean.
+     * @param {Boolean} visible True to show, false to hide
+     * @return {Roo.Component} this
+     */
+    setVisible: function(visible){
+        if(visible) {
+            this.show();
+        }else{
+            this.hide();
+        }
+        return this;
+    },
+
+    /**
+     * Returns true if this component is visible.
+     */
+    isVisible : function(){
+        return this.getActionEl().isVisible();
+    },
+
+    cloneConfig : function(overrides){
+        overrides = overrides || {};
+        var id = overrides.id || Roo.id();
+        var cfg = Roo.applyIf(overrides, this.initialConfig);
+        cfg.id = id; // prevent dup id
+        return new this.constructor(cfg);
+    }
+});
\ No newline at end of file
diff --git a/Roo/ComponentMgr.js b/Roo/ComponentMgr.js
new file mode 100644 (file)
index 0000000..44d0ea9
--- /dev/null
@@ -0,0 +1,61 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+
+/**
+ * @class Roo.ComponentMgr
+ * Provides a common registry of all components on a page so that they can be easily accessed by component id (see {@link Roo.getCmp}).
+ * @singleton
+ */
+Roo.ComponentMgr = function(){
+    var all = new Roo.util.MixedCollection();
+
+    return {
+        /**
+         * Registers a component.
+         * @param {Roo.Component} c The component
+         */
+        register : function(c){
+            all.add(c);
+        },
+
+        /**
+         * Unregisters a component.
+         * @param {Roo.Component} c The component
+         */
+        unregister : function(c){
+            all.remove(c);
+        },
+
+        /**
+         * Returns a component by id
+         * @param {String} id The component id
+         */
+        get : function(id){
+            return all.get(id);
+        },
+
+        /**
+         * Registers a function that will be called when a specified component is added to ComponentMgr
+         * @param {String} id The component id
+         * @param {Funtction} fn The callback function
+         * @param {Object} scope The scope of the callback
+         */
+        onAvailable : function(id, fn, scope){
+            all.on("add", function(index, o){
+                if(o.id == id){
+                    fn.call(scope || o, o);
+                    all.un("add", fn, scope);
+                }
+            });
+        }
+    };
+}();
\ No newline at end of file
diff --git a/Roo/CompositeElement.js b/Roo/CompositeElement.js
new file mode 100644 (file)
index 0000000..9b1fc3e
--- /dev/null
@@ -0,0 +1,236 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+
+
+/**
+ * @class Roo.CompositeElement
+ * Standard composite class. Creates a Roo.Element for every element in the collection.
+ * <br><br>
+ * <b>NOTE: Although they are not listed, this class supports all of the set/update methods of Roo.Element. All Roo.Element
+ * actions will be performed on all the elements in this collection.</b>
+ * <br><br>
+ * All methods return <i>this</i> and can be chained.
+ <pre><code>
+ var els = Roo.select("#some-el div.some-class", true);
+ // or select directly from an existing element
+ var el = Roo.get('some-el');
+ el.select('div.some-class', true);
+
+ els.setWidth(100); // all elements become 100 width
+ els.hide(true); // all elements fade out and hide
+ // or
+ els.setWidth(100).hide(true);
+ </code></pre>
+ */
+Roo.CompositeElement = function(els){
+    this.elements = [];
+    this.addElements(els);
+};
+Roo.CompositeElement.prototype = {
+    isComposite: true,
+    addElements : function(els){
+        if(!els) return this;
+        if(typeof els == "string"){
+            els = Roo.Element.selectorFunction(els);
+        }
+        var yels = this.elements;
+        var index = yels.length-1;
+        for(var i = 0, len = els.length; i < len; i++) {
+               yels[++index] = Roo.get(els[i]);
+        }
+        return this;
+    },
+
+    /**
+    * Clears this composite and adds the elements returned by the passed selector.
+    * @param {String/Array} els A string CSS selector, an array of elements or an element
+    * @return {CompositeElement} this
+    */
+    fill : function(els){
+        this.elements = [];
+        this.add(els);
+        return this;
+    },
+
+    /**
+    * Filters this composite to only elements that match the passed selector.
+    * @param {String} selector A string CSS selector
+    * @return {CompositeElement} this
+    */
+    filter : function(selector){
+        var els = [];
+        this.each(function(el){
+            if(el.is(selector)){
+                els[els.length] = el.dom;
+            }
+        });
+        this.fill(els);
+        return this;
+    },
+
+    invoke : function(fn, args){
+        var els = this.elements;
+        for(var i = 0, len = els.length; i < len; i++) {
+               Roo.Element.prototype[fn].apply(els[i], args);
+        }
+        return this;
+    },
+    /**
+    * Adds elements to this composite.
+    * @param {String/Array} els A string CSS selector, an array of elements or an element
+    * @return {CompositeElement} this
+    */
+    add : function(els){
+        if(typeof els == "string"){
+            this.addElements(Roo.Element.selectorFunction(els));
+        }else if(els.length !== undefined){
+            this.addElements(els);
+        }else{
+            this.addElements([els]);
+        }
+        return this;
+    },
+    /**
+    * Calls the passed function passing (el, this, index) for each element in this composite.
+    * @param {Function} fn The function to call
+    * @param {Object} scope (optional) The <i>this</i> object (defaults to the element)
+    * @return {CompositeElement} this
+    */
+    each : function(fn, scope){
+        var els = this.elements;
+        for(var i = 0, len = els.length; i < len; i++){
+            if(fn.call(scope || els[i], els[i], this, i) === false) {
+                break;
+            }
+        }
+        return this;
+    },
+
+    /**
+     * Returns the Element object at the specified index
+     * @param {Number} index
+     * @return {Roo.Element}
+     */
+    item : function(index){
+        return this.elements[index] || null;
+    },
+
+    /**
+     * Returns the first Element
+     * @return {Roo.Element}
+     */
+    first : function(){
+        return this.item(0);
+    },
+
+    /**
+     * Returns the last Element
+     * @return {Roo.Element}
+     */
+    last : function(){
+        return this.item(this.elements.length-1);
+    },
+
+    /**
+     * Returns the number of elements in this composite
+     * @return Number
+     */
+    getCount : function(){
+        return this.elements.length;
+    },
+
+    /**
+     * Returns true if this composite contains the passed element
+     * @return Boolean
+     */
+    contains : function(el){
+        return this.indexOf(el) !== -1;
+    },
+
+    /**
+     * Returns true if this composite contains the passed element
+     * @return Boolean
+     */
+    indexOf : function(el){
+        return this.elements.indexOf(Roo.get(el));
+    },
+
+
+    /**
+    * Removes the specified element(s).
+    * @param {Mixed} el The id of an element, the Element itself, the index of the element in this composite
+    * or an array of any of those.
+    * @param {Boolean} removeDom (optional) True to also remove the element from the document
+    * @return {CompositeElement} this
+    */
+    removeElement : function(el, removeDom){
+        if(el instanceof Array){
+            for(var i = 0, len = el.length; i < len; i++){
+                this.removeElement(el[i]);
+            }
+            return this;
+        }
+        var index = typeof el == 'number' ? el : this.indexOf(el);
+        if(index !== -1){
+            if(removeDom){
+                var d = this.elements[index];
+                if(d.dom){
+                    d.remove();
+                }else{
+                    d.parentNode.removeChild(d);
+                }
+            }
+            this.elements.splice(index, 1);
+        }
+        return this;
+    },
+
+    /**
+    * Replaces the specified element with the passed element.
+    * @param {String/HTMLElement/Element/Number} el The id of an element, the Element itself, the index of the element in this composite
+    * to replace.
+    * @param {String/HTMLElement/Element} replacement The id of an element or the Element itself.
+    * @param {Boolean} domReplace (Optional) True to remove and replace the element in the document too.
+    * @return {CompositeElement} this
+    */
+    replaceElement : function(el, replacement, domReplace){
+        var index = typeof el == 'number' ? el : this.indexOf(el);
+        if(index !== -1){
+            if(domReplace){
+                this.elements[index].replaceWith(replacement);
+            }else{
+                this.elements.splice(index, 1, Roo.get(replacement))
+            }
+        }
+        return this;
+    },
+
+    /**
+     * Removes all elements.
+     */
+    clear : function(){
+        this.elements = [];
+    }
+};
+(function(){
+    Roo.CompositeElement.createCall = function(proto, fnName){
+        if(!proto[fnName]){
+            proto[fnName] = function(){
+                return this.invoke(fnName, arguments);
+            };
+        }
+    };
+    for(var fnName in Roo.Element.prototype){
+        if(typeof Roo.Element.prototype[fnName] == "function"){
+            Roo.CompositeElement.createCall(Roo.CompositeElement.prototype, fnName);
+        }
+    };
+})();
diff --git a/Roo/CompositeElementLite.js b/Roo/CompositeElementLite.js
new file mode 100644 (file)
index 0000000..28699f8
--- /dev/null
@@ -0,0 +1,119 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+
+/**
+ * @class Roo.CompositeElementLite
+ * @extends Roo.CompositeElement
+ * Flyweight composite class. Reuses the same Roo.Element for element operations.
+ <pre><code>
+ var els = Roo.select("#some-el div.some-class");
+ // or select directly from an existing element
+ var el = Roo.get('some-el');
+ el.select('div.some-class');
+
+ els.setWidth(100); // all elements become 100 width
+ els.hide(true); // all elements fade out and hide
+ // or
+ els.setWidth(100).hide(true);
+ </code></pre><br><br>
+ * <b>NOTE: Although they are not listed, this class supports all of the set/update methods of Roo.Element. All Roo.Element
+ * actions will be performed on all the elements in this collection.</b>
+ */
+Roo.CompositeElementLite = function(els){
+    Roo.CompositeElementLite.superclass.constructor.call(this, els);
+    this.el = new Roo.Element.Flyweight();
+};
+Roo.extend(Roo.CompositeElementLite, Roo.CompositeElement, {
+    addElements : function(els){
+        if(els){
+            if(els instanceof Array){
+                this.elements = this.elements.concat(els);
+            }else{
+                var yels = this.elements;
+                var index = yels.length-1;
+                for(var i = 0, len = els.length; i < len; i++) {
+                    yels[++index] = els[i];
+                }
+            }
+        }
+        return this;
+    },
+    invoke : function(fn, args){
+        var els = this.elements;
+        var el = this.el;
+        for(var i = 0, len = els.length; i < len; i++) {
+            el.dom = els[i];
+               Roo.Element.prototype[fn].apply(el, args);
+        }
+        return this;
+    },
+    /**
+     * Returns a flyweight Element of the dom element object at the specified index
+     * @param {Number} index
+     * @return {Roo.Element}
+     */
+    item : function(index){
+        if(!this.elements[index]){
+            return null;
+        }
+        this.el.dom = this.elements[index];
+        return this.el;
+    },
+
+    // fixes scope with flyweight
+    addListener : function(eventName, handler, scope, opt){
+        var els = this.elements;
+        for(var i = 0, len = els.length; i < len; i++) {
+            Roo.EventManager.on(els[i], eventName, handler, scope || els[i], opt);
+        }
+        return this;
+    },
+
+    /**
+    * Calls the passed function passing (el, this, index) for each element in this composite. <b>The element
+    * passed is the flyweight (shared) Roo.Element instance, so if you require a
+    * a reference to the dom node, use el.dom.</b>
+    * @param {Function} fn The function to call
+    * @param {Object} scope (optional) The <i>this</i> object (defaults to the element)
+    * @return {CompositeElement} this
+    */
+    each : function(fn, scope){
+        var els = this.elements;
+        var el = this.el;
+        for(var i = 0, len = els.length; i < len; i++){
+            el.dom = els[i];
+               if(fn.call(scope || el, el, this, i) === false){
+                break;
+            }
+        }
+        return this;
+    },
+
+    indexOf : function(el){
+        return this.elements.indexOf(Roo.getDom(el));
+    },
+
+    replaceElement : function(el, replacement, domReplace){
+        var index = typeof el == 'number' ? el : this.indexOf(el);
+        if(index !== -1){
+            replacement = Roo.getDom(replacement);
+            if(domReplace){
+                var d = this.elements[index];
+                d.parentNode.insertBefore(replacement, d);
+                d.parentNode.removeChild(d);
+            }
+            this.elements.splice(index, 1, replacement);
+        }
+        return this;
+    }
+});
+Roo.CompositeElementLite.prototype.on = Roo.CompositeElementLite.prototype.addListener;
+
diff --git a/Roo/ContentPanel.js b/Roo/ContentPanel.js
new file mode 100644 (file)
index 0000000..18c8d77
--- /dev/null
@@ -0,0 +1,677 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+/**
+ * @class Roo.ContentPanel
+ * @extends Roo.util.Observable
+ * A basic ContentPanel element.
+ * @cfg {Boolean} fitToFrame True for this panel to adjust its size to fit when the region resizes  (defaults to false)
+ * @cfg {Boolean} fitContainer When using {@link #fitToFrame} and {@link #resizeEl}, you can also fit the parent container  (defaults to false)
+ * @cfg {Boolean/Object} autoCreate True to auto generate the DOM element for this panel, or a {@link Roo.DomHelper} config of the element to create
+ * @cfg {Boolean} closable True if the panel can be closed/removed
+ * @cfg {Boolean} background True if the panel should not be activated when it is added (defaults to false)
+ * @cfg {String/HTMLElement/Element} resizeEl An element to resize if {@link #fitToFrame} is true (instead of this panel's element)
+ * @cfg {Toolbar} toolbar A toolbar for this panel
+ * @cfg {Boolean} autoScroll True to scroll overflow in this panel (use with {@link #fitToFrame})
+ * @cfg {String} title The title for this panel
+ * @cfg {Array} adjustments Values to <b>add</b> to the width/height when doing a {@link #fitToFrame} (default is [0, 0])
+ * @cfg {String} url Calls {@link #setUrl} with this value
+ * @cfg {String/Object} params When used with {@link #url}, calls {@link #setUrl} with this value
+ * @cfg {Boolean} loadOnce When used with {@link #url}, calls {@link #setUrl} with this value
+ * @constructor
+ * Create a new ContentPanel.
+ * @param {String/HTMLElement/Roo.Element} el The container element for this panel
+ * @param {String/Object} config A string to set only the title or a config object
+ * @param {String} content (optional) Set the HTML content for this panel
+ * @param {String} region (optional) Used by xtype constructors to add to regions. (values center,east,west,south,north)
+ */
+Roo.ContentPanel = function(el, config, content){
+    
+     
+    /*
+    if(el.autoCreate || el.xtype){ // xtype is available if this is called from factory
+        config = el;
+        el = Roo.id();
+    }
+    if (config && config.parentLayout) { 
+        el = config.parentLayout.el.createChild(); 
+    }
+    */
+    if(el.autoCreate){ // xtype is available if this is called from factory
+        config = el;
+        el = Roo.id();
+    }
+    this.el = Roo.get(el);
+    if(!this.el && config && config.autoCreate){
+        if(typeof config.autoCreate == "object"){
+            if(!config.autoCreate.id){
+                config.autoCreate.id = config.id||el;
+            }
+            this.el = Roo.DomHelper.append(document.body,
+                        config.autoCreate, true);
+        }else{
+            this.el = Roo.DomHelper.append(document.body,
+                        {tag: "div", cls: "x-layout-inactive-content", id: config.id||el}, true);
+        }
+    }
+    this.closable = false;
+    this.loaded = false;
+    this.active = false;
+    if(typeof config == "string"){
+        this.title = config;
+    }else{
+        Roo.apply(this, config);
+    }
+    
+    if (this.toolbar && !this.toolbar.el && this.toolbar.xtype) {
+        this.wrapEl = this.el.wrap();    
+        this.toolbar = new Roo.Toolbar(this.el.insertSibling(false, 'before'), [] , this.toolbar);
+        
+    }
+    
+    
+    
+    if(this.resizeEl){
+        this.resizeEl = Roo.get(this.resizeEl, true);
+    }else{
+        this.resizeEl = this.el;
+    }
+    this.addEvents({
+        /**
+         * @event activate
+         * Fires when this panel is activated. 
+         * @param {Roo.ContentPanel} this
+         */
+        "activate" : true,
+        /**
+         * @event deactivate
+         * Fires when this panel is activated. 
+         * @param {Roo.ContentPanel} this
+         */
+        "deactivate" : true,
+
+        /**
+         * @event resize
+         * Fires when this panel is resized if fitToFrame is true.
+         * @param {Roo.ContentPanel} this
+         * @param {Number} width The width after any component adjustments
+         * @param {Number} height The height after any component adjustments
+         */
+        "resize" : true
+    });
+    if(this.autoScroll){
+        this.resizeEl.setStyle("overflow", "auto");
+    }
+    content = content || this.content;
+    if(content){
+        this.setContent(content);
+    }
+    if(config && config.url){
+        this.setUrl(this.url, this.params, this.loadOnce);
+    }
+    
+    
+    
+    Roo.ContentPanel.superclass.constructor.call(this);
+};
+
+Roo.extend(Roo.ContentPanel, Roo.util.Observable, {
+    tabTip:'',
+    setRegion : function(region){
+        this.region = region;
+        if(region){
+           this.el.replaceClass("x-layout-inactive-content", "x-layout-active-content");
+        }else{
+           this.el.replaceClass("x-layout-active-content", "x-layout-inactive-content");
+        } 
+    },
+    
+    /**
+     * Returns the toolbar for this Panel if one was configured. 
+     * @return {Roo.Toolbar} 
+     */
+    getToolbar : function(){
+        return this.toolbar;
+    },
+    
+    setActiveState : function(active){
+        this.active = active;
+        if(!active){
+            this.fireEvent("deactivate", this);
+        }else{
+            this.fireEvent("activate", this);
+        }
+    },
+    /**
+     * Updates this panel's element
+     * @param {String} content The new content
+     * @param {Boolean} loadScripts (optional) true to look for and process scripts
+    */
+    setContent : function(content, loadScripts){
+        this.el.update(content, loadScripts);
+    },
+
+    ignoreResize : function(w, h){
+        if(this.lastSize && this.lastSize.width == w && this.lastSize.height == h){
+            return true;
+        }else{
+            this.lastSize = {width: w, height: h};
+            return false;
+        }
+    },
+    /**
+     * Get the {@link Roo.UpdateManager} for this panel. Enables you to perform Ajax updates.
+     * @return {Roo.UpdateManager} The UpdateManager
+     */
+    getUpdateManager : function(){
+        return this.el.getUpdateManager();
+    },
+     /**
+     * Loads this content panel immediately with content from XHR. Note: to delay loading until the panel is activated, use {@link #setUrl}.
+     * @param {Object/String/Function} url The url for this request or a function to call to get the url or a config object containing any of the following options:
+<pre><code>
+panel.load({
+    url: "your-url.php",
+    params: {param1: "foo", param2: "bar"}, // or a URL encoded string
+    callback: yourFunction,
+    scope: yourObject, //(optional scope)
+    discardUrl: false,
+    nocache: false,
+    text: "Loading...",
+    timeout: 30,
+    scripts: false
+});
+</code></pre>
+     * The only required property is <i>url</i>. The optional properties <i>nocache</i>, <i>text</i> and <i>scripts</i>
+     * are shorthand for <i>disableCaching</i>, <i>indicatorText</i> and <i>loadScripts</i> and are used to set their associated property on this panel UpdateManager instance.
+     * @param {String/Object} params (optional) The parameters to pass as either a URL encoded string "param1=1&amp;param2=2" or an object {param1: 1, param2: 2}
+     * @param {Function} callback (optional) Callback when transaction is complete -- called with signature (oElement, bSuccess, oResponse)
+     * @param {Boolean} discardUrl (optional) By default when you execute an update the defaultUrl is changed to the last used URL. If true, it will not store the URL.
+     * @return {Roo.ContentPanel} this
+     */
+    load : function(){
+        var um = this.el.getUpdateManager();
+        um.update.apply(um, arguments);
+        return this;
+    },
+
+
+    /**
+     * Set a URL to be used to load the content for this panel. When this panel is activated, the content will be loaded from that URL.
+     * @param {String/Function} url The URL to load the content from or a function to call to get the URL
+     * @param {String/Object} params (optional) The string params for the update call or an object of the params. See {@link Roo.UpdateManager#update} for more details. (Defaults to null)
+     * @param {Boolean} loadOnce (optional) Whether to only load the content once. If this is false it makes the Ajax call every time this panel is activated. (Defaults to false)
+     * @return {Roo.UpdateManager} The UpdateManager
+     */
+    setUrl : function(url, params, loadOnce){
+        if(this.refreshDelegate){
+            this.removeListener("activate", this.refreshDelegate);
+        }
+        this.refreshDelegate = this._handleRefresh.createDelegate(this, [url, params, loadOnce]);
+        this.on("activate", this.refreshDelegate);
+        return this.el.getUpdateManager();
+    },
+    
+    _handleRefresh : function(url, params, loadOnce){
+        if(!loadOnce || !this.loaded){
+            var updater = this.el.getUpdateManager();
+            updater.update(url, params, this._setLoaded.createDelegate(this));
+        }
+    },
+    
+    _setLoaded : function(){
+        this.loaded = true;
+    }, 
+    
+    /**
+     * Returns this panel's id
+     * @return {String} 
+     */
+    getId : function(){
+        return this.el.id;
+    },
+    
+    /** 
+     * Returns this panel's element - used by regiosn to add.
+     * @return {Roo.Element} 
+     */
+    getEl : function(){
+        return this.wrapEl || this.el;
+    },
+    
+    adjustForComponents : function(width, height){
+        if(this.resizeEl != this.el){
+            width -= this.el.getFrameWidth('lr');
+            height -= this.el.getFrameWidth('tb');
+        }
+        if(this.toolbar){
+            var te = this.toolbar.getEl();
+            height -= te.getHeight();
+            te.setWidth(width);
+        }
+        if(this.adjustments){
+            width += this.adjustments[0];
+            height += this.adjustments[1];
+        }
+        return {"width": width, "height": height};
+    },
+    
+    setSize : function(width, height){
+        if(this.fitToFrame && !this.ignoreResize(width, height)){
+            if(this.fitContainer && this.resizeEl != this.el){
+                this.el.setSize(width, height);
+            }
+            var size = this.adjustForComponents(width, height);
+            this.resizeEl.setSize(this.autoWidth ? "auto" : size.width, this.autoHeight ? "auto" : size.height);
+            this.fireEvent('resize', this, size.width, size.height);
+        }
+    },
+    
+    /**
+     * Returns this panel's title
+     * @return {String} 
+     */
+    getTitle : function(){
+        return this.title;
+    },
+    
+    /**
+     * Set this panel's title
+     * @param {String} title
+     */
+    setTitle : function(title){
+        this.title = title;
+        if(this.region){
+            this.region.updatePanelTitle(this, title);
+        }
+    },
+    
+    /**
+     * Returns true is this panel was configured to be closable
+     * @return {Boolean} 
+     */
+    isClosable : function(){
+        return this.closable;
+    },
+    
+    beforeSlide : function(){
+        this.el.clip();
+        this.resizeEl.clip();
+    },
+    
+    afterSlide : function(){
+        this.el.unclip();
+        this.resizeEl.unclip();
+    },
+    
+    /**
+     *   Force a content refresh from the URL specified in the {@link #setUrl} method.
+     *   Will fail silently if the {@link #setUrl} method has not been called.
+     *   This does not activate the panel, just updates its content.
+     */
+    refresh : function(){
+        if(this.refreshDelegate){
+           this.loaded = false;
+           this.refreshDelegate();
+        }
+    },
+    
+    /**
+     * Destroys this panel
+     */
+    destroy : function(){
+        this.el.removeAllListeners();
+        var tempEl = document.createElement("span");
+        tempEl.appendChild(this.el.dom);
+        tempEl.innerHTML = "";
+        this.el.remove();
+        this.el = null;
+    },
+    
+      /**
+     * Adds a xtype elements to the panel - currently only supports Forms.
+     * <pre><code>
+
+layout.addxtype({
+       xtype : 'Form',
+       items: [ .... ]
+   }
+);
+
+</code></pre>
+     * @param {Object} cfg Xtype definition of item to add.
+     */
+    
+    addxtype : function(cfg) {
+        // add form..
+        if (!cfg.xtype.match(/^Form$/)) {
+            return false;
+        }
+        var el = this.el.createChild();
+        this.form = new  Roo.form.Form(cfg);
+        
+        if ( this.form.allItems.length) this.form.render(el.dom);
+        return this.form;
+        
+    }
+});
+
+/**
+ * @class Roo.GridPanel
+ * @extends Roo.ContentPanel
+ * @constructor
+ * Create a new GridPanel.
+ * @param {Roo.grid.Grid} grid The grid for this panel
+ * @param {String/Object} config A string to set only the panel's title, or a config object
+ */
+Roo.GridPanel = function(grid, config){
+    this.wrapper = Roo.DomHelper.append(document.body, // wrapper for IE7 strict & safari scroll issue
+        {tag: "div", cls: "x-layout-grid-wrapper x-layout-inactive-content"}, true);
+    this.wrapper.dom.appendChild(grid.getGridEl().dom);
+    Roo.GridPanel.superclass.constructor.call(this, this.wrapper, config);
+    
+    
+    if(this.toolbar){
+        this.toolbar.el.insertBefore(this.wrapper.dom.firstChild);
+    }
+    // xtype created footer. - not sure if will work as we normally have to render first..
+    if (this.footer && !this.footer.el && this.footer.xtype) {
+        
+        this.footer.container = this.grid.getView().getFooterPanel(true);
+        this.footer.dataSource = this.grid.dataSource;
+        this.footer= Roo.factory(this.footer, Roo);
+        
+    }
+    
+    grid.monitorWindowResize = false; // turn off autosizing
+    grid.autoHeight = false;
+    grid.autoWidth = false;
+    this.grid = grid;
+    this.grid.getGridEl().replaceClass("x-layout-inactive-content", "x-layout-component-panel");
+};
+
+Roo.extend(Roo.GridPanel, Roo.ContentPanel, {
+    getId : function(){
+        return this.grid.id;
+    },
+    
+    /**
+     * Returns the grid for this panel
+     * @return {Roo.grid.Grid} 
+     */
+    getGrid : function(){
+        return this.grid;    
+    },
+    
+    setSize : function(width, height){
+        if(!this.ignoreResize(width, height)){
+            var grid = this.grid;
+            var size = this.adjustForComponents(width, height);
+            grid.getGridEl().setSize(size.width, size.height);
+            grid.autoSize();
+        }
+    },
+    
+    beforeSlide : function(){
+        this.grid.getView().scroller.clip();
+    },
+    
+    afterSlide : function(){
+        this.grid.getView().scroller.unclip();
+    },
+    
+    destroy : function(){
+        this.grid.destroy();
+        delete this.grid;
+        Roo.GridPanel.superclass.destroy.call(this); 
+    }
+});
+
+
+/**
+ * @class Roo.NestedLayoutPanel
+ * @extends Roo.ContentPanel
+ * @constructor
+ * Create a new NestedLayoutPanel.
+ * 
+ * 
+ * @param {Roo.BorderLayout} layout The layout for this panel
+ * @param {String/Object} config A string to set only the title or a config object
+ */
+Roo.NestedLayoutPanel = function(layout, config)
+{
+    // construct with only one argument..
+    /* FIXME - implement nicer consturctors
+    if (layout.layout) {
+        config = layout;
+        layout = config.layout;
+        delete config.layout;
+    }
+    if (layout.xtype && !layout.getEl) {
+        // then layout needs constructing..
+        layout = Roo.factory(layout, Roo);
+    }
+    */
+    
+    Roo.NestedLayoutPanel.superclass.constructor.call(this, layout.getEl(), config);
+    
+    layout.monitorWindowResize = false; // turn off autosizing
+    this.layout = layout;
+    this.layout.getEl().addClass("x-layout-nested-layout");
+    
+    
+    
+};
+
+Roo.extend(Roo.NestedLayoutPanel, Roo.ContentPanel, {
+
+    setSize : function(width, height){
+        if(!this.ignoreResize(width, height)){
+            var size = this.adjustForComponents(width, height);
+            var el = this.layout.getEl();
+            el.setSize(size.width, size.height);
+            var touch = el.dom.offsetWidth;
+            this.layout.layout();
+            // ie requires a double layout on the first pass
+            if(Roo.isIE && !this.initialized){
+                this.initialized = true;
+                this.layout.layout();
+            }
+        }
+    },
+    
+    // activate all subpanels if not currently active..
+    
+    setActiveState : function(active){
+        this.active = active;
+        if(!active){
+            this.fireEvent("deactivate", this);
+            return;
+        }
+        
+        this.fireEvent("activate", this);
+        // not sure if this should happen before or after..
+        if (!this.layout) {
+            return; // should not happen..
+        }
+        var reg = false;
+        for (var r in this.layout.regions) {
+            reg = this.layout.getRegion(r);
+            if (reg.getActivePanel()) {
+                //reg.showPanel(reg.getActivePanel()); // force it to activate.. 
+                reg.setActivePanel(reg.getActivePanel());
+                continue;
+            }
+            if (!reg.panels.length) {
+                continue;
+            }
+            reg.showPanel(reg.getPanel(0));
+        }
+        
+        
+        
+        
+    },
+    
+    /**
+     * Returns the nested BorderLayout for this panel
+     * @return {Roo.BorderLayout} 
+     */
+    getLayout : function(){
+        return this.layout;
+    },
+    
+     /**
+     * Adds a xtype elements to the layout of the nested panel
+     * <pre><code>
+
+panel.addxtype({
+       xtype : 'ContentPanel',
+       region: 'west',
+       items: [ .... ]
+   }
+);
+
+panel.addxtype({
+        xtype : 'NestedLayoutPanel',
+        region: 'west',
+        layout: {
+           center: { },
+           west: { }   
+        },
+        items : [ ... list of content panels or nested layout panels.. ]
+   }
+);
+</code></pre>
+     * @param {Object} cfg Xtype definition of item to add.
+     */
+    addxtype : function(cfg) {
+        return this.layout.addxtype(cfg);
+    
+    }
+});
+
+Roo.ScrollPanel = function(el, config, content){
+    config = config || {};
+    config.fitToFrame = true;
+    Roo.ScrollPanel.superclass.constructor.call(this, el, config, content);
+    
+    this.el.dom.style.overflow = "hidden";
+    var wrap = this.el.wrap({cls: "x-scroller x-layout-inactive-content"});
+    this.el.removeClass("x-layout-inactive-content");
+    this.el.on("mousewheel", this.onWheel, this);
+
+    var up = wrap.createChild({cls: "x-scroller-up", html: "&#160;"}, this.el.dom);
+    var down = wrap.createChild({cls: "x-scroller-down", html: "&#160;"});
+    up.unselectable(); down.unselectable();
+    up.on("click", this.scrollUp, this);
+    down.on("click", this.scrollDown, this);
+    up.addClassOnOver("x-scroller-btn-over");
+    down.addClassOnOver("x-scroller-btn-over");
+    up.addClassOnClick("x-scroller-btn-click");
+    down.addClassOnClick("x-scroller-btn-click");
+    this.adjustments = [0, -(up.getHeight() + down.getHeight())];
+
+    this.resizeEl = this.el;
+    this.el = wrap; this.up = up; this.down = down;
+};
+
+Roo.extend(Roo.ScrollPanel, Roo.ContentPanel, {
+    increment : 100,
+    wheelIncrement : 5,
+    scrollUp : function(){
+        this.resizeEl.scroll("up", this.increment, {callback: this.afterScroll, scope: this});
+    },
+
+    scrollDown : function(){
+        this.resizeEl.scroll("down", this.increment, {callback: this.afterScroll, scope: this});
+    },
+
+    afterScroll : function(){
+        var el = this.resizeEl;
+        var t = el.dom.scrollTop, h = el.dom.scrollHeight, ch = el.dom.clientHeight;
+        this.up[t == 0 ? "addClass" : "removeClass"]("x-scroller-btn-disabled");
+        this.down[h - t <= ch ? "addClass" : "removeClass"]("x-scroller-btn-disabled");
+    },
+
+    setSize : function(){
+        Roo.ScrollPanel.superclass.setSize.apply(this, arguments);
+        this.afterScroll();
+    },
+
+    onWheel : function(e){
+        var d = e.getWheelDelta();
+        this.resizeEl.dom.scrollTop -= (d*this.wheelIncrement);
+        this.afterScroll();
+        e.stopEvent();
+    },
+
+    setContent : function(content, loadScripts){
+        this.resizeEl.update(content, loadScripts);
+    }
+
+});
+
+
+
+
+
+
+
+
+
+/**
+ * @class Roo.TreePanel
+ * @extends Roo.ContentPanel
+ * @constructor
+ * Create a new TreePanel.
+ * @param {String/Object} config A string to set only the panel's title, or a config object
+ * @cfg {Roo.tree.TreePanel} tree The tree TreePanel, with config etc.
+ */
+Roo.TreePanel = function(config){
+    var el = config.el;
+    var tree = config.tree;
+    delete config.tree; 
+    delete config.el; // hopefull!
+    Roo.TreePanel.superclass.constructor.call(this, el, config);
+    var treeEl = el.createChild();
+    this.tree = new Roo.tree.TreePanel(treeEl , tree);
+    //console.log(tree);
+    this.on('activate', function()
+    {
+        if (this.tree.rendered) {
+            return;
+        }
+        //console.log('render tree');
+        this.tree.render();
+    });
+    
+    this.on('resize',  function (cp, w, h) {
+            this.tree.innerCt.setWidth(w);
+            this.tree.innerCt.setHeight(h);
+            this.tree.innerCt.setStyle('overflow-y', 'auto');
+    });
+
+        
+    
+};
+
+Roo.extend(Roo.TreePanel, Roo.ContentPanel);
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Roo/DDView.js b/Roo/DDView.js
new file mode 100644 (file)
index 0000000..c8a2872
--- /dev/null
@@ -0,0 +1,417 @@
+//<script type="text/javasscript">
+
+/**
+ * @class Roo.DDView
+ * A DnD enabled version of Roo.View.
+ * @param {Element/String} container The Element in which to create the View.
+ * @param {String} tpl The template string used to create the markup for each element of the View
+ * @param {Object} config The configuration properties. These include all the config options of
+ * {@link Roo.View} plus some specific to this class.<br>
+ * <p>
+ * Drag/drop is implemented by adding {@link Roo.data.Record}s to the target DDView. If copying is
+ * not being performed, the original {@link Roo.data.Record} is removed from the source DDView.<br>
+ * <p>
+ * The following extra CSS rules are needed to provide insertion point highlighting:<pre><code>
+.x-view-drag-insert-above {
+       border-top:1px dotted #3366cc;
+}
+.x-view-drag-insert-below {
+       border-bottom:1px dotted #3366cc;
+}
+</code></pre>
+ * 
+ */
+Roo.DDView = function(container, tpl, config) {
+    Roo.DDView.superclass.constructor.apply(this, arguments);
+    this.getEl().setStyle("outline", "0px none");
+    this.getEl().unselectable();
+    if (this.dragGroup) {
+               this.setDraggable(this.dragGroup.split(","));
+    }
+    if (this.dropGroup) {
+               this.setDroppable(this.dropGroup.split(","));
+    }
+    if (this.deletable) {
+       this.setDeletable();
+    }
+    this.isDirtyFlag = false;
+       this.addEvents({
+               "drop" : true
+       });
+};
+
+Roo.extend(Roo.DDView, Roo.View, {
+/**    @cfg {String/Array} dragGroup The ddgroup name(s) for the View's DragZone. */
+/**    @cfg {String/Array} dropGroup The ddgroup name(s) for the View's DropZone. */
+/**    @cfg {Boolean} copy Causes drag operations to copy nodes rather than move. */
+/**    @cfg {Boolean} allowCopy Causes ctrl/drag operations to copy nodes rather than move. */
+
+       isFormField: true,
+
+       reset: Roo.emptyFn,
+       
+       clearInvalid: Roo.form.Field.prototype.clearInvalid,
+
+       validate: function() {
+               return true;
+       },
+       
+       destroy: function() {
+               this.purgeListeners();
+               this.getEl.removeAllListeners();
+               this.getEl().remove();
+               if (this.dragZone) {
+                       if (this.dragZone.destroy) {
+                               this.dragZone.destroy();
+                       }
+               }
+               if (this.dropZone) {
+                       if (this.dropZone.destroy) {
+                               this.dropZone.destroy();
+                       }
+               }
+       },
+
+/**    Allows this class to be an Roo.form.Field so it can be found using {@link Roo.form.BasicForm#findField}. */
+       getName: function() {
+               return this.name;
+       },
+
+/**    Loads the View from a JSON string representing the Records to put into the Store. */
+       setValue: function(v) {
+               if (!this.store) {
+                       throw "DDView.setValue(). DDView must be constructed with a valid Store";
+               }
+               var data = {};
+               data[this.store.reader.meta.root] = v ? [].concat(v) : [];
+               this.store.proxy = new Roo.data.MemoryProxy(data);
+               this.store.load();
+       },
+
+/**    @return {String} a parenthesised list of the ids of the Records in the View. */
+       getValue: function() {
+               var result = '(';
+               this.store.each(function(rec) {
+                       result += rec.id + ',';
+               });
+               return result.substr(0, result.length - 1) + ')';
+       },
+       
+       getIds: function() {
+               var i = 0, result = new Array(this.store.getCount());
+               this.store.each(function(rec) {
+                       result[i++] = rec.id;
+               });
+               return result;
+       },
+       
+       isDirty: function() {
+               return this.isDirtyFlag;
+       },
+
+/**
+ *     Part of the Roo.dd.DropZone interface. If no target node is found, the
+ *     whole Element becomes the target, and this causes the drop gesture to append.
+ */
+    getTargetFromEvent : function(e) {
+               var target = e.getTarget();
+               while ((target !== null) && (target.parentNode != this.el.dom)) {
+               target = target.parentNode;
+               }
+               if (!target) {
+                       target = this.el.dom.lastChild || this.el.dom;
+               }
+               return target;
+    },
+
+/**
+ *     Create the drag data which consists of an object which has the property "ddel" as
+ *     the drag proxy element. 
+ */
+    getDragData : function(e) {
+        var target = this.findItemFromChild(e.getTarget());
+               if(target) {
+                       this.handleSelection(e);
+                       var selNodes = this.getSelectedNodes();
+            var dragData = {
+                source: this,
+                copy: this.copy || (this.allowCopy && e.ctrlKey),
+                nodes: selNodes,
+                records: []
+                       };
+                       var selectedIndices = this.getSelectedIndexes();
+                       for (var i = 0; i < selectedIndices.length; i++) {
+                               dragData.records.push(this.store.getAt(selectedIndices[i]));
+                       }
+                       if (selNodes.length == 1) {
+                               dragData.ddel = target.cloneNode(true); // the div element
+                       } else {
+                               var div = document.createElement('div'); // create the multi element drag "ghost"
+                               div.className = 'multi-proxy';
+                               for (var i = 0, len = selNodes.length; i < len; i++) {
+                                       div.appendChild(selNodes[i].cloneNode(true));
+                               }
+                               dragData.ddel = div;
+                       }
+            //console.log(dragData)
+            //console.log(dragData.ddel.innerHTML)
+                       return dragData;
+               }
+        //console.log('nodragData')
+               return false;
+    },
+    
+/**    Specify to which ddGroup items in this DDView may be dragged. */
+    setDraggable: function(ddGroup) {
+       if (ddGroup instanceof Array) {
+               Roo.each(ddGroup, this.setDraggable, this);
+               return;
+       }
+       if (this.dragZone) {
+               this.dragZone.addToGroup(ddGroup);
+       } else {
+                       this.dragZone = new Roo.dd.DragZone(this.getEl(), {
+                               containerScroll: true,
+                               ddGroup: ddGroup 
+
+                       });
+//                     Draggability implies selection. DragZone's mousedown selects the element.
+                       if (!this.multiSelect) { this.singleSelect = true; }
+
+//                     Wire the DragZone's handlers up to methods in *this*
+                       this.dragZone.getDragData = this.getDragData.createDelegate(this);
+               }
+    },
+
+/**    Specify from which ddGroup this DDView accepts drops. */
+    setDroppable: function(ddGroup) {
+       if (ddGroup instanceof Array) {
+               Roo.each(ddGroup, this.setDroppable, this);
+               return;
+       }
+       if (this.dropZone) {
+               this.dropZone.addToGroup(ddGroup);
+       } else {
+                       this.dropZone = new Roo.dd.DropZone(this.getEl(), {
+                               containerScroll: true,
+                               ddGroup: ddGroup
+                       });
+
+//                     Wire the DropZone's handlers up to methods in *this*
+                       this.dropZone.getTargetFromEvent = this.getTargetFromEvent.createDelegate(this);
+                       this.dropZone.onNodeEnter = this.onNodeEnter.createDelegate(this);
+                       this.dropZone.onNodeOver = this.onNodeOver.createDelegate(this);
+                       this.dropZone.onNodeOut = this.onNodeOut.createDelegate(this);
+                       this.dropZone.onNodeDrop = this.onNodeDrop.createDelegate(this);
+               }
+    },
+
+/**    Decide whether to drop above or below a View node. */
+    getDropPoint : function(e, n, dd){
+       if (n == this.el.dom) { return "above"; }
+               var t = Roo.lib.Dom.getY(n), b = t + n.offsetHeight;
+               var c = t + (b - t) / 2;
+               var y = Roo.lib.Event.getPageY(e);
+               if(y <= c) {
+                       return "above";
+               }else{
+                       return "below";
+               }
+    },
+
+    onNodeEnter : function(n, dd, e, data){
+               return false;
+    },
+    
+    onNodeOver : function(n, dd, e, data){
+               var pt = this.getDropPoint(e, n, dd);
+               // set the insert point style on the target node
+               var dragElClass = this.dropNotAllowed;
+               if (pt) {
+                       var targetElClass;
+                       if (pt == "above"){
+                               dragElClass = n.previousSibling ? "x-tree-drop-ok-between" : "x-tree-drop-ok-above";
+                               targetElClass = "x-view-drag-insert-above";
+                       } else {
+                               dragElClass = n.nextSibling ? "x-tree-drop-ok-between" : "x-tree-drop-ok-below";
+                               targetElClass = "x-view-drag-insert-below";
+                       }
+                       if (this.lastInsertClass != targetElClass){
+                               Roo.fly(n).replaceClass(this.lastInsertClass, targetElClass);
+                               this.lastInsertClass = targetElClass;
+                       }
+               }
+               return dragElClass;
+       },
+
+    onNodeOut : function(n, dd, e, data){
+               this.removeDropIndicators(n);
+    },
+
+    onNodeDrop : function(n, dd, e, data){
+       if (this.fireEvent("drop", this, n, dd, e, data) === false) {
+               return false;
+       }
+       var pt = this.getDropPoint(e, n, dd);
+               var insertAt = (n == this.el.dom) ? this.nodes.length : n.nodeIndex;
+               if (pt == "below") { insertAt++; }
+               for (var i = 0; i < data.records.length; i++) {
+                       var r = data.records[i];
+                       var dup = this.store.getById(r.id);
+                       if (dup && (dd != this.dragZone)) {
+                               Roo.fly(this.getNode(this.store.indexOf(dup))).frame("red", 1);
+                       } else {
+                               if (data.copy) {
+                                       this.store.insert(insertAt++, r.copy());
+                               } else {
+                                       data.source.isDirtyFlag = true;
+                                       r.store.remove(r);
+                                       this.store.insert(insertAt++, r);
+                               }
+                               this.isDirtyFlag = true;
+                       }
+               }
+               this.dragZone.cachedTarget = null;
+               return true;
+    },
+
+    removeDropIndicators : function(n){
+               if(n){
+                       Roo.fly(n).removeClass([
+                               "x-view-drag-insert-above",
+                               "x-view-drag-insert-below"]);
+                       this.lastInsertClass = "_noclass";
+               }
+    },
+
+/**
+ *     Utility method. Add a delete option to the DDView's context menu.
+ *     @param {String} imageUrl The URL of the "delete" icon image.
+ */
+       setDeletable: function(imageUrl) {
+               if (!this.singleSelect && !this.multiSelect) {
+                       this.singleSelect = true;
+               }
+               var c = this.getContextMenu();
+               this.contextMenu.on("itemclick", function(item) {
+                       switch (item.id) {
+                               case "delete":
+                                       this.remove(this.getSelectedIndexes());
+                                       break;
+                       }
+               }, this);
+               this.contextMenu.add({
+                       icon: imageUrl,
+                       id: "delete",
+                       text: 'Delete'
+               });
+       },
+       
+/**    Return the context menu for this DDView. */
+       getContextMenu: function() {
+               if (!this.contextMenu) {
+//                     Create the View's context menu
+                       this.contextMenu = new Roo.menu.Menu({
+                               id: this.id + "-contextmenu"
+                       });
+                       this.el.on("contextmenu", this.showContextMenu, this);
+               }
+               return this.contextMenu;
+       },
+       
+       disableContextMenu: function() {
+               if (this.contextMenu) {
+                       this.el.un("contextmenu", this.showContextMenu, this);
+               }
+       },
+
+       showContextMenu: function(e, item) {
+        item = this.findItemFromChild(e.getTarget());
+               if (item) {
+                       e.stopEvent();
+                       this.select(this.getNode(item), this.multiSelect && e.ctrlKey, true);
+                       this.contextMenu.showAt(e.getXY());
+           }
+    },
+
+/**
+ *     Remove {@link Roo.data.Record}s at the specified indices.
+ *     @param {Array/Number} selectedIndices The index (or Array of indices) of Records to remove.
+ */
+    remove: function(selectedIndices) {
+               selectedIndices = [].concat(selectedIndices);
+               for (var i = 0; i < selectedIndices.length; i++) {
+                       var rec = this.store.getAt(selectedIndices[i]);
+                       this.store.remove(rec);
+               }
+    },
+
+/**
+ *     Double click fires the event, but also, if this is draggable, and there is only one other
+ *     related DropZone, it transfers the selected node.
+ */
+    onDblClick : function(e){
+        var item = this.findItemFromChild(e.getTarget());
+        if(item){
+            if (this.fireEvent("dblclick", this, this.indexOf(item), item, e) === false) {
+               return false;
+            }
+            if (this.dragGroup) {
+                   var targets = Roo.dd.DragDropMgr.getRelated(this.dragZone, true);
+                   while (targets.indexOf(this.dropZone) > -1) {
+                           targets.remove(this.dropZone);
+                               }
+                   if (targets.length == 1) {
+                                       this.dragZone.cachedTarget = null;
+                       var el = Roo.get(targets[0].getEl());
+                       var box = el.getBox(true);
+                       targets[0].onNodeDrop(el.dom, {
+                               target: el.dom,
+                               xy: [box.x, box.y + box.height - 1]
+                       }, null, this.getDragData(e));
+                   }
+               }
+        }
+    },
+    
+    handleSelection: function(e) {
+               this.dragZone.cachedTarget = null;
+        var item = this.findItemFromChild(e.getTarget());
+        if (!item) {
+               this.clearSelections(true);
+               return;
+        }
+               if (item && (this.multiSelect || this.singleSelect)){
+                       if(this.multiSelect && e.shiftKey && (!e.ctrlKey) && this.lastSelection){
+                               this.select(this.getNodes(this.indexOf(this.lastSelection), item.nodeIndex), false);
+                       }else if (this.isSelected(this.getNode(item)) && e.ctrlKey){
+                               this.unselect(item);
+                       } else {
+                               this.select(item, this.multiSelect && e.ctrlKey);
+                               this.lastSelection = item;
+                       }
+               }
+    },
+
+    onItemClick : function(item, index, e){
+               if(this.fireEvent("beforeclick", this, index, item, e) === false){
+                       return false;
+               }
+               return true;
+    },
+
+    unselect : function(nodeInfo, suppressEvent){
+               var node = this.getNode(nodeInfo);
+               if(node && this.isSelected(node)){
+                       if(this.fireEvent("beforeselect", this, node, this.selections) !== false){
+                               Roo.fly(node).removeClass(this.selectedClass);
+                               this.selections.remove(node);
+                               if(!suppressEvent){
+                                       this.fireEvent("selectionchange", this, this.selections);
+                               }
+                       }
+               }
+    }
+});
diff --git a/Roo/DatePicker.js b/Roo/DatePicker.js
new file mode 100644 (file)
index 0000000..fe6d3f8
--- /dev/null
@@ -0,0 +1,638 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+/**
+ * @class Roo.DatePicker
+ * @extends Roo.Component
+ * Simple date picker class.
+ * @constructor
+ * Create a new DatePicker
+ * @param {Object} config The config object
+ */
+Roo.DatePicker = function(config){
+    Roo.DatePicker.superclass.constructor.call(this, config);
+
+    this.value = config && config.value ?
+                 config.value.clearTime() : new Date().clearTime();
+
+    this.addEvents({
+        /**
+            * @event select
+            * Fires when a date is selected
+            * @param {DatePicker} this
+            * @param {Date} date The selected date
+            */
+        select: true
+    });
+
+    if(this.handler){
+        this.on("select", this.handler,  this.scope || this);
+    }
+    // build the disabledDatesRE
+    if(!this.disabledDatesRE && this.disabledDates){
+        var dd = this.disabledDates;
+        var re = "(?:";
+        for(var i = 0; i < dd.length; i++){
+            re += dd[i];
+            if(i != dd.length-1) re += "|";
+        }
+        this.disabledDatesRE = new RegExp(re + ")");
+    }
+};
+
+Roo.extend(Roo.DatePicker, Roo.Component, {
+    /**
+     * @cfg {String} todayText
+     * The text to display on the button that selects the current date (defaults to "Today")
+     */
+    todayText : "Today",
+    /**
+     * @cfg {String} okText
+     * The text to display on the ok button
+     */
+    okText : "&#160;OK&#160;", // &#160; to give the user extra clicking room
+    /**
+     * @cfg {String} cancelText
+     * The text to display on the cancel button
+     */
+    cancelText : "Cancel",
+    /**
+     * @cfg {String} todayTip
+     * The tooltip to display for the button that selects the current date (defaults to "{current date} (Spacebar)")
+     */
+    todayTip : "{0} (Spacebar)",
+    /**
+     * @cfg {Date} minDate
+     * Minimum allowable date (JavaScript date object, defaults to null)
+     */
+    minDate : null,
+    /**
+     * @cfg {Date} maxDate
+     * Maximum allowable date (JavaScript date object, defaults to null)
+     */
+    maxDate : null,
+    /**
+     * @cfg {String} minText
+     * The error text to display if the minDate validation fails (defaults to "This date is before the minimum date")
+     */
+    minText : "This date is before the minimum date",
+    /**
+     * @cfg {String} maxText
+     * The error text to display if the maxDate validation fails (defaults to "This date is after the maximum date")
+     */
+    maxText : "This date is after the maximum date",
+    /**
+     * @cfg {String} format
+     * The default date format string which can be overriden for localization support.  The format must be
+     * valid according to {@link Date#parseDate} (defaults to 'm/d/y').
+     */
+    format : "m/d/y",
+    /**
+     * @cfg {Array} disabledDays
+     * An array of days to disable, 0-based. For example, [0, 6] disables Sunday and Saturday (defaults to null).
+     */
+    disabledDays : null,
+    /**
+     * @cfg {String} disabledDaysText
+     * The tooltip to display when the date falls on a disabled day (defaults to "")
+     */
+    disabledDaysText : "",
+    /**
+     * @cfg {RegExp} disabledDatesRE
+     * JavaScript regular expression used to disable a pattern of dates (defaults to null)
+     */
+    disabledDatesRE : null,
+    /**
+     * @cfg {String} disabledDatesText
+     * The tooltip text to display when the date falls on a disabled date (defaults to "")
+     */
+    disabledDatesText : "",
+    /**
+     * @cfg {Boolean} constrainToViewport
+     * True to constrain the date picker to the viewport (defaults to true)
+     */
+    constrainToViewport : true,
+    /**
+     * @cfg {Array} monthNames
+     * An array of textual month names which can be overriden for localization support (defaults to Date.monthNames)
+     */
+    monthNames : Date.monthNames,
+    /**
+     * @cfg {Array} dayNames
+     * An array of textual day names which can be overriden for localization support (defaults to Date.dayNames)
+     */
+    dayNames : Date.dayNames,
+    /**
+     * @cfg {String} nextText
+     * The next month navigation button tooltip (defaults to 'Next Month (Control+Right)')
+     */
+    nextText: 'Next Month (Control+Right)',
+    /**
+     * @cfg {String} prevText
+     * The previous month navigation button tooltip (defaults to 'Previous Month (Control+Left)')
+     */
+    prevText: 'Previous Month (Control+Left)',
+    /**
+     * @cfg {String} monthYearText
+     * The header month selector tooltip (defaults to 'Choose a month (Control+Up/Down to move years)')
+     */
+    monthYearText: 'Choose a month (Control+Up/Down to move years)',
+    /**
+     * @cfg {Number} startDay
+     * Day index at which the week should begin, 0-based (defaults to 0, which is Sunday)
+     */
+    startDay : 0,
+    /**
+     * @cfg {Bool} showClear
+     * Show a clear button (usefull for date form elements that can be blank.)
+     */
+    
+    showClear: false,
+    
+    /**
+     * Sets the value of the date field
+     * @param {Date} value The date to set
+     */
+    setValue : function(value){
+        var old = this.value;
+        this.value = value.clearTime(true);
+        if(this.el){
+            this.update(this.value);
+        }
+    },
+
+    /**
+     * Gets the current selected value of the date field
+     * @return {Date} The selected date
+     */
+    getValue : function(){
+        return this.value;
+    },
+
+    // private
+    focus : function(){
+        if(this.el){
+            this.update(this.activeDate);
+        }
+    },
+
+    // private
+    onRender : function(container, position){
+        var m = [
+             '<table cellspacing="0">',
+                '<tr><td class="x-date-left"><a href="#" title="', this.prevText ,'">&#160;</a></td><td class="x-date-middle" align="center"></td><td class="x-date-right"><a href="#" title="', this.nextText ,'">&#160;</a></td></tr>',
+                '<tr><td colspan="3"><table class="x-date-inner" cellspacing="0"><thead><tr>'];
+        var dn = this.dayNames;
+        for(var i = 0; i < 7; i++){
+            var d = this.startDay+i;
+            if(d > 6){
+                d = d-7;
+            }
+            m.push("<th><span>", dn[d].substr(0,1), "</span></th>");
+        }
+        m[m.length] = "</tr></thead><tbody><tr>";
+        for(var i = 0; i < 42; i++) {
+            if(i % 7 == 0 && i != 0){
+                m[m.length] = "</tr><tr>";
+            }
+            m[m.length] = '<td><a href="#" hidefocus="on" class="x-date-date" tabIndex="1"><em><span></span></em></a></td>';
+        }
+        m[m.length] = '</tr></tbody></table></td></tr><tr>'+
+            '<td colspan="3" class="x-date-bottom" align="center"></td></tr></table><div class="x-date-mp"></div>';
+
+        var el = document.createElement("div");
+        el.className = "x-date-picker";
+        el.innerHTML = m.join("");
+
+        container.dom.insertBefore(el, position);
+
+        this.el = Roo.get(el);
+        this.eventEl = Roo.get(el.firstChild);
+
+        new Roo.util.ClickRepeater(this.el.child("td.x-date-left a"), {
+            handler: this.showPrevMonth,
+            scope: this,
+            preventDefault:true,
+            stopDefault:true
+        });
+
+        new Roo.util.ClickRepeater(this.el.child("td.x-date-right a"), {
+            handler: this.showNextMonth,
+            scope: this,
+            preventDefault:true,
+            stopDefault:true
+        });
+
+        this.eventEl.on("mousewheel", this.handleMouseWheel,  this);
+
+        this.monthPicker = this.el.down('div.x-date-mp');
+        this.monthPicker.enableDisplayMode('block');
+        
+        var kn = new Roo.KeyNav(this.eventEl, {
+            "left" : function(e){
+                e.ctrlKey ?
+                    this.showPrevMonth() :
+                    this.update(this.activeDate.add("d", -1));
+            },
+
+            "right" : function(e){
+                e.ctrlKey ?
+                    this.showNextMonth() :
+                    this.update(this.activeDate.add("d", 1));
+            },
+
+            "up" : function(e){
+                e.ctrlKey ?
+                    this.showNextYear() :
+                    this.update(this.activeDate.add("d", -7));
+            },
+
+            "down" : function(e){
+                e.ctrlKey ?
+                    this.showPrevYear() :
+                    this.update(this.activeDate.add("d", 7));
+            },
+
+            "pageUp" : function(e){
+                this.showNextMonth();
+            },
+
+            "pageDown" : function(e){
+                this.showPrevMonth();
+            },
+
+            "enter" : function(e){
+                e.stopPropagation();
+                return true;
+            },
+
+            scope : this
+        });
+
+        this.eventEl.on("click", this.handleDateClick,  this, {delegate: "a.x-date-date"});
+
+        this.eventEl.addKeyListener(Roo.EventObject.SPACE, this.selectToday,  this);
+
+        this.el.unselectable();
+        
+        this.cells = this.el.select("table.x-date-inner tbody td");
+        this.textNodes = this.el.query("table.x-date-inner tbody span");
+
+        this.mbtn = new Roo.Button(this.el.child("td.x-date-middle", true), {
+            text: "&#160;",
+            tooltip: this.monthYearText
+        });
+
+        this.mbtn.on('click', this.showMonthPicker, this);
+        this.mbtn.el.child(this.mbtn.menuClassTarget).addClass("x-btn-with-menu");
+
+
+        var today = (new Date()).dateFormat(this.format);
+        
+        var baseTb = new Roo.Toolbar(this.el.child("td.x-date-bottom", true));
+        baseTb.add({
+            text: String.format(this.todayText, today),
+            tooltip: String.format(this.todayTip, today),
+            handler: this.selectToday,
+            scope: this
+        });
+        
+        //var todayBtn = new Roo.Button(this.el.child("td.x-date-bottom", true), {
+            
+        //});
+        if (this.showClear) {
+            
+            baseTb.add( new Roo.Toolbar.Fill());
+            baseTb.add({
+                text: '&#160;',
+                cls: 'x-btn-icon x-btn-clear',
+                handler: function() {
+                    //this.value = '';
+                    this.fireEvent("select", this, '');
+                },
+                scope: this
+            });
+        }
+        
+        
+        if(Roo.isIE){
+            this.el.repaint();
+        }
+        this.update(this.value);
+    },
+
+    createMonthPicker : function(){
+        if(!this.monthPicker.dom.firstChild){
+            var buf = ['<table border="0" cellspacing="0">'];
+            for(var i = 0; i < 6; i++){
+                buf.push(
+                    '<tr><td class="x-date-mp-month"><a href="#">', this.monthNames[i].substr(0, 3), '</a></td>',
+                    '<td class="x-date-mp-month x-date-mp-sep"><a href="#">', this.monthNames[i+6].substr(0, 3), '</a></td>',
+                    i == 0 ?
+                    '<td class="x-date-mp-ybtn" align="center"><a class="x-date-mp-prev"></a></td><td class="x-date-mp-ybtn" align="center"><a class="x-date-mp-next"></a></td></tr>' :
+                    '<td class="x-date-mp-year"><a href="#"></a></td><td class="x-date-mp-year"><a href="#"></a></td></tr>'
+                );
+            }
+            buf.push(
+                '<tr class="x-date-mp-btns"><td colspan="4"><button type="button" class="x-date-mp-ok">',
+                    this.okText,
+                    '</button><button type="button" class="x-date-mp-cancel">',
+                    this.cancelText,
+                    '</button></td></tr>',
+                '</table>'
+            );
+            this.monthPicker.update(buf.join(''));
+            this.monthPicker.on('click', this.onMonthClick, this);
+            this.monthPicker.on('dblclick', this.onMonthDblClick, this);
+
+            this.mpMonths = this.monthPicker.select('td.x-date-mp-month');
+            this.mpYears = this.monthPicker.select('td.x-date-mp-year');
+
+            this.mpMonths.each(function(m, a, i){
+                i += 1;
+                if((i%2) == 0){
+                    m.dom.xmonth = 5 + Math.round(i * .5);
+                }else{
+                    m.dom.xmonth = Math.round((i-1) * .5);
+                }
+            });
+        }
+    },
+
+    showMonthPicker : function(){
+        this.createMonthPicker();
+        var size = this.el.getSize();
+        this.monthPicker.setSize(size);
+        this.monthPicker.child('table').setSize(size);
+
+        this.mpSelMonth = (this.activeDate || this.value).getMonth();
+        this.updateMPMonth(this.mpSelMonth);
+        this.mpSelYear = (this.activeDate || this.value).getFullYear();
+        this.updateMPYear(this.mpSelYear);
+
+        this.monthPicker.slideIn('t', {duration:.2});
+    },
+
+    updateMPYear : function(y){
+        this.mpyear = y;
+        var ys = this.mpYears.elements;
+        for(var i = 1; i <= 10; i++){
+            var td = ys[i-1], y2;
+            if((i%2) == 0){
+                y2 = y + Math.round(i * .5);
+                td.firstChild.innerHTML = y2;
+                td.xyear = y2;
+            }else{
+                y2 = y - (5-Math.round(i * .5));
+                td.firstChild.innerHTML = y2;
+                td.xyear = y2;
+            }
+            this.mpYears.item(i-1)[y2 == this.mpSelYear ? 'addClass' : 'removeClass']('x-date-mp-sel');
+        }
+    },
+
+    updateMPMonth : function(sm){
+        this.mpMonths.each(function(m, a, i){
+            m[m.dom.xmonth == sm ? 'addClass' : 'removeClass']('x-date-mp-sel');
+        });
+    },
+
+    selectMPMonth: function(m){
+        
+    },
+
+    onMonthClick : function(e, t){
+        e.stopEvent();
+        var el = new Roo.Element(t), pn;
+        if(el.is('button.x-date-mp-cancel')){
+            this.hideMonthPicker();
+        }
+        else if(el.is('button.x-date-mp-ok')){
+            this.update(new Date(this.mpSelYear, this.mpSelMonth, (this.activeDate || this.value).getDate()));
+            this.hideMonthPicker();
+        }
+        else if(pn = el.up('td.x-date-mp-month', 2)){
+            this.mpMonths.removeClass('x-date-mp-sel');
+            pn.addClass('x-date-mp-sel');
+            this.mpSelMonth = pn.dom.xmonth;
+        }
+        else if(pn = el.up('td.x-date-mp-year', 2)){
+            this.mpYears.removeClass('x-date-mp-sel');
+            pn.addClass('x-date-mp-sel');
+            this.mpSelYear = pn.dom.xyear;
+        }
+        else if(el.is('a.x-date-mp-prev')){
+            this.updateMPYear(this.mpyear-10);
+        }
+        else if(el.is('a.x-date-mp-next')){
+            this.updateMPYear(this.mpyear+10);
+        }
+    },
+
+    onMonthDblClick : function(e, t){
+        e.stopEvent();
+        var el = new Roo.Element(t), pn;
+        if(pn = el.up('td.x-date-mp-month', 2)){
+            this.update(new Date(this.mpSelYear, pn.dom.xmonth, (this.activeDate || this.value).getDate()));
+            this.hideMonthPicker();
+        }
+        else if(pn = el.up('td.x-date-mp-year', 2)){
+            this.update(new Date(pn.dom.xyear, this.mpSelMonth, (this.activeDate || this.value).getDate()));
+            this.hideMonthPicker();
+        }
+    },
+
+    hideMonthPicker : function(disableAnim){
+        if(this.monthPicker){
+            if(disableAnim === true){
+                this.monthPicker.hide();
+            }else{
+                this.monthPicker.slideOut('t', {duration:.2});
+            }
+        }
+    },
+
+    // private
+    showPrevMonth : function(e){
+        this.update(this.activeDate.add("mo", -1));
+    },
+
+    // private
+    showNextMonth : function(e){
+        this.update(this.activeDate.add("mo", 1));
+    },
+
+    // private
+    showPrevYear : function(){
+        this.update(this.activeDate.add("y", -1));
+    },
+
+    // private
+    showNextYear : function(){
+        this.update(this.activeDate.add("y", 1));
+    },
+
+    // private
+    handleMouseWheel : function(e){
+        var delta = e.getWheelDelta();
+        if(delta > 0){
+            this.showPrevMonth();
+            e.stopEvent();
+        } else if(delta < 0){
+            this.showNextMonth();
+            e.stopEvent();
+        }
+    },
+
+    // private
+    handleDateClick : function(e, t){
+        e.stopEvent();
+        if(t.dateValue && !Roo.fly(t.parentNode).hasClass("x-date-disabled")){
+            this.setValue(new Date(t.dateValue));
+            this.fireEvent("select", this, this.value);
+        }
+    },
+
+    // private
+    selectToday : function(){
+        this.setValue(new Date().clearTime());
+        this.fireEvent("select", this, this.value);
+    },
+
+    // private
+    update : function(date){
+        var vd = this.activeDate;
+        this.activeDate = date;
+        if(vd && this.el){
+            var t = date.getTime();
+            if(vd.getMonth() == date.getMonth() && vd.getFullYear() == date.getFullYear()){
+                this.cells.removeClass("x-date-selected");
+                this.cells.each(function(c){
+                   if(c.dom.firstChild.dateValue == t){
+                       c.addClass("x-date-selected");
+                       setTimeout(function(){
+                            try{c.dom.firstChild.focus();}catch(e){}
+                       }, 50);
+                       return false;
+                   }
+                });
+                return;
+            }
+        }
+        var days = date.getDaysInMonth();
+        var firstOfMonth = date.getFirstDateOfMonth();
+        var startingPos = firstOfMonth.getDay()-this.startDay;
+
+        if(startingPos <= this.startDay){
+            startingPos += 7;
+        }
+
+        var pm = date.add("mo", -1);
+        var prevStart = pm.getDaysInMonth()-startingPos;
+
+        var cells = this.cells.elements;
+        var textEls = this.textNodes;
+        days += startingPos;
+
+        // convert everything to numbers so it's fast
+        var day = 86400000;
+        var d = (new Date(pm.getFullYear(), pm.getMonth(), prevStart)).clearTime();
+        var today = new Date().clearTime().getTime();
+        var sel = date.clearTime().getTime();
+        var min = this.minDate ? this.minDate.clearTime() : Number.NEGATIVE_INFINITY;
+        var max = this.maxDate ? this.maxDate.clearTime() : Number.POSITIVE_INFINITY;
+        var ddMatch = this.disabledDatesRE;
+        var ddText = this.disabledDatesText;
+        var ddays = this.disabledDays ? this.disabledDays.join("") : false;
+        var ddaysText = this.disabledDaysText;
+        var format = this.format;
+
+        var setCellClass = function(cal, cell){
+            cell.title = "";
+            var t = d.getTime();
+            cell.firstChild.dateValue = t;
+            if(t == today){
+                cell.className += " x-date-today";
+                cell.title = cal.todayText;
+            }
+            if(t == sel){
+                cell.className += " x-date-selected";
+                setTimeout(function(){
+                    try{cell.firstChild.focus();}catch(e){}
+                }, 50);
+            }
+            // disabling
+            if(t < min) {
+                cell.className = " x-date-disabled";
+                cell.title = cal.minText;
+                return;
+            }
+            if(t > max) {
+                cell.className = " x-date-disabled";
+                cell.title = cal.maxText;
+                return;
+            }
+            if(ddays){
+                if(ddays.indexOf(d.getDay()) != -1){
+                    cell.title = ddaysText;
+                    cell.className = " x-date-disabled";
+                }
+            }
+            if(ddMatch && format){
+                var fvalue = d.dateFormat(format);
+                if(ddMatch.test(fvalue)){
+                    cell.title = ddText.replace("%0", fvalue);
+                    cell.className = " x-date-disabled";
+                }
+            }
+        };
+
+        var i = 0;
+        for(; i < startingPos; i++) {
+            textEls[i].innerHTML = (++prevStart);
+            d.setDate(d.getDate()+1);
+            cells[i].className = "x-date-prevday";
+            setCellClass(this, cells[i]);
+        }
+        for(; i < days; i++){
+            intDay = i - startingPos + 1;
+            textEls[i].innerHTML = (intDay);
+            d.setDate(d.getDate()+1);
+            cells[i].className = "x-date-active";
+            setCellClass(this, cells[i]);
+        }
+        var extraDays = 0;
+        for(; i < 42; i++) {
+             textEls[i].innerHTML = (++extraDays);
+             d.setDate(d.getDate()+1);
+             cells[i].className = "x-date-nextday";
+             setCellClass(this, cells[i]);
+        }
+
+        this.mbtn.setText(this.monthNames[date.getMonth()] + " " + date.getFullYear());
+
+        if(!this.internalRender){
+            var main = this.el.dom.firstChild;
+            var w = main.offsetWidth;
+            this.el.setWidth(w + this.el.getBorderWidth("lr"));
+            Roo.fly(main).setWidth(w);
+            this.internalRender = true;
+            // opera does not respect the auto grow header center column
+            // then, after it gets a width opera refuses to recalculate
+            // without a second pass
+            if(Roo.isOpera && !this.secondPass){
+                main.rows[0].cells[1].style.width = (w - (main.rows[0].cells[0].offsetWidth+main.rows[0].cells[2].offsetWidth)) + "px";
+                this.secondPass = true;
+                this.update.defer(10, this, [date]);
+            }
+        }
+    }
+});
\ No newline at end of file
diff --git a/Roo/DomHelper.js b/Roo/DomHelper.js
new file mode 100644 (file)
index 0000000..93f0144
--- /dev/null
@@ -0,0 +1,438 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+
+/**
+ * @class Roo.DomHelper
+ * Utility class for working with DOM and/or Templates. It transparently supports using HTML fragments or DOM.
+ * For more information see <a href="http://www.jackslocum.com/yui/2006/10/06/domhelper-create-elements-using-dom-html-fragments-or-templates/">this blog post with examples</a>.
+ * @singleton
+ */
+Roo.DomHelper = function(){
+    var tempTableEl = null;
+    var emptyTags = /^(?:br|frame|hr|img|input|link|meta|range|spacer|wbr|area|param|col)$/i;
+    var tableRe = /^table|tbody|tr|td$/i;
+    var xmlns = {};
+    // build as innerHTML where available
+    /** @ignore */
+    var createHtml = function(o){
+        if(typeof o == 'string'){
+            return o;
+        }
+        var b = "";
+        if(!o.tag){
+            o.tag = "div";
+        }
+        b += "<" + o.tag;
+        for(var attr in o){
+            if(attr == "tag" || attr == "children" || attr == "cn" || attr == "html" || typeof o[attr] == "function") continue;
+            if(attr == "style"){
+                var s = o["style"];
+                if(typeof s == "function"){
+                    s = s.call();
+                }
+                if(typeof s == "string"){
+                    b += ' style="' + s + '"';
+                }else if(typeof s == "object"){
+                    b += ' style="';
+                    for(var key in s){
+                        if(typeof s[key] != "function"){
+                            b += key + ":" + s[key] + ";";
+                        }
+                    }
+                    b += '"';
+                }
+            }else{
+                if(attr == "cls"){
+                    b += ' class="' + o["cls"] + '"';
+                }else if(attr == "htmlFor"){
+                    b += ' for="' + o["htmlFor"] + '"';
+                }else{
+                    b += " " + attr + '="' + o[attr] + '"';
+                }
+            }
+        }
+        if(emptyTags.test(o.tag)){
+            b += "/>";
+        }else{
+            b += ">";
+            var cn = o.children || o.cn;
+            if(cn){
+                //http://bugs.kde.org/show_bug.cgi?id=71506
+                if((cn instanceof Array) || (Roo.isSafari && typeof(cn.join) == "function")){
+                    for(var i = 0, len = cn.length; i < len; i++) {
+                        b += createHtml(cn[i], b);
+                    }
+                }else{
+                    b += createHtml(cn, b);
+                }
+            }
+            if(o.html){
+                b += o.html;
+            }
+            b += "</" + o.tag + ">";
+        }
+        return b;
+    };
+
+    // build as dom
+    /** @ignore */
+    var createDom = function(o, parentNode){
+         
+        // defininition craeted..
+        var ns = false;
+        if (o.ns && o.ns != 'html') {
+               
+            if (o.xmlns && typeof(xmlns[o.ns]) == 'undefined') {
+                xmlns[o.ns] = o.xmlns;
+                ns = o.xmlns;
+            }
+            if (typeof(xmlns[o.ns]) == 'undefined') {
+                console.log("Trying to create namespace element " + o.ns + ", however no xmlns was sent to builder previously");
+            }
+            ns = xmlns[o.ns];
+        }
+        
+        
+        if (typeof(o) == 'string') {
+            return parentNode.appendChild(document.createTextNode(o));
+        }
+        o.tag = o.tag || div;
+        if (o.ns && Roo.isIE) {
+            ns = false;
+            o.tag = o.ns + ':' + o.tag;
+            
+        }
+        var el = ns ? document.createElementNS( ns, o.tag||'div') :  document.createElement(o.tag||'div');
+        var useSet = el.setAttribute ? true : false; // In IE some elements don't have setAttribute
+        for(var attr in o){
+            
+            if(attr == "tag" || attr == "ns" ||attr == "xmlns" ||attr == "children" || attr == "cn" || attr == "html" || 
+                    attr == "style" || typeof o[attr] == "function") continue;
+                    
+            if(attr=="cls" && Roo.isIE){
+                el.className = o["cls"];
+            }else{
+                if(useSet) el.setAttribute(attr=="cls" ? 'class' : attr, o[attr]);
+                else el[attr] = o[attr];
+            }
+        }
+        Roo.DomHelper.applyStyles(el, o.style);
+        var cn = o.children || o.cn;
+        if(cn){
+            //http://bugs.kde.org/show_bug.cgi?id=71506
+             if((cn instanceof Array) || (Roo.isSafari && typeof(cn.join) == "function")){
+                for(var i = 0, len = cn.length; i < len; i++) {
+                    createDom(cn[i], el);
+                }
+            }else{
+                createDom(cn, el);
+            }
+        }
+        if(o.html){
+            el.innerHTML = o.html;
+        }
+        if(parentNode){
+           parentNode.appendChild(el);
+        }
+        return el;
+    };
+
+    var ieTable = function(depth, s, h, e){
+        tempTableEl.innerHTML = [s, h, e].join('');
+        var i = -1, el = tempTableEl;
+        while(++i < depth){
+            el = el.firstChild;
+        }
+        return el;
+    };
+
+    // kill repeat to save bytes
+    var ts = '<table>',
+        te = '</table>',
+        tbs = ts+'<tbody>',
+        tbe = '</tbody>'+te,
+        trs = tbs + '<tr>',
+        tre = '</tr>'+tbe;
+
+    /**
+     * @ignore
+     * Nasty code for IE's broken table implementation
+     */
+    var insertIntoTable = function(tag, where, el, html){
+        if(!tempTableEl){
+            tempTableEl = document.createElement('div');
+        }
+        var node;
+        var before = null;
+        if(tag == 'td'){
+            if(where == 'afterbegin' || where == 'beforeend'){ // INTO a TD
+                return;
+            }
+            if(where == 'beforebegin'){
+                before = el;
+                el = el.parentNode;
+            } else{
+                before = el.nextSibling;
+                el = el.parentNode;
+            }
+            node = ieTable(4, trs, html, tre);
+        }
+        else if(tag == 'tr'){
+            if(where == 'beforebegin'){
+                before = el;
+                el = el.parentNode;
+                node = ieTable(3, tbs, html, tbe);
+            } else if(where == 'afterend'){
+                before = el.nextSibling;
+                el = el.parentNode;
+                node = ieTable(3, tbs, html, tbe);
+            } else{ // INTO a TR
+                if(where == 'afterbegin'){
+                    before = el.firstChild;
+                }
+                node = ieTable(4, trs, html, tre);
+            }
+        } else if(tag == 'tbody'){
+            if(where == 'beforebegin'){
+                before = el;
+                el = el.parentNode;
+                node = ieTable(2, ts, html, te);
+            } else if(where == 'afterend'){
+                before = el.nextSibling;
+                el = el.parentNode;
+                node = ieTable(2, ts, html, te);
+            } else{
+                if(where == 'afterbegin'){
+                    before = el.firstChild;
+                }
+                node = ieTable(3, tbs, html, tbe);
+            }
+        } else{ // TABLE
+            if(where == 'beforebegin' || where == 'afterend'){ // OUTSIDE the table
+                return;
+            }
+            if(where == 'afterbegin'){
+                before = el.firstChild;
+            }
+            node = ieTable(2, ts, html, te);
+        }
+        el.insertBefore(node, before);
+        return node;
+    };
+
+    return {
+    /** True to force the use of DOM instead of html fragments @type Boolean */
+    useDom : false,
+
+    /**
+     * Returns the markup for the passed Element(s) config
+     * @param {Object} o The Dom object spec (and children)
+     * @return {String}
+     */
+    markup : function(o){
+        return createHtml(o);
+    },
+
+    /**
+     * Applies a style specification to an element
+     * @param {String/HTMLElement} el The element to apply styles to
+     * @param {String/Object/Function} styles A style specification string eg "width:100px", or object in the form {width:"100px"}, or
+     * a function which returns such a specification.
+     */
+    applyStyles : function(el, styles){
+        if(styles){
+           el = Roo.fly(el);
+           if(typeof styles == "string"){
+               var re = /\s?([a-z\-]*)\:\s?([^;]*);?/gi;
+               var matches;
+               while ((matches = re.exec(styles)) != null){
+                   el.setStyle(matches[1], matches[2]);
+               }
+           }else if (typeof styles == "object"){
+               for (var style in styles){
+                  el.setStyle(style, styles[style]);
+               }
+           }else if (typeof styles == "function"){
+                Roo.DomHelper.applyStyles(el, styles.call());
+           }
+        }
+    },
+
+    /**
+     * Inserts an HTML fragment into the Dom
+     * @param {String} where Where to insert the html in relation to el - beforeBegin, afterBegin, beforeEnd, afterEnd.
+     * @param {HTMLElement} el The context element
+     * @param {String} html The HTML fragmenet
+     * @return {HTMLElement} The new node
+     */
+    insertHtml : function(where, el, html){
+        where = where.toLowerCase();
+        if(el.insertAdjacentHTML){
+            if(tableRe.test(el.tagName)){
+                var rs;
+                if(rs = insertIntoTable(el.tagName.toLowerCase(), where, el, html)){
+                    return rs;
+                }
+            }
+            switch(where){
+                case "beforebegin":
+                    el.insertAdjacentHTML('BeforeBegin', html);
+                    return el.previousSibling;
+                case "afterbegin":
+                    el.insertAdjacentHTML('AfterBegin', html);
+                    return el.firstChild;
+                case "beforeend":
+                    el.insertAdjacentHTML('BeforeEnd', html);
+                    return el.lastChild;
+                case "afterend":
+                    el.insertAdjacentHTML('AfterEnd', html);
+                    return el.nextSibling;
+            }
+            throw 'Illegal insertion point -> "' + where + '"';
+        }
+        var range = el.ownerDocument.createRange();
+        var frag;
+        switch(where){
+             case "beforebegin":
+                range.setStartBefore(el);
+                frag = range.createContextualFragment(html);
+                el.parentNode.insertBefore(frag, el);
+                return el.previousSibling;
+             case "afterbegin":
+                if(el.firstChild){
+                    range.setStartBefore(el.firstChild);
+                    frag = range.createContextualFragment(html);
+                    el.insertBefore(frag, el.firstChild);
+                    return el.firstChild;
+                }else{
+                    el.innerHTML = html;
+                    return el.firstChild;
+                }
+            case "beforeend":
+                if(el.lastChild){
+                    range.setStartAfter(el.lastChild);
+                    frag = range.createContextualFragment(html);
+                    el.appendChild(frag);
+                    return el.lastChild;
+                }else{
+                    el.innerHTML = html;
+                    return el.lastChild;
+                }
+            case "afterend":
+                range.setStartAfter(el);
+                frag = range.createContextualFragment(html);
+                el.parentNode.insertBefore(frag, el.nextSibling);
+                return el.nextSibling;
+            }
+            throw 'Illegal insertion point -> "' + where + '"';
+    },
+
+    /**
+     * Creates new Dom element(s) and inserts them before el
+     * @param {String/HTMLElement/Element} el The context element
+     * @param {Object/String} o The Dom object spec (and children) or raw HTML blob
+     * @param {Boolean} returnElement (optional) true to return a Roo.Element
+     * @return {HTMLElement/Roo.Element} The new node
+     */
+    insertBefore : function(el, o, returnElement){
+        return this.doInsert(el, o, returnElement, "beforeBegin");
+    },
+
+    /**
+     * Creates new Dom element(s) and inserts them after el
+     * @param {String/HTMLElement/Element} el The context element
+     * @param {Object} o The Dom object spec (and children)
+     * @param {Boolean} returnElement (optional) true to return a Roo.Element
+     * @return {HTMLElement/Roo.Element} The new node
+     */
+    insertAfter : function(el, o, returnElement){
+        return this.doInsert(el, o, returnElement, "afterEnd", "nextSibling");
+    },
+
+    /**
+     * Creates new Dom element(s) and inserts them as the first child of el
+     * @param {String/HTMLElement/Element} el The context element
+     * @param {Object/String} o The Dom object spec (and children) or raw HTML blob
+     * @param {Boolean} returnElement (optional) true to return a Roo.Element
+     * @return {HTMLElement/Roo.Element} The new node
+     */
+    insertFirst : function(el, o, returnElement){
+        return this.doInsert(el, o, returnElement, "afterBegin");
+    },
+
+    // private
+    doInsert : function(el, o, returnElement, pos, sibling){
+        el = Roo.getDom(el);
+        var newNode;
+        if(this.useDom || o.ns){
+            newNode = createDom(o, null);
+            el.parentNode.insertBefore(newNode, sibling ? el[sibling] : el);
+        }else{
+            var html = createHtml(o);
+            newNode = this.insertHtml(pos, el, html);
+        }
+        return returnElement ? Roo.get(newNode, true) : newNode;
+    },
+
+    /**
+     * Creates new Dom element(s) and appends them to el
+     * @param {String/HTMLElement/Element} el The context element
+     * @param {Object/String} o The Dom object spec (and children) or raw HTML blob
+     * @param {Boolean} returnElement (optional) true to return a Roo.Element
+     * @return {HTMLElement/Roo.Element} The new node
+     */
+    append : function(el, o, returnElement){
+        el = Roo.getDom(el);
+        var newNode;
+        if(this.useDom || o.ns){
+            newNode = createDom(o, null);
+            el.appendChild(newNode);
+        }else{
+            var html = createHtml(o);
+            newNode = this.insertHtml("beforeEnd", el, html);
+        }
+        return returnElement ? Roo.get(newNode, true) : newNode;
+    },
+
+    /**
+     * Creates new Dom element(s) and overwrites the contents of el with them
+     * @param {String/HTMLElement/Element} el The context element
+     * @param {Object/String} o The Dom object spec (and children) or raw HTML blob
+     * @param {Boolean} returnElement (optional) true to return a Roo.Element
+     * @return {HTMLElement/Roo.Element} The new node
+     */
+    overwrite : function(el, o, returnElement){
+        el = Roo.getDom(el);
+        if (o.ns) {
+          
+            while (el.childNodes.length) {
+                el.removeChild(el.firstChild);
+            }
+            createDom(o, el);
+        } else {
+            el.innerHTML = createHtml(o);   
+        }
+        
+        return returnElement ? Roo.get(el.firstChild, true) : el.firstChild;
+    },
+
+    /**
+     * Creates a new Roo.DomHelper.Template from the Dom object spec
+     * @param {Object} o The Dom object spec (and children)
+     * @return {Roo.DomHelper.Template} The new template
+     */
+    createTemplate : function(o){
+        var html = createHtml(o);
+        return new Roo.Template(html);
+    }
+    };
+}();
diff --git a/Roo/DomQuery.js b/Roo/DomQuery.js
new file mode 100644 (file)
index 0000000..e9ac3f1
--- /dev/null
@@ -0,0 +1,823 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+
+/*
+ * This is code is also distributed under MIT license for use
+ * with jQuery and prototype JavaScript libraries.
+ */
+/**
+ * @class Roo.DomQuery
+Provides high performance selector/xpath processing by compiling queries into reusable functions. New pseudo classes and matchers can be plugged. It works on HTML and XML documents (if a content node is passed in).
+<p>
+DomQuery supports most of the <a href="http://www.w3.org/TR/2005/WD-css3-selectors-20051215/">CSS3 selectors spec</a>, along with some custom selectors and basic XPath.</p>
+
+<p>
+All selectors, attribute filters and pseudos below can be combined infinitely in any order. For example "div.foo:nth-child(odd)[@foo=bar].bar:first" would be a perfectly valid selector. Node filters are processed in the order in which they appear, which allows you to optimize your queries for your document structure.
+</p>
+<h4>Element Selectors:</h4>
+<ul class="list">
+    <li> <b>*</b> any element</li>
+    <li> <b>E</b> an element with the tag E</li>
+    <li> <b>E F</b> All descendent elements of E that have the tag F</li>
+    <li> <b>E > F</b> or <b>E/F</b> all direct children elements of E that have the tag F</li>
+    <li> <b>E + F</b> all elements with the tag F that are immediately preceded by an element with the tag E</li>
+    <li> <b>E ~ F</b> all elements with the tag F that are preceded by a sibling element with the tag E</li>
+</ul>
+<h4>Attribute Selectors:</h4>
+<p>The use of @ and quotes are optional. For example, div[@foo='bar'] is also a valid attribute selector.</p>
+<ul class="list">
+    <li> <b>E[foo]</b> has an attribute "foo"</li>
+    <li> <b>E[foo=bar]</b> has an attribute "foo" that equals "bar"</li>
+    <li> <b>E[foo^=bar]</b> has an attribute "foo" that starts with "bar"</li>
+    <li> <b>E[foo$=bar]</b> has an attribute "foo" that ends with "bar"</li>
+    <li> <b>E[foo*=bar]</b> has an attribute "foo" that contains the substring "bar"</li>
+    <li> <b>E[foo%=2]</b> has an attribute "foo" that is evenly divisible by 2</li>
+    <li> <b>E[foo!=bar]</b> has an attribute "foo" that does not equal "bar"</li>
+</ul>
+<h4>Pseudo Classes:</h4>
+<ul class="list">
+    <li> <b>E:first-child</b> E is the first child of its parent</li>
+    <li> <b>E:last-child</b> E is the last child of its parent</li>
+    <li> <b>E:nth-child(<i>n</i>)</b> E is the <i>n</i>th child of its parent (1 based as per the spec)</li>
+    <li> <b>E:nth-child(odd)</b> E is an odd child of its parent</li>
+    <li> <b>E:nth-child(even)</b> E is an even child of its parent</li>
+    <li> <b>E:only-child</b> E is the only child of its parent</li>
+    <li> <b>E:checked</b> E is an element that is has a checked attribute that is true (e.g. a radio or checkbox) </li>
+    <li> <b>E:first</b> the first E in the resultset</li>
+    <li> <b>E:last</b> the last E in the resultset</li>
+    <li> <b>E:nth(<i>n</i>)</b> the <i>n</i>th E in the resultset (1 based)</li>
+    <li> <b>E:odd</b> shortcut for :nth-child(odd)</li>
+    <li> <b>E:even</b> shortcut for :nth-child(even)</li>
+    <li> <b>E:contains(foo)</b> E's innerHTML contains the substring "foo"</li>
+    <li> <b>E:nodeValue(foo)</b> E contains a textNode with a nodeValue that equals "foo"</li>
+    <li> <b>E:not(S)</b> an E element that does not match simple selector S</li>
+    <li> <b>E:has(S)</b> an E element that has a descendent that matches simple selector S</li>
+    <li> <b>E:next(S)</b> an E element whose next sibling matches simple selector S</li>
+    <li> <b>E:prev(S)</b> an E element whose previous sibling matches simple selector S</li>
+</ul>
+<h4>CSS Value Selectors:</h4>
+<ul class="list">
+    <li> <b>E{display=none}</b> css value "display" that equals "none"</li>
+    <li> <b>E{display^=none}</b> css value "display" that starts with "none"</li>
+    <li> <b>E{display$=none}</b> css value "display" that ends with "none"</li>
+    <li> <b>E{display*=none}</b> css value "display" that contains the substring "none"</li>
+    <li> <b>E{display%=2}</b> css value "display" that is evenly divisible by 2</li>
+    <li> <b>E{display!=none}</b> css value "display" that does not equal "none"</li>
+</ul>
+ * @singleton
+ */
+Roo.DomQuery = function(){
+    var cache = {}, simpleCache = {}, valueCache = {};
+    var nonSpace = /\S/;
+    var trimRe = /^\s+|\s+$/g;
+    var tplRe = /\{(\d+)\}/g;
+    var modeRe = /^(\s?[\/>+~]\s?|\s|$)/;
+    var tagTokenRe = /^(#)?([\w-\*]+)/;
+    var nthRe = /(\d*)n\+?(\d*)/, nthRe2 = /\D/;
+
+    function child(p, index){
+        var i = 0;
+        var n = p.firstChild;
+        while(n){
+            if(n.nodeType == 1){
+               if(++i == index){
+                   return n;
+               }
+            }
+            n = n.nextSibling;
+        }
+        return null;
+    };
+
+    function next(n){
+        while((n = n.nextSibling) && n.nodeType != 1);
+        return n;
+    };
+
+    function prev(n){
+        while((n = n.previousSibling) && n.nodeType != 1);
+        return n;
+    };
+
+    function children(d){
+        var n = d.firstChild, ni = -1;
+           while(n){
+               var nx = n.nextSibling;
+               if(n.nodeType == 3 && !nonSpace.test(n.nodeValue)){
+                   d.removeChild(n);
+               }else{
+                   n.nodeIndex = ++ni;
+               }
+               n = nx;
+           }
+           return this;
+       };
+
+    function byClassName(c, a, v){
+        if(!v){
+            return c;
+        }
+        var r = [], ri = -1, cn;
+        for(var i = 0, ci; ci = c[i]; i++){
+            if((' '+ci.className+' ').indexOf(v) != -1){
+                r[++ri] = ci;
+            }
+        }
+        return r;
+    };
+
+    function attrValue(n, attr){
+        if(!n.tagName && typeof n.length != "undefined"){
+            n = n[0];
+        }
+        if(!n){
+            return null;
+        }
+        if(attr == "for"){
+            return n.htmlFor;
+        }
+        if(attr == "class" || attr == "className"){
+            return n.className;
+        }
+        return n.getAttribute(attr) || n[attr];
+
+    };
+
+    function getNodes(ns, mode, tagName){
+        var result = [], ri = -1, cs;
+        if(!ns){
+            return result;
+        }
+        tagName = tagName || "*";
+        if(typeof ns.getElementsByTagName != "undefined"){
+            ns = [ns];
+        }
+        if(!mode){
+            for(var i = 0, ni; ni = ns[i]; i++){
+                cs = ni.getElementsByTagName(tagName);
+                for(var j = 0, ci; ci = cs[j]; j++){
+                    result[++ri] = ci;
+                }
+            }
+        }else if(mode == "/" || mode == ">"){
+            var utag = tagName.toUpperCase();
+            for(var i = 0, ni, cn; ni = ns[i]; i++){
+                cn = ni.children || ni.childNodes;
+                for(var j = 0, cj; cj = cn[j]; j++){
+                    if(cj.nodeName == utag || cj.nodeName == tagName  || tagName == '*'){
+                        result[++ri] = cj;
+                    }
+                }
+            }
+        }else if(mode == "+"){
+            var utag = tagName.toUpperCase();
+            for(var i = 0, n; n = ns[i]; i++){
+                while((n = n.nextSibling) && n.nodeType != 1);
+                if(n && (n.nodeName == utag || n.nodeName == tagName || tagName == '*')){
+                    result[++ri] = n;
+                }
+            }
+        }else if(mode == "~"){
+            for(var i = 0, n; n = ns[i]; i++){
+                while((n = n.nextSibling) && (n.nodeType != 1 || (tagName == '*' || n.tagName.toLowerCase()!=tagName)));
+                if(n){
+                    result[++ri] = n;
+                }
+            }
+        }
+        return result;
+    };
+
+    function concat(a, b){
+        if(b.slice){
+            return a.concat(b);
+        }
+        for(var i = 0, l = b.length; i < l; i++){
+            a[a.length] = b[i];
+        }
+        return a;
+    }
+
+    function byTag(cs, tagName){
+        if(cs.tagName || cs == document){
+            cs = [cs];
+        }
+        if(!tagName){
+            return cs;
+        }
+        var r = [], ri = -1;
+        tagName = tagName.toLowerCase();
+        for(var i = 0, ci; ci = cs[i]; i++){
+            if(ci.nodeType == 1 && ci.tagName.toLowerCase()==tagName){
+                r[++ri] = ci;
+            }
+        }
+        return r;
+    };
+
+    function byId(cs, attr, id){
+        if(cs.tagName || cs == document){
+            cs = [cs];
+        }
+        if(!id){
+            return cs;
+        }
+        var r = [], ri = -1;
+        for(var i = 0,ci; ci = cs[i]; i++){
+            if(ci && ci.id == id){
+                r[++ri] = ci;
+                return r;
+            }
+        }
+        return r;
+    };
+
+    function byAttribute(cs, attr, value, op, custom){
+        var r = [], ri = -1, st = custom=="{";
+        var f = Roo.DomQuery.operators[op];
+        for(var i = 0, ci; ci = cs[i]; i++){
+            var a;
+            if(st){
+                a = Roo.DomQuery.getStyle(ci, attr);
+            }
+            else if(attr == "class" || attr == "className"){
+                a = ci.className;
+            }else if(attr == "for"){
+                a = ci.htmlFor;
+            }else if(attr == "href"){
+                a = ci.getAttribute("href", 2);
+            }else{
+                a = ci.getAttribute(attr);
+            }
+            if((f && f(a, value)) || (!f && a)){
+                r[++ri] = ci;
+            }
+        }
+        return r;
+    };
+
+    function byPseudo(cs, name, value){
+        return Roo.DomQuery.pseudos[name](cs, value);
+    };
+
+    // This is for IE MSXML which does not support expandos.
+    // IE runs the same speed using setAttribute, however FF slows way down
+    // and Safari completely fails so they need to continue to use expandos.
+    var isIE = window.ActiveXObject ? true : false;
+
+    // this eval is stop the compressor from
+    // renaming the variable to something shorter
+    
+    /** eval:var:batch */
+    var batch = 30803; 
+
+    var key = 30803;
+
+    function nodupIEXml(cs){
+        var d = ++key;
+        cs[0].setAttribute("_nodup", d);
+        var r = [cs[0]];
+        for(var i = 1, len = cs.length; i < len; i++){
+            var c = cs[i];
+            if(!c.getAttribute("_nodup") != d){
+                c.setAttribute("_nodup", d);
+                r[r.length] = c;
+            }
+        }
+        for(var i = 0, len = cs.length; i < len; i++){
+            cs[i].removeAttribute("_nodup");
+        }
+        return r;
+    }
+
+    function nodup(cs){
+        if(!cs){
+            return [];
+        }
+        var len = cs.length, c, i, r = cs, cj, ri = -1;
+        if(!len || typeof cs.nodeType != "undefined" || len == 1){
+            return cs;
+        }
+        if(isIE && typeof cs[0].selectSingleNode != "undefined"){
+            return nodupIEXml(cs);
+        }
+        var d = ++key;
+        cs[0]._nodup = d;
+        for(i = 1; c = cs[i]; i++){
+            if(c._nodup != d){
+                c._nodup = d;
+            }else{
+                r = [];
+                for(var j = 0; j < i; j++){
+                    r[++ri] = cs[j];
+                }
+                for(j = i+1; cj = cs[j]; j++){
+                    if(cj._nodup != d){
+                        cj._nodup = d;
+                        r[++ri] = cj;
+                    }
+                }
+                return r;
+            }
+        }
+        return r;
+    }
+
+    function quickDiffIEXml(c1, c2){
+        var d = ++key;
+        for(var i = 0, len = c1.length; i < len; i++){
+            c1[i].setAttribute("_qdiff", d);
+        }
+        var r = [];
+        for(var i = 0, len = c2.length; i < len; i++){
+            if(c2[i].getAttribute("_qdiff") != d){
+                r[r.length] = c2[i];
+            }
+        }
+        for(var i = 0, len = c1.length; i < len; i++){
+           c1[i].removeAttribute("_qdiff");
+        }
+        return r;
+    }
+
+    function quickDiff(c1, c2){
+        var len1 = c1.length;
+        if(!len1){
+            return c2;
+        }
+        if(isIE && c1[0].selectSingleNode){
+            return quickDiffIEXml(c1, c2);
+        }
+        var d = ++key;
+        for(var i = 0; i < len1; i++){
+            c1[i]._qdiff = d;
+        }
+        var r = [];
+        for(var i = 0, len = c2.length; i < len; i++){
+            if(c2[i]._qdiff != d){
+                r[r.length] = c2[i];
+            }
+        }
+        return r;
+    }
+
+    function quickId(ns, mode, root, id){
+        if(ns == root){
+           var d = root.ownerDocument || root;
+           return d.getElementById(id);
+        }
+        ns = getNodes(ns, mode, "*");
+        return byId(ns, null, id);
+    }
+
+    return {
+        getStyle : function(el, name){
+            return Roo.fly(el).getStyle(name);
+        },
+        /**
+         * Compiles a selector/xpath query into a reusable function. The returned function
+         * takes one parameter "root" (optional), which is the context node from where the query should start.
+         * @param {String} selector The selector/xpath query
+         * @param {String} type (optional) Either "select" (the default) or "simple" for a simple selector match
+         * @return {Function}
+         */
+        compile : function(path, type){
+            type = type || "select";
+            
+            var fn = ["var f = function(root){\n var mode; ++batch; var n = root || document;\n"];
+            var q = path, mode, lq;
+            var tk = Roo.DomQuery.matchers;
+            var tklen = tk.length;
+            var mm;
+
+            // accept leading mode switch
+            var lmode = q.match(modeRe);
+            if(lmode && lmode[1]){
+                fn[fn.length] = 'mode="'+lmode[1].replace(trimRe, "")+'";';
+                q = q.replace(lmode[1], "");
+            }
+            // strip leading slashes
+            while(path.substr(0, 1)=="/"){
+                path = path.substr(1);
+            }
+
+            while(q && lq != q){
+                lq = q;
+                var tm = q.match(tagTokenRe);
+                if(type == "select"){
+                    if(tm){
+                        if(tm[1] == "#"){
+                            fn[fn.length] = 'n = quickId(n, mode, root, "'+tm[2]+'");';
+                        }else{
+                            fn[fn.length] = 'n = getNodes(n, mode, "'+tm[2]+'");';
+                        }
+                        q = q.replace(tm[0], "");
+                    }else if(q.substr(0, 1) != '@'){
+                        fn[fn.length] = 'n = getNodes(n, mode, "*");';
+                    }
+                }else{
+                    if(tm){
+                        if(tm[1] == "#"){
+                            fn[fn.length] = 'n = byId(n, null, "'+tm[2]+'");';
+                        }else{
+                            fn[fn.length] = 'n = byTag(n, "'+tm[2]+'");';
+                        }
+                        q = q.replace(tm[0], "");
+                    }
+                }
+                while(!(mm = q.match(modeRe))){
+                    var matched = false;
+                    for(var j = 0; j < tklen; j++){
+                        var t = tk[j];
+                        var m = q.match(t.re);
+                        if(m){
+                            fn[fn.length] = t.select.replace(tplRe, function(x, i){
+                                                    return m[i];
+                                                });
+                            q = q.replace(m[0], "");
+                            matched = true;
+                            break;
+                        }
+                    }
+                    // prevent infinite loop on bad selector
+                    if(!matched){
+                        throw 'Error parsing selector, parsing failed at "' + q + '"';
+                    }
+                }
+                if(mm[1]){
+                    fn[fn.length] = 'mode="'+mm[1].replace(trimRe, "")+'";';
+                    q = q.replace(mm[1], "");
+                }
+            }
+            fn[fn.length] = "return nodup(n);\n}";
+            
+             /** 
+              * list of variables that need from compression as they are used by eval.
+             *  eval:var:batch 
+             *  eval:var:nodup
+             *  eval:var:byTag
+             *  eval:var:ById
+             *  eval:var:getNodes
+             *  eval:var:quickId
+             *  eval:var:mode
+             *  eval:var:root
+             *  eval:var:n
+             *  eval:var:byClassName
+             *  eval:var:byPseudo
+             *  eval:var:byAttribute
+             *  eval:var:attrValue
+             * 
+             **/ 
+            eval(fn.join(""));
+            return f;
+        },
+
+        /**
+         * Selects a group of elements.
+         * @param {String} selector The selector/xpath query (can be a comma separated list of selectors)
+         * @param {Node} root (optional) The start of the query (defaults to document).
+         * @return {Array}
+         */
+        select : function(path, root, type){
+            if(!root || root == document){
+                root = document;
+            }
+            if(typeof root == "string"){
+                root = document.getElementById(root);
+            }
+            var paths = path.split(",");
+            var results = [];
+            for(var i = 0, len = paths.length; i < len; i++){
+                var p = paths[i].replace(trimRe, "");
+                if(!cache[p]){
+                    cache[p] = Roo.DomQuery.compile(p);
+                    if(!cache[p]){
+                        throw p + " is not a valid selector";
+                    }
+                }
+                var result = cache[p](root);
+                if(result && result != document){
+                    results = results.concat(result);
+                }
+            }
+            if(paths.length > 1){
+                return nodup(results);
+            }
+            return results;
+        },
+
+        /**
+         * Selects a single element.
+         * @param {String} selector The selector/xpath query
+         * @param {Node} root (optional) The start of the query (defaults to document).
+         * @return {Element}
+         */
+        selectNode : function(path, root){
+            return Roo.DomQuery.select(path, root)[0];
+        },
+
+        /**
+         * Selects the value of a node, optionally replacing null with the defaultValue.
+         * @param {String} selector The selector/xpath query
+         * @param {Node} root (optional) The start of the query (defaults to document).
+         * @param {String} defaultValue
+         */
+        selectValue : function(path, root, defaultValue){
+            path = path.replace(trimRe, "");
+            if(!valueCache[path]){
+                valueCache[path] = Roo.DomQuery.compile(path, "select");
+            }
+            var n = valueCache[path](root);
+            n = n[0] ? n[0] : n;
+            var v = (n && n.firstChild ? n.firstChild.nodeValue : null);
+            return ((v === null||v === undefined||v==='') ? defaultValue : v);
+        },
+
+        /**
+         * Selects the value of a node, parsing integers and floats.
+         * @param {String} selector The selector/xpath query
+         * @param {Node} root (optional) The start of the query (defaults to document).
+         * @param {Number} defaultValue
+         * @return {Number}
+         */
+        selectNumber : function(path, root, defaultValue){
+            var v = Roo.DomQuery.selectValue(path, root, defaultValue || 0);
+            return parseFloat(v);
+        },
+
+        /**
+         * Returns true if the passed element(s) match the passed simple selector (e.g. div.some-class or span:first-child)
+         * @param {String/HTMLElement/Array} el An element id, element or array of elements
+         * @param {String} selector The simple selector to test
+         * @return {Boolean}
+         */
+        is : function(el, ss){
+            if(typeof el == "string"){
+                el = document.getElementById(el);
+            }
+            var isArray = (el instanceof Array);
+            var result = Roo.DomQuery.filter(isArray ? el : [el], ss);
+            return isArray ? (result.length == el.length) : (result.length > 0);
+        },
+
+        /**
+         * Filters an array of elements to only include matches of a simple selector (e.g. div.some-class or span:first-child)
+         * @param {Array} el An array of elements to filter
+         * @param {String} selector The simple selector to test
+         * @param {Boolean} nonMatches If true, it returns the elements that DON'T match
+         * the selector instead of the ones that match
+         * @return {Array}
+         */
+        filter : function(els, ss, nonMatches){
+            ss = ss.replace(trimRe, "");
+            if(!simpleCache[ss]){
+                simpleCache[ss] = Roo.DomQuery.compile(ss, "simple");
+            }
+            var result = simpleCache[ss](els);
+            return nonMatches ? quickDiff(result, els) : result;
+        },
+
+        /**
+         * Collection of matching regular expressions and code snippets.
+         */
+        matchers : [{
+                re: /^\.([\w-]+)/,
+                select: 'n = byClassName(n, null, " {1} ");'
+            }, {
+                re: /^\:([\w-]+)(?:\(((?:[^\s>\/]*|.*?))\))?/,
+                select: 'n = byPseudo(n, "{1}", "{2}");'
+            },{
+                re: /^(?:([\[\{])(?:@)?([\w-]+)\s?(?:(=|.=)\s?['"]?(.*?)["']?)?[\]\}])/,
+                select: 'n = byAttribute(n, "{2}", "{4}", "{3}", "{1}");'
+            }, {
+                re: /^#([\w-]+)/,
+                select: 'n = byId(n, null, "{1}");'
+            },{
+                re: /^@([\w-]+)/,
+                select: 'return {firstChild:{nodeValue:attrValue(n, "{1}")}};'
+            }
+        ],
+
+        /**
+         * Collection of operator comparison functions. The default operators are =, !=, ^=, $=, *=, %=, |= and ~=.
+         * New operators can be added as long as the match the format <i>c</i>= where <i>c</i> is any character other than space, &gt; &lt;.
+         */
+        operators : {
+            "=" : function(a, v){
+                return a == v;
+            },
+            "!=" : function(a, v){
+                return a != v;
+            },
+            "^=" : function(a, v){
+                return a && a.substr(0, v.length) == v;
+            },
+            "$=" : function(a, v){
+                return a && a.substr(a.length-v.length) == v;
+            },
+            "*=" : function(a, v){
+                return a && a.indexOf(v) !== -1;
+            },
+            "%=" : function(a, v){
+                return (a % v) == 0;
+            },
+            "|=" : function(a, v){
+                return a && (a == v || a.substr(0, v.length+1) == v+'-');
+            },
+            "~=" : function(a, v){
+                return a && (' '+a+' ').indexOf(' '+v+' ') != -1;
+            }
+        },
+
+        /**
+         * Collection of "pseudo class" processors. Each processor is passed the current nodeset (array)
+         * and the argument (if any) supplied in the selector.
+         */
+        pseudos : {
+            "first-child" : function(c){
+                var r = [], ri = -1, n;
+                for(var i = 0, ci; ci = n = c[i]; i++){
+                    while((n = n.previousSibling) && n.nodeType != 1);
+                    if(!n){
+                        r[++ri] = ci;
+                    }
+                }
+                return r;
+            },
+
+            "last-child" : function(c){
+                var r = [], ri = -1, n;
+                for(var i = 0, ci; ci = n = c[i]; i++){
+                    while((n = n.nextSibling) && n.nodeType != 1);
+                    if(!n){
+                        r[++ri] = ci;
+                    }
+                }
+                return r;
+            },
+
+            "nth-child" : function(c, a) {
+                var r = [], ri = -1;
+                var m = nthRe.exec(a == "even" && "2n" || a == "odd" && "2n+1" || !nthRe2.test(a) && "n+" + a || a);
+                var f = (m[1] || 1) - 0, l = m[2] - 0;
+                for(var i = 0, n; n = c[i]; i++){
+                    var pn = n.parentNode;
+                    if (batch != pn._batch) {
+                        var j = 0;
+                        for(var cn = pn.firstChild; cn; cn = cn.nextSibling){
+                            if(cn.nodeType == 1){
+                               cn.nodeIndex = ++j;
+                            }
+                        }
+                        pn._batch = batch;
+                    }
+                    if (f == 1) {
+                        if (l == 0 || n.nodeIndex == l){
+                            r[++ri] = n;
+                        }
+                    } else if ((n.nodeIndex + l) % f == 0){
+                        r[++ri] = n;
+                    }
+                }
+
+                return r;
+            },
+
+            "only-child" : function(c){
+                var r = [], ri = -1;;
+                for(var i = 0, ci; ci = c[i]; i++){
+                    if(!prev(ci) && !next(ci)){
+                        r[++ri] = ci;
+                    }
+                }
+                return r;
+            },
+
+            "empty" : function(c){
+                var r = [], ri = -1;
+                for(var i = 0, ci; ci = c[i]; i++){
+                    var cns = ci.childNodes, j = 0, cn, empty = true;
+                    while(cn = cns[j]){
+                        ++j;
+                        if(cn.nodeType == 1 || cn.nodeType == 3){
+                            empty = false;
+                            break;
+                        }
+                    }
+                    if(empty){
+                        r[++ri] = ci;
+                    }
+                }
+                return r;
+            },
+
+            "contains" : function(c, v){
+                var r = [], ri = -1;
+                for(var i = 0, ci; ci = c[i]; i++){
+                    if((ci.textContent||ci.innerText||'').indexOf(v) != -1){
+                        r[++ri] = ci;
+                    }
+                }
+                return r;
+            },
+
+            "nodeValue" : function(c, v){
+                var r = [], ri = -1;
+                for(var i = 0, ci; ci = c[i]; i++){
+                    if(ci.firstChild && ci.firstChild.nodeValue == v){
+                        r[++ri] = ci;
+                    }
+                }
+                return r;
+            },
+
+            "checked" : function(c){
+                var r = [], ri = -1;
+                for(var i = 0, ci; ci = c[i]; i++){
+                    if(ci.checked == true){
+                        r[++ri] = ci;
+                    }
+                }
+                return r;
+            },
+
+            "not" : function(c, ss){
+                return Roo.DomQuery.filter(c, ss, true);
+            },
+
+            "odd" : function(c){
+                return this["nth-child"](c, "odd");
+            },
+
+            "even" : function(c){
+                return this["nth-child"](c, "even");
+            },
+
+            "nth" : function(c, a){
+                return c[a-1] || [];
+            },
+
+            "first" : function(c){
+                return c[0] || [];
+            },
+
+            "last" : function(c){
+                return c[c.length-1] || [];
+            },
+
+            "has" : function(c, ss){
+                var s = Roo.DomQuery.select;
+                var r = [], ri = -1;
+                for(var i = 0, ci; ci = c[i]; i++){
+                    if(s(ss, ci).length > 0){
+                        r[++ri] = ci;
+                    }
+                }
+                return r;
+            },
+
+            "next" : function(c, ss){
+                var is = Roo.DomQuery.is;
+                var r = [], ri = -1;
+                for(var i = 0, ci; ci = c[i]; i++){
+                    var n = next(ci);
+                    if(n && is(n, ss)){
+                        r[++ri] = ci;
+                    }
+                }
+                return r;
+            },
+
+            "prev" : function(c, ss){
+                var is = Roo.DomQuery.is;
+                var r = [], ri = -1;
+                for(var i = 0, ci; ci = c[i]; i++){
+                    var n = prev(ci);
+                    if(n && is(n, ss)){
+                        r[++ri] = ci;
+                    }
+                }
+                return r;
+            }
+        }
+    };
+}();
+
+/**
+ * Selects an array of DOM nodes by CSS/XPath selector. Shorthand of {@link Roo.DomQuery#select}
+ * @param {String} path The selector/xpath query
+ * @param {Node} root (optional) The start of the query (defaults to document).
+ * @return {Array}
+ * @member Roo
+ * @method query
+ */
+Roo.query = Roo.DomQuery.select;
diff --git a/Roo/Editor.js b/Roo/Editor.js
new file mode 100644 (file)
index 0000000..5da9ac0
--- /dev/null
@@ -0,0 +1,333 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+
+/**
+ * @class Roo.Editor
+ * @extends Roo.Component
+ * A base editor field that handles displaying/hiding on demand and has some built-in sizing and event handling logic.
+ * @constructor
+ * Create a new Editor
+ * @param {Roo.form.Field} field The Field object (or descendant)
+ * @param {Object} config The config object
+ */
+Roo.Editor = function(field, config){
+    Roo.Editor.superclass.constructor.call(this, config);
+    this.field = field;
+    this.addEvents({
+        /**
+            * @event beforestartedit
+            * Fires when editing is initiated, but before the value changes.  Editing can be canceled by returning
+            * false from the handler of this event.
+            * @param {Editor} this
+            * @param {Roo.Element} boundEl The underlying element bound to this editor
+            * @param {Mixed} value The field value being set
+            */
+        "beforestartedit" : true,
+        /**
+            * @event startedit
+            * Fires when this editor is displayed
+            * @param {Roo.Element} boundEl The underlying element bound to this editor
+            * @param {Mixed} value The starting field value
+            */
+        "startedit" : true,
+        /**
+            * @event beforecomplete
+            * Fires after a change has been made to the field, but before the change is reflected in the underlying
+            * field.  Saving the change to the field can be canceled by returning false from the handler of this event.
+            * Note that if the value has not changed and ignoreNoChange = true, the editing will still end but this
+            * event will not fire since no edit actually occurred.
+            * @param {Editor} this
+            * @param {Mixed} value The current field value
+            * @param {Mixed} startValue The original field value
+            */
+        "beforecomplete" : true,
+        /**
+            * @event complete
+            * Fires after editing is complete and any changed value has been written to the underlying field.
+            * @param {Editor} this
+            * @param {Mixed} value The current field value
+            * @param {Mixed} startValue The original field value
+            */
+        "complete" : true,
+        /**
+         * @event specialkey
+         * Fires when any key related to navigation (arrows, tab, enter, esc, etc.) is pressed.  You can check
+         * {@link Roo.EventObject#getKey} to determine which key was pressed.
+         * @param {Roo.form.Field} this
+         * @param {Roo.EventObject} e The event object
+         */
+        "specialkey" : true
+    });
+};
+
+Roo.extend(Roo.Editor, Roo.Component, {
+    /**
+     * @cfg {Boolean/String} autosize
+     * True for the editor to automatically adopt the size of the underlying field, "width" to adopt the width only,
+     * or "height" to adopt the height only (defaults to false)
+     */
+    /**
+     * @cfg {Boolean} revertInvalid
+     * True to automatically revert the field value and cancel the edit when the user completes an edit and the field
+     * validation fails (defaults to true)
+     */
+    /**
+     * @cfg {Boolean} ignoreNoChange
+     * True to skip the the edit completion process (no save, no events fired) if the user completes an edit and
+     * the value has not changed (defaults to false).  Applies only to string values - edits for other data types
+     * will never be ignored.
+     */
+    /**
+     * @cfg {Boolean} hideEl
+     * False to keep the bound element visible while the editor is displayed (defaults to true)
+     */
+    /**
+     * @cfg {Mixed} value
+     * The data value of the underlying field (defaults to "")
+     */
+    value : "",
+    /**
+     * @cfg {String} alignment
+     * The position to align to (see {@link Roo.Element#alignTo} for more details, defaults to "c-c?").
+     */
+    alignment: "c-c?",
+    /**
+     * @cfg {Boolean/String} shadow "sides" for sides/bottom only, "frame" for 4-way shadow, and "drop"
+     * for bottom-right shadow (defaults to "frame")
+     */
+    shadow : "frame",
+    /**
+     * @cfg {Boolean} constrain True to constrain the editor to the viewport
+     */
+    constrain : false,
+    /**
+     * @cfg {Boolean} completeOnEnter True to complete the edit when the enter key is pressed (defaults to false)
+     */
+    completeOnEnter : false,
+    /**
+     * @cfg {Boolean} cancelOnEsc True to cancel the edit when the escape key is pressed (defaults to false)
+     */
+    cancelOnEsc : false,
+    /**
+     * @cfg {Boolean} updateEl True to update the innerHTML of the bound element when the update completes (defaults to false)
+     */
+    updateEl : false,
+
+    // private
+    onRender : function(ct, position){
+        this.el = new Roo.Layer({
+            shadow: this.shadow,
+            cls: "x-editor",
+            parentEl : ct,
+            shim : this.shim,
+            shadowOffset:4,
+            id: this.id,
+            constrain: this.constrain
+        });
+        this.el.setStyle("overflow", Roo.isGecko ? "auto" : "hidden");
+        if(this.field.msgTarget != 'title'){
+            this.field.msgTarget = 'qtip';
+        }
+        this.field.render(this.el);
+        if(Roo.isGecko){
+            this.field.el.dom.setAttribute('autocomplete', 'off');
+        }
+        this.field.on("specialkey", this.onSpecialKey, this);
+        if(this.swallowKeys){
+            this.field.el.swallowEvent(['keydown','keypress']);
+        }
+        this.field.show();
+        this.field.on("blur", this.onBlur, this);
+        if(this.field.grow){
+            this.field.on("autosize", this.el.sync,  this.el, {delay:1});
+        }
+    },
+
+    onSpecialKey : function(field, e){
+        if(this.completeOnEnter && e.getKey() == e.ENTER){
+            e.stopEvent();
+            this.completeEdit();
+        }else if(this.cancelOnEsc && e.getKey() == e.ESC){
+            this.cancelEdit();
+        }else{
+            this.fireEvent('specialkey', field, e);
+        }
+    },
+
+    /**
+     * Starts the editing process and shows the editor.
+     * @param {String/HTMLElement/Element} el The element to edit
+     * @param {String} value (optional) A value to initialize the editor with. If a value is not provided, it defaults
+      * to the innerHTML of el.
+     */
+    startEdit : function(el, value){
+        if(this.editing){
+            this.completeEdit();
+        }
+        this.boundEl = Roo.get(el);
+        var v = value !== undefined ? value : this.boundEl.dom.innerHTML;
+        if(!this.rendered){
+            this.render(this.parentEl || document.body);
+        }
+        if(this.fireEvent("beforestartedit", this, this.boundEl, v) === false){
+            return;
+        }
+        this.startValue = v;
+        this.field.setValue(v);
+        if(this.autoSize){
+            var sz = this.boundEl.getSize();
+            switch(this.autoSize){
+                case "width":
+                this.setSize(sz.width,  "");
+                break;
+                case "height":
+                this.setSize("",  sz.height);
+                break;
+                default:
+                this.setSize(sz.width,  sz.height);
+            }
+        }
+        this.el.alignTo(this.boundEl, this.alignment);
+        this.editing = true;
+        if(Roo.QuickTips){
+            Roo.QuickTips.disable();
+        }
+        this.show();
+    },
+
+    /**
+     * Sets the height and width of this editor.
+     * @param {Number} width The new width
+     * @param {Number} height The new height
+     */
+    setSize : function(w, h){
+        this.field.setSize(w, h);
+        if(this.el){
+            this.el.sync();
+        }
+    },
+
+    /**
+     * Realigns the editor to the bound field based on the current alignment config value.
+     */
+    realign : function(){
+        this.el.alignTo(this.boundEl, this.alignment);
+    },
+
+    /**
+     * Ends the editing process, persists the changed value to the underlying field, and hides the editor.
+     * @param {Boolean} remainVisible Override the default behavior and keep the editor visible after edit (defaults to false)
+     */
+    completeEdit : function(remainVisible){
+        if(!this.editing){
+            return;
+        }
+        var v = this.getValue();
+        if(this.revertInvalid !== false && !this.field.isValid()){
+            v = this.startValue;
+            this.cancelEdit(true);
+        }
+        if(String(v) === String(this.startValue) && this.ignoreNoChange){
+            this.editing = false;
+            this.hide();
+            return;
+        }
+        if(this.fireEvent("beforecomplete", this, v, this.startValue) !== false){
+            this.editing = false;
+            if(this.updateEl && this.boundEl){
+                this.boundEl.update(v);
+            }
+            if(remainVisible !== true){
+                this.hide();
+            }
+            this.fireEvent("complete", this, v, this.startValue);
+        }
+    },
+
+    // private
+    onShow : function(){
+        this.el.show();
+        if(this.hideEl !== false){
+            this.boundEl.hide();
+        }
+        this.field.show();
+        if(Roo.isIE && !this.fixIEFocus){ // IE has problems with focusing the first time
+            this.fixIEFocus = true;
+            this.deferredFocus.defer(50, this);
+        }else{
+            this.field.focus();
+        }
+        this.fireEvent("startedit", this.boundEl, this.startValue);
+    },
+
+    deferredFocus : function(){
+        if(this.editing){
+            this.field.focus();
+        }
+    },
+
+    /**
+     * Cancels the editing process and hides the editor without persisting any changes.  The field value will be
+     * reverted to the original starting value.
+     * @param {Boolean} remainVisible Override the default behavior and keep the editor visible after
+     * cancel (defaults to false)
+     */
+    cancelEdit : function(remainVisible){
+        if(this.editing){
+            this.setValue(this.startValue);
+            if(remainVisible !== true){
+                this.hide();
+            }
+        }
+    },
+
+    // private
+    onBlur : function(){
+        if(this.allowBlur !== true && this.editing){
+            this.completeEdit();
+        }
+    },
+
+    // private
+    onHide : function(){
+        if(this.editing){
+            this.completeEdit();
+            return;
+        }
+        this.field.blur();
+        if(this.field.collapse){
+            this.field.collapse();
+        }
+        this.el.hide();
+        if(this.hideEl !== false){
+            this.boundEl.show();
+        }
+        if(Roo.QuickTips){
+            Roo.QuickTips.enable();
+        }
+    },
+
+    /**
+     * Sets the data value of the editor
+     * @param {Mixed} value Any valid value supported by the underlying field
+     */
+    setValue : function(v){
+        this.field.setValue(v);
+    },
+
+    /**
+     * Gets the data value of the editor
+     * @return {Mixed} The data value
+     */
+    getValue : function(){
+        return this.field.getValue();
+    }
+});
\ No newline at end of file
diff --git a/Roo/Element.js b/Roo/Element.js
new file mode 100644 (file)
index 0000000..2160869
--- /dev/null
@@ -0,0 +1,2972 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+
+// was in Composite Element!??!?!
+(function(){
+    var D = Roo.lib.Dom;
+    var E = Roo.lib.Event;
+    var A = Roo.lib.Anim;
+
+    // local style camelizing for speed
+    var propCache = {};
+    var camelRe = /(-[a-z])/gi;
+    var camelFn = function(m, a){ return a.charAt(1).toUpperCase(); };
+    var view = document.defaultView;
+
+/**
+ * @class Roo.Element
+ * Represents an Element in the DOM.<br><br>
+ * Usage:<br>
+<pre><code>
+var el = Roo.get("my-div");
+
+// or with getEl
+var el = getEl("my-div");
+
+// or with a DOM element
+var el = Roo.get(myDivElement);
+</code></pre>
+ * Using Roo.get() or getEl() instead of calling the constructor directly ensures you get the same object
+ * each call instead of constructing a new one.<br><br>
+ * <b>Animations</b><br />
+ * Many of the functions for manipulating an element have an optional "animate" parameter. The animate parameter
+ * should either be a boolean (true) or an object literal with animation options. The animation options are:
+<pre>
+Option    Default   Description
+--------- --------  ---------------------------------------------
+duration  .35       The duration of the animation in seconds
+easing    easeOut   The YUI easing method
+callback  none      A function to execute when the anim completes
+scope     this      The scope (this) of the callback function
+</pre>
+* Also, the Anim object being used for the animation will be set on your options object as "anim", which allows you to stop or
+* manipulate the animation. Here's an example:
+<pre><code>
+var el = Roo.get("my-div");
+
+// no animation
+el.setWidth(100);
+
+// default animation
+el.setWidth(100, true);
+
+// animation with some options set
+el.setWidth(100, {
+    duration: 1,
+    callback: this.foo,
+    scope: this
+});
+
+// using the "anim" property to get the Anim object
+var opt = {
+    duration: 1,
+    callback: this.foo,
+    scope: this
+};
+el.setWidth(100, opt);
+...
+if(opt.anim.isAnimated()){
+    opt.anim.stop();
+}
+</code></pre>
+* <b> Composite (Collections of) Elements</b><br />
+ * For working with collections of Elements, see <a href="Roo.CompositeElement.html">Roo.CompositeElement</a>
+ * @constructor Create a new Element directly.
+ * @param {String/HTMLElement} element
+ * @param {Boolean} forceNew (optional) By default the constructor checks to see if there is already an instance of this element in the cache and if there is it returns the same instance. This will skip that check (useful for extending this class).
+ */
+    Roo.Element = function(element, forceNew){
+        var dom = typeof element == "string" ?
+                document.getElementById(element) : element;
+        if(!dom){ // invalid id/element
+            return null;
+        }
+        var id = dom.id;
+        if(forceNew !== true && id && Roo.Element.cache[id]){ // element object already exists
+            return Roo.Element.cache[id];
+        }
+
+        /**
+         * The DOM element
+         * @type HTMLElement
+         */
+        this.dom = dom;
+
+        /**
+         * The DOM element ID
+         * @type String
+         */
+        this.id = id || Roo.id(dom);
+    };
+
+    var El = Roo.Element;
+
+    El.prototype = {
+        /**
+         * The element's default display mode  (defaults to "")
+         * @type String
+         */
+        originalDisplay : "",
+
+        visibilityMode : 1,
+        /**
+         * The default unit to append to CSS values where a unit isn't provided (defaults to px).
+         * @type String
+         */
+        defaultUnit : "px",
+        /**
+         * Sets the element's visibility mode. When setVisible() is called it
+         * will use this to determine whether to set the visibility or the display property.
+         * @param visMode Element.VISIBILITY or Element.DISPLAY
+         * @return {Roo.Element} this
+         */
+        setVisibilityMode : function(visMode){
+            this.visibilityMode = visMode;
+            return this;
+        },
+        /**
+         * Convenience method for setVisibilityMode(Element.DISPLAY)
+         * @param {String} display (optional) What to set display to when visible
+         * @return {Roo.Element} this
+         */
+        enableDisplayMode : function(display){
+            this.setVisibilityMode(El.DISPLAY);
+            if(typeof display != "undefined") this.originalDisplay = display;
+            return this;
+        },
+
+        /**
+         * Looks at this node and then at parent nodes for a match of the passed simple selector (e.g. div.some-class or span:first-child)
+         * @param {String} selector The simple selector to test
+         * @param {Number/String/HTMLElement/Element} maxDepth (optional) The max depth to
+                search as a number or element (defaults to 10 || document.body)
+         * @param {Boolean} returnEl (optional) True to return a Roo.Element object instead of DOM node
+         * @return {HTMLElement} The matching DOM node (or null if no match was found)
+         */
+        findParent : function(simpleSelector, maxDepth, returnEl){
+            var p = this.dom, b = document.body, depth = 0, dq = Roo.DomQuery, stopEl;
+            maxDepth = maxDepth || 50;
+            if(typeof maxDepth != "number"){
+                stopEl = Roo.getDom(maxDepth);
+                maxDepth = 10;
+            }
+            while(p && p.nodeType == 1 && depth < maxDepth && p != b && p != stopEl){
+                if(dq.is(p, simpleSelector)){
+                    return returnEl ? Roo.get(p) : p;
+                }
+                depth++;
+                p = p.parentNode;
+            }
+            return null;
+        },
+
+
+        /**
+         * Looks at parent nodes for a match of the passed simple selector (e.g. div.some-class or span:first-child)
+         * @param {String} selector The simple selector to test
+         * @param {Number/String/HTMLElement/Element} maxDepth (optional) The max depth to
+                search as a number or element (defaults to 10 || document.body)
+         * @param {Boolean} returnEl (optional) True to return a Roo.Element object instead of DOM node
+         * @return {HTMLElement} The matching DOM node (or null if no match was found)
+         */
+        findParentNode : function(simpleSelector, maxDepth, returnEl){
+            var p = Roo.fly(this.dom.parentNode, '_internal');
+            return p ? p.findParent(simpleSelector, maxDepth, returnEl) : null;
+        },
+
+        /**
+         * Walks up the dom looking for a parent node that matches the passed simple selector (e.g. div.some-class or span:first-child).
+         * This is a shortcut for findParentNode() that always returns an Roo.Element.
+         * @param {String} selector The simple selector to test
+         * @param {Number/String/HTMLElement/Element} maxDepth (optional) The max depth to
+                search as a number or element (defaults to 10 || document.body)
+         * @return {Roo.Element} The matching DOM node (or null if no match was found)
+         */
+        up : function(simpleSelector, maxDepth){
+            return this.findParentNode(simpleSelector, maxDepth, true);
+        },
+
+
+
+        /**
+         * Returns true if this element matches the passed simple selector (e.g. div.some-class or span:first-child)
+         * @param {String} selector The simple selector to test
+         * @return {Boolean} True if this element matches the selector, else false
+         */
+        is : function(simpleSelector){
+            return Roo.DomQuery.is(this.dom, simpleSelector);
+        },
+
+        /**
+         * Perform animation on this element.
+         * @param {Object} args The YUI animation control args
+         * @param {Float} duration (optional) How long the animation lasts in seconds (defaults to .35)
+         * @param {Function} onComplete (optional) Function to call when animation completes
+         * @param {String} easing (optional) Easing method to use (defaults to 'easeOut')
+         * @param {String} animType (optional) 'run' is the default. Can also be 'color', 'motion', or 'scroll'
+         * @return {Roo.Element} this
+         */
+        animate : function(args, duration, onComplete, easing, animType){
+            this.anim(args, {duration: duration, callback: onComplete, easing: easing}, animType);
+            return this;
+        },
+
+        /*
+         * @private Internal animation call
+         */
+        anim : function(args, opt, animType, defaultDur, defaultEase, cb){
+            animType = animType || 'run';
+            opt = opt || {};
+            var anim = Roo.lib.Anim[animType](
+                this.dom, args,
+                (opt.duration || defaultDur) || .35,
+                (opt.easing || defaultEase) || 'easeOut',
+                function(){
+                    Roo.callback(cb, this);
+                    Roo.callback(opt.callback, opt.scope || this, [this, opt]);
+                },
+                this
+            );
+            opt.anim = anim;
+            return anim;
+        },
+
+        // private legacy anim prep
+        preanim : function(a, i){
+            return !a[i] ? false : (typeof a[i] == "object" ? a[i]: {duration: a[i+1], callback: a[i+2], easing: a[i+3]});
+        },
+
+        /**
+         * Removes worthless text nodes
+         * @param {Boolean} forceReclean (optional) By default the element
+         * keeps track if it has been cleaned already so
+         * you can call this over and over. However, if you update the element and
+         * need to force a reclean, you can pass true.
+         */
+        clean : function(forceReclean){
+            if(this.isCleaned && forceReclean !== true){
+                return this;
+            }
+            var ns = /\S/;
+            var d = this.dom, n = d.firstChild, ni = -1;
+            while(n){
+                var nx = n.nextSibling;
+                if(n.nodeType == 3 && !ns.test(n.nodeValue)){
+                    d.removeChild(n);
+                }else{
+                    n.nodeIndex = ++ni;
+                }
+                n = nx;
+            }
+            this.isCleaned = true;
+            return this;
+        },
+
+        // private
+        calcOffsetsTo : function(el){
+            el = Roo.get(el);
+            var d = el.dom;
+            var restorePos = false;
+            if(el.getStyle('position') == 'static'){
+                el.position('relative');
+                restorePos = true;
+            }
+            var x = 0, y =0;
+            var op = this.dom;
+            while(op && op != d && op.tagName != 'HTML'){
+                x+= op.offsetLeft;
+                y+= op.offsetTop;
+                op = op.offsetParent;
+            }
+            if(restorePos){
+                el.position('static');
+            }
+            return [x, y];
+        },
+
+        /**
+         * Scrolls this element into view within the passed container.
+         * @param {String/HTMLElement/Element} container (optional) The container element to scroll (defaults to document.body)
+         * @param {Boolean} hscroll (optional) False to disable horizontal scroll (defaults to true)
+         * @return {Roo.Element} this
+         */
+        scrollIntoView : function(container, hscroll){
+            var c = Roo.getDom(container) || document.body;
+            var el = this.dom;
+
+            var o = this.calcOffsetsTo(c),
+                l = o[0],
+                t = o[1],
+                b = t+el.offsetHeight,
+                r = l+el.offsetWidth;
+
+            var ch = c.clientHeight;
+            var ct = parseInt(c.scrollTop, 10);
+            var cl = parseInt(c.scrollLeft, 10);
+            var cb = ct + ch;
+            var cr = cl + c.clientWidth;
+
+            if(t < ct){
+                c.scrollTop = t;
+            }else if(b > cb){
+                c.scrollTop = b-ch;
+            }
+
+            if(hscroll !== false){
+                if(l < cl){
+                    c.scrollLeft = l;
+                }else if(r > cr){
+                    c.scrollLeft = r-c.clientWidth;
+                }
+            }
+            return this;
+        },
+
+        // private
+        scrollChildIntoView : function(child, hscroll){
+            Roo.fly(child, '_scrollChildIntoView').scrollIntoView(this, hscroll);
+        },
+
+        /**
+         * Measures the element's content height and updates height to match. Note: this function uses setTimeout so
+         * the new height may not be available immediately.
+         * @param {Boolean} animate (optional) Animate the transition (defaults to false)
+         * @param {Float} duration (optional) Length of the animation in seconds (defaults to .35)
+         * @param {Function} onComplete (optional) Function to call when animation completes
+         * @param {String} easing (optional) Easing method to use (defaults to easeOut)
+         * @return {Roo.Element} this
+         */
+        autoHeight : function(animate, duration, onComplete, easing){
+            var oldHeight = this.getHeight();
+            this.clip();
+            this.setHeight(1); // force clipping
+            setTimeout(function(){
+                var height = parseInt(this.dom.scrollHeight, 10); // parseInt for Safari
+                if(!animate){
+                    this.setHeight(height);
+                    this.unclip();
+                    if(typeof onComplete == "function"){
+                        onComplete();
+                    }
+                }else{
+                    this.setHeight(oldHeight); // restore original height
+                    this.setHeight(height, animate, duration, function(){
+                        this.unclip();
+                        if(typeof onComplete == "function") onComplete();
+                    }.createDelegate(this), easing);
+                }
+            }.createDelegate(this), 0);
+            return this;
+        },
+
+        /**
+         * Returns true if this element is an ancestor of the passed element
+         * @param {HTMLElement/String} el The element to check
+         * @return {Boolean} True if this element is an ancestor of el, else false
+         */
+        contains : function(el){
+            if(!el){return false;}
+            return D.isAncestor(this.dom, el.dom ? el.dom : el);
+        },
+
+        /**
+         * Checks whether the element is currently visible using both visibility and display properties.
+         * @param {Boolean} deep (optional) True to walk the dom and see if parent elements are hidden (defaults to false)
+         * @return {Boolean} True if the element is currently visible, else false
+         */
+        isVisible : function(deep) {
+            var vis = !(this.getStyle("visibility") == "hidden" || this.getStyle("display") == "none");
+            if(deep !== true || !vis){
+                return vis;
+            }
+            var p = this.dom.parentNode;
+            while(p && p.tagName.toLowerCase() != "body"){
+                if(!Roo.fly(p, '_isVisible').isVisible()){
+                    return false;
+                }
+                p = p.parentNode;
+            }
+            return true;
+        },
+
+        /**
+         * Creates a {@link Roo.CompositeElement} for child nodes based on the passed CSS selector (the selector should not contain an id).
+         * @param {String} selector The CSS selector
+         * @param {Boolean} unique (optional) True to create a unique Roo.Element for each child (defaults to false, which creates a single shared flyweight object)
+         * @return {CompositeElement/CompositeElementLite} The composite element
+         */
+        select : function(selector, unique){
+            return El.select(selector, unique, this.dom);
+        },
+
+        /**
+         * Selects child nodes based on the passed CSS selector (the selector should not contain an id).
+         * @param {String} selector The CSS selector
+         * @return {Array} An array of the matched nodes
+         */
+        query : function(selector, unique){
+            return Roo.DomQuery.select(selector, this.dom);
+        },
+
+        /**
+         * Selects a single child at any depth below this element based on the passed CSS selector (the selector should not contain an id).
+         * @param {String} selector The CSS selector
+         * @param {Boolean} returnDom (optional) True to return the DOM node instead of Roo.Element (defaults to false)
+         * @return {HTMLElement/Roo.Element} The child Roo.Element (or DOM node if returnDom = true)
+         */
+        child : function(selector, returnDom){
+            var n = Roo.DomQuery.selectNode(selector, this.dom);
+            return returnDom ? n : Roo.get(n);
+        },
+
+        /**
+         * Selects a single *direct* child based on the passed CSS selector (the selector should not contain an id).
+         * @param {String} selector The CSS selector
+         * @param {Boolean} returnDom (optional) True to return the DOM node instead of Roo.Element (defaults to false)
+         * @return {HTMLElement/Roo.Element} The child Roo.Element (or DOM node if returnDom = true)
+         */
+        down : function(selector, returnDom){
+            var n = Roo.DomQuery.selectNode(" > " + selector, this.dom);
+            return returnDom ? n : Roo.get(n);
+        },
+
+        /**
+         * Initializes a {@link Roo.dd.DD} drag drop object for this element.
+         * @param {String} group The group the DD object is member of
+         * @param {Object} config The DD config object
+         * @param {Object} overrides An object containing methods to override/implement on the DD object
+         * @return {Roo.dd.DD} The DD object
+         */
+        initDD : function(group, config, overrides){
+            var dd = new Roo.dd.DD(Roo.id(this.dom), group, config);
+            return Roo.apply(dd, overrides);
+        },
+
+        /**
+         * Initializes a {@link Roo.dd.DDProxy} object for this element.
+         * @param {String} group The group the DDProxy object is member of
+         * @param {Object} config The DDProxy config object
+         * @param {Object} overrides An object containing methods to override/implement on the DDProxy object
+         * @return {Roo.dd.DDProxy} The DDProxy object
+         */
+        initDDProxy : function(group, config, overrides){
+            var dd = new Roo.dd.DDProxy(Roo.id(this.dom), group, config);
+            return Roo.apply(dd, overrides);
+        },
+
+        /**
+         * Initializes a {@link Roo.dd.DDTarget} object for this element.
+         * @param {String} group The group the DDTarget object is member of
+         * @param {Object} config The DDTarget config object
+         * @param {Object} overrides An object containing methods to override/implement on the DDTarget object
+         * @return {Roo.dd.DDTarget} The DDTarget object
+         */
+        initDDTarget : function(group, config, overrides){
+            var dd = new Roo.dd.DDTarget(Roo.id(this.dom), group, config);
+            return Roo.apply(dd, overrides);
+        },
+
+        /**
+         * Sets the visibility of the element (see details). If the visibilityMode is set to Element.DISPLAY, it will use
+         * the display property to hide the element, otherwise it uses visibility. The default is to hide and show using the visibility property.
+         * @param {Boolean} visible Whether the element is visible
+         * @param {Boolean/Object} animate (optional) True for the default animation, or a standard Element animation config object
+         * @return {Roo.Element} this
+         */
+         setVisible : function(visible, animate){
+            if(!animate || !A){
+                if(this.visibilityMode == El.DISPLAY){
+                    this.setDisplayed(visible);
+                }else{
+                    this.fixDisplay();
+                    this.dom.style.visibility = visible ? "visible" : "hidden";
+                }
+            }else{
+                // closure for composites
+                var dom = this.dom;
+                var visMode = this.visibilityMode;
+                if(visible){
+                    this.setOpacity(.01);
+                    this.setVisible(true);
+                }
+                this.anim({opacity: { to: (visible?1:0) }},
+                      this.preanim(arguments, 1),
+                      null, .35, 'easeIn', function(){
+                         if(!visible){
+                             if(visMode == El.DISPLAY){
+                                 dom.style.display = "none";
+                             }else{
+                                 dom.style.visibility = "hidden";
+                             }
+                             Roo.get(dom).setOpacity(1);
+                         }
+                     });
+            }
+            return this;
+        },
+
+        /**
+         * Returns true if display is not "none"
+         * @return {Boolean}
+         */
+        isDisplayed : function() {
+            return this.getStyle("display") != "none";
+        },
+
+        /**
+         * Toggles the element's visibility or display, depending on visibility mode.
+         * @param {Boolean/Object} animate (optional) True for the default animation, or a standard Element animation config object
+         * @return {Roo.Element} this
+         */
+        toggle : function(animate){
+            this.setVisible(!this.isVisible(), this.preanim(arguments, 0));
+            return this;
+        },
+
+        /**
+         * Sets the CSS display property. Uses originalDisplay if the specified value is a boolean true.
+         * @param {Boolean} value Boolean value to display the element using its default display, or a string to set the display directly
+         * @return {Roo.Element} this
+         */
+        setDisplayed : function(value) {
+            if(typeof value == "boolean"){
+               value = value ? this.originalDisplay : "none";
+            }
+            this.setStyle("display", value);
+            return this;
+        },
+
+        /**
+         * Tries to focus the element. Any exceptions are caught and ignored.
+         * @return {Roo.Element} this
+         */
+        focus : function() {
+            try{
+                this.dom.focus();
+            }catch(e){}
+            return this;
+        },
+
+        /**
+         * Tries to blur the element. Any exceptions are caught and ignored.
+         * @return {Roo.Element} this
+         */
+        blur : function() {
+            try{
+                this.dom.blur();
+            }catch(e){}
+            return this;
+        },
+
+        /**
+         * Adds one or more CSS classes to the element. Duplicate classes are automatically filtered out.
+         * @param {String/Array} className The CSS class to add, or an array of classes
+         * @return {Roo.Element} this
+         */
+        addClass : function(className){
+            if(className instanceof Array){
+                for(var i = 0, len = className.length; i < len; i++) {
+                    this.addClass(className[i]);
+                }
+            }else{
+                if(className && !this.hasClass(className)){
+                    this.dom.className = this.dom.className + " " + className;
+                }
+            }
+            return this;
+        },
+
+        /**
+         * Adds one or more CSS classes to this element and removes the same class(es) from all siblings.
+         * @param {String/Array} className The CSS class to add, or an array of classes
+         * @return {Roo.Element} this
+         */
+        radioClass : function(className){
+            var siblings = this.dom.parentNode.childNodes;
+            for(var i = 0; i < siblings.length; i++) {
+                var s = siblings[i];
+                if(s.nodeType == 1){
+                    Roo.get(s).removeClass(className);
+                }
+            }
+            this.addClass(className);
+            return this;
+        },
+
+        /**
+         * Removes one or more CSS classes from the element.
+         * @param {String/Array} className The CSS class to remove, or an array of classes
+         * @return {Roo.Element} this
+         */
+        removeClass : function(className){
+            if(!className || !this.dom.className){
+                return this;
+            }
+            if(className instanceof Array){
+                for(var i = 0, len = className.length; i < len; i++) {
+                    this.removeClass(className[i]);
+                }
+            }else{
+                if(this.hasClass(className)){
+                    var re = this.classReCache[className];
+                    if (!re) {
+                       re = new RegExp('(?:^|\\s+)' + className + '(?:\\s+|$)', "g");
+                       this.classReCache[className] = re;
+                    }
+                    this.dom.className =
+                        this.dom.className.replace(re, " ");
+                }
+            }
+            return this;
+        },
+
+        // private
+        classReCache: {},
+
+        /**
+         * Toggles the specified CSS class on this element (removes it if it already exists, otherwise adds it).
+         * @param {String} className The CSS class to toggle
+         * @return {Roo.Element} this
+         */
+        toggleClass : function(className){
+            if(this.hasClass(className)){
+                this.removeClass(className);
+            }else{
+                this.addClass(className);
+            }
+            return this;
+        },
+
+        /**
+         * Checks if the specified CSS class exists on this element's DOM node.
+         * @param {String} className The CSS class to check for
+         * @return {Boolean} True if the class exists, else false
+         */
+        hasClass : function(className){
+            return className && (' '+this.dom.className+' ').indexOf(' '+className+' ') != -1;
+        },
+
+        /**
+         * Replaces a CSS class on the element with another.  If the old name does not exist, the new name will simply be added.
+         * @param {String} oldClassName The CSS class to replace
+         * @param {String} newClassName The replacement CSS class
+         * @return {Roo.Element} this
+         */
+        replaceClass : function(oldClassName, newClassName){
+            this.removeClass(oldClassName);
+            this.addClass(newClassName);
+            return this;
+        },
+
+        /**
+         * Returns an object with properties matching the styles requested.
+         * For example, el.getStyles('color', 'font-size', 'width') might return
+         * {'color': '#FFFFFF', 'font-size': '13px', 'width': '100px'}.
+         * @param {String} style1 A style name
+         * @param {String} style2 A style name
+         * @param {String} etc.
+         * @return {Object} The style object
+         */
+        getStyles : function(){
+            var a = arguments, len = a.length, r = {};
+            for(var i = 0; i < len; i++){
+                r[a[i]] = this.getStyle(a[i]);
+            }
+            return r;
+        },
+
+        /**
+         * Normalizes currentStyle and computedStyle. This is not YUI getStyle, it is an optimised version.
+         * @param {String} property The style property whose value is returned.
+         * @return {String} The current value of the style property for this element.
+         */
+        getStyle : function(){
+            return view && view.getComputedStyle ?
+                function(prop){
+                    var el = this.dom, v, cs, camel;
+                    if(prop == 'float'){
+                        prop = "cssFloat";
+                    }
+                    if(el.style && (v = el.style[prop])){
+                        return v;
+                    }
+                    if(cs = view.getComputedStyle(el, "")){
+                        if(!(camel = propCache[prop])){
+                            camel = propCache[prop] = prop.replace(camelRe, camelFn);
+                        }
+                        return cs[camel];
+                    }
+                    return null;
+                } :
+                function(prop){
+                    var el = this.dom, v, cs, camel;
+                    if(prop == 'opacity'){
+                        if(typeof el.style.filter == 'string'){
+                            var m = el.style.filter.match(/alpha\(opacity=(.*)\)/i);
+                            if(m){
+                                var fv = parseFloat(m[1]);
+                                if(!isNaN(fv)){
+                                    return fv ? fv / 100 : 0;
+                                }
+                            }
+                        }
+                        return 1;
+                    }else if(prop == 'float'){
+                        prop = "styleFloat";
+                    }
+                    if(!(camel = propCache[prop])){
+                        camel = propCache[prop] = prop.replace(camelRe, camelFn);
+                    }
+                    if(v = el.style[camel]){
+                        return v;
+                    }
+                    if(cs = el.currentStyle){
+                        return cs[camel];
+                    }
+                    return null;
+                };
+        }(),
+
+        /**
+         * Wrapper for setting style properties, also takes single object parameter of multiple styles.
+         * @param {String/Object} property The style property to be set, or an object of multiple styles.
+         * @param {String} value (optional) The value to apply to the given property, or null if an object was passed.
+         * @return {Roo.Element} this
+         */
+        setStyle : function(prop, value){
+            if(typeof prop == "string"){
+                var camel;
+                if(!(camel = propCache[prop])){
+                    camel = propCache[prop] = prop.replace(camelRe, camelFn);
+                }
+                if(camel == 'opacity') {
+                    this.setOpacity(value);
+                }else{
+                    this.dom.style[camel] = value;
+                }
+            }else{
+                for(var style in prop){
+                    if(typeof prop[style] != "function"){
+                       this.setStyle(style, prop[style]);
+                    }
+                }
+            }
+            return this;
+        },
+
+        /**
+         * More flexible version of {@link #setStyle} for setting style properties.
+         * @param {String/Object/Function} styles A style specification string, e.g. "width:100px", or object in the form {width:"100px"}, or
+         * a function which returns such a specification.
+         * @return {Roo.Element} this
+         */
+        applyStyles : function(style){
+            Roo.DomHelper.applyStyles(this.dom, style);
+            return this;
+        },
+
+        /**
+          * Gets the current X position of the element based on page coordinates.  Element must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).
+          * @return {Number} The X position of the element
+          */
+        getX : function(){
+            return D.getX(this.dom);
+        },
+
+        /**
+          * Gets the current Y position of the element based on page coordinates.  Element must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).
+          * @return {Number} The Y position of the element
+          */
+        getY : function(){
+            return D.getY(this.dom);
+        },
+
+        /**
+          * Gets the current position of the element based on page coordinates.  Element must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).
+          * @return {Array} The XY position of the element
+          */
+        getXY : function(){
+            return D.getXY(this.dom);
+        },
+
+        /**
+         * Sets the X position of the element based on page coordinates.  Element must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).
+         * @param {Number} The X position of the element
+         * @param {Boolean/Object} animate (optional) True for the default animation, or a standard Element animation config object
+         * @return {Roo.Element} this
+         */
+        setX : function(x, animate){
+            if(!animate || !A){
+                D.setX(this.dom, x);
+            }else{
+                this.setXY([x, this.getY()], this.preanim(arguments, 1));
+            }
+            return this;
+        },
+
+        /**
+         * Sets the Y position of the element based on page coordinates.  Element must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).
+         * @param {Number} The Y position of the element
+         * @param {Boolean/Object} animate (optional) True for the default animation, or a standard Element animation config object
+         * @return {Roo.Element} this
+         */
+        setY : function(y, animate){
+            if(!animate || !A){
+                D.setY(this.dom, y);
+            }else{
+                this.setXY([this.getX(), y], this.preanim(arguments, 1));
+            }
+            return this;
+        },
+
+        /**
+         * Sets the element's left position directly using CSS style (instead of {@link #setX}).
+         * @param {String} left The left CSS property value
+         * @return {Roo.Element} this
+         */
+        setLeft : function(left){
+            this.setStyle("left", this.addUnits(left));
+            return this;
+        },
+
+        /**
+         * Sets the element's top position directly using CSS style (instead of {@link #setY}).
+         * @param {String} top The top CSS property value
+         * @return {Roo.Element} this
+         */
+        setTop : function(top){
+            this.setStyle("top", this.addUnits(top));
+            return this;
+        },
+
+        /**
+         * Sets the element's CSS right style.
+         * @param {String} right The right CSS property value
+         * @return {Roo.Element} this
+         */
+        setRight : function(right){
+            this.setStyle("right", this.addUnits(right));
+            return this;
+        },
+
+        /**
+         * Sets the element's CSS bottom style.
+         * @param {String} bottom The bottom CSS property value
+         * @return {Roo.Element} this
+         */
+        setBottom : function(bottom){
+            this.setStyle("bottom", this.addUnits(bottom));
+            return this;
+        },
+
+        /**
+         * Sets the position of the element in page coordinates, regardless of how the element is positioned.
+         * The element must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).
+         * @param {Array} pos Contains X & Y [x, y] values for new position (coordinates are page-based)
+         * @param {Boolean/Object} animate (optional) True for the default animation, or a standard Element animation config object
+         * @return {Roo.Element} this
+         */
+        setXY : function(pos, animate){
+            if(!animate || !A){
+                D.setXY(this.dom, pos);
+            }else{
+                this.anim({points: {to: pos}}, this.preanim(arguments, 1), 'motion');
+            }
+            return this;
+        },
+
+        /**
+         * Sets the position of the element in page coordinates, regardless of how the element is positioned.
+         * The element must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).
+         * @param {Number} x X value for new position (coordinates are page-based)
+         * @param {Number} y Y value for new position (coordinates are page-based)
+         * @param {Boolean/Object} animate (optional) True for the default animation, or a standard Element animation config object
+         * @return {Roo.Element} this
+         */
+        setLocation : function(x, y, animate){
+            this.setXY([x, y], this.preanim(arguments, 2));
+            return this;
+        },
+
+        /**
+         * Sets the position of the element in page coordinates, regardless of how the element is positioned.
+         * The element must be part of the DOM tree to have page coordinates (display:none or elements not appended return false).
+         * @param {Number} x X value for new position (coordinates are page-based)
+         * @param {Number} y Y value for new position (coordinates are page-based)
+         * @param {Boolean/Object} animate (optional) True for the default animation, or a standard Element animation config object
+         * @return {Roo.Element} this
+         */
+        moveTo : function(x, y, animate){
+            this.setXY([x, y], this.preanim(arguments, 2));
+            return this;
+        },
+
+        /**
+         * Returns the region of the given element.
+         * The element must be part of the DOM tree to have a region (display:none or elements not appended return false).
+         * @return {Region} A Roo.lib.Region containing "top, left, bottom, right" member data.
+         */
+        getRegion : function(){
+            return D.getRegion(this.dom);
+        },
+
+        /**
+         * Returns the offset height of the element
+         * @param {Boolean} contentHeight (optional) true to get the height minus borders and padding
+         * @return {Number} The element's height
+         */
+        getHeight : function(contentHeight){
+            var h = this.dom.offsetHeight || 0;
+            return contentHeight !== true ? h : h-this.getBorderWidth("tb")-this.getPadding("tb");
+        },
+
+        /**
+         * Returns the offset width of the element
+         * @param {Boolean} contentWidth (optional) true to get the width minus borders and padding
+         * @return {Number} The element's width
+         */
+        getWidth : function(contentWidth){
+            var w = this.dom.offsetWidth || 0;
+            return contentWidth !== true ? w : w-this.getBorderWidth("lr")-this.getPadding("lr");
+        },
+
+        /**
+         * Returns either the offsetHeight or the height of this element based on CSS height adjusted by padding or borders
+         * when needed to simulate offsetHeight when offsets aren't available. This may not work on display:none elements
+         * if a height has not been set using CSS.
+         * @return {Number}
+         */
+        getComputedHeight : function(){
+            var h = Math.max(this.dom.offsetHeight, this.dom.clientHeight);
+            if(!h){
+                h = parseInt(this.getStyle('height'), 10) || 0;
+                if(!this.isBorderBox()){
+                    h += this.getFrameWidth('tb');
+                }
+            }
+            return h;
+        },
+
+        /**
+         * Returns either the offsetWidth or the width of this element based on CSS width adjusted by padding or borders
+         * when needed to simulate offsetWidth when offsets aren't available. This may not work on display:none elements
+         * if a width has not been set using CSS.
+         * @return {Number}
+         */
+        getComputedWidth : function(){
+            var w = Math.max(this.dom.offsetWidth, this.dom.clientWidth);
+            if(!w){
+                w = parseInt(this.getStyle('width'), 10) || 0;
+                if(!this.isBorderBox()){
+                    w += this.getFrameWidth('lr');
+                }
+            }
+            return w;
+        },
+
+        /**
+         * Returns the size of the element.
+         * @param {Boolean} contentSize (optional) true to get the width/size minus borders and padding
+         * @return {Object} An object containing the element's size {width: (element width), height: (element height)}
+         */
+        getSize : function(contentSize){
+            return {width: this.getWidth(contentSize), height: this.getHeight(contentSize)};
+        },
+
+        /**
+         * Returns the width and height of the viewport.
+         * @return {Object} An object containing the viewport's size {width: (viewport width), height: (viewport height)}
+         */
+        getViewSize : function(){
+            var d = this.dom, doc = document, aw = 0, ah = 0;
+            if(d == doc || d == doc.body){
+                return {width : D.getViewWidth(), height: D.getViewHeight()};
+            }else{
+                return {
+                    width : d.clientWidth,
+                    height: d.clientHeight
+                };
+            }
+        },
+
+        /**
+         * Returns the value of the "value" attribute
+         * @param {Boolean} asNumber true to parse the value as a number
+         * @return {String/Number}
+         */
+        getValue : function(asNumber){
+            return asNumber ? parseInt(this.dom.value, 10) : this.dom.value;
+        },
+
+        // private
+        adjustWidth : function(width){
+            if(typeof width == "number"){
+                if(this.autoBoxAdjust && !this.isBorderBox()){
+                   width -= (this.getBorderWidth("lr") + this.getPadding("lr"));
+                }
+                if(width < 0){
+                    width = 0;
+                }
+            }
+            return width;
+        },
+
+        // private
+        adjustHeight : function(height){
+            if(typeof height == "number"){
+               if(this.autoBoxAdjust && !this.isBorderBox()){
+                   height -= (this.getBorderWidth("tb") + this.getPadding("tb"));
+               }
+               if(height < 0){
+                   height = 0;
+               }
+            }
+            return height;
+        },
+
+        /**
+         * Set the width of the element
+         * @param {Number} width The new width
+         * @param {Boolean/Object} animate (optional) true for the default animation or a standard Element animation config object
+         * @return {Roo.Element} this
+         */
+        setWidth : function(width, animate){
+            width = this.adjustWidth(width);
+            if(!animate || !A){
+                this.dom.style.width = this.addUnits(width);
+            }else{
+                this.anim({width: {to: width}}, this.preanim(arguments, 1));
+            }
+            return this;
+        },
+
+        /**
+         * Set the height of the element
+         * @param {Number} height The new height
+         * @param {Boolean/Object} animate (optional) true for the default animation or a standard Element animation config object
+         * @return {Roo.Element} this
+         */
+         setHeight : function(height, animate){
+            height = this.adjustHeight(height);
+            if(!animate || !A){
+                this.dom.style.height = this.addUnits(height);
+            }else{
+                this.anim({height: {to: height}}, this.preanim(arguments, 1));
+            }
+            return this;
+        },
+
+        /**
+         * Set the size of the element. If animation is true, both width an height will be animated concurrently.
+         * @param {Number} width The new width
+         * @param {Number} height The new height
+         * @param {Boolean/Object} animate (optional) true for the default animation or a standard Element animation config object
+         * @return {Roo.Element} this
+         */
+         setSize : function(width, height, animate){
+            if(typeof width == "object"){ // in case of object from getSize()
+                height = width.height; width = width.width;
+            }
+            width = this.adjustWidth(width); height = this.adjustHeight(height);
+            if(!animate || !A){
+                this.dom.style.width = this.addUnits(width);
+                this.dom.style.height = this.addUnits(height);
+            }else{
+                this.anim({width: {to: width}, height: {to: height}}, this.preanim(arguments, 2));
+            }
+            return this;
+        },
+
+        /**
+         * Sets the element's position and size in one shot. If animation is true then width, height, x and y will be animated concurrently.
+         * @param {Number} x X value for new position (coordinates are page-based)
+         * @param {Number} y Y value for new position (coordinates are page-based)
+         * @param {Number} width The new width
+         * @param {Number} height The new height
+         * @param {Boolean/Object} animate (optional) true for the default animation or a standard Element animation config object
+         * @return {Roo.Element} this
+         */
+        setBounds : function(x, y, width, height, animate){
+            if(!animate || !A){
+                this.setSize(width, height);
+                this.setLocation(x, y);
+            }else{
+                width = this.adjustWidth(width); height = this.adjustHeight(height);
+                this.anim({points: {to: [x, y]}, width: {to: width}, height: {to: height}},
+                              this.preanim(arguments, 4), 'motion');
+            }
+            return this;
+        },
+
+        /**
+         * Sets the element's position and size the the specified region. If animation is true then width, height, x and y will be animated concurrently.
+         * @param {Roo.lib.Region} region The region to fill
+         * @param {Boolean/Object} animate (optional) true for the default animation or a standard Element animation config object
+         * @return {Roo.Element} this
+         */
+        setRegion : function(region, animate){
+            this.setBounds(region.left, region.top, region.right-region.left, region.bottom-region.top, this.preanim(arguments, 1));
+            return this;
+        },
+
+        /**
+         * Appends an event handler
+         *
+         * @param {String}   eventName     The type of event to append
+         * @param {Function} fn        The method the event invokes
+         * @param {Object} scope       (optional) The scope (this object) of the fn
+         * @param {Object}   options   (optional)An object with standard {@link Roo.EventManager#addListener} options
+         */
+        addListener : function(eventName, fn, scope, options){
+            Roo.EventManager.on(this.dom,  eventName, fn, scope || this, options);
+        },
+
+        /**
+         * Removes an event handler from this element
+         * @param {String} eventName the type of event to remove
+         * @param {Function} fn the method the event invokes
+         * @return {Roo.Element} this
+         */
+        removeListener : function(eventName, fn){
+            Roo.EventManager.removeListener(this.dom,  eventName, fn);
+            return this;
+        },
+
+        /**
+         * Removes all previous added listeners from this element
+         * @return {Roo.Element} this
+         */
+        removeAllListeners : function(){
+            E.purgeElement(this.dom);
+            return this;
+        },
+
+        relayEvent : function(eventName, observable){
+            this.on(eventName, function(e){
+                observable.fireEvent(eventName, e);
+            });
+        },
+
+        /**
+         * Set the opacity of the element
+         * @param {Float} opacity The new opacity. 0 = transparent, .5 = 50% visibile, 1 = fully visible, etc
+         * @param {Boolean/Object} animate (optional) true for the default animation or a standard Element animation config object
+         * @return {Roo.Element} this
+         */
+         setOpacity : function(opacity, animate){
+            if(!animate || !A){
+                var s = this.dom.style;
+                if(Roo.isIE){
+                    s.zoom = 1;
+                    s.filter = (s.filter || '').replace(/alpha\([^\)]*\)/gi,"") +
+                               (opacity == 1 ? "" : "alpha(opacity=" + opacity * 100 + ")");
+                }else{
+                    s.opacity = opacity;
+                }
+            }else{
+                this.anim({opacity: {to: opacity}}, this.preanim(arguments, 1), null, .35, 'easeIn');
+            }
+            return this;
+        },
+
+        /**
+         * Gets the left X coordinate
+         * @param {Boolean} local True to get the local css position instead of page coordinate
+         * @return {Number}
+         */
+        getLeft : function(local){
+            if(!local){
+                return this.getX();
+            }else{
+                return parseInt(this.getStyle("left"), 10) || 0;
+            }
+        },
+
+        /**
+         * Gets the right X coordinate of the element (element X position + element width)
+         * @param {Boolean} local True to get the local css position instead of page coordinate
+         * @return {Number}
+         */
+        getRight : function(local){
+            if(!local){
+                return this.getX() + this.getWidth();
+            }else{
+                return (this.getLeft(true) + this.getWidth()) || 0;
+            }
+        },
+
+        /**
+         * Gets the top Y coordinate
+         * @param {Boolean} local True to get the local css position instead of page coordinate
+         * @return {Number}
+         */
+        getTop : function(local) {
+            if(!local){
+                return this.getY();
+            }else{
+                return parseInt(this.getStyle("top"), 10) || 0;
+            }
+        },
+
+        /**
+         * Gets the bottom Y coordinate of the element (element Y position + element height)
+         * @param {Boolean} local True to get the local css position instead of page coordinate
+         * @return {Number}
+         */
+        getBottom : function(local){
+            if(!local){
+                return this.getY() + this.getHeight();
+            }else{
+                return (this.getTop(true) + this.getHeight()) || 0;
+            }
+        },
+
+        /**
+        * Initializes positioning on this element. If a desired position is not passed, it will make the
+        * the element positioned relative IF it is not already positioned.
+        * @param {String} pos (optional) Positioning to use "relative", "absolute" or "fixed"
+        * @param {Number} zIndex (optional) The zIndex to apply
+        * @param {Number} x (optional) Set the page X position
+        * @param {Number} y (optional) Set the page Y position
+        */
+        position : function(pos, zIndex, x, y){
+            if(!pos){
+               if(this.getStyle('position') == 'static'){
+                   this.setStyle('position', 'relative');
+               }
+            }else{
+                this.setStyle("position", pos);
+            }
+            if(zIndex){
+                this.setStyle("z-index", zIndex);
+            }
+            if(x !== undefined && y !== undefined){
+                this.setXY([x, y]);
+            }else if(x !== undefined){
+                this.setX(x);
+            }else if(y !== undefined){
+                this.setY(y);
+            }
+        },
+
+        /**
+        * Clear positioning back to the default when the document was loaded
+        * @param {String} value (optional) The value to use for the left,right,top,bottom, defaults to '' (empty string). You could use 'auto'.
+        * @return {Roo.Element} this
+         */
+        clearPositioning : function(value){
+            value = value ||'';
+            this.setStyle({
+                "left": value,
+                "right": value,
+                "top": value,
+                "bottom": value,
+                "z-index": "",
+                "position" : "static"
+            });
+            return this;
+        },
+
+        /**
+        * Gets an object with all CSS positioning properties. Useful along with setPostioning to get
+        * snapshot before performing an update and then restoring the element.
+        * @return {Object}
+        */
+        getPositioning : function(){
+            var l = this.getStyle("left");
+            var t = this.getStyle("top");
+            return {
+                "position" : this.getStyle("position"),
+                "left" : l,
+                "right" : l ? "" : this.getStyle("right"),
+                "top" : t,
+                "bottom" : t ? "" : this.getStyle("bottom"),
+                "z-index" : this.getStyle("z-index")
+            };
+        },
+
+        /**
+         * Gets the width of the border(s) for the specified side(s)
+         * @param {String} side Can be t, l, r, b or any combination of those to add multiple values. For example,
+         * passing lr would get the border (l)eft width + the border (r)ight width.
+         * @return {Number} The width of the sides passed added together
+         */
+        getBorderWidth : function(side){
+            return this.addStyles(side, El.borders);
+        },
+
+        /**
+         * Gets the width of the padding(s) for the specified side(s)
+         * @param {String} side Can be t, l, r, b or any combination of those to add multiple values. For example,
+         * passing lr would get the padding (l)eft + the padding (r)ight.
+         * @return {Number} The padding of the sides passed added together
+         */
+        getPadding : function(side){
+            return this.addStyles(side, El.paddings);
+        },
+
+        /**
+        * Set positioning with an object returned by getPositioning().
+        * @param {Object} posCfg
+        * @return {Roo.Element} this
+         */
+        setPositioning : function(pc){
+            this.applyStyles(pc);
+            if(pc.right == "auto"){
+                this.dom.style.right = "";
+            }
+            if(pc.bottom == "auto"){
+                this.dom.style.bottom = "";
+            }
+            return this;
+        },
+
+        // private
+        fixDisplay : function(){
+            if(this.getStyle("display") == "none"){
+                this.setStyle("visibility", "hidden");
+                this.setStyle("display", this.originalDisplay); // first try reverting to default
+                if(this.getStyle("display") == "none"){ // if that fails, default to block
+                    this.setStyle("display", "block");
+                }
+            }
+        },
+
+        /**
+         * Quick set left and top adding default units
+         * @param {String} left The left CSS property value
+         * @param {String} top The top CSS property value
+         * @return {Roo.Element} this
+         */
+         setLeftTop : function(left, top){
+            this.dom.style.left = this.addUnits(left);
+            this.dom.style.top = this.addUnits(top);
+            return this;
+        },
+
+        /**
+         * Move this element relative to its current position.
+         * @param {String} direction Possible values are: "l","left" - "r","right" - "t","top","up" - "b","bottom","down".
+         * @param {Number} distance How far to move the element in pixels
+         * @param {Boolean/Object} animate (optional) true for the default animation or a standard Element animation config object
+         * @return {Roo.Element} this
+         */
+         move : function(direction, distance, animate){
+            var xy = this.getXY();
+            direction = direction.toLowerCase();
+            switch(direction){
+                case "l":
+                case "left":
+                    this.moveTo(xy[0]-distance, xy[1], this.preanim(arguments, 2));
+                    break;
+               case "r":
+               case "right":
+                    this.moveTo(xy[0]+distance, xy[1], this.preanim(arguments, 2));
+                    break;
+               case "t":
+               case "top":
+               case "up":
+                    this.moveTo(xy[0], xy[1]-distance, this.preanim(arguments, 2));
+                    break;
+               case "b":
+               case "bottom":
+               case "down":
+                    this.moveTo(xy[0], xy[1]+distance, this.preanim(arguments, 2));
+                    break;
+            }
+            return this;
+        },
+
+        /**
+         *  Store the current overflow setting and clip overflow on the element - use {@link #unclip} to remove
+         * @return {Roo.Element} this
+         */
+        clip : function(){
+            if(!this.isClipped){
+               this.isClipped = true;
+               this.originalClip = {
+                   "o": this.getStyle("overflow"),
+                   "x": this.getStyle("overflow-x"),
+                   "y": this.getStyle("overflow-y")
+               };
+               this.setStyle("overflow", "hidden");
+               this.setStyle("overflow-x", "hidden");
+               this.setStyle("overflow-y", "hidden");
+            }
+            return this;
+        },
+
+        /**
+         *  Return clipping (overflow) to original clipping before clip() was called
+         * @return {Roo.Element} this
+         */
+        unclip : function(){
+            if(this.isClipped){
+                this.isClipped = false;
+                var o = this.originalClip;
+                if(o.o){this.setStyle("overflow", o.o);}
+                if(o.x){this.setStyle("overflow-x", o.x);}
+                if(o.y){this.setStyle("overflow-y", o.y);}
+            }
+            return this;
+        },
+
+
+        /**
+         * Gets the x,y coordinates specified by the anchor position on the element.
+         * @param {String} anchor (optional) The specified anchor position (defaults to "c").  See {@link #alignTo} for details on supported anchor positions.
+         * @param {Object} size (optional) An object containing the size to use for calculating anchor position
+         *                       {width: (target width), height: (target height)} (defaults to the element's current size)
+         * @param {Boolean} local (optional) True to get the local (element top/left-relative) anchor position instead of page coordinates
+         * @return {Array} [x, y] An array containing the element's x and y coordinates
+         */
+        getAnchorXY : function(anchor, local, s){
+            //Passing a different size is useful for pre-calculating anchors,
+            //especially for anchored animations that change the el size.
+
+            var w, h, vp = false;
+            if(!s){
+                var d = this.dom;
+                if(d == document.body || d == document){
+                    vp = true;
+                    w = D.getViewWidth(); h = D.getViewHeight();
+                }else{
+                    w = this.getWidth(); h = this.getHeight();
+                }
+            }else{
+                w = s.width;  h = s.height;
+            }
+            var x = 0, y = 0, r = Math.round;
+            switch((anchor || "tl").toLowerCase()){
+                case "c":
+                    x = r(w*.5);
+                    y = r(h*.5);
+                break;
+                case "t":
+                    x = r(w*.5);
+                    y = 0;
+                break;
+                case "l":
+                    x = 0;
+                    y = r(h*.5);
+                break;
+                case "r":
+                    x = w;
+                    y = r(h*.5);
+                break;
+                case "b":
+                    x = r(w*.5);
+                    y = h;
+                break;
+                case "tl":
+                    x = 0;
+                    y = 0;
+                break;
+                case "bl":
+                    x = 0;
+                    y = h;
+                break;
+                case "br":
+                    x = w;
+                    y = h;
+                break;
+                case "tr":
+                    x = w;
+                    y = 0;
+                break;
+            }
+            if(local === true){
+                return [x, y];
+            }
+            if(vp){
+                var sc = this.getScroll();
+                return [x + sc.left, y + sc.top];
+            }
+            //Add the element's offset xy
+            var o = this.getXY();
+            return [x+o[0], y+o[1]];
+        },
+
+        /**
+         * Gets the x,y coordinates to align this element with another element. See {@link #alignTo} for more info on the
+         * supported position values.
+         * @param {String/HTMLElement/Roo.Element} element The element to align to.
+         * @param {String} position The position to align to.
+         * @param {Array} offsets (optional) Offset the positioning by [x, y]
+         * @return {Array} [x, y]
+         */
+        getAlignToXY : function(el, p, o){
+            el = Roo.get(el);
+            var d = this.dom;
+            if(!el.dom){
+                throw "Element.alignTo with an element that doesn't exist";
+            }
+            var c = false; //constrain to viewport
+            var p1 = "", p2 = "";
+            o = o || [0,0];
+
+            if(!p){
+                p = "tl-bl";
+            }else if(p == "?"){
+                p = "tl-bl?";
+            }else if(p.indexOf("-") == -1){
+                p = "tl-" + p;
+            }
+            p = p.toLowerCase();
+            var m = p.match(/^([a-z]+)-([a-z]+)(\?)?$/);
+            if(!m){
+               throw "Element.alignTo with an invalid alignment " + p;
+            }
+            p1 = m[1]; p2 = m[2]; c = !!m[3];
+
+            //Subtract the aligned el's internal xy from the target's offset xy
+            //plus custom offset to get the aligned el's new offset xy
+            var a1 = this.getAnchorXY(p1, true);
+            var a2 = el.getAnchorXY(p2, false);
+            var x = a2[0] - a1[0] + o[0];
+            var y = a2[1] - a1[1] + o[1];
+            if(c){
+                //constrain the aligned el to viewport if necessary
+                var w = this.getWidth(), h = this.getHeight(), r = el.getRegion();
+                // 5px of margin for ie
+                var dw = D.getViewWidth()-5, dh = D.getViewHeight()-5;
+
+                //If we are at a viewport boundary and the aligned el is anchored on a target border that is
+                //perpendicular to the vp border, allow the aligned el to slide on that border,
+                //otherwise swap the aligned el to the opposite border of the target.
+                var p1y = p1.charAt(0), p1x = p1.charAt(p1.length-1);
+               var p2y = p2.charAt(0), p2x = p2.charAt(p2.length-1);
+               var swapY = ((p1y=="t" && p2y=="b") || (p1y=="b" && p2y=="t"));
+               var swapX = ((p1x=="r" && p2x=="l") || (p1x=="l" && p2x=="r"));
+
+               var doc = document;
+               var scrollX = (doc.documentElement.scrollLeft || doc.body.scrollLeft || 0)+5;
+               var scrollY = (doc.documentElement.scrollTop || doc.body.scrollTop || 0)+5;
+
+               if((x+w) > dw + scrollX){
+                    x = swapX ? r.left-w : dw+scrollX-w;
+                }
+               if(x < scrollX){
+                   x = swapX ? r.right : scrollX;
+               }
+               if((y+h) > dh + scrollY){
+                    y = swapY ? r.top-h : dh+scrollY-h;
+                }
+               if (y < scrollY){
+                   y = swapY ? r.bottom : scrollY;
+               }
+            }
+            return [x,y];
+        },
+
+        // private
+        getConstrainToXY : function(){
+            var os = {top:0, left:0, bottom:0, right: 0};
+
+            return function(el, local, offsets, proposedXY){
+                el = Roo.get(el);
+                offsets = offsets ? Roo.applyIf(offsets, os) : os;
+
+                var vw, vh, vx = 0, vy = 0;
+                if(el.dom == document.body || el.dom == document){
+                    vw = Roo.lib.Dom.getViewWidth();
+                    vh = Roo.lib.Dom.getViewHeight();
+                }else{
+                    vw = el.dom.clientWidth;
+                    vh = el.dom.clientHeight;
+                    if(!local){
+                        var vxy = el.getXY();
+                        vx = vxy[0];
+                        vy = vxy[1];
+                    }
+                }
+
+                var s = el.getScroll();
+
+                vx += offsets.left + s.left;
+                vy += offsets.top + s.top;
+
+                vw -= offsets.right;
+                vh -= offsets.bottom;
+
+                var vr = vx+vw;
+                var vb = vy+vh;
+
+                var xy = proposedXY || (!local ? this.getXY() : [this.getLeft(true), this.getTop(true)]);
+                var x = xy[0], y = xy[1];
+                var w = this.dom.offsetWidth, h = this.dom.offsetHeight;
+
+                // only move it if it needs it
+                var moved = false;
+
+                // first validate right/bottom
+                if((x + w) > vr){
+                    x = vr - w;
+                    moved = true;
+                }
+                if((y + h) > vb){
+                    y = vb - h;
+                    moved = true;
+                }
+                // then make sure top/left isn't negative
+                if(x < vx){
+                    x = vx;
+                    moved = true;
+                }
+                if(y < vy){
+                    y = vy;
+                    moved = true;
+                }
+                return moved ? [x, y] : false;
+            };
+        }(),
+
+        // private
+        adjustForConstraints : function(xy, parent, offsets){
+            return this.getConstrainToXY(parent || document, false, offsets, xy) ||  xy;
+        },
+
+        /**
+         * Aligns this element with another element relative to the specified anchor points. If the other element is the
+         * document it aligns it to the viewport.
+         * The position parameter is optional, and can be specified in any one of the following formats:
+         * <ul>
+         *   <li><b>Blank</b>: Defaults to aligning the element's top-left corner to the target's bottom-left corner ("tl-bl").</li>
+         *   <li><b>One anchor (deprecated)</b>: The passed anchor position is used as the target element's anchor point.
+         *       The element being aligned will position its top-left corner (tl) to that point.  <i>This method has been
+         *       deprecated in favor of the newer two anchor syntax below</i>.</li>
+         *   <li><b>Two anchors</b>: If two values from the table below are passed separated by a dash, the first value is used as the
+         *       element's anchor point, and the second value is used as the target's anchor point.</li>
+         * </ul>
+         * In addition to the anchor points, the position parameter also supports the "?" character.  If "?" is passed at the end of
+         * the position string, the element will attempt to align as specified, but the position will be adjusted to constrain to
+         * the viewport if necessary.  Note that the element being aligned might be swapped to align to a different position than
+         * that specified in order to enforce the viewport constraints.
+         * Following are all of the supported anchor positions:
+    <pre>
+    Value  Description
+    -----  -----------------------------
+    tl     The top left corner (default)
+    t      The center of the top edge
+    tr     The top right corner
+    l      The center of the left edge
+    c      In the center of the element
+    r      The center of the right edge
+    bl     The bottom left corner
+    b      The center of the bottom edge
+    br     The bottom right corner
+    </pre>
+    Example Usage:
+    <pre><code>
+    // align el to other-el using the default positioning ("tl-bl", non-constrained)
+    el.alignTo("other-el");
+
+    // align the top left corner of el with the top right corner of other-el (constrained to viewport)
+    el.alignTo("other-el", "tr?");
+
+    // align the bottom right corner of el with the center left edge of other-el
+    el.alignTo("other-el", "br-l?");
+
+    // align the center of el with the bottom left corner of other-el and
+    // adjust the x position by -6 pixels (and the y position by 0)
+    el.alignTo("other-el", "c-bl", [-6, 0]);
+    </code></pre>
+         * @param {String/HTMLElement/Roo.Element} element The element to align to.
+         * @param {String} position The position to align to.
+         * @param {Array} offsets (optional) Offset the positioning by [x, y]
+         * @param {Boolean/Object} animate (optional) true for the default animation or a standard Element animation config object
+         * @return {Roo.Element} this
+         */
+        alignTo : function(element, position, offsets, animate){
+            var xy = this.getAlignToXY(element, position, offsets);
+            this.setXY(xy, this.preanim(arguments, 3));
+            return this;
+        },
+
+        /**
+         * Anchors an element to another element and realigns it when the window is resized.
+         * @param {String/HTMLElement/Roo.Element} element The element to align to.
+         * @param {String} position The position to align to.
+         * @param {Array} offsets (optional) Offset the positioning by [x, y]
+         * @param {Boolean/Object} animate (optional) True for the default animation or a standard Element animation config object
+         * @param {Boolean/Number} monitorScroll (optional) True to monitor body scroll and reposition. If this parameter
+         * is a number, it is used as the buffer delay (defaults to 50ms).
+         * @param {Function} callback The function to call after the animation finishes
+         * @return {Roo.Element} this
+         */
+        anchorTo : function(el, alignment, offsets, animate, monitorScroll, callback){
+            var action = function(){
+                this.alignTo(el, alignment, offsets, animate);
+                Roo.callback(callback, this);
+            };
+            Roo.EventManager.onWindowResize(action, this);
+            var tm = typeof monitorScroll;
+            if(tm != 'undefined'){
+                Roo.EventManager.on(window, 'scroll', action, this,
+                    {buffer: tm == 'number' ? monitorScroll : 50});
+            }
+            action.call(this); // align immediately
+            return this;
+        },
+        /**
+         * Clears any opacity settings from this element. Required in some cases for IE.
+         * @return {Roo.Element} this
+         */
+        clearOpacity : function(){
+            if (window.ActiveXObject) {
+                if(typeof this.dom.style.filter == 'string' && (/alpha/i).test(this.dom.style.filter)){
+                    this.dom.style.filter = "";
+                }
+            } else {
+                this.dom.style.opacity = "";
+                this.dom.style["-moz-opacity"] = "";
+                this.dom.style["-khtml-opacity"] = "";
+            }
+            return this;
+        },
+
+        /**
+         * Hide this element - Uses display mode to determine whether to use "display" or "visibility". See {@link #setVisible}.
+         * @param {Boolean/Object} animate (optional) true for the default animation or a standard Element animation config object
+         * @return {Roo.Element} this
+         */
+        hide : function(animate){
+            this.setVisible(false, this.preanim(arguments, 0));
+            return this;
+        },
+
+        /**
+        * Show this element - Uses display mode to determine whether to use "display" or "visibility". See {@link #setVisible}.
+        * @param {Boolean/Object} animate (optional) true for the default animation or a standard Element animation config object
+         * @return {Roo.Element} this
+         */
+        show : function(animate){
+            this.setVisible(true, this.preanim(arguments, 0));
+            return this;
+        },
+
+        /**
+         * @private Test if size has a unit, otherwise appends the default
+         */
+        addUnits : function(size){
+            return Roo.Element.addUnits(size, this.defaultUnit);
+        },
+
+        /**
+         * Temporarily enables offsets (width,height,x,y) for an element with display:none, use endMeasure() when done.
+         * @return {Roo.Element} this
+         */
+        beginMeasure : function(){
+            var el = this.dom;
+            if(el.offsetWidth || el.offsetHeight){
+                return this; // offsets work already
+            }
+            var changed = [];
+            var p = this.dom, b = document.body; // start with this element
+            while((!el.offsetWidth && !el.offsetHeight) && p && p.tagName && p != b){
+                var pe = Roo.get(p);
+                if(pe.getStyle('display') == 'none'){
+                    changed.push({el: p, visibility: pe.getStyle("visibility")});
+                    p.style.visibility = "hidden";
+                    p.style.display = "block";
+                }
+                p = p.parentNode;
+            }
+            this._measureChanged = changed;
+            return this;
+
+        },
+
+        /**
+         * Restores displays to before beginMeasure was called
+         * @return {Roo.Element} this
+         */
+        endMeasure : function(){
+            var changed = this._measureChanged;
+            if(changed){
+                for(var i = 0, len = changed.length; i < len; i++) {
+                    var r = changed[i];
+                    r.el.style.visibility = r.visibility;
+                    r.el.style.display = "none";
+                }
+                this._measureChanged = null;
+            }
+            return this;
+        },
+
+        /**
+        * Update the innerHTML of this element, optionally searching for and processing scripts
+        * @param {String} html The new HTML
+        * @param {Boolean} loadScripts (optional) true to look for and process scripts
+        * @param {Function} callback For async script loading you can be noticed when the update completes
+        * @return {Roo.Element} this
+         */
+        update : function(html, loadScripts, callback){
+            if(typeof html == "undefined"){
+                html = "";
+            }
+            if(loadScripts !== true){
+                this.dom.innerHTML = html;
+                if(typeof callback == "function"){
+                    callback();
+                }
+                return this;
+            }
+            var id = Roo.id();
+            var dom = this.dom;
+
+            html += '<span id="' + id + '"></span>';
+
+            E.onAvailable(id, function(){
+                var hd = document.getElementsByTagName("head")[0];
+                var re = /(?:<script([^>]*)?>)((\n|\r|.)*?)(?:<\/script>)/ig;
+                var srcRe = /\ssrc=([\'\"])(.*?)\1/i;
+                var typeRe = /\stype=([\'\"])(.*?)\1/i;
+
+                var match;
+                while(match = re.exec(html)){
+                    var attrs = match[1];
+                    var srcMatch = attrs ? attrs.match(srcRe) : false;
+                    if(srcMatch && srcMatch[2]){
+                       var s = document.createElement("script");
+                       s.src = srcMatch[2];
+                       var typeMatch = attrs.match(typeRe);
+                       if(typeMatch && typeMatch[2]){
+                           s.type = typeMatch[2];
+                       }
+                       hd.appendChild(s);
+                    }else if(match[2] && match[2].length > 0){
+                        if(window.execScript) {
+                           window.execScript(match[2]);
+                        } else {
+                            /**
+                             * eval:var:id
+                             * eval:var:dom
+                             * eval:var:html
+                             * 
+                             */
+                           window.eval(match[2]);
+                        }
+                    }
+                }
+                var el = document.getElementById(id);
+                if(el){el.parentNode.removeChild(el);}
+                if(typeof callback == "function"){
+                    callback();
+                }
+            });
+            dom.innerHTML = html.replace(/(?:<script.*?>)((\n|\r|.)*?)(?:<\/script>)/ig, "");
+            return this;
+        },
+
+        /**
+         * Direct access to the UpdateManager update() method (takes the same parameters).
+         * @param {String/Function} url The url for this request or a function to call to get the url
+         * @param {String/Object} params (optional) The parameters to pass as either a url encoded string "param1=1&amp;param2=2" or an object {param1: 1, param2: 2}
+         * @param {Function} callback (optional) Callback when transaction is complete - called with signature (oElement, bSuccess)
+         * @param {Boolean} discardUrl (optional) By default when you execute an update the defaultUrl is changed to the last used url. If true, it will not store the url.
+         * @return {Roo.Element} this
+         */
+        load : function(){
+            var um = this.getUpdateManager();
+            um.update.apply(um, arguments);
+            return this;
+        },
+
+        /**
+        * Gets this element's UpdateManager
+        * @return {Roo.UpdateManager} The UpdateManager
+        */
+        getUpdateManager : function(){
+            if(!this.updateManager){
+                this.updateManager = new Roo.UpdateManager(this);
+            }
+            return this.updateManager;
+        },
+
+        /**
+         * Disables text selection for this element (normalized across browsers)
+         * @return {Roo.Element} this
+         */
+        unselectable : function(){
+            this.dom.unselectable = "on";
+            this.swallowEvent("selectstart", true);
+            this.applyStyles("-moz-user-select:none;-khtml-user-select:none;");
+            this.addClass("x-unselectable");
+            return this;
+        },
+
+        /**
+        * Calculates the x, y to center this element on the screen
+        * @return {Array} The x, y values [x, y]
+        */
+        getCenterXY : function(){
+            return this.getAlignToXY(document, 'c-c');
+        },
+
+        /**
+        * Centers the Element in either the viewport, or another Element.
+        * @param {String/HTMLElement/Roo.Element} centerIn (optional) The element in which to center the element.
+        */
+        center : function(centerIn){
+            this.alignTo(centerIn || document, 'c-c');
+            return this;
+        },
+
+        /**
+         * Tests various css rules/browsers to determine if this element uses a border box
+         * @return {Boolean}
+         */
+        isBorderBox : function(){
+            return noBoxAdjust[this.dom.tagName.toLowerCase()] || Roo.isBorderBox;
+        },
+
+        /**
+         * Return a box {x, y, width, height} that can be used to set another elements
+         * size/location to match this element.
+         * @param {Boolean} contentBox (optional) If true a box for the content of the element is returned.
+         * @param {Boolean} local (optional) If true the element's left and top are returned instead of page x/y.
+         * @return {Object} box An object in the format {x, y, width, height}
+         */
+        getBox : function(contentBox, local){
+            var xy;
+            if(!local){
+                xy = this.getXY();
+            }else{
+                var left = parseInt(this.getStyle("left"), 10) || 0;
+                var top = parseInt(this.getStyle("top"), 10) || 0;
+                xy = [left, top];
+            }
+            var el = this.dom, w = el.offsetWidth, h = el.offsetHeight, bx;
+            if(!contentBox){
+                bx = {x: xy[0], y: xy[1], 0: xy[0], 1: xy[1], width: w, height: h};
+            }else{
+                var l = this.getBorderWidth("l")+this.getPadding("l");
+                var r = this.getBorderWidth("r")+this.getPadding("r");
+                var t = this.getBorderWidth("t")+this.getPadding("t");
+                var b = this.getBorderWidth("b")+this.getPadding("b");
+                bx = {x: xy[0]+l, y: xy[1]+t, 0: xy[0]+l, 1: xy[1]+t, width: w-(l+r), height: h-(t+b)};
+            }
+            bx.right = bx.x + bx.width;
+            bx.bottom = bx.y + bx.height;
+            return bx;
+        },
+
+        /**
+         * Returns the sum width of the padding and borders for the passed "sides". See getBorderWidth()
+         for more information about the sides.
+         * @param {String} sides
+         * @return {Number}
+         */
+        getFrameWidth : function(sides, onlyContentBox){
+            return onlyContentBox && Roo.isBorderBox ? 0 : (this.getPadding(sides) + this.getBorderWidth(sides));
+        },
+
+        /**
+         * Sets the element's box. Use getBox() on another element to get a box obj. If animate is true then width, height, x and y will be animated concurrently.
+         * @param {Object} box The box to fill {x, y, width, height}
+         * @param {Boolean} adjust (optional) Whether to adjust for box-model issues automatically
+         * @param {Boolean/Object} animate (optional) true for the default animation or a standard Element animation config object
+         * @return {Roo.Element} this
+         */
+        setBox : function(box, adjust, animate){
+            var w = box.width, h = box.height;
+            if((adjust && !this.autoBoxAdjust) && !this.isBorderBox()){
+               w -= (this.getBorderWidth("lr") + this.getPadding("lr"));
+               h -= (this.getBorderWidth("tb") + this.getPadding("tb"));
+            }
+            this.setBounds(box.x, box.y, w, h, this.preanim(arguments, 2));
+            return this;
+        },
+
+        /**
+         * Forces the browser to repaint this element
+         * @return {Roo.Element} this
+         */
+         repaint : function(){
+            var dom = this.dom;
+            this.addClass("x-repaint");
+            setTimeout(function(){
+                Roo.get(dom).removeClass("x-repaint");
+            }, 1);
+            return this;
+        },
+
+        /**
+         * Returns an object with properties top, left, right and bottom representing the margins of this element unless sides is passed,
+         * then it returns the calculated width of the sides (see getPadding)
+         * @param {String} sides (optional) Any combination of l, r, t, b to get the sum of those sides
+         * @return {Object/Number}
+         */
+        getMargins : function(side){
+            if(!side){
+                return {
+                    top: parseInt(this.getStyle("margin-top"), 10) || 0,
+                    left: parseInt(this.getStyle("margin-left"), 10) || 0,
+                    bottom: parseInt(this.getStyle("margin-bottom"), 10) || 0,
+                    right: parseInt(this.getStyle("margin-right"), 10) || 0
+                };
+            }else{
+                return this.addStyles(side, El.margins);
+             }
+        },
+
+        // private
+        addStyles : function(sides, styles){
+            var val = 0, v, w;
+            for(var i = 0, len = sides.length; i < len; i++){
+                v = this.getStyle(styles[sides.charAt(i)]);
+                if(v){
+                     w = parseInt(v, 10);
+                     if(w){ val += w; }
+                }
+            }
+            return val;
+        },
+
+        /**
+         * Creates a proxy element of this element
+         * @param {String/Object} config The class name of the proxy element or a DomHelper config object
+         * @param {String/HTMLElement} renderTo (optional) The element or element id to render the proxy to (defaults to document.body)
+         * @param {Boolean} matchBox (optional) True to align and size the proxy to this element now (defaults to false)
+         * @return {Roo.Element} The new proxy element
+         */
+        createProxy : function(config, renderTo, matchBox){
+            if(renderTo){
+                renderTo = Roo.getDom(renderTo);
+            }else{
+                renderTo = document.body;
+            }
+            config = typeof config == "object" ?
+                config : {tag : "div", cls: config};
+            var proxy = Roo.DomHelper.append(renderTo, config, true);
+            if(matchBox){
+               proxy.setBox(this.getBox());
+            }
+            return proxy;
+        },
+
+        /**
+         * Puts a mask over this element to disable user interaction. Requires core.css.
+         * This method can only be applied to elements which accept child nodes.
+         * @param {String} msg (optional) A message to display in the mask
+         * @param {String} msgCls (optional) A css class to apply to the msg element
+         * @return {Element} The mask  element
+         */
+        mask : function(msg, msgCls){
+            if(this.getStyle("position") == "static"){
+                this.setStyle("position", "relative");
+            }
+            if(!this._mask){
+                this._mask = Roo.DomHelper.append(this.dom, {cls:"roo-el-mask"}, true);
+            }
+            this.addClass("x-masked");
+            this._mask.setDisplayed(true);
+            if(typeof msg == 'string'){
+                if(!this._maskMsg){
+                    this._maskMsg = Roo.DomHelper.append(this.dom, {cls:"roo-el-mask-msg", cn:{tag:'div'}}, true);
+                }
+                var mm = this._maskMsg;
+                mm.dom.className = msgCls ? "roo-el-mask-msg " + msgCls : "roo-el-mask-msg";
+                mm.dom.firstChild.innerHTML = msg;
+                mm.setDisplayed(true);
+                mm.center(this);
+            }
+            if(Roo.isIE && !(Roo.isIE7 && Roo.isStrict) && this.getStyle('height') == 'auto'){ // ie will not expand full height automatically
+                this._mask.setHeight(this.getHeight());
+            }
+            return this._mask;
+        },
+
+        /**
+         * Removes a previously applied mask. If removeEl is true the mask overlay is destroyed, otherwise
+         * it is cached for reuse.
+         */
+        unmask : function(removeEl){
+            if(this._mask){
+                if(removeEl === true){
+                    this._mask.remove();
+                    delete this._mask;
+                    if(this._maskMsg){
+                        this._maskMsg.remove();
+                        delete this._maskMsg;
+                    }
+                }else{
+                    this._mask.setDisplayed(false);
+                    if(this._maskMsg){
+                        this._maskMsg.setDisplayed(false);
+                    }
+                }
+            }
+            this.removeClass("x-masked");
+        },
+
+        /**
+         * Returns true if this element is masked
+         * @return {Boolean}
+         */
+        isMasked : function(){
+            return this._mask && this._mask.isVisible();
+        },
+
+        /**
+         * Creates an iframe shim for this element to keep selects and other windowed objects from
+         * showing through.
+         * @return {Roo.Element} The new shim element
+         */
+        createShim : function(){
+            var el = document.createElement('iframe');
+            el.frameBorder = 'no';
+            el.className = 'roo-shim';
+            if(Roo.isIE && Roo.isSecure){
+                el.src = Roo.SSL_SECURE_URL;
+            }
+            var shim = Roo.get(this.dom.parentNode.insertBefore(el, this.dom));
+            shim.autoBoxAdjust = false;
+            return shim;
+        },
+
+        /**
+         * Removes this element from the DOM and deletes it from the cache
+         */
+        remove : function(){
+            if(this.dom.parentNode){
+                this.dom.parentNode.removeChild(this.dom);
+            }
+            delete El.cache[this.dom.id];
+        },
+
+        /**
+         * Sets up event handlers to add and remove a css class when the mouse is over this element
+         * @param {String} className
+         * @param {Boolean} preventFlicker (optional) If set to true, it prevents flickering by filtering
+         * mouseout events for children elements
+         * @return {Roo.Element} this
+         */
+        addClassOnOver : function(className, preventFlicker){
+            this.on("mouseover", function(){
+                Roo.fly(this, '_internal').addClass(className);
+            }, this.dom);
+            var removeFn = function(e){
+                if(preventFlicker !== true || !e.within(this, true)){
+                    Roo.fly(this, '_internal').removeClass(className);
+                }
+            };
+            this.on("mouseout", removeFn, this.dom);
+            return this;
+        },
+
+        /**
+         * Sets up event handlers to add and remove a css class when this element has the focus
+         * @param {String} className
+         * @return {Roo.Element} this
+         */
+        addClassOnFocus : function(className){
+            this.on("focus", function(){
+                Roo.fly(this, '_internal').addClass(className);
+            }, this.dom);
+            this.on("blur", function(){
+                Roo.fly(this, '_internal').removeClass(className);
+            }, this.dom);
+            return this;
+        },
+        /**
+         * Sets up event handlers to add and remove a css class when the mouse is down and then up on this element (a click effect)
+         * @param {String} className
+         * @return {Roo.Element} this
+         */
+        addClassOnClick : function(className){
+            var dom = this.dom;
+            this.on("mousedown", function(){
+                Roo.fly(dom, '_internal').addClass(className);
+                var d = Roo.get(document);
+                var fn = function(){
+                    Roo.fly(dom, '_internal').removeClass(className);
+                    d.removeListener("mouseup", fn);
+                };
+                d.on("mouseup", fn);
+            });
+            return this;
+        },
+
+        /**
+         * Stops the specified event from bubbling and optionally prevents the default action
+         * @param {String} eventName
+         * @param {Boolean} preventDefault (optional) true to prevent the default action too
+         * @return {Roo.Element} this
+         */
+        swallowEvent : function(eventName, preventDefault){
+            var fn = function(e){
+                e.stopPropagation();
+                if(preventDefault){
+                    e.preventDefault();
+                }
+            };
+            if(eventName instanceof Array){
+                for(var i = 0, len = eventName.length; i < len; i++){
+                     this.on(eventName[i], fn);
+                }
+                return this;
+            }
+            this.on(eventName, fn);
+            return this;
+        },
+
+        /**
+         * @private
+         */
+      fitToParentDelegate : Roo.emptyFn, // keep a reference to the fitToParent delegate
+
+        /**
+         * Sizes this element to its parent element's dimensions performing
+         * neccessary box adjustments.
+         * @param {Boolean} monitorResize (optional) If true maintains the fit when the browser window is resized.
+         * @param {String/HTMLElment/Element} targetParent (optional) The target parent, default to the parentNode.
+         * @return {Roo.Element} this
+         */
+        fitToParent : function(monitorResize, targetParent) {
+          Roo.EventManager.removeResizeListener(this.fitToParentDelegate); // always remove previous fitToParent delegate from onWindowResize
+          this.fitToParentDelegate = Roo.emptyFn; // remove reference to previous delegate
+          if (monitorResize === true && !this.dom.parentNode) { // check if this Element still exists
+            return;
+          }
+          var p = Roo.get(targetParent || this.dom.parentNode);
+          this.setSize(p.getComputedWidth() - p.getFrameWidth('lr'), p.getComputedHeight() - p.getFrameWidth('tb'));
+          if (monitorResize === true) {
+            this.fitToParentDelegate = this.fitToParent.createDelegate(this, [true, targetParent]);
+            Roo.EventManager.onWindowResize(this.fitToParentDelegate);
+          }
+          return this;
+        },
+
+        /**
+         * Gets the next sibling, skipping text nodes
+         * @return {HTMLElement} The next sibling or null
+         */
+        getNextSibling : function(){
+            var n = this.dom.nextSibling;
+            while(n && n.nodeType != 1){
+                n = n.nextSibling;
+            }
+            return n;
+        },
+
+        /**
+         * Gets the previous sibling, skipping text nodes
+         * @return {HTMLElement} The previous sibling or null
+         */
+        getPrevSibling : function(){
+            var n = this.dom.previousSibling;
+            while(n && n.nodeType != 1){
+                n = n.previousSibling;
+            }
+            return n;
+        },
+
+
+        /**
+         * Appends the passed element(s) to this element
+         * @param {String/HTMLElement/Array/Element/CompositeElement} el
+         * @return {Roo.Element} this
+         */
+        appendChild: function(el){
+            el = Roo.get(el);
+            el.appendTo(this);
+            return this;
+        },
+
+        /**
+         * Creates the passed DomHelper config and appends it to this element or optionally inserts it before the passed child element.
+         * @param {Object} config DomHelper element config object.  If no tag is specified (e.g., {tag:'input'}) then a div will be
+         * automatically generated with the specified attributes.
+         * @param {HTMLElement} insertBefore (optional) a child element of this element
+         * @param {Boolean} returnDom (optional) true to return the dom node instead of creating an Element
+         * @return {Roo.Element} The new child element
+         */
+        createChild: function(config, insertBefore, returnDom){
+            config = config || {tag:'div'};
+            if(insertBefore){
+                return Roo.DomHelper.insertBefore(insertBefore, config, returnDom !== true);
+            }
+            return Roo.DomHelper[!this.dom.firstChild ? 'overwrite' : 'append'](this.dom, config,  returnDom !== true);
+        },
+
+        /**
+         * Appends this element to the passed element
+         * @param {String/HTMLElement/Element} el The new parent element
+         * @return {Roo.Element} this
+         */
+        appendTo: function(el){
+            el = Roo.getDom(el);
+            el.appendChild(this.dom);
+            return this;
+        },
+
+        /**
+         * Inserts this element before the passed element in the DOM
+         * @param {String/HTMLElement/Element} el The element to insert before
+         * @return {Roo.Element} this
+         */
+        insertBefore: function(el){
+            el = Roo.getDom(el);
+            el.parentNode.insertBefore(this.dom, el);
+            return this;
+        },
+
+        /**
+         * Inserts this element after the passed element in the DOM
+         * @param {String/HTMLElement/Element} el The element to insert after
+         * @return {Roo.Element} this
+         */
+        insertAfter: function(el){
+            el = Roo.getDom(el);
+            el.parentNode.insertBefore(this.dom, el.nextSibling);
+            return this;
+        },
+
+        /**
+         * Inserts (or creates) an element (or DomHelper config) as the first child of the this element
+         * @param {String/HTMLElement/Element/Object} el The id or element to insert or a DomHelper config to create and insert
+         * @return {Roo.Element} The new child
+         */
+        insertFirst: function(el, returnDom){
+            el = el || {};
+            if(typeof el == 'object' && !el.nodeType){ // dh config
+                return this.createChild(el, this.dom.firstChild, returnDom);
+            }else{
+                el = Roo.getDom(el);
+                this.dom.insertBefore(el, this.dom.firstChild);
+                return !returnDom ? Roo.get(el) : el;
+            }
+        },
+
+        /**
+         * Inserts (or creates) the passed element (or DomHelper config) as a sibling of this element
+         * @param {String/HTMLElement/Element/Object} el The id or element to insert or a DomHelper config to create and insert
+         * @param {String} where (optional) 'before' or 'after' defaults to before
+         * @param {Boolean} returnDom (optional) True to return the raw DOM element instead of Roo.Element
+         * @return {Roo.Element} the inserted Element
+         */
+        insertSibling: function(el, where, returnDom){
+            where = where ? where.toLowerCase() : 'before';
+            el = el || {};
+            var rt, refNode = where == 'before' ? this.dom : this.dom.nextSibling;
+
+            if(typeof el == 'object' && !el.nodeType){ // dh config
+                if(where == 'after' && !this.dom.nextSibling){
+                    rt = Roo.DomHelper.append(this.dom.parentNode, el, !returnDom);
+                }else{
+                    rt = Roo.DomHelper[where == 'after' ? 'insertAfter' : 'insertBefore'](this.dom, el, !returnDom);
+                }
+
+            }else{
+                rt = this.dom.parentNode.insertBefore(Roo.getDom(el),
+                            where == 'before' ? this.dom : this.dom.nextSibling);
+                if(!returnDom){
+                    rt = Roo.get(rt);
+                }
+            }
+            return rt;
+        },
+
+        /**
+         * Creates and wraps this element with another element
+         * @param {Object} config (optional) DomHelper element config object for the wrapper element or null for an empty div
+         * @param {Boolean} returnDom (optional) True to return the raw DOM element instead of Roo.Element
+         * @return {HTMLElement/Element} The newly created wrapper element
+         */
+        wrap: function(config, returnDom){
+            if(!config){
+                config = {tag: "div"};
+            }
+            var newEl = Roo.DomHelper.insertBefore(this.dom, config, !returnDom);
+            newEl.dom ? newEl.dom.appendChild(this.dom) : newEl.appendChild(this.dom);
+            return newEl;
+        },
+
+        /**
+         * Replaces the passed element with this element
+         * @param {String/HTMLElement/Element} el The element to replace
+         * @return {Roo.Element} this
+         */
+        replace: function(el){
+            el = Roo.get(el);
+            this.insertBefore(el);
+            el.remove();
+            return this;
+        },
+
+        /**
+         * Inserts an html fragment into this element
+         * @param {String} where Where to insert the html in relation to the this element - beforeBegin, afterBegin, beforeEnd, afterEnd.
+         * @param {String} html The HTML fragment
+         * @param {Boolean} returnEl True to return an Roo.Element
+         * @return {HTMLElement/Roo.Element} The inserted node (or nearest related if more than 1 inserted)
+         */
+        insertHtml : function(where, html, returnEl){
+            var el = Roo.DomHelper.insertHtml(where, this.dom, html);
+            return returnEl ? Roo.get(el) : el;
+        },
+
+        /**
+         * Sets the passed attributes as attributes of this element (a style attribute can be a string, object or function)
+         * @param {Object} o The object with the attributes
+         * @param {Boolean} useSet (optional) false to override the default setAttribute to use expandos.
+         * @return {Roo.Element} this
+         */
+        set : function(o, useSet){
+            var el = this.dom;
+            useSet = typeof useSet == 'undefined' ? (el.setAttribute ? true : false) : useSet;
+            for(var attr in o){
+                if(attr == "style" || typeof o[attr] == "function") continue;
+                if(attr=="cls"){
+                    el.className = o["cls"];
+                }else{
+                    if(useSet) el.setAttribute(attr, o[attr]);
+                    else el[attr] = o[attr];
+                }
+            }
+            if(o.style){
+                Roo.DomHelper.applyStyles(el, o.style);
+            }
+            return this;
+        },
+
+        /**
+         * Convenience method for constructing a KeyMap
+         * @param {Number/Array/Object/String} key Either a string with the keys to listen for, the numeric key code, array of key codes or an object with the following options:
+         *                                  {key: (number or array), shift: (true/false), ctrl: (true/false), alt: (true/false)}
+         * @param {Function} fn The function to call
+         * @param {Object} scope (optional) The scope of the function
+         * @return {Roo.KeyMap} The KeyMap created
+         */
+        addKeyListener : function(key, fn, scope){
+            var config;
+            if(typeof key != "object" || key instanceof Array){
+                config = {
+                    key: key,
+                    fn: fn,
+                    scope: scope
+                };
+            }else{
+                config = {
+                    key : key.key,
+                    shift : key.shift,
+                    ctrl : key.ctrl,
+                    alt : key.alt,
+                    fn: fn,
+                    scope: scope
+                };
+            }
+            return new Roo.KeyMap(this, config);
+        },
+
+        /**
+         * Creates a KeyMap for this element
+         * @param {Object} config The KeyMap config. See {@link Roo.KeyMap} for more details
+         * @return {Roo.KeyMap} The KeyMap created
+         */
+        addKeyMap : function(config){
+            return new Roo.KeyMap(this, config);
+        },
+
+        /**
+         * Returns true if this element is scrollable.
+         * @return {Boolean}
+         */
+         isScrollable : function(){
+            var dom = this.dom;
+            return dom.scrollHeight > dom.clientHeight || dom.scrollWidth > dom.clientWidth;
+        },
+
+        /**
+         * Scrolls this element the specified scroll point. It does NOT do bounds checking so if you scroll to a weird value it will try to do it. For auto bounds checking, use scroll().
+         * @param {String} side Either "left" for scrollLeft values or "top" for scrollTop values.
+         * @param {Number} value The new scroll value
+         * @param {Boolean/Object} animate (optional) true for the default animation or a standard Element animation config object
+         * @return {Element} this
+         */
+
+        scrollTo : function(side, value, animate){
+            var prop = side.toLowerCase() == "left" ? "scrollLeft" : "scrollTop";
+            if(!animate || !A){
+                this.dom[prop] = value;
+            }else{
+                var to = prop == "scrollLeft" ? [value, this.dom.scrollTop] : [this.dom.scrollLeft, value];
+                this.anim({scroll: {"to": to}}, this.preanim(arguments, 2), 'scroll');
+            }
+            return this;
+        },
+
+        /**
+         * Scrolls this element the specified direction. Does bounds checking to make sure the scroll is
+         * within this element's scrollable range.
+         * @param {String} direction Possible values are: "l","left" - "r","right" - "t","top","up" - "b","bottom","down".
+         * @param {Number} distance How far to scroll the element in pixels
+         * @param {Boolean/Object} animate (optional) true for the default animation or a standard Element animation config object
+         * @return {Boolean} Returns true if a scroll was triggered or false if the element
+         * was scrolled as far as it could go.
+         */
+         scroll : function(direction, distance, animate){
+             if(!this.isScrollable()){
+                 return;
+             }
+             var el = this.dom;
+             var l = el.scrollLeft, t = el.scrollTop;
+             var w = el.scrollWidth, h = el.scrollHeight;
+             var cw = el.clientWidth, ch = el.clientHeight;
+             direction = direction.toLowerCase();
+             var scrolled = false;
+             var a = this.preanim(arguments, 2);
+             switch(direction){
+                 case "l":
+                 case "left":
+                     if(w - l > cw){
+                         var v = Math.min(l + distance, w-cw);
+                         this.scrollTo("left", v, a);
+                         scrolled = true;
+                     }
+                     break;
+                case "r":
+                case "right":
+                     if(l > 0){
+                         var v = Math.max(l - distance, 0);
+                         this.scrollTo("left", v, a);
+                         scrolled = true;
+                     }
+                     break;
+                case "t":
+                case "top":
+                case "up":
+                     if(t > 0){
+                         var v = Math.max(t - distance, 0);
+                         this.scrollTo("top", v, a);
+                         scrolled = true;
+                     }
+                     break;
+                case "b":
+                case "bottom":
+                case "down":
+                     if(h - t > ch){
+                         var v = Math.min(t + distance, h-ch);
+                         this.scrollTo("top", v, a);
+                         scrolled = true;
+                     }
+                     break;
+             }
+             return scrolled;
+        },
+
+        /**
+         * Translates the passed page coordinates into left/top css values for this element
+         * @param {Number/Array} x The page x or an array containing [x, y]
+         * @param {Number} y The page y
+         * @return {Object} An object with left and top properties. e.g. {left: (value), top: (value)}
+         */
+        translatePoints : function(x, y){
+            if(typeof x == 'object' || x instanceof Array){
+                y = x[1]; x = x[0];
+            }
+            var p = this.getStyle('position');
+            var o = this.getXY();
+
+            var l = parseInt(this.getStyle('left'), 10);
+            var t = parseInt(this.getStyle('top'), 10);
+
+            if(isNaN(l)){
+                l = (p == "relative") ? 0 : this.dom.offsetLeft;
+            }
+            if(isNaN(t)){
+                t = (p == "relative") ? 0 : this.dom.offsetTop;
+            }
+
+            return {left: (x - o[0] + l), top: (y - o[1] + t)};
+        },
+
+        /**
+         * Returns the current scroll position of the element.
+         * @return {Object} An object containing the scroll position in the format {left: (scrollLeft), top: (scrollTop)}
+         */
+        getScroll : function(){
+            var d = this.dom, doc = document;
+            if(d == doc || d == doc.body){
+                var l = window.pageXOffset || doc.documentElement.scrollLeft || doc.body.scrollLeft || 0;
+                var t = window.pageYOffset || doc.documentElement.scrollTop || doc.body.scrollTop || 0;
+                return {left: l, top: t};
+            }else{
+                return {left: d.scrollLeft, top: d.scrollTop};
+            }
+        },
+
+        /**
+         * Return the CSS color for the specified CSS attribute. rgb, 3 digit (like #fff) and valid values
+         * are convert to standard 6 digit hex color.
+         * @param {String} attr The css attribute
+         * @param {String} defaultValue The default value to use when a valid color isn't found
+         * @param {String} prefix (optional) defaults to #. Use an empty string when working with
+         * YUI color anims.
+         */
+        getColor : function(attr, defaultValue, prefix){
+            var v = this.getStyle(attr);
+            if(!v || v == "transparent" || v == "inherit") {
+                return defaultValue;
+            }
+            var color = typeof prefix == "undefined" ? "#" : prefix;
+            if(v.substr(0, 4) == "rgb("){
+                var rvs = v.slice(4, v.length -1).split(",");
+                for(var i = 0; i < 3; i++){
+                    var h = parseInt(rvs[i]).toString(16);
+                    if(h < 16){
+                        h = "0" + h;
+                    }
+                    color += h;
+                }
+            } else {
+                if(v.substr(0, 1) == "#"){
+                    if(v.length == 4) {
+                        for(var i = 1; i < 4; i++){
+                            var c = v.charAt(i);
+                            color +=  c + c;
+                        }
+                    }else if(v.length == 7){
+                        color += v.substr(1);
+                    }
+                }
+            }
+            return(color.length > 5 ? color.toLowerCase() : defaultValue);
+        },
+
+        /**
+         * Wraps the specified element with a special markup/CSS block that renders by default as a gray container with a
+         * gradient background, rounded corners and a 4-way shadow.
+         * @param {String} class (optional) A base CSS class to apply to the containing wrapper element (defaults to 'x-box').
+         * Note that there are a number of CSS rules that are dependent on this name to make the overall effect work,
+         * so if you supply an alternate base class, make sure you also supply all of the necessary rules.
+         * @return {Roo.Element} this
+         */
+        boxWrap : function(cls){
+            cls = cls || 'x-box';
+            var el = Roo.get(this.insertHtml('beforeBegin', String.format('<div class="{0}">'+El.boxMarkup+'</div>', cls)));
+            el.child('.'+cls+'-mc').dom.appendChild(this.dom);
+            return el;
+        },
+
+        /**
+         * Returns the value of a namespaced attribute from the element's underlying DOM node.
+         * @param {String} namespace The namespace in which to look for the attribute
+         * @param {String} name The attribute name
+         * @return {String} The attribute value
+         */
+        getAttributeNS : Roo.isIE ? function(ns, name){
+            var d = this.dom;
+            var type = typeof d[ns+":"+name];
+            if(type != 'undefined' && type != 'unknown'){
+                return d[ns+":"+name];
+            }
+            return d[name];
+        } : function(ns, name){
+            var d = this.dom;
+            return d.getAttributeNS(ns, name) || d.getAttribute(ns+":"+name) || d.getAttribute(name) || d[name];
+        }
+    };
+
+    var ep = El.prototype;
+
+    /**
+     * Appends an event handler (Shorthand for addListener)
+     * @param {String}   eventName     The type of event to append
+     * @param {Function} fn        The method the event invokes
+     * @param {Object} scope       (optional) The scope (this object) of the fn
+     * @param {Object}   options   (optional)An object with standard {@link Roo.EventManager#addListener} options
+     * @method
+     */
+    ep.on = ep.addListener;
+        // backwards compat
+    ep.mon = ep.addListener;
+
+    /**
+     * Removes an event handler from this element (shorthand for removeListener)
+     * @param {String} eventName the type of event to remove
+     * @param {Function} fn the method the event invokes
+     * @return {Roo.Element} this
+     * @method
+     */
+    ep.un = ep.removeListener;
+
+    /**
+     * true to automatically adjust width and height settings for box-model issues (default to true)
+     */
+    ep.autoBoxAdjust = true;
+
+    // private
+    El.unitPattern = /\d+(px|em|%|en|ex|pt|in|cm|mm|pc)$/i;
+
+    // private
+    El.addUnits = function(v, defaultUnit){
+        if(v === "" || v == "auto"){
+            return v;
+        }
+        if(v === undefined){
+            return '';
+        }
+        if(typeof v == "number" || !El.unitPattern.test(v)){
+            return v + (defaultUnit || 'px');
+        }
+        return v;
+    };
+
+    // special markup used throughout Roo when box wrapping elements
+    El.boxMarkup = '<div class="{0}-tl"><div class="{0}-tr"><div class="{0}-tc"></div></div></div><div class="{0}-ml"><div class="{0}-mr"><div class="{0}-mc"></div></div></div><div class="{0}-bl"><div class="{0}-br"><div class="{0}-bc"></div></div></div>';
+    /**
+     * Visibility mode constant - Use visibility to hide element
+     * @static
+     * @type Number
+     */
+    El.VISIBILITY = 1;
+    /**
+     * Visibility mode constant - Use display to hide element
+     * @static
+     * @type Number
+     */
+    El.DISPLAY = 2;
+
+    El.borders = {l: "border-left-width", r: "border-right-width", t: "border-top-width", b: "border-bottom-width"};
+    El.paddings = {l: "padding-left", r: "padding-right", t: "padding-top", b: "padding-bottom"};
+    El.margins = {l: "margin-left", r: "margin-right", t: "margin-top", b: "margin-bottom"};
+
+
+
+    /**
+     * @private
+     */
+    El.cache = {};
+
+    var docEl;
+
+    /**
+     * Static method to retrieve Element objects. Uses simple caching to consistently return the same object.
+     * Automatically fixes if an object was recreated with the same id via AJAX or DOM.
+     * @param {String/HTMLElement/Element} el The id of the node, a DOM Node or an existing Element.
+     * @return {Element} The Element object
+     * @static
+     */
+    El.get = function(el){
+        var ex, elm, id;
+        if(!el){ return null; }
+        if(typeof el == "string"){ // element id
+            if(!(elm = document.getElementById(el))){
+                return null;
+            }
+            if(ex = El.cache[el]){
+                ex.dom = elm;
+            }else{
+                ex = El.cache[el] = new El(elm);
+            }
+            return ex;
+        }else if(el.tagName){ // dom element
+            if(!(id = el.id)){
+                id = Roo.id(el);
+            }
+            if(ex = El.cache[id]){
+                ex.dom = el;
+            }else{
+                ex = El.cache[id] = new El(el);
+            }
+            return ex;
+        }else if(el instanceof El){
+            if(el != docEl){
+                el.dom = document.getElementById(el.id) || el.dom; // refresh dom element in case no longer valid,
+                                                              // catch case where it hasn't been appended
+                El.cache[el.id] = el; // in case it was created directly with Element(), let's cache it
+            }
+            return el;
+        }else if(el.isComposite){
+            return el;
+        }else if(el instanceof Array){
+            return El.select(el);
+        }else if(el == document){
+            // create a bogus element object representing the document object
+            if(!docEl){
+                var f = function(){};
+                f.prototype = El.prototype;
+                docEl = new f();
+                docEl.dom = document;
+            }
+            return docEl;
+        }
+        return null;
+    };
+
+    // private
+    El.uncache = function(el){
+        for(var i = 0, a = arguments, len = a.length; i < len; i++) {
+            if(a[i]){
+                delete El.cache[a[i].id || a[i]];
+            }
+        }
+    };
+
+    // private
+    // Garbage collection - uncache elements/purge listeners on orphaned elements
+    // so we don't hold a reference and cause the browser to retain them
+    El.garbageCollect = function(){
+        if(!Roo.enableGarbageCollector){
+            clearInterval(El.collectorThread);
+            return;
+        }
+        for(var eid in El.cache){
+            var el = El.cache[eid], d = el.dom;
+            // -------------------------------------------------------
+            // Determining what is garbage:
+            // -------------------------------------------------------
+            // !d
+            // dom node is null, definitely garbage
+            // -------------------------------------------------------
+            // !d.parentNode
+            // no parentNode == direct orphan, definitely garbage
+            // -------------------------------------------------------
+            // !d.offsetParent && !document.getElementById(eid)
+            // display none elements have no offsetParent so we will
+            // also try to look it up by it's id. However, check
+            // offsetParent first so we don't do unneeded lookups.
+            // This enables collection of elements that are not orphans
+            // directly, but somewhere up the line they have an orphan
+            // parent.
+            // -------------------------------------------------------
+            if(!d || !d.parentNode || (!d.offsetParent && !document.getElementById(eid))){
+                delete El.cache[eid];
+                if(d && Roo.enableListenerCollection){
+                    E.purgeElement(d);
+                }
+            }
+        }
+    }
+    El.collectorThreadId = setInterval(El.garbageCollect, 30000);
+
+
+    // dom is optional
+    El.Flyweight = function(dom){
+        this.dom = dom;
+    };
+    El.Flyweight.prototype = El.prototype;
+
+    El._flyweights = {};
+    /**
+     * Gets the globally shared flyweight Element, with the passed node as the active element. Do not store a reference to this element -
+     * the dom node can be overwritten by other code.
+     * @param {String/HTMLElement} el The dom node or id
+     * @param {String} named (optional) Allows for creation of named reusable flyweights to
+     *                                  prevent conflicts (e.g. internally Roo uses "_internal")
+     * @static
+     * @return {Element} The shared Element object
+     */
+    El.fly = function(el, named){
+        named = named || '_global';
+        el = Roo.getDom(el);
+        if(!el){
+            return null;
+        }
+        if(!El._flyweights[named]){
+            El._flyweights[named] = new El.Flyweight();
+        }
+        El._flyweights[named].dom = el;
+        return El._flyweights[named];
+    };
+
+    /**
+     * Static method to retrieve Element objects. Uses simple caching to consistently return the same object.
+     * Automatically fixes if an object was recreated with the same id via AJAX or DOM.
+     * Shorthand of {@link Roo.Element#get}
+     * @param {String/HTMLElement/Element} el The id of the node, a DOM Node or an existing Element.
+     * @return {Element} The Element object
+     * @member Roo
+     * @method get
+     */
+    Roo.get = El.get;
+    /**
+     * Gets the globally shared flyweight Element, with the passed node as the active element. Do not store a reference to this element -
+     * the dom node can be overwritten by other code.
+     * Shorthand of {@link Roo.Element#fly}
+     * @param {String/HTMLElement} el The dom node or id
+     * @param {String} named (optional) Allows for creation of named reusable flyweights to
+     *                                  prevent conflicts (e.g. internally Roo uses "_internal")
+     * @static
+     * @return {Element} The shared Element object
+     * @member Roo
+     * @method fly
+     */
+    Roo.fly = El.fly;
+
+    // speedy lookup for elements never to box adjust
+    var noBoxAdjust = Roo.isStrict ? {
+        select:1
+    } : {
+        input:1, select:1, textarea:1
+    };
+    if(Roo.isIE || Roo.isGecko){
+        noBoxAdjust['button'] = 1;
+    }
+
+
+    Roo.EventManager.on(window, 'unload', function(){
+        delete El.cache;
+        delete El._flyweights;
+    });
+})();
+
+
+
+
+if(Roo.DomQuery){
+    Roo.Element.selectorFunction = Roo.DomQuery.select;
+}
+
+Roo.Element.select = function(selector, unique, root){
+    var els;
+    if(typeof selector == "string"){
+        els = Roo.Element.selectorFunction(selector, root);
+    }else if(selector.length !== undefined){
+        els = selector;
+    }else{
+        throw "Invalid selector";
+    }
+    if(unique === true){
+        return new Roo.CompositeElement(els);
+    }else{
+        return new Roo.CompositeElementLite(els);
+    }
+};
+/**
+ * Selects elements based on the passed CSS selector to enable working on them as 1.
+ * @param {String/Array} selector The CSS selector or an array of elements
+ * @param {Boolean} unique (optional) true to create a unique Roo.Element for each element (defaults to a shared flyweight object)
+ * @param {HTMLElement/String} root (optional) The root element of the query or id of the root
+ * @return {CompositeElementLite/CompositeElement}
+ * @member Roo
+ * @method select
+ */
+Roo.select = Roo.Element.select;
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Roo/EventManager.js b/Roo/EventManager.js
new file mode 100644 (file)
index 0000000..7bf8dea
--- /dev/null
@@ -0,0 +1,836 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+
+/**
+ * @class Roo.EventManager
+ * Registers event handlers that want to receive a normalized EventObject instead of the standard browser event and provides 
+ * several useful events directly.
+ * See {@link Roo.EventObject} for more details on normalized event objects.
+ * @singleton
+ */
+Roo.EventManager = function(){
+    var docReadyEvent, docReadyProcId, docReadyState = false;
+    var resizeEvent, resizeTask, textEvent, textSize;
+    var E = Roo.lib.Event;
+    var D = Roo.lib.Dom;
+
+
+    var fireDocReady = function(){
+        if(!docReadyState){
+            docReadyState = true;
+            Roo.isReady = true;
+            if(docReadyProcId){
+                clearInterval(docReadyProcId);
+            }
+            if(Roo.isGecko || Roo.isOpera) {
+                document.removeEventListener("DOMContentLoaded", fireDocReady, false);
+            }
+            if(Roo.isIE){
+                var defer = document.getElementById("ie-deferred-loader");
+                if(defer){
+                    defer.onreadystatechange = null;
+                    defer.parentNode.removeChild(defer);
+                }
+            }
+            if(docReadyEvent){
+                docReadyEvent.fire();
+                docReadyEvent.clearListeners();
+            }
+        }
+    };
+    
+    var initDocReady = function(){
+        docReadyEvent = new Roo.util.Event();
+        if(Roo.isGecko || Roo.isOpera) {
+            document.addEventListener("DOMContentLoaded", fireDocReady, false);
+        }else if(Roo.isIE){
+            document.write("<s"+'cript id="ie-deferred-loader" defer="defer" src="/'+'/:"></s'+"cript>");
+            var defer = document.getElementById("ie-deferred-loader");
+            defer.onreadystatechange = function(){
+                if(this.readyState == "complete"){
+                    fireDocReady();
+                }
+            };
+        }else if(Roo.isSafari){ 
+            docReadyProcId = setInterval(function(){
+                var rs = document.readyState;
+                if(rs == "complete") {
+                    fireDocReady();     
+                 }
+            }, 10);
+        }
+        // no matter what, make sure it fires on load
+        E.on(window, "load", fireDocReady);
+    };
+
+    var createBuffered = function(h, o){
+        var task = new Roo.util.DelayedTask(h);
+        return function(e){
+            // create new event object impl so new events don't wipe out properties
+            e = new Roo.EventObjectImpl(e);
+            task.delay(o.buffer, h, null, [e]);
+        };
+    };
+
+    var createSingle = function(h, el, ename, fn){
+        return function(e){
+            Roo.EventManager.removeListener(el, ename, fn);
+            h(e);
+        };
+    };
+
+    var createDelayed = function(h, o){
+        return function(e){
+            // create new event object impl so new events don't wipe out properties
+            e = new Roo.EventObjectImpl(e);
+            setTimeout(function(){
+                h(e);
+            }, o.delay || 10);
+        };
+    };
+
+    var listen = function(element, ename, opt, fn, scope){
+        var o = (!opt || typeof opt == "boolean") ? {} : opt;
+        fn = fn || o.fn; scope = scope || o.scope;
+        var el = Roo.getDom(element);
+        if(!el){
+            throw "Error listening for \"" + ename + '\". Element "' + element + '" doesn\'t exist.';
+        }
+        var h = function(e){
+            e = Roo.EventObject.setEvent(e);
+            var t;
+            if(o.delegate){
+                t = e.getTarget(o.delegate, el);
+                if(!t){
+                    return;
+                }
+            }else{
+                t = e.target;
+            }
+            if(o.stopEvent === true){
+                e.stopEvent();
+            }
+            if(o.preventDefault === true){
+               e.preventDefault();
+            }
+            if(o.stopPropagation === true){
+                e.stopPropagation();
+            }
+
+            if(o.normalized === false){
+                e = e.browserEvent;
+            }
+
+            fn.call(scope || el, e, t, o);
+        };
+        if(o.delay){
+            h = createDelayed(h, o);
+        }
+        if(o.single){
+            h = createSingle(h, el, ename, fn);
+        }
+        if(o.buffer){
+            h = createBuffered(h, o);
+        }
+        fn._handlers = fn._handlers || [];
+        fn._handlers.push([Roo.id(el), ename, h]);
+
+        E.on(el, ename, h);
+        if(ename == "mousewheel" && el.addEventListener){ // workaround for jQuery
+            el.addEventListener("DOMMouseScroll", h, false);
+            E.on(window, 'unload', function(){
+                el.removeEventListener("DOMMouseScroll", h, false);
+            });
+        }
+        if(ename == "mousedown" && el == document){ // fix stopped mousedowns on the document
+            Roo.EventManager.stoppedMouseDownEvent.addListener(h);
+        }
+        return h;
+    };
+
+    var stopListening = function(el, ename, fn){
+        var id = Roo.id(el), hds = fn._handlers, hd = fn;
+        if(hds){
+            for(var i = 0, len = hds.length; i < len; i++){
+                var h = hds[i];
+                if(h[0] == id && h[1] == ename){
+                    hd = h[2];
+                    hds.splice(i, 1);
+                    break;
+                }
+            }
+        }
+        E.un(el, ename, hd);
+        el = Roo.getDom(el);
+        if(ename == "mousewheel" && el.addEventListener){
+            el.removeEventListener("DOMMouseScroll", hd, false);
+        }
+        if(ename == "mousedown" && el == document){ // fix stopped mousedowns on the document
+            Roo.EventManager.stoppedMouseDownEvent.removeListener(hd);
+        }
+    };
+
+    var propRe = /^(?:scope|delay|buffer|single|stopEvent|preventDefault|stopPropagation|normalized|args|delegate)$/;
+    
+    var pub = {
+        
+        
+        /** 
+         * Fix for doc tools
+         * @scope Roo.EventManager
+         */
+        
+        
+        /** 
+         * This is no longer needed and is deprecated. Places a simple wrapper around an event handler to override the browser event
+         * object with a Roo.EventObject
+         * @param {Function} fn        The method the event invokes
+         * @param {Object}   scope    An object that becomes the scope of the handler
+         * @param {boolean}  override If true, the obj passed in becomes
+         *                             the execution scope of the listener
+         * @return {Function} The wrapped function
+         * @deprecated
+         */
+        wrap : function(fn, scope, override){
+            return function(e){
+                Roo.EventObject.setEvent(e);
+                fn.call(override ? scope || window : window, Roo.EventObject, scope);
+            };
+        },
+        
+        /**
+     * Appends an event handler to an element (shorthand for addListener)
+     * @param {String/HTMLElement}   element        The html element or id to assign the
+     * @param {String}   eventName The type of event to listen for
+     * @param {Function} handler The method the event invokes
+     * @param {Object}   scope (optional) The scope in which to execute the handler
+     * function. The handler function's "this" context.
+     * @param {Object}   options (optional) An object containing handler configuration
+     * properties. This may contain any of the following properties:<ul>
+     * <li>scope {Object} The scope in which to execute the handler function. The handler function's "this" context.</li>
+     * <li>delegate {String} A simple selector to filter the target or look for a descendant of the target</li>
+     * <li>stopEvent {Boolean} True to stop the event. That is stop propagation, and prevent the default action.</li>
+     * <li>preventDefault {Boolean} True to prevent the default action</li>
+     * <li>stopPropagation {Boolean} True to prevent event propagation</li>
+     * <li>normalized {Boolean} False to pass a browser event to the handler function instead of an Roo.EventObject</li>
+     * <li>delay {Number} The number of milliseconds to delay the invocation of the handler after te event fires.</li>
+     * <li>single {Boolean} True to add a handler to handle just the next firing of the event, and then remove itself.</li>
+     * <li>buffer {Number} Causes the handler to be scheduled to run in an {@link Roo.util.DelayedTask} delayed
+     * by the specified number of milliseconds. If the event fires again within that time, the original
+     * handler is <em>not</em> invoked, but the new handler is scheduled in its place.</li>
+     * </ul><br>
+     * <p>
+     * <b>Combining Options</b><br>
+     * Using the options argument, it is possible to combine different types of listeners:<br>
+     * <br>
+     * A normalized, delayed, one-time listener that auto stops the event and passes a custom argument (forumId)<div style="margin: 5px 20px 20px;">
+     * Code:<pre><code>
+el.on('click', this.onClick, this, {
+    single: true,
+    delay: 100,
+    stopEvent : true,
+    forumId: 4
+});</code></pre>
+     * <p>
+     * <b>Attaching multiple handlers in 1 call</b><br>
+      * The method also allows for a single argument to be passed which is a config object containing properties
+     * which specify multiple handlers.
+     * <p>
+     * Code:<pre><code>
+el.on({
+    'click' : {
+        fn: this.onClick
+        scope: this,
+        delay: 100
+    },
+    'mouseover' : {
+        fn: this.onMouseOver
+        scope: this
+    },
+    'mouseout' : {
+        fn: this.onMouseOut
+        scope: this
+    }
+});</code></pre>
+     * <p>
+     * Or a shorthand syntax:<br>
+     * Code:<pre><code>
+el.on({
+    'click' : this.onClick,
+    'mouseover' : this.onMouseOver,
+    'mouseout' : this.onMouseOut
+    scope: this
+});</code></pre>
+     */
+        addListener : function(element, eventName, fn, scope, options){
+            if(typeof eventName == "object"){
+                var o = eventName;
+                for(var e in o){
+                    if(propRe.test(e)){
+                        continue;
+                    }
+                    if(typeof o[e] == "function"){
+                        // shared options
+                        listen(element, e, o, o[e], o.scope);
+                    }else{
+                        // individual options
+                        listen(element, e, o[e]);
+                    }
+                }
+                return;
+            }
+            return listen(element, eventName, options, fn, scope);
+        },
+        
+        /**
+         * Removes an event handler
+         *
+         * @param {String/HTMLElement}   element        The id or html element to remove the 
+         *                             event from
+         * @param {String}   eventName     The type of event
+         * @param {Function} fn
+         * @return {Boolean} True if a listener was actually removed
+         */
+        removeListener : function(element, eventName, fn){
+            return stopListening(element, eventName, fn);
+        },
+        
+        /**
+         * Fires when the document is ready (before onload and before images are loaded). Can be 
+         * accessed shorthanded Roo.onReady().
+         * @param {Function} fn        The method the event invokes
+         * @param {Object}   scope    An  object that becomes the scope of the handler
+         * @param {boolean}  options
+         */
+        onDocumentReady : function(fn, scope, options){
+            if(docReadyState){ // if it already fired
+                docReadyEvent.addListener(fn, scope, options);
+                docReadyEvent.fire();
+                docReadyEvent.clearListeners();
+                return;
+            }
+            if(!docReadyEvent){
+                initDocReady();
+            }
+            docReadyEvent.addListener(fn, scope, options);
+        },
+        
+        /**
+         * Fires when the window is resized and provides resize event buffering (50 milliseconds), passes new viewport width and height to handlers.
+         * @param {Function} fn        The method the event invokes
+         * @param {Object}   scope    An object that becomes the scope of the handler
+         * @param {boolean}  options
+         */
+        onWindowResize : function(fn, scope, options){
+            if(!resizeEvent){
+                resizeEvent = new Roo.util.Event();
+                resizeTask = new Roo.util.DelayedTask(function(){
+                    resizeEvent.fire(D.getViewWidth(), D.getViewHeight());
+                });
+                E.on(window, "resize", function(){
+                    if(Roo.isIE){
+                        resizeTask.delay(50);
+                    }else{
+                        resizeEvent.fire(D.getViewWidth(), D.getViewHeight());
+                    }
+                });
+            }
+            resizeEvent.addListener(fn, scope, options);
+        },
+
+        /**
+         * Fires when the user changes the active text size. Handler gets called with 2 params, the old size and the new size.
+         * @param {Function} fn        The method the event invokes
+         * @param {Object}   scope    An object that becomes the scope of the handler
+         * @param {boolean}  options
+         */
+        onTextResize : function(fn, scope, options){
+            if(!textEvent){
+                textEvent = new Roo.util.Event();
+                var textEl = new Roo.Element(document.createElement('div'));
+                textEl.dom.className = 'x-text-resize';
+                textEl.dom.innerHTML = 'X';
+                textEl.appendTo(document.body);
+                textSize = textEl.dom.offsetHeight;
+                setInterval(function(){
+                    if(textEl.dom.offsetHeight != textSize){
+                        textEvent.fire(textSize, textSize = textEl.dom.offsetHeight);
+                    }
+                }, this.textResizeInterval);
+            }
+            textEvent.addListener(fn, scope, options);
+        },
+
+        /**
+         * Removes the passed window resize listener.
+         * @param {Function} fn        The method the event invokes
+         * @param {Object}   scope    The scope of handler
+         */
+        removeResizeListener : function(fn, scope){
+            if(resizeEvent){
+                resizeEvent.removeListener(fn, scope);
+            }
+        },
+
+        // private
+        fireResize : function(){
+            if(resizeEvent){
+                resizeEvent.fire(D.getViewWidth(), D.getViewHeight());
+            }   
+        },
+        /**
+         * Url used for onDocumentReady with using SSL (defaults to Roo.SSL_SECURE_URL)
+         */
+        ieDeferSrc : false,
+        /**
+         * The frequency, in milliseconds, to check for text resize events (defaults to 50)
+         */
+        textResizeInterval : 50
+    };
+    
+    /**
+     * Fix for doc tools
+     * @scopeAlias pub=Roo.EventManager
+     */
+    
+     /**
+     * Appends an event handler to an element (shorthand for addListener)
+     * @param {String/HTMLElement}   element        The html element or id to assign the
+     * @param {String}   eventName The type of event to listen for
+     * @param {Function} handler The method the event invokes
+     * @param {Object}   scope (optional) The scope in which to execute the handler
+     * function. The handler function's "this" context.
+     * @param {Object}   options (optional) An object containing handler configuration
+     * properties. This may contain any of the following properties:<ul>
+     * <li>scope {Object} The scope in which to execute the handler function. The handler function's "this" context.</li>
+     * <li>delegate {String} A simple selector to filter the target or look for a descendant of the target</li>
+     * <li>stopEvent {Boolean} True to stop the event. That is stop propagation, and prevent the default action.</li>
+     * <li>preventDefault {Boolean} True to prevent the default action</li>
+     * <li>stopPropagation {Boolean} True to prevent event propagation</li>
+     * <li>normalized {Boolean} False to pass a browser event to the handler function instead of an Roo.EventObject</li>
+     * <li>delay {Number} The number of milliseconds to delay the invocation of the handler after te event fires.</li>
+     * <li>single {Boolean} True to add a handler to handle just the next firing of the event, and then remove itself.</li>
+     * <li>buffer {Number} Causes the handler to be scheduled to run in an {@link Roo.util.DelayedTask} delayed
+     * by the specified number of milliseconds. If the event fires again within that time, the original
+     * handler is <em>not</em> invoked, but the new handler is scheduled in its place.</li>
+     * </ul><br>
+     * <p>
+     * <b>Combining Options</b><br>
+     * Using the options argument, it is possible to combine different types of listeners:<br>
+     * <br>
+     * A normalized, delayed, one-time listener that auto stops the event and passes a custom argument (forumId)<div style="margin: 5px 20px 20px;">
+     * Code:<pre><code>
+el.on('click', this.onClick, this, {
+    single: true,
+    delay: 100,
+    stopEvent : true,
+    forumId: 4
+});</code></pre>
+     * <p>
+     * <b>Attaching multiple handlers in 1 call</b><br>
+      * The method also allows for a single argument to be passed which is a config object containing properties
+     * which specify multiple handlers.
+     * <p>
+     * Code:<pre><code>
+el.on({
+    'click' : {
+        fn: this.onClick
+        scope: this,
+        delay: 100
+    },
+    'mouseover' : {
+        fn: this.onMouseOver
+        scope: this
+    },
+    'mouseout' : {
+        fn: this.onMouseOut
+        scope: this
+    }
+});</code></pre>
+     * <p>
+     * Or a shorthand syntax:<br>
+     * Code:<pre><code>
+el.on({
+    'click' : this.onClick,
+    'mouseover' : this.onMouseOver,
+    'mouseout' : this.onMouseOut
+    scope: this
+});</code></pre>
+     */
+    pub.on = pub.addListener;
+    pub.un = pub.removeListener;
+
+    pub.stoppedMouseDownEvent = new Roo.util.Event();
+    return pub;
+}();
+/**
+  * Fires when the document is ready (before onload and before images are loaded).  Shorthand of {@link Roo.EventManager#onDocumentReady}.
+  * @param {Function} fn        The method the event invokes
+  * @param {Object}   scope    An  object that becomes the scope of the handler
+  * @param {boolean}  override If true, the obj passed in becomes
+  *                             the execution scope of the listener
+  * @member Roo
+  * @method onReady
+ */
+Roo.onReady = Roo.EventManager.onDocumentReady;
+
+Roo.onReady(function(){
+    var bd = Roo.get(document.body);
+    if(!bd){ return; }
+
+    var cls = [
+            Roo.isIE ? "roo-ie"
+            : Roo.isGecko ? "roo-gecko"
+            : Roo.isOpera ? "roo-opera"
+            : Roo.isSafari ? "roo-safari" : ""];
+
+    if(Roo.isMac){
+        cls.push("roo-mac");
+    }
+    if(Roo.isLinux){
+        cls.push("roo-linux");
+    }
+    if(Roo.isBorderBox){
+        cls.push('roo-border-box');
+    }
+    if(Roo.isStrict){ // add to the parent to allow for selectors like ".ext-strict .ext-ie"
+        var p = bd.dom.parentNode;
+        if(p){
+            p.className += ' roo-strict';
+        }
+    }
+    bd.addClass(cls.join(' '));
+});
+
+/**
+ * @class Roo.EventObject
+ * EventObject exposes the Yahoo! UI Event functionality directly on the object
+ * passed to your event handler. It exists mostly for convenience. It also fixes the annoying null checks automatically to cleanup your code 
+ * Example:
+ * <pre><code>
+ function handleClick(e){ // e is not a standard event object, it is a Roo.EventObject
+    e.preventDefault();
+    var target = e.getTarget();
+    ...
+ }
+ var myDiv = Roo.get("myDiv");
+ myDiv.on("click", handleClick);
+ //or
+ Roo.EventManager.on("myDiv", 'click', handleClick);
+ Roo.EventManager.addListener("myDiv", 'click', handleClick);
+ </code></pre>
+ * @singleton
+ */
+Roo.EventObject = function(){
+    
+    var E = Roo.lib.Event;
+    
+    // safari keypress events for special keys return bad keycodes
+    var safariKeys = {
+        63234 : 37, // left
+        63235 : 39, // right
+        63232 : 38, // up
+        63233 : 40, // down
+        63276 : 33, // page up
+        63277 : 34, // page down
+        63272 : 46, // delete
+        63273 : 36, // home
+        63275 : 35  // end
+    };
+
+    // normalize button clicks
+    var btnMap = Roo.isIE ? {1:0,4:1,2:2} :
+                (Roo.isSafari ? {1:0,2:1,3:2} : {0:0,1:1,2:2});
+
+    Roo.EventObjectImpl = function(e){
+        if(e){
+            this.setEvent(e.browserEvent || e);
+        }
+    };
+    Roo.EventObjectImpl.prototype = {
+        /**
+         * Used to fix doc tools.
+         * @scope Roo.EventObject.prototype
+         */
+            
+
+        
+        
+        /** The normal browser event */
+        browserEvent : null,
+        /** The button pressed in a mouse event */
+        button : -1,
+        /** True if the shift key was down during the event */
+        shiftKey : false,
+        /** True if the control key was down during the event */
+        ctrlKey : false,
+        /** True if the alt key was down during the event */
+        altKey : false,
+
+        /** Key constant 
+        * @type Number */
+        BACKSPACE : 8,
+        /** Key constant 
+        * @type Number */
+        TAB : 9,
+        /** Key constant 
+        * @type Number */
+        RETURN : 13,
+        /** Key constant 
+        * @type Number */
+        ENTER : 13,
+        /** Key constant 
+        * @type Number */
+        SHIFT : 16,
+        /** Key constant 
+        * @type Number */
+        CONTROL : 17,
+        /** Key constant 
+        * @type Number */
+        ESC : 27,
+        /** Key constant 
+        * @type Number */
+        SPACE : 32,
+        /** Key constant 
+        * @type Number */
+        PAGEUP : 33,
+        /** Key constant 
+        * @type Number */
+        PAGEDOWN : 34,
+        /** Key constant 
+        * @type Number */
+        END : 35,
+        /** Key constant 
+        * @type Number */
+        HOME : 36,
+        /** Key constant 
+        * @type Number */
+        LEFT : 37,
+        /** Key constant 
+        * @type Number */
+        UP : 38,
+        /** Key constant 
+        * @type Number */
+        RIGHT : 39,
+        /** Key constant 
+        * @type Number */
+        DOWN : 40,
+        /** Key constant 
+        * @type Number */
+        DELETE : 46,
+        /** Key constant 
+        * @type Number */
+        F5 : 116,
+
+           /** @private */
+        setEvent : function(e){
+            if(e == this || (e && e.browserEvent)){ // already wrapped
+                return e;
+            }
+            this.browserEvent = e;
+            if(e){
+                // normalize buttons
+                this.button = e.button ? btnMap[e.button] : (e.which ? e.which-1 : -1);
+                if(e.type == 'click' && this.button == -1){
+                    this.button = 0;
+                }
+                this.type = e.type;
+                this.shiftKey = e.shiftKey;
+                // mac metaKey behaves like ctrlKey
+                this.ctrlKey = e.ctrlKey || e.metaKey;
+                this.altKey = e.altKey;
+                // in getKey these will be normalized for the mac
+                this.keyCode = e.keyCode;
+                // keyup warnings on firefox.
+                this.charCode = (e.type == 'keyup' || e.type == 'keydown') ? 0 : e.charCode;
+                // cache the target for the delayed and or buffered events
+                this.target = E.getTarget(e);
+                // same for XY
+                this.xy = E.getXY(e);
+            }else{
+                this.button = -1;
+                this.shiftKey = false;
+                this.ctrlKey = false;
+                this.altKey = false;
+                this.keyCode = 0;
+                this.charCode =0;
+                this.target = null;
+                this.xy = [0, 0];
+            }
+            return this;
+        },
+
+        /**
+         * Stop the event (preventDefault and stopPropagation)
+         */
+        stopEvent : function(){
+            if(this.browserEvent){
+                if(this.browserEvent.type == 'mousedown'){
+                    Roo.EventManager.stoppedMouseDownEvent.fire(this);
+                }
+                E.stopEvent(this.browserEvent);
+            }
+        },
+
+        /**
+         * Prevents the browsers default handling of the event.
+         */
+        preventDefault : function(){
+            if(this.browserEvent){
+                E.preventDefault(this.browserEvent);
+            }
+        },
+
+        /** @private */
+        isNavKeyPress : function(){
+            var k = this.keyCode;
+            k = Roo.isSafari ? (safariKeys[k] || k) : k;
+            return (k >= 33 && k <= 40) || k == this.RETURN || k == this.TAB || k == this.ESC;
+        },
+
+        isSpecialKey : function(){
+            var k = this.keyCode;
+            return (this.type == 'keypress' && this.ctrlKey) || k == 9 || k == 13  || k == 40 || k == 27 ||
+            (k == 16) || (k == 17) ||
+            (k >= 18 && k <= 20) ||
+            (k >= 33 && k <= 35) ||
+            (k >= 36 && k <= 39) ||
+            (k >= 44 && k <= 45);
+        },
+        /**
+         * Cancels bubbling of the event.
+         */
+        stopPropagation : function(){
+            if(this.browserEvent){
+                if(this.type == 'mousedown'){
+                    Roo.EventManager.stoppedMouseDownEvent.fire(this);
+                }
+                E.stopPropagation(this.browserEvent);
+            }
+        },
+
+        /**
+         * Gets the key code for the event.
+         * @return {Number}
+         */
+        getCharCode : function(){
+            return this.charCode || this.keyCode;
+        },
+
+        /**
+         * Returns a normalized keyCode for the event.
+         * @return {Number} The key code
+         */
+        getKey : function(){
+            var k = this.keyCode || this.charCode;
+            return Roo.isSafari ? (safariKeys[k] || k) : k;
+        },
+
+        /**
+         * Gets the x coordinate of the event.
+         * @return {Number}
+         */
+        getPageX : function(){
+            return this.xy[0];
+        },
+
+        /**
+         * Gets the y coordinate of the event.
+         * @return {Number}
+         */
+        getPageY : function(){
+            return this.xy[1];
+        },
+
+        /**
+         * Gets the time of the event.
+         * @return {Number}
+         */
+        getTime : function(){
+            if(this.browserEvent){
+                return E.getTime(this.browserEvent);
+            }
+            return null;
+        },
+
+        /**
+         * Gets the page coordinates of the event.
+         * @return {Array} The xy values like [x, y]
+         */
+        getXY : function(){
+            return this.xy;
+        },
+
+        /**
+         * Gets the target for the event.
+         * @param {String} selector (optional) A simple selector to filter the target or look for an ancestor of the target
+         * @param {Number/String/HTMLElement/Element} maxDepth (optional) The max depth to
+                search as a number or element (defaults to 10 || document.body)
+         * @param {Boolean} returnEl (optional) True to return a Roo.Element object instead of DOM node
+         * @return {HTMLelement}
+         */
+        getTarget : function(selector, maxDepth, returnEl){
+            return selector ? Roo.fly(this.target).findParent(selector, maxDepth, returnEl) : this.target;
+        },
+        /**
+         * Gets the related target.
+         * @return {HTMLElement}
+         */
+        getRelatedTarget : function(){
+            if(this.browserEvent){
+                return E.getRelatedTarget(this.browserEvent);
+            }
+            return null;
+        },
+
+        /**
+         * Normalizes mouse wheel delta across browsers
+         * @return {Number} The delta
+         */
+        getWheelDelta : function(){
+            var e = this.browserEvent;
+            var delta = 0;
+            if(e.wheelDelta){ /* IE/Opera. */
+                delta = e.wheelDelta/120;
+            }else if(e.detail){ /* Mozilla case. */
+                delta = -e.detail/3;
+            }
+            return delta;
+        },
+
+        /**
+         * Returns true if the control, meta, shift or alt key was pressed during this event.
+         * @return {Boolean}
+         */
+        hasModifier : function(){
+            return !!((this.ctrlKey || this.altKey) || this.shiftKey);
+        },
+
+        /**
+         * Returns true if the target of this event equals el or is a child of el
+         * @param {String/HTMLElement/Element} el
+         * @param {Boolean} related (optional) true to test if the related target is within el instead of the target
+         * @return {Boolean}
+         */
+        within : function(el, related){
+            var t = this[related ? "getRelatedTarget" : "getTarget"]();
+            return t && Roo.fly(el).contains(t);
+        },
+
+        getPoint : function(){
+            return new Roo.lib.Point(this.xy[0], this.xy[1]);
+        }
+    };
+
+    return new Roo.EventObjectImpl();
+}();
+            
+    
\ No newline at end of file
diff --git a/Roo/Fx.js b/Roo/Fx.js
new file mode 100644 (file)
index 0000000..e14f217
--- /dev/null
+++ b/Roo/Fx.js
@@ -0,0 +1,1004 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+
+
+
+//Notifies Element that fx methods are available
+Roo.enableFx = true;
+
+/**
+ * @class Roo.Fx
+ * <p>A class to provide basic animation and visual effects support.  <b>Note:</b> This class is automatically applied
+ * to the {@link Roo.Element} interface when included, so all effects calls should be performed via Element.
+ * Conversely, since the effects are not actually defined in Element, Roo.Fx <b>must</b> be included in order for the 
+ * Element effects to work.</p><br/>
+ *
+ * <p>It is important to note that although the Fx methods and many non-Fx Element methods support "method chaining" in that
+ * they return the Element object itself as the method return value, it is not always possible to mix the two in a single
+ * method chain.  The Fx methods use an internal effects queue so that each effect can be properly timed and sequenced.
+ * Non-Fx methods, on the other hand, have no such internal queueing and will always execute immediately.  For this reason,
+ * while it may be possible to mix certain Fx and non-Fx method calls in a single chain, it may not always provide the
+ * expected results and should be done with care.</p><br/>
+ *
+ * <p>Motion effects support 8-way anchoring, meaning that you can choose one of 8 different anchor points on the Element
+ * that will serve as either the start or end point of the animation.  Following are all of the supported anchor positions:</p>
+<pre>
+Value  Description
+-----  -----------------------------
+tl     The top left corner
+t      The center of the top edge
+tr     The top right corner
+l      The center of the left edge
+r      The center of the right edge
+bl     The bottom left corner
+b      The center of the bottom edge
+br     The bottom right corner
+</pre>
+ * <b>Although some Fx methods accept specific custom config parameters, the ones shown in the Config Options section
+ * below are common options that can be passed to any Fx method.</b>
+ * @cfg {Function} callback A function called when the effect is finished
+ * @cfg {Object} scope The scope of the effect function
+ * @cfg {String} easing A valid Easing value for the effect
+ * @cfg {String} afterCls A css class to apply after the effect
+ * @cfg {Number} duration The length of time (in seconds) that the effect should last
+ * @cfg {Boolean} remove Whether the Element should be removed from the DOM and destroyed after the effect finishes
+ * @cfg {Boolean} useDisplay Whether to use the <i>display</i> CSS property instead of <i>visibility</i> when hiding Elements (only applies to 
+ * effects that end with the element being visually hidden, ignored otherwise)
+ * @cfg {String/Object/Function} afterStyle A style specification string, e.g. "width:100px", or an object in the form {width:"100px"}, or
+ * a function which returns such a specification that will be applied to the Element after the effect finishes
+ * @cfg {Boolean} block Whether the effect should block other effects from queueing while it runs
+ * @cfg {Boolean} concurrent Whether to allow subsequently-queued effects to run at the same time as the current effect, or to ensure that they run in sequence
+ * @cfg {Boolean} stopFx Whether subsequent effects should be stopped and removed after the current effect finishes
+ */
+Roo.Fx = {
+       /**
+        * Slides the element into view.  An anchor point can be optionally passed to set the point of
+        * origin for the slide effect.  This function automatically handles wrapping the element with
+        * a fixed-size container if needed.  See the Fx class overview for valid anchor point options.
+        * Usage:
+        *<pre><code>
+// default: slide the element in from the top
+el.slideIn();
+
+// custom: slide the element in from the right with a 2-second duration
+el.slideIn('r', { duration: 2 });
+
+// common config options shown with default values
+el.slideIn('t', {
+    easing: 'easeOut',
+    duration: .5
+});
+</code></pre>
+        * @param {String} anchor (optional) One of the valid Fx anchor positions (defaults to top: 't')
+        * @param {Object} options (optional) Object literal with any of the Fx config options
+        * @return {Roo.Element} The Element
+        */
+    slideIn : function(anchor, o){
+        var el = this.getFxEl();
+        o = o || {};
+
+        el.queueFx(o, function(){
+
+            anchor = anchor || "t";
+
+            // fix display to visibility
+            this.fixDisplay();
+
+            // restore values after effect
+            var r = this.getFxRestore();
+            var b = this.getBox();
+            // fixed size for slide
+            this.setSize(b);
+
+            // wrap if needed
+            var wrap = this.fxWrap(r.pos, o, "hidden");
+
+            var st = this.dom.style;
+            st.visibility = "visible";
+            st.position = "absolute";
+
+            // clear out temp styles after slide and unwrap
+            var after = function(){
+                el.fxUnwrap(wrap, r.pos, o);
+                st.width = r.width;
+                st.height = r.height;
+                el.afterFx(o);
+            };
+            // time to calc the positions
+            var a, pt = {to: [b.x, b.y]}, bw = {to: b.width}, bh = {to: b.height};
+
+            switch(anchor.toLowerCase()){
+                case "t":
+                    wrap.setSize(b.width, 0);
+                    st.left = st.bottom = "0";
+                    a = {height: bh};
+                break;
+                case "l":
+                    wrap.setSize(0, b.height);
+                    st.right = st.top = "0";
+                    a = {width: bw};
+                break;
+                case "r":
+                    wrap.setSize(0, b.height);
+                    wrap.setX(b.right);
+                    st.left = st.top = "0";
+                    a = {width: bw, points: pt};
+                break;
+                case "b":
+                    wrap.setSize(b.width, 0);
+                    wrap.setY(b.bottom);
+                    st.left = st.top = "0";
+                    a = {height: bh, points: pt};
+                break;
+                case "tl":
+                    wrap.setSize(0, 0);
+                    st.right = st.bottom = "0";
+                    a = {width: bw, height: bh};
+                break;
+                case "bl":
+                    wrap.setSize(0, 0);
+                    wrap.setY(b.y+b.height);
+                    st.right = st.top = "0";
+                    a = {width: bw, height: bh, points: pt};
+                break;
+                case "br":
+                    wrap.setSize(0, 0);
+                    wrap.setXY([b.right, b.bottom]);
+                    st.left = st.top = "0";
+                    a = {width: bw, height: bh, points: pt};
+                break;
+                case "tr":
+                    wrap.setSize(0, 0);
+                    wrap.setX(b.x+b.width);
+                    st.left = st.bottom = "0";
+                    a = {width: bw, height: bh, points: pt};
+                break;
+            }
+            this.dom.style.visibility = "visible";
+            wrap.show();
+
+            arguments.callee.anim = wrap.fxanim(a,
+                o,
+                'motion',
+                .5,
+                'easeOut', after);
+        });
+        return this;
+    },
+    
+       /**
+        * Slides the element out of view.  An anchor point can be optionally passed to set the end point
+        * for the slide effect.  When the effect is completed, the element will be hidden (visibility = 
+        * 'hidden') but block elements will still take up space in the document.  The element must be removed
+        * from the DOM using the 'remove' config option if desired.  This function automatically handles 
+        * wrapping the element with a fixed-size container if needed.  See the Fx class overview for valid anchor point options.
+        * Usage:
+        *<pre><code>
+// default: slide the element out to the top
+el.slideOut();
+
+// custom: slide the element out to the right with a 2-second duration
+el.slideOut('r', { duration: 2 });
+
+// common config options shown with default values
+el.slideOut('t', {
+    easing: 'easeOut',
+    duration: .5,
+    remove: false,
+    useDisplay: false
+});
+</code></pre>
+        * @param {String} anchor (optional) One of the valid Fx anchor positions (defaults to top: 't')
+        * @param {Object} options (optional) Object literal with any of the Fx config options
+        * @return {Roo.Element} The Element
+        */
+    slideOut : function(anchor, o){
+        var el = this.getFxEl();
+        o = o || {};
+
+        el.queueFx(o, function(){
+
+            anchor = anchor || "t";
+
+            // restore values after effect
+            var r = this.getFxRestore();
+            
+            var b = this.getBox();
+            // fixed size for slide
+            this.setSize(b);
+
+            // wrap if needed
+            var wrap = this.fxWrap(r.pos, o, "visible");
+
+            var st = this.dom.style;
+            st.visibility = "visible";
+            st.position = "absolute";
+
+            wrap.setSize(b);
+
+            var after = function(){
+                if(o.useDisplay){
+                    el.setDisplayed(false);
+                }else{
+                    el.hide();
+                }
+
+                el.fxUnwrap(wrap, r.pos, o);
+
+                st.width = r.width;
+                st.height = r.height;
+
+                el.afterFx(o);
+            };
+
+            var a, zero = {to: 0};
+            switch(anchor.toLowerCase()){
+                case "t":
+                    st.left = st.bottom = "0";
+                    a = {height: zero};
+                break;
+                case "l":
+                    st.right = st.top = "0";
+                    a = {width: zero};
+                break;
+                case "r":
+                    st.left = st.top = "0";
+                    a = {width: zero, points: {to:[b.right, b.y]}};
+                break;
+                case "b":
+                    st.left = st.top = "0";
+                    a = {height: zero, points: {to:[b.x, b.bottom]}};
+                break;
+                case "tl":
+                    st.right = st.bottom = "0";
+                    a = {width: zero, height: zero};
+                break;
+                case "bl":
+                    st.right = st.top = "0";
+                    a = {width: zero, height: zero, points: {to:[b.x, b.bottom]}};
+                break;
+                case "br":
+                    st.left = st.top = "0";
+                    a = {width: zero, height: zero, points: {to:[b.x+b.width, b.bottom]}};
+                break;
+                case "tr":
+                    st.left = st.bottom = "0";
+                    a = {width: zero, height: zero, points: {to:[b.right, b.y]}};
+                break;
+            }
+
+            arguments.callee.anim = wrap.fxanim(a,
+                o,
+                'motion',
+                .5,
+                "easeOut", after);
+        });
+        return this;
+    },
+
+       /**
+        * Fades the element out while slowly expanding it in all directions.  When the effect is completed, the 
+        * element will be hidden (visibility = 'hidden') but block elements will still take up space in the document. 
+        * The element must be removed from the DOM using the 'remove' config option if desired.
+        * Usage:
+        *<pre><code>
+// default
+el.puff();
+
+// common config options shown with default values
+el.puff({
+    easing: 'easeOut',
+    duration: .5,
+    remove: false,
+    useDisplay: false
+});
+</code></pre>
+        * @param {Object} options (optional) Object literal with any of the Fx config options
+        * @return {Roo.Element} The Element
+        */
+    puff : function(o){
+        var el = this.getFxEl();
+        o = o || {};
+
+        el.queueFx(o, function(){
+            this.clearOpacity();
+            this.show();
+
+            // restore values after effect
+            var r = this.getFxRestore();
+            var st = this.dom.style;
+
+            var after = function(){
+                if(o.useDisplay){
+                    el.setDisplayed(false);
+                }else{
+                    el.hide();
+                }
+
+                el.clearOpacity();
+
+                el.setPositioning(r.pos);
+                st.width = r.width;
+                st.height = r.height;
+                st.fontSize = '';
+                el.afterFx(o);
+            };
+
+            var width = this.getWidth();
+            var height = this.getHeight();
+
+            arguments.callee.anim = this.fxanim({
+                    width : {to: this.adjustWidth(width * 2)},
+                    height : {to: this.adjustHeight(height * 2)},
+                    points : {by: [-(width * .5), -(height * .5)]},
+                    opacity : {to: 0},
+                    fontSize: {to:200, unit: "%"}
+                },
+                o,
+                'motion',
+                .5,
+                "easeOut", after);
+        });
+        return this;
+    },
+
+       /**
+        * Blinks the element as if it was clicked and then collapses on its center (similar to switching off a television).
+        * When the effect is completed, the element will be hidden (visibility = 'hidden') but block elements will still 
+        * take up space in the document. The element must be removed from the DOM using the 'remove' config option if desired.
+        * Usage:
+        *<pre><code>
+// default
+el.switchOff();
+
+// all config options shown with default values
+el.switchOff({
+    easing: 'easeIn',
+    duration: .3,
+    remove: false,
+    useDisplay: false
+});
+</code></pre>
+        * @param {Object} options (optional) Object literal with any of the Fx config options
+        * @return {Roo.Element} The Element
+        */
+    switchOff : function(o){
+        var el = this.getFxEl();
+        o = o || {};
+
+        el.queueFx(o, function(){
+            this.clearOpacity();
+            this.clip();
+
+            // restore values after effect
+            var r = this.getFxRestore();
+            var st = this.dom.style;
+
+            var after = function(){
+                if(o.useDisplay){
+                    el.setDisplayed(false);
+                }else{
+                    el.hide();
+                }
+
+                el.clearOpacity();
+                el.setPositioning(r.pos);
+                st.width = r.width;
+                st.height = r.height;
+
+                el.afterFx(o);
+            };
+
+            this.fxanim({opacity:{to:0.3}}, null, null, .1, null, function(){
+                this.clearOpacity();
+                (function(){
+                    this.fxanim({
+                        height:{to:1},
+                        points:{by:[0, this.getHeight() * .5]}
+                    }, o, 'motion', 0.3, 'easeIn', after);
+                }).defer(100, this);
+            });
+        });
+        return this;
+    },
+
+    /**
+     * Highlights the Element by setting a color (applies to the background-color by default, but can be
+     * changed using the "attr" config option) and then fading back to the original color. If no original
+     * color is available, you should provide the "endColor" config option which will be cleared after the animation.
+     * Usage:
+<pre><code>
+// default: highlight background to yellow
+el.highlight();
+
+// custom: highlight foreground text to blue for 2 seconds
+el.highlight("0000ff", { attr: 'color', duration: 2 });
+
+// common config options shown with default values
+el.highlight("ffff9c", {
+    attr: "background-color", //can be any valid CSS property (attribute) that supports a color value
+    endColor: (current color) or "ffffff",
+    easing: 'easeIn',
+    duration: 1
+});
+</code></pre>
+     * @param {String} color (optional) The highlight color. Should be a 6 char hex color without the leading # (defaults to yellow: 'ffff9c')
+     * @param {Object} options (optional) Object literal with any of the Fx config options
+     * @return {Roo.Element} The Element
+     */        
+    highlight : function(color, o){
+        var el = this.getFxEl();
+        o = o || {};
+
+        el.queueFx(o, function(){
+            color = color || "ffff9c";
+            attr = o.attr || "backgroundColor";
+
+            this.clearOpacity();
+            this.show();
+
+            var origColor = this.getColor(attr);
+            var restoreColor = this.dom.style[attr];
+            endColor = (o.endColor || origColor) || "ffffff";
+
+            var after = function(){
+                el.dom.style[attr] = restoreColor;
+                el.afterFx(o);
+            };
+
+            var a = {};
+            a[attr] = {from: color, to: endColor};
+            arguments.callee.anim = this.fxanim(a,
+                o,
+                'color',
+                1,
+                'easeIn', after);
+        });
+        return this;
+    },
+
+   /**
+    * Shows a ripple of exploding, attenuating borders to draw attention to an Element.
+    * Usage:
+<pre><code>
+// default: a single light blue ripple
+el.frame();
+
+// custom: 3 red ripples lasting 3 seconds total
+el.frame("ff0000", 3, { duration: 3 });
+
+// common config options shown with default values
+el.frame("C3DAF9", 1, {
+    duration: 1 //duration of entire animation (not each individual ripple)
+    // Note: Easing is not configurable and will be ignored if included
+});
+</code></pre>
+    * @param {String} color (optional) The color of the border.  Should be a 6 char hex color without the leading # (defaults to light blue: 'C3DAF9').
+    * @param {Number} count (optional) The number of ripples to display (defaults to 1)
+    * @param {Object} options (optional) Object literal with any of the Fx config options
+    * @return {Roo.Element} The Element
+    */
+    frame : function(color, count, o){
+        var el = this.getFxEl();
+        o = o || {};
+
+        el.queueFx(o, function(){
+            color = color || "#C3DAF9";
+            if(color.length == 6){
+                color = "#" + color;
+            }
+            count = count || 1;
+            duration = o.duration || 1;
+            this.show();
+
+            var b = this.getBox();
+            var animFn = function(){
+                var proxy = this.createProxy({
+
+                     style:{
+                        visbility:"hidden",
+                        position:"absolute",
+                        "z-index":"35000", // yee haw
+                        border:"0px solid " + color
+                     }
+                  });
+                var scale = Roo.isBorderBox ? 2 : 1;
+                proxy.animate({
+                    top:{from:b.y, to:b.y - 20},
+                    left:{from:b.x, to:b.x - 20},
+                    borderWidth:{from:0, to:10},
+                    opacity:{from:1, to:0},
+                    height:{from:b.height, to:(b.height + (20*scale))},
+                    width:{from:b.width, to:(b.width + (20*scale))}
+                }, duration, function(){
+                    proxy.remove();
+                });
+                if(--count > 0){
+                     animFn.defer((duration/2)*1000, this);
+                }else{
+                    el.afterFx(o);
+                }
+            };
+            animFn.call(this);
+        });
+        return this;
+    },
+
+   /**
+    * Creates a pause before any subsequent queued effects begin.  If there are
+    * no effects queued after the pause it will have no effect.
+    * Usage:
+<pre><code>
+el.pause(1);
+</code></pre>
+    * @param {Number} seconds The length of time to pause (in seconds)
+    * @return {Roo.Element} The Element
+    */
+    pause : function(seconds){
+        var el = this.getFxEl();
+        var o = {};
+
+        el.queueFx(o, function(){
+            setTimeout(function(){
+                el.afterFx(o);
+            }, seconds * 1000);
+        });
+        return this;
+    },
+
+   /**
+    * Fade an element in (from transparent to opaque).  The ending opacity can be specified
+    * using the "endOpacity" config option.
+    * Usage:
+<pre><code>
+// default: fade in from opacity 0 to 100%
+el.fadeIn();
+
+// custom: fade in from opacity 0 to 75% over 2 seconds
+el.fadeIn({ endOpacity: .75, duration: 2});
+
+// common config options shown with default values
+el.fadeIn({
+    endOpacity: 1, //can be any value between 0 and 1 (e.g. .5)
+    easing: 'easeOut',
+    duration: .5
+});
+</code></pre>
+    * @param {Object} options (optional) Object literal with any of the Fx config options
+    * @return {Roo.Element} The Element
+    */
+    fadeIn : function(o){
+        var el = this.getFxEl();
+        o = o || {};
+        el.queueFx(o, function(){
+            this.setOpacity(0);
+            this.fixDisplay();
+            this.dom.style.visibility = 'visible';
+            var to = o.endOpacity || 1;
+            arguments.callee.anim = this.fxanim({opacity:{to:to}},
+                o, null, .5, "easeOut", function(){
+                if(to == 1){
+                    this.clearOpacity();
+                }
+                el.afterFx(o);
+            });
+        });
+        return this;
+    },
+
+   /**
+    * Fade an element out (from opaque to transparent).  The ending opacity can be specified
+    * using the "endOpacity" config option.
+    * Usage:
+<pre><code>
+// default: fade out from the element's current opacity to 0
+el.fadeOut();
+
+// custom: fade out from the element's current opacity to 25% over 2 seconds
+el.fadeOut({ endOpacity: .25, duration: 2});
+
+// common config options shown with default values
+el.fadeOut({
+    endOpacity: 0, //can be any value between 0 and 1 (e.g. .5)
+    easing: 'easeOut',
+    duration: .5
+    remove: false,
+    useDisplay: false
+});
+</code></pre>
+    * @param {Object} options (optional) Object literal with any of the Fx config options
+    * @return {Roo.Element} The Element
+    */
+    fadeOut : function(o){
+        var el = this.getFxEl();
+        o = o || {};
+        el.queueFx(o, function(){
+            arguments.callee.anim = this.fxanim({opacity:{to:o.endOpacity || 0}},
+                o, null, .5, "easeOut", function(){
+                if(this.visibilityMode == Roo.Element.DISPLAY || o.useDisplay){
+                     this.dom.style.display = "none";
+                }else{
+                     this.dom.style.visibility = "hidden";
+                }
+                this.clearOpacity();
+                el.afterFx(o);
+            });
+        });
+        return this;
+    },
+
+   /**
+    * Animates the transition of an element's dimensions from a starting height/width
+    * to an ending height/width.
+    * Usage:
+<pre><code>
+// change height and width to 100x100 pixels
+el.scale(100, 100);
+
+// common config options shown with default values.  The height and width will default to
+// the element's existing values if passed as null.
+el.scale(
+    [element's width],
+    [element's height], {
+    easing: 'easeOut',
+    duration: .35
+});
+</code></pre>
+    * @param {Number} width  The new width (pass undefined to keep the original width)
+    * @param {Number} height  The new height (pass undefined to keep the original height)
+    * @param {Object} options (optional) Object literal with any of the Fx config options
+    * @return {Roo.Element} The Element
+    */
+    scale : function(w, h, o){
+        this.shift(Roo.apply({}, o, {
+            width: w,
+            height: h
+        }));
+        return this;
+    },
+
+   /**
+    * Animates the transition of any combination of an element's dimensions, xy position and/or opacity.
+    * Any of these properties not specified in the config object will not be changed.  This effect 
+    * requires that at least one new dimension, position or opacity setting must be passed in on
+    * the config object in order for the function to have any effect.
+    * Usage:
+<pre><code>
+// slide the element horizontally to x position 200 while changing the height and opacity
+el.shift({ x: 200, height: 50, opacity: .8 });
+
+// common config options shown with default values.
+el.shift({
+    width: [element's width],
+    height: [element's height],
+    x: [element's x position],
+    y: [element's y position],
+    opacity: [element's opacity],
+    easing: 'easeOut',
+    duration: .35
+});
+</code></pre>
+    * @param {Object} options  Object literal with any of the Fx config options
+    * @return {Roo.Element} The Element
+    */
+    shift : function(o){
+        var el = this.getFxEl();
+        o = o || {};
+        el.queueFx(o, function(){
+            var a = {}, w = o.width, h = o.height, x = o.x, y = o.y,  op = o.opacity;
+            if(w !== undefined){
+                a.width = {to: this.adjustWidth(w)};
+            }
+            if(h !== undefined){
+                a.height = {to: this.adjustHeight(h)};
+            }
+            if(x !== undefined || y !== undefined){
+                a.points = {to: [
+                    x !== undefined ? x : this.getX(),
+                    y !== undefined ? y : this.getY()
+                ]};
+            }
+            if(op !== undefined){
+                a.opacity = {to: op};
+            }
+            if(o.xy !== undefined){
+                a.points = {to: o.xy};
+            }
+            arguments.callee.anim = this.fxanim(a,
+                o, 'motion', .35, "easeOut", function(){
+                el.afterFx(o);
+            });
+        });
+        return this;
+    },
+
+       /**
+        * Slides the element while fading it out of view.  An anchor point can be optionally passed to set the 
+        * ending point of the effect.
+        * Usage:
+        *<pre><code>
+// default: slide the element downward while fading out
+el.ghost();
+
+// custom: slide the element out to the right with a 2-second duration
+el.ghost('r', { duration: 2 });
+
+// common config options shown with default values
+el.ghost('b', {
+    easing: 'easeOut',
+    duration: .5
+    remove: false,
+    useDisplay: false
+});
+</code></pre>
+        * @param {String} anchor (optional) One of the valid Fx anchor positions (defaults to bottom: 'b')
+        * @param {Object} options (optional) Object literal with any of the Fx config options
+        * @return {Roo.Element} The Element
+        */
+    ghost : function(anchor, o){
+        var el = this.getFxEl();
+        o = o || {};
+
+        el.queueFx(o, function(){
+            anchor = anchor || "b";
+
+            // restore values after effect
+            var r = this.getFxRestore();
+            var w = this.getWidth(),
+                h = this.getHeight();
+
+            var st = this.dom.style;
+
+            var after = function(){
+                if(o.useDisplay){
+                    el.setDisplayed(false);
+                }else{
+                    el.hide();
+                }
+
+                el.clearOpacity();
+                el.setPositioning(r.pos);
+                st.width = r.width;
+                st.height = r.height;
+
+                el.afterFx(o);
+            };
+
+            var a = {opacity: {to: 0}, points: {}}, pt = a.points;
+            switch(anchor.toLowerCase()){
+                case "t":
+                    pt.by = [0, -h];
+                break;
+                case "l":
+                    pt.by = [-w, 0];
+                break;
+                case "r":
+                    pt.by = [w, 0];
+                break;
+                case "b":
+                    pt.by = [0, h];
+                break;
+                case "tl":
+                    pt.by = [-w, -h];
+                break;
+                case "bl":
+                    pt.by = [-w, h];
+                break;
+                case "br":
+                    pt.by = [w, h];
+                break;
+                case "tr":
+                    pt.by = [w, -h];
+                break;
+            }
+
+            arguments.callee.anim = this.fxanim(a,
+                o,
+                'motion',
+                .5,
+                "easeOut", after);
+        });
+        return this;
+    },
+
+       /**
+        * Ensures that all effects queued after syncFx is called on the element are
+        * run concurrently.  This is the opposite of {@link #sequenceFx}.
+        * @return {Roo.Element} The Element
+        */
+    syncFx : function(){
+        this.fxDefaults = Roo.apply(this.fxDefaults || {}, {
+            block : false,
+            concurrent : true,
+            stopFx : false
+        });
+        return this;
+    },
+
+       /**
+        * Ensures that all effects queued after sequenceFx is called on the element are
+        * run in sequence.  This is the opposite of {@link #syncFx}.
+        * @return {Roo.Element} The Element
+        */
+    sequenceFx : function(){
+        this.fxDefaults = Roo.apply(this.fxDefaults || {}, {
+            block : false,
+            concurrent : false,
+            stopFx : false
+        });
+        return this;
+    },
+
+       /* @private */
+    nextFx : function(){
+        var ef = this.fxQueue[0];
+        if(ef){
+            ef.call(this);
+        }
+    },
+
+       /**
+        * Returns true if the element has any effects actively running or queued, else returns false.
+        * @return {Boolean} True if element has active effects, else false
+        */
+    hasActiveFx : function(){
+        return this.fxQueue && this.fxQueue[0];
+    },
+
+       /**
+        * Stops any running effects and clears the element's internal effects queue if it contains
+        * any additional effects that haven't started yet.
+        * @return {Roo.Element} The Element
+        */
+    stopFx : function(){
+        if(this.hasActiveFx()){
+            var cur = this.fxQueue[0];
+            if(cur && cur.anim && cur.anim.isAnimated()){
+                this.fxQueue = [cur]; // clear out others
+                cur.anim.stop(true);
+            }
+        }
+        return this;
+    },
+
+       /* @private */
+    beforeFx : function(o){
+        if(this.hasActiveFx() && !o.concurrent){
+           if(o.stopFx){
+               this.stopFx();
+               return true;
+           }
+           return false;
+        }
+        return true;
+    },
+
+       /**
+        * Returns true if the element is currently blocking so that no other effect can be queued
+        * until this effect is finished, else returns false if blocking is not set.  This is commonly
+        * used to ensure that an effect initiated by a user action runs to completion prior to the
+        * same effect being restarted (e.g., firing only one effect even if the user clicks several times).
+        * @return {Boolean} True if blocking, else false
+        */
+    hasFxBlock : function(){
+        var q = this.fxQueue;
+        return q && q[0] && q[0].block;
+    },
+
+       /* @private */
+    queueFx : function(o, fn){
+        if(!this.fxQueue){
+            this.fxQueue = [];
+        }
+        if(!this.hasFxBlock()){
+            Roo.applyIf(o, this.fxDefaults);
+            if(!o.concurrent){
+                var run = this.beforeFx(o);
+                fn.block = o.block;
+                this.fxQueue.push(fn);
+                if(run){
+                    this.nextFx();
+                }
+            }else{
+                fn.call(this);
+            }
+        }
+        return this;
+    },
+
+       /* @private */
+    fxWrap : function(pos, o, vis){
+        var wrap;
+        if(!o.wrap || !(wrap = Roo.get(o.wrap))){
+            var wrapXY;
+            if(o.fixPosition){
+                wrapXY = this.getXY();
+            }
+            var div = document.createElement("div");
+            div.style.visibility = vis;
+            wrap = Roo.get(this.dom.parentNode.insertBefore(div, this.dom));
+            wrap.setPositioning(pos);
+            if(wrap.getStyle("position") == "static"){
+                wrap.position("relative");
+            }
+            this.clearPositioning('auto');
+            wrap.clip();
+            wrap.dom.appendChild(this.dom);
+            if(wrapXY){
+                wrap.setXY(wrapXY);
+            }
+        }
+        return wrap;
+    },
+
+       /* @private */
+    fxUnwrap : function(wrap, pos, o){
+        this.clearPositioning();
+        this.setPositioning(pos);
+        if(!o.wrap){
+            wrap.dom.parentNode.insertBefore(this.dom, wrap.dom);
+            wrap.remove();
+        }
+    },
+
+       /* @private */
+    getFxRestore : function(){
+        var st = this.dom.style;
+        return {pos: this.getPositioning(), width: st.width, height : st.height};
+    },
+
+       /* @private */
+    afterFx : function(o){
+        if(o.afterStyle){
+            this.applyStyles(o.afterStyle);
+        }
+        if(o.afterCls){
+            this.addClass(o.afterCls);
+        }
+        if(o.remove === true){
+            this.remove();
+        }
+        Roo.callback(o.callback, o.scope, [this]);
+        if(!o.concurrent){
+            this.fxQueue.shift();
+            this.nextFx();
+        }
+    },
+
+       /* @private */
+    getFxEl : function(){ // support for composite element fx
+        return Roo.get(this.dom);
+    },
+
+       /* @private */
+    fxanim : function(args, opt, animType, defaultDur, defaultEase, cb){
+        animType = animType || 'run';
+        opt = opt || {};
+        var anim = Roo.lib.Anim[animType](
+            this.dom, args,
+            (opt.duration || defaultDur) || .35,
+            (opt.easing || defaultEase) || 'easeOut',
+            function(){
+                Roo.callback(cb, this);
+            },
+            this
+        );
+        opt.anim = anim;
+        return anim;
+    }
+};
+
+// backwords compat
+Roo.Fx.resize = Roo.Fx.scale;
+
+//When included, Roo.Fx is automatically applied to Element so that all basic
+//effects are available directly via the Element API
+Roo.apply(Roo.Element.prototype, Roo.Fx);
\ No newline at end of file
diff --git a/Roo/JsonView.js b/Roo/JsonView.js
new file mode 100644 (file)
index 0000000..620a811
--- /dev/null
@@ -0,0 +1,304 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+
+/**
+ * @class Roo.JsonView
+ * @extends Roo.View
+ * Shortcut class to create a JSON + {@link Roo.UpdateManager} template view. Usage:
+<pre><code>
+var view = new Roo.JsonView("my-element",
+    '&lt;div id="{id}"&gt;{foo} - {bar}&lt;/div&gt;', // auto create template
+    { multiSelect: true, jsonRoot: "data" }
+);
+
+// listen for node click?
+view.on("click", function(vw, index, node, e){
+    alert('Node "' + node.id + '" at index: ' + index + " was clicked.");
+});
+
+// direct load of JSON data
+view.load("foobar.php");
+
+// Example from my blog list
+var tpl = new Roo.Template(
+    '&lt;div class="entry"&gt;' +
+    '&lt;a class="entry-title" href="{link}"&gt;{title}&lt;/a&gt;' +
+    "&lt;h4&gt;{date} by {author} | {comments} Comments&lt;/h4&gt;{description}" +
+    "&lt;/div&gt;&lt;hr /&gt;"
+);
+
+var moreView = new Roo.JsonView("entry-list", tpl, {
+    jsonRoot: "posts"
+});
+moreView.on("beforerender", this.sortEntries, this);
+moreView.load({
+    url: "/blog/get-posts.php",
+    params: "allposts=true",
+    text: "Loading Blog Entries..."
+});
+</code></pre>
+ * @constructor
+ * Create a new JsonView
+ * @param {String/HTMLElement/Element} container The container element where the view is to be rendered.
+ * @param {Template} tpl The rendering template
+ * @param {Object} config The config object
+ */
+Roo.JsonView = function(container, tpl, config){
+    Roo.JsonView.superclass.constructor.call(this, container, tpl, config);
+
+    var um = this.el.getUpdateManager();
+    um.setRenderer(this);
+    um.on("update", this.onLoad, this);
+    um.on("failure", this.onLoadException, this);
+
+    /**
+     * @event beforerender
+     * Fires before rendering of the downloaded JSON data.
+     * @param {Roo.JsonView} this
+     * @param {Object} data The JSON data loaded
+     */
+    /**
+     * @event load
+     * Fires when data is loaded.
+     * @param {Roo.JsonView} this
+     * @param {Object} data The JSON data loaded
+     * @param {Object} response The raw Connect response object
+     */
+    /**
+     * @event loadexception
+     * Fires when loading fails.
+     * @param {Roo.JsonView} this
+     * @param {Object} response The raw Connect response object
+     */
+    this.addEvents({
+        'beforerender' : true,
+        'load' : true,
+        'loadexception' : true
+    });
+};
+Roo.extend(Roo.JsonView, Roo.View, {
+    /**
+     * The root property in the loaded JSON object that contains the data
+     * @type {String}
+     */
+    jsonRoot : "",
+
+    /**
+     * Refreshes the view.
+     */
+    refresh : function(){
+        this.clearSelections();
+        this.el.update("");
+        var html = [];
+        var o = this.jsonData;
+        if(o && o.length > 0){
+            for(var i = 0, len = o.length; i < len; i++){
+                var data = this.prepareData(o[i], i, o);
+                html[html.length] = this.tpl.apply(data);
+            }
+        }else{
+            html.push(this.emptyText);
+        }
+        this.el.update(html.join(""));
+        this.nodes = this.el.dom.childNodes;
+        this.updateIndexes(0);
+    },
+
+    /**
+     * Performs an async HTTP request, and loads the JSON from the response. If <i>params</i> are specified it uses POST, otherwise it uses GET.
+     * @param {Object/String/Function} url The URL for this request, or a function to call to get the URL, or a config object containing any of the following options:
+     <pre><code>
+     view.load({
+         url: "your-url.php",
+         params: {param1: "foo", param2: "bar"}, // or a URL encoded string
+         callback: yourFunction,
+         scope: yourObject, //(optional scope)
+         discardUrl: false,
+         nocache: false,
+         text: "Loading...",
+         timeout: 30,
+         scripts: false
+     });
+     </code></pre>
+     * The only required property is <i>url</i>. The optional properties <i>nocache</i>, <i>text</i> and <i>scripts</i>
+     * are respectively shorthand for <i>disableCaching</i>, <i>indicatorText</i>, and <i>loadScripts</i> and are used to set their associated property on this UpdateManager instance.
+     * @param {String/Object} params (optional) The parameters to pass, as either a URL encoded string "param1=1&amp;param2=2" or an object {param1: 1, param2: 2}
+     * @param {Function} callback (optional) Callback when transaction is complete - called with signature (oElement, bSuccess)
+     * @param {Boolean} discardUrl (optional) By default when you execute an update the defaultUrl is changed to the last used URL. If true, it will not store the URL.
+     */
+    load : function(){
+        var um = this.el.getUpdateManager();
+        um.update.apply(um, arguments);
+    },
+
+    render : function(el, response){
+        this.clearSelections();
+        this.el.update("");
+        var o;
+        try{
+            o = Roo.util.JSON.decode(response.responseText);
+            if(this.jsonRoot){
+                
+                o = /** eval:var:o */ eval("o." + this.jsonRoot);
+            }
+        } catch(e){
+        }
+        /**
+         * The current JSON data or null
+         */
+        this.jsonData = o;
+        this.beforeRender();
+        this.refresh();
+    },
+
+/**
+ * Get the number of records in the current JSON dataset
+ * @return {Number}
+ */
+    getCount : function(){
+        return this.jsonData ? this.jsonData.length : 0;
+    },
+
+/**
+ * Returns the JSON object for the specified node(s)
+ * @param {HTMLElement/Array} node The node or an array of nodes
+ * @return {Object/Array} If you pass in an array, you get an array back, otherwise
+ * you get the JSON object for the node
+ */
+    getNodeData : function(node){
+        if(node instanceof Array){
+            var data = [];
+            for(var i = 0, len = node.length; i < len; i++){
+                data.push(this.getNodeData(node[i]));
+            }
+            return data;
+        }
+        return this.jsonData[this.indexOf(node)] || null;
+    },
+
+    beforeRender : function(){
+        this.snapshot = this.jsonData;
+        if(this.sortInfo){
+            this.sort.apply(this, this.sortInfo);
+        }
+        this.fireEvent("beforerender", this, this.jsonData);
+    },
+
+    onLoad : function(el, o){
+        this.fireEvent("load", this, this.jsonData, o);
+    },
+
+    onLoadException : function(el, o){
+        this.fireEvent("loadexception", this, o);
+    },
+
+/**
+ * Filter the data by a specific property.
+ * @param {String} property A property on your JSON objects
+ * @param {String/RegExp} value Either string that the property values
+ * should start with, or a RegExp to test against the property
+ */
+    filter : function(property, value){
+        if(this.jsonData){
+            var data = [];
+            var ss = this.snapshot;
+            if(typeof value == "string"){
+                var vlen = value.length;
+                if(vlen == 0){
+                    this.clearFilter();
+                    return;
+                }
+                value = value.toLowerCase();
+                for(var i = 0, len = ss.length; i < len; i++){
+                    var o = ss[i];
+                    if(o[property].substr(0, vlen).toLowerCase() == value){
+                        data.push(o);
+                    }
+                }
+            } else if(value.exec){ // regex?
+                for(var i = 0, len = ss.length; i < len; i++){
+                    var o = ss[i];
+                    if(value.test(o[property])){
+                        data.push(o);
+                    }
+                }
+            } else{
+                return;
+            }
+            this.jsonData = data;
+            this.refresh();
+        }
+    },
+
+/**
+ * Filter by a function. The passed function will be called with each
+ * object in the current dataset. If the function returns true the value is kept,
+ * otherwise it is filtered.
+ * @param {Function} fn
+ * @param {Object} scope (optional) The scope of the function (defaults to this JsonView)
+ */
+    filterBy : function(fn, scope){
+        if(this.jsonData){
+            var data = [];
+            var ss = this.snapshot;
+            for(var i = 0, len = ss.length; i < len; i++){
+                var o = ss[i];
+                if(fn.call(scope || this, o)){
+                    data.push(o);
+                }
+            }
+            this.jsonData = data;
+            this.refresh();
+        }
+    },
+
+/**
+ * Clears the current filter.
+ */
+    clearFilter : function(){
+        if(this.snapshot && this.jsonData != this.snapshot){
+            this.jsonData = this.snapshot;
+            this.refresh();
+        }
+    },
+
+
+/**
+ * Sorts the data for this view and refreshes it.
+ * @param {String} property A property on your JSON objects to sort on
+ * @param {String} direction (optional) "desc" or "asc" (defaults to "asc")
+ * @param {Function} sortType (optional) A function to call to convert the data to a sortable value.
+ */
+    sort : function(property, dir, sortType){
+        this.sortInfo = Array.prototype.slice.call(arguments, 0);
+        if(this.jsonData){
+            var p = property;
+            var dsc = dir && dir.toLowerCase() == "desc";
+            var f = function(o1, o2){
+                var v1 = sortType ? sortType(o1[p]) : o1[p];
+                var v2 = sortType ? sortType(o2[p]) : o2[p];
+                ;
+                if(v1 < v2){
+                    return dsc ? +1 : -1;
+                } else if(v1 > v2){
+                    return dsc ? -1 : +1;
+                } else{
+                    return 0;
+                }
+            };
+            this.jsonData.sort(f);
+            this.refresh();
+            if(this.jsonData != this.snapshot){
+                this.snapshot.sort(f);
+            }
+        }
+    }
+});
\ No newline at end of file
diff --git a/Roo/KeyMap.js b/Roo/KeyMap.js
new file mode 100644 (file)
index 0000000..534c347
--- /dev/null
@@ -0,0 +1,222 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+
+/**
+ * @class Roo.KeyMap
+ * Handles mapping keys to actions for an element. One key map can be used for multiple actions.
+ * The constructor accepts the same config object as defined by {@link #addBinding}.
+ * If you bind a callback function to a KeyMap, anytime the KeyMap handles an expected key
+ * combination it will call the function with this signature (if the match is a multi-key
+ * combination the callback will still be called only once): (String key, Roo.EventObject e)
+ * A KeyMap can also handle a string representation of keys.<br />
+ * Usage:
+ <pre><code>
+// map one key by key code
+var map = new Roo.KeyMap("my-element", {
+    key: 13, // or Roo.EventObject.ENTER
+    fn: myHandler,
+    scope: myObject
+});
+
+// map multiple keys to one action by string
+var map = new Roo.KeyMap("my-element", {
+    key: "a\r\n\t",
+    fn: myHandler,
+    scope: myObject
+});
+
+// map multiple keys to multiple actions by strings and array of codes
+var map = new Roo.KeyMap("my-element", [
+    {
+        key: [10,13],
+        fn: function(){ alert("Return was pressed"); }
+    }, {
+        key: "abc",
+        fn: function(){ alert('a, b or c was pressed'); }
+    }, {
+        key: "\t",
+        ctrl:true,
+        shift:true,
+        fn: function(){ alert('Control + shift + tab was pressed.'); }
+    }
+]);
+</code></pre>
+ * <b>Note: A KeyMap starts enabled</b>
+ * @constructor
+ * @param {String/HTMLElement/Roo.Element} el The element to bind to
+ * @param {Object} config The config (see {@link #addBinding})
+ * @param {String} eventName (optional) The event to bind to (defaults to "keydown")
+ */
+Roo.KeyMap = function(el, config, eventName){
+    this.el  = Roo.get(el);
+    this.eventName = eventName || "keydown";
+    this.bindings = [];
+    if(config){
+        this.addBinding(config);
+    }
+    this.enable();
+};
+
+Roo.KeyMap.prototype = {
+    /**
+     * True to stop the event from bubbling and prevent the default browser action if the
+     * key was handled by the KeyMap (defaults to false)
+     * @type Boolean
+     */
+    stopEvent : false,
+
+    /**
+     * Add a new binding to this KeyMap. The following config object properties are supported:
+     * <pre>
+Property    Type             Description
+----------  ---------------  ----------------------------------------------------------------------
+key         String/Array     A single keycode or an array of keycodes to handle
+shift       Boolean          True to handle key only when shift is pressed (defaults to false)
+ctrl        Boolean          True to handle key only when ctrl is pressed (defaults to false)
+alt         Boolean          True to handle key only when alt is pressed (defaults to false)
+fn          Function         The function to call when KeyMap finds the expected key combination
+scope       Object           The scope of the callback function
+</pre>
+     *
+     * Usage:
+     * <pre><code>
+// Create a KeyMap
+var map = new Roo.KeyMap(document, {
+    key: Roo.EventObject.ENTER,
+    fn: handleKey,
+    scope: this
+});
+
+//Add a new binding to the existing KeyMap later
+map.addBinding({
+    key: 'abc',
+    shift: true,
+    fn: handleKey,
+    scope: this
+});
+</code></pre>
+     * @param {Object/Array} config A single KeyMap config or an array of configs
+     */
+       addBinding : function(config){
+        if(config instanceof Array){
+            for(var i = 0, len = config.length; i < len; i++){
+                this.addBinding(config[i]);
+            }
+            return;
+        }
+        var keyCode = config.key,
+            shift = config.shift, 
+            ctrl = config.ctrl, 
+            alt = config.alt,
+            fn = config.fn,
+            scope = config.scope;
+        if(typeof keyCode == "string"){
+            var ks = [];
+            var keyString = keyCode.toUpperCase();
+            for(var j = 0, len = keyString.length; j < len; j++){
+                ks.push(keyString.charCodeAt(j));
+            }
+            keyCode = ks;
+        }
+        var keyArray = keyCode instanceof Array;
+        var handler = function(e){
+            if((!shift || e.shiftKey) && (!ctrl || e.ctrlKey) &&  (!alt || e.altKey)){
+                var k = e.getKey();
+                if(keyArray){
+                    for(var i = 0, len = keyCode.length; i < len; i++){
+                        if(keyCode[i] == k){
+                          if(this.stopEvent){
+                              e.stopEvent();
+                          }
+                          fn.call(scope || window, k, e);
+                          return;
+                        }
+                    }
+                }else{
+                    if(k == keyCode){
+                        if(this.stopEvent){
+                           e.stopEvent();
+                        }
+                        fn.call(scope || window, k, e);
+                    }
+                }
+            }
+        };
+        this.bindings.push(handler);  
+       },
+
+    /**
+     * Shorthand for adding a single key listener
+     * @param {Number/Array/Object} key Either the numeric key code, array of key codes or an object with the
+     * following options:
+     * {key: (number or array), shift: (true/false), ctrl: (true/false), alt: (true/false)}
+     * @param {Function} fn The function to call
+     * @param {Object} scope (optional) The scope of the function
+     */
+    on : function(key, fn, scope){
+        var keyCode, shift, ctrl, alt;
+        if(typeof key == "object" && !(key instanceof Array)){
+            keyCode = key.key;
+            shift = key.shift;
+            ctrl = key.ctrl;
+            alt = key.alt;
+        }else{
+            keyCode = key;
+        }
+        this.addBinding({
+            key: keyCode,
+            shift: shift,
+            ctrl: ctrl,
+            alt: alt,
+            fn: fn,
+            scope: scope
+        })
+    },
+
+    // private
+    handleKeyDown : function(e){
+           if(this.enabled){ //just in case
+           var b = this.bindings;
+           for(var i = 0, len = b.length; i < len; i++){
+               b[i].call(this, e);
+           }
+           }
+       },
+       
+       /**
+        * Returns true if this KeyMap is enabled
+        * @return {Boolean} 
+        */
+       isEnabled : function(){
+           return this.enabled;  
+       },
+       
+       /**
+        * Enables this KeyMap
+        */
+       enable: function(){
+               if(!this.enabled){
+                   this.el.on(this.eventName, this.handleKeyDown, this);
+                   this.enabled = true;
+               }
+       },
+
+       /**
+        * Disable this KeyMap
+        */
+       disable: function(){
+               if(this.enabled){
+                   this.el.removeListener(this.eventName, this.handleKeyDown, this);
+                   this.enabled = false;
+               }
+       }
+};
\ No newline at end of file
diff --git a/Roo/KeyNav.js b/Roo/KeyNav.js
new file mode 100644 (file)
index 0000000..309d97d
--- /dev/null
@@ -0,0 +1,157 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+
+/**
+ * @class Roo.KeyNav
+ * <p>Provides a convenient wrapper for normalized keyboard navigation.  KeyNav allows you to bind
+ * navigation keys to function calls that will get called when the keys are pressed, providing an easy
+ * way to implement custom navigation schemes for any UI component.</p>
+ * <p>The following are all of the possible keys that can be implemented: enter, left, right, up, down, tab, esc,
+ * pageUp, pageDown, del, home, end.  Usage:</p>
+ <pre><code>
+var nav = new Roo.KeyNav("my-element", {
+    "left" : function(e){
+        this.moveLeft(e.ctrlKey);
+    },
+    "right" : function(e){
+        this.moveRight(e.ctrlKey);
+    },
+    "enter" : function(e){
+        this.save();
+    },
+    scope : this
+});
+</code></pre>
+ * @constructor
+ * @param {String/HTMLElement/Roo.Element} el The element to bind to
+ * @param {Object} config The config
+ */
+Roo.KeyNav = function(el, config){
+    this.el = Roo.get(el);
+    Roo.apply(this, config);
+    if(!this.disabled){
+        this.disabled = true;
+        this.enable();
+    }
+};
+
+Roo.KeyNav.prototype = {
+    /**
+     * @cfg {Boolean} disabled
+     * True to disable this KeyNav instance (defaults to false)
+     */
+    disabled : false,
+    /**
+     * @cfg {String} defaultEventAction
+     * The method to call on the {@link Roo.EventObject} after this KeyNav intercepts a key.  Valid values are
+     * {@link Roo.EventObject#stopEvent}, {@link Roo.EventObject#preventDefault} and
+     * {@link Roo.EventObject#stopPropagation} (defaults to 'stopEvent')
+     */
+    defaultEventAction: "stopEvent",
+    /**
+     * @cfg {Boolean} forceKeyDown
+     * Handle the keydown event instead of keypress (defaults to false).  KeyNav automatically does this for IE since
+     * IE does not propagate special keys on keypress, but setting this to true will force other browsers to also
+     * handle keydown instead of keypress.
+     */
+    forceKeyDown : false,
+
+    // private
+    prepareEvent : function(e){
+        var k = e.getKey();
+        var h = this.keyToHandler[k];
+        //if(h && this[h]){
+        //    e.stopPropagation();
+        //}
+        if(Roo.isSafari && h && k >= 37 && k <= 40){
+            e.stopEvent();
+        }
+    },
+
+    // private
+    relay : function(e){
+        var k = e.getKey();
+        var h = this.keyToHandler[k];
+        if(h && this[h]){
+            if(this.doRelay(e, this[h], h) !== true){
+                e[this.defaultEventAction]();
+            }
+        }
+    },
+
+    // private
+    doRelay : function(e, h, hname){
+        return h.call(this.scope || this, e);
+    },
+
+    // possible handlers
+    enter : false,
+    left : false,
+    right : false,
+    up : false,
+    down : false,
+    tab : false,
+    esc : false,
+    pageUp : false,
+    pageDown : false,
+    del : false,
+    home : false,
+    end : false,
+
+    // quick lookup hash
+    keyToHandler : {
+        37 : "left",
+        39 : "right",
+        38 : "up",
+        40 : "down",
+        33 : "pageUp",
+        34 : "pageDown",
+        46 : "del",
+        36 : "home",
+        35 : "end",
+        13 : "enter",
+        27 : "esc",
+        9  : "tab"
+    },
+
+       /**
+        * Enable this KeyNav
+        */
+       enable: function(){
+               if(this.disabled){
+            // ie won't do special keys on keypress, no one else will repeat keys with keydown
+            // the EventObject will normalize Safari automatically
+            if(this.forceKeyDown || Roo.isIE || Roo.isAir){
+                this.el.on("keydown", this.relay,  this);
+            }else{
+                this.el.on("keydown", this.prepareEvent,  this);
+                this.el.on("keypress", this.relay,  this);
+            }
+                   this.disabled = false;
+               }
+       },
+
+       /**
+        * Disable this KeyNav
+        */
+       disable: function(){
+               if(!this.disabled){
+                   if(this.forceKeyDown || Roo.isIE || Roo.isAir){
+                this.el.un("keydown", this.relay);
+            }else{
+                this.el.un("keydown", this.prepareEvent);
+                this.el.un("keypress", this.relay);
+            }
+                   this.disabled = true;
+               }
+       }
+};
\ No newline at end of file
diff --git a/Roo/Layer.js b/Roo/Layer.js
new file mode 100644 (file)
index 0000000..de190b0
--- /dev/null
@@ -0,0 +1,458 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+ (function(){ 
+/**
+ * @class Roo.Layer
+ * @extends Roo.Element
+ * An extended {@link Roo.Element} object that supports a shadow and shim, constrain to viewport and
+ * automatic maintaining of shadow/shim positions.
+ * @cfg {Boolean} shim False to disable the iframe shim in browsers which need one (defaults to true)
+ * @cfg {String/Boolean} shadow True to create a shadow element with default class "x-layer-shadow", or
+ * you can pass a string with a CSS class name. False turns off the shadow.
+ * @cfg {Object} dh DomHelper object config to create element with (defaults to {tag: "div", cls: "x-layer"}).
+ * @cfg {Boolean} constrain False to disable constrain to viewport (defaults to true)
+ * @cfg {String} cls CSS class to add to the element
+ * @cfg {Number} zindex Starting z-index (defaults to 11000)
+ * @cfg {Number} shadowOffset Number of pixels to offset the shadow (defaults to 3)
+ * @constructor
+ * @param {Object} config An object with config options.
+ * @param {String/HTMLElement} existingEl (optional) Uses an existing DOM element. If the element is not found it creates it.
+ */
+
+Roo.Layer = function(config, existingEl){
+    config = config || {};
+    var dh = Roo.DomHelper;
+    var cp = config.parentEl, pel = cp ? Roo.getDom(cp) : document.body;
+    if(existingEl){
+        this.dom = Roo.getDom(existingEl);
+    }
+    if(!this.dom){
+        var o = config.dh || {tag: "div", cls: "x-layer"};
+        this.dom = dh.append(pel, o);
+    }
+    if(config.cls){
+        this.addClass(config.cls);
+    }
+    this.constrain = config.constrain !== false;
+    this.visibilityMode = Roo.Element.VISIBILITY;
+    if(config.id){
+        this.id = this.dom.id = config.id;
+    }else{
+        this.id = Roo.id(this.dom);
+    }
+    this.zindex = config.zindex || this.getZIndex();
+    this.position("absolute", this.zindex);
+    if(config.shadow){
+        this.shadowOffset = config.shadowOffset || 4;
+        this.shadow = new Roo.Shadow({
+            offset : this.shadowOffset,
+            mode : config.shadow
+        });
+    }else{
+        this.shadowOffset = 0;
+    }
+    this.useShim = config.shim !== false && Roo.useShims;
+    this.useDisplay = config.useDisplay;
+    this.hide();
+};
+
+var supr = Roo.Element.prototype;
+
+// shims are shared among layer to keep from having 100 iframes
+var shims = [];
+
+Roo.extend(Roo.Layer, Roo.Element, {
+
+    getZIndex : function(){
+        return this.zindex || parseInt(this.getStyle("z-index"), 10) || 11000;
+    },
+
+    getShim : function(){
+        if(!this.useShim){
+            return null;
+        }
+        if(this.shim){
+            return this.shim;
+        }
+        var shim = shims.shift();
+        if(!shim){
+            shim = this.createShim();
+            shim.enableDisplayMode('block');
+            shim.dom.style.display = 'none';
+            shim.dom.style.visibility = 'visible';
+        }
+        var pn = this.dom.parentNode;
+        if(shim.dom.parentNode != pn){
+            pn.insertBefore(shim.dom, this.dom);
+        }
+        shim.setStyle('z-index', this.getZIndex()-2);
+        this.shim = shim;
+        return shim;
+    },
+
+    hideShim : function(){
+        if(this.shim){
+            this.shim.setDisplayed(false);
+            shims.push(this.shim);
+            delete this.shim;
+        }
+    },
+
+    disableShadow : function(){
+        if(this.shadow){
+            this.shadowDisabled = true;
+            this.shadow.hide();
+            this.lastShadowOffset = this.shadowOffset;
+            this.shadowOffset = 0;
+        }
+    },
+
+    enableShadow : function(show){
+        if(this.shadow){
+            this.shadowDisabled = false;
+            this.shadowOffset = this.lastShadowOffset;
+            delete this.lastShadowOffset;
+            if(show){
+                this.sync(true);
+            }
+        }
+    },
+
+    // private
+    // this code can execute repeatedly in milliseconds (i.e. during a drag) so
+    // code size was sacrificed for effeciency (e.g. no getBox/setBox, no XY calls)
+    sync : function(doShow){
+        var sw = this.shadow;
+        if(!this.updating && this.isVisible() && (sw || this.useShim)){
+            var sh = this.getShim();
+
+            var w = this.getWidth(),
+                h = this.getHeight();
+
+            var l = this.getLeft(true),
+                t = this.getTop(true);
+
+            if(sw && !this.shadowDisabled){
+                if(doShow && !sw.isVisible()){
+                    sw.show(this);
+                }else{
+                    sw.realign(l, t, w, h);
+                }
+                if(sh){
+                    if(doShow){
+                       sh.show();
+                    }
+                    // fit the shim behind the shadow, so it is shimmed too
+                    var a = sw.adjusts, s = sh.dom.style;
+                    s.left = (Math.min(l, l+a.l))+"px";
+                    s.top = (Math.min(t, t+a.t))+"px";
+                    s.width = (w+a.w)+"px";
+                    s.height = (h+a.h)+"px";
+                }
+            }else if(sh){
+                if(doShow){
+                   sh.show();
+                }
+                sh.setSize(w, h);
+                sh.setLeftTop(l, t);
+            }
+            
+        }
+    },
+
+    // private
+    destroy : function(){
+        this.hideShim();
+        if(this.shadow){
+            this.shadow.hide();
+        }
+        this.removeAllListeners();
+        var pn = this.dom.parentNode;
+        if(pn){
+            pn.removeChild(this.dom);
+        }
+        Roo.Element.uncache(this.id);
+    },
+
+    remove : function(){
+        this.destroy();
+    },
+
+    // private
+    beginUpdate : function(){
+        this.updating = true;
+    },
+
+    // private
+    endUpdate : function(){
+        this.updating = false;
+        this.sync(true);
+    },
+
+    // private
+    hideUnders : function(negOffset){
+        if(this.shadow){
+            this.shadow.hide();
+        }
+        this.hideShim();
+    },
+
+    // private
+    constrainXY : function(){
+        if(this.constrain){
+            var vw = Roo.lib.Dom.getViewWidth(),
+                vh = Roo.lib.Dom.getViewHeight();
+            var s = Roo.get(document).getScroll();
+
+            var xy = this.getXY();
+            var x = xy[0], y = xy[1];   
+            var w = this.dom.offsetWidth+this.shadowOffset, h = this.dom.offsetHeight+this.shadowOffset;
+            // only move it if it needs it
+            var moved = false;
+            // first validate right/bottom
+            if((x + w) > vw+s.left){
+                x = vw - w - this.shadowOffset;
+                moved = true;
+            }
+            if((y + h) > vh+s.top){
+                y = vh - h - this.shadowOffset;
+                moved = true;
+            }
+            // then make sure top/left isn't negative
+            if(x < s.left){
+                x = s.left;
+                moved = true;
+            }
+            if(y < s.top){
+                y = s.top;
+                moved = true;
+            }
+            if(moved){
+                if(this.avoidY){
+                    var ay = this.avoidY;
+                    if(y <= ay && (y+h) >= ay){
+                        y = ay-h-5;   
+                    }
+                }
+                xy = [x, y];
+                this.storeXY(xy);
+                supr.setXY.call(this, xy);
+                this.sync();
+            }
+        }
+    },
+
+    isVisible : function(){
+        return this.visible;    
+    },
+
+    // private
+    showAction : function(){
+        this.visible = true; // track visibility to prevent getStyle calls
+        if(this.useDisplay === true){
+            this.setDisplayed("");
+        }else if(this.lastXY){
+            supr.setXY.call(this, this.lastXY);
+        }else if(this.lastLT){
+            supr.setLeftTop.call(this, this.lastLT[0], this.lastLT[1]);
+        }
+    },
+
+    // private
+    hideAction : function(){
+        this.visible = false;
+        if(this.useDisplay === true){
+            this.setDisplayed(false);
+        }else{
+            this.setLeftTop(-10000,-10000);
+        }
+    },
+
+    // overridden Element method
+    setVisible : function(v, a, d, c, e){
+        if(v){
+            this.showAction();
+        }
+        if(a && v){
+            var cb = function(){
+                this.sync(true);
+                if(c){
+                    c();
+                }
+            }.createDelegate(this);
+            supr.setVisible.call(this, true, true, d, cb, e);
+        }else{
+            if(!v){
+                this.hideUnders(true);
+            }
+            var cb = c;
+            if(a){
+                cb = function(){
+                    this.hideAction();
+                    if(c){
+                        c();
+                    }
+                }.createDelegate(this);
+            }
+            supr.setVisible.call(this, v, a, d, cb, e);
+            if(v){
+                this.sync(true);
+            }else if(!a){
+                this.hideAction();
+            }
+        }
+    },
+
+    storeXY : function(xy){
+        delete this.lastLT;
+        this.lastXY = xy;
+    },
+
+    storeLeftTop : function(left, top){
+        delete this.lastXY;
+        this.lastLT = [left, top];
+    },
+
+    // private
+    beforeFx : function(){
+        this.beforeAction();
+        return Roo.Layer.superclass.beforeFx.apply(this, arguments);
+    },
+
+    // private
+    afterFx : function(){
+        Roo.Layer.superclass.afterFx.apply(this, arguments);
+        this.sync(this.isVisible());
+    },
+
+    // private
+    beforeAction : function(){
+        if(!this.updating && this.shadow){
+            this.shadow.hide();
+        }
+    },
+
+    // overridden Element method
+    setLeft : function(left){
+        this.storeLeftTop(left, this.getTop(true));
+        supr.setLeft.apply(this, arguments);
+        this.sync();
+    },
+
+    setTop : function(top){
+        this.storeLeftTop(this.getLeft(true), top);
+        supr.setTop.apply(this, arguments);
+        this.sync();
+    },
+
+    setLeftTop : function(left, top){
+        this.storeLeftTop(left, top);
+        supr.setLeftTop.apply(this, arguments);
+        this.sync();
+    },
+
+    setXY : function(xy, a, d, c, e){
+        this.fixDisplay();
+        this.beforeAction();
+        this.storeXY(xy);
+        var cb = this.createCB(c);
+        supr.setXY.call(this, xy, a, d, cb, e);
+        if(!a){
+            cb();
+        }
+    },
+
+    // private
+    createCB : function(c){
+        var el = this;
+        return function(){
+            el.constrainXY();
+            el.sync(true);
+            if(c){
+                c();
+            }
+        };
+    },
+
+    // overridden Element method
+    setX : function(x, a, d, c, e){
+        this.setXY([x, this.getY()], a, d, c, e);
+    },
+
+    // overridden Element method
+    setY : function(y, a, d, c, e){
+        this.setXY([this.getX(), y], a, d, c, e);
+    },
+
+    // overridden Element method
+    setSize : function(w, h, a, d, c, e){
+        this.beforeAction();
+        var cb = this.createCB(c);
+        supr.setSize.call(this, w, h, a, d, cb, e);
+        if(!a){
+            cb();
+        }
+    },
+
+    // overridden Element method
+    setWidth : function(w, a, d, c, e){
+        this.beforeAction();
+        var cb = this.createCB(c);
+        supr.setWidth.call(this, w, a, d, cb, e);
+        if(!a){
+            cb();
+        }
+    },
+
+    // overridden Element method
+    setHeight : function(h, a, d, c, e){
+        this.beforeAction();
+        var cb = this.createCB(c);
+        supr.setHeight.call(this, h, a, d, cb, e);
+        if(!a){
+            cb();
+        }
+    },
+
+    // overridden Element method
+    setBounds : function(x, y, w, h, a, d, c, e){
+        this.beforeAction();
+        var cb = this.createCB(c);
+        if(!a){
+            this.storeXY([x, y]);
+            supr.setXY.call(this, [x, y]);
+            supr.setSize.call(this, w, h, a, d, cb, e);
+            cb();
+        }else{
+            supr.setBounds.call(this, x, y, w, h, a, d, cb, e);
+        }
+        return this;
+    },
+    
+    /**
+     * Sets the z-index of this layer and adjusts any shadow and shim z-indexes. The layer z-index is automatically
+     * incremented by two more than the value passed in so that it always shows above any shadow or shim (the shadow
+     * element, if any, will be assigned z-index + 1, and the shim element, if any, will be assigned the unmodified z-index).
+     * @param {Number} zindex The new z-index to set
+     * @return {this} The Layer
+     */
+    setZIndex : function(zindex){
+        this.zindex = zindex;
+        this.setStyle("z-index", zindex + 2);
+        if(this.shadow){
+            this.shadow.setZIndex(zindex + 1);
+        }
+        if(this.shim){
+            this.shim.setStyle("z-index", zindex);
+        }
+    }
+});
+})();
\ No newline at end of file
diff --git a/Roo/LayoutManager.js b/Roo/LayoutManager.js
new file mode 100644 (file)
index 0000000..f7d7c7f
--- /dev/null
@@ -0,0 +1,146 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+/**
+ * @class Roo.LayoutManager
+ * @extends Roo.util.Observable
+ * Base class for layout managers.
+ */
+Roo.LayoutManager = function(container, config){
+    Roo.LayoutManager.superclass.constructor.call(this);
+    this.el = Roo.get(container);
+    // ie scrollbar fix
+    if(this.el.dom == document.body && Roo.isIE && !config.allowScroll){
+        document.body.scroll = "no";
+    }else if(this.el.dom != document.body && this.el.getStyle('position') == 'static'){
+        this.el.position('relative');
+    }
+    this.id = this.el.id;
+    this.el.addClass("x-layout-container");
+    /** false to disable window resize monitoring @type Boolean */
+    this.monitorWindowResize = true;
+    this.regions = {};
+    this.addEvents({
+        /**
+         * @event layout
+         * Fires when a layout is performed. 
+         * @param {Roo.LayoutManager} this
+         */
+        "layout" : true,
+        /**
+         * @event regionresized
+         * Fires when the user resizes a region. 
+         * @param {Roo.LayoutRegion} region The resized region
+         * @param {Number} newSize The new size (width for east/west, height for north/south)
+         */
+        "regionresized" : true,
+        /**
+         * @event regioncollapsed
+         * Fires when a region is collapsed. 
+         * @param {Roo.LayoutRegion} region The collapsed region
+         */
+        "regioncollapsed" : true,
+        /**
+         * @event regionexpanded
+         * Fires when a region is expanded.  
+         * @param {Roo.LayoutRegion} region The expanded region
+         */
+        "regionexpanded" : true
+    });
+    this.updating = false;
+    Roo.EventManager.onWindowResize(this.onWindowResize, this, true);
+};
+
+Roo.extend(Roo.LayoutManager, Roo.util.Observable, {
+    /**
+     * Returns true if this layout is currently being updated
+     * @return {Boolean}
+     */
+    isUpdating : function(){
+        return this.updating; 
+    },
+    
+    /**
+     * Suspend the LayoutManager from doing auto-layouts while
+     * making multiple add or remove calls
+     */
+    beginUpdate : function(){
+        this.updating = true;    
+    },
+    
+    /**
+     * Restore auto-layouts and optionally disable the manager from performing a layout
+     * @param {Boolean} noLayout true to disable a layout update 
+     */
+    endUpdate : function(noLayout){
+        this.updating = false;
+        if(!noLayout){
+            this.layout();
+        }    
+    },
+    
+    layout: function(){
+        
+    },
+    
+    onRegionResized : function(region, newSize){
+        this.fireEvent("regionresized", region, newSize);
+        this.layout();
+    },
+    
+    onRegionCollapsed : function(region){
+        this.fireEvent("regioncollapsed", region);
+    },
+    
+    onRegionExpanded : function(region){
+        this.fireEvent("regionexpanded", region);
+    },
+        
+    /**
+     * Returns the size of the current view. This method normalizes document.body and element embedded layouts and
+     * performs box-model adjustments.
+     * @return {Object} The size as an object {width: (the width), height: (the height)}
+     */
+    getViewSize : function(){
+        var size;
+        if(this.el.dom != document.body){
+            size = this.el.getSize();
+        }else{
+            size = {width: Roo.lib.Dom.getViewWidth(), height: Roo.lib.Dom.getViewHeight()};
+        }
+        size.width -= this.el.getBorderWidth("lr")-this.el.getPadding("lr");
+        size.height -= this.el.getBorderWidth("tb")-this.el.getPadding("tb");
+        return size;
+    },
+    
+    /**
+     * Returns the Element this layout is bound to.
+     * @return {Roo.Element}
+     */
+    getEl : function(){
+        return this.el;
+    },
+    
+    /**
+     * Returns the specified region.
+     * @param {String} target The region key ('center', 'north', 'south', 'east' or 'west')
+     * @return {Roo.LayoutRegion}
+     */
+    getRegion : function(target){
+        return this.regions[target.toLowerCase()];
+    },
+    
+    onWindowResize : function(){
+        if(this.monitorWindowResize){
+            this.layout();
+        }
+    }
+});
\ No newline at end of file
diff --git a/Roo/LayoutRegion.js b/Roo/LayoutRegion.js
new file mode 100644 (file)
index 0000000..09f2561
--- /dev/null
@@ -0,0 +1,602 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+/**
+ * @class Roo.LayoutRegion
+ * @extends Roo.BasicLayoutRegion
+ * This class represents a region in a layout manager.
+ * @cfg {Boolean} collapsible False to disable collapsing (defaults to true)
+ * @cfg {Boolean} collapsed True to set the initial display to collapsed (defaults to false)
+ * @cfg {Boolean} floatable False to disable floating (defaults to true)
+ * @cfg {Object} margins Margins for the element (defaults to {top: 0, left: 0, right:0, bottom: 0})
+ * @cfg {Object} cmargins Margins for the element when collapsed (defaults to: north/south {top: 2, left: 0, right:0, bottom: 2} or east/west {top: 0, left: 2, right:2, bottom: 0})
+ * @cfg {String} tabPosition "top" or "bottom" (defaults to "bottom")
+ * @cfg {String} collapsedTitle Optional string message to display in the collapsed block of a north or south region
+ * @cfg {Boolean} alwaysShowTabs True to always display tabs even when there is only 1 panel (defaults to false)
+ * @cfg {Boolean} autoScroll True to enable overflow scrolling (defaults to false)
+ * @cfg {Boolean} titlebar True to display a title bar (defaults to true)
+ * @cfg {String} title The title for the region (overrides panel titles)
+ * @cfg {Boolean} animate True to animate expand/collapse (defaults to false)
+ * @cfg {Boolean} autoHide False to disable auto hiding when the mouse leaves the "floated" region (defaults to true)
+ * @cfg {Boolean} preservePanels True to preserve removed panels so they can be readded later (defaults to false)
+ * @cfg {Boolean} closeOnTab True to place the close icon on the tabs instead of the region titlebar (defaults to false)
+ * @cfg {Boolean} hideTabs True to hide the tab strip (defaults to false)
+ * @cfg {Boolean} resizeTabs True to enable automatic tab resizing. This will resize the tabs so they are all the same size and fit within
+ * the space available, similar to FireFox 1.5 tabs (defaults to false)
+ * @cfg {Number} minTabWidth The minimum tab width (defaults to 40)
+ * @cfg {Number} preferredTabWidth The preferred tab width (defaults to 150)
+ * @cfg {Boolean} showPin True to show a pin button
+* @cfg {Boolean} hidden True to start the region hidden (defaults to false)
+* @cfg {Boolean} hideWhenEmpty True to hide the region when it has no panels
+* @cfg {Boolean} disableTabTips True to disable tab tooltips
+* @cfg {Number} width  For East/West panels
+* @cfg {Number} height For North/South panels
+* @cfg {Boolean} split To show the splitter
+ */
+Roo.LayoutRegion = function(mgr, config, pos){
+    Roo.LayoutRegion.superclass.constructor.call(this, mgr, config, pos, true);
+    var dh = Roo.DomHelper;
+    /** This region's container element 
+    * @type Roo.Element */
+    this.el = dh.append(mgr.el.dom, {tag: "div", cls: "x-layout-panel x-layout-panel-" + this.position}, true);
+    /** This region's title element 
+    * @type Roo.Element */
+
+    this.titleEl = dh.append(this.el.dom, {tag: "div", unselectable: "on", cls: "x-unselectable x-layout-panel-hd x-layout-title-"+this.position, children:[
+        {tag: "span", cls: "x-unselectable x-layout-panel-hd-text", unselectable: "on", html: "&#160;"},
+        {tag: "div", cls: "x-unselectable x-layout-panel-hd-tools", unselectable: "on"}
+    ]}, true);
+    this.titleEl.enableDisplayMode();
+    /** This region's title text element 
+    * @type HTMLElement */
+    this.titleTextEl = this.titleEl.dom.firstChild;
+    this.tools = Roo.get(this.titleEl.dom.childNodes[1], true);
+    this.closeBtn = this.createTool(this.tools.dom, "x-layout-close");
+    this.closeBtn.enableDisplayMode();
+    this.closeBtn.on("click", this.closeClicked, this);
+    this.closeBtn.hide();
+
+    this.createBody(config);
+    this.visible = true;
+    this.collapsed = false;
+
+    if(config.hideWhenEmpty){
+        this.hide();
+        this.on("paneladded", this.validateVisibility, this);
+        this.on("panelremoved", this.validateVisibility, this);
+    }
+    this.applyConfig(config);
+};
+
+Roo.extend(Roo.LayoutRegion, Roo.BasicLayoutRegion, {
+
+    createBody : function(){
+        /** This region's body element 
+        * @type Roo.Element */
+        this.bodyEl = this.el.createChild({tag: "div", cls: "x-layout-panel-body"});
+    },
+
+    applyConfig : function(c){
+        if(c.collapsible && this.position != "center" && !this.collapsedEl){
+            var dh = Roo.DomHelper;
+            if(c.titlebar !== false){
+                this.collapseBtn = this.createTool(this.tools.dom, "x-layout-collapse-"+this.position);
+                this.collapseBtn.on("click", this.collapse, this);
+                this.collapseBtn.enableDisplayMode();
+
+                if(c.showPin === true || this.showPin){
+                    this.stickBtn = this.createTool(this.tools.dom, "x-layout-stick");
+                    this.stickBtn.enableDisplayMode();
+                    this.stickBtn.on("click", this.expand, this);
+                    this.stickBtn.hide();
+                }
+            }
+            /** This region's collapsed element
+            * @type Roo.Element */
+            this.collapsedEl = dh.append(this.mgr.el.dom, {cls: "x-layout-collapsed x-layout-collapsed-"+this.position, children:[
+                {cls: "x-layout-collapsed-tools", children:[{cls: "x-layout-ctools-inner"}]}
+            ]}, true);
+            if(c.floatable !== false){
+               this.collapsedEl.addClassOnOver("x-layout-collapsed-over");
+               this.collapsedEl.on("click", this.collapseClick, this);
+            }
+
+            if(c.collapsedTitle && (this.position == "north" || this.position== "south")) {
+                this.collapsedTitleTextEl = dh.append(this.collapsedEl.dom, {tag: "div", cls: "x-unselectable x-layout-panel-hd-text",
+                   id: "message", unselectable: "on", style:{"float":"left"}});
+               this.collapsedTitleTextEl.innerHTML = c.collapsedTitle;
+             }
+            this.expandBtn = this.createTool(this.collapsedEl.dom.firstChild.firstChild, "x-layout-expand-"+this.position);
+            this.expandBtn.on("click", this.expand, this);
+        }
+        if(this.collapseBtn){
+            this.collapseBtn.setVisible(c.collapsible == true);
+        }
+        this.cmargins = c.cmargins || this.cmargins ||
+                         (this.position == "west" || this.position == "east" ?
+                             {top: 0, left: 2, right:2, bottom: 0} :
+                             {top: 2, left: 0, right:0, bottom: 2});
+        this.margins = c.margins || this.margins || {top: 0, left: 0, right:0, bottom: 0};
+        this.bottomTabs = c.tabPosition != "top";
+        this.autoScroll = c.autoScroll || false;
+        if(this.autoScroll){
+            this.bodyEl.setStyle("overflow", "auto");
+        }else{
+            this.bodyEl.setStyle("overflow", "hidden");
+        }
+        //if(c.titlebar !== false){
+            if((!c.titlebar && !c.title) || c.titlebar === false){
+                this.titleEl.hide();
+            }else{
+                this.titleEl.show();
+                if(c.title){
+                    this.titleTextEl.innerHTML = c.title;
+                }
+            }
+        //}
+        this.duration = c.duration || .30;
+        this.slideDuration = c.slideDuration || .45;
+        this.config = c;
+        if(c.collapsed){
+            this.collapse(true);
+        }
+        if(c.hidden){
+            this.hide();
+        }
+    },
+    /**
+     * Returns true if this region is currently visible.
+     * @return {Boolean}
+     */
+    isVisible : function(){
+        return this.visible;
+    },
+
+    /**
+     * Updates the title for collapsed north/south regions (used with {@link #collapsedTitle} config option)
+     * @param {String} title (optional) The title text (accepts HTML markup, defaults to the numeric character reference for a non-breaking space, "&amp;#160;")
+     */
+    setCollapsedTitle : function(title){
+        title = title || "&#160;";
+        if(this.collapsedTitleTextEl){
+            this.collapsedTitleTextEl.innerHTML = title;
+        }
+    },
+
+    getBox : function(){
+        var b;
+        if(!this.collapsed){
+            b = this.el.getBox(false, true);
+        }else{
+            b = this.collapsedEl.getBox(false, true);
+        }
+        return b;
+    },
+
+    getMargins : function(){
+        return this.collapsed ? this.cmargins : this.margins;
+    },
+
+    highlight : function(){
+        this.el.addClass("x-layout-panel-dragover");
+    },
+
+    unhighlight : function(){
+        this.el.removeClass("x-layout-panel-dragover");
+    },
+
+    updateBox : function(box){
+        this.box = box;
+        if(!this.collapsed){
+            this.el.dom.style.left = box.x + "px";
+            this.el.dom.style.top = box.y + "px";
+            this.updateBody(box.width, box.height);
+        }else{
+            this.collapsedEl.dom.style.left = box.x + "px";
+            this.collapsedEl.dom.style.top = box.y + "px";
+            this.collapsedEl.setSize(box.width, box.height);
+        }
+        if(this.tabs){
+            this.tabs.autoSizeTabs();
+        }
+    },
+
+    updateBody : function(w, h){
+        if(w !== null){
+            this.el.setWidth(w);
+            w -= this.el.getBorderWidth("rl");
+            if(this.config.adjustments){
+                w += this.config.adjustments[0];
+            }
+        }
+        if(h !== null){
+            this.el.setHeight(h);
+            h = this.titleEl && this.titleEl.isDisplayed() ? h - (this.titleEl.getHeight()||0) : h;
+            h -= this.el.getBorderWidth("tb");
+            if(this.config.adjustments){
+                h += this.config.adjustments[1];
+            }
+            this.bodyEl.setHeight(h);
+            if(this.tabs){
+                h = this.tabs.syncHeight(h);
+            }
+        }
+        if(this.panelSize){
+            w = w !== null ? w : this.panelSize.width;
+            h = h !== null ? h : this.panelSize.height;
+        }
+        if(this.activePanel){
+            var el = this.activePanel.getEl();
+            w = w !== null ? w : el.getWidth();
+            h = h !== null ? h : el.getHeight();
+            this.panelSize = {width: w, height: h};
+            this.activePanel.setSize(w, h);
+        }
+        if(Roo.isIE && this.tabs){
+            this.tabs.el.repaint();
+        }
+    },
+
+    /**
+     * Returns the container element for this region.
+     * @return {Roo.Element}
+     */
+    getEl : function(){
+        return this.el;
+    },
+
+    /**
+     * Hides this region.
+     */
+    hide : function(){
+        if(!this.collapsed){
+            this.el.dom.style.left = "-2000px";
+            this.el.hide();
+        }else{
+            this.collapsedEl.dom.style.left = "-2000px";
+            this.collapsedEl.hide();
+        }
+        this.visible = false;
+        this.fireEvent("visibilitychange", this, false);
+    },
+
+    /**
+     * Shows this region if it was previously hidden.
+     */
+    show : function(){
+        if(!this.collapsed){
+            this.el.show();
+        }else{
+            this.collapsedEl.show();
+        }
+        this.visible = true;
+        this.fireEvent("visibilitychange", this, true);
+    },
+
+    closeClicked : function(){
+        if(this.activePanel){
+            this.remove(this.activePanel);
+        }
+    },
+
+    collapseClick : function(e){
+        if(this.isSlid){
+           e.stopPropagation();
+           this.slideIn();
+        }else{
+           e.stopPropagation();
+           this.slideOut();
+        }
+    },
+
+    /**
+     * Collapses this region.
+     * @param {Boolean} skipAnim (optional) true to collapse the element without animation (if animate is true)
+     */
+    collapse : function(skipAnim){
+        if(this.collapsed) return;
+        this.collapsed = true;
+        if(this.split){
+            this.split.el.hide();
+        }
+        if(this.config.animate && skipAnim !== true){
+            this.fireEvent("invalidated", this);
+            this.animateCollapse();
+        }else{
+            this.el.setLocation(-20000,-20000);
+            this.el.hide();
+            this.collapsedEl.show();
+            this.fireEvent("collapsed", this);
+            this.fireEvent("invalidated", this);
+        }
+    },
+
+    animateCollapse : function(){
+        // overridden
+    },
+
+    /**
+     * Expands this region if it was previously collapsed.
+     * @param {Roo.EventObject} e The event that triggered the expand (or null if calling manually)
+     * @param {Boolean} skipAnim (optional) true to expand the element without animation (if animate is true)
+     */
+    expand : function(e, skipAnim){
+        if(e) e.stopPropagation();
+        if(!this.collapsed || this.el.hasActiveFx()) return;
+        if(this.isSlid){
+            this.afterSlideIn();
+            skipAnim = true;
+        }
+        this.collapsed = false;
+        if(this.config.animate && skipAnim !== true){
+            this.animateExpand();
+        }else{
+            this.el.show();
+            if(this.split){
+                this.split.el.show();
+            }
+            this.collapsedEl.setLocation(-2000,-2000);
+            this.collapsedEl.hide();
+            this.fireEvent("invalidated", this);
+            this.fireEvent("expanded", this);
+        }
+    },
+
+    animateExpand : function(){
+        // overridden
+    },
+
+    initTabs : function(){
+        this.bodyEl.setStyle("overflow", "hidden");
+        var ts = new Roo.TabPanel(this.bodyEl.dom, {
+            tabPosition: this.bottomTabs ? 'bottom' : 'top',
+            disableTooltips: this.config.disableTabTips
+        });
+        if(this.config.hideTabs){
+            ts.stripWrap.setDisplayed(false);
+        }
+        this.tabs = ts;
+        ts.resizeTabs = this.config.resizeTabs === true;
+        ts.minTabWidth = this.config.minTabWidth || 40;
+        ts.maxTabWidth = this.config.maxTabWidth || 250;
+        ts.preferredTabWidth = this.config.preferredTabWidth || 150;
+        ts.monitorResize = false;
+        ts.bodyEl.setStyle("overflow", this.config.autoScroll ? "auto" : "hidden");
+        ts.bodyEl.addClass('x-layout-tabs-body');
+        this.panels.each(this.initPanelAsTab, this);
+    },
+
+    initPanelAsTab : function(panel){
+        var ti = this.tabs.addTab(panel.getEl().id, panel.getTitle(), null,
+                    this.config.closeOnTab && panel.isClosable());
+        if(panel.tabTip !== undefined){
+            ti.setTooltip(panel.tabTip);
+        }
+        ti.on("activate", function(){
+              this.setActivePanel(panel);
+        }, this);
+        if(this.config.closeOnTab){
+            ti.on("beforeclose", function(t, e){
+                e.cancel = true;
+                this.remove(panel);
+            }, this);
+        }
+        return ti;
+    },
+
+    updatePanelTitle : function(panel, title){
+        if(this.activePanel == panel){
+            this.updateTitle(title);
+        }
+        if(this.tabs){
+            var ti = this.tabs.getTab(panel.getEl().id);
+            ti.setText(title);
+            if(panel.tabTip !== undefined){
+                ti.setTooltip(panel.tabTip);
+            }
+        }
+    },
+
+    updateTitle : function(title){
+        if(this.titleTextEl && !this.config.title){
+            this.titleTextEl.innerHTML = (typeof title != "undefined" && title.length > 0 ? title : "&#160;");
+        }
+    },
+
+    setActivePanel : function(panel){
+        panel = this.getPanel(panel);
+        if(this.activePanel && this.activePanel != panel){
+            this.activePanel.setActiveState(false);
+        }
+        this.activePanel = panel;
+        panel.setActiveState(true);
+        if(this.panelSize){
+            panel.setSize(this.panelSize.width, this.panelSize.height);
+        }
+        if(this.closeBtn){
+            this.closeBtn.setVisible(!this.config.closeOnTab && !this.isSlid && panel.isClosable());
+        }
+        this.updateTitle(panel.getTitle());
+        if(this.tabs){
+            this.fireEvent("invalidated", this);
+        }
+        this.fireEvent("panelactivated", this, panel);
+    },
+
+    /**
+     * Shows the specified panel.
+     * @param {Number/String/ContentPanel} panelId The panel's index, id or the panel itself
+     * @return {Roo.ContentPanel} The shown panel, or null if a panel could not be found from panelId
+     */
+    showPanel : function(panel){
+        if(panel = this.getPanel(panel)){
+            if(this.tabs){
+                var tab = this.tabs.getTab(panel.getEl().id);
+                if(tab.isHidden()){
+                    this.tabs.unhideTab(tab.id);
+                }
+                tab.activate();
+            }else{
+                this.setActivePanel(panel);
+            }
+        }
+        return panel;
+    },
+
+    /**
+     * Get the active panel for this region.
+     * @return {Roo.ContentPanel} The active panel or null
+     */
+    getActivePanel : function(){
+        return this.activePanel;
+    },
+
+    validateVisibility : function(){
+        if(this.panels.getCount() < 1){
+            this.updateTitle("&#160;");
+            this.closeBtn.hide();
+            this.hide();
+        }else{
+            if(!this.isVisible()){
+                this.show();
+            }
+        }
+    },
+
+    /**
+     * Adds the passed ContentPanel(s) to this region.
+     * @param {ContentPanel...} panel The ContentPanel(s) to add (you can pass more than one)
+     * @return {Roo.ContentPanel} The panel added (if only one was added; null otherwise)
+     */
+    add : function(panel){
+        if(arguments.length > 1){
+            for(var i = 0, len = arguments.length; i < len; i++) {
+                this.add(arguments[i]);
+            }
+            return null;
+        }
+        if(this.hasPanel(panel)){
+            this.showPanel(panel);
+            return panel;
+        }
+        panel.setRegion(this);
+        this.panels.add(panel);
+        if(this.panels.getCount() == 1 && !this.config.alwaysShowTabs){
+            this.bodyEl.dom.appendChild(panel.getEl().dom);
+            if(panel.background !== true){
+                this.setActivePanel(panel);
+            }
+            this.fireEvent("paneladded", this, panel);
+            return panel;
+        }
+        if(!this.tabs){
+            this.initTabs();
+        }else{
+            this.initPanelAsTab(panel);
+        }
+        if(panel.background !== true){
+            this.tabs.activate(panel.getEl().id);
+        }
+        this.fireEvent("paneladded", this, panel);
+        return panel;
+    },
+
+    /**
+     * Hides the tab for the specified panel.
+     * @param {Number/String/ContentPanel} panel The panel's index, id or the panel itself
+     */
+    hidePanel : function(panel){
+        if(this.tabs && (panel = this.getPanel(panel))){
+            this.tabs.hideTab(panel.getEl().id);
+        }
+    },
+
+    /**
+     * Unhides the tab for a previously hidden panel.
+     * @param {Number/String/ContentPanel} panel The panel's index, id or the panel itself
+     */
+    unhidePanel : function(panel){
+        if(this.tabs && (panel = this.getPanel(panel))){
+            this.tabs.unhideTab(panel.getEl().id);
+        }
+    },
+
+    clearPanels : function(){
+        while(this.panels.getCount() > 0){
+             this.remove(this.panels.first());
+        }
+    },
+
+    /**
+     * Removes the specified panel. If preservePanel is not true (either here or in the config), the panel is destroyed.
+     * @param {Number/String/ContentPanel} panel The panel's index, id or the panel itself
+     * @param {Boolean} preservePanel Overrides the config preservePanel option
+     * @return {Roo.ContentPanel} The panel that was removed
+     */
+    remove : function(panel, preservePanel){
+        panel = this.getPanel(panel);
+        if(!panel){
+            return null;
+        }
+        var e = {};
+        this.fireEvent("beforeremove", this, panel, e);
+        if(e.cancel === true){
+            return null;
+        }
+        preservePanel = (typeof preservePanel != "undefined" ? preservePanel : (this.config.preservePanels === true || panel.preserve === true));
+        var panelId = panel.getId();
+        this.panels.removeKey(panelId);
+        if(preservePanel){
+            document.body.appendChild(panel.getEl().dom);
+        }
+        if(this.tabs){
+            this.tabs.removeTab(panel.getEl().id);
+        }else if (!preservePanel){
+            this.bodyEl.dom.removeChild(panel.getEl().dom);
+        }
+        if(this.panels.getCount() == 1 && this.tabs && !this.config.alwaysShowTabs){
+            var p = this.panels.first();
+            var tempEl = document.createElement("div"); // temp holder to keep IE from deleting the node
+            tempEl.appendChild(p.getEl().dom);
+            this.bodyEl.update("");
+            this.bodyEl.dom.appendChild(p.getEl().dom);
+            tempEl = null;
+            this.updateTitle(p.getTitle());
+            this.tabs = null;
+            this.bodyEl.setStyle("overflow", this.config.autoScroll ? "auto" : "hidden");
+            this.setActivePanel(p);
+        }
+        panel.setRegion(null);
+        if(this.activePanel == panel){
+            this.activePanel = null;
+        }
+        if(this.config.autoDestroy !== false && preservePanel !== true){
+            try{panel.destroy();}catch(e){}
+        }
+        this.fireEvent("panelremoved", this, panel);
+        return panel;
+    },
+
+    /**
+     * Returns the TabPanel component used by this region
+     * @return {Roo.TabPanel}
+     */
+    getTabs : function(){
+        return this.tabs;
+    },
+
+    createTool : function(parentEl, className){
+        var btn = Roo.DomHelper.append(parentEl, {tag: "div", cls: "x-layout-tools-button",
+            children: [{tag: "div", cls: "x-layout-tools-button-inner " + className, html: "&#160;"}]}, true);
+        btn.addClassOnOver("x-layout-tools-button-over");
+        return btn;
+    }
+});
\ No newline at end of file
diff --git a/Roo/LayoutStateManager.js b/Roo/LayoutStateManager.js
new file mode 100644 (file)
index 0000000..e3e2337
--- /dev/null
@@ -0,0 +1,80 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+/*
+ * Private internal class for reading and applying state
+ */
+Roo.LayoutStateManager = function(layout){
+     // default empty state
+     this.state = {
+        north: {},
+        south: {},
+        east: {},
+        west: {}       
+    };
+};
+
+Roo.LayoutStateManager.prototype = {
+    init : function(layout, provider){
+        this.provider = provider;
+        var state = provider.get(layout.id+"-layout-state");
+        if(state){
+            var wasUpdating = layout.isUpdating();
+            if(!wasUpdating){
+                layout.beginUpdate();
+            }
+            for(var key in state){
+                if(typeof state[key] != "function"){
+                    var rstate = state[key];
+                    var r = layout.getRegion(key);
+                    if(r && rstate){
+                        if(rstate.size){
+                            r.resizeTo(rstate.size);
+                        }
+                        if(rstate.collapsed == true){
+                            r.collapse(true);
+                        }else{
+                            r.expand(null, true);
+                        }
+                    }
+                }
+            }
+            if(!wasUpdating){
+                layout.endUpdate();
+            }
+            this.state = state; 
+        }
+        this.layout = layout;
+        layout.on("regionresized", this.onRegionResized, this);
+        layout.on("regioncollapsed", this.onRegionCollapsed, this);
+        layout.on("regionexpanded", this.onRegionExpanded, this);
+    },
+    
+    storeState : function(){
+        this.provider.set(this.layout.id+"-layout-state", this.state);
+    },
+    
+    onRegionResized : function(region, newSize){
+        this.state[region.getPosition()].size = newSize;
+        this.storeState();
+    },
+    
+    onRegionCollapsed : function(region){
+        this.state[region.getPosition()].collapsed = true;
+        this.storeState();
+    },
+    
+    onRegionExpanded : function(region){
+        this.state[region.getPosition()].collapsed = false;
+        this.storeState();
+    }
+};
\ No newline at end of file
diff --git a/Roo/LoadMask.js b/Roo/LoadMask.js
new file mode 100644 (file)
index 0000000..8d7d8f5
--- /dev/null
@@ -0,0 +1,103 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+/**
+ * @class Roo.LoadMask
+ * A simple utility class for generically masking elements while loading data.  If the element being masked has
+ * an underlying {@link Roo.data.Store}, the masking will be automatically synchronized with the store's loading
+ * process and the mask element will be cached for reuse.  For all other elements, this mask will replace the
+ * element's UpdateManager load indicator and will be destroyed after the initial load.
+ * @constructor
+ * Create a new LoadMask
+ * @param {String/HTMLElement/Roo.Element} el The element or DOM node, or its id
+ * @param {Object} config The config object
+ */
+Roo.LoadMask = function(el, config){
+    this.el = Roo.get(el);
+    Roo.apply(this, config);
+    if(this.store){
+        this.store.on('beforeload', this.onBeforeLoad, this);
+        this.store.on('load', this.onLoad, this);
+        this.store.on('loadexception', this.onLoad, this);
+        this.removeMask = false;
+    }else{
+        var um = this.el.getUpdateManager();
+        um.showLoadIndicator = false; // disable the default indicator
+        um.on('beforeupdate', this.onBeforeLoad, this);
+        um.on('update', this.onLoad, this);
+        um.on('failure', this.onLoad, this);
+        this.removeMask = true;
+    }
+};
+
+Roo.LoadMask.prototype = {
+    /**
+     * @cfg {Boolean} removeMask
+     * True to create a single-use mask that is automatically destroyed after loading (useful for page loads),
+     * False to persist the mask element reference for multiple uses (e.g., for paged data widgets).  Defaults to false.
+     */
+    /**
+     * @cfg {String} msg
+     * The text to display in a centered loading message box (defaults to 'Loading...')
+     */
+    msg : 'Loading...',
+    /**
+     * @cfg {String} msgCls
+     * The CSS class to apply to the loading message element (defaults to "x-mask-loading")
+     */
+    msgCls : 'x-mask-loading',
+
+    /**
+     * Read-only. True if the mask is currently disabled so that it will not be displayed (defaults to false)
+     * @type Boolean
+     */
+    disabled: false,
+
+    /**
+     * Disables the mask to prevent it from being displayed
+     */
+    disable : function(){
+       this.disabled = true;
+    },
+
+    /**
+     * Enables the mask so that it can be displayed
+     */
+    enable : function(){
+        this.disabled = false;
+    },
+
+    // private
+    onLoad : function(){
+        this.el.unmask(this.removeMask);
+    },
+
+    // private
+    onBeforeLoad : function(){
+        if(!this.disabled){
+            this.el.mask(this.msg, this.msgCls);
+        }
+    },
+
+    // private
+    destroy : function(){
+        if(this.store){
+            this.store.un('beforeload', this.onBeforeLoad, this);
+            this.store.un('load', this.onLoad, this);
+            this.store.un('loadexception', this.onLoad, this);
+        }else{
+            var um = this.el.getUpdateManager();
+            um.un('beforeupdate', this.onBeforeLoad, this);
+            um.un('update', this.onLoad, this);
+            um.un('failure', this.onLoad, this);
+        }
+    }
+};
\ No newline at end of file
diff --git a/Roo/MasterTemplate.js b/Roo/MasterTemplate.js
new file mode 100644 (file)
index 0000000..86104ef
--- /dev/null
@@ -0,0 +1,153 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+
+
+
+/**
+ * @class Roo.MasterTemplate
+ * @extends Roo.Template
+ * Provides a template that can have child templates. The syntax is:
+<pre><code>
+var t = new Roo.MasterTemplate(
+       '&lt;select name="{name}"&gt;',
+               '&lt;tpl name="options"&gt;&lt;option value="{value:trim}"&gt;{text:ellipsis(10)}&lt;/option&gt;&lt;/tpl&gt;',
+       '&lt;/select&gt;'
+);
+t.add('options', {value: 'foo', text: 'bar'});
+// or you can add multiple child elements in one shot
+t.addAll('options', [
+    {value: 'foo', text: 'bar'},
+    {value: 'foo2', text: 'bar2'},
+    {value: 'foo3', text: 'bar3'}
+]);
+// then append, applying the master template values
+t.append('my-form', {name: 'my-select'});
+</code></pre>
+* A name attribute for the child template is not required if you have only one child
+* template or you want to refer to them by index.
+ */
+Roo.MasterTemplate = function(){
+    Roo.MasterTemplate.superclass.constructor.apply(this, arguments);
+    this.originalHtml = this.html;
+    var st = {};
+    var m, re = this.subTemplateRe;
+    re.lastIndex = 0;
+    var subIndex = 0;
+    while(m = re.exec(this.html)){
+        var name = m[1], content = m[2];
+        st[subIndex] = {
+            name: name,
+            index: subIndex,
+            buffer: [],
+            tpl : new Roo.Template(content)
+        };
+        if(name){
+            st[name] = st[subIndex];
+        }
+        st[subIndex].tpl.compile();
+        st[subIndex].tpl.call = this.call.createDelegate(this);
+        subIndex++;
+    }
+    this.subCount = subIndex;
+    this.subs = st;
+};
+Roo.extend(Roo.MasterTemplate, Roo.Template, {
+    /**
+    * The regular expression used to match sub templates
+    * @type RegExp
+    * @property
+    */
+    subTemplateRe : /<tpl(?:\sname="([\w-]+)")?>((?:.|\n)*?)<\/tpl>/gi,
+
+    /**
+     * Applies the passed values to a child template.
+     * @param {String/Number} name (optional) The name or index of the child template
+     * @param {Array/Object} values The values to be applied to the template
+     * @return {MasterTemplate} this
+     */
+     add : function(name, values){
+        if(arguments.length == 1){
+            values = arguments[0];
+            name = 0;
+        }
+        var s = this.subs[name];
+        s.buffer[s.buffer.length] = s.tpl.apply(values);
+        return this;
+    },
+
+    /**
+     * Applies all the passed values to a child template.
+     * @param {String/Number} name (optional) The name or index of the child template
+     * @param {Array} values The values to be applied to the template, this should be an array of objects.
+     * @param {Boolean} reset (optional) True to reset the template first
+     * @return {MasterTemplate} this
+     */
+    fill : function(name, values, reset){
+        var a = arguments;
+        if(a.length == 1 || (a.length == 2 && typeof a[1] == "boolean")){
+            values = a[0];
+            name = 0;
+            reset = a[1];
+        }
+        if(reset){
+            this.reset();
+        }
+        for(var i = 0, len = values.length; i < len; i++){
+            this.add(name, values[i]);
+        }
+        return this;
+    },
+
+    /**
+     * Resets the template for reuse
+     * @return {MasterTemplate} this
+     */
+     reset : function(){
+        var s = this.subs;
+        for(var i = 0; i < this.subCount; i++){
+            s[i].buffer = [];
+        }
+        return this;
+    },
+
+    applyTemplate : function(values){
+        var s = this.subs;
+        var replaceIndex = -1;
+        this.html = this.originalHtml.replace(this.subTemplateRe, function(m, name){
+            return s[++replaceIndex].buffer.join("");
+        });
+        return Roo.MasterTemplate.superclass.applyTemplate.call(this, values);
+    },
+
+    apply : function(){
+        return this.applyTemplate.apply(this, arguments);
+    },
+
+    compile : function(){return this;}
+});
+
+/**
+ * Alias for fill().
+ * @method
+ */
+Roo.MasterTemplate.prototype.addAll = Roo.MasterTemplate.prototype.fill;
+ /**
+ * Creates a template from the passed element's value (display:none textarea, preferred) or innerHTML. e.g.
+ * var tpl = Roo.MasterTemplate.from('element-id');
+ * @param {String/HTMLElement} el
+ * @param {Object} config
+ * @static
+ */
+Roo.MasterTemplate.from = function(el, config){
+    el = Roo.getDom(el);
+    return new Roo.MasterTemplate(el.value || el.innerHTML, config || '');
+};
\ No newline at end of file
diff --git a/Roo/MessageBox.js b/Roo/MessageBox.js
new file mode 100644 (file)
index 0000000..43fb3fd
--- /dev/null
@@ -0,0 +1,519 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+/**
+ * @class Roo.MessageBox
+ * Utility class for generating different styles of message boxes.  The alias Roo.Msg can also be used.
+ * Example usage:
+ *<pre><code>
+// Basic alert:
+Roo.Msg.alert('Status', 'Changes saved successfully.');
+
+// Prompt for user data:
+Roo.Msg.prompt('Name', 'Please enter your name:', function(btn, text){
+    if (btn == 'ok'){
+        // process text value...
+    }
+});
+
+// Show a dialog using config options:
+Roo.Msg.show({
+   title:'Save Changes?',
+   msg: 'Your are closing a tab that has unsaved changes. Would you like to save your changes?',
+   buttons: Roo.Msg.YESNOCANCEL,
+   fn: processResult,
+   animEl: 'elId'
+});
+</code></pre>
+ * @singleton
+ */
+Roo.MessageBox = function(){
+    var dlg, opt, mask, waitTimer;
+    var bodyEl, msgEl, textboxEl, textareaEl, progressEl, pp;
+    var buttons, activeTextEl, bwidth;
+
+    // private
+    var handleButton = function(button){
+        dlg.hide();
+        Roo.callback(opt.fn, opt.scope||window, [button, activeTextEl.dom.value], 1);
+    };
+
+    // private
+    var handleHide = function(){
+        if(opt && opt.cls){
+            dlg.el.removeClass(opt.cls);
+        }
+        if(waitTimer){
+            Roo.TaskMgr.stop(waitTimer);
+            waitTimer = null;
+        }
+    };
+
+    // private
+    var updateButtons = function(b){
+        var width = 0;
+        if(!b){
+            buttons["ok"].hide();
+            buttons["cancel"].hide();
+            buttons["yes"].hide();
+            buttons["no"].hide();
+            dlg.footer.dom.style.display = 'none';
+            return width;
+        }
+        dlg.footer.dom.style.display = '';
+        for(var k in buttons){
+            if(typeof buttons[k] != "function"){
+                if(b[k]){
+                    buttons[k].show();
+                    buttons[k].setText(typeof b[k] == "string" ? b[k] : Roo.MessageBox.buttonText[k]);
+                    width += buttons[k].el.getWidth()+15;
+                }else{
+                    buttons[k].hide();
+                }
+            }
+        }
+        return width;
+    };
+
+    // private
+    var handleEsc = function(d, k, e){
+        if(opt && opt.closable !== false){
+            dlg.hide();
+        }
+        if(e){
+            e.stopEvent();
+        }
+    };
+
+    return {
+        /**
+         * Returns a reference to the underlying {@link Roo.BasicDialog} element
+         * @return {Roo.BasicDialog} The BasicDialog element
+         */
+        getDialog : function(){
+           if(!dlg){
+                dlg = new Roo.BasicDialog("x-msg-box", {
+                    autoCreate : true,
+                    shadow: true,
+                    draggable: true,
+                    resizable:false,
+                    constraintoviewport:false,
+                    fixedcenter:true,
+                    collapsible : false,
+                    shim:true,
+                    modal: true,
+                    width:400, height:100,
+                    buttonAlign:"center",
+                    closeClick : function(){
+                        if(opt && opt.buttons && opt.buttons.no && !opt.buttons.cancel){
+                            handleButton("no");
+                        }else{
+                            handleButton("cancel");
+                        }
+                    }
+                });
+                dlg.on("hide", handleHide);
+                mask = dlg.mask;
+                dlg.addKeyListener(27, handleEsc);
+                buttons = {};
+                var bt = this.buttonText;
+                buttons["ok"] = dlg.addButton(bt["ok"], handleButton.createCallback("ok"));
+                buttons["yes"] = dlg.addButton(bt["yes"], handleButton.createCallback("yes"));
+                buttons["no"] = dlg.addButton(bt["no"], handleButton.createCallback("no"));
+                buttons["cancel"] = dlg.addButton(bt["cancel"], handleButton.createCallback("cancel"));
+                bodyEl = dlg.body.createChild({
+
+                    html:'<span class="roo-mb-text"></span><br /><input type="text" class="roo-mb-input" /><textarea class="roo-mb-textarea"></textarea><div class="roo-mb-progress-wrap"><div class="roo-mb-progress"><div class="roo-mb-progress-bar">&#160;</div></div></div>'
+                });
+                msgEl = bodyEl.dom.firstChild;
+                textboxEl = Roo.get(bodyEl.dom.childNodes[2]);
+                textboxEl.enableDisplayMode();
+                textboxEl.addKeyListener([10,13], function(){
+                    if(dlg.isVisible() && opt && opt.buttons){
+                        if(opt.buttons.ok){
+                            handleButton("ok");
+                        }else if(opt.buttons.yes){
+                            handleButton("yes");
+                        }
+                    }
+                });
+                textareaEl = Roo.get(bodyEl.dom.childNodes[3]);
+                textareaEl.enableDisplayMode();
+                progressEl = Roo.get(bodyEl.dom.childNodes[4]);
+                progressEl.enableDisplayMode();
+                var pf = progressEl.dom.firstChild;
+                if (pf) {
+                    pp = Roo.get(pf.firstChild);
+                    pp.setHeight(pf.offsetHeight);
+                }
+                
+            }
+            return dlg;
+        },
+
+        /**
+         * Updates the message box body text
+         * @param {String} text (optional) Replaces the message box element's innerHTML with the specified string (defaults to
+         * the XHTML-compliant non-breaking space character '&amp;#160;')
+         * @return {Roo.MessageBox} This message box
+         */
+        updateText : function(text){
+            if(!dlg.isVisible() && !opt.width){
+                dlg.resizeTo(this.maxWidth, 100); // resize first so content is never clipped from previous shows
+            }
+            msgEl.innerHTML = text || '&#160;';
+            var w = Math.max(Math.min(opt.width || msgEl.offsetWidth, this.maxWidth), 
+                        Math.max(opt.minWidth || this.minWidth, bwidth));
+            if(opt.prompt){
+                activeTextEl.setWidth(w);
+            }
+            if(dlg.isVisible()){
+                dlg.fixedcenter = false;
+            }
+            dlg.setContentSize(w, bodyEl.getHeight());
+            if(dlg.isVisible()){
+                dlg.fixedcenter = true;
+            }
+            return this;
+        },
+
+        /**
+         * Updates a progress-style message box's text and progress bar.  Only relevant on message boxes
+         * initiated via {@link Roo.MessageBox#progress} or by calling {@link Roo.MessageBox#show} with progress: true.
+         * @param {Number} value Any number between 0 and 1 (e.g., .5)
+         * @param {String} text (optional) If defined, the message box's body text is replaced with the specified string (defaults to undefined)
+         * @return {Roo.MessageBox} This message box
+         */
+        updateProgress : function(value, text){
+            if(text){
+                this.updateText(text);
+            }
+            if (pp) { // weird bug on my firefox - for some reason this is not defined
+                pp.setWidth(Math.floor(value*progressEl.dom.firstChild.offsetWidth));
+            }
+            return this;
+        },        
+
+        /**
+         * Returns true if the message box is currently displayed
+         * @return {Boolean} True if the message box is visible, else false
+         */
+        isVisible : function(){
+            return dlg && dlg.isVisible();  
+        },
+
+        /**
+         * Hides the message box if it is displayed
+         */
+        hide : function(){
+            if(this.isVisible()){
+                dlg.hide();
+            }  
+        },
+
+        /**
+         * Displays a new message box, or reinitializes an existing message box, based on the config options
+         * passed in. All functions (e.g. prompt, alert, etc) on MessageBox call this function internally.
+         * The following config object properties are supported:
+         * <pre>
+Property    Type             Description
+----------  ---------------  ------------------------------------------------------------------------------------
+animEl            String/Element   An id or Element from which the message box should animate as it opens and
+                                   closes (defaults to undefined)
+buttons           Object/Boolean   A button config object (e.g., Roo.MessageBox.OKCANCEL or {ok:'Foo',
+                                   cancel:'Bar'}), or false to not show any buttons (defaults to false)
+closable          Boolean          False to hide the top-right close button (defaults to true).  Note that
+                                   progress and wait dialogs will ignore this property and always hide the
+                                   close button as they can only be closed programmatically.
+cls               String           A custom CSS class to apply to the message box element
+defaultTextHeight Number           The default height in pixels of the message box's multiline textarea if
+                                   displayed (defaults to 75)
+fn                Function         A callback function to execute after closing the dialog.  The arguments to the
+                                   function will be btn (the name of the button that was clicked, if applicable,
+                                   e.g. "ok"), and text (the value of the active text field, if applicable).
+                                   Progress and wait dialogs will ignore this option since they do not respond to
+                                   user actions and can only be closed programmatically, so any required function
+                                   should be called by the same code after it closes the dialog.
+icon              String           A CSS class that provides a background image to be used as an icon for
+                                   the dialog (e.g., Roo.MessageBox.WARNING or 'custom-class', defaults to '')
+maxWidth          Number           The maximum width in pixels of the message box (defaults to 600)
+minWidth          Number           The minimum width in pixels of the message box (defaults to 100)
+modal             Boolean          False to allow user interaction with the page while the message box is
+                                   displayed (defaults to true)
+msg               String           A string that will replace the existing message box body text (defaults
+                                   to the XHTML-compliant non-breaking space character '&#160;')
+multiline         Boolean          True to prompt the user to enter multi-line text (defaults to false)
+progress          Boolean          True to display a progress bar (defaults to false)
+progressText      String           The text to display inside the progress bar if progress = true (defaults to '')
+prompt            Boolean          True to prompt the user to enter single-line text (defaults to false)
+proxyDrag         Boolean          True to display a lightweight proxy while dragging (defaults to false)
+title             String           The title text
+value             String           The string value to set into the active textbox element if displayed
+wait              Boolean          True to display a progress bar (defaults to false)
+width             Number           The width of the dialog in pixels
+</pre>
+         *
+         * Example usage:
+         * <pre><code>
+Roo.Msg.show({
+   title: 'Address',
+   msg: 'Please enter your address:',
+   width: 300,
+   buttons: Roo.MessageBox.OKCANCEL,
+   multiline: true,
+   fn: saveAddress,
+   animEl: 'addAddressBtn'
+});
+</code></pre>
+         * @param {Object} config Configuration options
+         * @return {Roo.MessageBox} This message box
+         */
+        show : function(options){
+            if(this.isVisible()){
+                this.hide();
+            }
+            var d = this.getDialog();
+            opt = options;
+            d.setTitle(opt.title || "&#160;");
+            d.close.setDisplayed(opt.closable !== false);
+            activeTextEl = textboxEl;
+            opt.prompt = opt.prompt || (opt.multiline ? true : false);
+            if(opt.prompt){
+                if(opt.multiline){
+                    textboxEl.hide();
+                    textareaEl.show();
+                    textareaEl.setHeight(typeof opt.multiline == "number" ?
+                        opt.multiline : this.defaultTextHeight);
+                    activeTextEl = textareaEl;
+                }else{
+                    textboxEl.show();
+                    textareaEl.hide();
+                }
+            }else{
+                textboxEl.hide();
+                textareaEl.hide();
+            }
+            progressEl.setDisplayed(opt.progress === true);
+            this.updateProgress(0);
+            activeTextEl.dom.value = opt.value || "";
+            if(opt.prompt){
+                dlg.setDefaultButton(activeTextEl);
+            }else{
+                var bs = opt.buttons;
+                var db = null;
+                if(bs && bs.ok){
+                    db = buttons["ok"];
+                }else if(bs && bs.yes){
+                    db = buttons["yes"];
+                }
+                dlg.setDefaultButton(db);
+            }
+            bwidth = updateButtons(opt.buttons);
+            this.updateText(opt.msg);
+            if(opt.cls){
+                d.el.addClass(opt.cls);
+            }
+            d.proxyDrag = opt.proxyDrag === true;
+            d.modal = opt.modal !== false;
+            d.mask = opt.modal !== false ? mask : false;
+            if(!d.isVisible()){
+                // force it to the end of the z-index stack so it gets a cursor in FF
+                document.body.appendChild(dlg.el.dom);
+                d.animateTarget = null;
+                d.show(options.animEl);
+            }
+            return this;
+        },
+
+        /**
+         * Displays a message box with a progress bar.  This message box has no buttons and is not closeable by
+         * the user.  You are responsible for updating the progress bar as needed via {@link Roo.MessageBox#updateProgress}
+         * and closing the message box when the process is complete.
+         * @param {String} title The title bar text
+         * @param {String} msg The message box body text
+         * @return {Roo.MessageBox} This message box
+         */
+        progress : function(title, msg){
+            this.show({
+                title : title,
+                msg : msg,
+                buttons: false,
+                progress:true,
+                closable:false,
+                minWidth: this.minProgressWidth,
+                modal : true
+            });
+            return this;
+        },
+
+        /**
+         * Displays a standard read-only message box with an OK button (comparable to the basic JavaScript Window.alert).
+         * If a callback function is passed it will be called after the user clicks the button, and the
+         * id of the button that was clicked will be passed as the only parameter to the callback
+         * (could also be the top-right close button).
+         * @param {String} title The title bar text
+         * @param {String} msg The message box body text
+         * @param {Function} fn (optional) The callback function invoked after the message box is closed
+         * @param {Object} scope (optional) The scope of the callback function
+         * @return {Roo.MessageBox} This message box
+         */
+        alert : function(title, msg, fn, scope){
+            this.show({
+                title : title,
+                msg : msg,
+                buttons: this.OK,
+                fn: fn,
+                scope : scope,
+                modal : true
+            });
+            return this;
+        },
+
+        /**
+         * Displays a message box with an infinitely auto-updating progress bar.  This can be used to block user
+         * interaction while waiting for a long-running process to complete that does not have defined intervals.
+         * You are responsible for closing the message box when the process is complete.
+         * @param {String} msg The message box body text
+         * @param {String} title (optional) The title bar text
+         * @return {Roo.MessageBox} This message box
+         */
+        wait : function(msg, title){
+            this.show({
+                title : title,
+                msg : msg,
+                buttons: false,
+                closable:false,
+                progress:true,
+                modal:true,
+                width:300,
+                wait:true
+            });
+            waitTimer = Roo.TaskMgr.start({
+                run: function(i){
+                    Roo.MessageBox.updateProgress(((((i+20)%20)+1)*5)*.01);
+                },
+                interval: 1000
+            });
+            return this;
+        },
+
+        /**
+         * Displays a confirmation message box with Yes and No buttons (comparable to JavaScript's Window.confirm).
+         * If a callback function is passed it will be called after the user clicks either button, and the id of the
+         * button that was clicked will be passed as the only parameter to the callback (could also be the top-right close button).
+         * @param {String} title The title bar text
+         * @param {String} msg The message box body text
+         * @param {Function} fn (optional) The callback function invoked after the message box is closed
+         * @param {Object} scope (optional) The scope of the callback function
+         * @return {Roo.MessageBox} This message box
+         */
+        confirm : function(title, msg, fn, scope){
+            this.show({
+                title : title,
+                msg : msg,
+                buttons: this.YESNO,
+                fn: fn,
+                scope : scope,
+                modal : true
+            });
+            return this;
+        },
+
+        /**
+         * Displays a message box with OK and Cancel buttons prompting the user to enter some text (comparable to
+         * JavaScript's Window.prompt).  The prompt can be a single-line or multi-line textbox.  If a callback function
+         * is passed it will be called after the user clicks either button, and the id of the button that was clicked
+         * (could also be the top-right close button) and the text that was entered will be passed as the two
+         * parameters to the callback.
+         * @param {String} title The title bar text
+         * @param {String} msg The message box body text
+         * @param {Function} fn (optional) The callback function invoked after the message box is closed
+         * @param {Object} scope (optional) The scope of the callback function
+         * @param {Boolean/Number} multiline (optional) True to create a multiline textbox using the defaultTextHeight
+         * property, or the height in pixels to create the textbox (defaults to false / single-line)
+         * @return {Roo.MessageBox} This message box
+         */
+        prompt : function(title, msg, fn, scope, multiline){
+            this.show({
+                title : title,
+                msg : msg,
+                buttons: this.OKCANCEL,
+                fn: fn,
+                minWidth:250,
+                scope : scope,
+                prompt:true,
+                multiline: multiline,
+                modal : true
+            });
+            return this;
+        },
+
+        /**
+         * Button config that displays a single OK button
+         * @type Object
+         */
+        OK : {ok:true},
+        /**
+         * Button config that displays Yes and No buttons
+         * @type Object
+         */
+        YESNO : {yes:true, no:true},
+        /**
+         * Button config that displays OK and Cancel buttons
+         * @type Object
+         */
+        OKCANCEL : {ok:true, cancel:true},
+        /**
+         * Button config that displays Yes, No and Cancel buttons
+         * @type Object
+         */
+        YESNOCANCEL : {yes:true, no:true, cancel:true},
+
+        /**
+         * The default height in pixels of the message box's multiline textarea if displayed (defaults to 75)
+         * @type Number
+         */
+        defaultTextHeight : 75,
+        /**
+         * The maximum width in pixels of the message box (defaults to 600)
+         * @type Number
+         */
+        maxWidth : 600,
+        /**
+         * The minimum width in pixels of the message box (defaults to 100)
+         * @type Number
+         */
+        minWidth : 100,
+        /**
+         * The minimum width in pixels of the message box if it is a progress-style dialog.  This is useful
+         * for setting a different minimum width than text-only dialogs may need (defaults to 250)
+         * @type Number
+         */
+        minProgressWidth : 250,
+        /**
+         * An object containing the default button text strings that can be overriden for localized language support.
+         * Supported properties are: ok, cancel, yes and no.
+         * Customize the default text like so: Roo.MessageBox.buttonText.yes = "S?";
+         * @type Object
+         */
+        buttonText : {
+            ok : "OK",
+            cancel : "Cancel",
+            yes : "Yes",
+            no : "No"
+        }
+    };
+}();
+
+/**
+ * Shorthand for {@link Roo.MessageBox}
+ */
+Roo.Msg = Roo.MessageBox;
\ No newline at end of file
diff --git a/Roo/PagingToolbar.js b/Roo/PagingToolbar.js
new file mode 100644 (file)
index 0000000..635ab0f
--- /dev/null
@@ -0,0 +1,297 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+/**
+ * @class Roo.PagingToolbar
+ * @extends Roo.Toolbar
+ * A specialized toolbar that is bound to a {@link Roo.data.Store} and provides automatic paging controls.
+ * @constructor
+ * Create a new PagingToolbar
+ * @param {Object} config The config object
+ */
+Roo.PagingToolbar = function(el, ds, config)
+{
+    // old args format still supported... - xtype is prefered..
+    if (typeof(el) == 'object' && el.xtype) {
+        // created from xtype...
+        config = el;
+        ds = el.dataSource;
+        el = config.container;
+    }
+    
+    
+    Roo.PagingToolbar.superclass.constructor.call(this, el, null, config);
+    this.ds = ds;
+    this.cursor = 0;
+    this.renderButtons(this.el);
+    this.bind(ds);
+};
+
+Roo.extend(Roo.PagingToolbar, Roo.Toolbar, {
+    /**
+     * @cfg {Roo.data.Store} dataSource
+     * The underlying data store providing the paged data
+     */
+    /**
+     * @cfg {String/HTMLElement/Element} container
+     * container The id or element that will contain the toolbar
+     */
+    /**
+     * @cfg {Boolean} displayInfo
+     * True to display the displayMsg (defaults to false)
+     */
+    /**
+     * @cfg {Number} pageSize
+     * The number of records to display per page (defaults to 20)
+     */
+    pageSize: 20,
+    /**
+     * @cfg {String} displayMsg
+     * The paging status message to display (defaults to "Displaying {start} - {end} of {total}")
+     */
+    displayMsg : 'Displaying {0} - {1} of {2}',
+    /**
+     * @cfg {String} emptyMsg
+     * The message to display when no records are found (defaults to "No data to display")
+     */
+    emptyMsg : 'No data to display',
+    /**
+     * Customizable piece of the default paging text (defaults to "Page")
+     * @type String
+     */
+    beforePageText : "Page",
+    /**
+     * Customizable piece of the default paging text (defaults to "of %0")
+     * @type String
+     */
+    afterPageText : "of {0}",
+    /**
+     * Customizable piece of the default paging text (defaults to "First Page")
+     * @type String
+     */
+    firstText : "First Page",
+    /**
+     * Customizable piece of the default paging text (defaults to "Previous Page")
+     * @type String
+     */
+    prevText : "Previous Page",
+    /**
+     * Customizable piece of the default paging text (defaults to "Next Page")
+     * @type String
+     */
+    nextText : "Next Page",
+    /**
+     * Customizable piece of the default paging text (defaults to "Last Page")
+     * @type String
+     */
+    lastText : "Last Page",
+    /**
+     * Customizable piece of the default paging text (defaults to "Refresh")
+     * @type String
+     */
+    refreshText : "Refresh",
+
+    // private
+    renderButtons : function(el){
+        Roo.PagingToolbar.superclass.render.call(this, el);
+        this.first = this.addButton({
+            tooltip: this.firstText,
+            cls: "x-btn-icon x-grid-page-first",
+            disabled: true,
+            handler: this.onClick.createDelegate(this, ["first"])
+        });
+        this.prev = this.addButton({
+            tooltip: this.prevText,
+            cls: "x-btn-icon x-grid-page-prev",
+            disabled: true,
+            handler: this.onClick.createDelegate(this, ["prev"])
+        });
+        this.addSeparator();
+        this.add(this.beforePageText);
+        this.field = Roo.get(this.addDom({
+           tag: "input",
+           type: "text",
+           size: "3",
+           value: "1",
+           cls: "x-grid-page-number"
+        }).el);
+        this.field.on("keydown", this.onPagingKeydown, this);
+        this.field.on("focus", function(){this.dom.select();});
+        this.afterTextEl = this.addText(String.format(this.afterPageText, 1));
+        this.field.setHeight(18);
+        this.addSeparator();
+        this.next = this.addButton({
+            tooltip: this.nextText,
+            cls: "x-btn-icon x-grid-page-next",
+            disabled: true,
+            handler: this.onClick.createDelegate(this, ["next"])
+        });
+        this.last = this.addButton({
+            tooltip: this.lastText,
+            cls: "x-btn-icon x-grid-page-last",
+            disabled: true,
+            handler: this.onClick.createDelegate(this, ["last"])
+        });
+        this.addSeparator();
+        this.loading = this.addButton({
+            tooltip: this.refreshText,
+            cls: "x-btn-icon x-grid-loading",
+            handler: this.onClick.createDelegate(this, ["refresh"])
+        });
+
+        if(this.displayInfo){
+            this.displayEl = Roo.fly(this.el.dom.firstChild).createChild({cls:'x-paging-info'});
+        }
+    },
+
+    // private
+    updateInfo : function(){
+        if(this.displayEl){
+            var count = this.ds.getCount();
+            var msg = count == 0 ?
+                this.emptyMsg :
+                String.format(
+                    this.displayMsg,
+                    this.cursor+1, this.cursor+count, this.ds.getTotalCount()    
+                );
+            this.displayEl.update(msg);
+        }
+    },
+
+    // private
+    onLoad : function(ds, r, o){
+       this.cursor = o.params ? o.params.start : 0;
+       var d = this.getPageData(), ap = d.activePage, ps = d.pages;
+
+       this.afterTextEl.el.innerHTML = String.format(this.afterPageText, d.pages);
+       this.field.dom.value = ap;
+       this.first.setDisabled(ap == 1);
+       this.prev.setDisabled(ap == 1);
+       this.next.setDisabled(ap == ps);
+       this.last.setDisabled(ap == ps);
+       this.loading.enable();
+       this.updateInfo();
+    },
+
+    // private
+    getPageData : function(){
+        var total = this.ds.getTotalCount();
+        return {
+            total : total,
+            activePage : Math.ceil((this.cursor+this.pageSize)/this.pageSize),
+            pages :  total < this.pageSize ? 1 : Math.ceil(total/this.pageSize)
+        };
+    },
+
+    // private
+    onLoadError : function(){
+        this.loading.enable();
+    },
+
+    // private
+    onPagingKeydown : function(e){
+        var k = e.getKey();
+        var d = this.getPageData();
+        if(k == e.RETURN){
+            var v = this.field.dom.value, pageNum;
+            if(!v || isNaN(pageNum = parseInt(v, 10))){
+                this.field.dom.value = d.activePage;
+                return;
+            }
+            pageNum = Math.min(Math.max(1, pageNum), d.pages) - 1;
+            this.ds.load({params:{start: pageNum * this.pageSize, limit: this.pageSize}});
+            e.stopEvent();
+        }
+        else if(k == e.HOME || (k == e.UP && e.ctrlKey) || (k == e.PAGEUP && e.ctrlKey) || (k == e.RIGHT && e.ctrlKey) || k == e.END || (k == e.DOWN && e.ctrlKey) || (k == e.LEFT && e.ctrlKey) || (k == e.PAGEDOWN && e.ctrlKey))
+        {
+          var pageNum = (k == e.HOME || (k == e.DOWN && e.ctrlKey) || (k == e.LEFT && e.ctrlKey) || (k == e.PAGEDOWN && e.ctrlKey)) ? 1 : d.pages;
+          this.field.dom.value = pageNum;
+          this.ds.load({params:{start: (pageNum - 1) * this.pageSize, limit: this.pageSize}});
+          e.stopEvent();
+        }
+        else if(k == e.UP || k == e.RIGHT || k == e.PAGEUP || k == e.DOWN || k == e.LEFT || k == e.PAGEDOWN)
+        {
+          var v = this.field.dom.value, pageNum; 
+          var increment = (e.shiftKey) ? 10 : 1;
+          if(k == e.DOWN || k == e.LEFT || k == e.PAGEDOWN)
+            increment *= -1;
+          if(!v || isNaN(pageNum = parseInt(v, 10))) {
+            this.field.dom.value = d.activePage;
+            return;
+          }
+          else if(parseInt(v, 10) + increment >= 1 & parseInt(v, 10) + increment <= d.pages)
+          {
+            this.field.dom.value = parseInt(v, 10) + increment;
+            pageNum = Math.min(Math.max(1, pageNum + increment), d.pages) - 1;
+            this.ds.load({params:{start: pageNum * this.pageSize, limit: this.pageSize}});
+          }
+          e.stopEvent();
+        }
+    },
+
+    // private
+    beforeLoad : function(){
+        if(this.loading){
+            this.loading.disable();
+        }
+    },
+
+    // private
+    onClick : function(which){
+        var ds = this.ds;
+        switch(which){
+            case "first":
+                ds.load({params:{start: 0, limit: this.pageSize}});
+            break;
+            case "prev":
+                ds.load({params:{start: Math.max(0, this.cursor-this.pageSize), limit: this.pageSize}});
+            break;
+            case "next":
+                ds.load({params:{start: this.cursor+this.pageSize, limit: this.pageSize}});
+            break;
+            case "last":
+                var total = ds.getTotalCount();
+                var extra = total % this.pageSize;
+                var lastStart = extra ? (total - extra) : total-this.pageSize;
+                ds.load({params:{start: lastStart, limit: this.pageSize}});
+            break;
+            case "refresh":
+                ds.load({params:{start: this.cursor, limit: this.pageSize}});
+            break;
+        }
+    },
+
+    /**
+     * Unbinds the paging toolbar from the specified {@link Roo.data.Store}
+     * @param {Roo.data.Store} store The data store to unbind
+     */
+    unbind : function(ds){
+        ds.un("beforeload", this.beforeLoad, this);
+        ds.un("load", this.onLoad, this);
+        ds.un("loadexception", this.onLoadError, this);
+        ds.un("remove", this.updateInfo, this);
+        ds.un("add", this.updateInfo, this);
+        this.ds = undefined;
+    },
+
+    /**
+     * Binds the paging toolbar to the specified {@link Roo.data.Store}
+     * @param {Roo.data.Store} store The data store to bind
+     */
+    bind : function(ds){
+        ds.on("beforeload", this.beforeLoad, this);
+        ds.on("load", this.onLoad, this);
+        ds.on("loadexception", this.onLoadError, this);
+        ds.on("remove", this.updateInfo, this);
+        ds.on("add", this.updateInfo, this);
+        this.ds = ds;
+    }
+});
\ No newline at end of file
diff --git a/Roo/QuickTips.js b/Roo/QuickTips.js
new file mode 100644 (file)
index 0000000..f9e2810
--- /dev/null
@@ -0,0 +1,396 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+/**
+ * @class Roo.QuickTips
+ * Provides attractive and customizable tooltips for any element.
+ * @singleton
+ */
+Roo.QuickTips = function(){
+    var el, tipBody, tipBodyText, tipTitle, tm, cfg, close, tagEls = {}, esc, removeCls = null, bdLeft, bdRight;
+    var ce, bd, xy, dd;
+    var visible = false, disabled = true, inited = false;
+    var showProc = 1, hideProc = 1, dismissProc = 1, locks = [];
+    
+    var onOver = function(e){
+        if(disabled){
+            return;
+        }
+        var t = e.getTarget();
+        if(!t || t.nodeType !== 1 || t == document || t == document.body){
+            return;
+        }
+        if(ce && t == ce.el){
+            clearTimeout(hideProc);
+            return;
+        }
+        if(t && tagEls[t.id]){
+            tagEls[t.id].el = t;
+            showProc = show.defer(tm.showDelay, tm, [tagEls[t.id]]);
+            return;
+        }
+        var ttp, et = Roo.fly(t);
+        var ns = cfg.namespace;
+        if(tm.interceptTitles && t.title){
+            ttp = t.title;
+            t.qtip = ttp;
+            t.removeAttribute("title");
+            e.preventDefault();
+        }else{
+            ttp = t.qtip || et.getAttributeNS(ns, cfg.attribute);
+        }
+        if(ttp){
+            showProc = show.defer(tm.showDelay, tm, [{
+                el: t, 
+                text: ttp, 
+                width: et.getAttributeNS(ns, cfg.width),
+                autoHide: et.getAttributeNS(ns, cfg.hide) != "user",
+                title: et.getAttributeNS(ns, cfg.title),
+                   cls: et.getAttributeNS(ns, cfg.cls)
+            }]);
+        }
+    };
+    
+    var onOut = function(e){
+        clearTimeout(showProc);
+        var t = e.getTarget();
+        if(t && ce && ce.el == t && (tm.autoHide && ce.autoHide !== false)){
+            hideProc = setTimeout(hide, tm.hideDelay);
+        }
+    };
+    
+    var onMove = function(e){
+        if(disabled){
+            return;
+        }
+        xy = e.getXY();
+        xy[1] += 18;
+        if(tm.trackMouse && ce){
+            el.setXY(xy);
+        }
+    };
+    
+    var onDown = function(e){
+        clearTimeout(showProc);
+        clearTimeout(hideProc);
+        if(!e.within(el)){
+            if(tm.hideOnClick){
+                hide();
+                tm.disable();
+                tm.enable.defer(100, tm);
+            }
+        }
+    };
+    
+    var getPad = function(){
+        return 2;//bdLeft.getPadding('l')+bdRight.getPadding('r');
+    };
+
+    var show = function(o){
+        if(disabled){
+            return;
+        }
+        clearTimeout(dismissProc);
+        ce = o;
+        if(removeCls){ // in case manually hidden
+            el.removeClass(removeCls);
+            removeCls = null;
+        }
+        if(ce.cls){
+            el.addClass(ce.cls);
+            removeCls = ce.cls;
+        }
+        if(ce.title){
+            tipTitle.update(ce.title);
+            tipTitle.show();
+        }else{
+            tipTitle.update('');
+            tipTitle.hide();
+        }
+        el.dom.style.width  = tm.maxWidth+'px';
+        //tipBody.dom.style.width = '';
+        tipBodyText.update(o.text);
+        var p = getPad(), w = ce.width;
+        if(!w){
+            var td = tipBodyText.dom;
+            var aw = Math.max(td.offsetWidth, td.clientWidth, td.scrollWidth);
+            if(aw > tm.maxWidth){
+                w = tm.maxWidth;
+            }else if(aw < tm.minWidth){
+                w = tm.minWidth;
+            }else{
+                w = aw;
+            }
+        }
+        //tipBody.setWidth(w);
+        el.setWidth(parseInt(w, 10) + p);
+        if(ce.autoHide === false){
+            close.setDisplayed(true);
+            if(dd){
+                dd.unlock();
+            }
+        }else{
+            close.setDisplayed(false);
+            if(dd){
+                dd.lock();
+            }
+        }
+        if(xy){
+            el.avoidY = xy[1]-18;
+            el.setXY(xy);
+        }
+        if(tm.animate){
+            el.setOpacity(.1);
+            el.setStyle("visibility", "visible");
+            el.fadeIn({callback: afterShow});
+        }else{
+            afterShow();
+        }
+    };
+    
+    var afterShow = function(){
+        if(ce){
+            el.show();
+            esc.enable();
+            if(tm.autoDismiss && ce.autoHide !== false){
+                dismissProc = setTimeout(hide, tm.autoDismissDelay);
+            }
+        }
+    };
+    
+    var hide = function(noanim){
+        clearTimeout(dismissProc);
+        clearTimeout(hideProc);
+        ce = null;
+        if(el.isVisible()){
+            esc.disable();
+            if(noanim !== true && tm.animate){
+                el.fadeOut({callback: afterHide});
+            }else{
+                afterHide();
+            } 
+        }
+    };
+    
+    var afterHide = function(){
+        el.hide();
+        if(removeCls){
+            el.removeClass(removeCls);
+            removeCls = null;
+        }
+    };
+    
+    return {
+        /**
+        * @cfg {Number} minWidth
+        * The minimum width of the quick tip (defaults to 40)
+        */
+       minWidth : 40,
+        /**
+        * @cfg {Number} maxWidth
+        * The maximum width of the quick tip (defaults to 300)
+        */
+       maxWidth : 300,
+        /**
+        * @cfg {Boolean} interceptTitles
+        * True to automatically use the element's DOM title value if available (defaults to false)
+        */
+       interceptTitles : false,
+        /**
+        * @cfg {Boolean} trackMouse
+        * True to have the quick tip follow the mouse as it moves over the target element (defaults to false)
+        */
+       trackMouse : false,
+        /**
+        * @cfg {Boolean} hideOnClick
+        * True to hide the quick tip if the user clicks anywhere in the document (defaults to true)
+        */
+       hideOnClick : true,
+        /**
+        * @cfg {Number} showDelay
+        * Delay in milliseconds before the quick tip displays after the mouse enters the target element (defaults to 500)
+        */
+       showDelay : 500,
+        /**
+        * @cfg {Number} hideDelay
+        * Delay in milliseconds before the quick tip hides when autoHide = true (defaults to 200)
+        */
+       hideDelay : 200,
+        /**
+        * @cfg {Boolean} autoHide
+        * True to automatically hide the quick tip after the mouse exits the target element (defaults to true).
+        * Used in conjunction with hideDelay.
+        */
+       autoHide : true,
+        /**
+        * @cfg {Boolean}
+        * True to automatically hide the quick tip after a set period of time, regardless of the user's actions
+        * (defaults to true).  Used in conjunction with autoDismissDelay.
+        */
+       autoDismiss : true,
+        /**
+        * @cfg {Number}
+        * Delay in milliseconds before the quick tip hides when autoDismiss = true (defaults to 5000)
+        */
+       autoDismissDelay : 5000,
+       /**
+        * @cfg {Boolean} animate
+        * True to turn on fade animation. Defaults to false (ClearType/scrollbar flicker issues in IE7).
+        */
+       animate : false,
+
+       /**
+        * @cfg {String} title
+        * Title text to display (defaults to '').  This can be any valid HTML markup.
+        */
+       /**
+        * @cfg {String} text
+        * Body text to display (defaults to '').  This can be any valid HTML markup.
+        */
+       /**
+        * @cfg {String} cls
+        * A CSS class to apply to the base quick tip element (defaults to '').
+        */
+       /**
+        * @cfg {Number} width
+        * Width in pixels of the quick tip (defaults to auto).  Width will be ignored if it exceeds the bounds of
+        * minWidth or maxWidth.
+        */
+
+    /**
+     * Initialize and enable QuickTips for first use.  This should be called once before the first attempt to access
+     * or display QuickTips in a page.
+     */
+       init : function(){
+          tm = Roo.QuickTips;
+          cfg = tm.tagConfig;
+          if(!inited){
+              if(!Roo.isReady){ // allow calling of init() before onReady
+                  Roo.onReady(Roo.QuickTips.init, Roo.QuickTips);
+                  return;
+              }
+              el = new Roo.Layer({cls:"x-tip", shadow:"drop", shim: true, constrain:true, shadowOffset:4});
+              el.fxDefaults = {stopFx: true};
+              // maximum custom styling
+              //el.update('<div class="x-tip-top-left"><div class="x-tip-top-right"><div class="x-tip-top"></div></div></div><div class="x-tip-bd-left"><div class="x-tip-bd-right"><div class="x-tip-bd"><div class="x-tip-close"></div><h3></h3><div class="x-tip-bd-inner"></div><div class="x-clear"></div></div></div></div><div class="x-tip-ft-left"><div class="x-tip-ft-right"><div class="x-tip-ft"></div></div></div>');
+              el.update('<div class="x-tip-bd"><div class="x-tip-close"></div><h3></h3><div class="x-tip-bd-inner"></div><div class="x-clear"></div></div>');              
+              tipTitle = el.child('h3');
+              tipTitle.enableDisplayMode("block");
+              tipBody = el.child('div.x-tip-bd');
+              tipBodyText = el.child('div.x-tip-bd-inner');
+              //bdLeft = el.child('div.x-tip-bd-left');
+              //bdRight = el.child('div.x-tip-bd-right');
+              close = el.child('div.x-tip-close');
+              close.enableDisplayMode("block");
+              close.on("click", hide);
+              var d = Roo.get(document);
+              d.on("mousedown", onDown);
+              d.on("mouseover", onOver);
+              d.on("mouseout", onOut);
+              d.on("mousemove", onMove);
+              esc = d.addKeyListener(27, hide);
+              esc.disable();
+              if(Roo.dd.DD){
+                  dd = el.initDD("default", null, {
+                      onDrag : function(){
+                          el.sync();  
+                      }
+                  });
+                  dd.setHandleElId(tipTitle.id);
+                  dd.lock();
+              }
+              inited = true;
+          }
+          this.enable(); 
+       },
+
+    /**
+     * Configures a new quick tip instance and assigns it to a target element.  The following config options
+     * are supported:
+     * <pre>
+Property    Type                   Description
+----------  ---------------------  ------------------------------------------------------------------------
+target      Element/String/Array   An Element, id or array of ids that this quick tip should be tied to
+     * </ul>
+     * @param {Object} config The config object
+     */
+       register : function(config){
+           var cs = config instanceof Array ? config : arguments;
+           for(var i = 0, len = cs.length; i < len; i++) {
+               var c = cs[i];
+               var target = c.target;
+               if(target){
+                   if(target instanceof Array){
+                       for(var j = 0, jlen = target.length; j < jlen; j++){
+                           tagEls[target[j]] = c;
+                       }
+                   }else{
+                       tagEls[typeof target == 'string' ? target : Roo.id(target)] = c;
+                   }
+               }
+           }
+       },
+
+    /**
+     * Removes this quick tip from its element and destroys it.
+     * @param {String/HTMLElement/Element} el The element from which the quick tip is to be removed.
+     */
+       unregister : function(el){
+           delete tagEls[Roo.id(el)];
+       },
+
+    /**
+     * Enable this quick tip.
+     */
+       enable : function(){
+           if(inited && disabled){
+               locks.pop();
+               if(locks.length < 1){
+                   disabled = false;
+               }
+           }
+       },
+
+    /**
+     * Disable this quick tip.
+     */
+       disable : function(){
+          disabled = true;
+          clearTimeout(showProc);
+          clearTimeout(hideProc);
+          clearTimeout(dismissProc);
+          if(ce){
+              hide(true);
+          }
+          locks.push(1);
+       },
+
+    /**
+     * Returns true if the quick tip is enabled, else false.
+     */
+       isEnabled : function(){
+            return !disabled;
+       },
+
+        // private
+       tagConfig : {
+           namespace : "ext",
+           attribute : "qtip",
+           width : "width",
+           target : "target",
+           title : "qtitle",
+           hide : "hide",
+           cls : "qclass"
+       }
+   };
+}();
+
+// backwards compat
+Roo.QuickTips.tips = Roo.QuickTips.register;
\ No newline at end of file
diff --git a/Roo/ReaderLayout.js b/Roo/ReaderLayout.js
new file mode 100644 (file)
index 0000000..fff19da
--- /dev/null
@@ -0,0 +1,109 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+
+/**
+ * @class Roo.ReaderLayout
+ * @extends Roo.BorderLayout
+ * This is a pre-built layout that represents a classic, 5-pane application.  It consists of a header, a primary
+ * center region containing two nested regions (a top one for a list view and one for item preview below),
+ * and regions on either side that can be used for navigation, application commands, informational displays, etc.
+ * The setup and configuration work exactly the same as it does for a {@link Roo.BorderLayout} - this class simply
+ * expedites the setup of the overall layout and regions for this common application style.
+ * Example:
+ <pre><code>
+var reader = new Roo.ReaderLayout();
+var CP = Roo.ContentPanel;  // shortcut for adding
+
+reader.beginUpdate();
+reader.add("north", new CP("north", "North"));
+reader.add("west", new CP("west", {title: "West"}));
+reader.add("east", new CP("east", {title: "East"}));
+
+reader.regions.listView.add(new CP("listView", "List"));
+reader.regions.preview.add(new CP("preview", "Preview"));
+reader.endUpdate();
+</code></pre>
+* @constructor
+* Create a new ReaderLayout
+* @param {Object} config Configuration options
+* @param {String/HTMLElement/Element} container (optional) The container this layout is bound to (defaults to
+* document.body if omitted)
+*/
+Roo.ReaderLayout = function(config, renderTo){
+    var c = config || {size:{}};
+    Roo.ReaderLayout.superclass.constructor.call(this, renderTo || document.body, {
+        north: c.north !== false ? Roo.apply({
+            split:false,
+            initialSize: 32,
+            titlebar: false
+        }, c.north) : false,
+        west: c.west !== false ? Roo.apply({
+            split:true,
+            initialSize: 200,
+            minSize: 175,
+            maxSize: 400,
+            titlebar: true,
+            collapsible: true,
+            animate: true,
+            margins:{left:5,right:0,bottom:5,top:5},
+            cmargins:{left:5,right:5,bottom:5,top:5}
+        }, c.west) : false,
+        east: c.east !== false ? Roo.apply({
+            split:true,
+            initialSize: 200,
+            minSize: 175,
+            maxSize: 400,
+            titlebar: true,
+            collapsible: true,
+            animate: true,
+            margins:{left:0,right:5,bottom:5,top:5},
+            cmargins:{left:5,right:5,bottom:5,top:5}
+        }, c.east) : false,
+        center: Roo.apply({
+            tabPosition: 'top',
+            autoScroll:false,
+            closeOnTab: true,
+            titlebar:false,
+            margins:{left:c.west!==false ? 0 : 5,right:c.east!==false ? 0 : 5,bottom:5,top:2}
+        }, c.center)
+    });
+
+    this.el.addClass('x-reader');
+
+    this.beginUpdate();
+
+    var inner = new Roo.BorderLayout(Roo.get(document.body).createChild(), {
+        south: c.preview !== false ? Roo.apply({
+            split:true,
+            initialSize: 200,
+            minSize: 100,
+            autoScroll:true,
+            collapsible:true,
+            titlebar: true,
+            cmargins:{top:5,left:0, right:0, bottom:0}
+        }, c.preview) : false,
+        center: Roo.apply({
+            autoScroll:false,
+            titlebar:false,
+            minHeight:200
+        }, c.listView)
+    });
+    this.add('center', new Roo.NestedLayoutPanel(inner,
+            Roo.apply({title: c.mainTitle || '',tabTip:''},c.innerPanelCfg)));
+
+    this.endUpdate();
+
+    this.regions.preview = inner.getRegion('south');
+    this.regions.listView = inner.getRegion('center');
+};
+
+Roo.extend(Roo.ReaderLayout, Roo.BorderLayout);
\ No newline at end of file
diff --git a/Roo/Resizable.js b/Roo/Resizable.js
new file mode 100644 (file)
index 0000000..46eebe8
--- /dev/null
@@ -0,0 +1,636 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+
+/**
+ * @class Roo.Resizable
+ * @extends Roo.util.Observable
+ * <p>Applies drag handles to an element to make it resizable. The drag handles are inserted into the element
+ * and positioned absolute. Some elements, such as a textarea or image, don't support this. To overcome that, you can wrap
+ * the textarea in a div and set "resizeChild" to true (or to the id of the element), <b>or</b> set wrap:true in your config and
+ * the element will be wrapped for you automatically.</p>
+ * <p>Here is the list of valid resize handles:</p>
+ * <pre>
+Value   Description
+------  -------------------
+ 'n'     north
+ 's'     south
+ 'e'     east
+ 'w'     west
+ 'nw'    northwest
+ 'sw'    southwest
+ 'se'    southeast
+ 'ne'    northeast
+ 'all'   all
+</pre>
+ * <p>Here's an example showing the creation of a typical Resizable:</p>
+ * <pre><code>
+var resizer = new Roo.Resizable("element-id", {
+    handles: 'all',
+    minWidth: 200,
+    minHeight: 100,
+    maxWidth: 500,
+    maxHeight: 400,
+    pinned: true
+});
+resizer.on("resize", myHandler);
+</code></pre>
+ * <p>To hide a particular handle, set its display to none in CSS, or through script:<br>
+ * resizer.east.setDisplayed(false);</p>
+ * @cfg {Boolean/String/Element} resizeChild True to resize the first child, or id/element to resize (defaults to false)
+ * @cfg {Array/String} adjustments String "auto" or an array [width, height] with values to be <b>added</b> to the
+ * resize operation's new size (defaults to [0, 0])
+ * @cfg {Number} minWidth The minimum width for the element (defaults to 5)
+ * @cfg {Number} minHeight The minimum height for the element (defaults to 5)
+ * @cfg {Number} maxWidth The maximum width for the element (defaults to 10000)
+ * @cfg {Number} maxHeight The maximum height for the element (defaults to 10000)
+ * @cfg {Boolean} enabled False to disable resizing (defaults to true)
+ * @cfg {Boolean} wrap True to wrap an element with a div if needed (required for textareas and images, defaults to false)
+ * @cfg {Number} width The width of the element in pixels (defaults to null)
+ * @cfg {Number} height The height of the element in pixels (defaults to null)
+ * @cfg {Boolean} animate True to animate the resize (not compatible with dynamic sizing, defaults to false)
+ * @cfg {Number} duration Animation duration if animate = true (defaults to .35)
+ * @cfg {Boolean} dynamic True to resize the element while dragging instead of using a proxy (defaults to false)
+ * @cfg {String} handles String consisting of the resize handles to display (defaults to undefined)
+ * @cfg {Boolean} multiDirectional <b>Deprecated</b>.  The old style of adding multi-direction resize handles, deprecated
+ * in favor of the handles config option (defaults to false)
+ * @cfg {Boolean} disableTrackOver True to disable mouse tracking. This is only applied at config time. (defaults to false)
+ * @cfg {String} easing Animation easing if animate = true (defaults to 'easingOutStrong')
+ * @cfg {Number} widthIncrement The increment to snap the width resize in pixels (dynamic must be true, defaults to 0)
+ * @cfg {Number} heightIncrement The increment to snap the height resize in pixels (dynamic must be true, defaults to 0)
+ * @cfg {Boolean} pinned True to ensure that the resize handles are always visible, false to display them only when the
+ * user mouses over the resizable borders. This is only applied at config time. (defaults to false)
+ * @cfg {Boolean} preserveRatio True to preserve the original ratio between height and width during resize (defaults to false)
+ * @cfg {Boolean} transparent True for transparent handles. This is only applied at config time. (defaults to false)
+ * @cfg {Number} minX The minimum allowed page X for the element (only used for west resizing, defaults to 0)
+ * @cfg {Number} minY The minimum allowed page Y for the element (only used for north resizing, defaults to 0)
+ * @cfg {Boolean} draggable Convenience to initialize drag drop (defaults to false)
+ * @constructor
+ * Create a new resizable component
+ * @param {String/HTMLElement/Roo.Element} el The id or element to resize
+ * @param {Object} config configuration options
+  */
+Roo.Resizable = function(el, config){
+    this.el = Roo.get(el);
+
+    if(config && config.wrap){
+        config.resizeChild = this.el;
+        this.el = this.el.wrap(typeof config.wrap == "object" ? config.wrap : {cls:"xresizable-wrap"});
+        this.el.id = this.el.dom.id = config.resizeChild.id + "-rzwrap";
+        this.el.setStyle("overflow", "hidden");
+        this.el.setPositioning(config.resizeChild.getPositioning());
+        config.resizeChild.clearPositioning();
+        if(!config.width || !config.height){
+            var csize = config.resizeChild.getSize();
+            this.el.setSize(csize.width, csize.height);
+        }
+        if(config.pinned && !config.adjustments){
+            config.adjustments = "auto";
+        }
+    }
+
+    this.proxy = this.el.createProxy({tag: "div", cls: "x-resizable-proxy", id: this.el.id + "-rzproxy"});
+    this.proxy.unselectable();
+    this.proxy.enableDisplayMode('block');
+
+    Roo.apply(this, config);
+
+    if(this.pinned){
+        this.disableTrackOver = true;
+        this.el.addClass("x-resizable-pinned");
+    }
+    // if the element isn't positioned, make it relative
+    var position = this.el.getStyle("position");
+    if(position != "absolute" && position != "fixed"){
+        this.el.setStyle("position", "relative");
+    }
+    if(!this.handles){ // no handles passed, must be legacy style
+        this.handles = 's,e,se';
+        if(this.multiDirectional){
+            this.handles += ',n,w';
+        }
+    }
+    if(this.handles == "all"){
+        this.handles = "n s e w ne nw se sw";
+    }
+    var hs = this.handles.split(/\s*?[,;]\s*?| /);
+    var ps = Roo.Resizable.positions;
+    for(var i = 0, len = hs.length; i < len; i++){
+        if(hs[i] && ps[hs[i]]){
+            var pos = ps[hs[i]];
+            this[pos] = new Roo.Resizable.Handle(this, pos, this.disableTrackOver, this.transparent);
+        }
+    }
+    // legacy
+    this.corner = this.southeast;
+
+    if(this.handles.indexOf("n") != -1 || this.handles.indexOf("w") != -1){
+        this.updateBox = true;
+    }
+
+    this.activeHandle = null;
+
+    if(this.resizeChild){
+        if(typeof this.resizeChild == "boolean"){
+            this.resizeChild = Roo.get(this.el.dom.firstChild, true);
+        }else{
+            this.resizeChild = Roo.get(this.resizeChild, true);
+        }
+    }
+
+    if(this.adjustments == "auto"){
+        var rc = this.resizeChild;
+        var hw = this.west, he = this.east, hn = this.north, hs = this.south;
+        if(rc && (hw || hn)){
+            rc.position("relative");
+            rc.setLeft(hw ? hw.el.getWidth() : 0);
+            rc.setTop(hn ? hn.el.getHeight() : 0);
+        }
+        this.adjustments = [
+            (he ? -he.el.getWidth() : 0) + (hw ? -hw.el.getWidth() : 0),
+            (hn ? -hn.el.getHeight() : 0) + (hs ? -hs.el.getHeight() : 0) -1
+        ];
+    }
+
+    if(this.draggable){
+        this.dd = this.dynamic ?
+            this.el.initDD(null) : this.el.initDDProxy(null, {dragElId: this.proxy.id});
+        this.dd.setHandleElId(this.resizeChild ? this.resizeChild.id : this.el.id);
+    }
+
+    // public events
+    this.addEvents({
+        /**
+         * @event beforeresize
+         * Fired before resize is allowed. Set enabled to false to cancel resize.
+         * @param {Roo.Resizable} this
+         * @param {Roo.EventObject} e The mousedown event
+         */
+        "beforeresize" : true,
+        /**
+         * @event resize
+         * Fired after a resize.
+         * @param {Roo.Resizable} this
+         * @param {Number} width The new width
+         * @param {Number} height The new height
+         * @param {Roo.EventObject} e The mouseup event
+         */
+        "resize" : true
+    });
+
+    if(this.width !== null && this.height !== null){
+        this.resizeTo(this.width, this.height);
+    }else{
+        this.updateChildSize();
+    }
+    if(Roo.isIE){
+        this.el.dom.style.zoom = 1;
+    }
+    Roo.Resizable.superclass.constructor.call(this);
+};
+
+Roo.extend(Roo.Resizable, Roo.util.Observable, {
+        resizeChild : false,
+        adjustments : [0, 0],
+        minWidth : 5,
+        minHeight : 5,
+        maxWidth : 10000,
+        maxHeight : 10000,
+        enabled : true,
+        animate : false,
+        duration : .35,
+        dynamic : false,
+        handles : false,
+        multiDirectional : false,
+        disableTrackOver : false,
+        easing : 'easeOutStrong',
+        widthIncrement : 0,
+        heightIncrement : 0,
+        pinned : false,
+        width : null,
+        height : null,
+        preserveRatio : false,
+        transparent: false,
+        minX: 0,
+        minY: 0,
+        draggable: false,
+
+        /**
+         * @cfg {String/HTMLElement/Element} constrainTo Constrain the resize to a particular element
+         */
+        constrainTo: undefined,
+        /**
+         * @cfg {Roo.lib.Region} resizeRegion Constrain the resize to a particular region
+         */
+        resizeRegion: undefined,
+
+
+    /**
+     * Perform a manual resize
+     * @param {Number} width
+     * @param {Number} height
+     */
+    resizeTo : function(width, height){
+        this.el.setSize(width, height);
+        this.updateChildSize();
+        this.fireEvent("resize", this, width, height, null);
+    },
+
+    // private
+    startSizing : function(e, handle){
+        this.fireEvent("beforeresize", this, e);
+        if(this.enabled){ // 2nd enabled check in case disabled before beforeresize handler
+
+            if(!this.overlay){
+                this.overlay = this.el.createProxy({tag: "div", cls: "x-resizable-overlay", html: "&#160;"});
+                this.overlay.unselectable();
+                this.overlay.enableDisplayMode("block");
+                this.overlay.on("mousemove", this.onMouseMove, this);
+                this.overlay.on("mouseup", this.onMouseUp, this);
+            }
+            this.overlay.setStyle("cursor", handle.el.getStyle("cursor"));
+
+            this.resizing = true;
+            this.startBox = this.el.getBox();
+            this.startPoint = e.getXY();
+            this.offsets = [(this.startBox.x + this.startBox.width) - this.startPoint[0],
+                            (this.startBox.y + this.startBox.height) - this.startPoint[1]];
+
+            this.overlay.setSize(Roo.lib.Dom.getViewWidth(true), Roo.lib.Dom.getViewHeight(true));
+            this.overlay.show();
+
+            if(this.constrainTo) {
+                var ct = Roo.get(this.constrainTo);
+                this.resizeRegion = ct.getRegion().adjust(
+                    ct.getFrameWidth('t'),
+                    ct.getFrameWidth('l'),
+                    -ct.getFrameWidth('b'),
+                    -ct.getFrameWidth('r')
+                );
+            }
+
+            this.proxy.setStyle('visibility', 'hidden'); // workaround display none
+            this.proxy.show();
+            this.proxy.setBox(this.startBox);
+            if(!this.dynamic){
+                this.proxy.setStyle('visibility', 'visible');
+            }
+        }
+    },
+
+    // private
+    onMouseDown : function(handle, e){
+        if(this.enabled){
+            e.stopEvent();
+            this.activeHandle = handle;
+            this.startSizing(e, handle);
+        }
+    },
+
+    // private
+    onMouseUp : function(e){
+        var size = this.resizeElement();
+        this.resizing = false;
+        this.handleOut();
+        this.overlay.hide();
+        this.proxy.hide();
+        this.fireEvent("resize", this, size.width, size.height, e);
+    },
+
+    // private
+    updateChildSize : function(){
+        if(this.resizeChild){
+            var el = this.el;
+            var child = this.resizeChild;
+            var adj = this.adjustments;
+            if(el.dom.offsetWidth){
+                var b = el.getSize(true);
+                child.setSize(b.width+adj[0], b.height+adj[1]);
+            }
+            // Second call here for IE
+            // The first call enables instant resizing and
+            // the second call corrects scroll bars if they
+            // exist
+            if(Roo.isIE){
+                setTimeout(function(){
+                    if(el.dom.offsetWidth){
+                        var b = el.getSize(true);
+                        child.setSize(b.width+adj[0], b.height+adj[1]);
+                    }
+                }, 10);
+            }
+        }
+    },
+
+    // private
+    snap : function(value, inc, min){
+        if(!inc || !value) return value;
+        var newValue = value;
+        var m = value % inc;
+        if(m > 0){
+            if(m > (inc/2)){
+                newValue = value + (inc-m);
+            }else{
+                newValue = value - m;
+            }
+        }
+        return Math.max(min, newValue);
+    },
+
+    // private
+    resizeElement : function(){
+        var box = this.proxy.getBox();
+        if(this.updateBox){
+            this.el.setBox(box, false, this.animate, this.duration, null, this.easing);
+        }else{
+            this.el.setSize(box.width, box.height, this.animate, this.duration, null, this.easing);
+        }
+        this.updateChildSize();
+        if(!this.dynamic){
+            this.proxy.hide();
+        }
+        return box;
+    },
+
+    // private
+    constrain : function(v, diff, m, mx){
+        if(v - diff < m){
+            diff = v - m;
+        }else if(v - diff > mx){
+            diff = mx - v;
+        }
+        return diff;
+    },
+
+    // private
+    onMouseMove : function(e){
+        if(this.enabled){
+            try{// try catch so if something goes wrong the user doesn't get hung
+
+            if(this.resizeRegion && !this.resizeRegion.contains(e.getPoint())) {
+               return;
+            }
+
+            //var curXY = this.startPoint;
+            var curSize = this.curSize || this.startBox;
+            var x = this.startBox.x, y = this.startBox.y;
+            var ox = x, oy = y;
+            var w = curSize.width, h = curSize.height;
+            var ow = w, oh = h;
+            var mw = this.minWidth, mh = this.minHeight;
+            var mxw = this.maxWidth, mxh = this.maxHeight;
+            var wi = this.widthIncrement;
+            var hi = this.heightIncrement;
+
+            var eventXY = e.getXY();
+            var diffX = -(this.startPoint[0] - Math.max(this.minX, eventXY[0]));
+            var diffY = -(this.startPoint[1] - Math.max(this.minY, eventXY[1]));
+
+            var pos = this.activeHandle.position;
+
+            switch(pos){
+                case "east":
+                    w += diffX;
+                    w = Math.min(Math.max(mw, w), mxw);
+                    break;
+                case "south":
+                    h += diffY;
+                    h = Math.min(Math.max(mh, h), mxh);
+                    break;
+                case "southeast":
+                    w += diffX;
+                    h += diffY;
+                    w = Math.min(Math.max(mw, w), mxw);
+                    h = Math.min(Math.max(mh, h), mxh);
+                    break;
+                case "north":
+                    diffY = this.constrain(h, diffY, mh, mxh);
+                    y += diffY;
+                    h -= diffY;
+                    break;
+                case "west":
+                    diffX = this.constrain(w, diffX, mw, mxw);
+                    x += diffX;
+                    w -= diffX;
+                    break;
+                case "northeast":
+                    w += diffX;
+                    w = Math.min(Math.max(mw, w), mxw);
+                    diffY = this.constrain(h, diffY, mh, mxh);
+                    y += diffY;
+                    h -= diffY;
+                    break;
+                case "northwest":
+                    diffX = this.constrain(w, diffX, mw, mxw);
+                    diffY = this.constrain(h, diffY, mh, mxh);
+                    y += diffY;
+                    h -= diffY;
+                    x += diffX;
+                    w -= diffX;
+                    break;
+               case "southwest":
+                    diffX = this.constrain(w, diffX, mw, mxw);
+                    h += diffY;
+                    h = Math.min(Math.max(mh, h), mxh);
+                    x += diffX;
+                    w -= diffX;
+                    break;
+            }
+
+            var sw = this.snap(w, wi, mw);
+            var sh = this.snap(h, hi, mh);
+            if(sw != w || sh != h){
+                switch(pos){
+                    case "northeast":
+                        y -= sh - h;
+                    break;
+                    case "north":
+                        y -= sh - h;
+                        break;
+                    case "southwest":
+                        x -= sw - w;
+                    break;
+                    case "west":
+                        x -= sw - w;
+                        break;
+                    case "northwest":
+                        x -= sw - w;
+                        y -= sh - h;
+                    break;
+                }
+                w = sw;
+                h = sh;
+            }
+
+            if(this.preserveRatio){
+                switch(pos){
+                    case "southeast":
+                    case "east":
+                        h = oh * (w/ow);
+                        h = Math.min(Math.max(mh, h), mxh);
+                        w = ow * (h/oh);
+                       break;
+                    case "south":
+                        w = ow * (h/oh);
+                        w = Math.min(Math.max(mw, w), mxw);
+                        h = oh * (w/ow);
+                        break;
+                    case "northeast":
+                        w = ow * (h/oh);
+                        w = Math.min(Math.max(mw, w), mxw);
+                        h = oh * (w/ow);
+                    break;
+                    case "north":
+                        var tw = w;
+                        w = ow * (h/oh);
+                        w = Math.min(Math.max(mw, w), mxw);
+                        h = oh * (w/ow);
+                        x += (tw - w) / 2;
+                        break;
+                    case "southwest":
+                        h = oh * (w/ow);
+                        h = Math.min(Math.max(mh, h), mxh);
+                        var tw = w;
+                        w = ow * (h/oh);
+                        x += tw - w;
+                        break;
+                    case "west":
+                        var th = h;
+                        h = oh * (w/ow);
+                        h = Math.min(Math.max(mh, h), mxh);
+                        y += (th - h) / 2;
+                        var tw = w;
+                        w = ow * (h/oh);
+                        x += tw - w;
+                       break;
+                    case "northwest":
+                        var tw = w;
+                        var th = h;
+                        h = oh * (w/ow);
+                        h = Math.min(Math.max(mh, h), mxh);
+                        w = ow * (h/oh);
+                        y += th - h;
+                         x += tw - w;
+                       break;
+
+                }
+            }
+            this.proxy.setBounds(x, y, w, h);
+            if(this.dynamic){
+                this.resizeElement();
+            }
+            }catch(e){}
+        }
+    },
+
+    // private
+    handleOver : function(){
+        if(this.enabled){
+            this.el.addClass("x-resizable-over");
+        }
+    },
+
+    // private
+    handleOut : function(){
+        if(!this.resizing){
+            this.el.removeClass("x-resizable-over");
+        }
+    },
+
+    /**
+     * Returns the element this component is bound to.
+     * @return {Roo.Element}
+     */
+    getEl : function(){
+        return this.el;
+    },
+
+    /**
+     * Returns the resizeChild element (or null).
+     * @return {Roo.Element}
+     */
+    getResizeChild : function(){
+        return this.resizeChild;
+    },
+
+    /**
+     * Destroys this resizable. If the element was wrapped and
+     * removeEl is not true then the element remains.
+     * @param {Boolean} removeEl (optional) true to remove the element from the DOM
+     */
+    destroy : function(removeEl){
+        this.proxy.remove();
+        if(this.overlay){
+            this.overlay.removeAllListeners();
+            this.overlay.remove();
+        }
+        var ps = Roo.Resizable.positions;
+        for(var k in ps){
+            if(typeof ps[k] != "function" && this[ps[k]]){
+                var h = this[ps[k]];
+                h.el.removeAllListeners();
+                h.el.remove();
+            }
+        }
+        if(removeEl){
+            this.el.update("");
+            this.el.remove();
+        }
+    }
+});
+
+// private
+// hash to map config positions to true positions
+Roo.Resizable.positions = {
+    n: "north", s: "south", e: "east", w: "west", se: "southeast", sw: "southwest", nw: "northwest", ne: "northeast"
+};
+
+// private
+Roo.Resizable.Handle = function(rz, pos, disableTrackOver, transparent){
+    if(!this.tpl){
+        // only initialize the template if resizable is used
+        var tpl = Roo.DomHelper.createTemplate(
+            {tag: "div", cls: "x-resizable-handle x-resizable-handle-{0}"}
+        );
+        tpl.compile();
+        Roo.Resizable.Handle.prototype.tpl = tpl;
+    }
+    this.position = pos;
+    this.rz = rz;
+    this.el = this.tpl.append(rz.el.dom, [this.position], true);
+    this.el.unselectable();
+    if(transparent){
+        this.el.setOpacity(0);
+    }
+    this.el.on("mousedown", this.onMouseDown, this);
+    if(!disableTrackOver){
+        this.el.on("mouseover", this.onMouseOver, this);
+        this.el.on("mouseout", this.onMouseOut, this);
+    }
+};
+
+// private
+Roo.Resizable.Handle.prototype = {
+    afterResize : function(rz){
+        // do nothing
+    },
+    // private
+    onMouseDown : function(e){
+        this.rz.onMouseDown(this, e);
+    },
+    // private
+    onMouseOver : function(e){
+        this.rz.handleOver(this, e);
+    },
+    // private
+    onMouseOut : function(e){
+        this.rz.handleOut(this, e);
+    }
+};
\ No newline at end of file
diff --git a/Roo/Shadow.js b/Roo/Shadow.js
new file mode 100644 (file)
index 0000000..3b2f631
--- /dev/null
@@ -0,0 +1,197 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+
+
+/**
+ * @class Roo.Shadow
+ * Simple class that can provide a shadow effect for any element.  Note that the element MUST be absolutely positioned,
+ * and the shadow does not provide any shimming.  This should be used only in simple cases -- for more advanced
+ * functionality that can also provide the same shadow effect, see the {@link Roo.Layer} class.
+ * @constructor
+ * Create a new Shadow
+ * @param {Object} config The config object
+ */
+Roo.Shadow = function(config){
+    Roo.apply(this, config);
+    if(typeof this.mode != "string"){
+        this.mode = this.defaultMode;
+    }
+    var o = this.offset, a = {h: 0};
+    var rad = Math.floor(this.offset/2);
+    switch(this.mode.toLowerCase()){ // all this hideous nonsense calculates the various offsets for shadows
+        case "drop":
+            a.w = 0;
+            a.l = a.t = o;
+            a.t -= 1;
+            if(Roo.isIE){
+                a.l -= this.offset + rad;
+                a.t -= this.offset + rad;
+                a.w -= rad;
+                a.h -= rad;
+                a.t += 1;
+            }
+        break;
+        case "sides":
+            a.w = (o*2);
+            a.l = -o;
+            a.t = o-1;
+            if(Roo.isIE){
+                a.l -= (this.offset - rad);
+                a.t -= this.offset + rad;
+                a.l += 1;
+                a.w -= (this.offset - rad)*2;
+                a.w -= rad + 1;
+                a.h -= 1;
+            }
+        break;
+        case "frame":
+            a.w = a.h = (o*2);
+            a.l = a.t = -o;
+            a.t += 1;
+            a.h -= 2;
+            if(Roo.isIE){
+                a.l -= (this.offset - rad);
+                a.t -= (this.offset - rad);
+                a.l += 1;
+                a.w -= (this.offset + rad + 1);
+                a.h -= (this.offset + rad);
+                a.h += 1;
+            }
+        break;
+    };
+
+    this.adjusts = a;
+};
+
+Roo.Shadow.prototype = {
+    /**
+     * @cfg {String} mode
+     * The shadow display mode.  Supports the following options:<br />
+     * sides: Shadow displays on both sides and bottom only<br />
+     * frame: Shadow displays equally on all four sides<br />
+     * drop: Traditional bottom-right drop shadow (default)
+     */
+    /**
+     * @cfg {String} offset
+     * The number of pixels to offset the shadow from the element (defaults to 4)
+     */
+    offset: 4,
+
+    // private
+    defaultMode: "drop",
+
+    /**
+     * Displays the shadow under the target element
+     * @param {String/HTMLElement/Element} targetEl The id or element under which the shadow should display
+     */
+    show : function(target){
+        target = Roo.get(target);
+        if(!this.el){
+            this.el = Roo.Shadow.Pool.pull();
+            if(this.el.dom.nextSibling != target.dom){
+                this.el.insertBefore(target);
+            }
+        }
+        this.el.setStyle("z-index", this.zIndex || parseInt(target.getStyle("z-index"), 10)-1);
+        if(Roo.isIE){
+            this.el.dom.style.filter="progid:DXImageTransform.Microsoft.alpha(opacity=50) progid:DXImageTransform.Microsoft.Blur(pixelradius="+(this.offset)+")";
+        }
+        this.realign(
+            target.getLeft(true),
+            target.getTop(true),
+            target.getWidth(),
+            target.getHeight()
+        );
+        this.el.dom.style.display = "block";
+    },
+
+    /**
+     * Returns true if the shadow is visible, else false
+     */
+    isVisible : function(){
+        return this.el ? true : false;  
+    },
+
+    /**
+     * Direct alignment when values are already available. Show must be called at least once before
+     * calling this method to ensure it is initialized.
+     * @param {Number} left The target element left position
+     * @param {Number} top The target element top position
+     * @param {Number} width The target element width
+     * @param {Number} height The target element height
+     */
+    realign : function(l, t, w, h){
+        if(!this.el){
+            return;
+        }
+        var a = this.adjusts, d = this.el.dom, s = d.style;
+        var iea = 0;
+        s.left = (l+a.l)+"px";
+        s.top = (t+a.t)+"px";
+        var sw = (w+a.w), sh = (h+a.h), sws = sw +"px", shs = sh + "px";
+        if(s.width != sws || s.height != shs){
+            s.width = sws;
+            s.height = shs;
+            if(!Roo.isIE){
+                var cn = d.childNodes;
+                var sww = Math.max(0, (sw-12))+"px";
+                cn[0].childNodes[1].style.width = sww;
+                cn[1].childNodes[1].style.width = sww;
+                cn[2].childNodes[1].style.width = sww;
+                cn[1].style.height = Math.max(0, (sh-12))+"px";
+            }
+        }
+    },
+
+    /**
+     * Hides this shadow
+     */
+    hide : function(){
+        if(this.el){
+            this.el.dom.style.display = "none";
+            Roo.Shadow.Pool.push(this.el);
+            delete this.el;
+        }
+    },
+
+    /**
+     * Adjust the z-index of this shadow
+     * @param {Number} zindex The new z-index
+     */
+    setZIndex : function(z){
+        this.zIndex = z;
+        if(this.el){
+            this.el.setStyle("z-index", z);
+        }
+    }
+};
+
+// Private utility class that manages the internal Shadow cache
+Roo.Shadow.Pool = function(){
+    var p = [];
+    var markup = Roo.isIE ?
+                 '<div class="x-ie-shadow"></div>' :
+                 '<div class="x-shadow"><div class="xst"><div class="xstl"></div><div class="xstc"></div><div class="xstr"></div></div><div class="xsc"><div class="xsml"></div><div class="xsmc"></div><div class="xsmr"></div></div><div class="xsb"><div class="xsbl"></div><div class="xsbc"></div><div class="xsbr"></div></div></div>';
+    return {
+        pull : function(){
+            var sh = p.shift();
+            if(!sh){
+                sh = Roo.get(Roo.DomHelper.insertHtml("beforeBegin", document.body.firstChild, markup));
+                sh.autoBoxAdjust = false;
+            }
+            return sh;
+        },
+
+        push : function(sh){
+            p.push(sh);
+        }
+    };
+}();
\ No newline at end of file
diff --git a/Roo/SplitBar.js b/Roo/SplitBar.js
new file mode 100644 (file)
index 0000000..6169529
--- /dev/null
@@ -0,0 +1,441 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+
+
+/**
+ * @class Roo.SplitBar
+ * @extends Roo.util.Observable
+ * Creates draggable splitter bar functionality from two elements (element to be dragged and element to be resized).
+ * <br><br>
+ * Usage:
+ * <pre><code>
+var split = new Roo.SplitBar("elementToDrag", "elementToSize",
+                   Roo.SplitBar.HORIZONTAL, Roo.SplitBar.LEFT);
+split.setAdapter(new Roo.SplitBar.AbsoluteLayoutAdapter("container"));
+split.minSize = 100;
+split.maxSize = 600;
+split.animate = true;
+split.on('moved', splitterMoved);
+</code></pre>
+ * @constructor
+ * Create a new SplitBar
+ * @param {String/HTMLElement/Roo.Element} dragElement The element to be dragged and act as the SplitBar. 
+ * @param {String/HTMLElement/Roo.Element} resizingElement The element to be resized based on where the SplitBar element is dragged 
+ * @param {Number} orientation (optional) Either Roo.SplitBar.HORIZONTAL or Roo.SplitBar.VERTICAL. (Defaults to HORIZONTAL)
+ * @param {Number} placement (optional) Either Roo.SplitBar.LEFT or Roo.SplitBar.RIGHT for horizontal or  
+                        Roo.SplitBar.TOP or Roo.SplitBar.BOTTOM for vertical. (By default, this is determined automatically by the initial
+                        position of the SplitBar).
+ */
+Roo.SplitBar = function(dragElement, resizingElement, orientation, placement, existingProxy){
+    
+    /** @private */
+    this.el = Roo.get(dragElement, true);
+    this.el.dom.unselectable = "on";
+    /** @private */
+    this.resizingEl = Roo.get(resizingElement, true);
+
+    /**
+     * @private
+     * The orientation of the split. Either Roo.SplitBar.HORIZONTAL or Roo.SplitBar.VERTICAL. (Defaults to HORIZONTAL)
+     * Note: If this is changed after creating the SplitBar, the placement property must be manually updated
+     * @type Number
+     */
+    this.orientation = orientation || Roo.SplitBar.HORIZONTAL;
+    
+    /**
+     * The minimum size of the resizing element. (Defaults to 0)
+     * @type Number
+     */
+    this.minSize = 0;
+    
+    /**
+     * The maximum size of the resizing element. (Defaults to 2000)
+     * @type Number
+     */
+    this.maxSize = 2000;
+    
+    /**
+     * Whether to animate the transition to the new size
+     * @type Boolean
+     */
+    this.animate = false;
+    
+    /**
+     * Whether to create a transparent shim that overlays the page when dragging, enables dragging across iframes.
+     * @type Boolean
+     */
+    this.useShim = false;
+    
+    /** @private */
+    this.shim = null;
+    
+    if(!existingProxy){
+        /** @private */
+        this.proxy = Roo.SplitBar.createProxy(this.orientation);
+    }else{
+        this.proxy = Roo.get(existingProxy).dom;
+    }
+    /** @private */
+    this.dd = new Roo.dd.DDProxy(this.el.dom.id, "XSplitBars", {dragElId : this.proxy.id});
+    
+    /** @private */
+    this.dd.b4StartDrag = this.onStartProxyDrag.createDelegate(this);
+    
+    /** @private */
+    this.dd.endDrag = this.onEndProxyDrag.createDelegate(this);
+    
+    /** @private */
+    this.dragSpecs = {};
+    
+    /**
+     * @private The adapter to use to positon and resize elements
+     */
+    this.adapter = new Roo.SplitBar.BasicLayoutAdapter();
+    this.adapter.init(this);
+    
+    if(this.orientation == Roo.SplitBar.HORIZONTAL){
+        /** @private */
+        this.placement = placement || (this.el.getX() > this.resizingEl.getX() ? Roo.SplitBar.LEFT : Roo.SplitBar.RIGHT);
+        this.el.addClass("x-splitbar-h");
+    }else{
+        /** @private */
+        this.placement = placement || (this.el.getY() > this.resizingEl.getY() ? Roo.SplitBar.TOP : Roo.SplitBar.BOTTOM);
+        this.el.addClass("x-splitbar-v");
+    }
+    
+    this.addEvents({
+        /**
+         * @event resize
+         * Fires when the splitter is moved (alias for {@link #event-moved})
+         * @param {Roo.SplitBar} this
+         * @param {Number} newSize the new width or height
+         */
+        "resize" : true,
+        /**
+         * @event moved
+         * Fires when the splitter is moved
+         * @param {Roo.SplitBar} this
+         * @param {Number} newSize the new width or height
+         */
+        "moved" : true,
+        /**
+         * @event beforeresize
+         * Fires before the splitter is dragged
+         * @param {Roo.SplitBar} this
+         */
+        "beforeresize" : true,
+
+        "beforeapply" : true
+    });
+
+    Roo.util.Observable.call(this);
+};
+
+Roo.extend(Roo.SplitBar, Roo.util.Observable, {
+    onStartProxyDrag : function(x, y){
+        this.fireEvent("beforeresize", this);
+        if(!this.overlay){
+            var o = Roo.DomHelper.insertFirst(document.body,  {cls: "x-drag-overlay", html: "&#160;"}, true);
+            o.unselectable();
+            o.enableDisplayMode("block");
+            // all splitbars share the same overlay
+            Roo.SplitBar.prototype.overlay = o;
+        }
+        this.overlay.setSize(Roo.lib.Dom.getViewWidth(true), Roo.lib.Dom.getViewHeight(true));
+        this.overlay.show();
+        Roo.get(this.proxy).setDisplayed("block");
+        var size = this.adapter.getElementSize(this);
+        this.activeMinSize = this.getMinimumSize();;
+        this.activeMaxSize = this.getMaximumSize();;
+        var c1 = size - this.activeMinSize;
+        var c2 = Math.max(this.activeMaxSize - size, 0);
+        if(this.orientation == Roo.SplitBar.HORIZONTAL){
+            this.dd.resetConstraints();
+            this.dd.setXConstraint(
+                this.placement == Roo.SplitBar.LEFT ? c1 : c2, 
+                this.placement == Roo.SplitBar.LEFT ? c2 : c1
+            );
+            this.dd.setYConstraint(0, 0);
+        }else{
+            this.dd.resetConstraints();
+            this.dd.setXConstraint(0, 0);
+            this.dd.setYConstraint(
+                this.placement == Roo.SplitBar.TOP ? c1 : c2, 
+                this.placement == Roo.SplitBar.TOP ? c2 : c1
+            );
+         }
+        this.dragSpecs.startSize = size;
+        this.dragSpecs.startPoint = [x, y];
+        Roo.dd.DDProxy.prototype.b4StartDrag.call(this.dd, x, y);
+    },
+    
+    /** 
+     * @private Called after the drag operation by the DDProxy
+     */
+    onEndProxyDrag : function(e){
+        Roo.get(this.proxy).setDisplayed(false);
+        var endPoint = Roo.lib.Event.getXY(e);
+        if(this.overlay){
+            this.overlay.hide();
+        }
+        var newSize;
+        if(this.orientation == Roo.SplitBar.HORIZONTAL){
+            newSize = this.dragSpecs.startSize + 
+                (this.placement == Roo.SplitBar.LEFT ?
+                    endPoint[0] - this.dragSpecs.startPoint[0] :
+                    this.dragSpecs.startPoint[0] - endPoint[0]
+                );
+        }else{
+            newSize = this.dragSpecs.startSize + 
+                (this.placement == Roo.SplitBar.TOP ?
+                    endPoint[1] - this.dragSpecs.startPoint[1] :
+                    this.dragSpecs.startPoint[1] - endPoint[1]
+                );
+        }
+        newSize = Math.min(Math.max(newSize, this.activeMinSize), this.activeMaxSize);
+        if(newSize != this.dragSpecs.startSize){
+            if(this.fireEvent('beforeapply', this, newSize) !== false){
+                this.adapter.setElementSize(this, newSize);
+                this.fireEvent("moved", this, newSize);
+                this.fireEvent("resize", this, newSize);
+            }
+        }
+    },
+    
+    /**
+     * Get the adapter this SplitBar uses
+     * @return The adapter object
+     */
+    getAdapter : function(){
+        return this.adapter;
+    },
+    
+    /**
+     * Set the adapter this SplitBar uses
+     * @param {Object} adapter A SplitBar adapter object
+     */
+    setAdapter : function(adapter){
+        this.adapter = adapter;
+        this.adapter.init(this);
+    },
+    
+    /**
+     * Gets the minimum size for the resizing element
+     * @return {Number} The minimum size
+     */
+    getMinimumSize : function(){
+        return this.minSize;
+    },
+    
+    /**
+     * Sets the minimum size for the resizing element
+     * @param {Number} minSize The minimum size
+     */
+    setMinimumSize : function(minSize){
+        this.minSize = minSize;
+    },
+    
+    /**
+     * Gets the maximum size for the resizing element
+     * @return {Number} The maximum size
+     */
+    getMaximumSize : function(){
+        return this.maxSize;
+    },
+    
+    /**
+     * Sets the maximum size for the resizing element
+     * @param {Number} maxSize The maximum size
+     */
+    setMaximumSize : function(maxSize){
+        this.maxSize = maxSize;
+    },
+    
+    /**
+     * Sets the initialize size for the resizing element
+     * @param {Number} size The initial size
+     */
+    setCurrentSize : function(size){
+        var oldAnimate = this.animate;
+        this.animate = false;
+        this.adapter.setElementSize(this, size);
+        this.animate = oldAnimate;
+    },
+    
+    /**
+     * Destroy this splitbar. 
+     * @param {Boolean} removeEl True to remove the element
+     */
+    destroy : function(removeEl){
+        if(this.shim){
+            this.shim.remove();
+        }
+        this.dd.unreg();
+        this.proxy.parentNode.removeChild(this.proxy);
+        if(removeEl){
+            this.el.remove();
+        }
+    }
+});
+
+/**
+ * @private static Create our own proxy element element. So it will be the same same size on all browsers, we won't use borders. Instead we use a background color.
+ */
+Roo.SplitBar.createProxy = function(dir){
+    var proxy = new Roo.Element(document.createElement("div"));
+    proxy.unselectable();
+    var cls = 'x-splitbar-proxy';
+    proxy.addClass(cls + ' ' + (dir == Roo.SplitBar.HORIZONTAL ? cls +'-h' : cls + '-v'));
+    document.body.appendChild(proxy.dom);
+    return proxy.dom;
+};
+
+/** 
+ * @class Roo.SplitBar.BasicLayoutAdapter
+ * Default Adapter. It assumes the splitter and resizing element are not positioned
+ * elements and only gets/sets the width of the element. Generally used for table based layouts.
+ */
+Roo.SplitBar.BasicLayoutAdapter = function(){
+};
+
+Roo.SplitBar.BasicLayoutAdapter.prototype = {
+    // do nothing for now
+    init : function(s){
+    
+    },
+    /**
+     * Called before drag operations to get the current size of the resizing element. 
+     * @param {Roo.SplitBar} s The SplitBar using this adapter
+     */
+     getElementSize : function(s){
+        if(s.orientation == Roo.SplitBar.HORIZONTAL){
+            return s.resizingEl.getWidth();
+        }else{
+            return s.resizingEl.getHeight();
+        }
+    },
+    
+    /**
+     * Called after drag operations to set the size of the resizing element.
+     * @param {Roo.SplitBar} s The SplitBar using this adapter
+     * @param {Number} newSize The new size to set
+     * @param {Function} onComplete A function to be invoked when resizing is complete
+     */
+    setElementSize : function(s, newSize, onComplete){
+        if(s.orientation == Roo.SplitBar.HORIZONTAL){
+            if(!s.animate){
+                s.resizingEl.setWidth(newSize);
+                if(onComplete){
+                    onComplete(s, newSize);
+                }
+            }else{
+                s.resizingEl.setWidth(newSize, true, .1, onComplete, 'easeOut');
+            }
+        }else{
+            
+            if(!s.animate){
+                s.resizingEl.setHeight(newSize);
+                if(onComplete){
+                    onComplete(s, newSize);
+                }
+            }else{
+                s.resizingEl.setHeight(newSize, true, .1, onComplete, 'easeOut');
+            }
+        }
+    }
+};
+
+/** 
+ *@class Roo.SplitBar.AbsoluteLayoutAdapter
+ * @extends Roo.SplitBar.BasicLayoutAdapter
+ * Adapter that  moves the splitter element to align with the resized sizing element. 
+ * Used with an absolute positioned SplitBar.
+ * @param {String/HTMLElement/Roo.Element} container The container that wraps around the absolute positioned content. If it's
+ * document.body, make sure you assign an id to the body element.
+ */
+Roo.SplitBar.AbsoluteLayoutAdapter = function(container){
+    this.basic = new Roo.SplitBar.BasicLayoutAdapter();
+    this.container = Roo.get(container);
+};
+
+Roo.SplitBar.AbsoluteLayoutAdapter.prototype = {
+    init : function(s){
+        this.basic.init(s);
+    },
+    
+    getElementSize : function(s){
+        return this.basic.getElementSize(s);
+    },
+    
+    setElementSize : function(s, newSize, onComplete){
+        this.basic.setElementSize(s, newSize, this.moveSplitter.createDelegate(this, [s]));
+    },
+    
+    moveSplitter : function(s){
+        var yes = Roo.SplitBar;
+        switch(s.placement){
+            case yes.LEFT:
+                s.el.setX(s.resizingEl.getRight());
+                break;
+            case yes.RIGHT:
+                s.el.setStyle("right", (this.container.getWidth() - s.resizingEl.getLeft()) + "px");
+                break;
+            case yes.TOP:
+                s.el.setY(s.resizingEl.getBottom());
+                break;
+            case yes.BOTTOM:
+                s.el.setY(s.resizingEl.getTop() - s.el.getHeight());
+                break;
+        }
+    }
+};
+
+/**
+ * Orientation constant - Create a vertical SplitBar
+ * @static
+ * @type Number
+ */
+Roo.SplitBar.VERTICAL = 1;
+
+/**
+ * Orientation constant - Create a horizontal SplitBar
+ * @static
+ * @type Number
+ */
+Roo.SplitBar.HORIZONTAL = 2;
+
+/**
+ * Placement constant - The resizing element is to the left of the splitter element
+ * @static
+ * @type Number
+ */
+Roo.SplitBar.LEFT = 1;
+
+/**
+ * Placement constant - The resizing element is to the right of the splitter element
+ * @static
+ * @type Number
+ */
+Roo.SplitBar.RIGHT = 2;
+
+/**
+ * Placement constant - The resizing element is positioned above the splitter element
+ * @static
+ * @type Number
+ */
+Roo.SplitBar.TOP = 3;
+
+/**
+ * Placement constant - The resizing element is positioned under splitter element
+ * @static
+ * @type Number
+ */
+Roo.SplitBar.BOTTOM = 4;
diff --git a/Roo/SplitButton.js b/Roo/SplitButton.js
new file mode 100644 (file)
index 0000000..e16a485
--- /dev/null
@@ -0,0 +1,194 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+/**
+ * @class Roo.SplitButton
+ * @extends Roo.Button
+ * A split button that provides a built-in dropdown arrow that can fire an event separately from the default
+ * click event of the button.  Typically this would be used to display a dropdown menu that provides additional
+ * options to the primary button action, but any custom handler can provide the arrowclick implementation.
+ * @cfg {Function} arrowHandler A function called when the arrow button is clicked (can be used instead of click event)
+ * @cfg {String} arrowTooltip The title attribute of the arrow
+ * @constructor
+ * Create a new menu button
+ * @param {String/HTMLElement/Element} renderTo The element to append the button to
+ * @param {Object} config The config object
+ */
+Roo.SplitButton = function(renderTo, config){
+    Roo.SplitButton.superclass.constructor.call(this, renderTo, config);
+    /**
+     * @event arrowclick
+     * Fires when this button's arrow is clicked
+     * @param {SplitButton} this
+     * @param {EventObject} e The click event
+     */
+    this.addEvents({"arrowclick":true});
+};
+
+Roo.extend(Roo.SplitButton, Roo.Button, {
+    render : function(renderTo){
+        // this is one sweet looking template!
+        var tpl = new Roo.Template(
+            '<table cellspacing="0" class="x-btn-menu-wrap x-btn"><tr><td>',
+            '<table cellspacing="0" class="x-btn-wrap x-btn-menu-text-wrap"><tbody>',
+            '<tr><td class="x-btn-left"><i>&#160;</i></td><td class="x-btn-center"><button class="x-btn-text" type="{1}">{0}</button></td></tr>',
+            "</tbody></table></td><td>",
+            '<table cellspacing="0" class="x-btn-wrap x-btn-menu-arrow-wrap"><tbody>',
+            '<tr><td class="x-btn-center"><button class="x-btn-menu-arrow-el" type="button">&#160;</button></td><td class="x-btn-right"><i>&#160;</i></td></tr>',
+            "</tbody></table></td></tr></table>"
+        );
+        var btn = tpl.append(renderTo, [this.text, this.type], true);
+        var btnEl = btn.child("button");
+        if(this.cls){
+            btn.addClass(this.cls);
+        }
+        if(this.icon){
+            btnEl.setStyle('background-image', 'url(' +this.icon +')');
+        }
+        if(this.iconCls){
+            btnEl.addClass(this.iconCls);
+            if(!this.cls){
+                btn.addClass(this.text ? 'x-btn-text-icon' : 'x-btn-icon');
+            }
+        }
+        this.el = btn;
+        if(this.handleMouseEvents){
+            btn.on("mouseover", this.onMouseOver, this);
+            btn.on("mouseout", this.onMouseOut, this);
+            btn.on("mousedown", this.onMouseDown, this);
+            btn.on("mouseup", this.onMouseUp, this);
+        }
+        btn.on(this.clickEvent, this.onClick, this);
+        if(this.tooltip){
+            if(typeof this.tooltip == 'object'){
+                Roo.QuickTips.tips(Roo.apply({
+                      target: btnEl.id
+                }, this.tooltip));
+            } else {
+                btnEl.dom[this.tooltipType] = this.tooltip;
+            }
+        }
+        if(this.arrowTooltip){
+            btn.child("button:nth(2)").dom[this.tooltipType] = this.arrowTooltip;
+        }
+        if(this.hidden){
+            this.hide();
+        }
+        if(this.disabled){
+            this.disable();
+        }
+        if(this.pressed){
+            this.el.addClass("x-btn-pressed");
+        }
+        if(Roo.isIE && !Roo.isIE7){
+            this.autoWidth.defer(1, this);
+        }else{
+            this.autoWidth();
+        }
+        if(this.menu){
+            this.menu.on("show", this.onMenuShow, this);
+            this.menu.on("hide", this.onMenuHide, this);
+        }
+        this.fireEvent('render', this);
+    },
+
+    // private
+    autoWidth : function(){
+        if(this.el){
+            var tbl = this.el.child("table:first");
+            var tbl2 = this.el.child("table:last");
+            this.el.setWidth("auto");
+            tbl.setWidth("auto");
+            if(Roo.isIE7 && Roo.isStrict){
+                var ib = this.el.child('button:first');
+                if(ib && ib.getWidth() > 20){
+                    ib.clip();
+                    ib.setWidth(Roo.util.TextMetrics.measure(ib, this.text).width+ib.getFrameWidth('lr'));
+                }
+            }
+            if(this.minWidth){
+                if(this.hidden){
+                    this.el.beginMeasure();
+                }
+                if((tbl.getWidth()+tbl2.getWidth()) < this.minWidth){
+                    tbl.setWidth(this.minWidth-tbl2.getWidth());
+                }
+                if(this.hidden){
+                    this.el.endMeasure();
+                }
+            }
+            this.el.setWidth(tbl.getWidth()+tbl2.getWidth());
+        } 
+    },
+    /**
+     * Sets this button's click handler
+     * @param {Function} handler The function to call when the button is clicked
+     * @param {Object} scope (optional) Scope for the function passed above
+     */
+    setHandler : function(handler, scope){
+        this.handler = handler;
+        this.scope = scope;  
+    },
+    
+    /**
+     * Sets this button's arrow click handler
+     * @param {Function} handler The function to call when the arrow is clicked
+     * @param {Object} scope (optional) Scope for the function passed above
+     */
+    setArrowHandler : function(handler, scope){
+        this.arrowHandler = handler;
+        this.scope = scope;  
+    },
+    
+    /**
+     * Focus the button
+     */
+    focus : function(){
+        if(this.el){
+            this.el.child("button:first").focus();
+        }
+    },
+
+    // private
+    onClick : function(e){
+        e.preventDefault();
+        if(!this.disabled){
+            if(e.getTarget(".x-btn-menu-arrow-wrap")){
+                if(this.menu && !this.menu.isVisible()){
+                    this.menu.show(this.el, this.menuAlign);
+                }
+                this.fireEvent("arrowclick", this, e);
+                if(this.arrowHandler){
+                    this.arrowHandler.call(this.scope || this, this, e);
+                }
+            }else{
+                this.fireEvent("click", this, e);
+                if(this.handler){
+                    this.handler.call(this.scope || this, this, e);
+                }
+            }
+        }
+    },
+    // private
+    onMouseDown : function(e){
+        if(!this.disabled){
+            Roo.fly(e.getTarget("table")).addClass("x-btn-click");
+        }
+    },
+    // private
+    onMouseUp : function(e){
+        Roo.fly(e.getTarget("table")).removeClass("x-btn-click");
+    }   
+});
+
+
+// backwards compat
+Roo.MenuButton = Roo.SplitButton;
\ No newline at end of file
diff --git a/Roo/SplitLayoutRegion.js b/Roo/SplitLayoutRegion.js
new file mode 100644 (file)
index 0000000..89d25b2
--- /dev/null
@@ -0,0 +1,339 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+
+
+/**
+ * @class Roo.SplitLayoutRegion
+ * @extends Roo.LayoutRegion
+ * Adds a splitbar and other (private) useful functionality to a {@link Roo.LayoutRegion}.
+ */
+Roo.SplitLayoutRegion = function(mgr, config, pos, cursor){
+    this.cursor = cursor;
+    Roo.SplitLayoutRegion.superclass.constructor.call(this, mgr, config, pos);
+};
+
+Roo.extend(Roo.SplitLayoutRegion, Roo.LayoutRegion, {
+    splitTip : "Drag to resize.",
+    collapsibleSplitTip : "Drag to resize. Double click to hide.",
+    useSplitTips : false,
+
+    applyConfig : function(config){
+        Roo.SplitLayoutRegion.superclass.applyConfig.call(this, config);
+        if(config.split){
+            if(!this.split){
+                var splitEl = Roo.DomHelper.append(this.mgr.el.dom, 
+                        {tag: "div", id: this.el.id + "-split", cls: "x-layout-split x-layout-split-"+this.position, html: "&#160;"});
+                /** The SplitBar for this region 
+                * @type Roo.SplitBar */
+                this.split = new Roo.SplitBar(splitEl, this.el, this.orientation);
+                this.split.on("moved", this.onSplitMove, this);
+                this.split.useShim = config.useShim === true;
+                this.split.getMaximumSize = this[this.position == 'north' || this.position == 'south' ? 'getVMaxSize' : 'getHMaxSize'].createDelegate(this);
+                if(this.useSplitTips){
+                    this.split.el.dom.title = config.collapsible ? this.collapsibleSplitTip : this.splitTip;
+                }
+                if(config.collapsible){
+                    this.split.el.on("dblclick", this.collapse,  this);
+                }
+            }
+            if(typeof config.minSize != "undefined"){
+                this.split.minSize = config.minSize;
+            }
+            if(typeof config.maxSize != "undefined"){
+                this.split.maxSize = config.maxSize;
+            }
+            if(config.hideWhenEmpty || config.hidden || config.collapsed){
+                this.hideSplitter();
+            }
+        }
+    },
+
+    getHMaxSize : function(){
+         var cmax = this.config.maxSize || 10000;
+         var center = this.mgr.getRegion("center");
+         return Math.min(cmax, (this.el.getWidth()+center.getEl().getWidth())-center.getMinWidth());
+    },
+
+    getVMaxSize : function(){
+         var cmax = this.config.maxSize || 10000;
+         var center = this.mgr.getRegion("center");
+         return Math.min(cmax, (this.el.getHeight()+center.getEl().getHeight())-center.getMinHeight());
+    },
+
+    onSplitMove : function(split, newSize){
+        this.fireEvent("resized", this, newSize);
+    },
+    
+    /** 
+     * Returns the {@link Roo.SplitBar} for this region.
+     * @return {Roo.SplitBar}
+     */
+    getSplitBar : function(){
+        return this.split;
+    },
+    
+    hide : function(){
+        this.hideSplitter();
+        Roo.SplitLayoutRegion.superclass.hide.call(this);
+    },
+
+    hideSplitter : function(){
+        if(this.split){
+            this.split.el.setLocation(-2000,-2000);
+            this.split.el.hide();
+        }
+    },
+
+    show : function(){
+        if(this.split){
+            this.split.el.show();
+        }
+        Roo.SplitLayoutRegion.superclass.show.call(this);
+    },
+    
+    beforeSlide: function(){
+        if(Roo.isGecko){// firefox overflow auto bug workaround
+            this.bodyEl.clip();
+            if(this.tabs) this.tabs.bodyEl.clip();
+            if(this.activePanel){
+                this.activePanel.getEl().clip();
+                
+                if(this.activePanel.beforeSlide){
+                    this.activePanel.beforeSlide();
+                }
+            }
+        }
+    },
+    
+    afterSlide : function(){
+        if(Roo.isGecko){// firefox overflow auto bug workaround
+            this.bodyEl.unclip();
+            if(this.tabs) this.tabs.bodyEl.unclip();
+            if(this.activePanel){
+                this.activePanel.getEl().unclip();
+                if(this.activePanel.afterSlide){
+                    this.activePanel.afterSlide();
+                }
+            }
+        }
+    },
+
+    initAutoHide : function(){
+        if(this.autoHide !== false){
+            if(!this.autoHideHd){
+                var st = new Roo.util.DelayedTask(this.slideIn, this);
+                this.autoHideHd = {
+                    "mouseout": function(e){
+                        if(!e.within(this.el, true)){
+                            st.delay(500);
+                        }
+                    },
+                    "mouseover" : function(e){
+                        st.cancel();
+                    },
+                    scope : this
+                };
+            }
+            this.el.on(this.autoHideHd);
+        }
+    },
+
+    clearAutoHide : function(){
+        if(this.autoHide !== false){
+            this.el.un("mouseout", this.autoHideHd.mouseout);
+            this.el.un("mouseover", this.autoHideHd.mouseover);
+        }
+    },
+
+    clearMonitor : function(){
+        Roo.get(document).un("click", this.slideInIf, this);
+    },
+
+    // these names are backwards but not changed for compat
+    slideOut : function(){
+        if(this.isSlid || this.el.hasActiveFx()){
+            return;
+        }
+        this.isSlid = true;
+        if(this.collapseBtn){
+            this.collapseBtn.hide();
+        }
+        this.closeBtnState = this.closeBtn.getStyle('display');
+        this.closeBtn.hide();
+        if(this.stickBtn){
+            this.stickBtn.show();
+        }
+        this.el.show();
+        this.el.alignTo(this.collapsedEl, this.getCollapseAnchor());
+        this.beforeSlide();
+        this.el.setStyle("z-index", 10001);
+        this.el.slideIn(this.getSlideAnchor(), {
+            callback: function(){
+                this.afterSlide();
+                this.initAutoHide();
+                Roo.get(document).on("click", this.slideInIf, this);
+                this.fireEvent("slideshow", this);
+            },
+            scope: this,
+            block: true
+        });
+    },
+
+    afterSlideIn : function(){
+        this.clearAutoHide();
+        this.isSlid = false;
+        this.clearMonitor();
+        this.el.setStyle("z-index", "");
+        if(this.collapseBtn){
+            this.collapseBtn.show();
+        }
+        this.closeBtn.setStyle('display', this.closeBtnState);
+        if(this.stickBtn){
+            this.stickBtn.hide();
+        }
+        this.fireEvent("slidehide", this);
+    },
+
+    slideIn : function(cb){
+        if(!this.isSlid || this.el.hasActiveFx()){
+            Roo.callback(cb);
+            return;
+        }
+        this.isSlid = false;
+        this.beforeSlide();
+        this.el.slideOut(this.getSlideAnchor(), {
+            callback: function(){
+                this.el.setLeftTop(-10000, -10000);
+                this.afterSlide();
+                this.afterSlideIn();
+                Roo.callback(cb);
+            },
+            scope: this,
+            block: true
+        });
+    },
+    
+    slideInIf : function(e){
+        if(!e.within(this.el)){
+            this.slideIn();
+        }
+    },
+
+    animateCollapse : function(){
+        this.beforeSlide();
+        this.el.setStyle("z-index", 20000);
+        var anchor = this.getSlideAnchor();
+        this.el.slideOut(anchor, {
+            callback : function(){
+                this.el.setStyle("z-index", "");
+                this.collapsedEl.slideIn(anchor, {duration:.3});
+                this.afterSlide();
+                this.el.setLocation(-10000,-10000);
+                this.el.hide();
+                this.fireEvent("collapsed", this);
+            },
+            scope: this,
+            block: true
+        });
+    },
+
+    animateExpand : function(){
+        this.beforeSlide();
+        this.el.alignTo(this.collapsedEl, this.getCollapseAnchor(), this.getExpandAdj());
+        this.el.setStyle("z-index", 20000);
+        this.collapsedEl.hide({
+            duration:.1
+        });
+        this.el.slideIn(this.getSlideAnchor(), {
+            callback : function(){
+                this.el.setStyle("z-index", "");
+                this.afterSlide();
+                if(this.split){
+                    this.split.el.show();
+                }
+                this.fireEvent("invalidated", this);
+                this.fireEvent("expanded", this);
+            },
+            scope: this,
+            block: true
+        });
+    },
+
+    anchors : {
+        "west" : "left",
+        "east" : "right",
+        "north" : "top",
+        "south" : "bottom"
+    },
+
+    sanchors : {
+        "west" : "l",
+        "east" : "r",
+        "north" : "t",
+        "south" : "b"
+    },
+
+    canchors : {
+        "west" : "tl-tr",
+        "east" : "tr-tl",
+        "north" : "tl-bl",
+        "south" : "bl-tl"
+    },
+
+    getAnchor : function(){
+        return this.anchors[this.position];
+    },
+
+    getCollapseAnchor : function(){
+        return this.canchors[this.position];
+    },
+
+    getSlideAnchor : function(){
+        return this.sanchors[this.position];
+    },
+
+    getAlignAdj : function(){
+        var cm = this.cmargins;
+        switch(this.position){
+            case "west":
+                return [0, 0];
+            break;
+            case "east":
+                return [0, 0];
+            break;
+            case "north":
+                return [0, 0];
+            break;
+            case "south":
+                return [0, 0];
+            break;
+        }
+    },
+
+    getExpandAdj : function(){
+        var c = this.collapsedEl, cm = this.cmargins;
+        switch(this.position){
+            case "west":
+                return [-(cm.right+c.getWidth()+cm.left), 0];
+            break;
+            case "east":
+                return [cm.right+c.getWidth()+cm.left, 0];
+            break;
+            case "north":
+                return [0, -(cm.top+cm.bottom+c.getHeight())];
+            break;
+            case "south":
+                return [0, cm.top+cm.bottom+c.getHeight()];
+            break;
+        }
+    }
+});
\ No newline at end of file
diff --git a/Roo/TabPanel.js b/Roo/TabPanel.js
new file mode 100644 (file)
index 0000000..b586dc8
--- /dev/null
@@ -0,0 +1,777 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+/**
+ * @class Roo.TabPanel
+ * @extends Roo.util.Observable
+ * A lightweight tab container.
+ * <br><br>
+ * Usage:
+ * <pre><code>
+// basic tabs 1, built from existing content
+var tabs = new Roo.TabPanel("tabs1");
+tabs.addTab("script", "View Script");
+tabs.addTab("markup", "View Markup");
+tabs.activate("script");
+
+// more advanced tabs, built from javascript
+var jtabs = new Roo.TabPanel("jtabs");
+jtabs.addTab("jtabs-1", "Normal Tab", "My content was added during construction.");
+
+// set up the UpdateManager
+var tab2 = jtabs.addTab("jtabs-2", "Ajax Tab 1");
+var updater = tab2.getUpdateManager();
+updater.setDefaultUrl("ajax1.htm");
+tab2.on('activate', updater.refresh, updater, true);
+
+// Use setUrl for Ajax loading
+var tab3 = jtabs.addTab("jtabs-3", "Ajax Tab 2");
+tab3.setUrl("ajax2.htm", null, true);
+
+// Disabled tab
+var tab4 = jtabs.addTab("tabs1-5", "Disabled Tab", "Can't see me cause I'm disabled");
+tab4.disable();
+
+jtabs.activate("jtabs-1");
+ * </code></pre>
+ * @constructor
+ * Create a new TabPanel.
+ * @param {String/HTMLElement/Roo.Element} container The id, DOM element or Roo.Element container where this TabPanel is to be rendered.
+ * @param {Object/Boolean} config Config object to set any properties for this TabPanel, or true to render the tabs on the bottom.
+ */
+Roo.TabPanel = function(container, config){
+    /**
+    * The container element for this TabPanel.
+    * @type Roo.Element
+    */
+    this.el = Roo.get(container, true);
+    if(config){
+        if(typeof config == "boolean"){
+            this.tabPosition = config ? "bottom" : "top";
+        }else{
+            Roo.apply(this, config);
+        }
+    }
+    if(this.tabPosition == "bottom"){
+        this.bodyEl = Roo.get(this.createBody(this.el.dom));
+        this.el.addClass("x-tabs-bottom");
+    }
+    this.stripWrap = Roo.get(this.createStrip(this.el.dom), true);
+    this.stripEl = Roo.get(this.createStripList(this.stripWrap.dom), true);
+    this.stripBody = Roo.get(this.stripWrap.dom.firstChild.firstChild, true);
+    if(Roo.isIE){
+        Roo.fly(this.stripWrap.dom.firstChild).setStyle("overflow-x", "hidden");
+    }
+    if(this.tabPosition != "bottom"){
+    /** The body element that contains {@link Roo.TabPanelItem} bodies.
+     * @type Roo.Element
+     */
+      this.bodyEl = Roo.get(this.createBody(this.el.dom));
+      this.el.addClass("x-tabs-top");
+    }
+    this.items = [];
+
+    this.bodyEl.setStyle("position", "relative");
+
+    this.active = null;
+    this.activateDelegate = this.activate.createDelegate(this);
+
+    this.addEvents({
+        /**
+         * @event tabchange
+         * Fires when the active tab changes
+         * @param {Roo.TabPanel} this
+         * @param {Roo.TabPanelItem} activePanel The new active tab
+         */
+        "tabchange": true,
+        /**
+         * @event beforetabchange
+         * Fires before the active tab changes, set cancel to true on the "e" parameter to cancel the change
+         * @param {Roo.TabPanel} this
+         * @param {Object} e Set cancel to true on this object to cancel the tab change
+         * @param {Roo.TabPanelItem} tab The tab being changed to
+         */
+        "beforetabchange" : true
+    });
+
+    Roo.EventManager.onWindowResize(this.onResize, this);
+    this.cpad = this.el.getPadding("lr");
+    this.hiddenCount = 0;
+
+    Roo.TabPanel.superclass.constructor.call(this);
+};
+
+Roo.extend(Roo.TabPanel, Roo.util.Observable, {
+       /*
+        *@cfg {String} tabPosition "top" or "bottom" (defaults to "top")
+        */
+    tabPosition : "top",
+       /*
+        *@cfg {Number} currentTabWidth The width of the current tab (defaults to 0)
+        */
+    currentTabWidth : 0,
+       /*
+        *@cfg {Number} minTabWidth The minimum width of a tab (defaults to 40) (ignored if {@link #resizeTabs} is not true)
+        */
+    minTabWidth : 40,
+       /*
+        *@cfg {Number} maxTabWidth The maximum width of a tab (defaults to 250) (ignored if {@link #resizeTabs} is not true)
+        */
+    maxTabWidth : 250,
+       /*
+        *@cfg {Number} preferredTabWidth The preferred (default) width of a tab (defaults to 175) (ignored if {@link #resizeTabs} is not true)
+        */
+    preferredTabWidth : 175,
+       /*
+        *@cfg {Boolean} resizeTabs True to enable dynamic tab resizing (defaults to false)
+        */
+    resizeTabs : false,
+       /*
+        *@cfg {Boolean} monitorResize Set this to true to turn on window resize monitoring (ignored if {@link #resizeTabs} is not true) (defaults to true)
+        */
+    monitorResize : true,
+
+    /**
+     * Creates a new {@link Roo.TabPanelItem} by looking for an existing element with the provided id -- if it's not found it creates one.
+     * @param {String} id The id of the div to use <b>or create</b>
+     * @param {String} text The text for the tab
+     * @param {String} content (optional) Content to put in the TabPanelItem body
+     * @param {Boolean} closable (optional) True to create a close icon on the tab
+     * @return {Roo.TabPanelItem} The created TabPanelItem
+     */
+    addTab : function(id, text, content, closable){
+        var item = new Roo.TabPanelItem(this, id, text, closable);
+        this.addTabItem(item);
+        if(content){
+            item.setContent(content);
+        }
+        return item;
+    },
+
+    /**
+     * Returns the {@link Roo.TabPanelItem} with the specified id/index
+     * @param {String/Number} id The id or index of the TabPanelItem to fetch.
+     * @return {Roo.TabPanelItem}
+     */
+    getTab : function(id){
+        return this.items[id];
+    },
+
+    /**
+     * Hides the {@link Roo.TabPanelItem} with the specified id/index
+     * @param {String/Number} id The id or index of the TabPanelItem to hide.
+     */
+    hideTab : function(id){
+        var t = this.items[id];
+        if(!t.isHidden()){
+           t.setHidden(true);
+           this.hiddenCount++;
+           this.autoSizeTabs();
+        }
+    },
+
+    /**
+     * "Unhides" the {@link Roo.TabPanelItem} with the specified id/index.
+     * @param {String/Number} id The id or index of the TabPanelItem to unhide.
+     */
+    unhideTab : function(id){
+        var t = this.items[id];
+        if(t.isHidden()){
+           t.setHidden(false);
+           this.hiddenCount--;
+           this.autoSizeTabs();
+        }
+    },
+
+    /**
+     * Adds an existing {@link Roo.TabPanelItem}.
+     * @param {Roo.TabPanelItem} item The TabPanelItem to add
+     */
+    addTabItem : function(item){
+        this.items[item.id] = item;
+        this.items.push(item);
+        if(this.resizeTabs){
+           item.setWidth(this.currentTabWidth || this.preferredTabWidth);
+           this.autoSizeTabs();
+        }else{
+            item.autoSize();
+        }
+    },
+
+    /**
+     * Removes a {@link Roo.TabPanelItem}.
+     * @param {String/Number} id The id or index of the TabPanelItem to remove.
+     */
+    removeTab : function(id){
+        var items = this.items;
+        var tab = items[id];
+        if(!tab) return;
+        var index = items.indexOf(tab);
+        if(this.active == tab && items.length > 1){
+            var newTab = this.getNextAvailable(index);
+            if(newTab)newTab.activate();
+        }
+        this.stripEl.dom.removeChild(tab.pnode.dom);
+        if(tab.bodyEl.dom.parentNode == this.bodyEl.dom){ // if it was moved already prevent error
+            this.bodyEl.dom.removeChild(tab.bodyEl.dom);
+        }
+        items.splice(index, 1);
+        delete this.items[tab.id];
+        tab.fireEvent("close", tab);
+        tab.purgeListeners();
+        this.autoSizeTabs();
+    },
+
+    getNextAvailable : function(start){
+        var items = this.items;
+        var index = start;
+        // look for a next tab that will slide over to
+        // replace the one being removed
+        while(index < items.length){
+            var item = items[++index];
+            if(item && !item.isHidden()){
+                return item;
+            }
+        }
+        // if one isn't found select the previous tab (on the left)
+        index = start;
+        while(index >= 0){
+            var item = items[--index];
+            if(item && !item.isHidden()){
+                return item;
+            }
+        }
+        return null;
+    },
+
+    /**
+     * Disables a {@link Roo.TabPanelItem}. It cannot be the active tab, if it is this call is ignored.
+     * @param {String/Number} id The id or index of the TabPanelItem to disable.
+     */
+    disableTab : function(id){
+        var tab = this.items[id];
+        if(tab && this.active != tab){
+            tab.disable();
+        }
+    },
+
+    /**
+     * Enables a {@link Roo.TabPanelItem} that is disabled.
+     * @param {String/Number} id The id or index of the TabPanelItem to enable.
+     */
+    enableTab : function(id){
+        var tab = this.items[id];
+        tab.enable();
+    },
+
+    /**
+     * Activates a {@link Roo.TabPanelItem}. The currently active one will be deactivated.
+     * @param {String/Number} id The id or index of the TabPanelItem to activate.
+     * @return {Roo.TabPanelItem} The TabPanelItem.
+     */
+    activate : function(id){
+        var tab = this.items[id];
+        if(!tab){
+            return null;
+        }
+        if(tab == this.active || tab.disabled){
+            return tab;
+        }
+        var e = {};
+        this.fireEvent("beforetabchange", this, e, tab);
+        if(e.cancel !== true && !tab.disabled){
+            if(this.active){
+                this.active.hide();
+            }
+            this.active = this.items[id];
+            this.active.show();
+            this.fireEvent("tabchange", this, this.active);
+        }
+        return tab;
+    },
+
+    /**
+     * Gets the active {@link Roo.TabPanelItem}.
+     * @return {Roo.TabPanelItem} The active TabPanelItem or null if none are active.
+     */
+    getActiveTab : function(){
+        return this.active;
+    },
+
+    /**
+     * Updates the tab body element to fit the height of the container element
+     * for overflow scrolling
+     * @param {Number} targetHeight (optional) Override the starting height from the elements height
+     */
+    syncHeight : function(targetHeight){
+        var height = (targetHeight || this.el.getHeight())-this.el.getBorderWidth("tb")-this.el.getPadding("tb");
+        var bm = this.bodyEl.getMargins();
+        var newHeight = height-(this.stripWrap.getHeight()||0)-(bm.top+bm.bottom);
+        this.bodyEl.setHeight(newHeight);
+        return newHeight;
+    },
+
+    onResize : function(){
+        if(this.monitorResize){
+            this.autoSizeTabs();
+        }
+    },
+
+    /**
+     * Disables tab resizing while tabs are being added (if {@link #resizeTabs} is false this does nothing)
+     */
+    beginUpdate : function(){
+        this.updating = true;
+    },
+
+    /**
+     * Stops an update and resizes the tabs (if {@link #resizeTabs} is false this does nothing)
+     */
+    endUpdate : function(){
+        this.updating = false;
+        this.autoSizeTabs();
+    },
+
+    /**
+     * Manual call to resize the tabs (if {@link #resizeTabs} is false this does nothing)
+     */
+    autoSizeTabs : function(){
+        var count = this.items.length;
+        var vcount = count - this.hiddenCount;
+        if(!this.resizeTabs || count < 1 || vcount < 1 || this.updating) return;
+        var w = Math.max(this.el.getWidth() - this.cpad, 10);
+        var availWidth = Math.floor(w / vcount);
+        var b = this.stripBody;
+        if(b.getWidth() > w){
+            var tabs = this.items;
+            this.setTabWidth(Math.max(availWidth, this.minTabWidth)-2);
+            if(availWidth < this.minTabWidth){
+                /*if(!this.sleft){    // incomplete scrolling code
+                    this.createScrollButtons();
+                }
+                this.showScroll();
+                this.stripClip.setWidth(w - (this.sleft.getWidth()+this.sright.getWidth()));*/
+            }
+        }else{
+            if(this.currentTabWidth < this.preferredTabWidth){
+                this.setTabWidth(Math.min(availWidth, this.preferredTabWidth)-2);
+            }
+        }
+    },
+
+    /**
+     * Returns the number of tabs in this TabPanel.
+     * @return {Number}
+     */
+     getCount : function(){
+         return this.items.length;
+     },
+
+    /**
+     * Resizes all the tabs to the passed width
+     * @param {Number} The new width
+     */
+    setTabWidth : function(width){
+        this.currentTabWidth = width;
+        for(var i = 0, len = this.items.length; i < len; i++) {
+               if(!this.items[i].isHidden())this.items[i].setWidth(width);
+        }
+    },
+
+    /**
+     * Destroys this TabPanel
+     * @param {Boolean} removeEl (optional) True to remove the element from the DOM as well (defaults to undefined)
+     */
+    destroy : function(removeEl){
+        Roo.EventManager.removeResizeListener(this.onResize, this);
+        for(var i = 0, len = this.items.length; i < len; i++){
+            this.items[i].purgeListeners();
+        }
+        if(removeEl === true){
+            this.el.update("");
+            this.el.remove();
+        }
+    }
+});
+
+/**
+ * @class Roo.TabPanelItem
+ * @extends Roo.util.Observable
+ * Represents an individual item (tab plus body) in a TabPanel.
+ * @param {Roo.TabPanel} tabPanel The {@link Roo.TabPanel} this TabPanelItem belongs to
+ * @param {String} id The id of this TabPanelItem
+ * @param {String} text The text for the tab of this TabPanelItem
+ * @param {Boolean} closable True to allow this TabPanelItem to be closable (defaults to false)
+ */
+Roo.TabPanelItem = function(tabPanel, id, text, closable){
+    /**
+     * The {@link Roo.TabPanel} this TabPanelItem belongs to
+     * @type Roo.TabPanel
+     */
+    this.tabPanel = tabPanel;
+    /**
+     * The id for this TabPanelItem
+     * @type String
+     */
+    this.id = id;
+    /** @private */
+    this.disabled = false;
+    /** @private */
+    this.text = text;
+    /** @private */
+    this.loaded = false;
+    this.closable = closable;
+
+    /**
+     * The body element for this TabPanelItem.
+     * @type Roo.Element
+     */
+    this.bodyEl = Roo.get(tabPanel.createItemBody(tabPanel.bodyEl.dom, id));
+    this.bodyEl.setVisibilityMode(Roo.Element.VISIBILITY);
+    this.bodyEl.setStyle("display", "block");
+    this.bodyEl.setStyle("zoom", "1");
+    this.hideAction();
+
+    var els = tabPanel.createStripElements(tabPanel.stripEl.dom, text, closable);
+    /** @private */
+    this.el = Roo.get(els.el, true);
+    this.inner = Roo.get(els.inner, true);
+    this.textEl = Roo.get(this.el.dom.firstChild.firstChild.firstChild, true);
+    this.pnode = Roo.get(els.el.parentNode, true);
+    this.el.on("mousedown", this.onTabMouseDown, this);
+    this.el.on("click", this.onTabClick, this);
+    /** @private */
+    if(closable){
+        var c = Roo.get(els.close, true);
+        c.dom.title = this.closeText;
+        c.addClassOnOver("close-over");
+        c.on("click", this.closeClick, this);
+     }
+
+    this.addEvents({
+         /**
+         * @event activate
+         * Fires when this tab becomes the active tab.
+         * @param {Roo.TabPanel} tabPanel The parent TabPanel
+         * @param {Roo.TabPanelItem} this
+         */
+        "activate": true,
+        /**
+         * @event beforeclose
+         * Fires before this tab is closed. To cancel the close, set cancel to true on e (e.cancel = true).
+         * @param {Roo.TabPanelItem} this
+         * @param {Object} e Set cancel to true on this object to cancel the close.
+         */
+        "beforeclose": true,
+        /**
+         * @event close
+         * Fires when this tab is closed.
+         * @param {Roo.TabPanelItem} this
+         */
+         "close": true,
+        /**
+         * @event deactivate
+         * Fires when this tab is no longer the active tab.
+         * @param {Roo.TabPanel} tabPanel The parent TabPanel
+         * @param {Roo.TabPanelItem} this
+         */
+         "deactivate" : true
+    });
+    this.hidden = false;
+
+    Roo.TabPanelItem.superclass.constructor.call(this);
+};
+
+Roo.extend(Roo.TabPanelItem, Roo.util.Observable, {
+    purgeListeners : function(){
+       Roo.util.Observable.prototype.purgeListeners.call(this);
+       this.el.removeAllListeners();
+    },
+    /**
+     * Shows this TabPanelItem -- this <b>does not</b> deactivate the currently active TabPanelItem.
+     */
+    show : function(){
+        this.pnode.addClass("on");
+        this.showAction();
+        if(Roo.isOpera){
+            this.tabPanel.stripWrap.repaint();
+        }
+        this.fireEvent("activate", this.tabPanel, this);
+    },
+
+    /**
+     * Returns true if this tab is the active tab.
+     * @return {Boolean}
+     */
+    isActive : function(){
+        return this.tabPanel.getActiveTab() == this;
+    },
+
+    /**
+     * Hides this TabPanelItem -- if you don't activate another TabPanelItem this could look odd.
+     */
+    hide : function(){
+        this.pnode.removeClass("on");
+        this.hideAction();
+        this.fireEvent("deactivate", this.tabPanel, this);
+    },
+
+    hideAction : function(){
+        this.bodyEl.hide();
+        this.bodyEl.setStyle("position", "absolute");
+        this.bodyEl.setLeft("-20000px");
+        this.bodyEl.setTop("-20000px");
+    },
+
+    showAction : function(){
+        this.bodyEl.setStyle("position", "relative");
+        this.bodyEl.setTop("");
+        this.bodyEl.setLeft("");
+        this.bodyEl.show();
+    },
+
+    /**
+     * Set the tooltip for the tab.
+     * @param {String} tooltip The tab's tooltip
+     */
+    setTooltip : function(text){
+        if(Roo.QuickTips && Roo.QuickTips.isEnabled()){
+            this.textEl.dom.qtip = text;
+            this.textEl.dom.removeAttribute('title');
+        }else{
+            this.textEl.dom.title = text;
+        }
+    },
+
+    onTabClick : function(e){
+        e.preventDefault();
+        this.tabPanel.activate(this.id);
+    },
+
+    onTabMouseDown : function(e){
+        e.preventDefault();
+        this.tabPanel.activate(this.id);
+    },
+
+    getWidth : function(){
+        return this.inner.getWidth();
+    },
+
+    setWidth : function(width){
+        var iwidth = width - this.pnode.getPadding("lr");
+        this.inner.setWidth(iwidth);
+        this.textEl.setWidth(iwidth-this.inner.getPadding("lr"));
+        this.pnode.setWidth(width);
+    },
+
+    /**
+     * Show or hide the tab
+     * @param {Boolean} hidden True to hide or false to show.
+     */
+    setHidden : function(hidden){
+        this.hidden = hidden;
+        this.pnode.setStyle("display", hidden ? "none" : "");
+    },
+
+    /**
+     * Returns true if this tab is "hidden"
+     * @return {Boolean}
+     */
+    isHidden : function(){
+        return this.hidden;
+    },
+
+    /**
+     * Returns the text for this tab
+     * @return {String}
+     */
+    getText : function(){
+        return this.text;
+    },
+
+    autoSize : function(){
+        //this.el.beginMeasure();
+        this.textEl.setWidth(1);
+        this.setWidth(this.textEl.dom.scrollWidth+this.pnode.getPadding("lr")+this.inner.getPadding("lr"));
+        //this.el.endMeasure();
+    },
+
+    /**
+     * Sets the text for the tab (Note: this also sets the tooltip text)
+     * @param {String} text The tab's text and tooltip
+     */
+    setText : function(text){
+        this.text = text;
+        this.textEl.update(text);
+        this.setTooltip(text);
+        if(!this.tabPanel.resizeTabs){
+            this.autoSize();
+        }
+    },
+    /**
+     * Activates this TabPanelItem -- this <b>does</b> deactivate the currently active TabPanelItem.
+     */
+    activate : function(){
+        this.tabPanel.activate(this.id);
+    },
+
+    /**
+     * Disables this TabPanelItem -- this does nothing if this is the active TabPanelItem.
+     */
+    disable : function(){
+        if(this.tabPanel.active != this){
+            this.disabled = true;
+            this.pnode.addClass("disabled");
+        }
+    },
+
+    /**
+     * Enables this TabPanelItem if it was previously disabled.
+     */
+    enable : function(){
+        this.disabled = false;
+        this.pnode.removeClass("disabled");
+    },
+
+    /**
+     * Sets the content for this TabPanelItem.
+     * @param {String} content The content
+     * @param {Boolean} loadScripts true to look for and load scripts
+     */
+    setContent : function(content, loadScripts){
+        this.bodyEl.update(content, loadScripts);
+    },
+
+    /**
+     * Gets the {@link Roo.UpdateManager} for the body of this TabPanelItem. Enables you to perform Ajax updates.
+     * @return {Roo.UpdateManager} The UpdateManager
+     */
+    getUpdateManager : function(){
+        return this.bodyEl.getUpdateManager();
+    },
+
+    /**
+     * Set a URL to be used to load the content for this TabPanelItem.
+     * @param {String/Function} url The URL to load the content from, or a function to call to get the URL
+     * @param {String/Object} params (optional) The string params for the update call or an object of the params. See {@link Roo.UpdateManager#update} for more details. (Defaults to null)
+     * @param {Boolean} loadOnce (optional) Whether to only load the content once. If this is false it makes the Ajax call every time this TabPanelItem is activated. (Defaults to false)
+     * @return {Roo.UpdateManager} The UpdateManager
+     */
+    setUrl : function(url, params, loadOnce){
+        if(this.refreshDelegate){
+            this.un('activate', this.refreshDelegate);
+        }
+        this.refreshDelegate = this._handleRefresh.createDelegate(this, [url, params, loadOnce]);
+        this.on("activate", this.refreshDelegate);
+        return this.bodyEl.getUpdateManager();
+    },
+
+    /** @private */
+    _handleRefresh : function(url, params, loadOnce){
+        if(!loadOnce || !this.loaded){
+            var updater = this.bodyEl.getUpdateManager();
+            updater.update(url, params, this._setLoaded.createDelegate(this));
+        }
+    },
+
+    /**
+     *   Forces a content refresh from the URL specified in the {@link #setUrl} method.
+     *   Will fail silently if the setUrl method has not been called.
+     *   This does not activate the panel, just updates its content.
+     */
+    refresh : function(){
+        if(this.refreshDelegate){
+           this.loaded = false;
+           this.refreshDelegate();
+        }
+    },
+
+    /** @private */
+    _setLoaded : function(){
+        this.loaded = true;
+    },
+
+    /** @private */
+    closeClick : function(e){
+        var o = {};
+        e.stopEvent();
+        this.fireEvent("beforeclose", this, o);
+        if(o.cancel !== true){
+            this.tabPanel.removeTab(this.id);
+        }
+    },
+    /**
+     * The text displayed in the tooltip for the close icon.
+     * @type String
+     */
+    closeText : "Close this tab"
+});
+
+/** @private */
+Roo.TabPanel.prototype.createStrip = function(container){
+    var strip = document.createElement("div");
+    strip.className = "x-tabs-wrap";
+    container.appendChild(strip);
+    return strip;
+};
+/** @private */
+Roo.TabPanel.prototype.createStripList = function(strip){
+    // div wrapper for retard IE
+    strip.innerHTML = '<div class="x-tabs-strip-wrap"><table class="x-tabs-strip" cellspacing="0" cellpadding="0" border="0"><tbody><tr></tr></tbody></table></div>';
+    return strip.firstChild.firstChild.firstChild.firstChild;
+};
+/** @private */
+Roo.TabPanel.prototype.createBody = function(container){
+    var body = document.createElement("div");
+    Roo.id(body, "tab-body");
+    Roo.fly(body).addClass("x-tabs-body");
+    container.appendChild(body);
+    return body;
+};
+/** @private */
+Roo.TabPanel.prototype.createItemBody = function(bodyEl, id){
+    var body = Roo.getDom(id);
+    if(!body){
+        body = document.createElement("div");
+        body.id = id;
+    }
+    Roo.fly(body).addClass("x-tabs-item-body");
+    bodyEl.insertBefore(body, bodyEl.firstChild);
+    return body;
+};
+/** @private */
+Roo.TabPanel.prototype.createStripElements = function(stripEl, text, closable){
+    var td = document.createElement("td");
+    stripEl.appendChild(td);
+    if(closable){
+        td.className = "x-tabs-closable";
+        if(!this.closeTpl){
+            this.closeTpl = new Roo.Template(
+               '<a href="#" class="x-tabs-right"><span class="x-tabs-left"><em class="x-tabs-inner">' +
+               '<span unselectable="on"' + (this.disableTooltips ? '' : ' title="{text}"') +' class="x-tabs-text">{text}</span>' +
+               '<div unselectable="on" class="close-icon">&#160;</div></em></span></a>'
+            );
+        }
+        var el = this.closeTpl.overwrite(td, {"text": text});
+        var close = el.getElementsByTagName("div")[0];
+        var inner = el.getElementsByTagName("em")[0];
+        return {"el": el, "close": close, "inner": inner};
+    } else {
+        if(!this.tabTpl){
+            this.tabTpl = new Roo.Template(
+               '<a href="#" class="x-tabs-right"><span class="x-tabs-left"><em class="x-tabs-inner">' +
+               '<span unselectable="on"' + (this.disableTooltips ? '' : ' title="{text}"') +' class="x-tabs-text">{text}</span></em></span></a>'
+            );
+        }
+        var el = this.tabTpl.overwrite(td, {"text": text});
+        var inner = el.getElementsByTagName("em")[0];
+        return {"el": el, "inner": inner};
+    }
+};
\ No newline at end of file
diff --git a/Roo/Template.js b/Roo/Template.js
new file mode 100644 (file)
index 0000000..281628c
--- /dev/null
@@ -0,0 +1,234 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+/**
+* @class Roo.Template
+* Represents an HTML fragment template. Templates can be precompiled for greater performance.
+* For a list of available format functions, see {@link Roo.util.Format}.<br />
+* Usage:
+<pre><code>
+var t = new Roo.Template(
+    '&lt;div name="{id}"&gt;',
+        '&lt;span class="{cls}"&gt;{name:trim} {value:ellipsis(10)}&lt;/span&gt;',
+    '&lt;/div&gt;'
+);
+t.append('some-element', {id: 'myid', cls: 'myclass', name: 'foo', value: 'bar'});
+</code></pre>
+* For more information see this blog post with examples: <a href="http://www.jackslocum.com/yui/2006/10/06/domhelper-create-elements-using-dom-html-fragments-or-templates/">DomHelper - Create Elements using DOM, HTML fragments and Templates</a>. 
+* @constructor
+* @param {String/Array} html The HTML fragment or an array of fragments to join("") or multiple arguments to join("")
+*/
+Roo.Template = function(html){
+    if(html instanceof Array){
+        html = html.join("");
+    }else if(arguments.length > 1){
+        html = Array.prototype.join.call(arguments, "");
+    }
+    /**@private*/
+    this.html = html;
+    
+};
+Roo.Template.prototype = {
+    /**
+     * Returns an HTML fragment of this template with the specified values applied.
+     * @param {Object} values The template values. Can be an array if your params are numeric (i.e. {0}) or an object (i.e. {foo: 'bar'})
+     * @return {String} The HTML fragment
+     */
+    applyTemplate : function(values){
+        if(this.compiled){
+            return this.compiled(values);
+        }
+        var useF = this.disableFormats !== true;
+        var fm = Roo.util.Format, tpl = this;
+        var fn = function(m, name, format, args){
+            if(format && useF){
+                if(format.substr(0, 5) == "this."){
+                    return tpl.call(format.substr(5), values[name], values);
+                }else{
+                    if(args){
+                        // quoted values are required for strings in compiled templates, 
+                        // but for non compiled we need to strip them
+                        // quoted reversed for jsmin
+                        var re = /^\s*['"](.*)["']\s*$/;
+                        args = args.split(',');
+                        for(var i = 0, len = args.length; i < len; i++){
+                            args[i] = args[i].replace(re, "$1");
+                        }
+                        args = [values[name]].concat(args);
+                    }else{
+                        args = [values[name]];
+                    }
+                    return fm[format].apply(fm, args);
+                }
+            }else{
+                return values[name] !== undefined ? values[name] : "";
+            }
+        };
+        return this.html.replace(this.re, fn);
+    },
+    
+    /**
+     * Sets the HTML used as the template and optionally compiles it.
+     * @param {String} html
+     * @param {Boolean} compile (optional) True to compile the template (defaults to undefined)
+     * @return {Roo.Template} this
+     */
+    set : function(html, compile){
+        this.html = html;
+        this.compiled = null;
+        if(compile){
+            this.compile();
+        }
+        return this;
+    },
+    
+    /**
+     * True to disable format functions (defaults to false)
+     * @type Boolean
+     */
+    disableFormats : false,
+    
+    /**
+    * The regular expression used to match template variables 
+    * @type RegExp
+    * @property 
+    */
+    re : /\{([\w-]+)(?:\:([\w\.]*)(?:\((.*?)?\))?)?\}/g,
+    
+    /**
+     * Compiles the template into an internal function, eliminating the RegEx overhead.
+     * @return {Roo.Template} this
+     */
+    compile : function(){
+        var fm = Roo.util.Format;
+        var useF = this.disableFormats !== true;
+        var sep = Roo.isGecko ? "+" : ",";
+        var fn = function(m, name, format, args){
+            if(format && useF){
+                args = args ? ',' + args : "";
+                if(format.substr(0, 5) != "this."){
+                    format = "fm." + format + '(';
+                }else{
+                    format = 'this.call("'+ format.substr(5) + '", ';
+                    args = ", values";
+                }
+            }else{
+                args= ''; format = "(values['" + name + "'] == undefined ? '' : ";
+            }
+            return "'"+ sep + format + "values['" + name + "']" + args + ")"+sep+"'";
+        };
+        var body;
+        // branched to use + in gecko and [].join() in others
+        if(Roo.isGecko){
+            body = "this.compiled = function(values){ return '" +
+                   this.html.replace(/\\/g, '\\\\').replace(/(\r\n|\n)/g, '\\n').replace(/'/g, "\\'").replace(this.re, fn) +
+                    "';};";
+        }else{
+            body = ["this.compiled = function(values){ return ['"];
+            body.push(this.html.replace(/\\/g, '\\\\').replace(/(\r\n|\n)/g, '\\n').replace(/'/g, "\\'").replace(this.re, fn));
+            body.push("'].join('');};");
+            body = body.join('');
+        }
+        /**
+         * eval:var:values
+         * eval:var:fm
+         */
+        eval(body);
+        return this;
+    },
+    
+    // private function used to call members
+    call : function(fnName, value, allValues){
+        return this[fnName](value, allValues);
+    },
+    
+    /**
+     * Applies the supplied values to the template and inserts the new node(s) as the first child of el.
+     * @param {String/HTMLElement/Roo.Element} el The context element
+     * @param {Object} values The template values. Can be an array if your params are numeric (i.e. {0}) or an object (i.e. {foo: 'bar'})
+     * @param {Boolean} returnElement (optional) true to return a Roo.Element (defaults to undefined)
+     * @return {HTMLElement/Roo.Element} The new node or Element
+     */
+    insertFirst: function(el, values, returnElement){
+        return this.doInsert('afterBegin', el, values, returnElement);
+    },
+
+    /**
+     * Applies the supplied values to the template and inserts the new node(s) before el.
+     * @param {String/HTMLElement/Roo.Element} el The context element
+     * @param {Object} values The template values. Can be an array if your params are numeric (i.e. {0}) or an object (i.e. {foo: 'bar'})
+     * @param {Boolean} returnElement (optional) true to return a Roo.Element (defaults to undefined)
+     * @return {HTMLElement/Roo.Element} The new node or Element
+     */
+    insertBefore: function(el, values, returnElement){
+        return this.doInsert('beforeBegin', el, values, returnElement);
+    },
+
+    /**
+     * Applies the supplied values to the template and inserts the new node(s) after el.
+     * @param {String/HTMLElement/Roo.Element} el The context element
+     * @param {Object} values The template values. Can be an array if your params are numeric (i.e. {0}) or an object (i.e. {foo: 'bar'})
+     * @param {Boolean} returnElement (optional) true to return a Roo.Element (defaults to undefined)
+     * @return {HTMLElement/Roo.Element} The new node or Element
+     */
+    insertAfter : function(el, values, returnElement){
+        return this.doInsert('afterEnd', el, values, returnElement);
+    },
+    
+    /**
+     * Applies the supplied values to the template and appends the new node(s) to el.
+     * @param {String/HTMLElement/Roo.Element} el The context element
+     * @param {Object} values The template values. Can be an array if your params are numeric (i.e. {0}) or an object (i.e. {foo: 'bar'})
+     * @param {Boolean} returnElement (optional) true to return a Roo.Element (defaults to undefined)
+     * @return {HTMLElement/Roo.Element} The new node or Element
+     */
+    append : function(el, values, returnElement){
+        return this.doInsert('beforeEnd', el, values, returnElement);
+    },
+
+    doInsert : function(where, el, values, returnEl){
+        el = Roo.getDom(el);
+        var newNode = Roo.DomHelper.insertHtml(where, el, this.applyTemplate(values));
+        return returnEl ? Roo.get(newNode, true) : newNode;
+    },
+
+    /**
+     * Applies the supplied values to the template and overwrites the content of el with the new node(s).
+     * @param {String/HTMLElement/Roo.Element} el The context element
+     * @param {Object} values The template values. Can be an array if your params are numeric (i.e. {0}) or an object (i.e. {foo: 'bar'})
+     * @param {Boolean} returnElement (optional) true to return a Roo.Element (defaults to undefined)
+     * @return {HTMLElement/Roo.Element} The new node or Element
+     */
+    overwrite : function(el, values, returnElement){
+        el = Roo.getDom(el);
+        el.innerHTML = this.applyTemplate(values);
+        return returnElement ? Roo.get(el.firstChild, true) : el.firstChild;
+    }
+};
+/**
+ * Alias for {@link #applyTemplate}
+ * @method
+ */
+Roo.Template.prototype.apply = Roo.Template.prototype.applyTemplate;
+
+// backwards compat
+Roo.DomHelper.Template = Roo.Template;
+
+/**
+ * Creates a template from the passed element's value (<i>display:none</i> textarea, preferred) or innerHTML.
+ * @param {String/HTMLElement} el A DOM element or its id
+ * @returns {Roo.Template} The created template
+ * @static
+ */
+Roo.Template.from = function(el){
+    el = Roo.getDom(el);
+    return new Roo.Template(el.value || el.innerHTML);
+};
\ No newline at end of file
diff --git a/Roo/Toolbar.js b/Roo/Toolbar.js
new file mode 100644 (file)
index 0000000..8d7de71
--- /dev/null
@@ -0,0 +1,617 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+
+/**
+ * @class Roo.Toolbar
+ * Basic Toolbar class.
+ * @constructor
+ * Creates a new Toolbar
+ * @param {Object} config The config object
+ */ 
+Roo.Toolbar = function(container, buttons, config)
+{
+    /// old consturctor format still supported..
+    if(container instanceof Array){ // omit the container for later rendering
+        buttons = container;
+        config = buttons;
+        container = null;
+    }
+    if (typeof(container) == 'object' && container.xtype) {
+        config = container;
+        container = config.container;
+        buttons = config.buttons; // not really - use items!!
+    }
+    var xitems = [];
+    if (config && config.items) {
+        xitems = config.items;
+        delete config.items;
+    }
+    Roo.apply(this, config);
+    this.buttons = buttons;
+    
+    if(container){
+        this.render(container);
+    }
+    Roo.each(xitems, function(b) {
+        this.add(b);
+    }, this);
+    
+};
+
+Roo.Toolbar.prototype = {
+    /**
+     * @cfg {Roo.data.Store} items
+     * array of button configs or elements to add
+     */
+    
+    /**
+     * @cfg {String/HTMLElement/Element} container
+     * The id or element that will contain the toolbar
+     */
+    // private
+    render : function(ct){
+        this.el = Roo.get(ct);
+        if(this.cls){
+            this.el.addClass(this.cls);
+        }
+        // using a table allows for vertical alignment
+        // 100% width is needed by Safari...
+        this.el.update('<div class="x-toolbar x-small-editor"><table cellspacing="0"><tr></tr></table></div>');
+        this.tr = this.el.child("tr", true);
+        var autoId = 0;
+        this.items = new Roo.util.MixedCollection(false, function(o){
+            return o.id || ("item" + (++autoId));
+        });
+        if(this.buttons){
+            this.add.apply(this, this.buttons);
+            delete this.buttons;
+        }
+    },
+
+    /**
+     * Adds element(s) to the toolbar -- this function takes a variable number of 
+     * arguments of mixed type and adds them to the toolbar.
+     * @param {Mixed} arg1 The following types of arguments are all valid:<br />
+     * <ul>
+     * <li>{@link Roo.Toolbar.Button} config: A valid button config object (equivalent to {@link #addButton})</li>
+     * <li>HtmlElement: Any standard HTML element (equivalent to {@link #addElement})</li>
+     * <li>Field: Any form field (equivalent to {@link #addField})</li>
+     * <li>Item: Any subclass of {@link Roo.Toolbar.Item} (equivalent to {@link #addItem})</li>
+     * <li>String: Any generic string (gets wrapped in a {@link Roo.Toolbar.TextItem}, equivalent to {@link #addText}).
+     * Note that there are a few special strings that are treated differently as explained nRoo.</li>
+     * <li>'separator' or '-': Creates a separator element (equivalent to {@link #addSeparator})</li>
+     * <li>' ': Creates a spacer element (equivalent to {@link #addSpacer})</li>
+     * <li>'->': Creates a fill element (equivalent to {@link #addFill})</li>
+     * </ul>
+     * @param {Mixed} arg2
+     * @param {Mixed} etc.
+     */
+    add : function(){
+        var a = arguments, l = a.length;
+        for(var i = 0; i < l; i++){
+            this._add(a[i]);
+        }
+    },
+    // private..
+    _add : function(el) {
+        
+        if (el.xtype) {
+            el = Roo.factory(el, typeof(Roo.Toolbar[el.xtype]) == 'undefined' ? Roo.form : Roo.Toolbar);
+        }
+        
+        if (el.applyTo){ // some kind of form field
+            return this.addField(el);
+        } 
+        if (el.render){ // some kind of Toolbar.Item
+            return this.addItem(el);
+        }
+        if (typeof el == "string"){ // string
+            if(el == "separator" || el == "-"){
+                return this.addSeparator();
+            }
+            if (el == " "){
+                return this.addSpacer();
+            }
+            if(el == "->"){
+                return this.addFill();
+            }
+            return this.addText(el);
+            
+        }
+        if(el.tagName){ // element
+            return this.addElement(el);
+        }
+        if(typeof el == "object"){ // must be button config?
+            return this.addButton(el);
+        }
+        // and now what?!?!
+        return false;
+        
+    },
+    
+    /**
+     * Add an Xtype element
+     * @param {Object} xtype Xtype Object
+     * @return {Object} created Object
+     */
+    addxtype : function(e){
+        return this.add(e);  
+    },
+    
+    /**
+     * Returns the Element for this toolbar.
+     * @return {Roo.Element}
+     */
+    getEl : function(){
+        return this.el;  
+    },
+    
+    /**
+     * Adds a separator
+     * @return {Roo.Toolbar.Item} The separator item
+     */
+    addSeparator : function(){
+        return this.addItem(new Roo.Toolbar.Separator());
+    },
+
+    /**
+     * Adds a spacer element
+     * @return {Roo.Toolbar.Spacer} The spacer item
+     */
+    addSpacer : function(){
+        return this.addItem(new Roo.Toolbar.Spacer());
+    },
+
+    /**
+     * Adds a fill element that forces subsequent additions to the right side of the toolbar
+     * @return {Roo.Toolbar.Fill} The fill item
+     */
+    addFill : function(){
+        return this.addItem(new Roo.Toolbar.Fill());
+    },
+
+    /**
+     * Adds any standard HTML element to the toolbar
+     * @param {String/HTMLElement/Element} el The element or id of the element to add
+     * @return {Roo.Toolbar.Item} The element's item
+     */
+    addElement : function(el){
+        return this.addItem(new Roo.Toolbar.Item(el));
+    },
+    /**
+     * Collection of items on the toolbar.. (only Toolbar Items, so use fields to retrieve fields)
+     * @type Roo.util.MixedCollection  
+     */
+    items : false,
+     
+    /**
+     * Adds any Toolbar.Item or subclass
+     * @param {Roo.Toolbar.Item} item
+     * @return {Roo.Toolbar.Item} The item
+     */
+    addItem : function(item){
+        var td = this.nextBlock();
+        item.render(td);
+        this.items.add(item);
+        return item;
+    },
+    
+    /**
+     * Adds a button (or buttons). See {@link Roo.Toolbar.Button} for more info on the config.
+     * @param {Object/Array} config A button config or array of configs
+     * @return {Roo.Toolbar.Button/Array}
+     */
+    addButton : function(config){
+        if(config instanceof Array){
+            var buttons = [];
+            for(var i = 0, len = config.length; i < len; i++) {
+                buttons.push(this.addButton(config[i]));
+            }
+            return buttons;
+        }
+        var b = config;
+        if(!(config instanceof Roo.Toolbar.Button)){
+            b = config.split ?
+                new Roo.Toolbar.SplitButton(config) :
+                new Roo.Toolbar.Button(config);
+        }
+        var td = this.nextBlock();
+        b.render(td);
+        this.items.add(b);
+        return b;
+    },
+    
+    /**
+     * Adds text to the toolbar
+     * @param {String} text The text to add
+     * @return {Roo.Toolbar.Item} The element's item
+     */
+    addText : function(text){
+        return this.addItem(new Roo.Toolbar.TextItem(text));
+    },
+    
+    /**
+     * Inserts any {@link Roo.Toolbar.Item}/{@link Roo.Toolbar.Button} at the specified index.
+     * @param {Number} index The index where the item is to be inserted
+     * @param {Object/Roo.Toolbar.Item/Roo.Toolbar.Button (may be Array)} item The button, or button config object to be inserted.
+     * @return {Roo.Toolbar.Button/Item}
+     */
+    insertButton : function(index, item){
+        if(item instanceof Array){
+            var buttons = [];
+            for(var i = 0, len = item.length; i < len; i++) {
+               buttons.push(this.insertButton(index + i, item[i]));
+            }
+            return buttons;
+        }
+        if (!(item instanceof Roo.Toolbar.Button)){
+           item = new Roo.Toolbar.Button(item);
+        }
+        var td = document.createElement("td");
+        this.tr.insertBefore(td, this.tr.childNodes[index]);
+        item.render(td);
+        this.items.insert(index, item);
+        return item;
+    },
+    
+    /**
+     * Adds a new element to the toolbar from the passed {@link Roo.DomHelper} config.
+     * @param {Object} config
+     * @return {Roo.Toolbar.Item} The element's item
+     */
+    addDom : function(config, returnEl){
+        var td = this.nextBlock();
+        Roo.DomHelper.overwrite(td, config);
+        var ti = new Roo.Toolbar.Item(td.firstChild);
+        ti.render(td);
+        this.items.add(ti);
+        return ti;
+    },
+
+    /**
+     * Collection of fields on the toolbar.. usefull for quering (value is false if there are no fields)
+     * @type Roo.util.MixedCollection  
+     */
+    fields : false,
+    
+    /**
+     * Adds a dynamically rendered Roo.form field (TextField, ComboBox, etc). Note: the field should not have
+     * been rendered yet. For a field that has already been rendered, use {@link #addElement}.
+     * @param {Roo.form.Field} field
+     * @return {Roo.ToolbarItem}
+     */
+     
+      
+    addField : function(field) {
+        if (!this.fields) {
+            var autoId = 0;
+            this.fields = new Roo.util.MixedCollection(false, function(o){
+                return o.id || ("item" + (++autoId));
+            });
+
+        }
+        
+        var td = this.nextBlock();
+        field.render(td);
+        var ti = new Roo.Toolbar.Item(td.firstChild);
+        ti.render(td);
+        this.items.add(ti);
+        this.fields.add(field);
+        return ti;
+    },
+    /**
+     * Hide the toolbar
+     * @method hide
+     */
+     
+      
+    hide : function()
+    {
+        this.el.child('div').setVisibilityMode(Roo.Element.DISPLAY);
+        this.el.child('div').hide();
+    },
+    /**
+     * Show the toolbar
+     * @method show
+     */
+    show : function()
+    {
+        this.el.child('div').show();
+    },
+      
+    // private
+    nextBlock : function(){
+        var td = document.createElement("td");
+        this.tr.appendChild(td);
+        return td;
+    },
+
+    // private
+    destroy : function(){
+        if(this.items){ // rendered?
+            Roo.destroy.apply(Roo, this.items.items);
+        }
+        if(this.fields){ // rendered?
+            Roo.destroy.apply(Roo, this.fields.items);
+        }
+        Roo.Element.uncache(this.el, this.tr);
+    }
+};
+
+/**
+ * @class Roo.Toolbar.Item
+ * The base class that other classes should extend in order to get some basic common toolbar item functionality.
+ * @constructor
+ * Creates a new Item
+ * @param {HTMLElement} el 
+ */
+Roo.Toolbar.Item = function(el){
+    this.el = Roo.getDom(el);
+    this.id = Roo.id(this.el);
+    this.hidden = false;
+};
+
+Roo.Toolbar.Item.prototype = {
+    
+    /**
+     * Get this item's HTML Element
+     * @return {HTMLElement}
+     */
+    getEl : function(){
+       return this.el;  
+    },
+
+    // private
+    render : function(td){
+        this.td = td;
+        td.appendChild(this.el);
+    },
+    
+    /**
+     * Removes and destroys this item.
+     */
+    destroy : function(){
+        this.td.parentNode.removeChild(this.td);
+    },
+    
+    /**
+     * Shows this item.
+     */
+    show: function(){
+        this.hidden = false;
+        this.td.style.display = "";
+    },
+    
+    /**
+     * Hides this item.
+     */
+    hide: function(){
+        this.hidden = true;
+        this.td.style.display = "none";
+    },
+    
+    /**
+     * Convenience function for boolean show/hide.
+     * @param {Boolean} visible true to show/false to hide
+     */
+    setVisible: function(visible){
+        if(visible) {
+            this.show();
+        }else{
+            this.hide();
+        }
+    },
+    
+    /**
+     * Try to focus this item.
+     */
+    focus : function(){
+        Roo.fly(this.el).focus();
+    },
+    
+    /**
+     * Disables this item.
+     */
+    disable : function(){
+        Roo.fly(this.td).addClass("x-item-disabled");
+        this.disabled = true;
+        this.el.disabled = true;
+    },
+    
+    /**
+     * Enables this item.
+     */
+    enable : function(){
+        Roo.fly(this.td).removeClass("x-item-disabled");
+        this.disabled = false;
+        this.el.disabled = false;
+    }
+};
+
+
+/**
+ * @class Roo.Toolbar.Separator
+ * @extends Roo.Toolbar.Item
+ * A simple toolbar separator class
+ * @constructor
+ * Creates a new Separator
+ */
+Roo.Toolbar.Separator = function(){
+    var s = document.createElement("span");
+    s.className = "ytb-sep";
+    Roo.Toolbar.Separator.superclass.constructor.call(this, s);
+};
+Roo.extend(Roo.Toolbar.Separator, Roo.Toolbar.Item, {
+    enable:Roo.emptyFn,
+    disable:Roo.emptyFn,
+    focus:Roo.emptyFn
+});
+
+/**
+ * @class Roo.Toolbar.Spacer
+ * @extends Roo.Toolbar.Item
+ * A simple element that adds extra horizontal space to a toolbar.
+ * @constructor
+ * Creates a new Spacer
+ */
+Roo.Toolbar.Spacer = function(){
+    var s = document.createElement("div");
+    s.className = "ytb-spacer";
+    Roo.Toolbar.Spacer.superclass.constructor.call(this, s);
+};
+Roo.extend(Roo.Toolbar.Spacer, Roo.Toolbar.Item, {
+    enable:Roo.emptyFn,
+    disable:Roo.emptyFn,
+    focus:Roo.emptyFn
+});
+
+/**
+ * @class Roo.Toolbar.Fill
+ * @extends Roo.Toolbar.Spacer
+ * A simple element that adds a greedy (100% width) horizontal space to a toolbar.
+ * @constructor
+ * Creates a new Spacer
+ */
+Roo.Toolbar.Fill = Roo.extend(Roo.Toolbar.Spacer, {
+    // private
+    render : function(td){
+        td.style.width = '100%';
+        Roo.Toolbar.Fill.superclass.render.call(this, td);
+    }
+});
+
+/**
+ * @class Roo.Toolbar.TextItem
+ * @extends Roo.Toolbar.Item
+ * A simple class that renders text directly into a toolbar.
+ * @constructor
+ * Creates a new TextItem
+ * @param {String} text
+ */
+Roo.Toolbar.TextItem = function(text){
+    if (typeof(text) == 'object') {
+        text = text.text;
+    }
+    var s = document.createElement("span");
+    s.className = "ytb-text";
+    s.innerHTML = text;
+    Roo.Toolbar.TextItem.superclass.constructor.call(this, s);
+};
+Roo.extend(Roo.Toolbar.TextItem, Roo.Toolbar.Item, {
+    enable:Roo.emptyFn,
+    disable:Roo.emptyFn,
+    focus:Roo.emptyFn
+});
+
+/**
+ * @class Roo.Toolbar.Button
+ * @extends Roo.Button
+ * A button that renders into a toolbar.
+ * @constructor
+ * Creates a new Button
+ * @param {Object} config A standard {@link Roo.Button} config object
+ */
+Roo.Toolbar.Button = function(config){
+    Roo.Toolbar.Button.superclass.constructor.call(this, null, config);
+};
+Roo.extend(Roo.Toolbar.Button, Roo.Button, {
+    render : function(td){
+        this.td = td;
+        Roo.Toolbar.Button.superclass.render.call(this, td);
+    },
+    
+    /**
+     * Removes and destroys this button
+     */
+    destroy : function(){
+        Roo.Toolbar.Button.superclass.destroy.call(this);
+        this.td.parentNode.removeChild(this.td);
+    },
+    
+    /**
+     * Shows this button
+     */
+    show: function(){
+        this.hidden = false;
+        this.td.style.display = "";
+    },
+    
+    /**
+     * Hides this button
+     */
+    hide: function(){
+        this.hidden = true;
+        this.td.style.display = "none";
+    },
+
+    /**
+     * Disables this item
+     */
+    disable : function(){
+        Roo.fly(this.td).addClass("x-item-disabled");
+        this.disabled = true;
+    },
+
+    /**
+     * Enables this item
+     */
+    enable : function(){
+        Roo.fly(this.td).removeClass("x-item-disabled");
+        this.disabled = false;
+    }
+});
+// backwards compat
+Roo.ToolbarButton = Roo.Toolbar.Button;
+
+/**
+ * @class Roo.Toolbar.SplitButton
+ * @extends Roo.SplitButton
+ * A menu button that renders into a toolbar.
+ * @constructor
+ * Creates a new SplitButton
+ * @param {Object} config A standard {@link Roo.SplitButton} config object
+ */
+Roo.Toolbar.SplitButton = function(config){
+    Roo.Toolbar.SplitButton.superclass.constructor.call(this, null, config);
+};
+Roo.extend(Roo.Toolbar.SplitButton, Roo.SplitButton, {
+    render : function(td){
+        this.td = td;
+        Roo.Toolbar.SplitButton.superclass.render.call(this, td);
+    },
+    
+    /**
+     * Removes and destroys this button
+     */
+    destroy : function(){
+        Roo.Toolbar.SplitButton.superclass.destroy.call(this);
+        this.td.parentNode.removeChild(this.td);
+    },
+    
+    /**
+     * Shows this button
+     */
+    show: function(){
+        this.hidden = false;
+        this.td.style.display = "";
+    },
+    
+    /**
+     * Hides this button
+     */
+    hide: function(){
+        this.hidden = true;
+        this.td.style.display = "none";
+    }
+});
+
+// backwards compat
+Roo.Toolbar.MenuButton = Roo.Toolbar.SplitButton;
\ No newline at end of file
diff --git a/Roo/UpdateManager.js b/Roo/UpdateManager.js
new file mode 100644 (file)
index 0000000..59ef6bd
--- /dev/null
@@ -0,0 +1,484 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+
+/**
+ * @class Roo.UpdateManager
+ * @extends Roo.util.Observable
+ * Provides AJAX-style update for Element object.<br><br>
+ * Usage:<br>
+ * <pre><code>
+ * // Get it from a Roo.Element object
+ * var el = Roo.get("foo");
+ * var mgr = el.getUpdateManager();
+ * mgr.update("http://myserver.com/index.php", "param1=1&amp;param2=2");
+ * ...
+ * mgr.formUpdate("myFormId", "http://myserver.com/index.php");
+ * <br>
+ * // or directly (returns the same UpdateManager instance)
+ * var mgr = new Roo.UpdateManager("myElementId");
+ * mgr.startAutoRefresh(60, "http://myserver.com/index.php");
+ * mgr.on("update", myFcnNeedsToKnow);
+ * <br>
+   // short handed call directly from the element object
+   Roo.get("foo").load({
+        url: "bar.php",
+        scripts:true,
+        params: "for=bar",
+        text: "Loading Foo..."
+   });
+ * </code></pre>
+ * @constructor
+ * Create new UpdateManager directly.
+ * @param {String/HTMLElement/Roo.Element} el The element to update
+ * @param {Boolean} forceNew (optional) By default the constructor checks to see if the passed element already has an UpdateManager and if it does it returns the same instance. This will skip that check (useful for extending this class).
+ */
+Roo.UpdateManager = function(el, forceNew){
+    el = Roo.get(el);
+    if(!forceNew && el.updateManager){
+        return el.updateManager;
+    }
+    /**
+     * The Element object
+     * @type Roo.Element
+     */
+    this.el = el;
+    /**
+     * Cached url to use for refreshes. Overwritten every time update() is called unless "discardUrl" param is set to true.
+     * @type String
+     */
+    this.defaultUrl = null;
+
+    this.addEvents({
+        /**
+         * @event beforeupdate
+         * Fired before an update is made, return false from your handler and the update is cancelled.
+         * @param {Roo.Element} el
+         * @param {String/Object/Function} url
+         * @param {String/Object} params
+         */
+        "beforeupdate": true,
+        /**
+         * @event update
+         * Fired after successful update is made.
+         * @param {Roo.Element} el
+         * @param {Object} oResponseObject The response Object
+         */
+        "update": true,
+        /**
+         * @event failure
+         * Fired on update failure.
+         * @param {Roo.Element} el
+         * @param {Object} oResponseObject The response Object
+         */
+        "failure": true
+    });
+    var d = Roo.UpdateManager.defaults;
+    /**
+     * Blank page URL to use with SSL file uploads (Defaults to Roo.UpdateManager.defaults.sslBlankUrl or "about:blank").
+     * @type String
+     */
+    this.sslBlankUrl = d.sslBlankUrl;
+    /**
+     * Whether to append unique parameter on get request to disable caching (Defaults to Roo.UpdateManager.defaults.disableCaching or false).
+     * @type Boolean
+     */
+    this.disableCaching = d.disableCaching;
+    /**
+     * Text for loading indicator (Defaults to Roo.UpdateManager.defaults.indicatorText or '&lt;div class="loading-indicator"&gt;Loading...&lt;/div&gt;').
+     * @type String
+     */
+    this.indicatorText = d.indicatorText;
+    /**
+     * Whether to show indicatorText when loading (Defaults to Roo.UpdateManager.defaults.showLoadIndicator or true).
+     * @type String
+     */
+    this.showLoadIndicator = d.showLoadIndicator;
+    /**
+     * Timeout for requests or form posts in seconds (Defaults to Roo.UpdateManager.defaults.timeout or 30 seconds).
+     * @type Number
+     */
+    this.timeout = d.timeout;
+
+    /**
+     * True to process scripts in the output (Defaults to Roo.UpdateManager.defaults.loadScripts (false)).
+     * @type Boolean
+     */
+    this.loadScripts = d.loadScripts;
+
+    /**
+     * Transaction object of current executing transaction
+     */
+    this.transaction = null;
+
+    /**
+     * @private
+     */
+    this.autoRefreshProcId = null;
+    /**
+     * Delegate for refresh() prebound to "this", use myUpdater.refreshDelegate.createCallback(arg1, arg2) to bind arguments
+     * @type Function
+     */
+    this.refreshDelegate = this.refresh.createDelegate(this);
+    /**
+     * Delegate for update() prebound to "this", use myUpdater.updateDelegate.createCallback(arg1, arg2) to bind arguments
+     * @type Function
+     */
+    this.updateDelegate = this.update.createDelegate(this);
+    /**
+     * Delegate for formUpdate() prebound to "this", use myUpdater.formUpdateDelegate.createCallback(arg1, arg2) to bind arguments
+     * @type Function
+     */
+    this.formUpdateDelegate = this.formUpdate.createDelegate(this);
+    /**
+     * @private
+     */
+    this.successDelegate = this.processSuccess.createDelegate(this);
+    /**
+     * @private
+     */
+    this.failureDelegate = this.processFailure.createDelegate(this);
+
+    if(!this.renderer){
+     /**
+      * The renderer for this UpdateManager. Defaults to {@link Roo.UpdateManager.BasicRenderer}.
+      */
+    this.renderer = new Roo.UpdateManager.BasicRenderer();
+    }
+    
+    Roo.UpdateManager.superclass.constructor.call(this);
+};
+
+Roo.extend(Roo.UpdateManager, Roo.util.Observable, {
+    /**
+     * Get the Element this UpdateManager is bound to
+     * @return {Roo.Element} The element
+     */
+    getEl : function(){
+        return this.el;
+    },
+    /**
+     * Performs an async request, updating this element with the response. If params are specified it uses POST, otherwise it uses GET.
+     * @param {Object/String/Function} url The url for this request or a function to call to get the url or a config object containing any of the following options:
+<pre><code>
+um.update({<br/>
+    url: "your-url.php",<br/>
+    params: {param1: "foo", param2: "bar"}, // or a URL encoded string<br/>
+    callback: yourFunction,<br/>
+    scope: yourObject, //(optional scope)  <br/>
+    discardUrl: false, <br/>
+    nocache: false,<br/>
+    text: "Loading...",<br/>
+    timeout: 30,<br/>
+    scripts: false<br/>
+});
+</code></pre>
+     * The only required property is url. The optional properties nocache, text and scripts
+     * are shorthand for disableCaching, indicatorText and loadScripts and are used to set their associated property on this UpdateManager instance.
+     * @param {String/Object} params (optional) The parameters to pass as either a url encoded string "param1=1&amp;param2=2" or an object {param1: 1, param2: 2}
+     * @param {Function} callback (optional) Callback when transaction is complete - called with signature (oElement, bSuccess, oResponse)
+     * @param {Boolean} discardUrl (optional) By default when you execute an update the defaultUrl is changed to the last used url. If true, it will not store the url.
+     */
+    update : function(url, params, callback, discardUrl){
+        if(this.fireEvent("beforeupdate", this.el, url, params) !== false){
+            var method = this.method, cfg;
+            if(typeof url == "object"){ // must be config object
+                cfg = url;
+                url = cfg.url;
+                params = params || cfg.params;
+                callback = callback || cfg.callback;
+                discardUrl = discardUrl || cfg.discardUrl;
+                if(callback && cfg.scope){
+                    callback = callback.createDelegate(cfg.scope);
+                }
+                if(typeof cfg.method != "undefined"){method = cfg.method;};
+                if(typeof cfg.nocache != "undefined"){this.disableCaching = cfg.nocache;};
+                if(typeof cfg.text != "undefined"){this.indicatorText = '<div class="loading-indicator">'+cfg.text+"</div>";};
+                if(typeof cfg.scripts != "undefined"){this.loadScripts = cfg.scripts;};
+                if(typeof cfg.timeout != "undefined"){this.timeout = cfg.timeout;};
+            }
+            this.showLoading();
+            if(!discardUrl){
+                this.defaultUrl = url;
+            }
+            if(typeof url == "function"){
+                url = url.call(this);
+            }
+
+            method = method || (params ? "POST" : "GET");
+            if(method == "GET"){
+                url = this.prepareUrl(url);
+            }
+
+            var o = Roo.apply(cfg ||{}, {
+                url : url,
+                params: params,
+                success: this.successDelegate,
+                failure: this.failureDelegate,
+                callback: undefined,
+                timeout: (this.timeout*1000),
+                argument: {"url": url, "form": null, "callback": callback, "params": params}
+            });
+
+            this.transaction = Roo.Ajax.request(o);
+        }
+    },
+
+    /**
+     * Performs an async form post, updating this element with the response. If the form has the attribute enctype="multipart/form-data", it assumes it's a file upload.
+     * Uses this.sslBlankUrl for SSL file uploads to prevent IE security warning.
+     * @param {String/HTMLElement} form The form Id or form element
+     * @param {String} url (optional) The url to pass the form to. If omitted the action attribute on the form will be used.
+     * @param {Boolean} reset (optional) Whether to try to reset the form after the update
+     * @param {Function} callback (optional) Callback when transaction is complete - called with signature (oElement, bSuccess, oResponse)
+     */
+    formUpdate : function(form, url, reset, callback){
+        if(this.fireEvent("beforeupdate", this.el, form, url) !== false){
+            if(typeof url == "function"){
+                url = url.call(this);
+            }
+            form = Roo.getDom(form);
+            this.transaction = Roo.Ajax.request({
+                form: form,
+                url:url,
+                success: this.successDelegate,
+                failure: this.failureDelegate,
+                timeout: (this.timeout*1000),
+                argument: {"url": url, "form": form, "callback": callback, "reset": reset}
+            });
+            this.showLoading.defer(1, this);
+        }
+    },
+
+    /**
+     * Refresh the element with the last used url or defaultUrl. If there is no url, it returns immediately
+     * @param {Function} callback (optional) Callback when transaction is complete - called with signature (oElement, bSuccess)
+     */
+    refresh : function(callback){
+        if(this.defaultUrl == null){
+            return;
+        }
+        this.update(this.defaultUrl, null, callback, true);
+    },
+
+    /**
+     * Set this element to auto refresh.
+     * @param {Number} interval How often to update (in seconds).
+     * @param {String/Function} url (optional) The url for this request or a function to call to get the url (Defaults to the last used url)
+     * @param {String/Object} params (optional) The parameters to pass as either a url encoded string "&param1=1&param2=2" or as an object {param1: 1, param2: 2}
+     * @param {Function} callback (optional) Callback when transaction is complete - called with signature (oElement, bSuccess)
+     * @param {Boolean} refreshNow (optional) Whether to execute the refresh now, or wait the interval
+     */
+    startAutoRefresh : function(interval, url, params, callback, refreshNow){
+        if(refreshNow){
+            this.update(url || this.defaultUrl, params, callback, true);
+        }
+        if(this.autoRefreshProcId){
+            clearInterval(this.autoRefreshProcId);
+        }
+        this.autoRefreshProcId = setInterval(this.update.createDelegate(this, [url || this.defaultUrl, params, callback, true]), interval*1000);
+    },
+
+    /**
+     * Stop auto refresh on this element.
+     */
+     stopAutoRefresh : function(){
+        if(this.autoRefreshProcId){
+            clearInterval(this.autoRefreshProcId);
+            delete this.autoRefreshProcId;
+        }
+    },
+
+    isAutoRefreshing : function(){
+       return this.autoRefreshProcId ? true : false;
+    },
+    /**
+     * Called to update the element to "Loading" state. Override to perform custom action.
+     */
+    showLoading : function(){
+        if(this.showLoadIndicator){
+            this.el.update(this.indicatorText);
+        }
+    },
+
+    /**
+     * Adds unique parameter to query string if disableCaching = true
+     * @private
+     */
+    prepareUrl : function(url){
+        if(this.disableCaching){
+            var append = "_dc=" + (new Date().getTime());
+            if(url.indexOf("?") !== -1){
+                url += "&" + append;
+            }else{
+                url += "?" + append;
+            }
+        }
+        return url;
+    },
+
+    /**
+     * @private
+     */
+    processSuccess : function(response){
+        this.transaction = null;
+        if(response.argument.form && response.argument.reset){
+            try{ // put in try/catch since some older FF releases had problems with this
+                response.argument.form.reset();
+            }catch(e){}
+        }
+        if(this.loadScripts){
+            this.renderer.render(this.el, response, this,
+                this.updateComplete.createDelegate(this, [response]));
+        }else{
+            this.renderer.render(this.el, response, this);
+            this.updateComplete(response);
+        }
+    },
+
+    updateComplete : function(response){
+        this.fireEvent("update", this.el, response);
+        if(typeof response.argument.callback == "function"){
+            response.argument.callback(this.el, true, response);
+        }
+    },
+
+    /**
+     * @private
+     */
+    processFailure : function(response){
+        this.transaction = null;
+        this.fireEvent("failure", this.el, response);
+        if(typeof response.argument.callback == "function"){
+            response.argument.callback(this.el, false, response);
+        }
+    },
+
+    /**
+     * Set the content renderer for this UpdateManager. See {@link Roo.UpdateManager.BasicRenderer#render} for more details.
+     * @param {Object} renderer The object implementing the render() method
+     */
+    setRenderer : function(renderer){
+        this.renderer = renderer;
+    },
+
+    getRenderer : function(){
+       return this.renderer;
+    },
+
+    /**
+     * Set the defaultUrl used for updates
+     * @param {String/Function} defaultUrl The url or a function to call to get the url
+     */
+    setDefaultUrl : function(defaultUrl){
+        this.defaultUrl = defaultUrl;
+    },
+
+    /**
+     * Aborts the executing transaction
+     */
+    abort : function(){
+        if(this.transaction){
+            Roo.Ajax.abort(this.transaction);
+        }
+    },
+
+    /**
+     * Returns true if an update is in progress
+     * @return {Boolean}
+     */
+    isUpdating : function(){
+        if(this.transaction){
+            return Roo.Ajax.isLoading(this.transaction);
+        }
+        return false;
+    }
+});
+
+/**
+ * @class Roo.UpdateManager.defaults
+ * @static (not really - but it helps the doc tool)
+ * The defaults collection enables customizing the default properties of UpdateManager
+ */
+   Roo.UpdateManager.defaults = {
+       /**
+         * Timeout for requests or form posts in seconds (Defaults 30 seconds).
+         * @type Number
+         */
+         timeout : 30,
+
+         /**
+         * True to process scripts by default (Defaults to false).
+         * @type Boolean
+         */
+        loadScripts : false,
+
+        /**
+        * Blank page URL to use with SSL file uploads (Defaults to "javascript:false").
+        * @type String
+        */
+        sslBlankUrl : (Roo.SSL_SECURE_URL || "javascript:false"),
+        /**
+         * Whether to append unique parameter on get request to disable caching (Defaults to false).
+         * @type Boolean
+         */
+        disableCaching : false,
+        /**
+         * Whether to show indicatorText when loading (Defaults to true).
+         * @type Boolean
+         */
+        showLoadIndicator : true,
+        /**
+         * Text for loading indicator (Defaults to '&lt;div class="loading-indicator"&gt;Loading...&lt;/div&gt;').
+         * @type String
+         */
+        indicatorText : '<div class="loading-indicator">Loading...</div>'
+   };
+
+/**
+ * Static convenience method. This method is deprecated in favor of el.load({url:'foo.php', ...}).
+ *Usage:
+ * <pre><code>Roo.UpdateManager.updateElement("my-div", "stuff.php");</code></pre>
+ * @param {String/HTMLElement/Roo.Element} el The element to update
+ * @param {String} url The url
+ * @param {String/Object} params (optional) Url encoded param string or an object of name/value pairs
+ * @param {Object} options (optional) A config object with any of the UpdateManager properties you want to set - for example: {disableCaching:true, indicatorText: "Loading data..."}
+ * @static
+ * @deprecated
+ * @member Roo.UpdateManager
+ */
+Roo.UpdateManager.updateElement = function(el, url, params, options){
+    var um = Roo.get(el, true).getUpdateManager();
+    Roo.apply(um, options);
+    um.update(url, params, options ? options.callback : null);
+};
+// alias for backwards compat
+Roo.UpdateManager.update = Roo.UpdateManager.updateElement;
+/**
+ * @class Roo.UpdateManager.BasicRenderer
+ * Default Content renderer. Updates the elements innerHTML with the responseText.
+ */
+Roo.UpdateManager.BasicRenderer = function(){};
+
+Roo.UpdateManager.BasicRenderer.prototype = {
+    /**
+     * This is called when the transaction is completed and it's time to update the element - The BasicRenderer
+     * updates the elements innerHTML with the responseText - To perform a custom render (i.e. XML or JSON processing),
+     * create an object with a "render(el, response)" method and pass it to setRenderer on the UpdateManager.
+     * @param {Roo.Element} el The element being rendered
+     * @param {Object} response The YUI Connect response object
+     * @param {UpdateManager} updateManager The calling update manager
+     * @param {Function} callback A callback that will need to be called if loadScripts is true on the UpdateManager
+     */
+     render : function(el, response, updateManager, callback){
+        el.update(response.responseText, updateManager.loadScripts, callback);
+    }
+};
diff --git a/Roo/View.js b/Roo/View.js
new file mode 100644 (file)
index 0000000..32bd372
--- /dev/null
@@ -0,0 +1,466 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+
+/**
+ * @class Roo.View
+ * @extends Roo.util.Observable
+ * Create a "View" for an element based on a data model or UpdateManager and the supplied DomHelper template. 
+ * This class also supports single and multi selection modes. <br>
+ * Create a data model bound view:
+ <pre><code>
+ var store = new Roo.data.Store(...);
+
+ var view = new Roo.View("my-element",
+ '&lt;div id="{0}"&gt;{2} - {1}&lt;/div&gt;', // auto create template
+ {
+ singleSelect: true,
+ selectedClass: "ydataview-selected",
+ store: store
+ });
+
+ // listen for node click?
+ view.on("click", function(vw, index, node, e){
+ alert('Node "' + node.id + '" at index: ' + index + " was clicked.");
+ });
+
+ // load XML data
+ dataModel.load("foobar.xml");
+ </code></pre>
+ For an example of creating a JSON/UpdateManager view, see {@link Roo.JsonView}.
+ * <br><br>
+ * <b>Note: The root of your template must be a single node. Table/row implementations may work but are not supported due to
+ * IE"s limited insertion support with tables and Opera"s faulty event bubbling.</b>
+ * @constructor
+ * Create a new View
+ * @param {String/HTMLElement/Element} container The container element where the view is to be rendered.
+ * @param {String/DomHelper.Template} tpl The rendering template or a string to create a template with
+ * @param {Object} config The config object
+ */
+Roo.View = function(container, tpl, config){
+    this.el = Roo.get(container);
+    if(typeof tpl == "string"){
+        tpl = new Roo.Template(tpl);
+    }
+    tpl.compile();
+    /**
+     * The template used by this View
+     * @type {Roo.DomHelper.Template}
+     */
+    this.tpl = tpl;
+
+    Roo.apply(this, config);
+
+    /** @private */
+    this.addEvents({
+    /**
+     * @event beforeclick
+     * Fires before a click is processed. Returns false to cancel the default action.
+     * @param {Roo.View} this
+     * @param {Number} index The index of the target node
+     * @param {HTMLElement} node The target node
+     * @param {Roo.EventObject} e The raw event object
+     */
+        "beforeclick" : true,
+    /**
+     * @event click
+     * Fires when a template node is clicked.
+     * @param {Roo.View} this
+     * @param {Number} index The index of the target node
+     * @param {HTMLElement} node The target node
+     * @param {Roo.EventObject} e The raw event object
+     */
+        "click" : true,
+    /**
+     * @event dblclick
+     * Fires when a template node is double clicked.
+     * @param {Roo.View} this
+     * @param {Number} index The index of the target node
+     * @param {HTMLElement} node The target node
+     * @param {Roo.EventObject} e The raw event object
+     */
+        "dblclick" : true,
+    /**
+     * @event contextmenu
+     * Fires when a template node is right clicked.
+     * @param {Roo.View} this
+     * @param {Number} index The index of the target node
+     * @param {HTMLElement} node The target node
+     * @param {Roo.EventObject} e The raw event object
+     */
+        "contextmenu" : true,
+    /**
+     * @event selectionchange
+     * Fires when the selected nodes change.
+     * @param {Roo.View} this
+     * @param {Array} selections Array of the selected nodes
+     */
+        "selectionchange" : true,
+
+    /**
+     * @event beforeselect
+     * Fires before a selection is made. If any handlers return false, the selection is cancelled.
+     * @param {Roo.View} this
+     * @param {HTMLElement} node The node to be selected
+     * @param {Array} selections Array of currently selected nodes
+     */
+        "beforeselect" : true
+    });
+
+    this.el.on({
+        "click": this.onClick,
+        "dblclick": this.onDblClick,
+        "contextmenu": this.onContextMenu,
+        scope:this
+    });
+
+    this.selections = [];
+    this.nodes = [];
+    this.cmp = new Roo.CompositeElementLite([]);
+    if(this.store){
+        this.store = Roo.factory(this.store, Roo.data);
+        this.setStore(this.store, true);
+    }
+    Roo.View.superclass.constructor.call(this);
+};
+
+Roo.extend(Roo.View, Roo.util.Observable, {
+    /**
+     * The css class to add to selected nodes
+     * @type {Roo.DomHelper.Template}
+     */
+    selectedClass : "x-view-selected",
+    
+    emptyText : "",
+    /**
+     * Returns the element this view is bound to.
+     * @return {Roo.Element}
+     */
+    getEl : function(){
+        return this.el;
+    },
+
+    /**
+     * Refreshes the view.
+     */
+    refresh : function(){
+        var t = this.tpl;
+        this.clearSelections();
+        this.el.update("");
+        var html = [];
+        var records = this.store.getRange();
+        if(records.length < 1){
+            this.el.update(this.emptyText);
+            return;
+        }
+        for(var i = 0, len = records.length; i < len; i++){
+            var data = this.prepareData(records[i].data, i, records[i]);
+            html[html.length] = t.apply(data);
+        }
+        this.el.update(html.join(""));
+        this.nodes = this.el.dom.childNodes;
+        this.updateIndexes(0);
+    },
+
+    /**
+     * Function to override to reformat the data that is sent to
+     * the template for each node.
+     * @param {Array/Object} data The raw data (array of colData for a data model bound view or
+     * a JSON object for an UpdateManager bound view).
+     */
+    prepareData : function(data){
+        return data;
+    },
+
+    onUpdate : function(ds, record){
+        this.clearSelections();
+        var index = this.store.indexOf(record);
+        var n = this.nodes[index];
+        this.tpl.insertBefore(n, this.prepareData(record.data));
+        n.parentNode.removeChild(n);
+        this.updateIndexes(index, index);
+    },
+
+    onAdd : function(ds, records, index){
+        this.clearSelections();
+        if(this.nodes.length == 0){
+            this.refresh();
+            return;
+        }
+        var n = this.nodes[index];
+        for(var i = 0, len = records.length; i < len; i++){
+            var d = this.prepareData(records[i].data);
+            if(n){
+                this.tpl.insertBefore(n, d);
+            }else{
+                this.tpl.append(this.el, d);
+            }
+        }
+        this.updateIndexes(index);
+    },
+
+    onRemove : function(ds, record, index){
+        this.clearSelections();
+        this.el.dom.removeChild(this.nodes[index]);
+        this.updateIndexes(index);
+    },
+
+    /**
+     * Refresh an individual node.
+     * @param {Number} index
+     */
+    refreshNode : function(index){
+        this.onUpdate(this.store, this.store.getAt(index));
+    },
+
+    updateIndexes : function(startIndex, endIndex){
+        var ns = this.nodes;
+        startIndex = startIndex || 0;
+        endIndex = endIndex || ns.length - 1;
+        for(var i = startIndex; i <= endIndex; i++){
+            ns[i].nodeIndex = i;
+        }
+    },
+
+    /**
+     * Changes the data store this view uses and refresh the view.
+     * @param {Store} store
+     */
+    setStore : function(store, initial){
+        if(!initial && this.store){
+            this.store.un("datachanged", this.refresh);
+            this.store.un("add", this.onAdd);
+            this.store.un("remove", this.onRemove);
+            this.store.un("update", this.onUpdate);
+            this.store.un("clear", this.refresh);
+        }
+        if(store){
+          
+            store.on("datachanged", this.refresh, this);
+            store.on("add", this.onAdd, this);
+            store.on("remove", this.onRemove, this);
+            store.on("update", this.onUpdate, this);
+            store.on("clear", this.refresh, this);
+        }
+        
+        if(store){
+            this.refresh();
+        }
+    },
+
+    /**
+     * Returns the template node the passed child belongs to or null if it doesn't belong to one.
+     * @param {HTMLElement} node
+     * @return {HTMLElement} The template node
+     */
+    findItemFromChild : function(node){
+        var el = this.el.dom;
+        if(!node || node.parentNode == el){
+                   return node;
+           }
+           var p = node.parentNode;
+           while(p && p != el){
+            if(p.parentNode == el){
+               return p;
+            }
+            p = p.parentNode;
+        }
+           return null;
+    },
+
+    /** @ignore */
+    onClick : function(e){
+        var item = this.findItemFromChild(e.getTarget());
+        if(item){
+            var index = this.indexOf(item);
+            if(this.onItemClick(item, index, e) !== false){
+                this.fireEvent("click", this, index, item, e);
+            }
+        }else{
+            this.clearSelections();
+        }
+    },
+
+    /** @ignore */
+    onContextMenu : function(e){
+        var item = this.findItemFromChild(e.getTarget());
+        if(item){
+            this.fireEvent("contextmenu", this, this.indexOf(item), item, e);
+        }
+    },
+
+    /** @ignore */
+    onDblClick : function(e){
+        var item = this.findItemFromChild(e.getTarget());
+        if(item){
+            this.fireEvent("dblclick", this, this.indexOf(item), item, e);
+        }
+    },
+
+    onItemClick : function(item, index, e){
+        if(this.fireEvent("beforeclick", this, index, item, e) === false){
+            return false;
+        }
+        if(this.multiSelect || this.singleSelect){
+            if(this.multiSelect && e.shiftKey && this.lastSelection){
+                this.select(this.getNodes(this.indexOf(this.lastSelection), index), false);
+            }else{
+                this.select(item, this.multiSelect && e.ctrlKey);
+                this.lastSelection = item;
+            }
+            e.preventDefault();
+        }
+        return true;
+    },
+
+    /**
+     * Get the number of selected nodes.
+     * @return {Number}
+     */
+    getSelectionCount : function(){
+        return this.selections.length;
+    },
+
+    /**
+     * Get the currently selected nodes.
+     * @return {Array} An array of HTMLElements
+     */
+    getSelectedNodes : function(){
+        return this.selections;
+    },
+
+    /**
+     * Get the indexes of the selected nodes.
+     * @return {Array}
+     */
+    getSelectedIndexes : function(){
+        var indexes = [], s = this.selections;
+        for(var i = 0, len = s.length; i < len; i++){
+            indexes.push(s[i].nodeIndex);
+        }
+        return indexes;
+    },
+
+    /**
+     * Clear all selections
+     * @param {Boolean} suppressEvent (optional) true to skip firing of the selectionchange event
+     */
+    clearSelections : function(suppressEvent){
+        if(this.nodes && (this.multiSelect || this.singleSelect) && this.selections.length > 0){
+            this.cmp.elements = this.selections;
+            this.cmp.removeClass(this.selectedClass);
+            this.selections = [];
+            if(!suppressEvent){
+                this.fireEvent("selectionchange", this, this.selections);
+            }
+        }
+    },
+
+    /**
+     * Returns true if the passed node is selected
+     * @param {HTMLElement/Number} node The node or node index
+     * @return {Boolean}
+     */
+    isSelected : function(node){
+        var s = this.selections;
+        if(s.length < 1){
+            return false;
+        }
+        node = this.getNode(node);
+        return s.indexOf(node) !== -1;
+    },
+
+    /**
+     * Selects nodes.
+     * @param {Array/HTMLElement/String/Number} nodeInfo An HTMLElement template node, index of a template node, id of a template node or an array of any of those to select
+     * @param {Boolean} keepExisting (optional) true to keep existing selections
+     * @param {Boolean} suppressEvent (optional) true to skip firing of the selectionchange vent
+     */
+    select : function(nodeInfo, keepExisting, suppressEvent){
+        if(nodeInfo instanceof Array){
+            if(!keepExisting){
+                this.clearSelections(true);
+            }
+            for(var i = 0, len = nodeInfo.length; i < len; i++){
+                this.select(nodeInfo[i], true, true);
+            }
+        } else{
+            var node = this.getNode(nodeInfo);
+            if(node && !this.isSelected(node)){
+                if(!keepExisting){
+                    this.clearSelections(true);
+                }
+                if(this.fireEvent("beforeselect", this, node, this.selections) !== false){
+                    Roo.fly(node).addClass(this.selectedClass);
+                    this.selections.push(node);
+                    if(!suppressEvent){
+                        this.fireEvent("selectionchange", this, this.selections);
+                    }
+                }
+            }
+        }
+    },
+
+    /**
+     * Gets a template node.
+     * @param {HTMLElement/String/Number} nodeInfo An HTMLElement template node, index of a template node or the id of a template node
+     * @return {HTMLElement} The node or null if it wasn't found
+     */
+    getNode : function(nodeInfo){
+        if(typeof nodeInfo == "string"){
+            return document.getElementById(nodeInfo);
+        }else if(typeof nodeInfo == "number"){
+            return this.nodes[nodeInfo];
+        }
+        return nodeInfo;
+    },
+
+    /**
+     * Gets a range template nodes.
+     * @param {Number} startIndex
+     * @param {Number} endIndex
+     * @return {Array} An array of nodes
+     */
+    getNodes : function(start, end){
+        var ns = this.nodes;
+        start = start || 0;
+        end = typeof end == "undefined" ? ns.length - 1 : end;
+        var nodes = [];
+        if(start <= end){
+            for(var i = start; i <= end; i++){
+                nodes.push(ns[i]);
+            }
+        } else{
+            for(var i = start; i >= end; i--){
+                nodes.push(ns[i]);
+            }
+        }
+        return nodes;
+    },
+
+    /**
+     * Finds the index of the passed node
+     * @param {HTMLElement/String/Number} nodeInfo An HTMLElement template node, index of a template node or the id of a template node
+     * @return {Number} The index of the node or -1
+     */
+    indexOf : function(node){
+        node = this.getNode(node);
+        if(typeof node.nodeIndex == "number"){
+            return node.nodeIndex;
+        }
+        var ns = this.nodes;
+        for(var i = 0, len = ns.length; i < len; i++){
+            if(ns[i] == node){
+                return i;
+            }
+        }
+        return -1;
+    }
+});
diff --git a/Roo/XTemplate.js b/Roo/XTemplate.js
new file mode 100644 (file)
index 0000000..530eda0
--- /dev/null
@@ -0,0 +1,149 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+Roo.XTemplate = function(){
+    Roo.XTemplate.superclass.constructor.apply(this, arguments);
+    var s = this.html;
+
+    s = ['<tpl>', s, '</tpl>'].join('');
+
+    var re = /<tpl\b[^>]*>((?:(?=([^<]+))\2|<(?!tpl\b[^>]*>))*?)<\/tpl>/;
+
+    var nameRe = /^<tpl\b[^>]*?for="(.*?)"/;
+    var ifRe = /^<tpl\b[^>]*?if="(.*?)"/;
+    var execRe = /^<tpl\b[^>]*?exec="(.*?)"/;
+    var m, id = 0;
+    var tpls = [];
+
+    while(m = s.match(re)){
+       var m2 = m[0].match(nameRe);
+       var m3 = m[0].match(ifRe);
+       var m4 = m[0].match(execRe);
+       var exp = null, fn = null, exec = null;
+       var name = m2 && m2[1] ? m2[1] : '';
+       if(m3){
+           exp = m3 && m3[1] ? m3[1] : null;
+           if(exp){
+               fn = new Function('values', 'parent', 'with(values){ return '+(Roo.util.Format.htmlDecode(exp))+'; }');
+           }
+       }
+       if(m4){
+           exp = m4 && m4[1] ? m4[1] : null;
+           if(exp){
+               exec = new Function('values', 'parent', 'with(values){ '+(Roo.util.Format.htmlDecode(exp))+'; }');
+           }
+       }
+       if(name){
+           switch(name){
+               case '.': name = new Function('values', 'parent', 'with(values){ return values; }'); break;
+               case '..': name = new Function('values', 'parent', 'with(values){ return parent; }'); break;
+               default: name = new Function('values', 'parent', 'with(values){ return '+name+'; }');
+           }
+       }
+       tpls.push({
+            id: id,
+            target: name,
+            exec: exec,
+            test: fn,
+            body: m[1]||''
+        });
+       s = s.replace(m[0], '{xtpl'+ id + '}');
+       ++id;
+    }
+    for(var i = tpls.length-1; i >= 0; --i){
+        this.compileTpl(tpls[i]);
+    }
+    this.master = tpls[tpls.length-1];
+    this.tpls = tpls;
+};
+Roo.extend(Roo.XTemplate, Roo.Template, {
+
+    re : /\{([\w-\.]+)(?:\:([\w\.]*)(?:\((.*?)?\))?)?\}/g,
+
+    applySubTemplate : function(id, values, parent){
+        var t = this.tpls[id];
+        if(t.test && !t.test.call(this, values, parent)){
+            return '';
+        }
+        if(t.exec && t.exec.call(this, values, parent)){
+            return '';
+        }
+        var vs = t.target ? t.target.call(this, values, parent) : values;
+        parent = t.target ? values : parent;
+        if(t.target && vs instanceof Array){
+            var buf = [];
+            for(var i = 0, len = vs.length; i < len; i++){
+                buf[buf.length] = t.compiled.call(this, vs[i], parent);
+            }
+            return buf.join('');
+        }
+        return t.compiled.call(this, vs, parent);
+    },
+
+    compileTpl : function(tpl){
+        var fm = Roo.util.Format;
+        var useF = this.disableFormats !== true;
+        var sep = Roo.isGecko ? "+" : ",";
+        var fn = function(m, name, format, args){
+            if(name.substr(0, 4) == 'xtpl'){
+                return "'"+ sep +'this.applySubTemplate('+name.substr(4)+', values, parent)'+sep+"'";
+            }
+            var v;
+            if(name.indexOf('.') != -1){
+                v = name;
+            }else{
+                v = "values['" + name + "']";
+            }
+            if(format && useF){
+                args = args ? ',' + args : "";
+                if(format.substr(0, 5) != "this."){
+                    format = "fm." + format + '(';
+                }else{
+                    format = 'this.call("'+ format.substr(5) + '", ';
+                    args = ", values";
+                }
+            }else{
+                args= ''; format = "("+v+" === undefined ? '' : ";
+            }
+            return "'"+ sep + format + v + args + ")"+sep+"'";
+        };
+        var body;
+        // branched to use + in gecko and [].join() in others
+        if(Roo.isGecko){
+            body = "tpl.compiled = function(values, parent){ return '" +
+                   tpl.body.replace(/(\r\n|\n)/g, '\\n').replace(/'/g, "\\'").replace(this.re, fn) +
+                    "';};";
+        }else{
+            body = ["tpl.compiled = function(values, parent){ return ['"];
+            body.push(tpl.body.replace(/(\r\n|\n)/g, '\\n').replace(/'/g, "\\'").replace(this.re, fn));
+            body.push("'].join('');};");
+            body = body.join('');
+        }
+        /** eval:var:zzzzzzz */
+        eval(body);
+        return this;
+    },
+
+    applyTemplate : function(values){
+        return this.master.compiled.call(this, values, {});
+        var s = this.subs;
+    },
+
+    apply : function(){
+        return this.applyTemplate.apply(this, arguments);
+    },
+
+    compile : function(){return this;}
+});
+
+Roo.XTemplate.from = function(el){
+    el = Roo.getDom(el);
+    return new Roo.XTemplate(el.value || el.innerHTML);
+};
\ No newline at end of file
diff --git a/Roo/data/ArrayReader.js b/Roo/data/ArrayReader.js
new file mode 100644 (file)
index 0000000..0ecf85f
--- /dev/null
@@ -0,0 +1,80 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+
+/**
+ * @class Roo.data.ArrayReader
+ * @extends Roo.data.DataReader
+ * Data reader class to create an Array of Roo.data.Record objects from an Array.
+ * Each element of that Array represents a row of data fields. The
+ * fields are pulled into a Record object using as a subscript, the <em>mapping</em> property
+ * of the field definition if it exists, or the field's ordinal position in the definition.<br>
+ * <p>
+ * Example code:.
+ * <pre><code>
+var RecordDef = Roo.data.Record.create([
+    {name: 'name', mapping: 1},         // "mapping" only needed if an "id" field is present which
+    {name: 'occupation', mapping: 2}    // precludes using the ordinal position as the index.
+]);
+var myReader = new Roo.data.ArrayReader({
+    id: 0                     // The subscript within row Array that provides an ID for the Record (optional)
+}, RecordDef);
+</code></pre>
+ * <p>
+ * This would consume an Array like this:
+ * <pre><code>
+[ [1, 'Bill', 'Gardener'], [2, 'Ben', 'Horticulturalist'] ]
+  </code></pre>
+ * @cfg {String} id (optional) The subscript within row Array that provides an ID for the Record
+ * @constructor
+ * Create a new JsonReader
+ * @param {Object} meta Metadata configuration options.
+ * @param {Object} recordType Either an Array of field definition objects
+ * as specified to {@link Roo.data.Record#create},
+ * or an {@link Roo.data.Record} object
+ * created using {@link Roo.data.Record#create}.
+ */
+Roo.data.ArrayReader = function(meta, recordType){
+    Roo.data.ArrayReader.superclass.constructor.call(this, meta, recordType);
+};
+
+Roo.extend(Roo.data.ArrayReader, Roo.data.JsonReader, {
+    /**
+     * Create a data block containing Roo.data.Records from an XML document.
+     * @param {Object} o An Array of row objects which represents the dataset.
+     * @return {Object} data A data block which is used by an Roo.data.Store object as
+     * a cache of Roo.data.Records.
+     */
+    readRecords : function(o){
+        var sid = this.meta ? this.meta.id : null;
+       var recordType = this.recordType, fields = recordType.prototype.fields;
+       var records = [];
+       var root = o;
+           for(var i = 0; i < root.length; i++){
+                   var n = root[i];
+               var values = {};
+               var id = ((sid || sid === 0) && n[sid] !== undefined && n[sid] !== "" ? n[sid] : null);
+               for(var j = 0, jlen = fields.length; j < jlen; j++){
+                var f = fields.items[j];
+                var k = f.mapping !== undefined && f.mapping !== null ? f.mapping : j;
+                var v = n[k] !== undefined ? n[k] : f.defaultValue;
+                v = f.convert(v);
+                values[f.name] = v;
+            }
+               var record = new recordType(values, id);
+               record.json = n;
+               records[records.length] = record;
+           }
+           return {
+               records : records,
+               totalRecords : records.length
+           };
+    }
+});
\ No newline at end of file
diff --git a/Roo/data/Connection.js b/Roo/data/Connection.js
new file mode 100644 (file)
index 0000000..3b04c42
--- /dev/null
@@ -0,0 +1,418 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+
+
+/**
+ * @class Roo.data.Connection
+ * @extends Roo.util.Observable
+ * The class encapsulates a connection to the page's originating domain, allowing requests to be made
+ * either to a configured URL, or to a URL specified at request time.<br><br>
+ * <p>
+ * Requests made by this class are asynchronous, and will return immediately. No data from
+ * the server will be available to the statement immediately following the {@link #request} call.
+ * To process returned data, use a callback in the request options object, or an event listener.</p><br>
+ * <p>
+ * Note: If you are doing a file upload, you will not get a normal response object sent back to
+ * your callback or event handler.  Since the upload is handled via in IFRAME, there is no XMLHttpRequest.
+ * The response object is created using the innerHTML of the IFRAME's document as the responseText
+ * property and, if present, the IFRAME's XML document as the responseXML property.</p><br>
+ * This means that a valid XML or HTML document must be returned. If JSON data is required, it is suggested
+ * that it be placed either inside a &lt;textarea> in an HTML document and retrieved from the responseText
+ * using a regex, or inside a CDATA section in an XML document and retrieved from the responseXML using
+ * standard DOM methods.
+ * @constructor
+ * @param {Object} config a configuration object.
+ */
+Roo.data.Connection = function(config){
+    Roo.apply(this, config);
+    this.addEvents({
+        /**
+         * @event beforerequest
+         * Fires before a network request is made to retrieve a data object.
+         * @param {Connection} conn This Connection object.
+         * @param {Object} options The options config object passed to the {@link #request} method.
+         */
+        "beforerequest" : true,
+        /**
+         * @event requestcomplete
+         * Fires if the request was successfully completed.
+         * @param {Connection} conn This Connection object.
+         * @param {Object} response The XHR object containing the response data.
+         * See {@link http://www.w3.org/TR/XMLHttpRequest/} for details.
+         * @param {Object} options The options config object passed to the {@link #request} method.
+         */
+        "requestcomplete" : true,
+        /**
+         * @event requestexception
+         * Fires if an error HTTP status was returned from the server.
+         * See {@link http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html} for details of HTTP status codes.
+         * @param {Connection} conn This Connection object.
+         * @param {Object} response The XHR object containing the response data.
+         * See {@link http://www.w3.org/TR/XMLHttpRequest/} for details.
+         * @param {Object} options The options config object passed to the {@link #request} method.
+         */
+        "requestexception" : true
+    });
+    Roo.data.Connection.superclass.constructor.call(this);
+};
+
+Roo.extend(Roo.data.Connection, Roo.util.Observable, {
+    /**
+     * @cfg {String} url (Optional) The default URL to be used for requests to the server. (defaults to undefined)
+     */
+    /**
+     * @cfg {Object} extraParams (Optional) An object containing properties which are used as
+     * extra parameters to each request made by this object. (defaults to undefined)
+     */
+    /**
+     * @cfg {Object} defaultHeaders (Optional) An object containing request headers which are added
+     *  to each request made by this object. (defaults to undefined)
+     */
+    /**
+     * @cfg {String} method (Optional) The default HTTP method to be used for requests. (defaults to undefined; if not set but parms are present will use POST, otherwise GET)
+     */
+    /**
+     * @cfg {Number} timeout (Optional) The timeout in milliseconds to be used for requests. (defaults to 30000)
+     */
+    timeout : 30000,
+    /**
+     * @cfg {Boolean} autoAbort (Optional) Whether this request should abort any pending requests. (defaults to false)
+     * @type Boolean
+     */
+    autoAbort:false,
+
+    /**
+     * @cfg {Boolean} disableCaching (Optional) True to add a unique cache-buster param to GET requests. (defaults to true)
+     * @type Boolean
+     */
+    disableCaching: true,
+
+    /**
+     * Sends an HTTP request to a remote server.
+     * @param {Object} options An object which may contain the following properties:<ul>
+     * <li><b>url</b> {String} (Optional) The URL to which to send the request. Defaults to configured URL</li>
+     * <li><b>params</b> {Object/String/Function} (Optional) An object containing properties which are used as parameters to the
+     * request, a url encoded string or a function to call to get either.</li>
+     * <li><b>method</b> {String} (Optional) The HTTP method to use for the request. Defaults to the configured method, or
+     * if no method was configured, "GET" if no parameters are being sent, and "POST" if parameters are being sent.</li>
+     * <li><b>callback</b> {Function} (Optional) The function to be called upon receipt of the HTTP response.
+     * The callback is called regardless of success or failure and is passed the following parameters:<ul>
+     * <li>options {Object} The parameter to the request call.</li>
+     * <li>success {Boolean} True if the request succeeded.</li>
+     * <li>response {Object} The XMLHttpRequest object containing the response data.</li>
+     * </ul></li>
+     * <li><b>success</b> {Function} (Optional) The function to be called upon success of the request.
+     * The callback is passed the following parameters:<ul>
+     * <li>response {Object} The XMLHttpRequest object containing the response data.</li>
+     * <li>options {Object} The parameter to the request call.</li>
+     * </ul></li>
+     * <li><b>failure</b> {Function} (Optional) The function to be called upon failure of the request.
+     * The callback is passed the following parameters:<ul>
+     * <li>response {Object} The XMLHttpRequest object containing the response data.</li>
+     * <li>options {Object} The parameter to the request call.</li>
+     * </ul></li>
+     * <li><b>scope</b> {Object} (Optional) The scope in which to execute the callbacks: The "this" object
+     * for the callback function. Defaults to the browser window.</li>
+     * <li><b>form</b> {Object/String} (Optional) A form object or id to pull parameters from.</li>
+     * <li><b>isUpload</b> {Boolean} (Optional) True if the form object is a file upload (will usually be automatically detected).</li>
+     * <li><b>headers</b> {Object} (Optional) Request headers to set for the request.</li>
+     * <li><b>xmlData</b> {Object} (Optional) XML document to use for the post. Note: This will be used instead of
+     * params for the post data. Any params will be appended to the URL.</li>
+     * <li><b>disableCaching</b> {Boolean} (Optional) True to add a unique cache-buster param to GET requests.</li>
+     * </ul>
+     * @return {Number} transactionId
+     */
+    request : function(o){
+        if(this.fireEvent("beforerequest", this, o) !== false){
+            var p = o.params;
+
+            if(typeof p == "function"){
+                p = p.call(o.scope||window, o);
+            }
+            if(typeof p == "object"){
+                p = Roo.urlEncode(o.params);
+            }
+            if(this.extraParams){
+                var extras = Roo.urlEncode(this.extraParams);
+                p = p ? (p + '&' + extras) : extras;
+            }
+
+            var url = o.url || this.url;
+            if(typeof url == 'function'){
+                url = url.call(o.scope||window, o);
+            }
+
+            if(o.form){
+                var form = Roo.getDom(o.form);
+                url = url || form.action;
+
+                var enctype = form.getAttribute("enctype");
+                if(o.isUpload || (enctype && enctype.toLowerCase() == 'multipart/form-data')){
+                    return this.doFormUpload(o, p, url);
+                }
+                var f = Roo.lib.Ajax.serializeForm(form);
+                p = p ? (p + '&' + f) : f;
+            }
+
+            var hs = o.headers;
+            if(this.defaultHeaders){
+                hs = Roo.apply(hs || {}, this.defaultHeaders);
+                if(!o.headers){
+                    o.headers = hs;
+                }
+            }
+
+            var cb = {
+                success: this.handleResponse,
+                failure: this.handleFailure,
+                scope: this,
+                argument: {options: o},
+                timeout : this.timeout
+            };
+
+            var method = o.method||this.method||(p ? "POST" : "GET");
+
+            if(method == 'GET' && (this.disableCaching && o.disableCaching !== false) || o.disableCaching === true){
+                url += (url.indexOf('?') != -1 ? '&' : '?') + '_dc=' + (new Date().getTime());
+            }
+
+            if(typeof o.autoAbort == 'boolean'){ // options gets top priority
+                if(o.autoAbort){
+                    this.abort();
+                }
+            }else if(this.autoAbort !== false){
+                this.abort();
+            }
+
+            if((method == 'GET' && p) || o.xmlData){
+                url += (url.indexOf('?') != -1 ? '&' : '?') + p;
+                p = '';
+            }
+            this.transId = Roo.lib.Ajax.request(method, url, cb, p, o);
+            return this.transId;
+        }else{
+            Roo.callback(o.callback, o.scope, [o, null, null]);
+            return null;
+        }
+    },
+
+    /**
+     * Determine whether this object has a request outstanding.
+     * @param {Number} transactionId (Optional) defaults to the last transaction
+     * @return {Boolean} True if there is an outstanding request.
+     */
+    isLoading : function(transId){
+        if(transId){
+            return Roo.lib.Ajax.isCallInProgress(transId);
+        }else{
+            return this.transId ? true : false;
+        }
+    },
+
+    /**
+     * Aborts any outstanding request.
+     * @param {Number} transactionId (Optional) defaults to the last transaction
+     */
+    abort : function(transId){
+        if(transId || this.isLoading()){
+            Roo.lib.Ajax.abort(transId || this.transId);
+        }
+    },
+
+    // private
+    handleResponse : function(response){
+        this.transId = false;
+        var options = response.argument.options;
+        response.argument = options ? options.argument : null;
+        this.fireEvent("requestcomplete", this, response, options);
+        Roo.callback(options.success, options.scope, [response, options]);
+        Roo.callback(options.callback, options.scope, [options, true, response]);
+    },
+
+    // private
+    handleFailure : function(response, e){
+        this.transId = false;
+        var options = response.argument.options;
+        response.argument = options ? options.argument : null;
+        this.fireEvent("requestexception", this, response, options, e);
+        Roo.callback(options.failure, options.scope, [response, options]);
+        Roo.callback(options.callback, options.scope, [options, false, response]);
+    },
+
+    // private
+    doFormUpload : function(o, ps, url){
+        var id = Roo.id();
+        var frame = document.createElement('iframe');
+        frame.id = id;
+        frame.name = id;
+        frame.className = 'x-hidden';
+        if(Roo.isIE){
+            frame.src = Roo.SSL_SECURE_URL;
+        }
+        document.body.appendChild(frame);
+
+        if(Roo.isIE){
+           document.frames[id].name = id;
+        }
+
+        var form = Roo.getDom(o.form);
+        form.target = id;
+        form.method = 'POST';
+        form.enctype = form.encoding = 'multipart/form-data';
+        if(url){
+            form.action = url;
+        }
+
+        var hiddens, hd;
+        if(ps){ // add dynamic params
+            hiddens = [];
+            ps = Roo.urlDecode(ps, false);
+            for(var k in ps){
+                if(ps.hasOwnProperty(k)){
+                    hd = document.createElement('input');
+                    hd.type = 'hidden';
+                    hd.name = k;
+                    hd.value = ps[k];
+                    form.appendChild(hd);
+                    hiddens.push(hd);
+                }
+            }
+        }
+
+        function cb(){
+            var r = {  // bogus response object
+                responseText : '',
+                responseXML : null
+            };
+
+            r.argument = o ? o.argument : null;
+
+            try { //
+                var doc;
+                if(Roo.isIE){
+                    doc = frame.contentWindow.document;
+                }else {
+                    doc = (frame.contentDocument || window.frames[id].document);
+                }
+                if(doc && doc.body){
+                    r.responseText = doc.body.innerHTML;
+                }
+                if(doc && doc.XMLDocument){
+                    r.responseXML = doc.XMLDocument;
+                }else {
+                    r.responseXML = doc;
+                }
+            }
+            catch(e) {
+                // ignore
+            }
+
+            Roo.EventManager.removeListener(frame, 'load', cb, this);
+
+            this.fireEvent("requestcomplete", this, r, o);
+            Roo.callback(o.success, o.scope, [r, o]);
+            Roo.callback(o.callback, o.scope, [o, true, r]);
+
+            setTimeout(function(){document.body.removeChild(frame);}, 100);
+        }
+
+        Roo.EventManager.on(frame, 'load', cb, this);
+        form.submit();
+
+        if(hiddens){ // remove dynamic params
+            for(var i = 0, len = hiddens.length; i < len; i++){
+                form.removeChild(hiddens[i]);
+            }
+        }
+    }
+});
+
+/**
+ * @class Roo.Ajax
+ * @extends Roo.data.Connection
+ * Global Ajax request class.
+ *
+ * @singleton
+ */
+Roo.Ajax = new Roo.data.Connection({
+    // fix up the docs
+   /**
+     * @cfg {String} url @hide
+     */
+    /**
+     * @cfg {Object} extraParams @hide
+     */
+    /**
+     * @cfg {Object} defaultHeaders @hide
+     */
+    /**
+     * @cfg {String} method (Optional) @hide
+     */
+    /**
+     * @cfg {Number} timeout (Optional) @hide
+     */
+    /**
+     * @cfg {Boolean} autoAbort (Optional) @hide
+     */
+
+    /**
+     * @cfg {Boolean} disableCaching (Optional) @hide
+     */
+
+    /**
+     * @property  disableCaching
+     * True to add a unique cache-buster param to GET requests. (defaults to true)
+     * @type Boolean
+     */
+    /**
+     * @property  url
+     * The default URL to be used for requests to the server. (defaults to undefined)
+     * @type String
+     */
+    /**
+     * @property  extraParams
+     * An object containing properties which are used as
+     * extra parameters to each request made by this object. (defaults to undefined)
+     * @type Object
+     */
+    /**
+     * @property  defaultHeaders
+     * An object containing request headers which are added to each request made by this object. (defaults to undefined)
+     * @type Object
+     */
+    /**
+     * @property  method
+     * The default HTTP method to be used for requests. (defaults to undefined; if not set but parms are present will use POST, otherwise GET)
+     * @type String
+     */
+    /**
+     * @property  timeout
+     * The timeout in milliseconds to be used for requests. (defaults to 30000)
+     * @type Number
+     */
+
+    /**
+     * @property  autoAbort
+     * Whether a new request should abort any pending requests. (defaults to false)
+     * @type Boolean
+     */
+    autoAbort : false,
+
+    /**
+     * Serialize the passed form into a url encoded string
+     * @param {String/HTMLElement} form
+     * @return {String}
+     */
+    serializeForm : function(form){
+        return Roo.lib.Ajax.serializeForm(form);
+    }
+});
\ No newline at end of file
diff --git a/Roo/data/DataProxy.js b/Roo/data/DataProxy.js
new file mode 100644 (file)
index 0000000..9b020a2
--- /dev/null
@@ -0,0 +1,59 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+
+/**
+ * @class Roo.data.DataProxy
+ * @extends Roo.data.Observable
+ * This class is an abstract base class for implementations which provide retrieval of
+ * unformatted data objects.<br>
+ * <p>
+ * DataProxy implementations are usually used in conjunction with an implementation of Roo.data.DataReader
+ * (of the appropriate type which knows how to parse the data object) to provide a block of
+ * {@link Roo.data.Records} to an {@link Roo.data.Store}.<br>
+ * <p>
+ * Custom implementations must implement the load method as described in
+ * {@link Roo.data.HttpProxy#load}.
+ */
+Roo.data.DataProxy = function(){
+    this.addEvents({
+        /**
+         * @event beforeload
+         * Fires before a network request is made to retrieve a data object.
+         * @param {Object} This DataProxy object.
+         * @param {Object} params The params parameter to the load function.
+         */
+        beforeload : true,
+        /**
+         * @event load
+         * Fires before the load method's callback is called.
+         * @param {Object} This DataProxy object.
+         * @param {Object} o The data object.
+         * @param {Object} arg The callback argument object passed to the load function.
+         */
+        load : true,
+        /**
+         * @event loadexception
+         * Fires if an Exception occurs during data retrieval.
+         * @param {Object} This DataProxy object.
+         * @param {Object} o The data object.
+         * @param {Object} arg The callback argument object passed to the load function.
+         * @param {Object} e The Exception.
+         */
+        loadexception : true
+    });
+    Roo.data.DataProxy.superclass.constructor.call(this);
+};
+
+Roo.extend(Roo.data.DataProxy, Roo.util.Observable);
+
+    /**
+     * @cfg {void} listeners (Not available) Constructor blocks listeners from being set
+     */
diff --git a/Roo/data/DataReader.js b/Roo/data/DataReader.js
new file mode 100644 (file)
index 0000000..ef10718
--- /dev/null
@@ -0,0 +1,43 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+// Base class for reading structured data from a data source.  This class is intended to be
+// extended (see ArrayReader, JsonReader and XmlReader) and should not be created directly.
+
+/**
+ * @class Roo.data.DataReader
+ * Base class for reading structured data from a data source.  This class is intended to be
+ * extended (see {Roo.data.ArrayReader}, {Roo.data.JsonReader} and {Roo.data.XmlReader}) and should not be created directly.
+ */
+
+Roo.data.DataReader = function(meta, recordType){
+    
+    this.meta = meta;
+    
+    this.recordType = recordType instanceof Array ? 
+        Roo.data.Record.create(recordType) : recordType;
+};
+
+Roo.data.DataReader.prototype = {
+     /**
+     * Create an empty record
+     * @param {Object} data (optional) - overlay some values
+     * @return {Roo.data.Record} record created.
+     */
+    newRow :  function(d) {
+        var da =  {};
+        this.recordType.prototype.fields.each(function(c) {
+            da[c.name] = '';
+        });
+        return new this.recordType(Roo.apply(da, d));
+    }
+    
+};
\ No newline at end of file
diff --git a/Roo/data/Field.js b/Roo/data/Field.js
new file mode 100644 (file)
index 0000000..4f41baa
--- /dev/null
@@ -0,0 +1,105 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+
+Roo.data.Field = function(config){
+    if(typeof config == "string"){
+        config = {name: config};
+    }
+    Roo.apply(this, config);
+    
+    if(!this.type){
+        this.type = "auto";
+    }
+    
+    var st = Roo.data.SortTypes;
+    // named sortTypes are supported, here we look them up
+    if(typeof this.sortType == "string"){
+        this.sortType = st[this.sortType];
+    }
+    
+    // set default sortType for strings and dates
+    if(!this.sortType){
+        switch(this.type){
+            case "string":
+                this.sortType = st.asUCString;
+                break;
+            case "date":
+                this.sortType = st.asDate;
+                break;
+            default:
+                this.sortType = st.none;
+        }
+    }
+
+    // define once
+    var stripRe = /[\$,%]/g;
+
+    // prebuilt conversion function for this field, instead of
+    // switching every time we're reading a value
+    if(!this.convert){
+        var cv, dateFormat = this.dateFormat;
+        switch(this.type){
+            case "":
+            case "auto":
+            case undefined:
+                cv = function(v){ return v; };
+                break;
+            case "string":
+                cv = function(v){ return (v === undefined || v === null) ? '' : String(v); };
+                break;
+            case "int":
+                cv = function(v){
+                    return v !== undefined && v !== null && v !== '' ?
+                           parseInt(String(v).replace(stripRe, ""), 10) : '';
+                    };
+                break;
+            case "float":
+                cv = function(v){
+                    return v !== undefined && v !== null && v !== '' ?
+                           parseFloat(String(v).replace(stripRe, ""), 10) : ''; 
+                    };
+                break;
+            case "bool":
+            case "boolean":
+                cv = function(v){ return v === true || v === "true" || v == 1; };
+                break;
+            case "date":
+                cv = function(v){
+                    if(!v){
+                        return '';
+                    }
+                    if(v instanceof Date){
+                        return v;
+                    }
+                    if(dateFormat){
+                        if(dateFormat == "timestamp"){
+                            return new Date(v*1000);
+                        }
+                        return Date.parseDate(v, dateFormat);
+                    }
+                    var parsed = Date.parse(v);
+                    return parsed ? new Date(parsed) : null;
+                };
+             break;
+            
+        }
+        this.convert = cv;
+    }
+};
+
+Roo.data.Field.prototype = {
+    dateFormat: null,
+    defaultValue: "",
+    mapping: null,
+    sortType : null,
+    sortDir : "ASC"
+};
\ No newline at end of file
diff --git a/Roo/data/HttpProxy.js b/Roo/data/HttpProxy.js
new file mode 100644 (file)
index 0000000..0b979ee
--- /dev/null
@@ -0,0 +1,150 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+/**
+ * @class Roo.data.HttpProxy
+ * @extends Roo.data.DataProxy
+ * An implementation of {@link Roo.data.DataProxy} that reads a data object from an {@link Roo.data.Connection} object
+ * configured to reference a certain URL.<br><br>
+ * <p>
+ * <em>Note that this class cannot be used to retrieve data from a domain other than the domain
+ * from which the running page was served.<br><br>
+ * <p>
+ * For cross-domain access to remote data, use an {@link Roo.data.ScriptTagProxy}.</em><br><br>
+ * <p>
+ * Be aware that to enable the browser to parse an XML document, the server must set
+ * the Content-Type header in the HTTP response to "text/xml".
+ * @constructor
+ * @param {Object} conn Connection config options to add to each request (e.g. {url: 'foo.php'} or
+ * an {@link Roo.data.Connection} object.  If a Connection config is passed, the singleton {@link Roo.Ajax} object
+ * will be used to make the request.
+ */
+Roo.data.HttpProxy = function(conn){
+    Roo.data.HttpProxy.superclass.constructor.call(this);
+    // is conn a conn config or a real conn?
+    this.conn = conn;
+    this.useAjax = !conn || !conn.events;
+  
+};
+
+Roo.extend(Roo.data.HttpProxy, Roo.data.DataProxy, {
+    // thse are take from connection...
+    
+    /**
+     * @cfg {String} url (Optional) The default URL to be used for requests to the server. (defaults to undefined)
+     */
+    /**
+     * @cfg {Object} extraParams (Optional) An object containing properties which are used as
+     * extra parameters to each request made by this object. (defaults to undefined)
+     */
+    /**
+     * @cfg {Object} defaultHeaders (Optional) An object containing request headers which are added
+     *  to each request made by this object. (defaults to undefined)
+     */
+    /**
+     * @cfg {String} method (Optional) The default HTTP method to be used for requests. (defaults to undefined; if not set but parms are present will use POST, otherwise GET)
+     */
+    /**
+     * @cfg {Number} timeout (Optional) The timeout in milliseconds to be used for requests. (defaults to 30000)
+     */
+     /**
+     * @cfg {Boolean} autoAbort (Optional) Whether this request should abort any pending requests. (defaults to false)
+     * @type Boolean
+     */
+  
+
+    /**
+     * @cfg {Boolean} disableCaching (Optional) True to add a unique cache-buster param to GET requests. (defaults to true)
+     * @type Boolean
+     */
+    /**
+     * Return the {@link Roo.data.Connection} object being used by this Proxy.
+     * @return {Connection} The Connection object. This object may be used to subscribe to events on
+     * a finer-grained basis than the DataProxy events.
+     */
+    getConnection : function(){
+        return this.useAjax ? Roo.Ajax : this.conn;
+    },
+
+    /**
+     * Load data from the configured {@link Roo.data.Connection}, read the data object into
+     * a block of Roo.data.Records using the passed {@link Roo.data.DataReader} implementation, and
+     * process that block using the passed callback.
+     * @param {Object} params An object containing properties which are to be used as HTTP parameters
+     * for the request to the remote server.
+     * @param {Roo.data.DataReader} reader The Reader object which converts the data
+     * object into a block of Roo.data.Records.
+     * @param {Function} callback The function into which to pass the block of Roo.data.Records.
+     * The function must be passed <ul>
+     * <li>The Record block object</li>
+     * <li>The "arg" argument from the load function</li>
+     * <li>A boolean success indicator</li>
+     * </ul>
+     * @param {Object} scope The scope in which to call the callback
+     * @param {Object} arg An optional argument which is passed to the callback as its second parameter.
+     */
+    load : function(params, reader, callback, scope, arg){
+        if(this.fireEvent("beforeload", this, params) !== false){
+            var  o = {
+                params : params || {},
+                request: {
+                    callback : callback,
+                    scope : scope,
+                    arg : arg
+                },
+                reader: reader,
+                callback : this.loadResponse,
+                scope: this
+            };
+            if(this.useAjax){
+                Roo.applyIf(o, this.conn);
+                if(this.activeRequest){
+                    Roo.Ajax.abort(this.activeRequest);
+                }
+                this.activeRequest = Roo.Ajax.request(o);
+            }else{
+                this.conn.request(o);
+            }
+        }else{
+            callback.call(scope||this, null, arg, false);
+        }
+    },
+
+    // private
+    loadResponse : function(o, success, response){
+        delete this.activeRequest;
+        if(!success){
+            this.fireEvent("loadexception", this, o, response);
+            o.request.callback.call(o.request.scope, null, o.request.arg, false);
+            return;
+        }
+        var result;
+        try {
+            result = o.reader.read(response);
+        }catch(e){
+            this.fireEvent("loadexception", this, o, response, e);
+            o.request.callback.call(o.request.scope, null, o.request.arg, false);
+            return;
+        }
+        
+        this.fireEvent("load", this, o, o.request.arg);
+        o.request.callback.call(o.request.scope, result, o.request.arg, true);
+    },
+
+    // private
+    update : function(dataSet){
+
+    },
+
+    // private
+    updateResponse : function(dataSet){
+
+    }
+});
\ No newline at end of file
diff --git a/Roo/data/JsonReader.js b/Roo/data/JsonReader.js
new file mode 100644 (file)
index 0000000..2fd0e32
--- /dev/null
@@ -0,0 +1,192 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+
+/**
+ * @class Roo.data.JsonReader
+ * @extends Roo.data.DataReader
+ * Data reader class to create an Array of Roo.data.Record objects from a JSON response
+ * based on mappings in a provided Roo.data.Record constructor.
+ * <p>
+ * Example code:
+ * <pre><code>
+var RecordDef = Roo.data.Record.create([
+    {name: 'name', mapping: 'name'},     // "mapping" property not needed if it's the same as "name"
+    {name: 'occupation'}                 // This field will use "occupation" as the mapping.
+]);
+var myReader = new Roo.data.JsonReader({
+    totalProperty: "results",    // The property which contains the total dataset size (optional)
+    root: "rows",                // The property which contains an Array of row objects
+    id: "id"                     // The property within each row object that provides an ID for the record (optional)
+}, RecordDef);
+</code></pre>
+ * <p>
+ * This would consume a JSON file like this:
+ * <pre><code>
+{ 'results': 2, 'rows': [
+    { 'id': 1, 'name': 'Bill', occupation: 'Gardener' },
+    { 'id': 2, 'name': 'Ben', occupation: 'Horticulturalist' } ]
+}
+</code></pre>
+ * @cfg {String} totalProperty Name of the property from which to retrieve the total number of records
+ * in the dataset. This is only needed if the whole dataset is not passed in one go, but is being
+ * paged from the remote server.
+ * @cfg {String} successProperty Name of the property from which to retrieve the success attribute used by forms.
+ * @cfg {String} root name of the property which contains the Array of row objects.
+ * @cfg {String} id Name of the property within a row object that contains a record identifier value.
+ * @constructor
+ * Create a new JsonReader
+ * @param {Object} meta Metadata configuration options
+ * @param {Object} recordType Either an Array of field definition objects,
+ * or an {@link Roo.data.Record} object created using {@link Roo.data.Record#create}.
+ */
+Roo.data.JsonReader = function(meta, recordType){
+    
+    meta = meta || {};
+    // set some defaults:
+    Roo.applyIf(meta, {
+        totalProperty: 'total',
+        successProperty : 'success',
+        root : 'data',
+        id : 'id'
+    });
+    
+    Roo.data.JsonReader.superclass.constructor.call(this, meta, recordType||meta.fields);
+};
+Roo.extend(Roo.data.JsonReader, Roo.data.DataReader, {
+    /**
+     * This method is only used by a DataProxy which has retrieved data from a remote server.
+     * @param {Object} response The XHR object which contains the JSON data in its responseText.
+     * @return {Object} data A data block which is used by an Roo.data.Store object as
+     * a cache of Roo.data.Records.
+     */
+    read : function(response){
+        var json = response.responseText;
+        /* eval:var:o */
+        var o = eval("("+json+")");
+        if(!o) {
+            throw {message: "JsonReader.read: Json object not found"};
+        }
+        
+        if(o.metaData){
+            delete this.ef;
+            this.meta = o.metaData;
+            this.recordType = Roo.data.Record.create(o.metaData.fields);
+            this.onMetaChange(this.meta, this.recordType, o);
+        }
+        return this.readRecords(o);
+    },
+
+    // private function a store will implement
+    onMetaChange : function(meta, recordType, o){
+
+    },
+
+    /**
+        * @ignore
+        */
+    simpleAccess: function(obj, subsc) {
+       return obj[subsc];
+    },
+
+       /**
+        * @ignore
+        */
+    getJsonAccessor: function(){
+        var re = /[\[\.]/;
+        return function(expr) {
+            try {
+                return(re.test(expr))
+                    ? new Function("obj", "return obj." + expr)
+                    : function(obj){
+                        return obj[expr];
+                    };
+            } catch(e){}
+            return Roo.emptyFn;
+        };
+    }(),
+
+    /**
+     * Create a data block containing Roo.data.Records from an XML document.
+     * @param {Object} o An object which contains an Array of row objects in the property specified
+     * in the config as 'root, and optionally a property, specified in the config as 'totalProperty'
+     * which contains the total size of the dataset.
+     * @return {Object} data A data block which is used by an Roo.data.Store object as
+     * a cache of Roo.data.Records.
+     */
+    readRecords : function(o){
+        /**
+         * After any data loads, the raw JSON data is available for further custom processing.
+         * @type Object
+         */
+        this.jsonData = o;
+        var s = this.meta, Record = this.recordType,
+            f = Record.prototype.fields, fi = f.items, fl = f.length;
+
+//      Generate extraction functions for the totalProperty, the root, the id, and for each field
+        if (!this.ef) {
+            if(s.totalProperty) {
+                   this.getTotal = this.getJsonAccessor(s.totalProperty);
+               }
+               if(s.successProperty) {
+                   this.getSuccess = this.getJsonAccessor(s.successProperty);
+               }
+               this.getRoot = s.root ? this.getJsonAccessor(s.root) : function(p){return p;};
+               if (s.id) {
+                       var g = this.getJsonAccessor(s.id);
+                       this.getId = function(rec) {
+                               var r = g(rec);
+                               return (r === undefined || r === "") ? null : r;
+                       };
+               } else {
+                       this.getId = function(){return null;};
+               }
+            this.ef = [];
+            for(var i = 0; i < fl; i++){
+                f = fi[i];
+                var map = (f.mapping !== undefined && f.mapping !== null) ? f.mapping : f.name;
+                this.ef[i] = this.getJsonAccessor(map);
+            }
+        }
+
+       var root = this.getRoot(o), c = root.length, totalRecords = c, success = true;
+       if(s.totalProperty){
+            var v = parseInt(this.getTotal(o), 10);
+            if(!isNaN(v)){
+                totalRecords = v;
+            }
+        }
+        if(s.successProperty){
+            var v = this.getSuccess(o);
+            if(v === false || v === 'false'){
+                success = false;
+            }
+        }
+        var records = [];
+           for(var i = 0; i < c; i++){
+                   var n = root[i];
+               var values = {};
+               var id = this.getId(n);
+               for(var j = 0; j < fl; j++){
+                   f = fi[j];
+                var v = this.ef[j](n);
+                values[f.name] = f.convert((v !== undefined) ? v : f.defaultValue);
+               }
+               var record = new Record(values, id);
+               record.json = n;
+               records[i] = record;
+           }
+           return {
+               success : success,
+               records : records,
+               totalRecords : totalRecords
+           };
+    }
+});
\ No newline at end of file
diff --git a/Roo/data/JsonStore.js b/Roo/data/JsonStore.js
new file mode 100644 (file)
index 0000000..590196c
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+
+/**
+/**
+ * @extends Roo.data.Store
+ * @class Roo.data.JsonStore
+ * Small helper class to make creating Stores for JSON data easier. <br/>
+<pre><code>
+var store = new Roo.data.JsonStore({
+    url: 'get-images.php',
+    root: 'images',
+    fields: ['name', 'url', {name:'size', type: 'float'}, {name:'lastmod', type:'date'}]
+});
+</code></pre>
+ * <b>Note: Although they are not listed, this class inherits all of the config options of Store,
+ * JsonReader and HttpProxy (unless inline data is provided).</b>
+ * @cfg {Array} fields An array of field definition objects, or field name strings.
+ * @constructor
+ * @param {Object} config
+ */
+Roo.data.JsonStore = function(c){
+    Roo.data.JsonStore.superclass.constructor.call(this, Roo.apply(c, {
+        proxy: !c.data ? new Roo.data.HttpProxy({url: c.url}) : undefined,
+        reader: new Roo.data.JsonReader(c, c.fields)
+    }));
+};
+Roo.extend(Roo.data.JsonStore, Roo.data.Store);
\ No newline at end of file
diff --git a/Roo/data/MemoryProxy.js b/Roo/data/MemoryProxy.js
new file mode 100644 (file)
index 0000000..e4453a5
--- /dev/null
@@ -0,0 +1,61 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+/**
+ * @class Roo.data.MemoryProxy
+ * An implementation of Roo.data.DataProxy that simply passes the data specified in its constructor
+ * to the Reader when its load method is called.
+ * @constructor
+ * @param {Object} data The data object which the Reader uses to construct a block of Roo.data.Records.
+ */
+Roo.data.MemoryProxy = function(data){
+    if (data.data) {
+        data = data.data;
+    }
+    Roo.data.MemoryProxy.superclass.constructor.call(this);
+    this.data = data;
+};
+
+Roo.extend(Roo.data.MemoryProxy, Roo.data.DataProxy, {
+    /**
+     * Load data from the requested source (in this case an in-memory
+     * data object passed to the constructor), read the data object into
+     * a block of Roo.data.Records using the passed Roo.data.DataReader implementation, and
+     * process that block using the passed callback.
+     * @param {Object} params This parameter is not used by the MemoryProxy class.
+     * @param {Roo.data.DataReader} reader The Reader object which converts the data
+     * object into a block of Roo.data.Records.
+     * @param {Function} callback The function into which to pass the block of Roo.data.records.
+     * The function must be passed <ul>
+     * <li>The Record block object</li>
+     * <li>The "arg" argument from the load function</li>
+     * <li>A boolean success indicator</li>
+     * </ul>
+     * @param {Object} scope The scope in which to call the callback
+     * @param {Object} arg An optional argument which is passed to the callback as its second parameter.
+     */
+    load : function(params, reader, callback, scope, arg){
+        params = params || {};
+        var result;
+        try {
+            result = reader.readRecords(this.data);
+        }catch(e){
+            this.fireEvent("loadexception", this, arg, null, e);
+            callback.call(scope, null, arg, false);
+            return;
+        }
+        callback.call(scope, result, arg, true);
+    },
+    
+    // private
+    update : function(params, records){
+        
+    }
+});
\ No newline at end of file
diff --git a/Roo/data/Record.js b/Roo/data/Record.js
new file mode 100644 (file)
index 0000000..cf20de6
--- /dev/null
@@ -0,0 +1,234 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+
+/**
+* @class Roo.data.Record
+ * Instances of this class encapsulate both record <em>definition</em> information, and record
+ * <em>value</em> information for use in {@link Roo.data.Store} objects, or any code which needs
+ * to access Records cached in an {@link Roo.data.Store} object.<br>
+ * <p>
+ * Constructors for this class are generated by passing an Array of field definition objects to {@link #create}.
+ * Instances are usually only created by {@link Roo.data.Reader} implementations when processing unformatted data
+ * objects.<br>
+ * <p>
+ * Record objects generated by this constructor inherit all the methods of Roo.data.Record listed below.
+ * @constructor
+ * This constructor should not be used to create Record objects. Instead, use the constructor generated by
+ * {@link #create}. The parameters are the same.
+ * @param {Array} data An associative Array of data values keyed by the field name.
+ * @param {Object} id (Optional) The id of the record. This id should be unique, and is used by the
+ * {@link Roo.data.Store} object which owns the Record to index its collection of Records. If
+ * not specified an integer id is generated.
+ */
+Roo.data.Record = function(data, id){
+    this.id = (id || id === 0) ? id : ++Roo.data.Record.AUTO_ID;
+    this.data = data;
+};
+
+/**
+ * Generate a constructor for a specific record layout.
+ * @param {Array} o An Array of field definition objects which specify field names, and optionally,
+ * data types, and a mapping for an {@link Roo.data.Reader} to extract the field's value from a data object.
+ * Each field definition object may contain the following properties: <ul>
+ * <li><b>name</b> : String<p style="margin-left:1em">The name by which the field is referenced within the Record. This is referenced by,
+ * for example the <em>dataIndex</em> property in column definition objects passed to {@link Roo.grid.ColumnModel}</p></li>
+ * <li><b>mapping</b> : String<p style="margin-left:1em">(Optional) A path specification for use by the {@link Roo.data.Reader} implementation
+ * that is creating the Record to access the data value from the data object. If an {@link Roo.data.JsonReader}
+ * is being used, then this is a string containing the javascript expression to reference the data relative to 
+ * the record item's root. If an {@link Roo.data.XmlReader} is being used, this is an {@link Roo.DomQuery} path
+ * to the data item relative to the record element. If the mapping expression is the same as the field name,
+ * this may be omitted.</p></li>
+ * <li><b>type</b> : String<p style="margin-left:1em">(Optional) The data type for conversion to displayable value. Possible values are
+ * <ul><li>auto (Default, implies no conversion)</li>
+ * <li>string</li>
+ * <li>int</li>
+ * <li>float</li>
+ * <li>boolean</li>
+ * <li>date</li></ul></p></li>
+ * <li><b>sortType</b> : Mixed<p style="margin-left:1em">(Optional) A member of {@link Roo.data.SortTypes}.</p></li>
+ * <li><b>sortDir</b> : String<p style="margin-left:1em">(Optional) Initial direction to sort. "ASC" or "DESC"</p></li>
+ * <li><b>convert</b> : Function<p style="margin-left:1em">(Optional) A function which converts the value provided
+ * by the Reader into an object that will be stored in the Record. It is passed the
+ * following parameters:<ul>
+ * <li><b>v</b> : Mixed<p style="margin-left:1em">The data value as read by the Reader.</p></li>
+ * </ul></p></li>
+ * <li><b>dateFormat</b> : String<p style="margin-left:1em">(Optional) A format String for the Date.parseDate function.</p></li>
+ * </ul>
+ * <br>usage:<br><pre><code>
+var TopicRecord = Roo.data.Record.create(
+    {name: 'title', mapping: 'topic_title'},
+    {name: 'author', mapping: 'username'},
+    {name: 'totalPosts', mapping: 'topic_replies', type: 'int'},
+    {name: 'lastPost', mapping: 'post_time', type: 'date'},
+    {name: 'lastPoster', mapping: 'user2'},
+    {name: 'excerpt', mapping: 'post_text'}
+);
+
+var myNewRecord = new TopicRecord({
+    title: 'Do my job please',
+    author: 'noobie',
+    totalPosts: 1,
+    lastPost: new Date(),
+    lastPoster: 'Animal',
+    excerpt: 'No way dude!'
+});
+myStore.add(myNewRecord);
+</code></pre>
+ * @method create
+ * @static
+ */
+Roo.data.Record.create = function(o){
+    var f = function(){
+        f.superclass.constructor.apply(this, arguments);
+    };
+    Roo.extend(f, Roo.data.Record);
+    var p = f.prototype;
+    p.fields = new Roo.util.MixedCollection(false, function(field){
+        return field.name;
+    });
+    for(var i = 0, len = o.length; i < len; i++){
+        p.fields.add(new Roo.data.Field(o[i]));
+    }
+    f.getField = function(name){
+        return p.fields.get(name);  
+    };
+    return f;
+};
+
+Roo.data.Record.AUTO_ID = 1000;
+Roo.data.Record.EDIT = 'edit';
+Roo.data.Record.REJECT = 'reject';
+Roo.data.Record.COMMIT = 'commit';
+
+Roo.data.Record.prototype = {
+    /**
+     * Readonly flag - true if this record has been modified.
+     * @type Boolean
+     */
+    dirty : false,
+    editing : false,
+    error: null,
+    modified: null,
+
+    // private
+    join : function(store){
+        this.store = store;
+    },
+
+    /**
+     * Set the named field to the specified value.
+     * @param {String} name The name of the field to set.
+     * @param {Object} value The value to set the field to.
+     */
+    set : function(name, value){
+        if(this.data[name] == value){
+            return;
+        }
+        this.dirty = true;
+        if(!this.modified){
+            this.modified = {};
+        }
+        if(typeof this.modified[name] == 'undefined'){
+            this.modified[name] = this.data[name];
+        }
+        this.data[name] = value;
+        if(!this.editing){
+            this.store.afterEdit(this);
+        }       
+    },
+
+    /**
+     * Get the value of the named field.
+     * @param {String} name The name of the field to get the value of.
+     * @return {Object} The value of the field.
+     */
+    get : function(name){
+        return this.data[name]; 
+    },
+
+    // private
+    beginEdit : function(){
+        this.editing = true;
+        this.modified = {}; 
+    },
+
+    // private
+    cancelEdit : function(){
+        this.editing = false;
+        delete this.modified;
+    },
+
+    // private
+    endEdit : function(){
+        this.editing = false;
+        if(this.dirty && this.store){
+            this.store.afterEdit(this);
+        }
+    },
+
+    /**
+     * Usually called by the {@link Roo.data.Store} which owns the Record.
+     * Rejects all changes made to the Record since either creation, or the last commit operation.
+     * Modified fields are reverted to their original values.
+     * <p>
+     * Developers should subscribe to the {@link Roo.data.Store#update} event to have their code notified
+     * of reject operations.
+     */
+    reject : function(){
+        var m = this.modified;
+        for(var n in m){
+            if(typeof m[n] != "function"){
+                this.data[n] = m[n];
+            }
+        }
+        this.dirty = false;
+        delete this.modified;
+        this.editing = false;
+        if(this.store){
+            this.store.afterReject(this);
+        }
+    },
+
+    /**
+     * Usually called by the {@link Roo.data.Store} which owns the Record.
+     * Commits all changes made to the Record since either creation, or the last commit operation.
+     * <p>
+     * Developers should subscribe to the {@link Roo.data.Store#update} event to have their code notified
+     * of commit operations.
+     */
+    commit : function(){
+        this.dirty = false;
+        delete this.modified;
+        this.editing = false;
+        if(this.store){
+            this.store.afterCommit(this);
+        }
+    },
+
+    // private
+    hasError : function(){
+        return this.error != null;
+    },
+
+    // private
+    clearError : function(){
+        this.error = null;
+    },
+
+    /**
+     * Creates a copy of this record.
+     * @param {String} id (optional) A new record id if you don't want to use this record's id
+     * @return {Record}
+     */
+    copy : function(newId) {
+        return new this.constructor(Roo.apply({}, this.data), newId || this.id);
+    }
+};
\ No newline at end of file
diff --git a/Roo/data/ScriptTagProxy.js b/Roo/data/ScriptTagProxy.js
new file mode 100644 (file)
index 0000000..a161813
--- /dev/null
@@ -0,0 +1,201 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+
+/**
+ * @class Roo.data.ScriptTagProxy
+ * An implementation of Roo.data.DataProxy that reads a data object from a URL which may be in a domain
+ * other than the originating domain of the running page.<br><br>
+ * <p>
+ * <em>Note that if you are retrieving data from a page that is in a domain that is NOT the same as the originating domain
+ * of the running page, you must use this class, rather than DataProxy.</em><br><br>
+ * <p>
+ * The content passed back from a server resource requested by a ScriptTagProxy is executable JavaScript
+ * source code that is used as the source inside a &lt;script> tag.<br><br>
+ * <p>
+ * In order for the browser to process the returned data, the server must wrap the data object
+ * with a call to a callback function, the name of which is passed as a parameter by the ScriptTagProxy.
+ * Below is a Java example for a servlet which returns data for either a ScriptTagProxy, or an HttpProxy
+ * depending on whether the callback name was passed:
+ * <p>
+ * <pre><code>
+boolean scriptTag = false;
+String cb = request.getParameter("callback");
+if (cb != null) {
+    scriptTag = true;
+    response.setContentType("text/javascript");
+} else {
+    response.setContentType("application/x-json");
+}
+Writer out = response.getWriter();
+if (scriptTag) {
+    out.write(cb + "(");
+}
+out.print(dataBlock.toJsonString());
+if (scriptTag) {
+    out.write(");");
+}
+</pre></code>
+ *
+ * @constructor
+ * @param {Object} config A configuration object.
+ */
+Roo.data.ScriptTagProxy = function(config){
+    Roo.data.ScriptTagProxy.superclass.constructor.call(this);
+    Roo.apply(this, config);
+    this.head = document.getElementsByTagName("head")[0];
+};
+
+Roo.data.ScriptTagProxy.TRANS_ID = 1000;
+
+Roo.extend(Roo.data.ScriptTagProxy, Roo.data.DataProxy, {
+    /**
+     * @cfg {String} url The URL from which to request the data object.
+     */
+    /**
+     * @cfg {Number} timeout (Optional) The number of milliseconds to wait for a response. Defaults to 30 seconds.
+     */
+    timeout : 30000,
+    /**
+     * @cfg {String} callbackParam (Optional) The name of the parameter to pass to the server which tells
+     * the server the name of the callback function set up by the load call to process the returned data object.
+     * Defaults to "callback".<p>The server-side processing must read this parameter value, and generate
+     * javascript output which calls this named function passing the data object as its only parameter.
+     */
+    callbackParam : "callback",
+    /**
+     *  @cfg {Boolean} nocache (Optional) Defaults to true. Disable cacheing by adding a unique parameter
+     * name to the request.
+     */
+    nocache : true,
+
+    /**
+     * Load data from the configured URL, read the data object into
+     * a block of Roo.data.Records using the passed Roo.data.DataReader implementation, and
+     * process that block using the passed callback.
+     * @param {Object} params An object containing properties which are to be used as HTTP parameters
+     * for the request to the remote server.
+     * @param {Roo.data.DataReader} reader The Reader object which converts the data
+     * object into a block of Roo.data.Records.
+     * @param {Function} callback The function into which to pass the block of Roo.data.Records.
+     * The function must be passed <ul>
+     * <li>The Record block object</li>
+     * <li>The "arg" argument from the load function</li>
+     * <li>A boolean success indicator</li>
+     * </ul>
+     * @param {Object} scope The scope in which to call the callback
+     * @param {Object} arg An optional argument which is passed to the callback as its second parameter.
+     */
+    load : function(params, reader, callback, scope, arg){
+        if(this.fireEvent("beforeload", this, params) !== false){
+
+            var p = Roo.urlEncode(Roo.apply(params, this.extraParams));
+
+            var url = this.url;
+            url += (url.indexOf("?") != -1 ? "&" : "?") + p;
+            if(this.nocache){
+                url += "&_dc=" + (new Date().getTime());
+            }
+            var transId = ++Roo.data.ScriptTagProxy.TRANS_ID;
+            var trans = {
+                id : transId,
+                cb : "stcCallback"+transId,
+                scriptId : "stcScript"+transId,
+                params : params,
+                arg : arg,
+                url : url,
+                callback : callback,
+                scope : scope,
+                reader : reader
+            };
+            var conn = this;
+
+            window[trans.cb] = function(o){
+                conn.handleResponse(o, trans);
+            };
+
+            url += String.format("&{0}={1}", this.callbackParam, trans.cb);
+
+            if(this.autoAbort !== false){
+                this.abort();
+            }
+
+            trans.timeoutId = this.handleFailure.defer(this.timeout, this, [trans]);
+
+            var script = document.createElement("script");
+            script.setAttribute("src", url);
+            script.setAttribute("type", "text/javascript");
+            script.setAttribute("id", trans.scriptId);
+            this.head.appendChild(script);
+
+            this.trans = trans;
+        }else{
+            callback.call(scope||this, null, arg, false);
+        }
+    },
+
+    // private
+    isLoading : function(){
+        return this.trans ? true : false;
+    },
+
+    /**
+     * Abort the current server request.
+     */
+    abort : function(){
+        if(this.isLoading()){
+            this.destroyTrans(this.trans);
+        }
+    },
+
+    // private
+    destroyTrans : function(trans, isLoaded){
+        this.head.removeChild(document.getElementById(trans.scriptId));
+        clearTimeout(trans.timeoutId);
+        if(isLoaded){
+            window[trans.cb] = undefined;
+            try{
+                delete window[trans.cb];
+            }catch(e){}
+        }else{
+            // if hasn't been loaded, wait for load to remove it to prevent script error
+            window[trans.cb] = function(){
+                window[trans.cb] = undefined;
+                try{
+                    delete window[trans.cb];
+                }catch(e){}
+            };
+        }
+    },
+
+    // private
+    handleResponse : function(o, trans){
+        this.trans = false;
+        this.destroyTrans(trans, true);
+        var result;
+        try {
+            result = trans.reader.readRecords(o);
+        }catch(e){
+            this.fireEvent("loadexception", this, o, trans.arg, e);
+            trans.callback.call(trans.scope||window, null, trans.arg, false);
+            return;
+        }
+        this.fireEvent("load", this, o, trans.arg);
+        trans.callback.call(trans.scope||window, result, trans.arg, true);
+    },
+
+    // private
+    handleFailure : function(trans){
+        this.trans = false;
+        this.destroyTrans(trans, false);
+        this.fireEvent("loadexception", this, null, trans.arg);
+        trans.callback.call(trans.scope||window, null, trans.arg, false);
+    }
+});
\ No newline at end of file
diff --git a/Roo/data/SimpleStore.js b/Roo/data/SimpleStore.js
new file mode 100644 (file)
index 0000000..adbe6f2
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+
+/**
+ * @class Roo.data.SimpleStore
+ * @extends Roo.data.Store
+ * Small helper class to make creating Stores from Array data easier.
+ * @cfg {Number} id The array index of the record id. Leave blank to auto generate ids.
+ * @cfg {Array} fields An array of field definition objects, or field name strings.
+ * @cfg {Array} data The multi-dimensional array of data
+ * @constructor
+ * @param {Object} config
+ */
+Roo.data.SimpleStore = function(config){
+    Roo.data.SimpleStore.superclass.constructor.call(this, {
+        isLocal : true,
+        reader: new Roo.data.ArrayReader({
+                id: config.id
+            },
+            Roo.data.Record.create(config.fields)
+        ),
+        proxy : new Roo.data.MemoryProxy(config.data)
+    });
+    this.load();
+};
+Roo.extend(Roo.data.SimpleStore, Roo.data.Store);
\ No newline at end of file
diff --git a/Roo/data/SortTypes.js b/Roo/data/SortTypes.js
new file mode 100644 (file)
index 0000000..1f8fbb8
--- /dev/null
@@ -0,0 +1,98 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+
+
+/**
+ * @class Roo.data.SortTypes
+ * @singleton
+ * Defines the default sorting (casting?) comparison functions used when sorting data.
+ */
+Roo.data.SortTypes = {
+    /**
+     * Default sort that does nothing
+     * @param {Mixed} s The value being converted
+     * @return {Mixed} The comparison value
+     */
+    none : function(s){
+        return s;
+    },
+    
+    /**
+     * The regular expression used to strip tags
+     * @type {RegExp}
+     * @property
+     */
+    stripTagsRE : /<\/?[^>]+>/gi,
+    
+    /**
+     * Strips all HTML tags to sort on text only
+     * @param {Mixed} s The value being converted
+     * @return {String} The comparison value
+     */
+    asText : function(s){
+        return String(s).replace(this.stripTagsRE, "");
+    },
+    
+    /**
+     * Strips all HTML tags to sort on text only - Case insensitive
+     * @param {Mixed} s The value being converted
+     * @return {String} The comparison value
+     */
+    asUCText : function(s){
+        return String(s).toUpperCase().replace(this.stripTagsRE, "");
+    },
+    
+    /**
+     * Case insensitive string
+     * @param {Mixed} s The value being converted
+     * @return {String} The comparison value
+     */
+    asUCString : function(s) {
+       return String(s).toUpperCase();
+    },
+    
+    /**
+     * Date sorting
+     * @param {Mixed} s The value being converted
+     * @return {Number} The comparison value
+     */
+    asDate : function(s) {
+        if(!s){
+            return 0;
+        }
+        if(s instanceof Date){
+            return s.getTime();
+        }
+       return Date.parse(String(s));
+    },
+    
+    /**
+     * Float sorting
+     * @param {Mixed} s The value being converted
+     * @return {Float} The comparison value
+     */
+    asFloat : function(s) {
+       var val = parseFloat(String(s).replace(/,/g, ""));
+        if(isNaN(val)) val = 0;
+       return val;
+    },
+    
+    /**
+     * Integer sorting
+     * @param {Mixed} s The value being converted
+     * @return {Number} The comparison value
+     */
+    asInt : function(s) {
+        var val = parseInt(String(s).replace(/,/g, ""));
+        if(isNaN(val)) val = 0;
+       return val;
+    }
+};
\ No newline at end of file
diff --git a/Roo/data/Store.js b/Roo/data/Store.js
new file mode 100644 (file)
index 0000000..c34270b
--- /dev/null
@@ -0,0 +1,678 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+
+
+
+/**
+ * @class Roo.data.Store
+ * @extends Roo.util.Observable
+ * The Store class encapsulates a client side cache of {@link Roo.data.Record} objects which provide input data
+ * for widgets such as the Roo.grid.Grid, or the Roo.form.ComboBox.<br>
+ * <p>
+ * A Store object uses an implementation of {@link Roo.data.DataProxy} to access a data object unless you call loadData() directly and pass in your data. The Store object
+ * has no knowledge of the format of the data returned by the Proxy.<br>
+ * <p>
+ * A Store object uses its configured implementation of {@link Roo.data.DataReader} to create {@link Roo.data.Record}
+ * instances from the data object. These records are cached and made available through accessor functions.
+ * @constructor
+ * Creates a new Store.
+ * @param {Object} config A config object containing the objects needed for the Store to access data,
+ * and read the data into Records.
+ */
+Roo.data.Store = function(config){
+    this.data = new Roo.util.MixedCollection(false);
+    this.data.getKey = function(o){
+        return o.id;
+    };
+    this.baseParams = {};
+    // private
+    this.paramNames = {
+        "start" : "start",
+        "limit" : "limit",
+        "sort" : "sort",
+        "dir" : "dir"
+    };
+
+    if(config && config.data){
+        this.inlineData = config.data;
+        delete config.data;
+    }
+
+    Roo.apply(this, config);
+    
+    if(this.reader){ // reader passed
+        this.reader = Roo.factory(this.reader, Roo.data);
+        if(!this.recordType){
+            this.recordType = this.reader.recordType;
+        }
+        if(this.reader.onMetaChange){
+            this.reader.onMetaChange = this.onMetaChange.createDelegate(this);
+        }
+    }
+
+    if(this.recordType){
+        this.fields = this.recordType.prototype.fields;
+    }
+    this.modified = [];
+
+    this.addEvents({
+        /**
+         * @event datachanged
+         * Fires when the data cache has changed, and a widget which is using this Store
+         * as a Record cache should refresh its view.
+         * @param {Store} this
+         */
+        datachanged : true,
+        /**
+         * @event metachange
+         * Fires when this store's reader provides new metadata (fields). This is currently only support for JsonReaders.
+         * @param {Store} this
+         * @param {Object} meta The JSON metadata
+         */
+        metachange : true,
+        /**
+         * @event add
+         * Fires when Records have been added to the Store
+         * @param {Store} this
+         * @param {Roo.data.Record[]} records The array of Records added
+         * @param {Number} index The index at which the record(s) were added
+         */
+        add : true,
+        /**
+         * @event remove
+         * Fires when a Record has been removed from the Store
+         * @param {Store} this
+         * @param {Roo.data.Record} record The Record that was removed
+         * @param {Number} index The index at which the record was removed
+         */
+        remove : true,
+        /**
+         * @event update
+         * Fires when a Record has been updated
+         * @param {Store} this
+         * @param {Roo.data.Record} record The Record that was updated
+         * @param {String} operation The update operation being performed.  Value may be one of:
+         * <pre><code>
+ Roo.data.Record.EDIT
+ Roo.data.Record.REJECT
+ Roo.data.Record.COMMIT
+         * </code></pre>
+         */
+        update : true,
+        /**
+         * @event clear
+         * Fires when the data cache has been cleared.
+         * @param {Store} this
+         */
+        clear : true,
+        /**
+         * @event beforeload
+         * Fires before a request is made for a new data object.  If the beforeload handler returns false
+         * the load action will be canceled.
+         * @param {Store} this
+         * @param {Object} options The loading options that were specified (see {@link #load} for details)
+         */
+        beforeload : true,
+        /**
+         * @event load
+         * Fires after a new set of Records has been loaded.
+         * @param {Store} this
+         * @param {Roo.data.Record[]} records The Records that were loaded
+         * @param {Object} options The loading options that were specified (see {@link #load} for details)
+         */
+        load : true,
+        /**
+         * @event loadexception
+         * Fires if an exception occurs in the Proxy during loading.
+         * Called with the signature of the Proxy's "loadexception" event.
+         * If you return Json { data: [] , success: false, .... } then this will be thrown with the following args
+         * 
+         * @param {Proxy} 
+         * @param {Object} return from JsonData.reader() - success, totalRecords, records
+         * @param {Object} load options 
+         * @param {Object} jsonData from your request (normally this contains the Exception)
+         */
+        loadexception : true
+    });
+    
+    if(this.proxy){
+        this.proxy = Roo.factory(this.proxy, Roo.data);
+        this.relayEvents(this.proxy,  ["loadexception"]);
+    }
+    this.sortToggle = {};
+
+    Roo.data.Store.superclass.constructor.call(this);
+
+    if(this.inlineData){
+        this.loadData(this.inlineData);
+        delete this.inlineData;
+    }
+};
+Roo.extend(Roo.data.Store, Roo.util.Observable, {
+     /**
+    * @cfg {boolean} isLocal   flag if data is locally available (and can be always looked up
+    * without a remote query - used by combo/forms at present.
+    */
+    
+    /**
+    * @cfg {Roo.data.DataProxy} proxy The Proxy object which provides access to a data object.
+    */
+    /**
+    * @cfg {Array} data Inline data to be loaded when the store is initialized.
+    */
+    /**
+    * @cfg {Roo.data.Reader} reader The Reader object which processes the data object and returns
+    * an Array of Roo.data.record objects which are cached keyed by their <em>id</em> property.
+    */
+    /**
+    * @cfg {Object} baseParams An object containing properties which are to be sent as parameters
+    * on any HTTP request
+    */
+    /**
+    * @cfg {Object} sortInfo A config object in the format: {field: "fieldName", direction: "ASC|DESC"}
+    */
+    /**
+    * @cfg {boolean} remoteSort True if sorting is to be handled by requesting the Proxy to provide a refreshed
+    * version of the data object in sorted order, as opposed to sorting the Record cache in place (defaults to false).
+    */
+    remoteSort : false,
+
+    /**
+    * @cfg {boolean} pruneModifiedRecords True to clear all modified record information each time the store is
+     * loaded or when a record is removed. (defaults to false).
+    */
+    pruneModifiedRecords : false,
+
+    // private
+    lastOptions : null,
+
+    /**
+     * Add Records to the Store and fires the add event.
+     * @param {Roo.data.Record[]} records An Array of Roo.data.Record objects to add to the cache.
+     */
+    add : function(records){
+        records = [].concat(records);
+        for(var i = 0, len = records.length; i < len; i++){
+            records[i].join(this);
+        }
+        var index = this.data.length;
+        this.data.addAll(records);
+        this.fireEvent("add", this, records, index);
+    },
+
+    /**
+     * Remove a Record from the Store and fires the remove event.
+     * @param {Ext.data.Record} record The Roo.data.Record object to remove from the cache.
+     */
+    remove : function(record){
+        var index = this.data.indexOf(record);
+        this.data.removeAt(index);
+        if(this.pruneModifiedRecords){
+            this.modified.remove(record);
+        }
+        this.fireEvent("remove", this, record, index);
+    },
+
+    /**
+     * Remove all Records from the Store and fires the clear event.
+     */
+    removeAll : function(){
+        this.data.clear();
+        if(this.pruneModifiedRecords){
+            this.modified = [];
+        }
+        this.fireEvent("clear", this);
+    },
+
+    /**
+     * Inserts Records to the Store at the given index and fires the add event.
+     * @param {Number} index The start index at which to insert the passed Records.
+     * @param {Roo.data.Record[]} records An Array of Roo.data.Record objects to add to the cache.
+     */
+    insert : function(index, records){
+        records = [].concat(records);
+        for(var i = 0, len = records.length; i < len; i++){
+            this.data.insert(index, records[i]);
+            records[i].join(this);
+        }
+        this.fireEvent("add", this, records, index);
+    },
+
+    /**
+     * Get the index within the cache of the passed Record.
+     * @param {Roo.data.Record} record The Roo.data.Record object to to find.
+     * @return {Number} The index of the passed Record. Returns -1 if not found.
+     */
+    indexOf : function(record){
+        return this.data.indexOf(record);
+    },
+
+    /**
+     * Get the index within the cache of the Record with the passed id.
+     * @param {String} id The id of the Record to find.
+     * @return {Number} The index of the Record. Returns -1 if not found.
+     */
+    indexOfId : function(id){
+        return this.data.indexOfKey(id);
+    },
+
+    /**
+     * Get the Record with the specified id.
+     * @param {String} id The id of the Record to find.
+     * @return {Roo.data.Record} The Record with the passed id. Returns undefined if not found.
+     */
+    getById : function(id){
+        return this.data.key(id);
+    },
+
+    /**
+     * Get the Record at the specified index.
+     * @param {Number} index The index of the Record to find.
+     * @return {Roo.data.Record} The Record at the passed index. Returns undefined if not found.
+     */
+    getAt : function(index){
+        return this.data.itemAt(index);
+    },
+
+    /**
+     * Returns a range of Records between specified indices.
+     * @param {Number} startIndex (optional) The starting index (defaults to 0)
+     * @param {Number} endIndex (optional) The ending index (defaults to the last Record in the Store)
+     * @return {Roo.data.Record[]} An array of Records
+     */
+    getRange : function(start, end){
+        return this.data.getRange(start, end);
+    },
+
+    // private
+    storeOptions : function(o){
+        o = Roo.apply({}, o);
+        delete o.callback;
+        delete o.scope;
+        this.lastOptions = o;
+    },
+
+    /**
+     * Loads the Record cache from the configured Proxy using the configured Reader.
+     * <p>
+     * If using remote paging, then the first load call must specify the <em>start</em>
+     * and <em>limit</em> properties in the options.params property to establish the initial
+     * position within the dataset, and the number of Records to cache on each read from the Proxy.
+     * <p>
+     * <strong>It is important to note that for remote data sources, loading is asynchronous,
+     * and this call will return before the new data has been loaded. Perform any post-processing
+     * in a callback function, or in a "load" event handler.</strong>
+     * <p>
+     * @param {Object} options An object containing properties which control loading options:<ul>
+     * <li>params {Object} An object containing properties to pass as HTTP parameters to a remote data source.</li>
+     * <li>callback {Function} A function to be called after the Records have been loaded. The callback is
+     * passed the following arguments:<ul>
+     * <li>r : Roo.data.Record[]</li>
+     * <li>options: Options object from the load call</li>
+     * <li>success: Boolean success indicator</li></ul></li>
+     * <li>scope {Object} Scope with which to call the callback (defaults to the Store object)</li>
+     * <li>add {Boolean} indicator to append loaded records rather than replace the current cache.</li>
+     * </ul>
+     */
+    load : function(options){
+        options = options || {};
+        if(this.fireEvent("beforeload", this, options) !== false){
+            this.storeOptions(options);
+            var p = Roo.apply(options.params || {}, this.baseParams);
+            if(this.sortInfo && this.remoteSort){
+                var pn = this.paramNames;
+                p[pn["sort"]] = this.sortInfo.field;
+                p[pn["dir"]] = this.sortInfo.direction;
+            }
+            this.proxy.load(p, this.reader, this.loadRecords, this, options);
+        }
+    },
+
+    /**
+     * Reloads the Record cache from the configured Proxy using the configured Reader and
+     * the options from the last load operation performed.
+     * @param {Object} options (optional) An object containing properties which may override the options
+     * used in the last load operation. See {@link #load} for details (defaults to null, in which case
+     * the most recently used options are reused).
+     */
+    reload : function(options){
+        this.load(Roo.applyIf(options||{}, this.lastOptions));
+    },
+
+    // private
+    // Called as a callback by the Reader during a load operation.
+    loadRecords : function(o, options, success){
+        if(!o || success === false){
+            if(success !== false){
+                this.fireEvent("load", this, [], options);
+            }
+            if(options.callback){
+                options.callback.call(options.scope || this, [], options, false);
+            }
+            return;
+        }
+        // if data returned failure - throw an exception.
+        if (o.success === false) {
+            this.fireEvent("loadexception", this, o, options, this.reader.jsonData);
+            return;
+        }
+        var r = o.records, t = o.totalRecords || r.length;
+        if(!options || options.add !== true){
+            if(this.pruneModifiedRecords){
+                this.modified = [];
+            }
+            for(var i = 0, len = r.length; i < len; i++){
+                r[i].join(this);
+            }
+            if(this.snapshot){
+                this.data = this.snapshot;
+                delete this.snapshot;
+            }
+            this.data.clear();
+            this.data.addAll(r);
+            this.totalLength = t;
+            this.applySort();
+            this.fireEvent("datachanged", this);
+        }else{
+            this.totalLength = Math.max(t, this.data.length+r.length);
+            this.add(r);
+        }
+        this.fireEvent("load", this, r, options);
+        if(options.callback){
+            options.callback.call(options.scope || this, r, options, true);
+        }
+    },
+
+    /**
+     * Loads data from a passed data block. A Reader which understands the format of the data
+     * must have been configured in the constructor.
+     * @param {Object} data The data block from which to read the Records.  The format of the data expected
+     * is dependent on the type of Reader that is configured and should correspond to that Reader's readRecords parameter.
+     * @param {Boolean} append (Optional) True to append the new Records rather than replace the existing cache.
+     */
+    loadData : function(o, append){
+        var r = this.reader.readRecords(o);
+        this.loadRecords(r, {add: append}, true);
+    },
+
+    /**
+     * Gets the number of cached records.
+     * <p>
+     * <em>If using paging, this may not be the total size of the dataset. If the data object
+     * used by the Reader contains the dataset size, then the getTotalCount() function returns
+     * the data set size</em>
+     */
+    getCount : function(){
+        return this.data.length || 0;
+    },
+
+    /**
+     * Gets the total number of records in the dataset as returned by the server.
+     * <p>
+     * <em>If using paging, for this to be accurate, the data object used by the Reader must contain
+     * the dataset size</em>
+     */
+    getTotalCount : function(){
+        return this.totalLength || 0;
+    },
+
+    /**
+     * Returns the sort state of the Store as an object with two properties:
+     * <pre><code>
+ field {String} The name of the field by which the Records are sorted
+ direction {String} The sort order, "ASC" or "DESC"
+     * </code></pre>
+     */
+    getSortState : function(){
+        return this.sortInfo;
+    },
+
+    // private
+    applySort : function(){
+        if(this.sortInfo && !this.remoteSort){
+            var s = this.sortInfo, f = s.field;
+            var st = this.fields.get(f).sortType;
+            var fn = function(r1, r2){
+                var v1 = st(r1.data[f]), v2 = st(r2.data[f]);
+                return v1 > v2 ? 1 : (v1 < v2 ? -1 : 0);
+            };
+            this.data.sort(s.direction, fn);
+            if(this.snapshot && this.snapshot != this.data){
+                this.snapshot.sort(s.direction, fn);
+            }
+        }
+    },
+
+    /**
+     * Sets the default sort column and order to be used by the next load operation.
+     * @param {String} fieldName The name of the field to sort by.
+     * @param {String} dir (optional) The sort order, "ASC" or "DESC" (defaults to "ASC")
+     */
+    setDefaultSort : function(field, dir){
+        this.sortInfo = {field: field, direction: dir ? dir.toUpperCase() : "ASC"};
+    },
+
+    /**
+     * Sort the Records.
+     * If remote sorting is used, the sort is performed on the server, and the cache is
+     * reloaded. If local sorting is used, the cache is sorted internally.
+     * @param {String} fieldName The name of the field to sort by.
+     * @param {String} dir (optional) The sort order, "ASC" or "DESC" (defaults to "ASC")
+     */
+    sort : function(fieldName, dir){
+        var f = this.fields.get(fieldName);
+        if(!dir){
+            if(this.sortInfo && this.sortInfo.field == f.name){ // toggle sort dir
+                dir = (this.sortToggle[f.name] || "ASC").toggle("ASC", "DESC");
+            }else{
+                dir = f.sortDir;
+            }
+        }
+        this.sortToggle[f.name] = dir;
+        this.sortInfo = {field: f.name, direction: dir};
+        if(!this.remoteSort){
+            this.applySort();
+            this.fireEvent("datachanged", this);
+        }else{
+            this.load(this.lastOptions);
+        }
+    },
+
+    /**
+     * Calls the specified function for each of the Records in the cache.
+     * @param {Function} fn The function to call. The Record is passed as the first parameter.
+     * Returning <em>false</em> aborts and exits the iteration.
+     * @param {Object} scope (optional) The scope in which to call the function (defaults to the Record).
+     */
+    each : function(fn, scope){
+        this.data.each(fn, scope);
+    },
+
+    /**
+     * Gets all records modified since the last commit.  Modified records are persisted across load operations
+     * (e.g., during paging).
+     * @return {Roo.data.Record[]} An array of Records containing outstanding modifications.
+     */
+    getModifiedRecords : function(){
+        return this.modified;
+    },
+
+    // private
+    createFilterFn : function(property, value, anyMatch){
+        if(!value.exec){ // not a regex
+            value = String(value);
+            if(value.length == 0){
+                return false;
+            }
+            value = new RegExp((anyMatch === true ? '' : '^') + Roo.escapeRe(value), "i");
+        }
+        return function(r){
+            return value.test(r.data[property]);
+        };
+    },
+
+    /**
+     * Sums the value of <i>property</i> for each record between start and end and returns the result.
+     * @param {String} property A field on your records
+     * @param {Number} start The record index to start at (defaults to 0)
+     * @param {Number} end The last record index to include (defaults to length - 1)
+     * @return {Number} The sum
+     */
+    sum : function(property, start, end){
+        var rs = this.data.items, v = 0;
+        start = start || 0;
+        end = (end || end === 0) ? end : rs.length-1;
+
+        for(var i = start; i <= end; i++){
+            v += (rs[i].data[property] || 0);
+        }
+        return v;
+    },
+
+    /**
+     * Filter the records by a specified property.
+     * @param {String} field A field on your records
+     * @param {String/RegExp} value Either a string that the field
+     * should start with or a RegExp to test against the field
+     * @param {Boolean} anyMatch True to match any part not just the beginning
+     */
+    filter : function(property, value, anyMatch){
+        var fn = this.createFilterFn(property, value, anyMatch);
+        return fn ? this.filterBy(fn) : this.clearFilter();
+    },
+
+    /**
+     * Filter by a function. The specified function will be called with each
+     * record in this data source. If the function returns true the record is included,
+     * otherwise it is filtered.
+     * @param {Function} fn The function to be called, it will receive 2 args (record, id)
+     * @param {Object} scope (optional) The scope of the function (defaults to this)
+     */
+    filterBy : function(fn, scope){
+        this.snapshot = this.snapshot || this.data;
+        this.data = this.queryBy(fn, scope||this);
+        this.fireEvent("datachanged", this);
+    },
+
+    /**
+     * Query the records by a specified property.
+     * @param {String} field A field on your records
+     * @param {String/RegExp} value Either a string that the field
+     * should start with or a RegExp to test against the field
+     * @param {Boolean} anyMatch True to match any part not just the beginning
+     * @return {MixedCollection} Returns an Roo.util.MixedCollection of the matched records
+     */
+    query : function(property, value, anyMatch){
+        var fn = this.createFilterFn(property, value, anyMatch);
+        return fn ? this.queryBy(fn) : this.data.clone();
+    },
+
+    /**
+     * Query by a function. The specified function will be called with each
+     * record in this data source. If the function returns true the record is included
+     * in the results.
+     * @param {Function} fn The function to be called, it will receive 2 args (record, id)
+     * @param {Object} scope (optional) The scope of the function (defaults to this)
+      @return {MixedCollection} Returns an Roo.util.MixedCollection of the matched records
+     **/
+    queryBy : function(fn, scope){
+        var data = this.snapshot || this.data;
+        return data.filterBy(fn, scope||this);
+    },
+
+    /**
+     * Collects unique values for a particular dataIndex from this store.
+     * @param {String} dataIndex The property to collect
+     * @param {Boolean} allowNull (optional) Pass true to allow null, undefined or empty string values
+     * @param {Boolean} bypassFilter (optional) Pass true to collect from all records, even ones which are filtered
+     * @return {Array} An array of the unique values
+     **/
+    collect : function(dataIndex, allowNull, bypassFilter){
+        var d = (bypassFilter === true && this.snapshot) ?
+                this.snapshot.items : this.data.items;
+        var v, sv, r = [], l = {};
+        for(var i = 0, len = d.length; i < len; i++){
+            v = d[i].data[dataIndex];
+            sv = String(v);
+            if((allowNull || !Roo.isEmpty(v)) && !l[sv]){
+                l[sv] = true;
+                r[r.length] = v;
+            }
+        }
+        return r;
+    },
+
+    /**
+     * Revert to a view of the Record cache with no filtering applied.
+     * @param {Boolean} suppressEvent If true the filter is cleared silently without notifying listeners
+     */
+    clearFilter : function(suppressEvent){
+        if(this.snapshot && this.snapshot != this.data){
+            this.data = this.snapshot;
+            delete this.snapshot;
+            if(suppressEvent !== true){
+                this.fireEvent("datachanged", this);
+            }
+        }
+    },
+
+    // private
+    afterEdit : function(record){
+        if(this.modified.indexOf(record) == -1){
+            this.modified.push(record);
+        }
+        this.fireEvent("update", this, record, Roo.data.Record.EDIT);
+    },
+
+    // private
+    afterReject : function(record){
+        this.modified.remove(record);
+        this.fireEvent("update", this, record, Roo.data.Record.REJECT);
+    },
+
+    // private
+    afterCommit : function(record){
+        this.modified.remove(record);
+        this.fireEvent("update", this, record, Roo.data.Record.COMMIT);
+    },
+
+    /**
+     * Commit all Records with outstanding changes. To handle updates for changes, subscribe to the
+     * Store's "update" event, and perform updating when the third parameter is Roo.data.Record.COMMIT.
+     */
+    commitChanges : function(){
+        var m = this.modified.slice(0);
+        this.modified = [];
+        for(var i = 0, len = m.length; i < len; i++){
+            m[i].commit();
+        }
+    },
+
+    /**
+     * Cancel outstanding changes on all changed records.
+     */
+    rejectChanges : function(){
+        var m = this.modified.slice(0);
+        this.modified = [];
+        for(var i = 0, len = m.length; i < len; i++){
+            m[i].reject();
+        }
+    },
+
+    onMetaChange : function(meta, rtype, o){
+        this.recordType = rtype;
+        this.fields = rtype.prototype.fields;
+        delete this.snapshot;
+        this.sortInfo = meta.sortInfo;
+        this.modified = [];
+        this.fireEvent('metachange', this, this.reader.meta);
+    }
+});
\ No newline at end of file
diff --git a/Roo/data/Tree.js b/Roo/data/Tree.js
new file mode 100644 (file)
index 0000000..f4bbaee
--- /dev/null
@@ -0,0 +1,737 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+
+
+/**
+ * @class Roo.data.Tree
+ * @extends Roo.util.Observable
+ * Represents a tree data structure and bubbles all the events for its nodes. The nodes
+ * in the tree have most standard DOM functionality.
+ * @constructor
+ * @param {Node} root (optional) The root node
+ */
+Roo.data.Tree = function(root){
+   this.nodeHash = {};
+   /**
+    * The root node for this tree
+    * @type Node
+    */
+   this.root = null;
+   if(root){
+       this.setRootNode(root);
+   }
+   this.addEvents({
+       /**
+        * @event append
+        * Fires when a new child node is appended to a node in this tree.
+        * @param {Tree} tree The owner tree
+        * @param {Node} parent The parent node
+        * @param {Node} node The newly appended node
+        * @param {Number} index The index of the newly appended node
+        */
+       "append" : true,
+       /**
+        * @event remove
+        * Fires when a child node is removed from a node in this tree.
+        * @param {Tree} tree The owner tree
+        * @param {Node} parent The parent node
+        * @param {Node} node The child node removed
+        */
+       "remove" : true,
+       /**
+        * @event move
+        * Fires when a node is moved to a new location in the tree
+        * @param {Tree} tree The owner tree
+        * @param {Node} node The node moved
+        * @param {Node} oldParent The old parent of this node
+        * @param {Node} newParent The new parent of this node
+        * @param {Number} index The index it was moved to
+        */
+       "move" : true,
+       /**
+        * @event insert
+        * Fires when a new child node is inserted in a node in this tree.
+        * @param {Tree} tree The owner tree
+        * @param {Node} parent The parent node
+        * @param {Node} node The child node inserted
+        * @param {Node} refNode The child node the node was inserted before
+        */
+       "insert" : true,
+       /**
+        * @event beforeappend
+        * Fires before a new child is appended to a node in this tree, return false to cancel the append.
+        * @param {Tree} tree The owner tree
+        * @param {Node} parent The parent node
+        * @param {Node} node The child node to be appended
+        */
+       "beforeappend" : true,
+       /**
+        * @event beforeremove
+        * Fires before a child is removed from a node in this tree, return false to cancel the remove.
+        * @param {Tree} tree The owner tree
+        * @param {Node} parent The parent node
+        * @param {Node} node The child node to be removed
+        */
+       "beforeremove" : true,
+       /**
+        * @event beforemove
+        * Fires before a node is moved to a new location in the tree. Return false to cancel the move.
+        * @param {Tree} tree The owner tree
+        * @param {Node} node The node being moved
+        * @param {Node} oldParent The parent of the node
+        * @param {Node} newParent The new parent the node is moving to
+        * @param {Number} index The index it is being moved to
+        */
+       "beforemove" : true,
+       /**
+        * @event beforeinsert
+        * Fires before a new child is inserted in a node in this tree, return false to cancel the insert.
+        * @param {Tree} tree The owner tree
+        * @param {Node} parent The parent node
+        * @param {Node} node The child node to be inserted
+        * @param {Node} refNode The child node the node is being inserted before
+        */
+       "beforeinsert" : true
+   });
+
+    Roo.data.Tree.superclass.constructor.call(this);
+};
+
+Roo.extend(Roo.data.Tree, Roo.util.Observable, {
+    pathSeparator: "/",
+
+    proxyNodeEvent : function(){
+        return this.fireEvent.apply(this, arguments);
+    },
+
+    /**
+     * Returns the root node for this tree.
+     * @return {Node}
+     */
+    getRootNode : function(){
+        return this.root;
+    },
+
+    /**
+     * Sets the root node for this tree.
+     * @param {Node} node
+     * @return {Node}
+     */
+    setRootNode : function(node){
+        this.root = node;
+        node.ownerTree = this;
+        node.isRoot = true;
+        this.registerNode(node);
+        return node;
+    },
+
+    /**
+     * Gets a node in this tree by its id.
+     * @param {String} id
+     * @return {Node}
+     */
+    getNodeById : function(id){
+        return this.nodeHash[id];
+    },
+
+    registerNode : function(node){
+        this.nodeHash[node.id] = node;
+    },
+
+    unregisterNode : function(node){
+        delete this.nodeHash[node.id];
+    },
+
+    toString : function(){
+        return "[Tree"+(this.id?" "+this.id:"")+"]";
+    }
+});
+
+/**
+ * @class Roo.data.Node
+ * @extends Roo.util.Observable
+ * @cfg {Boolean} leaf true if this node is a leaf and does not have children
+ * @cfg {String} id The id for this node. If one is not specified, one is generated.
+ * @constructor
+ * @param {Object} attributes The attributes/config for the node
+ */
+Roo.data.Node = function(attributes){
+    /**
+     * The attributes supplied for the node. You can use this property to access any custom attributes you supplied.
+     * @type {Object}
+     */
+    this.attributes = attributes || {};
+    this.leaf = this.attributes.leaf;
+    /**
+     * The node id. @type String
+     */
+    this.id = this.attributes.id;
+    if(!this.id){
+        this.id = Roo.id(null, "ynode-");
+        this.attributes.id = this.id;
+    }
+    /**
+     * All child nodes of this node. @type Array
+     */
+    this.childNodes = [];
+    if(!this.childNodes.indexOf){ // indexOf is a must
+        this.childNodes.indexOf = function(o){
+            for(var i = 0, len = this.length; i < len; i++){
+                if(this[i] == o) return i;
+            }
+            return -1;
+        };
+    }
+    /**
+     * The parent node for this node. @type Node
+     */
+    this.parentNode = null;
+    /**
+     * The first direct child node of this node, or null if this node has no child nodes. @type Node
+     */
+    this.firstChild = null;
+    /**
+     * The last direct child node of this node, or null if this node has no child nodes. @type Node
+     */
+    this.lastChild = null;
+    /**
+     * The node immediately preceding this node in the tree, or null if there is no sibling node. @type Node
+     */
+    this.previousSibling = null;
+    /**
+     * The node immediately following this node in the tree, or null if there is no sibling node. @type Node
+     */
+    this.nextSibling = null;
+
+    this.addEvents({
+       /**
+        * @event append
+        * Fires when a new child node is appended
+        * @param {Tree} tree The owner tree
+        * @param {Node} this This node
+        * @param {Node} node The newly appended node
+        * @param {Number} index The index of the newly appended node
+        */
+       "append" : true,
+       /**
+        * @event remove
+        * Fires when a child node is removed
+        * @param {Tree} tree The owner tree
+        * @param {Node} this This node
+        * @param {Node} node The removed node
+        */
+       "remove" : true,
+       /**
+        * @event move
+        * Fires when this node is moved to a new location in the tree
+        * @param {Tree} tree The owner tree
+        * @param {Node} this This node
+        * @param {Node} oldParent The old parent of this node
+        * @param {Node} newParent The new parent of this node
+        * @param {Number} index The index it was moved to
+        */
+       "move" : true,
+       /**
+        * @event insert
+        * Fires when a new child node is inserted.
+        * @param {Tree} tree The owner tree
+        * @param {Node} this This node
+        * @param {Node} node The child node inserted
+        * @param {Node} refNode The child node the node was inserted before
+        */
+       "insert" : true,
+       /**
+        * @event beforeappend
+        * Fires before a new child is appended, return false to cancel the append.
+        * @param {Tree} tree The owner tree
+        * @param {Node} this This node
+        * @param {Node} node The child node to be appended
+        */
+       "beforeappend" : true,
+       /**
+        * @event beforeremove
+        * Fires before a child is removed, return false to cancel the remove.
+        * @param {Tree} tree The owner tree
+        * @param {Node} this This node
+        * @param {Node} node The child node to be removed
+        */
+       "beforeremove" : true,
+       /**
+        * @event beforemove
+        * Fires before this node is moved to a new location in the tree. Return false to cancel the move.
+        * @param {Tree} tree The owner tree
+        * @param {Node} this This node
+        * @param {Node} oldParent The parent of this node
+        * @param {Node} newParent The new parent this node is moving to
+        * @param {Number} index The index it is being moved to
+        */
+       "beforemove" : true,
+       /**
+        * @event beforeinsert
+        * Fires before a new child is inserted, return false to cancel the insert.
+        * @param {Tree} tree The owner tree
+        * @param {Node} this This node
+        * @param {Node} node The child node to be inserted
+        * @param {Node} refNode The child node the node is being inserted before
+        */
+       "beforeinsert" : true
+   });
+    this.listeners = this.attributes.listeners;
+    Roo.data.Node.superclass.constructor.call(this);
+};
+
+Roo.extend(Roo.data.Node, Roo.util.Observable, {
+    fireEvent : function(evtName){
+        // first do standard event for this node
+        if(Roo.data.Node.superclass.fireEvent.apply(this, arguments) === false){
+            return false;
+        }
+        // then bubble it up to the tree if the event wasn't cancelled
+        var ot = this.getOwnerTree();
+        if(ot){
+            if(ot.proxyNodeEvent.apply(ot, arguments) === false){
+                return false;
+            }
+        }
+        return true;
+    },
+
+    /**
+     * Returns true if this node is a leaf
+     * @return {Boolean}
+     */
+    isLeaf : function(){
+        return this.leaf === true;
+    },
+
+    // private
+    setFirstChild : function(node){
+        this.firstChild = node;
+    },
+
+    //private
+    setLastChild : function(node){
+        this.lastChild = node;
+    },
+
+
+    /**
+     * Returns true if this node is the last child of its parent
+     * @return {Boolean}
+     */
+    isLast : function(){
+       return (!this.parentNode ? true : this.parentNode.lastChild == this);
+    },
+
+    /**
+     * Returns true if this node is the first child of its parent
+     * @return {Boolean}
+     */
+    isFirst : function(){
+       return (!this.parentNode ? true : this.parentNode.firstChild == this);
+    },
+
+    hasChildNodes : function(){
+        return !this.isLeaf() && this.childNodes.length > 0;
+    },
+
+    /**
+     * Insert node(s) as the last child node of this node.
+     * @param {Node/Array} node The node or Array of nodes to append
+     * @return {Node} The appended node if single append, or null if an array was passed
+     */
+    appendChild : function(node){
+        var multi = false;
+        if(node instanceof Array){
+            multi = node;
+        }else if(arguments.length > 1){
+            multi = arguments;
+        }
+        // if passed an array or multiple args do them one by one
+        if(multi){
+            for(var i = 0, len = multi.length; i < len; i++) {
+               this.appendChild(multi[i]);
+            }
+        }else{
+            if(this.fireEvent("beforeappend", this.ownerTree, this, node) === false){
+                return false;
+            }
+            var index = this.childNodes.length;
+            var oldParent = node.parentNode;
+            // it's a move, make sure we move it cleanly
+            if(oldParent){
+                if(node.fireEvent("beforemove", node.getOwnerTree(), node, oldParent, this, index) === false){
+                    return false;
+                }
+                oldParent.removeChild(node);
+            }
+            index = this.childNodes.length;
+            if(index == 0){
+                this.setFirstChild(node);
+            }
+            this.childNodes.push(node);
+            node.parentNode = this;
+            var ps = this.childNodes[index-1];
+            if(ps){
+                node.previousSibling = ps;
+                ps.nextSibling = node;
+            }else{
+                node.previousSibling = null;
+            }
+            node.nextSibling = null;
+            this.setLastChild(node);
+            node.setOwnerTree(this.getOwnerTree());
+            this.fireEvent("append", this.ownerTree, this, node, index);
+            if(oldParent){
+                node.fireEvent("move", this.ownerTree, node, oldParent, this, index);
+            }
+            return node;
+        }
+    },
+
+    /**
+     * Removes a child node from this node.
+     * @param {Node} node The node to remove
+     * @return {Node} The removed node
+     */
+    removeChild : function(node){
+        var index = this.childNodes.indexOf(node);
+        if(index == -1){
+            return false;
+        }
+        if(this.fireEvent("beforeremove", this.ownerTree, this, node) === false){
+            return false;
+        }
+
+        // remove it from childNodes collection
+        this.childNodes.splice(index, 1);
+
+        // update siblings
+        if(node.previousSibling){
+            node.previousSibling.nextSibling = node.nextSibling;
+        }
+        if(node.nextSibling){
+            node.nextSibling.previousSibling = node.previousSibling;
+        }
+
+        // update child refs
+        if(this.firstChild == node){
+            this.setFirstChild(node.nextSibling);
+        }
+        if(this.lastChild == node){
+            this.setLastChild(node.previousSibling);
+        }
+
+        node.setOwnerTree(null);
+        // clear any references from the node
+        node.parentNode = null;
+        node.previousSibling = null;
+        node.nextSibling = null;
+        this.fireEvent("remove", this.ownerTree, this, node);
+        return node;
+    },
+
+    /**
+     * Inserts the first node before the second node in this nodes childNodes collection.
+     * @param {Node} node The node to insert
+     * @param {Node} refNode The node to insert before (if null the node is appended)
+     * @return {Node} The inserted node
+     */
+    insertBefore : function(node, refNode){
+        if(!refNode){ // like standard Dom, refNode can be null for append
+            return this.appendChild(node);
+        }
+        // nothing to do
+        if(node == refNode){
+            return false;
+        }
+
+        if(this.fireEvent("beforeinsert", this.ownerTree, this, node, refNode) === false){
+            return false;
+        }
+        var index = this.childNodes.indexOf(refNode);
+        var oldParent = node.parentNode;
+        var refIndex = index;
+
+        // when moving internally, indexes will change after remove
+        if(oldParent == this && this.childNodes.indexOf(node) < index){
+            refIndex--;
+        }
+
+        // it's a move, make sure we move it cleanly
+        if(oldParent){
+            if(node.fireEvent("beforemove", node.getOwnerTree(), node, oldParent, this, index, refNode) === false){
+                return false;
+            }
+            oldParent.removeChild(node);
+        }
+        if(refIndex == 0){
+            this.setFirstChild(node);
+        }
+        this.childNodes.splice(refIndex, 0, node);
+        node.parentNode = this;
+        var ps = this.childNodes[refIndex-1];
+        if(ps){
+            node.previousSibling = ps;
+            ps.nextSibling = node;
+        }else{
+            node.previousSibling = null;
+        }
+        node.nextSibling = refNode;
+        refNode.previousSibling = node;
+        node.setOwnerTree(this.getOwnerTree());
+        this.fireEvent("insert", this.ownerTree, this, node, refNode);
+        if(oldParent){
+            node.fireEvent("move", this.ownerTree, node, oldParent, this, refIndex, refNode);
+        }
+        return node;
+    },
+
+    /**
+     * Returns the child node at the specified index.
+     * @param {Number} index
+     * @return {Node}
+     */
+    item : function(index){
+        return this.childNodes[index];
+    },
+
+    /**
+     * Replaces one child node in this node with another.
+     * @param {Node} newChild The replacement node
+     * @param {Node} oldChild The node to replace
+     * @return {Node} The replaced node
+     */
+    replaceChild : function(newChild, oldChild){
+        this.insertBefore(newChild, oldChild);
+        this.removeChild(oldChild);
+        return oldChild;
+    },
+
+    /**
+     * Returns the index of a child node
+     * @param {Node} node
+     * @return {Number} The index of the node or -1 if it was not found
+     */
+    indexOf : function(child){
+        return this.childNodes.indexOf(child);
+    },
+
+    /**
+     * Returns the tree this node is in.
+     * @return {Tree}
+     */
+    getOwnerTree : function(){
+        // if it doesn't have one, look for one
+        if(!this.ownerTree){
+            var p = this;
+            while(p){
+                if(p.ownerTree){
+                    this.ownerTree = p.ownerTree;
+                    break;
+                }
+                p = p.parentNode;
+            }
+        }
+        return this.ownerTree;
+    },
+
+    /**
+     * Returns depth of this node (the root node has a depth of 0)
+     * @return {Number}
+     */
+    getDepth : function(){
+        var depth = 0;
+        var p = this;
+        while(p.parentNode){
+            ++depth;
+            p = p.parentNode;
+        }
+        return depth;
+    },
+
+    // private
+    setOwnerTree : function(tree){
+        // if it's move, we need to update everyone
+        if(tree != this.ownerTree){
+            if(this.ownerTree){
+                this.ownerTree.unregisterNode(this);
+            }
+            this.ownerTree = tree;
+            var cs = this.childNodes;
+            for(var i = 0, len = cs.length; i < len; i++) {
+               cs[i].setOwnerTree(tree);
+            }
+            if(tree){
+                tree.registerNode(this);
+            }
+        }
+    },
+
+    /**
+     * Returns the path for this node. The path can be used to expand or select this node programmatically.
+     * @param {String} attr (optional) The attr to use for the path (defaults to the node's id)
+     * @return {String} The path
+     */
+    getPath : function(attr){
+        attr = attr || "id";
+        var p = this.parentNode;
+        var b = [this.attributes[attr]];
+        while(p){
+            b.unshift(p.attributes[attr]);
+            p = p.parentNode;
+        }
+        var sep = this.getOwnerTree().pathSeparator;
+        return sep + b.join(sep);
+    },
+
+    /**
+     * Bubbles up the tree from this node, calling the specified function with each node. The scope (<i>this</i>) of
+     * function call will be the scope provided or the current node. The arguments to the function
+     * will be the args provided or the current node. If the function returns false at any point,
+     * the bubble is stopped.
+     * @param {Function} fn The function to call
+     * @param {Object} scope (optional) The scope of the function (defaults to current node)
+     * @param {Array} args (optional) The args to call the function with (default to passing the current node)
+     */
+    bubble : function(fn, scope, args){
+        var p = this;
+        while(p){
+            if(fn.call(scope || p, args || p) === false){
+                break;
+            }
+            p = p.parentNode;
+        }
+    },
+
+    /**
+     * Cascades down the tree from this node, calling the specified function with each node. The scope (<i>this</i>) of
+     * function call will be the scope provided or the current node. The arguments to the function
+     * will be the args provided or the current node. If the function returns false at any point,
+     * the cascade is stopped on that branch.
+     * @param {Function} fn The function to call
+     * @param {Object} scope (optional) The scope of the function (defaults to current node)
+     * @param {Array} args (optional) The args to call the function with (default to passing the current node)
+     */
+    cascade : function(fn, scope, args){
+        if(fn.call(scope || this, args || this) !== false){
+            var cs = this.childNodes;
+            for(var i = 0, len = cs.length; i < len; i++) {
+               cs[i].cascade(fn, scope, args);
+            }
+        }
+    },
+
+    /**
+     * Interates the child nodes of this node, calling the specified function with each node. The scope (<i>this</i>) of
+     * function call will be the scope provided or the current node. The arguments to the function
+     * will be the args provided or the current node. If the function returns false at any point,
+     * the iteration stops.
+     * @param {Function} fn The function to call
+     * @param {Object} scope (optional) The scope of the function (defaults to current node)
+     * @param {Array} args (optional) The args to call the function with (default to passing the current node)
+     */
+    eachChild : function(fn, scope, args){
+        var cs = this.childNodes;
+        for(var i = 0, len = cs.length; i < len; i++) {
+               if(fn.call(scope || this, args || cs[i]) === false){
+                   break;
+               }
+        }
+    },
+
+    /**
+     * Finds the first child that has the attribute with the specified value.
+     * @param {String} attribute The attribute name
+     * @param {Mixed} value The value to search for
+     * @return {Node} The found child or null if none was found
+     */
+    findChild : function(attribute, value){
+        var cs = this.childNodes;
+        for(var i = 0, len = cs.length; i < len; i++) {
+               if(cs[i].attributes[attribute] == value){
+                   return cs[i];
+               }
+        }
+        return null;
+    },
+
+    /**
+     * Finds the first child by a custom function. The child matches if the function passed
+     * returns true.
+     * @param {Function} fn
+     * @param {Object} scope (optional)
+     * @return {Node} The found child or null if none was found
+     */
+    findChildBy : function(fn, scope){
+        var cs = this.childNodes;
+        for(var i = 0, len = cs.length; i < len; i++) {
+               if(fn.call(scope||cs[i], cs[i]) === true){
+                   return cs[i];
+               }
+        }
+        return null;
+    },
+
+    /**
+     * Sorts this nodes children using the supplied sort function
+     * @param {Function} fn
+     * @param {Object} scope (optional)
+     */
+    sort : function(fn, scope){
+        var cs = this.childNodes;
+        var len = cs.length;
+        if(len > 0){
+            var sortFn = scope ? function(){fn.apply(scope, arguments);} : fn;
+            cs.sort(sortFn);
+            for(var i = 0; i < len; i++){
+                var n = cs[i];
+                n.previousSibling = cs[i-1];
+                n.nextSibling = cs[i+1];
+                if(i == 0){
+                    this.setFirstChild(n);
+                }
+                if(i == len-1){
+                    this.setLastChild(n);
+                }
+            }
+        }
+    },
+
+    /**
+     * Returns true if this node is an ancestor (at any point) of the passed node.
+     * @param {Node} node
+     * @return {Boolean}
+     */
+    contains : function(node){
+        return node.isAncestor(this);
+    },
+
+    /**
+     * Returns true if the passed node is an ancestor (at any point) of this node.
+     * @param {Node} node
+     * @return {Boolean}
+     */
+    isAncestor : function(node){
+        var p = this.parentNode;
+        while(p){
+            if(p == node){
+                return true;
+            }
+            p = p.parentNode;
+        }
+        return false;
+    },
+
+    toString : function(){
+        return "[Node"+(this.id?" "+this.id:"")+"]";
+    }
+});
\ No newline at end of file
diff --git a/Roo/data/XmlReader.js b/Roo/data/XmlReader.js
new file mode 100644 (file)
index 0000000..3dda634
--- /dev/null
@@ -0,0 +1,133 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+
+/**
+ * @class Roo.data.XmlReader
+ * @extends Roo.data.DataReader
+ * Data reader class to create an Array of {@link Roo.data.Record} objects from an XML document
+ * based on mappings in a provided Roo.data.Record constructor.<br><br>
+ * <p>
+ * <em>Note that in order for the browser to parse a returned XML document, the Content-Type
+ * header in the HTTP response must be set to "text/xml".</em>
+ * <p>
+ * Example code:
+ * <pre><code>
+var RecordDef = Roo.data.Record.create([
+   {name: 'name', mapping: 'name'},     // "mapping" property not needed if it's the same as "name"
+   {name: 'occupation'}                 // This field will use "occupation" as the mapping.
+]);
+var myReader = new Roo.data.XmlReader({
+   totalRecords: "results", // The element which contains the total dataset size (optional)
+   record: "row",           // The repeated element which contains row information
+   id: "id"                 // The element within the row that provides an ID for the record (optional)
+}, RecordDef);
+</code></pre>
+ * <p>
+ * This would consume an XML file like this:
+ * <pre><code>
+&lt;?xml?>
+&lt;dataset>
+ &lt;results>2&lt;/results>
+ &lt;row>
+   &lt;id>1&lt;/id>
+   &lt;name>Bill&lt;/name>
+   &lt;occupation>Gardener&lt;/occupation>
+ &lt;/row>
+ &lt;row>
+   &lt;id>2&lt;/id>
+   &lt;name>Ben&lt;/name>
+   &lt;occupation>Horticulturalist&lt;/occupation>
+ &lt;/row>
+&lt;/dataset>
+</code></pre>
+ * @cfg {String} totalRecords The DomQuery path from which to retrieve the total number of records
+ * in the dataset. This is only needed if the whole dataset is not passed in one go, but is being
+ * paged from the remote server.
+ * @cfg {String} record The DomQuery path to the repeated element which contains record information.
+ * @cfg {String} success The DomQuery path to the success attribute used by forms.
+ * @cfg {String} id The DomQuery path relative from the record element to the element that contains
+ * a record identifier value.
+ * @constructor
+ * Create a new XmlReader
+ * @param {Object} meta Metadata configuration options
+ * @param {Mixed} recordType The definition of the data record type to produce.  This can be either a valid
+ * Record subclass created with {@link Roo.data.Record#create}, or an array of objects with which to call
+ * Roo.data.Record.create.  See the {@link Roo.data.Record} class for more details.
+ */
+Roo.data.XmlReader = function(meta, recordType){
+    meta = meta || {};
+    Roo.data.XmlReader.superclass.constructor.call(this, meta, recordType||meta.fields);
+};
+Roo.extend(Roo.data.XmlReader, Roo.data.DataReader, {
+    /**
+     * This method is only used by a DataProxy which has retrieved data from a remote server.
+        * @param {Object} response The XHR object which contains the parsed XML document.  The response is expected
+        * to contain a method called 'responseXML' that returns an XML document object.
+     * @return {Object} records A data block which is used by an {@link Roo.data.Store} as
+     * a cache of Roo.data.Records.
+     */
+    read : function(response){
+        var doc = response.responseXML;
+        if(!doc) {
+            throw {message: "XmlReader.read: XML Document not available"};
+        }
+        return this.readRecords(doc);
+    },
+
+    /**
+     * Create a data block containing Roo.data.Records from an XML document.
+        * @param {Object} doc A parsed XML document.
+     * @return {Object} records A data block which is used by an {@link Roo.data.Store} as
+     * a cache of Roo.data.Records.
+     */
+    readRecords : function(doc){
+        /**
+         * After any data loads/reads, the raw XML Document is available for further custom processing.
+         * @type XMLDocument
+         */
+        this.xmlData = doc;
+        var root = doc.documentElement || doc;
+       var q = Roo.DomQuery;
+       var recordType = this.recordType, fields = recordType.prototype.fields;
+       var sid = this.meta.id;
+       var totalRecords = 0, success = true;
+       if(this.meta.totalRecords){
+           totalRecords = q.selectNumber(this.meta.totalRecords, root, 0);
+       }
+        
+        if(this.meta.success){
+            var sv = q.selectValue(this.meta.success, root, true);
+            success = sv !== false && sv !== 'false';
+       }
+       var records = [];
+       var ns = q.select(this.meta.record, root);
+        for(var i = 0, len = ns.length; i < len; i++) {
+               var n = ns[i];
+               var values = {};
+               var id = sid ? q.selectValue(sid, n) : undefined;
+               for(var j = 0, jlen = fields.length; j < jlen; j++){
+                   var f = fields.items[j];
+                var v = q.selectValue(f.mapping || f.name, n, f.defaultValue);
+                   v = f.convert(v);
+                   values[f.name] = v;
+               }
+               var record = new recordType(values, id);
+               record.node = n;
+               records[records.length] = record;
+           }
+
+           return {
+               success : success,
+               records : records,
+               totalRecords : totalRecords || records.length
+           };
+    }
+});
\ No newline at end of file
diff --git a/Roo/dd/DD.js b/Roo/dd/DD.js
new file mode 100644 (file)
index 0000000..b6966e4
--- /dev/null
@@ -0,0 +1,300 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+
+/**
+ * @class Roo.dd.DD
+ * A DragDrop implementation where the linked element follows the
+ * mouse cursor during a drag.
+ * @extends Roo.dd.DragDrop
+ * @constructor
+ * @param {String} id the id of the linked element
+ * @param {String} sGroup the group of related DragDrop items
+ * @param {object} config an object containing configurable attributes
+ *                Valid properties for DD:
+ *                    scroll
+ */
+Roo.dd.DD = function(id, sGroup, config) {
+    if (id) {
+        this.init(id, sGroup, config);
+    }
+};
+
+Roo.extend(Roo.dd.DD, Roo.dd.DragDrop, {
+
+    /**
+     * When set to true, the utility automatically tries to scroll the browser
+     * window wehn a drag and drop element is dragged near the viewport boundary.
+     * Defaults to true.
+     * @property scroll
+     * @type boolean
+     */
+    scroll: true,
+
+    /**
+     * Sets the pointer offset to the distance between the linked element's top
+     * left corner and the location the element was clicked
+     * @method autoOffset
+     * @param {int} iPageX the X coordinate of the click
+     * @param {int} iPageY the Y coordinate of the click
+     */
+    autoOffset: function(iPageX, iPageY) {
+        var x = iPageX - this.startPageX;
+        var y = iPageY - this.startPageY;
+        this.setDelta(x, y);
+    },
+
+    /**
+     * Sets the pointer offset.  You can call this directly to force the
+     * offset to be in a particular location (e.g., pass in 0,0 to set it
+     * to the center of the object)
+     * @method setDelta
+     * @param {int} iDeltaX the distance from the left
+     * @param {int} iDeltaY the distance from the top
+     */
+    setDelta: function(iDeltaX, iDeltaY) {
+        this.deltaX = iDeltaX;
+        this.deltaY = iDeltaY;
+    },
+
+    /**
+     * Sets the drag element to the location of the mousedown or click event,
+     * maintaining the cursor location relative to the location on the element
+     * that was clicked.  Override this if you want to place the element in a
+     * location other than where the cursor is.
+     * @method setDragElPos
+     * @param {int} iPageX the X coordinate of the mousedown or drag event
+     * @param {int} iPageY the Y coordinate of the mousedown or drag event
+     */
+    setDragElPos: function(iPageX, iPageY) {
+        // the first time we do this, we are going to check to make sure
+        // the element has css positioning
+
+        var el = this.getDragEl();
+        this.alignElWithMouse(el, iPageX, iPageY);
+    },
+
+    /**
+     * Sets the element to the location of the mousedown or click event,
+     * maintaining the cursor location relative to the location on the element
+     * that was clicked.  Override this if you want to place the element in a
+     * location other than where the cursor is.
+     * @method alignElWithMouse
+     * @param {HTMLElement} el the element to move
+     * @param {int} iPageX the X coordinate of the mousedown or drag event
+     * @param {int} iPageY the Y coordinate of the mousedown or drag event
+     */
+    alignElWithMouse: function(el, iPageX, iPageY) {
+        var oCoord = this.getTargetCoord(iPageX, iPageY);
+        var fly = el.dom ? el : Roo.fly(el);
+        if (!this.deltaSetXY) {
+            var aCoord = [oCoord.x, oCoord.y];
+            fly.setXY(aCoord);
+            var newLeft = fly.getLeft(true);
+            var newTop  = fly.getTop(true);
+            this.deltaSetXY = [ newLeft - oCoord.x, newTop - oCoord.y ];
+        } else {
+            fly.setLeftTop(oCoord.x + this.deltaSetXY[0], oCoord.y + this.deltaSetXY[1]);
+        }
+
+        this.cachePosition(oCoord.x, oCoord.y);
+        this.autoScroll(oCoord.x, oCoord.y, el.offsetHeight, el.offsetWidth);
+        return oCoord;
+    },
+
+    /**
+     * Saves the most recent position so that we can reset the constraints and
+     * tick marks on-demand.  We need to know this so that we can calculate the
+     * number of pixels the element is offset from its original position.
+     * @method cachePosition
+     * @param iPageX the current x position (optional, this just makes it so we
+     * don't have to look it up again)
+     * @param iPageY the current y position (optional, this just makes it so we
+     * don't have to look it up again)
+     */
+    cachePosition: function(iPageX, iPageY) {
+        if (iPageX) {
+            this.lastPageX = iPageX;
+            this.lastPageY = iPageY;
+        } else {
+            var aCoord = Roo.lib.Dom.getXY(this.getEl());
+            this.lastPageX = aCoord[0];
+            this.lastPageY = aCoord[1];
+        }
+    },
+
+    /**
+     * Auto-scroll the window if the dragged object has been moved beyond the
+     * visible window boundary.
+     * @method autoScroll
+     * @param {int} x the drag element's x position
+     * @param {int} y the drag element's y position
+     * @param {int} h the height of the drag element
+     * @param {int} w the width of the drag element
+     * @private
+     */
+    autoScroll: function(x, y, h, w) {
+
+        if (this.scroll) {
+            // The client height
+            var clientH = Roo.lib.Dom.getViewWidth();
+
+            // The client width
+            var clientW = Roo.lib.Dom.getViewHeight();
+
+            // The amt scrolled down
+            var st = this.DDM.getScrollTop();
+
+            // The amt scrolled right
+            var sl = this.DDM.getScrollLeft();
+
+            // Location of the bottom of the element
+            var bot = h + y;
+
+            // Location of the right of the element
+            var right = w + x;
+
+            // The distance from the cursor to the bottom of the visible area,
+            // adjusted so that we don't scroll if the cursor is beyond the
+            // element drag constraints
+            var toBot = (clientH + st - y - this.deltaY);
+
+            // The distance from the cursor to the right of the visible area
+            var toRight = (clientW + sl - x - this.deltaX);
+
+
+            // How close to the edge the cursor must be before we scroll
+            // var thresh = (document.all) ? 100 : 40;
+            var thresh = 40;
+
+            // How many pixels to scroll per autoscroll op.  This helps to reduce
+            // clunky scrolling. IE is more sensitive about this ... it needs this
+            // value to be higher.
+            var scrAmt = (document.all) ? 80 : 30;
+
+            // Scroll down if we are near the bottom of the visible page and the
+            // obj extends below the crease
+            if ( bot > clientH && toBot < thresh ) {
+                window.scrollTo(sl, st + scrAmt);
+            }
+
+            // Scroll up if the window is scrolled down and the top of the object
+            // goes above the top border
+            if ( y < st && st > 0 && y - st < thresh ) {
+                window.scrollTo(sl, st - scrAmt);
+            }
+
+            // Scroll right if the obj is beyond the right border and the cursor is
+            // near the border.
+            if ( right > clientW && toRight < thresh ) {
+                window.scrollTo(sl + scrAmt, st);
+            }
+
+            // Scroll left if the window has been scrolled to the right and the obj
+            // extends past the left border
+            if ( x < sl && sl > 0 && x - sl < thresh ) {
+                window.scrollTo(sl - scrAmt, st);
+            }
+        }
+    },
+
+    /**
+     * Finds the location the element should be placed if we want to move
+     * it to where the mouse location less the click offset would place us.
+     * @method getTargetCoord
+     * @param {int} iPageX the X coordinate of the click
+     * @param {int} iPageY the Y coordinate of the click
+     * @return an object that contains the coordinates (Object.x and Object.y)
+     * @private
+     */
+    getTargetCoord: function(iPageX, iPageY) {
+
+
+        var x = iPageX - this.deltaX;
+        var y = iPageY - this.deltaY;
+
+        if (this.constrainX) {
+            if (x < this.minX) { x = this.minX; }
+            if (x > this.maxX) { x = this.maxX; }
+        }
+
+        if (this.constrainY) {
+            if (y < this.minY) { y = this.minY; }
+            if (y > this.maxY) { y = this.maxY; }
+        }
+
+        x = this.getTick(x, this.xTicks);
+        y = this.getTick(y, this.yTicks);
+
+
+        return {x:x, y:y};
+    },
+
+    /*
+     * Sets up config options specific to this class. Overrides
+     * Roo.dd.DragDrop, but all versions of this method through the
+     * inheritance chain are called
+     */
+    applyConfig: function() {
+        Roo.dd.DD.superclass.applyConfig.call(this);
+        this.scroll = (this.config.scroll !== false);
+    },
+
+    /*
+     * Event that fires prior to the onMouseDown event.  Overrides
+     * Roo.dd.DragDrop.
+     */
+    b4MouseDown: function(e) {
+        // this.resetConstraints();
+        this.autoOffset(e.getPageX(),
+                            e.getPageY());
+    },
+
+    /*
+     * Event that fires prior to the onDrag event.  Overrides
+     * Roo.dd.DragDrop.
+     */
+    b4Drag: function(e) {
+        this.setDragElPos(e.getPageX(),
+                            e.getPageY());
+    },
+
+    toString: function() {
+        return ("DD " + this.id);
+    }
+
+    //////////////////////////////////////////////////////////////////////////
+    // Debugging ygDragDrop events that can be overridden
+    //////////////////////////////////////////////////////////////////////////
+    /*
+    startDrag: function(x, y) {
+    },
+
+    onDrag: function(e) {
+    },
+
+    onDragEnter: function(e, id) {
+    },
+
+    onDragOver: function(e, id) {
+    },
+
+    onDragOut: function(e, id) {
+    },
+
+    onDragDrop: function(e, id) {
+    },
+
+    endDrag: function(e) {
+    }
+
+    */
+
+});
\ No newline at end of file
diff --git a/Roo/dd/DDProxy.js b/Roo/dd/DDProxy.js
new file mode 100644 (file)
index 0000000..eee61a1
--- /dev/null
@@ -0,0 +1,208 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+
+/**
+ * @class Roo.dd.DDProxy
+ * A DragDrop implementation that inserts an empty, bordered div into
+ * the document that follows the cursor during drag operations.  At the time of
+ * the click, the frame div is resized to the dimensions of the linked html
+ * element, and moved to the exact location of the linked element.
+ *
+ * References to the "frame" element refer to the single proxy element that
+ * was created to be dragged in place of all DDProxy elements on the
+ * page.
+ *
+ * @extends Roo.dd.DD
+ * @constructor
+ * @param {String} id the id of the linked html element
+ * @param {String} sGroup the group of related DragDrop objects
+ * @param {object} config an object containing configurable attributes
+ *                Valid properties for DDProxy in addition to those in DragDrop:
+ *                   resizeFrame, centerFrame, dragElId
+ */
+Roo.dd.DDProxy = function(id, sGroup, config) {
+    if (id) {
+        this.init(id, sGroup, config);
+        this.initFrame();
+    }
+};
+
+/**
+ * The default drag frame div id
+ * @property Roo.dd.DDProxy.dragElId
+ * @type String
+ * @static
+ */
+Roo.dd.DDProxy.dragElId = "ygddfdiv";
+
+Roo.extend(Roo.dd.DDProxy, Roo.dd.DD, {
+
+    /**
+     * By default we resize the drag frame to be the same size as the element
+     * we want to drag (this is to get the frame effect).  We can turn it off
+     * if we want a different behavior.
+     * @property resizeFrame
+     * @type boolean
+     */
+    resizeFrame: true,
+
+    /**
+     * By default the frame is positioned exactly where the drag element is, so
+     * we use the cursor offset provided by Roo.dd.DD.  Another option that works only if
+     * you do not have constraints on the obj is to have the drag frame centered
+     * around the cursor.  Set centerFrame to true for this effect.
+     * @property centerFrame
+     * @type boolean
+     */
+    centerFrame: false,
+
+    /**
+     * Creates the proxy element if it does not yet exist
+     * @method createFrame
+     */
+    createFrame: function() {
+        var self = this;
+        var body = document.body;
+
+        if (!body || !body.firstChild) {
+            setTimeout( function() { self.createFrame(); }, 50 );
+            return;
+        }
+
+        var div = this.getDragEl();
+
+        if (!div) {
+            div    = document.createElement("div");
+            div.id = this.dragElId;
+            var s  = div.style;
+
+            s.position   = "absolute";
+            s.visibility = "hidden";
+            s.cursor     = "move";
+            s.border     = "2px solid #aaa";
+            s.zIndex     = 999;
+
+            // appendChild can blow up IE if invoked prior to the window load event
+            // while rendering a table.  It is possible there are other scenarios
+            // that would cause this to happen as well.
+            body.insertBefore(div, body.firstChild);
+        }
+    },
+
+    /**
+     * Initialization for the drag frame element.  Must be called in the
+     * constructor of all subclasses
+     * @method initFrame
+     */
+    initFrame: function() {
+        this.createFrame();
+    },
+
+    applyConfig: function() {
+        Roo.dd.DDProxy.superclass.applyConfig.call(this);
+
+        this.resizeFrame = (this.config.resizeFrame !== false);
+        this.centerFrame = (this.config.centerFrame);
+        this.setDragElId(this.config.dragElId || Roo.dd.DDProxy.dragElId);
+    },
+
+    /**
+     * Resizes the drag frame to the dimensions of the clicked object, positions
+     * it over the object, and finally displays it
+     * @method showFrame
+     * @param {int} iPageX X click position
+     * @param {int} iPageY Y click position
+     * @private
+     */
+    showFrame: function(iPageX, iPageY) {
+        var el = this.getEl();
+        var dragEl = this.getDragEl();
+        var s = dragEl.style;
+
+        this._resizeProxy();
+
+        if (this.centerFrame) {
+            this.setDelta( Math.round(parseInt(s.width,  10)/2),
+                           Math.round(parseInt(s.height, 10)/2) );
+        }
+
+        this.setDragElPos(iPageX, iPageY);
+
+        Roo.fly(dragEl).show();
+    },
+
+    /**
+     * The proxy is automatically resized to the dimensions of the linked
+     * element when a drag is initiated, unless resizeFrame is set to false
+     * @method _resizeProxy
+     * @private
+     */
+    _resizeProxy: function() {
+        if (this.resizeFrame) {
+            var el = this.getEl();
+            Roo.fly(this.getDragEl()).setSize(el.offsetWidth, el.offsetHeight);
+        }
+    },
+
+    // overrides Roo.dd.DragDrop
+    b4MouseDown: function(e) {
+        var x = e.getPageX();
+        var y = e.getPageY();
+        this.autoOffset(x, y);
+        this.setDragElPos(x, y);
+    },
+
+    // overrides Roo.dd.DragDrop
+    b4StartDrag: function(x, y) {
+        // show the drag frame
+        this.showFrame(x, y);
+    },
+
+    // overrides Roo.dd.DragDrop
+    b4EndDrag: function(e) {
+        Roo.fly(this.getDragEl()).hide();
+    },
+
+    // overrides Roo.dd.DragDrop
+    // By default we try to move the element to the last location of the frame.
+    // This is so that the default behavior mirrors that of Roo.dd.DD.
+    endDrag: function(e) {
+
+        var lel = this.getEl();
+        var del = this.getDragEl();
+
+        // Show the drag frame briefly so we can get its position
+        del.style.visibility = "";
+
+        this.beforeMove();
+        // Hide the linked element before the move to get around a Safari
+        // rendering bug.
+        lel.style.visibility = "hidden";
+        Roo.dd.DDM.moveToEl(lel, del);
+        del.style.visibility = "hidden";
+        lel.style.visibility = "";
+
+        this.afterDrag();
+    },
+
+    beforeMove : function(){
+
+    },
+
+    afterDrag : function(){
+
+    },
+
+    toString: function() {
+        return ("DDProxy " + this.id);
+    }
+
+});
diff --git a/Roo/dd/DDTarget.js b/Roo/dd/DDTarget.js
new file mode 100644 (file)
index 0000000..fd4bce3
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+
+ /**
+ * @class Roo.dd.DDTarget
+ * A DragDrop implementation that does not move, but can be a drop
+ * target.  You would get the same result by simply omitting implementation
+ * for the event callbacks, but this way we reduce the processing cost of the
+ * event listener and the callbacks.
+ * @extends Roo.dd.DragDrop
+ * @constructor
+ * @param {String} id the id of the element that is a drop target
+ * @param {String} sGroup the group of related DragDrop objects
+ * @param {object} config an object containing configurable attributes
+ *                 Valid properties for DDTarget in addition to those in
+ *                 DragDrop:
+ *                    none
+ */
+Roo.dd.DDTarget = function(id, sGroup, config) {
+    if (id) {
+        this.initTarget(id, sGroup, config);
+    }
+};
+
+// Roo.dd.DDTarget.prototype = new Roo.dd.DragDrop();
+Roo.extend(Roo.dd.DDTarget, Roo.dd.DragDrop, {
+    toString: function() {
+        return ("DDTarget " + this.id);
+    }
+});
diff --git a/Roo/dd/DragDrop.js b/Roo/dd/DragDrop.js
new file mode 100644 (file)
index 0000000..bfd52f5
--- /dev/null
@@ -0,0 +1,1162 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+
+
+
+/*
+ * These classes are derivatives of the similarly named classes in the YUI Library.
+ * The original license:
+ * Copyright (c) 2006, Yahoo! Inc. All rights reserved.
+ * Code licensed under the BSD License:
+ * http://developer.yahoo.net/yui/license.txt
+ */
+
+(function() {
+
+var Event=Roo.EventManager;
+var Dom=Roo.lib.Dom;
+
+/**
+ * @class Roo.dd.DragDrop
+ * Defines the interface and base operation of items that that can be
+ * dragged or can be drop targets.  It was designed to be extended, overriding
+ * the event handlers for startDrag, onDrag, onDragOver and onDragOut.
+ * Up to three html elements can be associated with a DragDrop instance:
+ * <ul>
+ * <li>linked element: the element that is passed into the constructor.
+ * This is the element which defines the boundaries for interaction with
+ * other DragDrop objects.</li>
+ * <li>handle element(s): The drag operation only occurs if the element that
+ * was clicked matches a handle element.  By default this is the linked
+ * element, but there are times that you will want only a portion of the
+ * linked element to initiate the drag operation, and the setHandleElId()
+ * method provides a way to define this.</li>
+ * <li>drag element: this represents the element that would be moved along
+ * with the cursor during a drag operation.  By default, this is the linked
+ * element itself as in {@link Roo.dd.DD}.  setDragElId() lets you define
+ * a separate element that would be moved, as in {@link Roo.dd.DDProxy}.
+ * </li>
+ * </ul>
+ * This class should not be instantiated until the onload event to ensure that
+ * the associated elements are available.
+ * The following would define a DragDrop obj that would interact with any
+ * other DragDrop obj in the "group1" group:
+ * <pre>
+ *  dd = new Roo.dd.DragDrop("div1", "group1");
+ * </pre>
+ * Since none of the event handlers have been implemented, nothing would
+ * actually happen if you were to run the code above.  Normally you would
+ * override this class or one of the default implementations, but you can
+ * also override the methods you want on an instance of the class...
+ * <pre>
+ *  dd.onDragDrop = function(e, id) {
+ *  &nbsp;&nbsp;alert("dd was dropped on " + id);
+ *  }
+ * </pre>
+ * @constructor
+ * @param {String} id of the element that is linked to this instance
+ * @param {String} sGroup the group of related DragDrop objects
+ * @param {object} config an object containing configurable attributes
+ *                Valid properties for DragDrop:
+ *                    padding, isTarget, maintainOffset, primaryButtonOnly
+ */
+Roo.dd.DragDrop = function(id, sGroup, config) {
+    if (id) {
+        this.init(id, sGroup, config);
+    }
+};
+
+Roo.dd.DragDrop.prototype = {
+
+    /**
+     * The id of the element associated with this object.  This is what we
+     * refer to as the "linked element" because the size and position of
+     * this element is used to determine when the drag and drop objects have
+     * interacted.
+     * @property id
+     * @type String
+     */
+    id: null,
+
+    /**
+     * Configuration attributes passed into the constructor
+     * @property config
+     * @type object
+     */
+    config: null,
+
+    /**
+     * The id of the element that will be dragged.  By default this is same
+     * as the linked element , but could be changed to another element. Ex:
+     * Roo.dd.DDProxy
+     * @property dragElId
+     * @type String
+     * @private
+     */
+    dragElId: null,
+
+    /**
+     * the id of the element that initiates the drag operation.  By default
+     * this is the linked element, but could be changed to be a child of this
+     * element.  This lets us do things like only starting the drag when the
+     * header element within the linked html element is clicked.
+     * @property handleElId
+     * @type String
+     * @private
+     */
+    handleElId: null,
+
+    /**
+     * An associative array of HTML tags that will be ignored if clicked.
+     * @property invalidHandleTypes
+     * @type {string: string}
+     */
+    invalidHandleTypes: null,
+
+    /**
+     * An associative array of ids for elements that will be ignored if clicked
+     * @property invalidHandleIds
+     * @type {string: string}
+     */
+    invalidHandleIds: null,
+
+    /**
+     * An indexted array of css class names for elements that will be ignored
+     * if clicked.
+     * @property invalidHandleClasses
+     * @type string[]
+     */
+    invalidHandleClasses: null,
+
+    /**
+     * The linked element's absolute X position at the time the drag was
+     * started
+     * @property startPageX
+     * @type int
+     * @private
+     */
+    startPageX: 0,
+
+    /**
+     * The linked element's absolute X position at the time the drag was
+     * started
+     * @property startPageY
+     * @type int
+     * @private
+     */
+    startPageY: 0,
+
+    /**
+     * The group defines a logical collection of DragDrop objects that are
+     * related.  Instances only get events when interacting with other
+     * DragDrop object in the same group.  This lets us define multiple
+     * groups using a single DragDrop subclass if we want.
+     * @property groups
+     * @type {string: string}
+     */
+    groups: null,
+
+    /**
+     * Individual drag/drop instances can be locked.  This will prevent
+     * onmousedown start drag.
+     * @property locked
+     * @type boolean
+     * @private
+     */
+    locked: false,
+
+    /**
+     * Lock this instance
+     * @method lock
+     */
+    lock: function() { this.locked = true; },
+
+    /**
+     * Unlock this instace
+     * @method unlock
+     */
+    unlock: function() { this.locked = false; },
+
+    /**
+     * By default, all insances can be a drop target.  This can be disabled by
+     * setting isTarget to false.
+     * @method isTarget
+     * @type boolean
+     */
+    isTarget: true,
+
+    /**
+     * The padding configured for this drag and drop object for calculating
+     * the drop zone intersection with this object.
+     * @method padding
+     * @type int[]
+     */
+    padding: null,
+
+    /**
+     * Cached reference to the linked element
+     * @property _domRef
+     * @private
+     */
+    _domRef: null,
+
+    /**
+     * Internal typeof flag
+     * @property __ygDragDrop
+     * @private
+     */
+    __ygDragDrop: true,
+
+    /**
+     * Set to true when horizontal contraints are applied
+     * @property constrainX
+     * @type boolean
+     * @private
+     */
+    constrainX: false,
+
+    /**
+     * Set to true when vertical contraints are applied
+     * @property constrainY
+     * @type boolean
+     * @private
+     */
+    constrainY: false,
+
+    /**
+     * The left constraint
+     * @property minX
+     * @type int
+     * @private
+     */
+    minX: 0,
+
+    /**
+     * The right constraint
+     * @property maxX
+     * @type int
+     * @private
+     */
+    maxX: 0,
+
+    /**
+     * The up constraint
+     * @property minY
+     * @type int
+     * @type int
+     * @private
+     */
+    minY: 0,
+
+    /**
+     * The down constraint
+     * @property maxY
+     * @type int
+     * @private
+     */
+    maxY: 0,
+
+    /**
+     * Maintain offsets when we resetconstraints.  Set to true when you want
+     * the position of the element relative to its parent to stay the same
+     * when the page changes
+     *
+     * @property maintainOffset
+     * @type boolean
+     */
+    maintainOffset: false,
+
+    /**
+     * Array of pixel locations the element will snap to if we specified a
+     * horizontal graduation/interval.  This array is generated automatically
+     * when you define a tick interval.
+     * @property xTicks
+     * @type int[]
+     */
+    xTicks: null,
+
+    /**
+     * Array of pixel locations the element will snap to if we specified a
+     * vertical graduation/interval.  This array is generated automatically
+     * when you define a tick interval.
+     * @property yTicks
+     * @type int[]
+     */
+    yTicks: null,
+
+    /**
+     * By default the drag and drop instance will only respond to the primary
+     * button click (left button for a right-handed mouse).  Set to true to
+     * allow drag and drop to start with any mouse click that is propogated
+     * by the browser
+     * @property primaryButtonOnly
+     * @type boolean
+     */
+    primaryButtonOnly: true,
+
+    /**
+     * The availabe property is false until the linked dom element is accessible.
+     * @property available
+     * @type boolean
+     */
+    available: false,
+
+    /**
+     * By default, drags can only be initiated if the mousedown occurs in the
+     * region the linked element is.  This is done in part to work around a
+     * bug in some browsers that mis-report the mousedown if the previous
+     * mouseup happened outside of the window.  This property is set to true
+     * if outer handles are defined.
+     *
+     * @property hasOuterHandles
+     * @type boolean
+     * @default false
+     */
+    hasOuterHandles: false,
+
+    /**
+     * Code that executes immediately before the startDrag event
+     * @method b4StartDrag
+     * @private
+     */
+    b4StartDrag: function(x, y) { },
+
+    /**
+     * Abstract method called after a drag/drop object is clicked
+     * and the drag or mousedown time thresholds have beeen met.
+     * @method startDrag
+     * @param {int} X click location
+     * @param {int} Y click location
+     */
+    startDrag: function(x, y) { /* override this */ },
+
+    /**
+     * Code that executes immediately before the onDrag event
+     * @method b4Drag
+     * @private
+     */
+    b4Drag: function(e) { },
+
+    /**
+     * Abstract method called during the onMouseMove event while dragging an
+     * object.
+     * @method onDrag
+     * @param {Event} e the mousemove event
+     */
+    onDrag: function(e) { /* override this */ },
+
+    /**
+     * Abstract method called when this element fist begins hovering over
+     * another DragDrop obj
+     * @method onDragEnter
+     * @param {Event} e the mousemove event
+     * @param {String|DragDrop[]} id In POINT mode, the element
+     * id this is hovering over.  In INTERSECT mode, an array of one or more
+     * dragdrop items being hovered over.
+     */
+    onDragEnter: function(e, id) { /* override this */ },
+
+    /**
+     * Code that executes immediately before the onDragOver event
+     * @method b4DragOver
+     * @private
+     */
+    b4DragOver: function(e) { },
+
+    /**
+     * Abstract method called when this element is hovering over another
+     * DragDrop obj
+     * @method onDragOver
+     * @param {Event} e the mousemove event
+     * @param {String|DragDrop[]} id In POINT mode, the element
+     * id this is hovering over.  In INTERSECT mode, an array of dd items
+     * being hovered over.
+     */
+    onDragOver: function(e, id) { /* override this */ },
+
+    /**
+     * Code that executes immediately before the onDragOut event
+     * @method b4DragOut
+     * @private
+     */
+    b4DragOut: function(e) { },
+
+    /**
+     * Abstract method called when we are no longer hovering over an element
+     * @method onDragOut
+     * @param {Event} e the mousemove event
+     * @param {String|DragDrop[]} id In POINT mode, the element
+     * id this was hovering over.  In INTERSECT mode, an array of dd items
+     * that the mouse is no longer over.
+     */
+    onDragOut: function(e, id) { /* override this */ },
+
+    /**
+     * Code that executes immediately before the onDragDrop event
+     * @method b4DragDrop
+     * @private
+     */
+    b4DragDrop: function(e) { },
+
+    /**
+     * Abstract method called when this item is dropped on another DragDrop
+     * obj
+     * @method onDragDrop
+     * @param {Event} e the mouseup event
+     * @param {String|DragDrop[]} id In POINT mode, the element
+     * id this was dropped on.  In INTERSECT mode, an array of dd items this
+     * was dropped on.
+     */
+    onDragDrop: function(e, id) { /* override this */ },
+
+    /**
+     * Abstract method called when this item is dropped on an area with no
+     * drop target
+     * @method onInvalidDrop
+     * @param {Event} e the mouseup event
+     */
+    onInvalidDrop: function(e) { /* override this */ },
+
+    /**
+     * Code that executes immediately before the endDrag event
+     * @method b4EndDrag
+     * @private
+     */
+    b4EndDrag: function(e) { },
+
+    /**
+     * Fired when we are done dragging the object
+     * @method endDrag
+     * @param {Event} e the mouseup event
+     */
+    endDrag: function(e) { /* override this */ },
+
+    /**
+     * Code executed immediately before the onMouseDown event
+     * @method b4MouseDown
+     * @param {Event} e the mousedown event
+     * @private
+     */
+    b4MouseDown: function(e) {  },
+
+    /**
+     * Event handler that fires when a drag/drop obj gets a mousedown
+     * @method onMouseDown
+     * @param {Event} e the mousedown event
+     */
+    onMouseDown: function(e) { /* override this */ },
+
+    /**
+     * Event handler that fires when a drag/drop obj gets a mouseup
+     * @method onMouseUp
+     * @param {Event} e the mouseup event
+     */
+    onMouseUp: function(e) { /* override this */ },
+
+    /**
+     * Override the onAvailable method to do what is needed after the initial
+     * position was determined.
+     * @method onAvailable
+     */
+    onAvailable: function () {
+    },
+
+    /*
+     * Provides default constraint padding to "constrainTo" elements (defaults to {left: 0, right:0, top:0, bottom:0}).
+     * @type Object
+     */
+    defaultPadding : {left:0, right:0, top:0, bottom:0},
+
+    /*
+     * Initializes the drag drop object's constraints to restrict movement to a certain element.
+ *
+ * Usage:
+ <pre><code>
+ var dd = new Roo.dd.DDProxy("dragDiv1", "proxytest",
+                { dragElId: "existingProxyDiv" });
+ dd.startDrag = function(){
+     this.constrainTo("parent-id");
+ };
+ </code></pre>
+ * Or you can initalize it using the {@link Roo.Element} object:
+ <pre><code>
+ Roo.get("dragDiv1").initDDProxy("proxytest", {dragElId: "existingProxyDiv"}, {
+     startDrag : function(){
+         this.constrainTo("parent-id");
+     }
+ });
+ </code></pre>
+     * @param {String/HTMLElement/Element} constrainTo The element to constrain to.
+     * @param {Object/Number} pad (optional) Pad provides a way to specify "padding" of the constraints,
+     * and can be either a number for symmetrical padding (4 would be equal to {left:4, right:4, top:4, bottom:4}) or
+     * an object containing the sides to pad. For example: {right:10, bottom:10}
+     * @param {Boolean} inContent (optional) Constrain the draggable in the content box of the element (inside padding and borders)
+     */
+    constrainTo : function(constrainTo, pad, inContent){
+        if(typeof pad == "number"){
+            pad = {left: pad, right:pad, top:pad, bottom:pad};
+        }
+        pad = pad || this.defaultPadding;
+        var b = Roo.get(this.getEl()).getBox();
+        var ce = Roo.get(constrainTo);
+        var s = ce.getScroll();
+        var c, cd = ce.dom;
+        if(cd == document.body){
+            c = { x: s.left, y: s.top, width: Roo.lib.Dom.getViewWidth(), height: Roo.lib.Dom.getViewHeight()};
+        }else{
+            xy = ce.getXY();
+            c = {x : xy[0]+s.left, y: xy[1]+s.top, width: cd.clientWidth, height: cd.clientHeight};
+        }
+
+
+        var topSpace = b.y - c.y;
+        var leftSpace = b.x - c.x;
+
+        this.resetConstraints();
+        this.setXConstraint(leftSpace - (pad.left||0), // left
+                c.width - leftSpace - b.width - (pad.right||0) //right
+        );
+        this.setYConstraint(topSpace - (pad.top||0), //top
+                c.height - topSpace - b.height - (pad.bottom||0) //bottom
+        );
+    },
+
+    /**
+     * Returns a reference to the linked element
+     * @method getEl
+     * @return {HTMLElement} the html element
+     */
+    getEl: function() {
+        if (!this._domRef) {
+            this._domRef = Roo.getDom(this.id);
+        }
+
+        return this._domRef;
+    },
+
+    /**
+     * Returns a reference to the actual element to drag.  By default this is
+     * the same as the html element, but it can be assigned to another
+     * element. An example of this can be found in Roo.dd.DDProxy
+     * @method getDragEl
+     * @return {HTMLElement} the html element
+     */
+    getDragEl: function() {
+        return Roo.getDom(this.dragElId);
+    },
+
+    /**
+     * Sets up the DragDrop object.  Must be called in the constructor of any
+     * Roo.dd.DragDrop subclass
+     * @method init
+     * @param id the id of the linked element
+     * @param {String} sGroup the group of related items
+     * @param {object} config configuration attributes
+     */
+    init: function(id, sGroup, config) {
+        this.initTarget(id, sGroup, config);
+        Event.on(this.id, "mousedown", this.handleMouseDown, this);
+        // Event.on(this.id, "selectstart", Event.preventDefault);
+    },
+
+    /**
+     * Initializes Targeting functionality only... the object does not
+     * get a mousedown handler.
+     * @method initTarget
+     * @param id the id of the linked element
+     * @param {String} sGroup the group of related items
+     * @param {object} config configuration attributes
+     */
+    initTarget: function(id, sGroup, config) {
+
+        // configuration attributes
+        this.config = config || {};
+
+        // create a local reference to the drag and drop manager
+        this.DDM = Roo.dd.DDM;
+        // initialize the groups array
+        this.groups = {};
+
+        // assume that we have an element reference instead of an id if the
+        // parameter is not a string
+        if (typeof id !== "string") {
+            id = Roo.id(id);
+        }
+
+        // set the id
+        this.id = id;
+
+        // add to an interaction group
+        this.addToGroup((sGroup) ? sGroup : "default");
+
+        // We don't want to register this as the handle with the manager
+        // so we just set the id rather than calling the setter.
+        this.handleElId = id;
+
+        // the linked element is the element that gets dragged by default
+        this.setDragElId(id);
+
+        // by default, clicked anchors will not start drag operations.
+        this.invalidHandleTypes = { A: "A" };
+        this.invalidHandleIds = {};
+        this.invalidHandleClasses = [];
+
+        this.applyConfig();
+
+        this.handleOnAvailable();
+    },
+
+    /**
+     * Applies the configuration parameters that were passed into the constructor.
+     * This is supposed to happen at each level through the inheritance chain.  So
+     * a DDProxy implentation will execute apply config on DDProxy, DD, and
+     * DragDrop in order to get all of the parameters that are available in
+     * each object.
+     * @method applyConfig
+     */
+    applyConfig: function() {
+
+        // configurable properties:
+        //    padding, isTarget, maintainOffset, primaryButtonOnly
+        this.padding           = this.config.padding || [0, 0, 0, 0];
+        this.isTarget          = (this.config.isTarget !== false);
+        this.maintainOffset    = (this.config.maintainOffset);
+        this.primaryButtonOnly = (this.config.primaryButtonOnly !== false);
+
+    },
+
+    /**
+     * Executed when the linked element is available
+     * @method handleOnAvailable
+     * @private
+     */
+    handleOnAvailable: function() {
+        this.available = true;
+        this.resetConstraints();
+        this.onAvailable();
+    },
+
+     /**
+     * Configures the padding for the target zone in px.  Effectively expands
+     * (or reduces) the virtual object size for targeting calculations.
+     * Supports css-style shorthand; if only one parameter is passed, all sides
+     * will have that padding, and if only two are passed, the top and bottom
+     * will have the first param, the left and right the second.
+     * @method setPadding
+     * @param {int} iTop    Top pad
+     * @param {int} iRight  Right pad
+     * @param {int} iBot    Bot pad
+     * @param {int} iLeft   Left pad
+     */
+    setPadding: function(iTop, iRight, iBot, iLeft) {
+        // this.padding = [iLeft, iRight, iTop, iBot];
+        if (!iRight && 0 !== iRight) {
+            this.padding = [iTop, iTop, iTop, iTop];
+        } else if (!iBot && 0 !== iBot) {
+            this.padding = [iTop, iRight, iTop, iRight];
+        } else {
+            this.padding = [iTop, iRight, iBot, iLeft];
+        }
+    },
+
+    /**
+     * Stores the initial placement of the linked element.
+     * @method setInitialPosition
+     * @param {int} diffX   the X offset, default 0
+     * @param {int} diffY   the Y offset, default 0
+     */
+    setInitPosition: function(diffX, diffY) {
+        var el = this.getEl();
+
+        if (!this.DDM.verifyEl(el)) {
+            return;
+        }
+
+        var dx = diffX || 0;
+        var dy = diffY || 0;
+
+        var p = Dom.getXY( el );
+
+        this.initPageX = p[0] - dx;
+        this.initPageY = p[1] - dy;
+
+        this.lastPageX = p[0];
+        this.lastPageY = p[1];
+
+
+        this.setStartPosition(p);
+    },
+
+    /**
+     * Sets the start position of the element.  This is set when the obj
+     * is initialized, the reset when a drag is started.
+     * @method setStartPosition
+     * @param pos current position (from previous lookup)
+     * @private
+     */
+    setStartPosition: function(pos) {
+        var p = pos || Dom.getXY( this.getEl() );
+        this.deltaSetXY = null;
+
+        this.startPageX = p[0];
+        this.startPageY = p[1];
+    },
+
+    /**
+     * Add this instance to a group of related drag/drop objects.  All
+     * instances belong to at least one group, and can belong to as many
+     * groups as needed.
+     * @method addToGroup
+     * @param sGroup {string} the name of the group
+     */
+    addToGroup: function(sGroup) {
+        this.groups[sGroup] = true;
+        this.DDM.regDragDrop(this, sGroup);
+    },
+
+    /**
+     * Remove's this instance from the supplied interaction group
+     * @method removeFromGroup
+     * @param {string}  sGroup  The group to drop
+     */
+    removeFromGroup: function(sGroup) {
+        if (this.groups[sGroup]) {
+            delete this.groups[sGroup];
+        }
+
+        this.DDM.removeDDFromGroup(this, sGroup);
+    },
+
+    /**
+     * Allows you to specify that an element other than the linked element
+     * will be moved with the cursor during a drag
+     * @method setDragElId
+     * @param id {string} the id of the element that will be used to initiate the drag
+     */
+    setDragElId: function(id) {
+        this.dragElId = id;
+    },
+
+    /**
+     * Allows you to specify a child of the linked element that should be
+     * used to initiate the drag operation.  An example of this would be if
+     * you have a content div with text and links.  Clicking anywhere in the
+     * content area would normally start the drag operation.  Use this method
+     * to specify that an element inside of the content div is the element
+     * that starts the drag operation.
+     * @method setHandleElId
+     * @param id {string} the id of the element that will be used to
+     * initiate the drag.
+     */
+    setHandleElId: function(id) {
+        if (typeof id !== "string") {
+            id = Roo.id(id);
+        }
+        this.handleElId = id;
+        this.DDM.regHandle(this.id, id);
+    },
+
+    /**
+     * Allows you to set an element outside of the linked element as a drag
+     * handle
+     * @method setOuterHandleElId
+     * @param id the id of the element that will be used to initiate the drag
+     */
+    setOuterHandleElId: function(id) {
+        if (typeof id !== "string") {
+            id = Roo.id(id);
+        }
+        Event.on(id, "mousedown",
+                this.handleMouseDown, this);
+        this.setHandleElId(id);
+
+        this.hasOuterHandles = true;
+    },
+
+    /**
+     * Remove all drag and drop hooks for this element
+     * @method unreg
+     */
+    unreg: function() {
+        Event.un(this.id, "mousedown",
+                this.handleMouseDown);
+        this._domRef = null;
+        this.DDM._remove(this);
+    },
+
+    destroy : function(){
+        this.unreg();
+    },
+
+    /**
+     * Returns true if this instance is locked, or the drag drop mgr is locked
+     * (meaning that all drag/drop is disabled on the page.)
+     * @method isLocked
+     * @return {boolean} true if this obj or all drag/drop is locked, else
+     * false
+     */
+    isLocked: function() {
+        return (this.DDM.isLocked() || this.locked);
+    },
+
+    /**
+     * Fired when this object is clicked
+     * @method handleMouseDown
+     * @param {Event} e
+     * @param {Roo.dd.DragDrop} oDD the clicked dd object (this dd obj)
+     * @private
+     */
+    handleMouseDown: function(e, oDD){
+        if (this.primaryButtonOnly && e.button != 0) {
+            return;
+        }
+
+        if (this.isLocked()) {
+            return;
+        }
+
+        this.DDM.refreshCache(this.groups);
+
+        var pt = new Roo.lib.Point(Roo.lib.Event.getPageX(e), Roo.lib.Event.getPageY(e));
+        if (!this.hasOuterHandles && !this.DDM.isOverTarget(pt, this) )  {
+        } else {
+            if (this.clickValidator(e)) {
+
+                // set the initial element position
+                this.setStartPosition();
+
+
+                this.b4MouseDown(e);
+                this.onMouseDown(e);
+
+                this.DDM.handleMouseDown(e, this);
+
+                this.DDM.stopEvent(e);
+            } else {
+
+
+            }
+        }
+    },
+
+    clickValidator: function(e) {
+        var target = e.getTarget();
+        return ( this.isValidHandleChild(target) &&
+                    (this.id == this.handleElId ||
+                        this.DDM.handleWasClicked(target, this.id)) );
+    },
+
+    /**
+     * Allows you to specify a tag name that should not start a drag operation
+     * when clicked.  This is designed to facilitate embedding links within a
+     * drag handle that do something other than start the drag.
+     * @method addInvalidHandleType
+     * @param {string} tagName the type of element to exclude
+     */
+    addInvalidHandleType: function(tagName) {
+        var type = tagName.toUpperCase();
+        this.invalidHandleTypes[type] = type;
+    },
+
+    /**
+     * Lets you to specify an element id for a child of a drag handle
+     * that should not initiate a drag
+     * @method addInvalidHandleId
+     * @param {string} id the element id of the element you wish to ignore
+     */
+    addInvalidHandleId: function(id) {
+        if (typeof id !== "string") {
+            id = Roo.id(id);
+        }
+        this.invalidHandleIds[id] = id;
+    },
+
+    /**
+     * Lets you specify a css class of elements that will not initiate a drag
+     * @method addInvalidHandleClass
+     * @param {string} cssClass the class of the elements you wish to ignore
+     */
+    addInvalidHandleClass: function(cssClass) {
+        this.invalidHandleClasses.push(cssClass);
+    },
+
+    /**
+     * Unsets an excluded tag name set by addInvalidHandleType
+     * @method removeInvalidHandleType
+     * @param {string} tagName the type of element to unexclude
+     */
+    removeInvalidHandleType: function(tagName) {
+        var type = tagName.toUpperCase();
+        // this.invalidHandleTypes[type] = null;
+        delete this.invalidHandleTypes[type];
+    },
+
+    /**
+     * Unsets an invalid handle id
+     * @method removeInvalidHandleId
+     * @param {string} id the id of the element to re-enable
+     */
+    removeInvalidHandleId: function(id) {
+        if (typeof id !== "string") {
+            id = Roo.id(id);
+        }
+        delete this.invalidHandleIds[id];
+    },
+
+    /**
+     * Unsets an invalid css class
+     * @method removeInvalidHandleClass
+     * @param {string} cssClass the class of the element(s) you wish to
+     * re-enable
+     */
+    removeInvalidHandleClass: function(cssClass) {
+        for (var i=0, len=this.invalidHandleClasses.length; i<len; ++i) {
+            if (this.invalidHandleClasses[i] == cssClass) {
+                delete this.invalidHandleClasses[i];
+            }
+        }
+    },
+
+    /**
+     * Checks the tag exclusion list to see if this click should be ignored
+     * @method isValidHandleChild
+     * @param {HTMLElement} node the HTMLElement to evaluate
+     * @return {boolean} true if this is a valid tag type, false if not
+     */
+    isValidHandleChild: function(node) {
+
+        var valid = true;
+        // var n = (node.nodeName == "#text") ? node.parentNode : node;
+        var nodeName;
+        try {
+            nodeName = node.nodeName.toUpperCase();
+        } catch(e) {
+            nodeName = node.nodeName;
+        }
+        valid = valid && !this.invalidHandleTypes[nodeName];
+        valid = valid && !this.invalidHandleIds[node.id];
+
+        for (var i=0, len=this.invalidHandleClasses.length; valid && i<len; ++i) {
+            valid = !Dom.hasClass(node, this.invalidHandleClasses[i]);
+        }
+
+
+        return valid;
+
+    },
+
+    /**
+     * Create the array of horizontal tick marks if an interval was specified
+     * in setXConstraint().
+     * @method setXTicks
+     * @private
+     */
+    setXTicks: function(iStartX, iTickSize) {
+        this.xTicks = [];
+        this.xTickSize = iTickSize;
+
+        var tickMap = {};
+
+        for (var i = this.initPageX; i >= this.minX; i = i - iTickSize) {
+            if (!tickMap[i]) {
+                this.xTicks[this.xTicks.length] = i;
+                tickMap[i] = true;
+            }
+        }
+
+        for (i = this.initPageX; i <= this.maxX; i = i + iTickSize) {
+            if (!tickMap[i]) {
+                this.xTicks[this.xTicks.length] = i;
+                tickMap[i] = true;
+            }
+        }
+
+        this.xTicks.sort(this.DDM.numericSort) ;
+    },
+
+    /**
+     * Create the array of vertical tick marks if an interval was specified in
+     * setYConstraint().
+     * @method setYTicks
+     * @private
+     */
+    setYTicks: function(iStartY, iTickSize) {
+        this.yTicks = [];
+        this.yTickSize = iTickSize;
+
+        var tickMap = {};
+
+        for (var i = this.initPageY; i >= this.minY; i = i - iTickSize) {
+            if (!tickMap[i]) {
+                this.yTicks[this.yTicks.length] = i;
+                tickMap[i] = true;
+            }
+        }
+
+        for (i = this.initPageY; i <= this.maxY; i = i + iTickSize) {
+            if (!tickMap[i]) {
+                this.yTicks[this.yTicks.length] = i;
+                tickMap[i] = true;
+            }
+        }
+
+        this.yTicks.sort(this.DDM.numericSort) ;
+    },
+
+    /**
+     * By default, the element can be dragged any place on the screen.  Use
+     * this method to limit the horizontal travel of the element.  Pass in
+     * 0,0 for the parameters if you want to lock the drag to the y axis.
+     * @method setXConstraint
+     * @param {int} iLeft the number of pixels the element can move to the left
+     * @param {int} iRight the number of pixels the element can move to the
+     * right
+     * @param {int} iTickSize optional parameter for specifying that the
+     * element
+     * should move iTickSize pixels at a time.
+     */
+    setXConstraint: function(iLeft, iRight, iTickSize) {
+        this.leftConstraint = iLeft;
+        this.rightConstraint = iRight;
+
+        this.minX = this.initPageX - iLeft;
+        this.maxX = this.initPageX + iRight;
+        if (iTickSize) { this.setXTicks(this.initPageX, iTickSize); }
+
+        this.constrainX = true;
+    },
+
+    /**
+     * Clears any constraints applied to this instance.  Also clears ticks
+     * since they can't exist independent of a constraint at this time.
+     * @method clearConstraints
+     */
+    clearConstraints: function() {
+        this.constrainX = false;
+        this.constrainY = false;
+        this.clearTicks();
+    },
+
+    /**
+     * Clears any tick interval defined for this instance
+     * @method clearTicks
+     */
+    clearTicks: function() {
+        this.xTicks = null;
+        this.yTicks = null;
+        this.xTickSize = 0;
+        this.yTickSize = 0;
+    },
+
+    /**
+     * By default, the element can be dragged any place on the screen.  Set
+     * this to limit the vertical travel of the element.  Pass in 0,0 for the
+     * parameters if you want to lock the drag to the x axis.
+     * @method setYConstraint
+     * @param {int} iUp the number of pixels the element can move up
+     * @param {int} iDown the number of pixels the element can move down
+     * @param {int} iTickSize optional parameter for specifying that the
+     * element should move iTickSize pixels at a time.
+     */
+    setYConstraint: function(iUp, iDown, iTickSize) {
+        this.topConstraint = iUp;
+        this.bottomConstraint = iDown;
+
+        this.minY = this.initPageY - iUp;
+        this.maxY = this.initPageY + iDown;
+        if (iTickSize) { this.setYTicks(this.initPageY, iTickSize); }
+
+        this.constrainY = true;
+
+    },
+
+    /**
+     * resetConstraints must be called if you manually reposition a dd element.
+     * @method resetConstraints
+     * @param {boolean} maintainOffset
+     */
+    resetConstraints: function() {
+
+
+        // Maintain offsets if necessary
+        if (this.initPageX || this.initPageX === 0) {
+            // figure out how much this thing has moved
+            var dx = (this.maintainOffset) ? this.lastPageX - this.initPageX : 0;
+            var dy = (this.maintainOffset) ? this.lastPageY - this.initPageY : 0;
+
+            this.setInitPosition(dx, dy);
+
+        // This is the first time we have detected the element's position
+        } else {
+            this.setInitPosition();
+        }
+
+        if (this.constrainX) {
+            this.setXConstraint( this.leftConstraint,
+                                 this.rightConstraint,
+                                 this.xTickSize        );
+        }
+
+        if (this.constrainY) {
+            this.setYConstraint( this.topConstraint,
+                                 this.bottomConstraint,
+                                 this.yTickSize         );
+        }
+    },
+
+    /**
+     * Normally the drag element is moved pixel by pixel, but we can specify
+     * that it move a number of pixels at a time.  This method resolves the
+     * location when we have it set up like this.
+     * @method getTick
+     * @param {int} val where we want to place the object
+     * @param {int[]} tickArray sorted array of valid points
+     * @return {int} the closest tick
+     * @private
+     */
+    getTick: function(val, tickArray) {
+
+        if (!tickArray) {
+            // If tick interval is not defined, it is effectively 1 pixel,
+            // so we return the value passed to us.
+            return val;
+        } else if (tickArray[0] >= val) {
+            // The value is lower than the first tick, so we return the first
+            // tick.
+            return tickArray[0];
+        } else {
+            for (var i=0, len=tickArray.length; i<len; ++i) {
+                var next = i + 1;
+                if (tickArray[next] && tickArray[next] >= val) {
+                    var diff1 = val - tickArray[i];
+                    var diff2 = tickArray[next] - val;
+                    return (diff2 > diff1) ? tickArray[i] : tickArray[next];
+                }
+            }
+
+            // The value is larger than the last tick, so we return the last
+            // tick.
+            return tickArray[tickArray.length - 1];
+        }
+    },
+
+    /**
+     * toString method
+     * @method toString
+     * @return {string} string representation of the dd obj
+     */
+    toString: function() {
+        return ("DragDrop " + this.id);
+    }
+
+};
+
+})();
diff --git a/Roo/dd/DragDropMgr.js b/Roo/dd/DragDropMgr.js
new file mode 100644 (file)
index 0000000..32c1f08
--- /dev/null
@@ -0,0 +1,1304 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+
+
+/**
+ * The drag and drop utility provides a framework for building drag and drop
+ * applications.  In addition to enabling drag and drop for specific elements,
+ * the drag and drop elements are tracked by the manager class, and the
+ * interactions between the various elements are tracked during the drag and
+ * the implementing code is notified about these important moments.
+ */
+
+// Only load the library once.  Rewriting the manager class would orphan
+// existing drag and drop instances.
+if (!Roo.dd.DragDropMgr) {
+
+/**
+ * @class Roo.dd.DragDropMgr
+ * DragDropMgr is a singleton that tracks the element interaction for
+ * all DragDrop items in the window.  Generally, you will not call
+ * this class directly, but it does have helper methods that could
+ * be useful in your DragDrop implementations.
+ * @singleton
+ */
+Roo.dd.DragDropMgr = function() {
+
+    var Event = Roo.EventManager;
+
+    return {
+
+        /**
+         * Two dimensional Array of registered DragDrop objects.  The first
+         * dimension is the DragDrop item group, the second the DragDrop
+         * object.
+         * @property ids
+         * @type {string: string}
+         * @private
+         * @static
+         */
+        ids: {},
+
+        /**
+         * Array of element ids defined as drag handles.  Used to determine
+         * if the element that generated the mousedown event is actually the
+         * handle and not the html element itself.
+         * @property handleIds
+         * @type {string: string}
+         * @private
+         * @static
+         */
+        handleIds: {},
+
+        /**
+         * the DragDrop object that is currently being dragged
+         * @property dragCurrent
+         * @type DragDrop
+         * @private
+         * @static
+         **/
+        dragCurrent: null,
+
+        /**
+         * the DragDrop object(s) that are being hovered over
+         * @property dragOvers
+         * @type Array
+         * @private
+         * @static
+         */
+        dragOvers: {},
+
+        /**
+         * the X distance between the cursor and the object being dragged
+         * @property deltaX
+         * @type int
+         * @private
+         * @static
+         */
+        deltaX: 0,
+
+        /**
+         * the Y distance between the cursor and the object being dragged
+         * @property deltaY
+         * @type int
+         * @private
+         * @static
+         */
+        deltaY: 0,
+
+        /**
+         * Flag to determine if we should prevent the default behavior of the
+         * events we define. By default this is true, but this can be set to
+         * false if you need the default behavior (not recommended)
+         * @property preventDefault
+         * @type boolean
+         * @static
+         */
+        preventDefault: true,
+
+        /**
+         * Flag to determine if we should stop the propagation of the events
+         * we generate. This is true by default but you may want to set it to
+         * false if the html element contains other features that require the
+         * mouse click.
+         * @property stopPropagation
+         * @type boolean
+         * @static
+         */
+        stopPropagation: true,
+
+        /**
+         * Internal flag that is set to true when drag and drop has been
+         * intialized
+         * @property initialized
+         * @private
+         * @static
+         */
+        initalized: false,
+
+        /**
+         * All drag and drop can be disabled.
+         * @property locked
+         * @private
+         * @static
+         */
+        locked: false,
+
+        /**
+         * Called the first time an element is registered.
+         * @method init
+         * @private
+         * @static
+         */
+        init: function() {
+            this.initialized = true;
+        },
+
+        /**
+         * In point mode, drag and drop interaction is defined by the
+         * location of the cursor during the drag/drop
+         * @property POINT
+         * @type int
+         * @static
+         */
+        POINT: 0,
+
+        /**
+         * In intersect mode, drag and drop interactio nis defined by the
+         * overlap of two or more drag and drop objects.
+         * @property INTERSECT
+         * @type int
+         * @static
+         */
+        INTERSECT: 1,
+
+        /**
+         * The current drag and drop mode.  Default: POINT
+         * @property mode
+         * @type int
+         * @static
+         */
+        mode: 0,
+
+        /**
+         * Runs method on all drag and drop objects
+         * @method _execOnAll
+         * @private
+         * @static
+         */
+        _execOnAll: function(sMethod, args) {
+            for (var i in this.ids) {
+                for (var j in this.ids[i]) {
+                    var oDD = this.ids[i][j];
+                    if (! this.isTypeOfDD(oDD)) {
+                        continue;
+                    }
+                    oDD[sMethod].apply(oDD, args);
+                }
+            }
+        },
+
+        /**
+         * Drag and drop initialization.  Sets up the global event handlers
+         * @method _onLoad
+         * @private
+         * @static
+         */
+        _onLoad: function() {
+
+            this.init();
+
+
+            Event.on(document, "mouseup",   this.handleMouseUp, this, true);
+            Event.on(document, "mousemove", this.handleMouseMove, this, true);
+            Event.on(window,   "unload",    this._onUnload, this, true);
+            Event.on(window,   "resize",    this._onResize, this, true);
+            // Event.on(window,   "mouseout",    this._test);
+
+        },
+
+        /**
+         * Reset constraints on all drag and drop objs
+         * @method _onResize
+         * @private
+         * @static
+         */
+        _onResize: function(e) {
+            this._execOnAll("resetConstraints", []);
+        },
+
+        /**
+         * Lock all drag and drop functionality
+         * @method lock
+         * @static
+         */
+        lock: function() { this.locked = true; },
+
+        /**
+         * Unlock all drag and drop functionality
+         * @method unlock
+         * @static
+         */
+        unlock: function() { this.locked = false; },
+
+        /**
+         * Is drag and drop locked?
+         * @method isLocked
+         * @return {boolean} True if drag and drop is locked, false otherwise.
+         * @static
+         */
+        isLocked: function() { return this.locked; },
+
+        /**
+         * Location cache that is set for all drag drop objects when a drag is
+         * initiated, cleared when the drag is finished.
+         * @property locationCache
+         * @private
+         * @static
+         */
+        locationCache: {},
+
+        /**
+         * Set useCache to false if you want to force object the lookup of each
+         * drag and drop linked element constantly during a drag.
+         * @property useCache
+         * @type boolean
+         * @static
+         */
+        useCache: true,
+
+        /**
+         * The number of pixels that the mouse needs to move after the
+         * mousedown before the drag is initiated.  Default=3;
+         * @property clickPixelThresh
+         * @type int
+         * @static
+         */
+        clickPixelThresh: 3,
+
+        /**
+         * The number of milliseconds after the mousedown event to initiate the
+         * drag if we don't get a mouseup event. Default=1000
+         * @property clickTimeThresh
+         * @type int
+         * @static
+         */
+        clickTimeThresh: 350,
+
+        /**
+         * Flag that indicates that either the drag pixel threshold or the
+         * mousdown time threshold has been met
+         * @property dragThreshMet
+         * @type boolean
+         * @private
+         * @static
+         */
+        dragThreshMet: false,
+
+        /**
+         * Timeout used for the click time threshold
+         * @property clickTimeout
+         * @type Object
+         * @private
+         * @static
+         */
+        clickTimeout: null,
+
+        /**
+         * The X position of the mousedown event stored for later use when a
+         * drag threshold is met.
+         * @property startX
+         * @type int
+         * @private
+         * @static
+         */
+        startX: 0,
+
+        /**
+         * The Y position of the mousedown event stored for later use when a
+         * drag threshold is met.
+         * @property startY
+         * @type int
+         * @private
+         * @static
+         */
+        startY: 0,
+
+        /**
+         * Each DragDrop instance must be registered with the DragDropMgr.
+         * This is executed in DragDrop.init()
+         * @method regDragDrop
+         * @param {DragDrop} oDD the DragDrop object to register
+         * @param {String} sGroup the name of the group this element belongs to
+         * @static
+         */
+        regDragDrop: function(oDD, sGroup) {
+            if (!this.initialized) { this.init(); }
+
+            if (!this.ids[sGroup]) {
+                this.ids[sGroup] = {};
+            }
+            this.ids[sGroup][oDD.id] = oDD;
+        },
+
+        /**
+         * Removes the supplied dd instance from the supplied group. Executed
+         * by DragDrop.removeFromGroup, so don't call this function directly.
+         * @method removeDDFromGroup
+         * @private
+         * @static
+         */
+        removeDDFromGroup: function(oDD, sGroup) {
+            if (!this.ids[sGroup]) {
+                this.ids[sGroup] = {};
+            }
+
+            var obj = this.ids[sGroup];
+            if (obj && obj[oDD.id]) {
+                delete obj[oDD.id];
+            }
+        },
+
+        /**
+         * Unregisters a drag and drop item.  This is executed in
+         * DragDrop.unreg, use that method instead of calling this directly.
+         * @method _remove
+         * @private
+         * @static
+         */
+        _remove: function(oDD) {
+            for (var g in oDD.groups) {
+                if (g && this.ids[g][oDD.id]) {
+                    delete this.ids[g][oDD.id];
+                }
+            }
+            delete this.handleIds[oDD.id];
+        },
+
+        /**
+         * Each DragDrop handle element must be registered.  This is done
+         * automatically when executing DragDrop.setHandleElId()
+         * @method regHandle
+         * @param {String} sDDId the DragDrop id this element is a handle for
+         * @param {String} sHandleId the id of the element that is the drag
+         * handle
+         * @static
+         */
+        regHandle: function(sDDId, sHandleId) {
+            if (!this.handleIds[sDDId]) {
+                this.handleIds[sDDId] = {};
+            }
+            this.handleIds[sDDId][sHandleId] = sHandleId;
+        },
+
+        /**
+         * Utility function to determine if a given element has been
+         * registered as a drag drop item.
+         * @method isDragDrop
+         * @param {String} id the element id to check
+         * @return {boolean} true if this element is a DragDrop item,
+         * false otherwise
+         * @static
+         */
+        isDragDrop: function(id) {
+            return ( this.getDDById(id) ) ? true : false;
+        },
+
+        /**
+         * Returns the drag and drop instances that are in all groups the
+         * passed in instance belongs to.
+         * @method getRelated
+         * @param {DragDrop} p_oDD the obj to get related data for
+         * @param {boolean} bTargetsOnly if true, only return targetable objs
+         * @return {DragDrop[]} the related instances
+         * @static
+         */
+        getRelated: function(p_oDD, bTargetsOnly) {
+            var oDDs = [];
+            for (var i in p_oDD.groups) {
+                for (j in this.ids[i]) {
+                    var dd = this.ids[i][j];
+                    if (! this.isTypeOfDD(dd)) {
+                        continue;
+                    }
+                    if (!bTargetsOnly || dd.isTarget) {
+                        oDDs[oDDs.length] = dd;
+                    }
+                }
+            }
+
+            return oDDs;
+        },
+
+        /**
+         * Returns true if the specified dd target is a legal target for
+         * the specifice drag obj
+         * @method isLegalTarget
+         * @param {DragDrop} the drag obj
+         * @param {DragDrop} the target
+         * @return {boolean} true if the target is a legal target for the
+         * dd obj
+         * @static
+         */
+        isLegalTarget: function (oDD, oTargetDD) {
+            var targets = this.getRelated(oDD, true);
+            for (var i=0, len=targets.length;i<len;++i) {
+                if (targets[i].id == oTargetDD.id) {
+                    return true;
+                }
+            }
+
+            return false;
+        },
+
+        /**
+         * My goal is to be able to transparently determine if an object is
+         * typeof DragDrop, and the exact subclass of DragDrop.  typeof
+         * returns "object", oDD.constructor.toString() always returns
+         * "DragDrop" and not the name of the subclass.  So for now it just
+         * evaluates a well-known variable in DragDrop.
+         * @method isTypeOfDD
+         * @param {Object} the object to evaluate
+         * @return {boolean} true if typeof oDD = DragDrop
+         * @static
+         */
+        isTypeOfDD: function (oDD) {
+            return (oDD && oDD.__ygDragDrop);
+        },
+
+        /**
+         * Utility function to determine if a given element has been
+         * registered as a drag drop handle for the given Drag Drop object.
+         * @method isHandle
+         * @param {String} id the element id to check
+         * @return {boolean} true if this element is a DragDrop handle, false
+         * otherwise
+         * @static
+         */
+        isHandle: function(sDDId, sHandleId) {
+            return ( this.handleIds[sDDId] &&
+                            this.handleIds[sDDId][sHandleId] );
+        },
+
+        /**
+         * Returns the DragDrop instance for a given id
+         * @method getDDById
+         * @param {String} id the id of the DragDrop object
+         * @return {DragDrop} the drag drop object, null if it is not found
+         * @static
+         */
+        getDDById: function(id) {
+            for (var i in this.ids) {
+                if (this.ids[i][id]) {
+                    return this.ids[i][id];
+                }
+            }
+            return null;
+        },
+
+        /**
+         * Fired after a registered DragDrop object gets the mousedown event.
+         * Sets up the events required to track the object being dragged
+         * @method handleMouseDown
+         * @param {Event} e the event
+         * @param oDD the DragDrop object being dragged
+         * @private
+         * @static
+         */
+        handleMouseDown: function(e, oDD) {
+            if(Roo.QuickTips){
+                Roo.QuickTips.disable();
+            }
+            this.currentTarget = e.getTarget();
+
+            this.dragCurrent = oDD;
+
+            var el = oDD.getEl();
+
+            // track start position
+            this.startX = e.getPageX();
+            this.startY = e.getPageY();
+
+            this.deltaX = this.startX - el.offsetLeft;
+            this.deltaY = this.startY - el.offsetTop;
+
+            this.dragThreshMet = false;
+
+            this.clickTimeout = setTimeout(
+                    function() {
+                        var DDM = Roo.dd.DDM;
+                        DDM.startDrag(DDM.startX, DDM.startY);
+                    },
+                    this.clickTimeThresh );
+        },
+
+        /**
+         * Fired when either the drag pixel threshol or the mousedown hold
+         * time threshold has been met.
+         * @method startDrag
+         * @param x {int} the X position of the original mousedown
+         * @param y {int} the Y position of the original mousedown
+         * @static
+         */
+        startDrag: function(x, y) {
+            clearTimeout(this.clickTimeout);
+            if (this.dragCurrent) {
+                this.dragCurrent.b4StartDrag(x, y);
+                this.dragCurrent.startDrag(x, y);
+            }
+            this.dragThreshMet = true;
+        },
+
+        /**
+         * Internal function to handle the mouseup event.  Will be invoked
+         * from the context of the document.
+         * @method handleMouseUp
+         * @param {Event} e the event
+         * @private
+         * @static
+         */
+        handleMouseUp: function(e) {
+
+            if(Roo.QuickTips){
+                Roo.QuickTips.enable();
+            }
+            if (! this.dragCurrent) {
+                return;
+            }
+
+            clearTimeout(this.clickTimeout);
+
+            if (this.dragThreshMet) {
+                this.fireEvents(e, true);
+            } else {
+            }
+
+            this.stopDrag(e);
+
+            this.stopEvent(e);
+        },
+
+        /**
+         * Utility to stop event propagation and event default, if these
+         * features are turned on.
+         * @method stopEvent
+         * @param {Event} e the event as returned by this.getEvent()
+         * @static
+         */
+        stopEvent: function(e){
+            if(this.stopPropagation) {
+                e.stopPropagation();
+            }
+
+            if (this.preventDefault) {
+                e.preventDefault();
+            }
+        },
+
+        /**
+         * Internal function to clean up event handlers after the drag
+         * operation is complete
+         * @method stopDrag
+         * @param {Event} e the event
+         * @private
+         * @static
+         */
+        stopDrag: function(e) {
+            // Fire the drag end event for the item that was dragged
+            if (this.dragCurrent) {
+                if (this.dragThreshMet) {
+                    this.dragCurrent.b4EndDrag(e);
+                    this.dragCurrent.endDrag(e);
+                }
+
+                this.dragCurrent.onMouseUp(e);
+            }
+
+            this.dragCurrent = null;
+            this.dragOvers = {};
+        },
+
+        /**
+         * Internal function to handle the mousemove event.  Will be invoked
+         * from the context of the html element.
+         *
+         * @TODO figure out what we can do about mouse events lost when the
+         * user drags objects beyond the window boundary.  Currently we can
+         * detect this in internet explorer by verifying that the mouse is
+         * down during the mousemove event.  Firefox doesn't give us the
+         * button state on the mousemove event.
+         * @method handleMouseMove
+         * @param {Event} e the event
+         * @private
+         * @static
+         */
+        handleMouseMove: function(e) {
+            if (! this.dragCurrent) {
+                return true;
+            }
+
+            // var button = e.which || e.button;
+
+            // check for IE mouseup outside of page boundary
+            if (Roo.isIE && (e.button !== 0 && e.button !== 1 && e.button !== 2)) {
+                this.stopEvent(e);
+                return this.handleMouseUp(e);
+            }
+
+            if (!this.dragThreshMet) {
+                var diffX = Math.abs(this.startX - e.getPageX());
+                var diffY = Math.abs(this.startY - e.getPageY());
+                if (diffX > this.clickPixelThresh ||
+                            diffY > this.clickPixelThresh) {
+                    this.startDrag(this.startX, this.startY);
+                }
+            }
+
+            if (this.dragThreshMet) {
+                this.dragCurrent.b4Drag(e);
+                this.dragCurrent.onDrag(e);
+                if(!this.dragCurrent.moveOnly){
+                    this.fireEvents(e, false);
+                }
+            }
+
+            this.stopEvent(e);
+
+            return true;
+        },
+
+        /**
+         * Iterates over all of the DragDrop elements to find ones we are
+         * hovering over or dropping on
+         * @method fireEvents
+         * @param {Event} e the event
+         * @param {boolean} isDrop is this a drop op or a mouseover op?
+         * @private
+         * @static
+         */
+        fireEvents: function(e, isDrop) {
+            var dc = this.dragCurrent;
+
+            // If the user did the mouse up outside of the window, we could
+            // get here even though we have ended the drag.
+            if (!dc || dc.isLocked()) {
+                return;
+            }
+
+            var pt = e.getPoint();
+
+            // cache the previous dragOver array
+            var oldOvers = [];
+
+            var outEvts   = [];
+            var overEvts  = [];
+            var dropEvts  = [];
+            var enterEvts = [];
+
+            // Check to see if the object(s) we were hovering over is no longer
+            // being hovered over so we can fire the onDragOut event
+            for (var i in this.dragOvers) {
+
+                var ddo = this.dragOvers[i];
+
+                if (! this.isTypeOfDD(ddo)) {
+                    continue;
+                }
+
+                if (! this.isOverTarget(pt, ddo, this.mode)) {
+                    outEvts.push( ddo );
+                }
+
+                oldOvers[i] = true;
+                delete this.dragOvers[i];
+            }
+
+            for (var sGroup in dc.groups) {
+
+                if ("string" != typeof sGroup) {
+                    continue;
+                }
+
+                for (i in this.ids[sGroup]) {
+                    var oDD = this.ids[sGroup][i];
+                    if (! this.isTypeOfDD(oDD)) {
+                        continue;
+                    }
+
+                    if (oDD.isTarget && !oDD.isLocked() && oDD != dc) {
+                        if (this.isOverTarget(pt, oDD, this.mode)) {
+                            // look for drop interactions
+                            if (isDrop) {
+                                dropEvts.push( oDD );
+                            // look for drag enter and drag over interactions
+                            } else {
+
+                                // initial drag over: dragEnter fires
+                                if (!oldOvers[oDD.id]) {
+                                    enterEvts.push( oDD );
+                                // subsequent drag overs: dragOver fires
+                                } else {
+                                    overEvts.push( oDD );
+                                }
+
+                                this.dragOvers[oDD.id] = oDD;
+                            }
+                        }
+                    }
+                }
+            }
+
+            if (this.mode) {
+                if (outEvts.length) {
+                    dc.b4DragOut(e, outEvts);
+                    dc.onDragOut(e, outEvts);
+                }
+
+                if (enterEvts.length) {
+                    dc.onDragEnter(e, enterEvts);
+                }
+
+                if (overEvts.length) {
+                    dc.b4DragOver(e, overEvts);
+                    dc.onDragOver(e, overEvts);
+                }
+
+                if (dropEvts.length) {
+                    dc.b4DragDrop(e, dropEvts);
+                    dc.onDragDrop(e, dropEvts);
+                }
+
+            } else {
+                // fire dragout events
+                var len = 0;
+                for (i=0, len=outEvts.length; i<len; ++i) {
+                    dc.b4DragOut(e, outEvts[i].id);
+                    dc.onDragOut(e, outEvts[i].id);
+                }
+
+                // fire enter events
+                for (i=0,len=enterEvts.length; i<len; ++i) {
+                    // dc.b4DragEnter(e, oDD.id);
+                    dc.onDragEnter(e, enterEvts[i].id);
+                }
+
+                // fire over events
+                for (i=0,len=overEvts.length; i<len; ++i) {
+                    dc.b4DragOver(e, overEvts[i].id);
+                    dc.onDragOver(e, overEvts[i].id);
+                }
+
+                // fire drop events
+                for (i=0, len=dropEvts.length; i<len; ++i) {
+                    dc.b4DragDrop(e, dropEvts[i].id);
+                    dc.onDragDrop(e, dropEvts[i].id);
+                }
+
+            }
+
+            // notify about a drop that did not find a target
+            if (isDrop && !dropEvts.length) {
+                dc.onInvalidDrop(e);
+            }
+
+        },
+
+        /**
+         * Helper function for getting the best match from the list of drag
+         * and drop objects returned by the drag and drop events when we are
+         * in INTERSECT mode.  It returns either the first object that the
+         * cursor is over, or the object that has the greatest overlap with
+         * the dragged element.
+         * @method getBestMatch
+         * @param  {DragDrop[]} dds The array of drag and drop objects
+         * targeted
+         * @return {DragDrop}       The best single match
+         * @static
+         */
+        getBestMatch: function(dds) {
+            var winner = null;
+            // Return null if the input is not what we expect
+            //if (!dds || !dds.length || dds.length == 0) {
+               // winner = null;
+            // If there is only one item, it wins
+            //} else if (dds.length == 1) {
+
+            var len = dds.length;
+
+            if (len == 1) {
+                winner = dds[0];
+            } else {
+                // Loop through the targeted items
+                for (var i=0; i<len; ++i) {
+                    var dd = dds[i];
+                    // If the cursor is over the object, it wins.  If the
+                    // cursor is over multiple matches, the first one we come
+                    // to wins.
+                    if (dd.cursorIsOver) {
+                        winner = dd;
+                        break;
+                    // Otherwise the object with the most overlap wins
+                    } else {
+                        if (!winner ||
+                            winner.overlap.getArea() < dd.overlap.getArea()) {
+                            winner = dd;
+                        }
+                    }
+                }
+            }
+
+            return winner;
+        },
+
+        /**
+         * Refreshes the cache of the top-left and bottom-right points of the
+         * drag and drop objects in the specified group(s).  This is in the
+         * format that is stored in the drag and drop instance, so typical
+         * usage is:
+         * <code>
+         * Roo.dd.DragDropMgr.refreshCache(ddinstance.groups);
+         * </code>
+         * Alternatively:
+         * <code>
+         * Roo.dd.DragDropMgr.refreshCache({group1:true, group2:true});
+         * </code>
+         * @TODO this really should be an indexed array.  Alternatively this
+         * method could accept both.
+         * @method refreshCache
+         * @param {Object} groups an associative array of groups to refresh
+         * @static
+         */
+        refreshCache: function(groups) {
+            for (var sGroup in groups) {
+                if ("string" != typeof sGroup) {
+                    continue;
+                }
+                for (var i in this.ids[sGroup]) {
+                    var oDD = this.ids[sGroup][i];
+
+                    if (this.isTypeOfDD(oDD)) {
+                    // if (this.isTypeOfDD(oDD) && oDD.isTarget) {
+                        var loc = this.getLocation(oDD);
+                        if (loc) {
+                            this.locationCache[oDD.id] = loc;
+                        } else {
+                            delete this.locationCache[oDD.id];
+                            // this will unregister the drag and drop object if
+                            // the element is not in a usable state
+                            // oDD.unreg();
+                        }
+                    }
+                }
+            }
+        },
+
+        /**
+         * This checks to make sure an element exists and is in the DOM.  The
+         * main purpose is to handle cases where innerHTML is used to remove
+         * drag and drop objects from the DOM.  IE provides an 'unspecified
+         * error' when trying to access the offsetParent of such an element
+         * @method verifyEl
+         * @param {HTMLElement} el the element to check
+         * @return {boolean} true if the element looks usable
+         * @static
+         */
+        verifyEl: function(el) {
+            if (el) {
+                var parent;
+                if(Roo.isIE){
+                    try{
+                        parent = el.offsetParent;
+                    }catch(e){}
+                }else{
+                    parent = el.offsetParent;
+                }
+                if (parent) {
+                    return true;
+                }
+            }
+
+            return false;
+        },
+
+        /**
+         * Returns a Region object containing the drag and drop element's position
+         * and size, including the padding configured for it
+         * @method getLocation
+         * @param {DragDrop} oDD the drag and drop object to get the
+         *                       location for
+         * @return {Roo.lib.Region} a Region object representing the total area
+         *                             the element occupies, including any padding
+         *                             the instance is configured for.
+         * @static
+         */
+        getLocation: function(oDD) {
+            if (! this.isTypeOfDD(oDD)) {
+                return null;
+            }
+
+            var el = oDD.getEl(), pos, x1, x2, y1, y2, t, r, b, l;
+
+            try {
+                pos= Roo.lib.Dom.getXY(el);
+            } catch (e) { }
+
+            if (!pos) {
+                return null;
+            }
+
+            x1 = pos[0];
+            x2 = x1 + el.offsetWidth;
+            y1 = pos[1];
+            y2 = y1 + el.offsetHeight;
+
+            t = y1 - oDD.padding[0];
+            r = x2 + oDD.padding[1];
+            b = y2 + oDD.padding[2];
+            l = x1 - oDD.padding[3];
+
+            return new Roo.lib.Region( t, r, b, l );
+        },
+
+        /**
+         * Checks the cursor location to see if it over the target
+         * @method isOverTarget
+         * @param {Roo.lib.Point} pt The point to evaluate
+         * @param {DragDrop} oTarget the DragDrop object we are inspecting
+         * @return {boolean} true if the mouse is over the target
+         * @private
+         * @static
+         */
+        isOverTarget: function(pt, oTarget, intersect) {
+            // use cache if available
+            var loc = this.locationCache[oTarget.id];
+            if (!loc || !this.useCache) {
+                loc = this.getLocation(oTarget);
+                this.locationCache[oTarget.id] = loc;
+
+            }
+
+            if (!loc) {
+                return false;
+            }
+
+            oTarget.cursorIsOver = loc.contains( pt );
+
+            // DragDrop is using this as a sanity check for the initial mousedown
+            // in this case we are done.  In POINT mode, if the drag obj has no
+            // contraints, we are also done. Otherwise we need to evaluate the
+            // location of the target as related to the actual location of the
+            // dragged element.
+            var dc = this.dragCurrent;
+            if (!dc || !dc.getTargetCoord ||
+                    (!intersect && !dc.constrainX && !dc.constrainY)) {
+                return oTarget.cursorIsOver;
+            }
+
+            oTarget.overlap = null;
+
+            // Get the current location of the drag element, this is the
+            // location of the mouse event less the delta that represents
+            // where the original mousedown happened on the element.  We
+            // need to consider constraints and ticks as well.
+            var pos = dc.getTargetCoord(pt.x, pt.y);
+
+            var el = dc.getDragEl();
+            var curRegion = new Roo.lib.Region( pos.y,
+                                                   pos.x + el.offsetWidth,
+                                                   pos.y + el.offsetHeight,
+                                                   pos.x );
+
+            var overlap = curRegion.intersect(loc);
+
+            if (overlap) {
+                oTarget.overlap = overlap;
+                return (intersect) ? true : oTarget.cursorIsOver;
+            } else {
+                return false;
+            }
+        },
+
+        /**
+         * unload event handler
+         * @method _onUnload
+         * @private
+         * @static
+         */
+        _onUnload: function(e, me) {
+            Roo.dd.DragDropMgr.unregAll();
+        },
+
+        /**
+         * Cleans up the drag and drop events and objects.
+         * @method unregAll
+         * @private
+         * @static
+         */
+        unregAll: function() {
+
+            if (this.dragCurrent) {
+                this.stopDrag();
+                this.dragCurrent = null;
+            }
+
+            this._execOnAll("unreg", []);
+
+            for (i in this.elementCache) {
+                delete this.elementCache[i];
+            }
+
+            this.elementCache = {};
+            this.ids = {};
+        },
+
+        /**
+         * A cache of DOM elements
+         * @property elementCache
+         * @private
+         * @static
+         */
+        elementCache: {},
+
+        /**
+         * Get the wrapper for the DOM element specified
+         * @method getElWrapper
+         * @param {String} id the id of the element to get
+         * @return {Roo.dd.DDM.ElementWrapper} the wrapped element
+         * @private
+         * @deprecated This wrapper isn't that useful
+         * @static
+         */
+        getElWrapper: function(id) {
+            var oWrapper = this.elementCache[id];
+            if (!oWrapper || !oWrapper.el) {
+                oWrapper = this.elementCache[id] =
+                    new this.ElementWrapper(Roo.getDom(id));
+            }
+            return oWrapper;
+        },
+
+        /**
+         * Returns the actual DOM element
+         * @method getElement
+         * @param {String} id the id of the elment to get
+         * @return {Object} The element
+         * @deprecated use Roo.getDom instead
+         * @static
+         */
+        getElement: function(id) {
+            return Roo.getDom(id);
+        },
+
+        /**
+         * Returns the style property for the DOM element (i.e.,
+         * document.getElById(id).style)
+         * @method getCss
+         * @param {String} id the id of the elment to get
+         * @return {Object} The style property of the element
+         * @deprecated use Roo.getDom instead
+         * @static
+         */
+        getCss: function(id) {
+            var el = Roo.getDom(id);
+            return (el) ? el.style : null;
+        },
+
+        /**
+         * Inner class for cached elements
+         * @class DragDropMgr.ElementWrapper
+         * @for DragDropMgr
+         * @private
+         * @deprecated
+         */
+        ElementWrapper: function(el) {
+                /**
+                 * The element
+                 * @property el
+                 */
+                this.el = el || null;
+                /**
+                 * The element id
+                 * @property id
+                 */
+                this.id = this.el && el.id;
+                /**
+                 * A reference to the style property
+                 * @property css
+                 */
+                this.css = this.el && el.style;
+            },
+
+        /**
+         * Returns the X position of an html element
+         * @method getPosX
+         * @param el the element for which to get the position
+         * @return {int} the X coordinate
+         * @for DragDropMgr
+         * @deprecated use Roo.lib.Dom.getX instead
+         * @static
+         */
+        getPosX: function(el) {
+            return Roo.lib.Dom.getX(el);
+        },
+
+        /**
+         * Returns the Y position of an html element
+         * @method getPosY
+         * @param el the element for which to get the position
+         * @return {int} the Y coordinate
+         * @deprecated use Roo.lib.Dom.getY instead
+         * @static
+         */
+        getPosY: function(el) {
+            return Roo.lib.Dom.getY(el);
+        },
+
+        /**
+         * Swap two nodes.  In IE, we use the native method, for others we
+         * emulate the IE behavior
+         * @method swapNode
+         * @param n1 the first node to swap
+         * @param n2 the other node to swap
+         * @static
+         */
+        swapNode: function(n1, n2) {
+            if (n1.swapNode) {
+                n1.swapNode(n2);
+            } else {
+                var p = n2.parentNode;
+                var s = n2.nextSibling;
+
+                if (s == n1) {
+                    p.insertBefore(n1, n2);
+                } else if (n2 == n1.nextSibling) {
+                    p.insertBefore(n2, n1);
+                } else {
+                    n1.parentNode.replaceChild(n2, n1);
+                    p.insertBefore(n1, s);
+                }
+            }
+        },
+
+        /**
+         * Returns the current scroll position
+         * @method getScroll
+         * @private
+         * @static
+         */
+        getScroll: function () {
+            var t, l, dde=document.documentElement, db=document.body;
+            if (dde && (dde.scrollTop || dde.scrollLeft)) {
+                t = dde.scrollTop;
+                l = dde.scrollLeft;
+            } else if (db) {
+                t = db.scrollTop;
+                l = db.scrollLeft;
+            } else {
+
+            }
+            return { top: t, left: l };
+        },
+
+        /**
+         * Returns the specified element style property
+         * @method getStyle
+         * @param {HTMLElement} el          the element
+         * @param {string}      styleProp   the style property
+         * @return {string} The value of the style property
+         * @deprecated use Roo.lib.Dom.getStyle
+         * @static
+         */
+        getStyle: function(el, styleProp) {
+            return Roo.fly(el).getStyle(styleProp);
+        },
+
+        /**
+         * Gets the scrollTop
+         * @method getScrollTop
+         * @return {int} the document's scrollTop
+         * @static
+         */
+        getScrollTop: function () { return this.getScroll().top; },
+
+        /**
+         * Gets the scrollLeft
+         * @method getScrollLeft
+         * @return {int} the document's scrollTop
+         * @static
+         */
+        getScrollLeft: function () { return this.getScroll().left; },
+
+        /**
+         * Sets the x/y position of an element to the location of the
+         * target element.
+         * @method moveToEl
+         * @param {HTMLElement} moveEl      The element to move
+         * @param {HTMLElement} targetEl    The position reference element
+         * @static
+         */
+        moveToEl: function (moveEl, targetEl) {
+            var aCoord = Roo.lib.Dom.getXY(targetEl);
+            Roo.lib.Dom.setXY(moveEl, aCoord);
+        },
+
+        /**
+         * Numeric array sort function
+         * @method numericSort
+         * @static
+         */
+        numericSort: function(a, b) { return (a - b); },
+
+        /**
+         * Internal counter
+         * @property _timeoutCount
+         * @private
+         * @static
+         */
+        _timeoutCount: 0,
+
+        /**
+         * Trying to make the load order less important.  Without this we get
+         * an error if this file is loaded before the Event Utility.
+         * @method _addListeners
+         * @private
+         * @static
+         */
+        _addListeners: function() {
+            var DDM = Roo.dd.DDM;
+            if ( Roo.lib.Event && document ) {
+                DDM._onLoad();
+            } else {
+                if (DDM._timeoutCount > 2000) {
+                } else {
+                    setTimeout(DDM._addListeners, 10);
+                    if (document && document.body) {
+                        DDM._timeoutCount += 1;
+                    }
+                }
+            }
+        },
+
+        /**
+         * Recursively searches the immediate parent and all child nodes for
+         * the handle element in order to determine wheter or not it was
+         * clicked.
+         * @method handleWasClicked
+         * @param node the html element to inspect
+         * @static
+         */
+        handleWasClicked: function(node, id) {
+            if (this.isHandle(id, node.id)) {
+                return true;
+            } else {
+                // check to see if this is a text node child of the one we want
+                var p = node.parentNode;
+
+                while (p) {
+                    if (this.isHandle(id, p.id)) {
+                        return true;
+                    } else {
+                        p = p.parentNode;
+                    }
+                }
+            }
+
+            return false;
+        }
+
+    };
+
+}();
+
+// shorter alias, save a few bytes
+Roo.dd.DDM = Roo.dd.DragDropMgr;
+Roo.dd.DDM._addListeners();
+
+}
\ No newline at end of file
diff --git a/Roo/dd/DragSource.js b/Roo/dd/DragSource.js
new file mode 100644 (file)
index 0000000..daf0825
--- /dev/null
@@ -0,0 +1,364 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+
+/**
+ * @class Roo.dd.DragSource
+ * @extends Roo.dd.DDProxy
+ * A simple class that provides the basic implementation needed to make any element draggable.
+ * @constructor
+ * @param {String/HTMLElement/Element} el The container element
+ * @param {Object} config
+ */
+Roo.dd.DragSource = function(el, config){
+    this.el = Roo.get(el);
+    this.dragData = {};
+    
+    Roo.apply(this, config);
+    
+    if(!this.proxy){
+        this.proxy = new Roo.dd.StatusProxy();
+    }
+
+    Roo.dd.DragSource.superclass.constructor.call(this, this.el.dom, this.ddGroup || this.group,
+          {dragElId : this.proxy.id, resizeFrame: false, isTarget: false, scroll: this.scroll === true});
+    
+    this.dragging = false;
+};
+
+Roo.extend(Roo.dd.DragSource, Roo.dd.DDProxy, {
+    /**
+     * @cfg {String} dropAllowed
+     * The CSS class returned to the drag source when drop is allowed (defaults to "x-dd-drop-ok").
+     */
+    dropAllowed : "x-dd-drop-ok",
+    /**
+     * @cfg {String} dropNotAllowed
+     * The CSS class returned to the drag source when drop is not allowed (defaults to "x-dd-drop-nodrop").
+     */
+    dropNotAllowed : "x-dd-drop-nodrop",
+
+    /**
+     * Returns the data object associated with this drag source
+     * @return {Object} data An object containing arbitrary data
+     */
+    getDragData : function(e){
+        return this.dragData;
+    },
+
+    // private
+    onDragEnter : function(e, id){
+        var target = Roo.dd.DragDropMgr.getDDById(id);
+        this.cachedTarget = target;
+        if(this.beforeDragEnter(target, e, id) !== false){
+            if(target.isNotifyTarget){
+                var status = target.notifyEnter(this, e, this.dragData);
+                this.proxy.setStatus(status);
+            }else{
+                this.proxy.setStatus(this.dropAllowed);
+            }
+            
+            if(this.afterDragEnter){
+                /**
+                 * An empty function by default, but provided so that you can perform a custom action
+                 * when the dragged item enters the drop target by providing an implementation.
+                 * @param {Roo.dd.DragDrop} target The drop target
+                 * @param {Event} e The event object
+                 * @param {String} id The id of the dragged element
+                 * @method afterDragEnter
+                 */
+                this.afterDragEnter(target, e, id);
+            }
+        }
+    },
+
+    /**
+     * An empty function by default, but provided so that you can perform a custom action
+     * before the dragged item enters the drop target and optionally cancel the onDragEnter.
+     * @param {Roo.dd.DragDrop} target The drop target
+     * @param {Event} e The event object
+     * @param {String} id The id of the dragged element
+     * @return {Boolean} isValid True if the drag event is valid, else false to cancel
+     */
+    beforeDragEnter : function(target, e, id){
+        return true;
+    },
+
+    // private
+    alignElWithMouse: function() {
+        Roo.dd.DragSource.superclass.alignElWithMouse.apply(this, arguments);
+        this.proxy.sync();
+    },
+
+    // private
+    onDragOver : function(e, id){
+        var target = this.cachedTarget || Roo.dd.DragDropMgr.getDDById(id);
+        if(this.beforeDragOver(target, e, id) !== false){
+            if(target.isNotifyTarget){
+                var status = target.notifyOver(this, e, this.dragData);
+                this.proxy.setStatus(status);
+            }
+
+            if(this.afterDragOver){
+                /**
+                 * An empty function by default, but provided so that you can perform a custom action
+                 * while the dragged item is over the drop target by providing an implementation.
+                 * @param {Roo.dd.DragDrop} target The drop target
+                 * @param {Event} e The event object
+                 * @param {String} id The id of the dragged element
+                 * @method afterDragOver
+                 */
+                this.afterDragOver(target, e, id);
+            }
+        }
+    },
+
+    /**
+     * An empty function by default, but provided so that you can perform a custom action
+     * while the dragged item is over the drop target and optionally cancel the onDragOver.
+     * @param {Roo.dd.DragDrop} target The drop target
+     * @param {Event} e The event object
+     * @param {String} id The id of the dragged element
+     * @return {Boolean} isValid True if the drag event is valid, else false to cancel
+     */
+    beforeDragOver : function(target, e, id){
+        return true;
+    },
+
+    // private
+    onDragOut : function(e, id){
+        var target = this.cachedTarget || Roo.dd.DragDropMgr.getDDById(id);
+        if(this.beforeDragOut(target, e, id) !== false){
+            if(target.isNotifyTarget){
+                target.notifyOut(this, e, this.dragData);
+            }
+            this.proxy.reset();
+            if(this.afterDragOut){
+                /**
+                 * An empty function by default, but provided so that you can perform a custom action
+                 * after the dragged item is dragged out of the target without dropping.
+                 * @param {Roo.dd.DragDrop} target The drop target
+                 * @param {Event} e The event object
+                 * @param {String} id The id of the dragged element
+                 * @method afterDragOut
+                 */
+                this.afterDragOut(target, e, id);
+            }
+        }
+        this.cachedTarget = null;
+    },
+
+    /**
+     * An empty function by default, but provided so that you can perform a custom action before the dragged
+     * item is dragged out of the target without dropping, and optionally cancel the onDragOut.
+     * @param {Roo.dd.DragDrop} target The drop target
+     * @param {Event} e The event object
+     * @param {String} id The id of the dragged element
+     * @return {Boolean} isValid True if the drag event is valid, else false to cancel
+     */
+    beforeDragOut : function(target, e, id){
+        return true;
+    },
+    
+    // private
+    onDragDrop : function(e, id){
+        var target = this.cachedTarget || Roo.dd.DragDropMgr.getDDById(id);
+        if(this.beforeDragDrop(target, e, id) !== false){
+            if(target.isNotifyTarget){
+                if(target.notifyDrop(this, e, this.dragData)){ // valid drop?
+                    this.onValidDrop(target, e, id);
+                }else{
+                    this.onInvalidDrop(target, e, id);
+                }
+            }else{
+                this.onValidDrop(target, e, id);
+            }
+            
+            if(this.afterDragDrop){
+                /**
+                 * An empty function by default, but provided so that you can perform a custom action
+                 * after a valid drag drop has occurred by providing an implementation.
+                 * @param {Roo.dd.DragDrop} target The drop target
+                 * @param {Event} e The event object
+                 * @param {String} id The id of the dropped element
+                 * @method afterDragDrop
+                 */
+                this.afterDragDrop(target, e, id);
+            }
+        }
+        delete this.cachedTarget;
+    },
+
+    /**
+     * An empty function by default, but provided so that you can perform a custom action before the dragged
+     * item is dropped onto the target and optionally cancel the onDragDrop.
+     * @param {Roo.dd.DragDrop} target The drop target
+     * @param {Event} e The event object
+     * @param {String} id The id of the dragged element
+     * @return {Boolean} isValid True if the drag drop event is valid, else false to cancel
+     */
+    beforeDragDrop : function(target, e, id){
+        return true;
+    },
+
+    // private
+    onValidDrop : function(target, e, id){
+        this.hideProxy();
+        if(this.afterValidDrop){
+            /**
+             * An empty function by default, but provided so that you can perform a custom action
+             * after a valid drop has occurred by providing an implementation.
+             * @param {Object} target The target DD 
+             * @param {Event} e The event object
+             * @param {String} id The id of the dropped element
+             * @method afterInvalidDrop
+             */
+            this.afterValidDrop(target, e, id);
+        }
+    },
+
+    // private
+    getRepairXY : function(e, data){
+        return this.el.getXY();  
+    },
+
+    // private
+    onInvalidDrop : function(target, e, id){
+        this.beforeInvalidDrop(target, e, id);
+        if(this.cachedTarget){
+            if(this.cachedTarget.isNotifyTarget){
+                this.cachedTarget.notifyOut(this, e, this.dragData);
+            }
+            this.cacheTarget = null;
+        }
+        this.proxy.repair(this.getRepairXY(e, this.dragData), this.afterRepair, this);
+
+        if(this.afterInvalidDrop){
+            /**
+             * An empty function by default, but provided so that you can perform a custom action
+             * after an invalid drop has occurred by providing an implementation.
+             * @param {Event} e The event object
+             * @param {String} id The id of the dropped element
+             * @method afterInvalidDrop
+             */
+            this.afterInvalidDrop(e, id);
+        }
+    },
+
+    // private
+    afterRepair : function(){
+        if(Roo.enableFx){
+            this.el.highlight(this.hlColor || "c3daf9");
+        }
+        this.dragging = false;
+    },
+
+    /**
+     * An empty function by default, but provided so that you can perform a custom action after an invalid
+     * drop has occurred.
+     * @param {Roo.dd.DragDrop} target The drop target
+     * @param {Event} e The event object
+     * @param {String} id The id of the dragged element
+     * @return {Boolean} isValid True if the invalid drop should proceed, else false to cancel
+     */
+    beforeInvalidDrop : function(target, e, id){
+        return true;
+    },
+
+    // private
+    handleMouseDown : function(e){
+        if(this.dragging) {
+            return;
+        }
+        var data = this.getDragData(e);
+        if(data && this.onBeforeDrag(data, e) !== false){
+            this.dragData = data;
+            this.proxy.stop();
+            Roo.dd.DragSource.superclass.handleMouseDown.apply(this, arguments);
+        } 
+    },
+
+    /**
+     * An empty function by default, but provided so that you can perform a custom action before the initial
+     * drag event begins and optionally cancel it.
+     * @param {Object} data An object containing arbitrary data to be shared with drop targets
+     * @param {Event} e The event object
+     * @return {Boolean} isValid True if the drag event is valid, else false to cancel
+     */
+    onBeforeDrag : function(data, e){
+        return true;
+    },
+
+    /**
+     * An empty function by default, but provided so that you can perform a custom action once the initial
+     * drag event has begun.  The drag cannot be canceled from this function.
+     * @param {Number} x The x position of the click on the dragged object
+     * @param {Number} y The y position of the click on the dragged object
+     */
+    onStartDrag : Roo.emptyFn,
+
+    // private - YUI override
+    startDrag : function(x, y){
+        this.proxy.reset();
+        this.dragging = true;
+        this.proxy.update("");
+        this.onInitDrag(x, y);
+        this.proxy.show();
+    },
+
+    // private
+    onInitDrag : function(x, y){
+        var clone = this.el.dom.cloneNode(true);
+        clone.id = Roo.id(); // prevent duplicate ids
+        this.proxy.update(clone);
+        this.onStartDrag(x, y);
+        return true;
+    },
+
+    /**
+     * Returns the drag source's underlying {@link Roo.dd.StatusProxy}
+     * @return {Roo.dd.StatusProxy} proxy The StatusProxy
+     */
+    getProxy : function(){
+        return this.proxy;  
+    },
+
+    /**
+     * Hides the drag source's {@link Roo.dd.StatusProxy}
+     */
+    hideProxy : function(){
+        this.proxy.hide();  
+        this.proxy.reset(true);
+        this.dragging = false;
+    },
+
+    // private
+    triggerCacheRefresh : function(){
+        Roo.dd.DDM.refreshCache(this.groups);
+    },
+
+    // private - override to prevent hiding
+    b4EndDrag: function(e) {
+    },
+
+    // private - override to prevent moving
+    endDrag : function(e){
+        this.onEndDrag(this.dragData, e);
+    },
+
+    // private
+    onEndDrag : function(data, e){
+    },
+    
+    // private - pin to cursor
+    autoOffset : function(x, y) {
+        this.setDelta(-12, -20);
+    }    
+});
\ No newline at end of file
diff --git a/Roo/dd/DragZone.js b/Roo/dd/DragZone.js
new file mode 100644 (file)
index 0000000..0b7cab6
--- /dev/null
@@ -0,0 +1,83 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+
+
+/**
+ * @class Roo.dd.DragZone
+ * @extends Roo.dd.DragSource
+ * This class provides a container DD instance that proxies for multiple child node sources.<br />
+ * By default, this class requires that draggable child nodes are registered with {@link Roo.dd.Registry}.
+ * @constructor
+ * @param {String/HTMLElement/Element} el The container element
+ * @param {Object} config
+ */
+Roo.dd.DragZone = function(el, config){
+    Roo.dd.DragZone.superclass.constructor.call(this, el, config);
+    if(this.containerScroll){
+        Roo.dd.ScrollManager.register(this.el);
+    }
+};
+
+Roo.extend(Roo.dd.DragZone, Roo.dd.DragSource, {
+    /**
+     * @cfg {Boolean} containerScroll True to register this container with the Scrollmanager
+     * for auto scrolling during drag operations.
+     */
+    /**
+     * @cfg {String} hlColor The color to use when visually highlighting the drag source in the afterRepair
+     * method after a failed drop (defaults to "c3daf9" - light blue)
+     */
+
+    /**
+     * Called when a mousedown occurs in this container. Looks in {@link Roo.dd.Registry}
+     * for a valid target to drag based on the mouse down. Override this method
+     * to provide your own lookup logic (e.g. finding a child by class name). Make sure your returned
+     * object has a "ddel" attribute (with an HTML Element) for other functions to work.
+     * @param {EventObject} e The mouse down event
+     * @return {Object} The dragData
+     */
+    getDragData : function(e){
+        return Roo.dd.Registry.getHandleFromEvent(e);
+    },
+    
+    /**
+     * Called once drag threshold has been reached to initialize the proxy element. By default, it clones the
+     * this.dragData.ddel
+     * @param {Number} x The x position of the click on the dragged object
+     * @param {Number} y The y position of the click on the dragged object
+     * @return {Boolean} true to continue the drag, false to cancel
+     */
+    onInitDrag : function(x, y){
+        this.proxy.update(this.dragData.ddel.cloneNode(true));
+        this.onStartDrag(x, y);
+        return true;
+    },
+    
+    /**
+     * Called after a repair of an invalid drop. By default, highlights this.dragData.ddel 
+     */
+    afterRepair : function(){
+        if(Roo.enableFx){
+            Roo.Element.fly(this.dragData.ddel).highlight(this.hlColor || "c3daf9");
+        }
+        this.dragging = false;
+    },
+
+    /**
+     * Called before a repair of an invalid drop to get the XY to animate to. By default returns
+     * the XY of this.dragData.ddel
+     * @param {EventObject} e The mouse up event
+     * @return {Array} The xy location (e.g. [100, 200])
+     */
+    getRepairXY : function(e){
+        return Roo.Element.fly(this.dragData.ddel).getXY();  
+    }
+});
\ No newline at end of file
diff --git a/Roo/dd/DropTarget.js b/Roo/dd/DropTarget.js
new file mode 100644 (file)
index 0000000..787fd72
--- /dev/null
@@ -0,0 +1,116 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+
+
+/**
+ * @class Roo.dd.DropTarget
+ * @extends Roo.dd.DDTarget
+ * A simple class that provides the basic implementation needed to make any element a drop target that can have
+ * draggable items dropped onto it.  The drop has no effect until an implementation of notifyDrop is provided.
+ * @constructor
+ * @param {String/HTMLElement/Element} el The container element
+ * @param {Object} config
+ */
+Roo.dd.DropTarget = function(el, config){
+    this.el = Roo.get(el);
+    
+    Roo.apply(this, config);
+    
+    if(this.containerScroll){
+        Roo.dd.ScrollManager.register(this.el);
+    }
+    
+    Roo.dd.DropTarget.superclass.constructor.call(this, this.el.dom, this.ddGroup || this.group, 
+          {isTarget: true});
+
+};
+
+Roo.extend(Roo.dd.DropTarget, Roo.dd.DDTarget, {
+    /**
+     * @cfg {String} overClass
+     * The CSS class applied to the drop target element while the drag source is over it (defaults to "").
+     */
+    /**
+     * @cfg {String} dropAllowed
+     * The CSS class returned to the drag source when drop is allowed (defaults to "x-dd-drop-ok").
+     */
+    dropAllowed : "x-dd-drop-ok",
+    /**
+     * @cfg {String} dropNotAllowed
+     * The CSS class returned to the drag source when drop is not allowed (defaults to "x-dd-drop-nodrop").
+     */
+    dropNotAllowed : "x-dd-drop-nodrop",
+
+    // private
+    isTarget : true,
+
+    // private
+    isNotifyTarget : true,
+
+    /**
+     * The function a {@link Roo.dd.DragSource} calls once to notify this drop target that the source is now over the
+     * target.  This default implementation adds the CSS class specified by overClass (if any) to the drop element
+     * and returns the dropAllowed config value.  This method should be overridden if drop validation is required.
+     * @param {Roo.dd.DragSource} source The drag source that was dragged over this drop target
+     * @param {Event} e The event
+     * @param {Object} data An object containing arbitrary data supplied by the drag source
+     * @return {String} status The CSS class that communicates the drop status back to the source so that the
+     * underlying {@link Roo.dd.StatusProxy} can be updated
+     */
+    notifyEnter : function(dd, e, data){
+        if(this.overClass){
+            this.el.addClass(this.overClass);
+        }
+        return this.dropAllowed;
+    },
+
+    /**
+     * The function a {@link Roo.dd.DragSource} calls continuously while it is being dragged over the target.
+     * This method will be called on every mouse movement while the drag source is over the drop target.
+     * This default implementation simply returns the dropAllowed config value.
+     * @param {Roo.dd.DragSource} source The drag source that was dragged over this drop target
+     * @param {Event} e The event
+     * @param {Object} data An object containing arbitrary data supplied by the drag source
+     * @return {String} status The CSS class that communicates the drop status back to the source so that the
+     * underlying {@link Roo.dd.StatusProxy} can be updated
+     */
+    notifyOver : function(dd, e, data){
+        return this.dropAllowed;
+    },
+
+    /**
+     * The function a {@link Roo.dd.DragSource} calls once to notify this drop target that the source has been dragged
+     * out of the target without dropping.  This default implementation simply removes the CSS class specified by
+     * overClass (if any) from the drop element.
+     * @param {Roo.dd.DragSource} source The drag source that was dragged over this drop target
+     * @param {Event} e The event
+     * @param {Object} data An object containing arbitrary data supplied by the drag source
+     */
+    notifyOut : function(dd, e, data){
+        if(this.overClass){
+            this.el.removeClass(this.overClass);
+        }
+    },
+
+    /**
+     * The function a {@link Roo.dd.DragSource} calls once to notify this drop target that the dragged item has
+     * been dropped on it.  This method has no default implementation and returns false, so you must provide an
+     * implementation that does something to process the drop event and returns true so that the drag source's
+     * repair action does not run.
+     * @param {Roo.dd.DragSource} source The drag source that was dragged over this drop target
+     * @param {Event} e The event
+     * @param {Object} data An object containing arbitrary data supplied by the drag source
+     * @return {Boolean} True if the drop was valid, else false
+     */
+    notifyDrop : function(dd, e, data){
+        return false;
+    }
+});
\ No newline at end of file
diff --git a/Roo/dd/DropZone.js b/Roo/dd/DropZone.js
new file mode 100644 (file)
index 0000000..b7dfc61
--- /dev/null
@@ -0,0 +1,210 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+/**
+ * @class Roo.dd.DropZone
+ * @extends Roo.dd.DropTarget
+ * This class provides a container DD instance that proxies for multiple child node targets.<br />
+ * By default, this class requires that child nodes accepting drop are registered with {@link Roo.dd.Registry}.
+ * @constructor
+ * @param {String/HTMLElement/Element} el The container element
+ * @param {Object} config
+ */
+Roo.dd.DropZone = function(el, config){
+    Roo.dd.DropZone.superclass.constructor.call(this, el, config);
+};
+
+Roo.extend(Roo.dd.DropZone, Roo.dd.DropTarget, {
+    /**
+     * Returns a custom data object associated with the DOM node that is the target of the event.  By default
+     * this looks up the event target in the {@link Roo.dd.Registry}, although you can override this method to
+     * provide your own custom lookup.
+     * @param {Event} e The event
+     * @return {Object} data The custom data
+     */
+    getTargetFromEvent : function(e){
+        return Roo.dd.Registry.getTargetFromEvent(e);
+    },
+
+    /**
+     * Called internally when the DropZone determines that a {@link Roo.dd.DragSource} has entered a drop node
+     * that it has registered.  This method has no default implementation and should be overridden to provide
+     * node-specific processing if necessary.
+     * @param {Object} nodeData The custom data associated with the drop node (this is the same value returned from 
+     * {@link #getTargetFromEvent} for this node)
+     * @param {Roo.dd.DragSource} source The drag source that was dragged over this drop zone
+     * @param {Event} e The event
+     * @param {Object} data An object containing arbitrary data supplied by the drag source
+     */
+    onNodeEnter : function(n, dd, e, data){
+        
+    },
+
+    /**
+     * Called internally while the DropZone determines that a {@link Roo.dd.DragSource} is over a drop node
+     * that it has registered.  The default implementation returns this.dropNotAllowed, so it should be
+     * overridden to provide the proper feedback.
+     * @param {Object} nodeData The custom data associated with the drop node (this is the same value returned from
+     * {@link #getTargetFromEvent} for this node)
+     * @param {Roo.dd.DragSource} source The drag source that was dragged over this drop zone
+     * @param {Event} e The event
+     * @param {Object} data An object containing arbitrary data supplied by the drag source
+     * @return {String} status The CSS class that communicates the drop status back to the source so that the
+     * underlying {@link Roo.dd.StatusProxy} can be updated
+     */
+    onNodeOver : function(n, dd, e, data){
+        return this.dropAllowed;
+    },
+
+    /**
+     * Called internally when the DropZone determines that a {@link Roo.dd.DragSource} has been dragged out of
+     * the drop node without dropping.  This method has no default implementation and should be overridden to provide
+     * node-specific processing if necessary.
+     * @param {Object} nodeData The custom data associated with the drop node (this is the same value returned from
+     * {@link #getTargetFromEvent} for this node)
+     * @param {Roo.dd.DragSource} source The drag source that was dragged over this drop zone
+     * @param {Event} e The event
+     * @param {Object} data An object containing arbitrary data supplied by the drag source
+     */
+    onNodeOut : function(n, dd, e, data){
+        
+    },
+
+    /**
+     * Called internally when the DropZone determines that a {@link Roo.dd.DragSource} has been dropped onto
+     * the drop node.  The default implementation returns false, so it should be overridden to provide the
+     * appropriate processing of the drop event and return true so that the drag source's repair action does not run.
+     * @param {Object} nodeData The custom data associated with the drop node (this is the same value returned from
+     * {@link #getTargetFromEvent} for this node)
+     * @param {Roo.dd.DragSource} source The drag source that was dragged over this drop zone
+     * @param {Event} e The event
+     * @param {Object} data An object containing arbitrary data supplied by the drag source
+     * @return {Boolean} True if the drop was valid, else false
+     */
+    onNodeDrop : function(n, dd, e, data){
+        return false;
+    },
+
+    /**
+     * Called internally while the DropZone determines that a {@link Roo.dd.DragSource} is being dragged over it,
+     * but not over any of its registered drop nodes.  The default implementation returns this.dropNotAllowed, so
+     * it should be overridden to provide the proper feedback if necessary.
+     * @param {Roo.dd.DragSource} source The drag source that was dragged over this drop zone
+     * @param {Event} e The event
+     * @param {Object} data An object containing arbitrary data supplied by the drag source
+     * @return {String} status The CSS class that communicates the drop status back to the source so that the
+     * underlying {@link Roo.dd.StatusProxy} can be updated
+     */
+    onContainerOver : function(dd, e, data){
+        return this.dropNotAllowed;
+    },
+
+    /**
+     * Called internally when the DropZone determines that a {@link Roo.dd.DragSource} has been dropped on it,
+     * but not on any of its registered drop nodes.  The default implementation returns false, so it should be
+     * overridden to provide the appropriate processing of the drop event if you need the drop zone itself to
+     * be able to accept drops.  It should return true when valid so that the drag source's repair action does not run.
+     * @param {Roo.dd.DragSource} source The drag source that was dragged over this drop zone
+     * @param {Event} e The event
+     * @param {Object} data An object containing arbitrary data supplied by the drag source
+     * @return {Boolean} True if the drop was valid, else false
+     */
+    onContainerDrop : function(dd, e, data){
+        return false;
+    },
+
+    /**
+     * The function a {@link Roo.dd.DragSource} calls once to notify this drop zone that the source is now over
+     * the zone.  The default implementation returns this.dropNotAllowed and expects that only registered drop
+     * nodes can process drag drop operations, so if you need the drop zone itself to be able to process drops
+     * you should override this method and provide a custom implementation.
+     * @param {Roo.dd.DragSource} source The drag source that was dragged over this drop zone
+     * @param {Event} e The event
+     * @param {Object} data An object containing arbitrary data supplied by the drag source
+     * @return {String} status The CSS class that communicates the drop status back to the source so that the
+     * underlying {@link Roo.dd.StatusProxy} can be updated
+     */
+    notifyEnter : function(dd, e, data){
+        return this.dropNotAllowed;
+    },
+
+    /**
+     * The function a {@link Roo.dd.DragSource} calls continuously while it is being dragged over the drop zone.
+     * This method will be called on every mouse movement while the drag source is over the drop zone.
+     * It will call {@link #onNodeOver} while the drag source is over a registered node, and will also automatically
+     * delegate to the appropriate node-specific methods as necessary when the drag source enters and exits
+     * registered nodes ({@link #onNodeEnter}, {@link #onNodeOut}). If the drag source is not currently over a
+     * registered node, it will call {@link #onContainerOver}.
+     * @param {Roo.dd.DragSource} source The drag source that was dragged over this drop zone
+     * @param {Event} e The event
+     * @param {Object} data An object containing arbitrary data supplied by the drag source
+     * @return {String} status The CSS class that communicates the drop status back to the source so that the
+     * underlying {@link Roo.dd.StatusProxy} can be updated
+     */
+    notifyOver : function(dd, e, data){
+        var n = this.getTargetFromEvent(e);
+        if(!n){ // not over valid drop target
+            if(this.lastOverNode){
+                this.onNodeOut(this.lastOverNode, dd, e, data);
+                this.lastOverNode = null;
+            }
+            return this.onContainerOver(dd, e, data);
+        }
+        if(this.lastOverNode != n){
+            if(this.lastOverNode){
+                this.onNodeOut(this.lastOverNode, dd, e, data);
+            }
+            this.onNodeEnter(n, dd, e, data);
+            this.lastOverNode = n;
+        }
+        return this.onNodeOver(n, dd, e, data);
+    },
+
+    /**
+     * The function a {@link Roo.dd.DragSource} calls once to notify this drop zone that the source has been dragged
+     * out of the zone without dropping.  If the drag source is currently over a registered node, the notification
+     * will be delegated to {@link #onNodeOut} for node-specific handling, otherwise it will be ignored.
+     * @param {Roo.dd.DragSource} source The drag source that was dragged over this drop target
+     * @param {Event} e The event
+     * @param {Object} data An object containing arbitrary data supplied by the drag zone
+     */
+    notifyOut : function(dd, e, data){
+        if(this.lastOverNode){
+            this.onNodeOut(this.lastOverNode, dd, e, data);
+            this.lastOverNode = null;
+        }
+    },
+
+    /**
+     * The function a {@link Roo.dd.DragSource} calls once to notify this drop zone that the dragged item has
+     * been dropped on it.  The drag zone will look up the target node based on the event passed in, and if there
+     * is a node registered for that event, it will delegate to {@link #onNodeDrop} for node-specific handling,
+     * otherwise it will call {@link #onContainerDrop}.
+     * @param {Roo.dd.DragSource} source The drag source that was dragged over this drop zone
+     * @param {Event} e The event
+     * @param {Object} data An object containing arbitrary data supplied by the drag source
+     * @return {Boolean} True if the drop was valid, else false
+     */
+    notifyDrop : function(dd, e, data){
+        if(this.lastOverNode){
+            this.onNodeOut(this.lastOverNode, dd, e, data);
+            this.lastOverNode = null;
+        }
+        var n = this.getTargetFromEvent(e);
+        return n ?
+            this.onNodeDrop(n, dd, e, data) :
+            this.onContainerDrop(dd, e, data);
+    },
+
+    // private
+    triggerCacheRefresh : function(){
+        Roo.dd.DDM.refreshCache(this.groups);
+    }  
+});
\ No newline at end of file
diff --git a/Roo/dd/Registry.js b/Roo/dd/Registry.js
new file mode 100644 (file)
index 0000000..e91c440
--- /dev/null
@@ -0,0 +1,133 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+
+/**
+ * @class Roo.dd.Registry
+ * Provides easy access to all drag drop components that are registered on a page.  Items can be retrieved either
+ * directly by DOM node id, or by passing in the drag drop event that occurred and looking up the event target.
+ * @singleton
+ */
+Roo.dd.Registry = function(){
+    var elements = {}; 
+    var handles = {}; 
+    var autoIdSeed = 0;
+
+    var getId = function(el, autogen){
+        if(typeof el == "string"){
+            return el;
+        }
+        var id = el.id;
+        if(!id && autogen !== false){
+            id = "roodd-" + (++autoIdSeed);
+            el.id = id;
+        }
+        return id;
+    };
+    
+    return {
+    /**
+     * Register a drag drop element
+     * @param {String/HTMLElement) element The id or DOM node to register
+     * @param {Object} data (optional) A custom data object that will be passed between the elements that are involved
+     * in drag drop operations.  You can populate this object with any arbitrary properties that your own code
+     * knows how to interpret, plus there are some specific properties known to the Registry that should be
+     * populated in the data object (if applicable):
+     * <pre>
+Value      Description<br />
+---------  ------------------------------------------<br />
+handles    Array of DOM nodes that trigger dragging<br />
+           for the element being registered<br />
+isHandle   True if the element passed in triggers<br />
+           dragging itself, else false
+</pre>
+     */
+        register : function(el, data){
+            data = data || {};
+            if(typeof el == "string"){
+                el = document.getElementById(el);
+            }
+            data.ddel = el;
+            elements[getId(el)] = data;
+            if(data.isHandle !== false){
+                handles[data.ddel.id] = data;
+            }
+            if(data.handles){
+                var hs = data.handles;
+                for(var i = 0, len = hs.length; i < len; i++){
+                       handles[getId(hs[i])] = data;
+                }
+            }
+        },
+
+    /**
+     * Unregister a drag drop element
+     * @param {String/HTMLElement) element The id or DOM node to unregister
+     */
+        unregister : function(el){
+            var id = getId(el, false);
+            var data = elements[id];
+            if(data){
+                delete elements[id];
+                if(data.handles){
+                    var hs = data.handles;
+                    for(var i = 0, len = hs.length; i < len; i++){
+                       delete handles[getId(hs[i], false)];
+                    }
+                }
+            }
+        },
+
+    /**
+     * Returns the handle registered for a DOM Node by id
+     * @param {String/HTMLElement} id The DOM node or id to look up
+     * @return {Object} handle The custom handle data
+     */
+        getHandle : function(id){
+            if(typeof id != "string"){ // must be element?
+                id = id.id;
+            }
+            return handles[id];
+        },
+
+    /**
+     * Returns the handle that is registered for the DOM node that is the target of the event
+     * @param {Event} e The event
+     * @return {Object} handle The custom handle data
+     */
+        getHandleFromEvent : function(e){
+            var t = Roo.lib.Event.getTarget(e);
+            return t ? handles[t.id] : null;
+        },
+
+    /**
+     * Returns a custom data object that is registered for a DOM node by id
+     * @param {String/HTMLElement} id The DOM node or id to look up
+     * @return {Object} data The custom data
+     */
+        getTarget : function(id){
+            if(typeof id != "string"){ // must be element?
+                id = id.id;
+            }
+            return elements[id];
+        },
+
+    /**
+     * Returns a custom data object that is registered for the DOM node that is the target of the event
+     * @param {Event} e The event
+     * @return {Object} data The custom data
+     */
+        getTargetFromEvent : function(e){
+            var t = Roo.lib.Event.getTarget(e);
+            return t ? elements[t.id] || handles[t.id] : null;
+        }
+    };
+}();
\ No newline at end of file
diff --git a/Roo/dd/ScrollManager.js b/Roo/dd/ScrollManager.js
new file mode 100644 (file)
index 0000000..2f5092e
--- /dev/null
@@ -0,0 +1,182 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+
+/**
+ * @class Roo.dd.ScrollManager
+ * Provides automatic scrolling of overflow regions in the page during drag operations.<br><br>
+ * <b>Note: This class uses "Point Mode" and is untested in "Intersect Mode".</b>
+ * @singleton
+ */
+Roo.dd.ScrollManager = function(){
+    var ddm = Roo.dd.DragDropMgr;
+    var els = {};
+    var dragEl = null;
+    var proc = {};
+    
+    var onStop = function(e){
+        dragEl = null;
+        clearProc();
+    };
+    
+    var triggerRefresh = function(){
+        if(ddm.dragCurrent){
+             ddm.refreshCache(ddm.dragCurrent.groups);
+        }
+    };
+    
+    var doScroll = function(){
+        if(ddm.dragCurrent){
+            var dds = Roo.dd.ScrollManager;
+            if(!dds.animate){
+                if(proc.el.scroll(proc.dir, dds.increment)){
+                    triggerRefresh();
+                }
+            }else{
+                proc.el.scroll(proc.dir, dds.increment, true, dds.animDuration, triggerRefresh);
+            }
+        }
+    };
+    
+    var clearProc = function(){
+        if(proc.id){
+            clearInterval(proc.id);
+        }
+        proc.id = 0;
+        proc.el = null;
+        proc.dir = "";
+    };
+    
+    var startProc = function(el, dir){
+        clearProc();
+        proc.el = el;
+        proc.dir = dir;
+        proc.id = setInterval(doScroll, Roo.dd.ScrollManager.frequency);
+    };
+    
+    var onFire = function(e, isDrop){
+        if(isDrop || !ddm.dragCurrent){ return; }
+        var dds = Roo.dd.ScrollManager;
+        if(!dragEl || dragEl != ddm.dragCurrent){
+            dragEl = ddm.dragCurrent;
+            // refresh regions on drag start
+            dds.refreshCache();
+        }
+        
+        var xy = Roo.lib.Event.getXY(e);
+        var pt = new Roo.lib.Point(xy[0], xy[1]);
+        for(var id in els){
+            var el = els[id], r = el._region;
+            if(r && r.contains(pt) && el.isScrollable()){
+                if(r.bottom - pt.y <= dds.thresh){
+                    if(proc.el != el){
+                        startProc(el, "down");
+                    }
+                    return;
+                }else if(r.right - pt.x <= dds.thresh){
+                    if(proc.el != el){
+                        startProc(el, "left");
+                    }
+                    return;
+                }else if(pt.y - r.top <= dds.thresh){
+                    if(proc.el != el){
+                        startProc(el, "up");
+                    }
+                    return;
+                }else if(pt.x - r.left <= dds.thresh){
+                    if(proc.el != el){
+                        startProc(el, "right");
+                    }
+                    return;
+                }
+            }
+        }
+        clearProc();
+    };
+    
+    ddm.fireEvents = ddm.fireEvents.createSequence(onFire, ddm);
+    ddm.stopDrag = ddm.stopDrag.createSequence(onStop, ddm);
+    
+    return {
+        /**
+         * Registers new overflow element(s) to auto scroll
+         * @param {String/HTMLElement/Element/Array} el The id of or the element to be scrolled or an array of either
+         */
+        register : function(el){
+            if(el instanceof Array){
+                for(var i = 0, len = el.length; i < len; i++) {
+                       this.register(el[i]);
+                }
+            }else{
+                el = Roo.get(el);
+                els[el.id] = el;
+            }
+        },
+        
+        /**
+         * Unregisters overflow element(s) so they are no longer scrolled
+         * @param {String/HTMLElement/Element/Array} el The id of or the element to be removed or an array of either
+         */
+        unregister : function(el){
+            if(el instanceof Array){
+                for(var i = 0, len = el.length; i < len; i++) {
+                       this.unregister(el[i]);
+                }
+            }else{
+                el = Roo.get(el);
+                delete els[el.id];
+            }
+        },
+        
+        /**
+         * The number of pixels from the edge of a container the pointer needs to be to 
+         * trigger scrolling (defaults to 25)
+         * @type Number
+         */
+        thresh : 25,
+        
+        /**
+         * The number of pixels to scroll in each scroll increment (defaults to 50)
+         * @type Number
+         */
+        increment : 100,
+        
+        /**
+         * The frequency of scrolls in milliseconds (defaults to 500)
+         * @type Number
+         */
+        frequency : 500,
+        
+        /**
+         * True to animate the scroll (defaults to true)
+         * @type Boolean
+         */
+        animate: true,
+        
+        /**
+         * The animation duration in seconds - 
+         * MUST BE less than Roo.dd.ScrollManager.frequency! (defaults to .4)
+         * @type Number
+         */
+        animDuration: .4,
+        
+        /**
+         * Manually trigger a cache refresh.
+         */
+        refreshCache : function(){
+            for(var id in els){
+                if(typeof els[id] == 'object'){ // for people extending the object prototype
+                    els[id]._region = els[id].getRegion();
+                }
+            }
+        }
+    };
+}();
\ No newline at end of file
diff --git a/Roo/dd/StatusProxy.js b/Roo/dd/StatusProxy.js
new file mode 100644 (file)
index 0000000..8c870d9
--- /dev/null
@@ -0,0 +1,177 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+
+/**
+ * @class Roo.dd.StatusProxy
+ * A specialized drag proxy that supports a drop status icon, {@link Roo.Layer} styles and auto-repair.  This is the
+ * default drag proxy used by all Roo.dd components.
+ * @constructor
+ * @param {Object} config
+ */
+Roo.dd.StatusProxy = function(config){
+    Roo.apply(this, config);
+    this.id = this.id || Roo.id();
+    this.el = new Roo.Layer({
+        dh: {
+            id: this.id, tag: "div", cls: "x-dd-drag-proxy "+this.dropNotAllowed, children: [
+                {tag: "div", cls: "x-dd-drop-icon"},
+                {tag: "div", cls: "x-dd-drag-ghost"}
+            ]
+        }, 
+        shadow: !config || config.shadow !== false
+    });
+    this.ghost = Roo.get(this.el.dom.childNodes[1]);
+    this.dropStatus = this.dropNotAllowed;
+};
+
+Roo.dd.StatusProxy.prototype = {
+    /**
+     * @cfg {String} dropAllowed
+     * The CSS class to apply to the status element when drop is allowed (defaults to "x-dd-drop-ok").
+     */
+    dropAllowed : "x-dd-drop-ok",
+    /**
+     * @cfg {String} dropNotAllowed
+     * The CSS class to apply to the status element when drop is not allowed (defaults to "x-dd-drop-nodrop").
+     */
+    dropNotAllowed : "x-dd-drop-nodrop",
+
+    /**
+     * Updates the proxy's visual element to indicate the status of whether or not drop is allowed
+     * over the current target element.
+     * @param {String} cssClass The css class for the new drop status indicator image
+     */
+    setStatus : function(cssClass){
+        cssClass = cssClass || this.dropNotAllowed;
+        if(this.dropStatus != cssClass){
+            this.el.replaceClass(this.dropStatus, cssClass);
+            this.dropStatus = cssClass;
+        }
+    },
+
+    /**
+     * Resets the status indicator to the default dropNotAllowed value
+     * @param {Boolean} clearGhost True to also remove all content from the ghost, false to preserve it
+     */
+    reset : function(clearGhost){
+        this.el.dom.className = "x-dd-drag-proxy " + this.dropNotAllowed;
+        this.dropStatus = this.dropNotAllowed;
+        if(clearGhost){
+            this.ghost.update("");
+        }
+    },
+
+    /**
+     * Updates the contents of the ghost element
+     * @param {String} html The html that will replace the current innerHTML of the ghost element
+     */
+    update : function(html){
+        if(typeof html == "string"){
+            this.ghost.update(html);
+        }else{
+            this.ghost.update("");
+            html.style.margin = "0";
+            this.ghost.dom.appendChild(html);
+        }
+        // ensure float = none set?? cant remember why though.
+        var el = this.ghost.dom.firstChild;
+               if(el){
+                       Roo.fly(el).setStyle('float', 'none');
+               }
+    },
+    
+    /**
+     * Returns the underlying proxy {@link Roo.Layer}
+     * @return {Roo.Layer} el
+    */
+    getEl : function(){
+        return this.el;
+    },
+
+    /**
+     * Returns the ghost element
+     * @return {Roo.Element} el
+     */
+    getGhost : function(){
+        return this.ghost;
+    },
+
+    /**
+     * Hides the proxy
+     * @param {Boolean} clear True to reset the status and clear the ghost contents, false to preserve them
+     */
+    hide : function(clear){
+        this.el.hide();
+        if(clear){
+            this.reset(true);
+        }
+    },
+
+    /**
+     * Stops the repair animation if it's currently running
+     */
+    stop : function(){
+        if(this.anim && this.anim.isAnimated && this.anim.isAnimated()){
+            this.anim.stop();
+        }
+    },
+
+    /**
+     * Displays this proxy
+     */
+    show : function(){
+        this.el.show();
+    },
+
+    /**
+     * Force the Layer to sync its shadow and shim positions to the element
+     */
+    sync : function(){
+        this.el.sync();
+    },
+
+    /**
+     * Causes the proxy to return to its position of origin via an animation.  Should be called after an
+     * invalid drop operation by the item being dragged.
+     * @param {Array} xy The XY position of the element ([x, y])
+     * @param {Function} callback The function to call after the repair is complete
+     * @param {Object} scope The scope in which to execute the callback
+     */
+    repair : function(xy, callback, scope){
+        this.callback = callback;
+        this.scope = scope;
+        if(xy && this.animRepair !== false){
+            this.el.addClass("x-dd-drag-repair");
+            this.el.hideUnders(true);
+            this.anim = this.el.shift({
+                duration: this.repairDuration || .5,
+                easing: 'easeOut',
+                xy: xy,
+                stopFx: true,
+                callback: this.afterRepair,
+                scope: this
+            });
+        }else{
+            this.afterRepair();
+        }
+    },
+
+    // private
+    afterRepair : function(){
+        this.hide(true);
+        if(typeof this.callback == "function"){
+            this.callback.call(this.scope || this);
+        }
+        this.callback = null;
+        this.scope = null;
+    }
+};
\ No newline at end of file
diff --git a/Roo/form/Action.js b/Roo/form/Action.js
new file mode 100644 (file)
index 0000000..0a14686
--- /dev/null
@@ -0,0 +1,244 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+ /**
+ * @class Roo.form.Action
+ * Internal Class used to handle form actions
+ * @constructor
+ * @param {Roo.form.BasicForm} el The form element or its id
+ * @param {Object} config Configuration options
+ */
+// define the action interface
+Roo.form.Action = function(form, options){
+    this.form = form;
+    this.options = options || {};
+};
+/**
+ * Client Validation Failed
+ * @const 
+ */
+Roo.form.Action.CLIENT_INVALID = 'client';
+/**
+ * Server Validation Failed
+ * @const 
+ */
+ Roo.form.Action.SERVER_INVALID = 'server';
+ /**
+ * Connect to Server Failed
+ * @const 
+ */
+Roo.form.Action.CONNECT_FAILURE = 'connect';
+/**
+ * Reading Data from Server Failed
+ * @const 
+ */
+Roo.form.Action.LOAD_FAILURE = 'load';
+
+Roo.form.Action.prototype = {
+    type : 'default',
+    failureType : undefined,
+    response : undefined,
+    result : undefined,
+
+    // interface method
+    run : function(options){
+
+    },
+
+    // interface method
+    success : function(response){
+
+    },
+
+    // interface method
+    handleResponse : function(response){
+
+    },
+
+    // default connection failure
+    failure : function(response){
+        this.response = response;
+        this.failureType = Roo.form.Action.CONNECT_FAILURE;
+        this.form.afterAction(this, false);
+    },
+
+    processResponse : function(response){
+        this.response = response;
+        if(!response.responseText){
+            return true;
+        }
+        this.result = this.handleResponse(response);
+        return this.result;
+    },
+
+    // utility functions used internally
+    getUrl : function(appendParams){
+        var url = this.options.url || this.form.url || this.form.el.dom.action;
+        if(appendParams){
+            var p = this.getParams();
+            if(p){
+                url += (url.indexOf('?') != -1 ? '&' : '?') + p;
+            }
+        }
+        return url;
+    },
+
+    getMethod : function(){
+        return (this.options.method || this.form.method || this.form.el.dom.method || 'POST').toUpperCase();
+    },
+
+    getParams : function(){
+        var bp = this.form.baseParams;
+        var p = this.options.params;
+        if(p){
+            if(typeof p == "object"){
+                p = Roo.urlEncode(Roo.applyIf(p, bp));
+            }else if(typeof p == 'string' && bp){
+                p += '&' + Roo.urlEncode(bp);
+            }
+        }else if(bp){
+            p = Roo.urlEncode(bp);
+        }
+        return p;
+    },
+
+    createCallback : function(){
+        return {
+            success: this.success,
+            failure: this.failure,
+            scope: this,
+            timeout: (this.form.timeout*1000),
+            upload: this.form.fileUpload ? this.success : undefined
+        };
+    }
+};
+
+Roo.form.Action.Submit = function(form, options){
+    Roo.form.Action.Submit.superclass.constructor.call(this, form, options);
+};
+
+Roo.extend(Roo.form.Action.Submit, Roo.form.Action, {
+    type : 'submit',
+
+    run : function(){
+        var o = this.options;
+        var method = this.getMethod();
+        var isPost = method == 'POST';
+        if(o.clientValidation === false || this.form.isValid()){
+            Roo.Ajax.request(Roo.apply(this.createCallback(), {
+                form:this.form.el.dom,
+                url:this.getUrl(!isPost),
+                method: method,
+                params:isPost ? this.getParams() : null,
+                isUpload: this.form.fileUpload
+            }));
+
+        }else if (o.clientValidation !== false){ // client validation failed
+            this.failureType = Roo.form.Action.CLIENT_INVALID;
+            this.form.afterAction(this, false);
+        }
+    },
+
+    success : function(response){
+        var result = this.processResponse(response);
+        if(result === true || result.success){
+            this.form.afterAction(this, true);
+            return;
+        }
+        if(result.errors){
+            this.form.markInvalid(result.errors);
+            this.failureType = Roo.form.Action.SERVER_INVALID;
+        }
+        this.form.afterAction(this, false);
+    },
+
+    handleResponse : function(response){
+        if(this.form.errorReader){
+            var rs = this.form.errorReader.read(response);
+            var errors = [];
+            if(rs.records){
+                for(var i = 0, len = rs.records.length; i < len; i++) {
+                    var r = rs.records[i];
+                    errors[i] = r.data;
+                }
+            }
+            if(errors.length < 1){
+                errors = null;
+            }
+            return {
+                success : rs.success,
+                errors : errors
+            };
+        }
+        var ret = false;
+        try {
+            ret = Roo.decode(response.responseText);
+        } catch (e) {
+            ret = {
+                success: false,
+                errorMsg: "Failed to read server message: " + response.responseText,
+                errors : []
+            };
+        }
+        return ret;
+        
+    }
+});
+
+
+Roo.form.Action.Load = function(form, options){
+    Roo.form.Action.Load.superclass.constructor.call(this, form, options);
+    this.reader = this.form.reader;
+};
+
+Roo.extend(Roo.form.Action.Load, Roo.form.Action, {
+    type : 'load',
+
+    run : function(){
+        Roo.Ajax.request(Roo.apply(
+                this.createCallback(), {
+                    method:this.getMethod(),
+                    url:this.getUrl(false),
+                    params:this.getParams()
+        }));
+    },
+
+    success : function(response){
+        var result = this.processResponse(response);
+        if(result === true || !result.success || !result.data){
+            this.failureType = Roo.form.Action.LOAD_FAILURE;
+            this.form.afterAction(this, false);
+            return;
+        }
+        this.form.clearInvalid();
+        this.form.setValues(result.data);
+        this.form.afterAction(this, true);
+    },
+
+    handleResponse : function(response){
+        if(this.form.reader){
+            var rs = this.form.reader.read(response);
+            var data = rs.records && rs.records[0] ? rs.records[0].data : null;
+            return {
+                success : rs.success,
+                data : data
+            };
+        }
+        return Roo.decode(response.responseText);
+    }
+});
+
+Roo.form.Action.ACTION_TYPES = {
+    'load' : Roo.form.Action.Load,
+    'submit' : Roo.form.Action.Submit
+};
\ No newline at end of file
diff --git a/Roo/form/BasicForm.js b/Roo/form/BasicForm.js
new file mode 100644 (file)
index 0000000..1188b37
--- /dev/null
@@ -0,0 +1,458 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+/**
+ * @class Roo.form.BasicForm
+ * @extends Roo.util.Observable
+ * Supplies the functionality to do "actions" on forms and initialize Roo.form.Field types on existing markup.
+ * @constructor
+ * @param {String/HTMLElement/Roo.Element} el The form element or its id
+ * @param {Object} config Configuration options
+ */
+Roo.form.BasicForm = function(el, config){
+    Roo.apply(this, config);
+    /*
+     * The Roo.form.Field items in this form.
+     * @type MixedCollection
+     */
+    this.items = new Roo.util.MixedCollection(false, function(o){
+        return o.id || (o.id = Roo.id());
+    });
+    this.addEvents({
+        /**
+         * @event beforeaction
+         * Fires before any action is performed. Return false to cancel the action.
+         * @param {Form} this
+         * @param {Action} action The action to be performed
+         */
+        beforeaction: true,
+        /**
+         * @event actionfailed
+         * Fires when an action fails.
+         * @param {Form} this
+         * @param {Action} action The action that failed
+         */
+        actionfailed : true,
+        /**
+         * @event actioncomplete
+         * Fires when an action is completed.
+         * @param {Form} this
+         * @param {Action} action The action that completed
+         */
+        actioncomplete : true
+    });
+    if(el){
+        this.initEl(el);
+    }
+    Roo.form.BasicForm.superclass.constructor.call(this);
+};
+
+Roo.extend(Roo.form.BasicForm, Roo.util.Observable, {
+    /**
+     * @cfg {String} method
+     * The request method to use (GET or POST) for form actions if one isn't supplied in the action options.
+     */
+    /**
+     * @cfg {DataReader} reader
+     * An Roo.data.DataReader (e.g. {@link Roo.data.XmlReader}) to be used to read data when executing "load" actions.
+     * This is optional as there is built-in support for processing JSON.
+     */
+    /**
+     * @cfg {DataReader} errorReader
+     * An Roo.data.DataReader (e.g. {@link Roo.data.XmlReader}) to be used to read data when reading validation errors on "submit" actions.
+     * This is completely optional as there is built-in support for processing JSON.
+     */
+    /**
+     * @cfg {String} url
+     * The URL to use for form actions if one isn't supplied in the action options.
+     */
+    /**
+     * @cfg {Boolean} fileUpload
+     * Set to true if this form is a file upload.
+     */
+    /**
+     * @cfg {Object} baseParams
+     * Parameters to pass with all requests. e.g. baseParams: {id: '123', foo: 'bar'}.
+     */
+    /**
+     * @cfg {Number} timeout Timeout for form actions in seconds (default is 30 seconds).
+     */
+    timeout: 30,
+
+    // private
+    activeAction : null,
+
+    /**
+     * @cfg {Boolean} trackResetOnLoad If set to true, form.reset() resets to the last loaded
+     * or setValues() data instead of when the form was first created.
+     */
+    trackResetOnLoad : false,
+
+    /**
+     * By default wait messages are displayed with Roo.MessageBox.wait. You can target a specific
+     * element by passing it or its id or mask the form itself by passing in true.
+     * @type Mixed
+     */
+    waitMsgTarget : undefined,
+
+    // private
+    initEl : function(el){
+        this.el = Roo.get(el);
+        this.id = this.el.id || Roo.id();
+        this.el.on('submit', this.onSubmit, this);
+        this.el.addClass('x-form');
+    },
+
+    // private
+    onSubmit : function(e){
+        e.stopEvent();
+    },
+
+    /**
+     * Returns true if client-side validation on the form is successful.
+     * @return Boolean
+     */
+    isValid : function(){
+        var valid = true;
+        this.items.each(function(f){
+           if(!f.validate()){
+               valid = false;
+           }
+        });
+        return valid;
+    },
+
+    /**
+     * Returns true if any fields in this form have changed since their original load.
+     * @return Boolean
+     */
+    isDirty : function(){
+        var dirty = false;
+        this.items.each(function(f){
+           if(f.isDirty()){
+               dirty = true;
+               return false;
+           }
+        });
+        return dirty;
+    },
+
+    /**
+     * Performs a predefined action (submit or load) or custom actions you define on this form.
+     * @param {String} actionName The name of the action type
+     * @param {Object} options (optional) The options to pass to the action.  All of the config options listed
+     * below are supported by both the submit and load actions unless otherwise noted (custom actions could also
+     * accept other config options):
+     * <pre>
+Property          Type             Description
+----------------  ---------------  ----------------------------------------------------------------------------------
+url               String           The url for the action (defaults to the form's url)
+method            String           The form method to use (defaults to the form's method, or POST if not defined)
+params            String/Object    The params to pass (defaults to the form's baseParams, or none if not defined)
+clientValidation  Boolean          Applies to submit only.  Pass true to call form.isValid() prior to posting to
+                                   validate the form on the client (defaults to false)
+     * </pre>
+     * @return {BasicForm} this
+     */
+    doAction : function(action, options){
+        if(typeof action == 'string'){
+            action = new Roo.form.Action.ACTION_TYPES[action](this, options);
+        }
+        if(this.fireEvent('beforeaction', this, action) !== false){
+            this.beforeAction(action);
+            action.run.defer(100, action);
+        }
+        return this;
+    },
+
+    /**
+     * Shortcut to do a submit action.
+     * @param {Object} options The options to pass to the action (see {@link #doAction} for details)
+     * @return {BasicForm} this
+     */
+    submit : function(options){
+        this.doAction('submit', options);
+        return this;
+    },
+
+    /**
+     * Shortcut to do a load action.
+     * @param {Object} options The options to pass to the action (see {@link #doAction} for details)
+     * @return {BasicForm} this
+     */
+    load : function(options){
+        this.doAction('load', options);
+        return this;
+    },
+
+    /**
+     * Persists the values in this form into the passed Roo.data.Record object in a beginEdit/endEdit block.
+     * @param {Record} record The record to edit
+     * @return {BasicForm} this
+     */
+    updateRecord : function(record){
+        record.beginEdit();
+        var fs = record.fields;
+        fs.each(function(f){
+            var field = this.findField(f.name);
+            if(field){
+                record.set(f.name, field.getValue());
+            }
+        }, this);
+        record.endEdit();
+        return this;
+    },
+
+    /**
+     * Loads an Roo.data.Record into this form.
+     * @param {Record} record The record to load
+     * @return {BasicForm} this
+     */
+    loadRecord : function(record){
+        this.setValues(record.data);
+        return this;
+    },
+
+    // private
+    beforeAction : function(action){
+        var o = action.options;
+        if(o.waitMsg){
+            if(this.waitMsgTarget === true){
+                this.el.mask(o.waitMsg, 'x-mask-loading');
+            }else if(this.waitMsgTarget){
+                this.waitMsgTarget = Roo.get(this.waitMsgTarget);
+                this.waitMsgTarget.mask(o.waitMsg, 'x-mask-loading');
+            }else{
+                Roo.MessageBox.wait(o.waitMsg, o.waitTitle || this.waitTitle || 'Please Wait...');
+            }
+        }
+    },
+
+    // private
+    afterAction : function(action, success){
+        this.activeAction = null;
+        var o = action.options;
+        if(o.waitMsg){
+            if(this.waitMsgTarget === true){
+                this.el.unmask();
+            }else if(this.waitMsgTarget){
+                this.waitMsgTarget.unmask();
+            }else{
+                Roo.MessageBox.updateProgress(1);
+                Roo.MessageBox.hide();
+            }
+        }
+        if(success){
+            if(o.reset){
+                this.reset();
+            }
+            Roo.callback(o.success, o.scope, [this, action]);
+            this.fireEvent('actioncomplete', this, action);
+        }else{
+            Roo.callback(o.failure, o.scope, [this, action]);
+            this.fireEvent('actionfailed', this, action);
+        }
+    },
+
+    /**
+     * Find a Roo.form.Field in this form by id, dataIndex, name or hiddenName
+     * @param {String} id The value to search for
+     * @return Field
+     */
+    findField : function(id){
+        var field = this.items.get(id);
+        if(!field){
+            this.items.each(function(f){
+                if(f.isFormField && (f.dataIndex == id || f.id == id || f.getName() == id)){
+                    field = f;
+                    return false;
+                }
+            });
+        }
+        return field || null;
+    },
+
+
+    /**
+     * Mark fields in this form invalid in bulk.
+     * @param {Array/Object} errors Either an array in the form [{id:'fieldId', msg:'The message'},...] or an object hash of {id: msg, id2: msg2}
+     * @return {BasicForm} this
+     */
+    markInvalid : function(errors){
+        if(errors instanceof Array){
+            for(var i = 0, len = errors.length; i < len; i++){
+                var fieldError = errors[i];
+                var f = this.findField(fieldError.id);
+                if(f){
+                    f.markInvalid(fieldError.msg);
+                }
+            }
+        }else{
+            var field, id;
+            for(id in errors){
+                if(typeof errors[id] != 'function' && (field = this.findField(id))){
+                    field.markInvalid(errors[id]);
+                }
+            }
+        }
+        return this;
+    },
+
+    /**
+     * Set values for fields in this form in bulk.
+     * @param {Array/Object} values Either an array in the form [{id:'fieldId', value:'foo'},...] or an object hash of {id: value, id2: value2}
+     * @return {BasicForm} this
+     */
+    setValues : function(values){
+        if(values instanceof Array){ // array of objects
+            for(var i = 0, len = values.length; i < len; i++){
+                var v = values[i];
+                var f = this.findField(v.id);
+                if(f){
+                    f.setValue(v.value);
+                    if(this.trackResetOnLoad){
+                        f.originalValue = f.getValue();
+                    }
+                }
+            }
+        }else{ // object hash
+            var field, id;
+            for(id in values){
+                if(typeof values[id] != 'function' && (field = this.findField(id))){
+                    
+                    if (field.setFromData && 
+                        field.valueField && 
+                        field.displayField &&
+                        // combos' with local stores can 
+                        // be queried via setValue()
+                        // to set their value..
+                        (field.store && !field.store.isLocal)
+                        ) {
+                        // it's a combo
+                        var sd = { };
+                        sd[field.valueField] = typeof(values[field.hiddenName]) == 'undefined' ? '' : values[field.hiddenName];
+                        sd[field.displayField] = typeof(values[field.name]) == 'undefined' ? '' : values[field.name];
+                        field.setFromData(sd);
+                        
+                    } else {
+                        field.setValue(values[id]);
+                    }
+                    
+                    
+                    if(this.trackResetOnLoad){
+                        field.originalValue = field.getValue();
+                    }
+                }
+            }
+        }
+        return this;
+    },
+
+    /**
+     * Returns the fields in this form as an object with key/value pairs. If multiple fields exist with the same name
+     * they are returned as an array.
+     * @param {Boolean} asString
+     * @return {Object}
+     */
+    getValues : function(asString){
+        var fs = Roo.lib.Ajax.serializeForm(this.el.dom);
+        if(asString === true){
+            return fs;
+        }
+        return Roo.urlDecode(fs);
+    },
+
+    /**
+     * Clears all invalid messages in this form.
+     * @return {BasicForm} this
+     */
+    clearInvalid : function(){
+        this.items.each(function(f){
+           f.clearInvalid();
+        });
+        return this;
+    },
+
+    /**
+     * Resets this form.
+     * @return {BasicForm} this
+     */
+    reset : function(){
+        this.items.each(function(f){
+            f.reset();
+        });
+        return this;
+    },
+
+    /**
+     * Add Roo.form components to this form.
+     * @param {Field} field1
+     * @param {Field} field2 (optional)
+     * @param {Field} etc (optional)
+     * @return {BasicForm} this
+     */
+    add : function(){
+        this.items.addAll(Array.prototype.slice.call(arguments, 0));
+        return this;
+    },
+
+
+    /**
+     * Removes a field from the items collection (does NOT remove its markup).
+     * @param {Field} field
+     * @return {BasicForm} this
+     */
+    remove : function(field){
+        this.items.remove(field);
+        return this;
+    },
+
+    /**
+     * Looks at the fields in this form, checks them for an id attribute,
+     * and calls applyTo on the existing dom element with that id.
+     * @return {BasicForm} this
+     */
+    render : function(){
+        this.items.each(function(f){
+            if(f.isFormField && !f.rendered && document.getElementById(f.id)){ // if the element exists
+                f.applyTo(f.id);
+            }
+        });
+        return this;
+    },
+
+    /**
+     * Calls {@link Ext#apply} for all fields in this form with the passed object.
+     * @param {Object} values
+     * @return {BasicForm} this
+     */
+    applyToFields : function(o){
+        this.items.each(function(f){
+           Roo.apply(f, o);
+        });
+        return this;
+    },
+
+    /**
+     * Calls {@link Ext#applyIf} for all field in this form with the passed object.
+     * @param {Object} values
+     * @return {BasicForm} this
+     */
+    applyIfToFields : function(o){
+        this.items.each(function(f){
+           Roo.applyIf(f, o);
+        });
+        return this;
+    }
+});
+
+// back compat
+Roo.BasicForm = Roo.form.BasicForm;
\ No newline at end of file
diff --git a/Roo/form/Checkbox.js b/Roo/form/Checkbox.js
new file mode 100644 (file)
index 0000000..ef3d3e7
--- /dev/null
@@ -0,0 +1,210 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+/**
+ * @class Roo.form.Checkbox
+ * @extends Roo.form.Field
+ * Single checkbox field.  Can be used as a direct replacement for traditional checkbox fields.
+ * @constructor
+ * Creates a new Checkbox
+ * @param {Object} config Configuration options
+ */
+Roo.form.Checkbox = function(config){
+    Roo.form.Checkbox.superclass.constructor.call(this, config);
+    this.addEvents({
+        /**
+         * @event check
+         * Fires when the checkbox is checked or unchecked.
+            * @param {Roo.form.Checkbox} this This checkbox
+            * @param {Boolean} checked The new checked value
+            */
+        check : true
+    });
+};
+
+Roo.extend(Roo.form.Checkbox, Roo.form.Field,  {
+    /**
+     * @cfg {String} focusClass The CSS class to use when the checkbox receives focus (defaults to undefined)
+     */
+    focusClass : undefined,
+    /**
+     * @cfg {String} fieldClass The default CSS class for the checkbox (defaults to "x-form-field")
+     */
+    fieldClass: "x-form-field",
+    /**
+     * @cfg {Boolean} checked True if the the checkbox should render already checked (defaults to false)
+     */
+    checked: false,
+    /**
+     * @cfg {String/Object} autoCreate A DomHelper element spec, or true for a default element spec (defaults to
+     * {tag: "input", type: "checkbox", autocomplete: "off"})
+     */
+    defaultAutoCreate : { tag: "input", type: 'hidden', autocomplete: "off"},
+    /**
+     * @cfg {String} boxLabel The text that appears beside the checkbox
+     */
+    boxLabel : "",
+    /**
+     * @cfg {String} inputValue The value that should go into the generated input element's value attribute
+     */  
+    inputValue : '1',
+    /**
+     * @cfg {String} valueOff The value that should go into the generated input element's value when unchecked.
+     */
+     valueOff: '0', // value when not checked..
+
+    actionMode : 'viewEl', 
+    //
+    // private
+    itemCls : 'x-menu-check-item x-form-item',
+    groupClass : 'x-menu-group-item',
+    inputType : 'hidden',
+    
+    
+    inSetChecked: false, // check that we are not calling self...
+    
+    inputElement: false, // real input element?
+    basedOn: false, // ????
+    
+    isFormField: true, // not sure where this is needed!!!!
+
+    onResize : function(){
+        Roo.form.Checkbox.superclass.onResize.apply(this, arguments);
+        if(!this.boxLabel){
+            this.el.alignTo(this.wrap, 'c-c');
+        }
+    },
+
+    initEvents : function(){
+        Roo.form.Checkbox.superclass.initEvents.call(this);
+        this.el.on("click", this.onClick,  this);
+        this.el.on("change", this.onClick,  this);
+    },
+
+
+    getResizeEl : function(){
+        return this.wrap;
+    },
+
+    getPositionEl : function(){
+        return this.wrap;
+    },
+
+    // private
+    onRender : function(ct, position){
+        Roo.form.Checkbox.superclass.onRender.call(this, ct, position);
+        /*
+        if(this.inputValue !== undefined){
+            this.el.dom.value = this.inputValue;
+        }
+        */
+        //this.wrap = this.el.wrap({cls: "x-form-check-wrap"});
+        this.wrap = this.el.wrap({cls: 'x-menu-check-item '});
+        var viewEl = this.wrap.createChild({ 
+            tag: 'img', cls: 'x-menu-item-icon', style: 'margin: 0px;' ,src : Roo.BLANK_IMAGE_URL });
+        this.viewEl = viewEl;   
+        this.wrap.on('click', this.onClick,  this); 
+        
+        this.el.on('DOMAttrModified', this.setFromHidden,  this); //ff
+        this.el.on('propertychange', this.setFromHidden,  this);  //ie
+        
+        
+        
+        if(this.boxLabel){
+            this.wrap.createChild({tag: 'label', htmlFor: this.el.id, cls: 'x-form-cb-label', html: this.boxLabel});
+        //    viewEl.on('click', this.onClick,  this); 
+        }
+        //if(this.checked){
+            this.setChecked(this.checked);
+        //}else{
+            //this.checked = this.el.dom;
+        //}
+
+    },
+
+    // private
+    initValue : Roo.emptyFn,
+
+    /**
+     * Returns the checked state of the checkbox.
+     * @return {Boolean} True if checked, else false
+     */
+    getValue : function(){
+        if(this.el){
+            return String(this.el.dom.value) == String(this.inputValue ) ? this.inputValue : this.valueOff;
+        }
+        return this.valueOff;
+        
+    },
+
+       // private
+    onClick : function(){ 
+        this.setChecked(!this.checked);
+
+        //if(this.el.dom.checked != this.checked){
+        //    this.setValue(this.el.dom.checked);
+       // }
+    },
+
+    /**
+     * Sets the checked state of the checkbox.
+     * @param {Boolean/String} checked True, 'true', '1', or 'on' to check the checkbox, any other value will uncheck it.
+     */
+    setValue : function(v,suppressEvent){
+        //this.checked = (v === true || v === 'true' || v == '1' || String(v).toLowerCase() == 'on');
+        //if(this.el && this.el.dom){
+        //    this.el.dom.checked = this.checked;
+        //    this.el.dom.defaultChecked = this.checked;
+        //}
+        this.setChecked(v === this.inputValue);
+        //this.fireEvent("check", this, this.checked);
+    },
+    // private..
+    setChecked : function(state,suppressEvent)
+    {
+        if (this.inSetChecked) {
+            this.checked = state;
+            return;
+        }
+        
+    
+        if(this.wrap){
+            this.wrap[state ? 'addClass' : 'removeClass']('x-menu-item-checked');
+        }
+        this.checked = state;
+        if(suppressEvent !== true){
+            this.fireEvent('checkchange', this, state);
+        }
+        this.inSetChecked = true;
+        this.el.dom.value = state ? this.inputValue : this.valueOff;
+        this.inSetChecked = false;
+        
+    },
+    // handle setting of hidden value by some other method!!?!?
+    setFromHidden: function()
+    {
+        if(!this.el){
+            return;
+        }
+        //console.log("SET FROM HIDDEN");
+        //alert('setFrom hidden');
+        this.setValue(this.el.dom.value);
+    },
+    
+    onDestroy : function()
+    {
+        if(this.viewEl){
+            Roo.get(this.viewEl).remove();
+        }
+         
+        Roo.form.Checkbox.superclass.onDestroy.call(this);
+    }
+
+});
\ No newline at end of file
diff --git a/Roo/form/ComboBox.js b/Roo/form/ComboBox.js
new file mode 100644 (file)
index 0000000..31bd699
--- /dev/null
@@ -0,0 +1,923 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+
+/**
+ * @class Roo.form.ComboBox
+ * @extends Roo.form.TriggerField
+ * A combobox control with support for autocomplete, remote-loading, paging and many other features.
+ * @constructor
+ * Create a new ComboBox.
+ * @param {Object} config Configuration options
+ */
+Roo.form.ComboBox = function(config){
+    Roo.form.ComboBox.superclass.constructor.call(this, config);
+    this.addEvents({
+        /**
+         * @event expand
+         * Fires when the dropdown list is expanded
+            * @param {Roo.form.ComboBox} combo This combo box
+            */
+        'expand' : true,
+        /**
+         * @event collapse
+         * Fires when the dropdown list is collapsed
+            * @param {Roo.form.ComboBox} combo This combo box
+            */
+        'collapse' : true,
+        /**
+         * @event beforeselect
+         * Fires before a list item is selected. Return false to cancel the selection.
+            * @param {Roo.form.ComboBox} combo This combo box
+            * @param {Roo.data.Record} record The data record returned from the underlying store
+            * @param {Number} index The index of the selected item in the dropdown list
+            */
+        'beforeselect' : true,
+        /**
+         * @event select
+         * Fires when a list item is selected
+            * @param {Roo.form.ComboBox} combo This combo box
+            * @param {Roo.data.Record} record The data record returned from the underlying store (or false on clear)
+            * @param {Number} index The index of the selected item in the dropdown list
+            */
+        'select' : true,
+        /**
+         * @event beforequery
+         * Fires before all queries are processed. Return false to cancel the query or set cancel to true.
+         * The event object passed has these properties:
+            * @param {Roo.form.ComboBox} combo This combo box
+            * @param {String} query The query
+            * @param {Boolean} forceAll true to force "all" query
+            * @param {Boolean} cancel true to cancel the query
+            * @param {Object} e The query event object
+            */
+        'beforequery': true
+    });
+    if(this.transform){
+        this.allowDomMove = false;
+        var s = Roo.getDom(this.transform);
+        if(!this.hiddenName){
+            this.hiddenName = s.name;
+        }
+        if(!this.store){
+            this.mode = 'local';
+            var d = [], opts = s.options;
+            for(var i = 0, len = opts.length;i < len; i++){
+                var o = opts[i];
+                var value = (Roo.isIE ? o.getAttributeNode('value').specified : o.hasAttribute('value')) ? o.value : o.text;
+                if(o.selected) {
+                    this.value = value;
+                }
+                d.push([value, o.text]);
+            }
+            this.store = new Roo.data.SimpleStore({
+                'id': 0,
+                fields: ['value', 'text'],
+                data : d
+            });
+            this.valueField = 'value';
+            this.displayField = 'text';
+        }
+        s.name = Roo.id(); // wipe out the name in case somewhere else they have a reference
+        if(!this.lazyRender){
+            this.target = true;
+            this.el = Roo.DomHelper.insertBefore(s, this.autoCreate || this.defaultAutoCreate);
+            s.parentNode.removeChild(s); // remove it
+            this.render(this.el.parentNode);
+        }else{
+            s.parentNode.removeChild(s); // remove it
+        }
+
+    }
+    if (this.store) {
+        this.store = Roo.factory(this.store, Roo.data);
+    }
+    
+    this.selectedIndex = -1;
+    if(this.mode == 'local'){
+        if(config.queryDelay === undefined){
+            this.queryDelay = 10;
+        }
+        if(config.minChars === undefined){
+            this.minChars = 0;
+        }
+    }
+};
+
+Roo.extend(Roo.form.ComboBox, Roo.form.TriggerField, {
+    /**
+     * @cfg {String/HTMLElement/Element} transform The id, DOM node or element of an existing select to convert to a ComboBox
+     */
+    /**
+     * @cfg {Boolean} lazyRender True to prevent the ComboBox from rendering until requested (should always be used when
+     * rendering into an Roo.Editor, defaults to false)
+     */
+    /**
+     * @cfg {Boolean/Object} autoCreate A DomHelper element spec, or true for a default element spec (defaults to:
+     * {tag: "input", type: "text", size: "24", autocomplete: "off"})
+     */
+    /**
+     * @cfg {Roo.data.Store} store The data store to which this combo is bound (defaults to undefined)
+     */
+    /**
+     * @cfg {String} title If supplied, a header element is created containing this text and added into the top of
+     * the dropdown list (defaults to undefined, with no header element)
+     */
+
+     /**
+     * @cfg {String/Roo.Template} tpl The template to use to render the output
+     */
+     
+    // private
+    defaultAutoCreate : {tag: "input", type: "text", size: "24", autocomplete: "off"},
+    /**
+     * @cfg {Number} listWidth The width in pixels of the dropdown list (defaults to the width of the ComboBox field)
+     */
+    listWidth: undefined,
+    /**
+     * @cfg {String} displayField The underlying data field name to bind to this CombBox (defaults to undefined if
+     * mode = 'remote' or 'text' if mode = 'local')
+     */
+    displayField: undefined,
+    /**
+     * @cfg {String} valueField The underlying data value name to bind to this CombBox (defaults to undefined if
+     * mode = 'remote' or 'value' if mode = 'local'). 
+     * Note: use of a valueField requires the user make a selection
+     * in order for a value to be mapped.
+     */
+    valueField: undefined,
+    /**
+     * @cfg {String} hiddenName If specified, a hidden form field with this name is dynamically generated to store the
+     * field's data value (defaults to the underlying DOM element's name)
+     */
+    hiddenName: undefined,
+    /**
+     * @cfg {String} listClass CSS class to apply to the dropdown list element (defaults to '')
+     */
+    listClass: '',
+    /**
+     * @cfg {String} selectedClass CSS class to apply to the selected item in the dropdown list (defaults to 'x-combo-selected')
+     */
+    selectedClass: 'x-combo-selected',
+    /**
+     * @cfg {String} triggerClass An additional CSS class used to style the trigger button.  The trigger will always get the
+     * class 'x-form-trigger' and triggerClass will be <b>appended</b> if specified (defaults to 'x-form-arrow-trigger'
+     * which displays a downward arrow icon).
+     */
+    triggerClass : 'x-form-arrow-trigger',
+    /**
+     * @cfg {Boolean/String} shadow True or "sides" for the default effect, "frame" for 4-way shadow, and "drop" for bottom-right
+     */
+    shadow:'sides',
+    /**
+     * @cfg {String} listAlign A valid anchor position value. See {@link Roo.Element#alignTo} for details on supported
+     * anchor positions (defaults to 'tl-bl')
+     */
+    listAlign: 'tl-bl?',
+    /**
+     * @cfg {Number} maxHeight The maximum height in pixels of the dropdown list before scrollbars are shown (defaults to 300)
+     */
+    maxHeight: 300,
+    /**
+     * @cfg {String} triggerAction The action to execute when the trigger field is activated.  Use 'all' to run the
+     * query specified by the allQuery config option (defaults to 'query')
+     */
+    triggerAction: 'query',
+    /**
+     * @cfg {Number} minChars The minimum number of characters the user must type before autocomplete and typeahead activate
+     * (defaults to 4, does not apply if editable = false)
+     */
+    minChars : 4,
+    /**
+     * @cfg {Boolean} typeAhead True to populate and autoselect the remainder of the text being typed after a configurable
+     * delay (typeAheadDelay) if it matches a known value (defaults to false)
+     */
+    typeAhead: false,
+    /**
+     * @cfg {Number} queryDelay The length of time in milliseconds to delay between the start of typing and sending the
+     * query to filter the dropdown list (defaults to 500 if mode = 'remote' or 10 if mode = 'local')
+     */
+    queryDelay: 500,
+    /**
+     * @cfg {Number} pageSize If greater than 0, a paging toolbar is displayed in the footer of the dropdown list and the
+     * filter queries will execute with page start and limit parameters.  Only applies when mode = 'remote' (defaults to 0)
+     */
+    pageSize: 0,
+    /**
+     * @cfg {Boolean} selectOnFocus True to select any existing text in the field immediately on focus.  Only applies
+     * when editable = true (defaults to false)
+     */
+    selectOnFocus:false,
+    /**
+     * @cfg {String} queryParam Name of the query as it will be passed on the querystring (defaults to 'query')
+     */
+    queryParam: 'query',
+    /**
+     * @cfg {String} loadingText The text to display in the dropdown list while data is loading.  Only applies
+     * when mode = 'remote' (defaults to 'Loading...')
+     */
+    loadingText: 'Loading...',
+    /**
+     * @cfg {Boolean} resizable True to add a resize handle to the bottom of the dropdown list (defaults to false)
+     */
+    resizable: false,
+    /**
+     * @cfg {Number} handleHeight The height in pixels of the dropdown list resize handle if resizable = true (defaults to 8)
+     */
+    handleHeight : 8,
+    /**
+     * @cfg {Boolean} editable False to prevent the user from typing text directly into the field, just like a
+     * traditional select (defaults to true)
+     */
+    editable: true,
+    /**
+     * @cfg {String} allQuery The text query to send to the server to return all records for the list with no filtering (defaults to '')
+     */
+    allQuery: '',
+    /**
+     * @cfg {String} mode Set to 'local' if the ComboBox loads local data (defaults to 'remote' which loads from the server)
+     */
+    mode: 'remote',
+    /**
+     * @cfg {Number} minListWidth The minimum width of the dropdown list in pixels (defaults to 70, will be ignored if
+     * listWidth has a higher value)
+     */
+    minListWidth : 70,
+    /**
+     * @cfg {Boolean} forceSelection True to restrict the selected value to one of the values in the list, false to
+     * allow the user to set arbitrary text into the field (defaults to false)
+     */
+    forceSelection:false,
+    /**
+     * @cfg {Number} typeAheadDelay The length of time in milliseconds to wait until the typeahead text is displayed
+     * if typeAhead = true (defaults to 250)
+     */
+    typeAheadDelay : 250,
+    /**
+     * @cfg {String} valueNotFoundText When using a name/value combo, if the value passed to setValue is not found in
+     * the store, valueNotFoundText will be displayed as the field text if defined (defaults to undefined)
+     */
+    valueNotFoundText : undefined,
+    /**
+     * @cfg {bool} blockFocus Prevents all focus calls, so it can work with things like HTML edtor bar
+     */
+    blockFocus : false,
+    
+    /**
+     * @cfg {bool} disableClear Disable showing of clear button.
+     */
+    disableClear : false,
+    
+    // private
+    onRender : function(ct, position){
+        Roo.form.ComboBox.superclass.onRender.call(this, ct, position);
+        if(this.hiddenName){
+            this.hiddenField = this.el.insertSibling({tag:'input', type:'hidden', name: this.hiddenName, id:  (this.hiddenId||this.hiddenName)},
+                    'before', true);
+            this.hiddenField.value =
+                this.hiddenValue !== undefined ? this.hiddenValue :
+                this.value !== undefined ? this.value : '';
+
+            // prevent input submission
+            this.el.dom.removeAttribute('name');
+        }
+        if(Roo.isGecko){
+            this.el.dom.setAttribute('autocomplete', 'off');
+        }
+
+        var cls = 'x-combo-list';
+
+        this.list = new Roo.Layer({
+            shadow: this.shadow, cls: [cls, this.listClass].join(' '), constrain:false
+        });
+
+        var lw = this.listWidth || Math.max(this.wrap.getWidth(), this.minListWidth);
+        this.list.setWidth(lw);
+        this.list.swallowEvent('mousewheel');
+        this.assetHeight = 0;
+
+        if(this.title){
+            this.header = this.list.createChild({cls:cls+'-hd', html: this.title});
+            this.assetHeight += this.header.getHeight();
+        }
+
+        this.innerList = this.list.createChild({cls:cls+'-inner'});
+        this.innerList.on('mouseover', this.onViewOver, this);
+        this.innerList.on('mousemove', this.onViewMove, this);
+        this.innerList.setWidth(lw - this.list.getFrameWidth('lr'));
+        
+        if(this.allowBlank && !this.pageSize && !this.disableClear){
+            this.footer = this.list.createChild({cls:cls+'-ft'});
+            this.pageTb = new Roo.Toolbar(this.footer);
+           
+        }
+        if(this.pageSize){
+            this.footer = this.list.createChild({cls:cls+'-ft'});
+            this.pageTb = new Roo.PagingToolbar(this.footer, this.store,
+                    {pageSize: this.pageSize});
+            
+        }
+        
+        if (this.pageTb && this.allowBlank && !this.disableClear) {
+            var _this = this;
+            this.pageTb.add(new Roo.Toolbar.Fill(), {
+                cls: 'x-btn-icon x-btn-clear',
+                text: '&#160;',
+                handler: function()
+                {
+                    _this.collapse();
+                    _this.clearValue();
+                    _this.onSelect(false, -1);
+                }
+            });
+        }
+        if (this.footer) {
+            this.assetHeight += this.footer.getHeight();
+        }
+        
+
+        if(!this.tpl){
+            this.tpl = '<div class="'+cls+'-item">{' + this.displayField + '}</div>';
+        }
+
+        this.view = new Roo.View(this.innerList, this.tpl, {
+            singleSelect:true, store: this.store, selectedClass: this.selectedClass
+        });
+
+        this.view.on('click', this.onViewClick, this);
+
+        this.store.on('beforeload', this.onBeforeLoad, this);
+        this.store.on('load', this.onLoad, this);
+        this.store.on('loadexception', this.collapse, this);
+
+        if(this.resizable){
+            this.resizer = new Roo.Resizable(this.list,  {
+               pinned:true, handles:'se'
+            });
+            this.resizer.on('resize', function(r, w, h){
+                this.maxHeight = h-this.handleHeight-this.list.getFrameWidth('tb')-this.assetHeight;
+                this.listWidth = w;
+                this.innerList.setWidth(w - this.list.getFrameWidth('lr'));
+                this.restrictHeight();
+            }, this);
+            this[this.pageSize?'footer':'innerList'].setStyle('margin-bottom', this.handleHeight+'px');
+        }
+        if(!this.editable){
+            this.editable = true;
+            this.setEditable(false);
+        }
+    },
+
+    // private
+    initEvents : function(){
+        Roo.form.ComboBox.superclass.initEvents.call(this);
+
+        this.keyNav = new Roo.KeyNav(this.el, {
+            "up" : function(e){
+                this.inKeyMode = true;
+                this.selectPrev();
+            },
+
+            "down" : function(e){
+                if(!this.isExpanded()){
+                    this.onTriggerClick();
+                }else{
+                    this.inKeyMode = true;
+                    this.selectNext();
+                }
+            },
+
+            "enter" : function(e){
+                this.onViewClick();
+                //return true;
+            },
+
+            "esc" : function(e){
+                this.collapse();
+            },
+
+            "tab" : function(e){
+                this.onViewClick(false);
+                return true;
+            },
+
+            scope : this,
+
+            doRelay : function(foo, bar, hname){
+                if(hname == 'down' || this.scope.isExpanded()){
+                   return Roo.KeyNav.prototype.doRelay.apply(this, arguments);
+                }
+                return true;
+            },
+
+            forceKeyDown: true
+        });
+        this.queryDelay = Math.max(this.queryDelay || 10,
+                this.mode == 'local' ? 10 : 250);
+        this.dqTask = new Roo.util.DelayedTask(this.initQuery, this);
+        if(this.typeAhead){
+            this.taTask = new Roo.util.DelayedTask(this.onTypeAhead, this);
+        }
+        if(this.editable !== false){
+            this.el.on("keyup", this.onKeyUp, this);
+        }
+        if(this.forceSelection){
+            this.on('blur', this.doForce, this);
+        }
+    },
+
+    onDestroy : function(){
+        if(this.view){
+            this.view.setStore(null);
+            this.view.el.removeAllListeners();
+            this.view.el.remove();
+            this.view.purgeListeners();
+        }
+        if(this.list){
+            this.list.destroy();
+        }
+        if(this.store){
+            this.store.un('beforeload', this.onBeforeLoad, this);
+            this.store.un('load', this.onLoad, this);
+            this.store.un('loadexception', this.collapse, this);
+        }
+        Roo.form.ComboBox.superclass.onDestroy.call(this);
+    },
+
+    // private
+    fireKey : function(e){
+        if(e.isNavKeyPress() && !this.list.isVisible()){
+            this.fireEvent("specialkey", this, e);
+        }
+    },
+
+    // private
+    onResize: function(w, h){
+        Roo.form.ComboBox.superclass.onResize.apply(this, arguments);
+        if(this.list && this.listWidth === undefined){
+            var lw = Math.max(w, this.minListWidth);
+            this.list.setWidth(lw);
+            this.innerList.setWidth(lw - this.list.getFrameWidth('lr'));
+        }
+    },
+
+    /**
+     * Allow or prevent the user from directly editing the field text.  If false is passed,
+     * the user will only be able to select from the items defined in the dropdown list.  This method
+     * is the runtime equivalent of setting the 'editable' config option at config time.
+     * @param {Boolean} value True to allow the user to directly edit the field text
+     */
+    setEditable : function(value){
+        if(value == this.editable){
+            return;
+        }
+        this.editable = value;
+        if(!value){
+            this.el.dom.setAttribute('readOnly', true);
+            this.el.on('mousedown', this.onTriggerClick,  this);
+            this.el.addClass('x-combo-noedit');
+        }else{
+            this.el.dom.setAttribute('readOnly', false);
+            this.el.un('mousedown', this.onTriggerClick,  this);
+            this.el.removeClass('x-combo-noedit');
+        }
+    },
+
+    // private
+    onBeforeLoad : function(){
+        if(!this.hasFocus){
+            return;
+        }
+        this.innerList.update(this.loadingText ?
+               '<div class="loading-indicator">'+this.loadingText+'</div>' : '');
+        this.restrictHeight();
+        this.selectedIndex = -1;
+    },
+
+    // private
+    onLoad : function(){
+        if(!this.hasFocus){
+            return;
+        }
+        if(this.store.getCount() > 0){
+            this.expand();
+            this.restrictHeight();
+            if(this.lastQuery == this.allQuery){
+                if(this.editable){
+                    this.el.dom.select();
+                }
+                if(!this.selectByValue(this.value, true)){
+                    this.select(0, true);
+                }
+            }else{
+                this.selectNext();
+                if(this.typeAhead && this.lastKey != Roo.EventObject.BACKSPACE && this.lastKey != Roo.EventObject.DELETE){
+                    this.taTask.delay(this.typeAheadDelay);
+                }
+            }
+        }else{
+            this.onEmptyResults();
+        }
+        //this.el.focus();
+    },
+
+    // private
+    onTypeAhead : function(){
+        if(this.store.getCount() > 0){
+            var r = this.store.getAt(0);
+            var newValue = r.data[this.displayField];
+            var len = newValue.length;
+            var selStart = this.getRawValue().length;
+            if(selStart != len){
+                this.setRawValue(newValue);
+                this.selectText(selStart, newValue.length);
+            }
+        }
+    },
+
+    // private
+    onSelect : function(record, index){
+        if(this.fireEvent('beforeselect', this, record, index) !== false){
+            this.setFromData(index > -1 ? record.data : false);
+            this.collapse();
+            this.fireEvent('select', this, record, index);
+        }
+    },
+
+    /**
+     * Returns the currently selected field value or empty string if no value is set.
+     * @return {String} value The selected value
+     */
+    getValue : function(){
+        if(this.valueField){
+            return typeof this.value != 'undefined' ? this.value : '';
+        }else{
+            return Roo.form.ComboBox.superclass.getValue.call(this);
+        }
+    },
+
+    /**
+     * Clears any text/value currently set in the field
+     */
+    clearValue : function(){
+        if(this.hiddenField){
+            this.hiddenField.value = '';
+        }
+        this.value = '';
+        this.setRawValue('');
+        this.lastSelectionText = '';
+        this.applyEmptyText();
+    },
+
+    /**
+     * Sets the specified value into the field.  If the value finds a match, the corresponding record text
+     * will be displayed in the field.  If the value does not match the data value of an existing item,
+     * and the valueNotFoundText config option is defined, it will be displayed as the default field text.
+     * Otherwise the field will be blank (although the value will still be set).
+     * @param {String} value The value to match
+     */
+    setValue : function(v){
+        var text = v;
+        if(this.valueField){
+            var r = this.findRecord(this.valueField, v);
+            if(r){
+                text = r.data[this.displayField];
+            }else if(this.valueNotFoundText !== undefined){
+                text = this.valueNotFoundText;
+            }
+        }
+        this.lastSelectionText = text;
+        if(this.hiddenField){
+            this.hiddenField.value = v;
+        }
+        Roo.form.ComboBox.superclass.setValue.call(this, text);
+        this.value = v;
+    },
+    /**
+     * @property {Object} the last set data for the element
+     */
+    
+    lastData : false,
+    /**
+     * Sets the value of the field based on a object which is related to the record format for the store.
+     * @param {Object} value the value to set as. or false on reset?
+     */
+    setFromData : function(o){
+        var dv = ''; // display value
+        var vv = ''; // value value..
+        this.lastData = o;
+        if (this.displayField) {
+            dv = !o || typeof(o[this.displayField]) == 'undefined' ? '' : o[this.displayField];
+        } else {
+            // this is an error condition!!!
+            console.log('no value field set for '+ this.name);
+        }
+        
+        if(this.valueField){
+            vv = !o || typeof(o[this.valueField]) == 'undefined' ? dv : o[this.valueField];
+        }
+        if(this.hiddenField){
+            this.hiddenField.value = vv;
+            
+            this.lastSelectionText = dv;
+            Roo.form.ComboBox.superclass.setValue.call(this, dv);
+            this.value = vv;
+            return;
+        }
+        // no hidden field.. - we store the value in 'value', but still display
+        // display field!!!!
+        this.lastSelectionText = dv;
+        Roo.form.ComboBox.superclass.setValue.call(this, dv);
+        this.value = vv;
+        
+        
+    },
+    // private
+    findRecord : function(prop, value){
+        var record;
+        if(this.store.getCount() > 0){
+            this.store.each(function(r){
+                if(r.data[prop] == value){
+                    record = r;
+                    return false;
+                }
+            });
+        }
+        return record;
+    },
+
+    // private
+    onViewMove : function(e, t){
+        this.inKeyMode = false;
+    },
+
+    // private
+    onViewOver : function(e, t){
+        if(this.inKeyMode){ // prevent key nav and mouse over conflicts
+            return;
+        }
+        var item = this.view.findItemFromChild(t);
+        if(item){
+            var index = this.view.indexOf(item);
+            this.select(index, false);
+        }
+    },
+
+    // private
+    onViewClick : function(doFocus){
+        var index = this.view.getSelectedIndexes()[0];
+        var r = this.store.getAt(index);
+        if(r){
+            this.onSelect(r, index);
+        }
+        if(doFocus !== false && !this.blockFocus){
+            this.el.focus();
+        }
+    },
+
+    // private
+    restrictHeight : function(){
+        this.innerList.dom.style.height = '';
+        var inner = this.innerList.dom;
+        var h = Math.max(inner.clientHeight, inner.offsetHeight, inner.scrollHeight);
+        this.innerList.setHeight(h < this.maxHeight ? 'auto' : this.maxHeight);
+        this.list.beginUpdate();
+        this.list.setHeight(this.innerList.getHeight()+this.list.getFrameWidth('tb')+(this.resizable?this.handleHeight:0)+this.assetHeight);
+        this.list.alignTo(this.el, this.listAlign);
+        this.list.endUpdate();
+    },
+
+    // private
+    onEmptyResults : function(){
+        this.collapse();
+    },
+
+    /**
+     * Returns true if the dropdown list is expanded, else false.
+     */
+    isExpanded : function(){
+        return this.list.isVisible();
+    },
+
+    /**
+     * Select an item in the dropdown list by its data value. This function does NOT cause the select event to fire.
+     * The store must be loaded and the list expanded for this function to work, otherwise use setValue.
+     * @param {String} value The data value of the item to select
+     * @param {Boolean} scrollIntoView False to prevent the dropdown list from autoscrolling to display the
+     * selected item if it is not currently in view (defaults to true)
+     * @return {Boolean} True if the value matched an item in the list, else false
+     */
+    selectByValue : function(v, scrollIntoView){
+        if(v !== undefined && v !== null){
+            var r = this.findRecord(this.valueField || this.displayField, v);
+            if(r){
+                this.select(this.store.indexOf(r), scrollIntoView);
+                return true;
+            }
+        }
+        return false;
+    },
+
+    /**
+     * Select an item in the dropdown list by its numeric index in the list. This function does NOT cause the select event to fire.
+     * The store must be loaded and the list expanded for this function to work, otherwise use setValue.
+     * @param {Number} index The zero-based index of the list item to select
+     * @param {Boolean} scrollIntoView False to prevent the dropdown list from autoscrolling to display the
+     * selected item if it is not currently in view (defaults to true)
+     */
+    select : function(index, scrollIntoView){
+        this.selectedIndex = index;
+        this.view.select(index);
+        if(scrollIntoView !== false){
+            var el = this.view.getNode(index);
+            if(el){
+                this.innerList.scrollChildIntoView(el, false);
+            }
+        }
+    },
+
+    // private
+    selectNext : function(){
+        var ct = this.store.getCount();
+        if(ct > 0){
+            if(this.selectedIndex == -1){
+                this.select(0);
+            }else if(this.selectedIndex < ct-1){
+                this.select(this.selectedIndex+1);
+            }
+        }
+    },
+
+    // private
+    selectPrev : function(){
+        var ct = this.store.getCount();
+        if(ct > 0){
+            if(this.selectedIndex == -1){
+                this.select(0);
+            }else if(this.selectedIndex != 0){
+                this.select(this.selectedIndex-1);
+            }
+        }
+    },
+
+    // private
+    onKeyUp : function(e){
+        if(this.editable !== false && !e.isSpecialKey()){
+            this.lastKey = e.getKey();
+            this.dqTask.delay(this.queryDelay);
+        }
+    },
+
+    // private
+    validateBlur : function(){
+        return !this.list || !this.list.isVisible();   
+    },
+
+    // private
+    initQuery : function(){
+        this.doQuery(this.getRawValue());
+    },
+
+    // private
+    doForce : function(){
+        if(this.el.dom.value.length > 0){
+            this.el.dom.value =
+                this.lastSelectionText === undefined ? '' : this.lastSelectionText;
+            this.applyEmptyText();
+        }
+    },
+
+    /**
+     * Execute a query to filter the dropdown list.  Fires the beforequery event prior to performing the
+     * query allowing the query action to be canceled if needed.
+     * @param {String} query The SQL query to execute
+     * @param {Boolean} forceAll True to force the query to execute even if there are currently fewer characters
+     * in the field than the minimum specified by the minChars config option.  It also clears any filter previously
+     * saved in the current store (defaults to false)
+     */
+    doQuery : function(q, forceAll){
+        if(q === undefined || q === null){
+            q = '';
+        }
+        var qe = {
+            query: q,
+            forceAll: forceAll,
+            combo: this,
+            cancel:false
+        };
+        if(this.fireEvent('beforequery', qe)===false || qe.cancel){
+            return false;
+        }
+        q = qe.query;
+        forceAll = qe.forceAll;
+        if(forceAll === true || (q.length >= this.minChars)){
+            if(this.lastQuery != q){
+                this.lastQuery = q;
+                if(this.mode == 'local'){
+                    this.selectedIndex = -1;
+                    if(forceAll){
+                        this.store.clearFilter();
+                    }else{
+                        this.store.filter(this.displayField, q);
+                    }
+                    this.onLoad();
+                }else{
+                    this.store.baseParams[this.queryParam] = q;
+                    this.store.load({
+                        params: this.getParams(q)
+                    });
+                    this.expand();
+                }
+            }else{
+                this.selectedIndex = -1;
+                this.onLoad();   
+            }
+        }
+    },
+
+    // private
+    getParams : function(q){
+        var p = {};
+        //p[this.queryParam] = q;
+        if(this.pageSize){
+            p.start = 0;
+            p.limit = this.pageSize;
+        }
+        return p;
+    },
+
+    /**
+     * Hides the dropdown list if it is currently expanded. Fires the 'collapse' event on completion.
+     */
+    collapse : function(){
+        if(!this.isExpanded()){
+            return;
+        }
+        this.list.hide();
+        Roo.get(document).un('mousedown', this.collapseIf, this);
+        Roo.get(document).un('mousewheel', this.collapseIf, this);
+        this.fireEvent('collapse', this);
+    },
+
+    // private
+    collapseIf : function(e){
+        if(!e.within(this.wrap) && !e.within(this.list)){
+            this.collapse();
+        }
+    },
+
+    /**
+     * Expands the dropdown list if it is currently hidden. Fires the 'expand' event on completion.
+     */
+    expand : function(){
+        if(this.isExpanded() || !this.hasFocus){
+            return;
+        }
+        this.list.alignTo(this.el, this.listAlign);
+        this.list.show();
+        Roo.get(document).on('mousedown', this.collapseIf, this);
+        Roo.get(document).on('mousewheel', this.collapseIf, this);
+        this.fireEvent('expand', this);
+    },
+
+    // private
+    // Implements the default empty TriggerField.onTriggerClick function
+    onTriggerClick : function(){
+        if(this.disabled){
+            return;
+        }
+        if(this.isExpanded()){
+            this.collapse();
+            if (!this.blockFocus) {
+                this.el.focus();
+            }
+            
+        }else {
+            this.hasFocus = true;
+            if(this.triggerAction == 'all') {
+                this.doQuery(this.allQuery, true);
+            } else {
+                this.doQuery(this.getRawValue());
+            }
+            if (!this.blockFocus) {
+                this.el.focus();
+            }
+        }
+    }
+
+    /** @cfg {Boolean} grow @hide */
+    /** @cfg {Number} growMin @hide */
+    /** @cfg {Number} growMax @hide */
+    /**
+     * @hide
+     * @method autoSize
+     */
+});
\ No newline at end of file
diff --git a/Roo/form/DateField.js b/Roo/form/DateField.js
new file mode 100644 (file)
index 0000000..aa12e01
--- /dev/null
@@ -0,0 +1,332 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+/**
+ * @class Roo.form.DateField
+ * @extends Roo.form.TriggerField
+ * Provides a date input field with a {@link Roo.DatePicker} dropdown and automatic date validation.
+* @constructor
+* Create a new DateField
+* @param {Object} config
+ */
+Roo.form.DateField = function(config){
+    Roo.form.DateField.superclass.constructor.call(this, config);
+    
+      this.addEvents({
+         
+        /**
+         * @event select
+         * Fires when a date is selected
+            * @param {Roo.form.DateField} combo This combo box
+            * @param {Date} date The date selected
+            */
+        'select' : true
+         
+    });
+    
+    
+    if(typeof this.minValue == "string") this.minValue = this.parseDate(this.minValue);
+    if(typeof this.maxValue == "string") this.maxValue = this.parseDate(this.maxValue);
+    this.ddMatch = null;
+    if(this.disabledDates){
+        var dd = this.disabledDates;
+        var re = "(?:";
+        for(var i = 0; i < dd.length; i++){
+            re += dd[i];
+            if(i != dd.length-1) re += "|";
+        }
+        this.ddMatch = new RegExp(re + ")");
+    }
+};
+
+Roo.extend(Roo.form.DateField, Roo.form.TriggerField,  {
+    /**
+     * @cfg {String} format
+     * The default date format string which can be overriden for localization support.  The format must be
+     * valid according to {@link Date#parseDate} (defaults to 'm/d/y').
+     */
+    format : "m/d/y",
+    /**
+     * @cfg {String} altFormats
+     * Multiple date formats separated by "|" to try when parsing a user input value and it doesn't match the defined
+     * format (defaults to 'm/d/Y|m-d-y|m-d-Y|m/d|m-d|d').
+     */
+    altFormats : "m/d/Y|m-d-y|m-d-Y|m/d|m-d|md|mdy|mdY|d",
+    /**
+     * @cfg {Array} disabledDays
+     * An array of days to disable, 0 based. For example, [0, 6] disables Sunday and Saturday (defaults to null).
+     */
+    disabledDays : null,
+    /**
+     * @cfg {String} disabledDaysText
+     * The tooltip to display when the date falls on a disabled day (defaults to 'Disabled')
+     */
+    disabledDaysText : "Disabled",
+    /**
+     * @cfg {Array} disabledDates
+     * An array of "dates" to disable, as strings. These strings will be used to build a dynamic regular
+     * expression so they are very powerful. Some examples:
+     * <ul>
+     * <li>["03/08/2003", "09/16/2003"] would disable those exact dates</li>
+     * <li>["03/08", "09/16"] would disable those days for every year</li>
+     * <li>["^03/08"] would only match the beginning (useful if you are using short years)</li>
+     * <li>["03/../2006"] would disable every day in March 2006</li>
+     * <li>["^03"] would disable every day in every March</li>
+     * </ul>
+     * In order to support regular expressions, if you are using a date format that has "." in it, you will have to
+     * escape the dot when restricting dates. For example: ["03\\.08\\.03"].
+     */
+    disabledDates : null,
+    /**
+     * @cfg {String} disabledDatesText
+     * The tooltip text to display when the date falls on a disabled date (defaults to 'Disabled')
+     */
+    disabledDatesText : "Disabled",
+    /**
+     * @cfg {Date/String} minValue
+     * The minimum allowed date. Can be either a Javascript date object or a string date in a
+     * valid format (defaults to null).
+     */
+    minValue : null,
+    /**
+     * @cfg {Date/String} maxValue
+     * The maximum allowed date. Can be either a Javascript date object or a string date in a
+     * valid format (defaults to null).
+     */
+    maxValue : null,
+    /**
+     * @cfg {String} minText
+     * The error text to display when the date in the cell is before minValue (defaults to
+     * 'The date in this field must be after {minValue}').
+     */
+    minText : "The date in this field must be equal to or after {0}",
+    /**
+     * @cfg {String} maxText
+     * The error text to display when the date in the cell is after maxValue (defaults to
+     * 'The date in this field must be before {maxValue}').
+     */
+    maxText : "The date in this field must be equal to or before {0}",
+    /**
+     * @cfg {String} invalidText
+     * The error text to display when the date in the field is invalid (defaults to
+     * '{value} is not a valid date - it must be in the format {format}').
+     */
+    invalidText : "{0} is not a valid date - it must be in the format {1}",
+    /**
+     * @cfg {String} triggerClass
+     * An additional CSS class used to style the trigger button.  The trigger will always get the
+     * class 'x-form-trigger' and triggerClass will be <b>appended</b> if specified (defaults to 'x-form-date-trigger'
+     * which displays a calendar icon).
+     */
+    triggerClass : 'x-form-date-trigger',
+    
+
+    /**
+     * @cfg {bool} useIso
+     * if enabled, then the date field will use a hidden field to store the 
+     * real value as iso formated date. default (false)
+     */ 
+    useIso : false,
+    /**
+     * @cfg {String/Object} autoCreate
+     * A DomHelper element spec, or true for a default element spec (defaults to
+     * {tag: "input", type: "text", size: "10", autocomplete: "off"})
+     */ 
+    // private
+    defaultAutoCreate : {tag: "input", type: "text", size: "10", autocomplete: "off"},
+    
+    // private
+    hiddenField: false,
+    
+    onRender : function(ct, position)
+    {
+        Roo.form.DateField.superclass.onRender.call(this, ct, position);
+        if (this.useIso) {
+            this.el.dom.removeAttribute('name'); 
+            this.hiddenField = this.el.insertSibling({ tag:'input', type:'hidden', name: this.name },
+                    'before', true);
+            this.hiddenField.value = this.formatDate(this.value, 'Y-m-d');
+            // prevent input submission
+            this.hiddenName = this.name;
+        }
+            
+            
+    },
+    
+    // private
+    validateValue : function(value)
+    {
+        value = this.formatDate(value);
+        if(!Roo.form.DateField.superclass.validateValue.call(this, value)){
+            return false;
+        }
+        if(value.length < 1){ // if it's blank and textfield didn't flag it then it's valid
+             return true;
+        }
+        var svalue = value;
+        value = this.parseDate(value);
+        if(!value){
+            this.markInvalid(String.format(this.invalidText, svalue, this.format));
+            return false;
+        }
+        var time = value.getTime();
+        if(this.minValue && time < this.minValue.getTime()){
+            this.markInvalid(String.format(this.minText, this.formatDate(this.minValue)));
+            return false;
+        }
+        if(this.maxValue && time > this.maxValue.getTime()){
+            this.markInvalid(String.format(this.maxText, this.formatDate(this.maxValue)));
+            return false;
+        }
+        if(this.disabledDays){
+            var day = value.getDay();
+            for(var i = 0; i < this.disabledDays.length; i++) {
+               if(day === this.disabledDays[i]){
+                   this.markInvalid(this.disabledDaysText);
+                    return false;
+               }
+            }
+        }
+        var fvalue = this.formatDate(value);
+        if(this.ddMatch && this.ddMatch.test(fvalue)){
+            this.markInvalid(String.format(this.disabledDatesText, fvalue));
+            return false;
+        }
+        return true;
+    },
+
+    // private
+    // Provides logic to override the default TriggerField.validateBlur which just returns true
+    validateBlur : function(){
+        return !this.menu || !this.menu.isVisible();
+    },
+
+    /**
+     * Returns the current date value of the date field.
+     * @return {Date} The date value
+     */
+    getValue : function(){
+        
+        return  this.hiddenField ? this.hiddenField.value : this.parseDate(Roo.form.DateField.superclass.getValue.call(this)) || "";
+    },
+
+    /**
+     * Sets the value of the date field.  You can pass a date object or any string that can be parsed into a valid
+     * date, using DateField.format as the date format, according to the same rules as {@link Date#parseDate}
+     * (the default format used is "m/d/y").
+     * <br />Usage:
+     * <pre><code>
+//All of these calls set the same date value (May 4, 2006)
+
+//Pass a date object:
+var dt = new Date('5/4/06');
+dateField.setValue(dt);
+
+//Pass a date string (default format):
+dateField.setValue('5/4/06');
+
+//Pass a date string (custom format):
+dateField.format = 'Y-m-d';
+dateField.setValue('2006-5-4');
+</code></pre>
+     * @param {String/Date} date The date or valid date string
+     */
+    setValue : function(date){
+        if (this.hiddenField) {
+            this.hiddenField.value = this.formatDate(this.parseDate(date), 'Y-m-d');
+        }
+        Roo.form.DateField.superclass.setValue.call(this, this.formatDate(this.parseDate(date)));
+    },
+
+    // private
+    parseDate : function(value){
+        if(!value || value instanceof Date){
+            return value;
+        }
+        var v = Date.parseDate(value, this.format);
+        if(!v && this.altFormats){
+            if(!this.altFormatsArray){
+                this.altFormatsArray = this.altFormats.split("|");
+            }
+            for(var i = 0, len = this.altFormatsArray.length; i < len && !v; i++){
+                v = Date.parseDate(value, this.altFormatsArray[i]);
+            }
+        }
+        return v;
+    },
+
+    // private
+    formatDate : function(date, fmt){
+        return (!date || !(date instanceof Date)) ?
+               date : date.dateFormat(fmt || this.format);
+    },
+
+    // private
+    menuListeners : {
+        select: function(m, d){
+            this.setValue(d);
+            this.fireEvent('select', this, d);
+        },
+        show : function(){ // retain focus styling
+            this.onFocus();
+        },
+        hide : function(){
+            this.focus.defer(10, this);
+            var ml = this.menuListeners;
+            this.menu.un("select", ml.select,  this);
+            this.menu.un("show", ml.show,  this);
+            this.menu.un("hide", ml.hide,  this);
+        }
+    },
+
+    // private
+    // Implements the default empty TriggerField.onTriggerClick function to display the DatePicker
+    onTriggerClick : function(){
+        if(this.disabled){
+            return;
+        }
+        if(this.menu == null){
+            this.menu = new Roo.menu.DateMenu();
+        }
+        Roo.apply(this.menu.picker,  {
+            showClear: this.allowBlank,
+            minDate : this.minValue,
+            maxDate : this.maxValue,
+            disabledDatesRE : this.ddMatch,
+            disabledDatesText : this.disabledDatesText,
+            disabledDays : this.disabledDays,
+            disabledDaysText : this.disabledDaysText,
+            format : this.format,
+            minText : String.format(this.minText, this.formatDate(this.minValue)),
+            maxText : String.format(this.maxText, this.formatDate(this.maxValue))
+        });
+        this.menu.on(Roo.apply({}, this.menuListeners, {
+            scope:this
+        }));
+        this.menu.picker.setValue(this.getValue() || new Date());
+        this.menu.show(this.el, "tl-bl?");
+    },
+
+    beforeBlur : function(){
+        var v = this.parseDate(this.getRawValue());
+        if(v){
+            this.setValue(v);
+        }
+    }
+
+    /** @cfg {Boolean} grow @hide */
+    /** @cfg {Number} growMin @hide */
+    /** @cfg {Number} growMax @hide */
+    /**
+     * @hide
+     * @method autoSize
+     */
+});
\ No newline at end of file
diff --git a/Roo/form/FCKeditor.js b/Roo/form/FCKeditor.js
new file mode 100644 (file)
index 0000000..d471a53
--- /dev/null
@@ -0,0 +1,337 @@
+//<script type="text/javascript">
+
+/**
+ * @class Roo.form.FCKeditor
+ * @extends Roo.form.TextArea
+ * Wrapper around the FCKEditor http://www.fckeditor.net
+ * @constructor
+ * Creates a new FCKeditor
+ * @param {Object} config Configuration options
+ */
+Roo.form.FCKeditor = function(config){
+    Roo.form.FCKeditor.superclass.constructor.call(this, config);
+    this.addEvents({
+         /**
+         * @event editorinit
+         * Fired when the editor is initialized - you can add extra handlers here..
+         * @param {FCKeditor} this
+         * @param {Object} the FCK object.
+         */
+        editorinit : true
+    });
+    
+    
+};
+Roo.form.FCKeditor.editors = { };
+Roo.extend(Roo.form.FCKeditor, Roo.form.TextArea,
+{
+    //defaultAutoCreate : {
+    //    tag : "textarea",style   : "width:100px;height:60px;" ,autocomplete    : "off"
+    //},
+    // private
+    /**
+     * @cfg {Object} fck options - see fck manual for details.
+     */
+    fckconfig : false,
+    
+    /**
+     * @cfg {Object} fck toolbar set (Basic or Default)
+     */
+    toolbarSet : 'Basic',
+    /**
+     * @cfg {Object} fck BasePath
+     */ 
+    basePath : '/fckeditor/',
+    
+    
+    frame : false,
+    
+    value : '',
+    
+   
+    onRender : function(ct, position)
+    {
+        if(!this.el){
+            this.defaultAutoCreate = {
+                tag: "textarea",
+                style:"width:300px;height:60px;",
+                autocomplete: "off"
+            };
+        }
+        Roo.form.FCKeditor.superclass.onRender.call(this, ct, position);
+        /*
+        if(this.grow){
+            this.textSizeEl = Roo.DomHelper.append(document.body, {tag: "pre", cls: "x-form-grow-sizer"});
+            if(this.preventScrollbars){
+                this.el.setStyle("overflow", "hidden");
+            }
+            this.el.setHeight(this.growMin);
+        }
+        */
+        //console.log('onrender' + this.getId() );
+        Roo.form.FCKeditor.editors[this.getId()] = this;
+         
+
+        this.replaceTextarea() ;
+        
+    },
+    
+    getEditor : function() {
+        return this.fckEditor;
+    },
+    /**
+     * Sets a data value into the field and validates it.  To set the value directly without validation see {@link #setRawValue}.
+     * @param {Mixed} value The value to set
+     */
+    
+    
+    setValue : function(value)
+    {
+        //console.log('setValue: ' + value);
+        
+        if(typeof(value) == 'undefined') { // not sure why this is happending...
+            return;
+        }
+        Roo.form.FCKeditor.superclass.setValue.apply(this,[value]);
+        
+        //if(!this.el || !this.getEditor()) {
+        //    this.value = value;
+            //this.setValue.defer(100,this,[value]);    
+        //    return;
+        //} 
+        
+        if(!this.getEditor()) {
+            return;
+        }
+        
+        this.getEditor().SetData(value);
+        
+        //
+
+    },
+
+    /**
+     * Returns the normalized data value (undefined or emptyText will be returned as '').  To return the raw value see {@link #getRawValue}.
+     * @return {Mixed} value The field value
+     */
+    getValue : function()
+    {
+        
+        if (this.frame && this.frame.dom.style.display == 'none') {
+            return Roo.form.FCKeditor.superclass.getValue.call(this);
+        }
+        
+        if(!this.el || !this.getEditor()) {
+           
+           // this.getValue.defer(100,this); 
+            return this.value;
+        }
+       
+        
+        var value=this.getEditor().GetData();
+        Roo.form.FCKeditor.superclass.setValue.apply(this,[value]);
+        return Roo.form.FCKeditor.superclass.getValue.call(this);
+        
+
+    },
+
+    /**
+     * Returns the raw data value which may or may not be a valid, defined value.  To return a normalized value see {@link #getValue}.
+     * @return {Mixed} value The field value
+     */
+    getRawValue : function()
+    {
+        if (this.frame && this.frame.dom.style.display == 'none') {
+            return Roo.form.FCKeditor.superclass.getRawValue.call(this);
+        }
+        
+        if(!this.el || !this.getEditor()) {
+            //this.getRawValue.defer(100,this); 
+            return this.value;
+            return;
+        }
+        
+        
+        
+        var value=this.getEditor().GetData();
+        Roo.form.FCKeditor.superclass.setRawValue.apply(this,[value]);
+        return Roo.form.FCKeditor.superclass.getRawValue.call(this);
+         
+    },
+    
+    setSize : function(w,h) {
+        
+        
+        
+        //if (this.frame && this.frame.dom.style.display == 'none') {
+        //    Roo.form.FCKeditor.superclass.setSize.apply(this, [w, h]);
+        //    return;
+        //}
+        //if(!this.el || !this.getEditor()) {
+        //    this.setSize.defer(100,this, [w,h]); 
+        //    return;
+        //}
+        
+        
+        
+        Roo.form.FCKeditor.superclass.setSize.apply(this, [w, h]);
+        
+        this.frame.dom.setAttribute('width', w);
+        this.frame.dom.setAttribute('height', h);
+        this.frame.setSize(w,h);
+        
+    },
+    
+    toggleSourceEdit : function(value) {
+        
+      
+         
+        this.el.dom.style.display = value ? '' : 'none';
+        this.frame.dom.style.display = value ?  'none' : '';
+        
+    },
+    
+    
+    focus: function(tag)
+    {
+        if (this.frame.dom.style.display == 'none') {
+            return Roo.form.FCKeditor.superclass.focus.call(this);
+        }
+        if(!this.el || !this.getEditor()) {
+            this.focus.defer(100,this, [tag]); 
+            return;
+        }
+        
+        
+        
+        
+        var tgs = this.getEditor().EditorDocument.getElementsByTagName(tag);
+        this.getEditor().Focus();
+        if (tgs.length) {
+            if (!this.getEditor().Selection.GetSelection()) {
+                this.focus.defer(100,this, [tag]); 
+                return;
+            }
+            
+            
+            var r = this.getEditor().EditorDocument.createRange();
+            r.setStart(tgs[0],0);
+            r.setEnd(tgs[0],0);
+            this.getEditor().Selection.GetSelection().removeAllRanges();
+            this.getEditor().Selection.GetSelection().addRange(r);
+            this.getEditor().Focus();
+        }
+        
+    },
+    
+    
+    
+    replaceTextarea : function()
+    {
+        if ( document.getElementById( this.getId() + '___Frame' ) )
+            return ;
+        //if ( !this.checkBrowser || this._isCompatibleBrowser() )
+        //{
+            // We must check the elements firstly using the Id and then the name.
+        var oTextarea = document.getElementById( this.getId() );
+        
+        var colElementsByName = document.getElementsByName( this.getId() ) ;
+         
+        oTextarea.style.display = 'none' ;
+
+        if ( oTextarea.tabIndex ) {            
+            this.TabIndex = oTextarea.tabIndex ;
+        }
+        
+        this._insertHtmlBefore( this._getConfigHtml(), oTextarea ) ;
+        this._insertHtmlBefore( this._getIFrameHtml(), oTextarea ) ;
+        this.frame = Roo.get(this.getId() + '___Frame')
+    },
+    
+    _getConfigHtml : function()
+    {
+        var sConfig = '' ;
+
+        for ( var o in this.fckconfig ) {
+            sConfig += sConfig.length > 0  ? '&amp;' : '';
+            sConfig += encodeURIComponent( o ) + '=' + encodeURIComponent( this.fckconfig[o] ) ;
+        }
+
+        return '<input type="hidden" id="' + this.getId() + '___Config" value="' + sConfig + '" style="display:none" />' ;
+    },
+    
+    
+    _getIFrameHtml : function()
+    {
+        var sFile = 'fckeditor.html' ;
+        /* no idea what this is about..
+        try
+        {
+            if ( (/fcksource=true/i).test( window.top.location.search ) )
+                sFile = 'fckeditor.original.html' ;
+        }
+        catch (e) { 
+        */
+
+        var sLink = this.basePath + 'editor/' + sFile + '?InstanceName=' + encodeURIComponent( this.getId() ) ;
+        sLink += this.toolbarSet ? ( '&amp;Toolbar=' + this.toolbarSet)  : '';
+        
+        
+        var html = '<iframe id="' + this.getId() +
+            '___Frame" src="' + sLink +
+            '" width="' + this.width +
+            '" height="' + this.height + '"' +
+            (this.tabIndex ?  ' tabindex="' + this.tabIndex + '"' :'' ) +
+            ' frameborder="0" scrolling="no"></iframe>' ;
+
+        return html ;
+    },
+    
+    _insertHtmlBefore : function( html, element )
+    {
+        if ( element.insertAdjacentHTML )      {
+            // IE
+            element.insertAdjacentHTML( 'beforeBegin', html ) ;
+        } else { // Gecko
+            var oRange = document.createRange() ;
+            oRange.setStartBefore( element ) ;
+            var oFragment = oRange.createContextualFragment( html );
+            element.parentNode.insertBefore( oFragment, element ) ;
+        }
+    }
+    
+    
+  
+    
+    
+    
+    
+
+});
+
+//Roo.reg('fckeditor', Roo.form.FCKeditor);
+
+function FCKeditor_OnComplete(editorInstance){
+    var f = Roo.form.FCKeditor.editors[editorInstance.Name];
+    f.fckEditor = editorInstance;
+    //console.log("loaded");
+    f.fireEvent('editorinit', f, editorInstance);
+} 
+  
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/Roo/form/Field.js b/Roo/form/Field.js
new file mode 100644 (file)
index 0000000..f7c9e03
--- /dev/null
@@ -0,0 +1,541 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+/**
+ * @class Roo.form.Field
+ * @extends Roo.BoxComponent
+ * Base class for form fields that provides default event handling, sizing, value handling and other functionality.
+ * @constructor
+ * Creates a new Field
+ * @param {Object} config Configuration options
+ */
+Roo.form.Field = function(config){
+    Roo.form.Field.superclass.constructor.call(this, config);
+};
+
+Roo.extend(Roo.form.Field, Roo.BoxComponent,  {
+    /**
+     * @cfg {String} fieldLabel Label to use when rendering a form.
+     */
+       /**
+     * @cfg {String} qtip Mouse over tip
+     */
+     
+    /**
+     * @cfg {String} invalidClass The CSS class to use when marking a field invalid (defaults to "x-form-invalid")
+     */
+    invalidClass : "x-form-invalid",
+    /**
+     * @cfg {String} invalidText The error text to use when marking a field invalid and no message is provided (defaults to "The value in this field is invalid")
+     */
+    invalidText : "The value in this field is invalid",
+    /**
+     * @cfg {String} focusClass The CSS class to use when the field receives focus (defaults to "x-form-focus")
+     */
+    focusClass : "x-form-focus",
+    /**
+     * @cfg {String/Boolean} validationEvent The event that should initiate field validation. Set to false to disable
+      automatic validation (defaults to "keyup").
+     */
+    validationEvent : "keyup",
+    /**
+     * @cfg {Boolean} validateOnBlur Whether the field should validate when it loses focus (defaults to true).
+     */
+    validateOnBlur : true,
+    /**
+     * @cfg {Number} validationDelay The length of time in milliseconds after user input begins until validation is initiated (defaults to 250)
+     */
+    validationDelay : 250,
+    /**
+     * @cfg {String/Object} autoCreate A DomHelper element spec, or true for a default element spec (defaults to
+     * {tag: "input", type: "text", size: "20", autocomplete: "off"})
+     */
+    defaultAutoCreate : {tag: "input", type: "text", size: "20", autocomplete: "off"},
+    /**
+     * @cfg {String} fieldClass The default CSS class for the field (defaults to "x-form-field")
+     */
+    fieldClass : "x-form-field",
+    /**
+     * @cfg {String} msgTarget The location where error text should display.  Should be one of the following values (defaults to 'qtip'):
+     *<pre>
+Value         Description
+-----------   ----------------------------------------------------------------------
+qtip          Display a quick tip when the user hovers over the field
+title         Display a default browser title attribute popup
+under         Add a block div beneath the field containing the error text
+side          Add an error icon to the right of the field with a popup on hover
+[element id]  Add the error text directly to the innerHTML of the specified element
+</pre>
+     */
+    msgTarget : 'qtip',
+    /**
+     * @cfg {String} msgFx <b>Experimental</b> The effect used when displaying a validation message under the field (defaults to 'normal').
+     */
+    msgFx : 'normal',
+
+    /**
+     * @cfg {Boolean} readOnly True to mark the field as readOnly in HTML (defaults to false) -- Note: this only sets the element's readOnly DOM attribute.
+     */
+    readOnly : false,
+
+    /**
+     * @cfg {Boolean} disabled True to disable the field (defaults to false).
+     */
+    disabled : false,
+
+    /**
+     * @cfg {String} inputType The type attribute for input fields -- e.g. radio, text, password (defaults to "text").
+     */
+    inputType : undefined,
+    
+    /**
+     * @cfg {Number} tabIndex The tabIndex for this field. Note this only applies to fields that are rendered, not those which are built via applyTo (defaults to undefined).
+        */
+       tabIndex : undefined,
+       
+    // private
+    isFormField : true,
+
+    // private
+    hasFocus : false,
+    /**
+     * @property {Roo.Element} fieldEl
+     * Element Containing the rendered Field (with label etc.)
+     */
+    /**
+     * @cfg {Mixed} value A value to initialize this field with.
+     */
+    value : undefined,
+
+    /**
+     * @cfg {String} name The field's HTML name attribute.
+     */
+    /**
+     * @cfg {String} cls A CSS class to apply to the field's underlying element.
+     */
+
+       // private ??
+       initComponent : function(){
+        Roo.form.Field.superclass.initComponent.call(this);
+        this.addEvents({
+            /**
+             * @event focus
+             * Fires when this field receives input focus.
+             * @param {Roo.form.Field} this
+             */
+            focus : true,
+            /**
+             * @event blur
+             * Fires when this field loses input focus.
+             * @param {Roo.form.Field} this
+             */
+            blur : true,
+            /**
+             * @event specialkey
+             * Fires when any key related to navigation (arrows, tab, enter, esc, etc.) is pressed.  You can check
+             * {@link Roo.EventObject#getKey} to determine which key was pressed.
+             * @param {Roo.form.Field} this
+             * @param {Roo.EventObject} e The event object
+             */
+            specialkey : true,
+            /**
+             * @event change
+             * Fires just before the field blurs if the field value has changed.
+             * @param {Roo.form.Field} this
+             * @param {Mixed} newValue The new value
+             * @param {Mixed} oldValue The original value
+             */
+            change : true,
+            /**
+             * @event invalid
+             * Fires after the field has been marked as invalid.
+             * @param {Roo.form.Field} this
+             * @param {String} msg The validation message
+             */
+            invalid : true,
+            /**
+             * @event valid
+             * Fires after the field has been validated with no errors.
+             * @param {Roo.form.Field} this
+             */
+            valid : true
+        });
+    },
+
+    /**
+     * Returns the name attribute of the field if available
+     * @return {String} name The field name
+     */
+    getName: function(){
+         return this.rendered && this.el.dom.name ? this.el.dom.name : (this.hiddenName || '');
+    },
+
+    // private
+    onRender : function(ct, position){
+        Roo.form.Field.superclass.onRender.call(this, ct, position);
+        if(!this.el){
+            var cfg = this.getAutoCreate();
+            if(!cfg.name){
+                cfg.name = this.name || this.id;
+            }
+            if(this.inputType){
+                cfg.type = this.inputType;
+            }
+            this.el = ct.createChild(cfg, position);
+        }
+        var type = this.el.dom.type;
+        if(type){
+            if(type == 'password'){
+                type = 'text';
+            }
+            this.el.addClass('x-form-'+type);
+        }
+        if(this.readOnly){
+            this.el.dom.readOnly = true;
+        }
+        if(this.tabIndex !== undefined){
+            this.el.dom.setAttribute('tabIndex', this.tabIndex);
+        }
+
+        this.el.addClass([this.fieldClass, this.cls]);
+        this.initValue();
+    },
+
+    /**
+     * Apply the behaviors of this component to an existing element. <b>This is used instead of render().</b>
+     * @param {String/HTMLElement/Element} el The id of the node, a DOM node or an existing Element
+     * @return {Roo.form.Field} this
+     */
+    applyTo : function(target){
+        this.allowDomMove = false;
+        this.el = Roo.get(target);
+        this.render(this.el.dom.parentNode);
+        return this;
+    },
+
+    // private
+    initValue : function(){
+        if(this.value !== undefined){
+            this.setValue(this.value);
+        }else if(this.el.dom.value.length > 0){
+            this.setValue(this.el.dom.value);
+        }
+    },
+
+    /**
+     * Returns true if this field has been changed since it was originally loaded and is not disabled.
+     */
+    isDirty : function() {
+        if(this.disabled) {
+            return false;
+        }
+        return String(this.getValue()) !== String(this.originalValue);
+    },
+
+    // private
+    afterRender : function(){
+        Roo.form.Field.superclass.afterRender.call(this);
+        this.initEvents();
+    },
+
+    // private
+    fireKey : function(e){
+        if(e.isNavKeyPress()){
+            this.fireEvent("specialkey", this, e);
+        }
+    },
+
+    /**
+     * Resets the current field value to the originally loaded value and clears any validation messages
+     */
+    reset : function(){
+        this.setValue(this.originalValue);
+        this.clearInvalid();
+    },
+
+    // private
+    initEvents : function(){
+        this.el.on(Roo.isIE ? "keydown" : "keypress", this.fireKey,  this);
+        this.el.on("focus", this.onFocus,  this);
+        this.el.on("blur", this.onBlur,  this);
+
+        // reference to original value for reset
+        this.originalValue = this.getValue();
+    },
+
+    // private
+    onFocus : function(){
+        if(!Roo.isOpera && this.focusClass){ // don't touch in Opera
+            this.el.addClass(this.focusClass);
+        }
+        if(!this.hasFocus){
+            this.hasFocus = true;
+            this.startValue = this.getValue();
+            this.fireEvent("focus", this);
+        }
+    },
+
+    beforeBlur : Roo.emptyFn,
+
+    // private
+    onBlur : function(){
+        this.beforeBlur();
+        if(!Roo.isOpera && this.focusClass){ // don't touch in Opera
+            this.el.removeClass(this.focusClass);
+        }
+        this.hasFocus = false;
+        if(this.validationEvent !== false && this.validateOnBlur && this.validationEvent != "blur"){
+            this.validate();
+        }
+        var v = this.getValue();
+        if(String(v) !== String(this.startValue)){
+            this.fireEvent('change', this, v, this.startValue);
+        }
+        this.fireEvent("blur", this);
+    },
+
+    /**
+     * Returns whether or not the field value is currently valid
+     * @param {Boolean} preventMark True to disable marking the field invalid
+     * @return {Boolean} True if the value is valid, else false
+     */
+    isValid : function(preventMark){
+        if(this.disabled){
+            return true;
+        }
+        var restore = this.preventMark;
+        this.preventMark = preventMark === true;
+        var v = this.validateValue(this.processValue(this.getRawValue()));
+        this.preventMark = restore;
+        return v;
+    },
+
+    /**
+     * Validates the field value
+     * @return {Boolean} True if the value is valid, else false
+     */
+    validate : function(){
+        if(this.disabled || this.validateValue(this.processValue(this.getRawValue()))){
+            this.clearInvalid();
+            return true;
+        }
+        return false;
+    },
+
+    processValue : function(value){
+        return value;
+    },
+
+    // private
+    // Subclasses should provide the validation implementation by overriding this
+    validateValue : function(value){
+        return true;
+    },
+
+    /**
+     * Mark this field as invalid
+     * @param {String} msg The validation message
+     */
+    markInvalid : function(msg){
+        if(!this.rendered || this.preventMark){ // not rendered
+            return;
+        }
+        this.el.addClass(this.invalidClass);
+        msg = msg || this.invalidText;
+        switch(this.msgTarget){
+            case 'qtip':
+                this.el.dom.qtip = msg;
+                this.el.dom.qclass = 'x-form-invalid-tip';
+                if(Roo.QuickTips){ // fix for floating editors interacting with DND
+                    Roo.QuickTips.enable();
+                }
+                break;
+            case 'title':
+                this.el.dom.title = msg;
+                break;
+            case 'under':
+                if(!this.errorEl){
+                    var elp = this.el.findParent('.x-form-element', 5, true);
+                    this.errorEl = elp.createChild({cls:'x-form-invalid-msg'});
+                    this.errorEl.setWidth(elp.getWidth(true)-20);
+                }
+                this.errorEl.update(msg);
+                Roo.form.Field.msgFx[this.msgFx].show(this.errorEl, this);
+                break;
+            case 'side':
+                if(!this.errorIcon){
+                    var elp = this.el.findParent('.x-form-element', 5, true);
+                    this.errorIcon = elp.createChild({cls:'x-form-invalid-icon'});
+                }
+                this.alignErrorIcon();
+                this.errorIcon.dom.qtip = msg;
+                this.errorIcon.dom.qclass = 'x-form-invalid-tip';
+                this.errorIcon.show();
+                this.on('resize', this.alignErrorIcon, this);
+                break;
+            default:
+                var t = Roo.getDom(this.msgTarget);
+                t.innerHTML = msg;
+                t.style.display = this.msgDisplay;
+                break;
+        }
+        this.fireEvent('invalid', this, msg);
+    },
+
+    // private
+    alignErrorIcon : function(){
+        this.errorIcon.alignTo(this.el, 'tl-tr', [2, 0]);
+    },
+
+    /**
+     * Clear any invalid styles/messages for this field
+     */
+    clearInvalid : function(){
+        if(!this.rendered || this.preventMark){ // not rendered
+            return;
+        }
+        this.el.removeClass(this.invalidClass);
+        switch(this.msgTarget){
+            case 'qtip':
+                this.el.dom.qtip = '';
+                break;
+            case 'title':
+                this.el.dom.title = '';
+                break;
+            case 'under':
+                if(this.errorEl){
+                    Roo.form.Field.msgFx[this.msgFx].hide(this.errorEl, this);
+                }
+                break;
+            case 'side':
+                if(this.errorIcon){
+                    this.errorIcon.dom.qtip = '';
+                    this.errorIcon.hide();
+                    this.un('resize', this.alignErrorIcon, this);
+                }
+                break;
+            default:
+                var t = Roo.getDom(this.msgTarget);
+                t.innerHTML = '';
+                t.style.display = 'none';
+                break;
+        }
+        this.fireEvent('valid', this);
+    },
+
+    /**
+     * Returns the raw data value which may or may not be a valid, defined value.  To return a normalized value see {@link #getValue}.
+     * @return {Mixed} value The field value
+     */
+    getRawValue : function(){
+        var v = this.el.getValue();
+        if(v === this.emptyText){
+            v = '';
+        }
+        return v;
+    },
+
+    /**
+     * Returns the normalized data value (undefined or emptyText will be returned as '').  To return the raw value see {@link #getRawValue}.
+     * @return {Mixed} value The field value
+     */
+    getValue : function(){
+        var v = this.el.getValue();
+        if(v === this.emptyText || v === undefined){
+            v = '';
+        }
+        return v;
+    },
+
+    /**
+     * Sets the underlying DOM field's value directly, bypassing validation.  To set the value with validation see {@link #setValue}.
+     * @param {Mixed} value The value to set
+     */
+    setRawValue : function(v){
+        return this.el.dom.value = (v === null || v === undefined ? '' : v);
+    },
+
+    /**
+     * Sets a data value into the field and validates it.  To set the value directly without validation see {@link #setRawValue}.
+     * @param {Mixed} value The value to set
+     */
+    setValue : function(v){
+        this.value = v;
+        if(this.rendered){
+            this.el.dom.value = (v === null || v === undefined ? '' : v);
+            this.validate();
+        }
+    },
+
+    adjustSize : function(w, h){
+        var s = Roo.form.Field.superclass.adjustSize.call(this, w, h);
+        s.width = this.adjustWidth(this.el.dom.tagName, s.width);
+        return s;
+    },
+
+    adjustWidth : function(tag, w){
+        tag = tag.toLowerCase();
+        if(typeof w == 'number' && Roo.isStrict && !Roo.isSafari){
+            if(Roo.isIE && (tag == 'input' || tag == 'textarea')){
+                if(tag == 'input'){
+                    return w + 2;
+                }
+                if(tag = 'textarea'){
+                    return w-2;
+                }
+            }else if(Roo.isOpera){
+                if(tag == 'input'){
+                    return w + 2;
+                }
+                if(tag = 'textarea'){
+                    return w-2;
+                }
+            }
+        }
+        return w;
+    }
+});
+
+
+// anything other than normal should be considered experimental
+Roo.form.Field.msgFx = {
+    normal : {
+        show: function(msgEl, f){
+            msgEl.setDisplayed('block');
+        },
+
+        hide : function(msgEl, f){
+            msgEl.setDisplayed(false).update('');
+        }
+    },
+
+    slide : {
+        show: function(msgEl, f){
+            msgEl.slideIn('t', {stopFx:true});
+        },
+
+        hide : function(msgEl, f){
+            msgEl.slideOut('t', {stopFx:true,useDisplay:true});
+        }
+    },
+
+    slideRight : {
+        show: function(msgEl, f){
+            msgEl.fixDisplay();
+            msgEl.alignTo(f.el, 'tl-tr');
+            msgEl.slideIn('l', {stopFx:true});
+        },
+
+        hide : function(msgEl, f){
+            msgEl.slideOut('l', {stopFx:true,useDisplay:true});
+        }
+    }
+};
\ No newline at end of file
diff --git a/Roo/form/Form.js b/Roo/form/Form.js
new file mode 100644 (file)
index 0000000..e5c95f5
--- /dev/null
@@ -0,0 +1,413 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+
+/**
+ * @class Roo.form.Form
+ * @extends Roo.form.BasicForm
+ * Adds the ability to dynamically render forms with JavaScript to {@link Roo.form.BasicForm}.
+ * @constructor
+ * @param {Object} config Configuration options
+ */
+Roo.form.Form = function(config){
+    var xitems =  [];
+    if (config.items) {
+        xitems = config.items;
+        delete config.items;
+    }
+    
+    
+    Roo.form.Form.superclass.constructor.call(this, null, config);
+    this.url = this.url || this.action;
+    if(!this.root){
+        this.root = new Roo.form.Layout(Roo.applyIf({
+            id: Roo.id()
+        }, config));
+    }
+    this.active = this.root;
+    /**
+     * Array of all the buttons that have been added to this form via {@link addButton}
+     * @type Array
+     */
+    this.buttons = [];
+    this.allItems = [];
+    this.addEvents({
+        /**
+         * @event clientvalidation
+         * If the monitorValid config option is true, this event fires repetitively to notify of valid state
+         * @param {Form} this
+         * @param {Boolean} valid true if the form has passed client-side validation
+         */
+        clientvalidation: true,
+        /**
+         * @event rendered
+         * Fires when the form is rendered
+         * @param {Roo.form.Form} form
+         */
+        rendered : true
+    });
+    
+    Roo.each(xitems, this.addxtype, this);
+    
+    
+    
+};
+
+Roo.extend(Roo.form.Form, Roo.form.BasicForm, {
+    /**
+     * @cfg {Number} labelWidth The width of labels. This property cascades to child containers.
+     */
+    /**
+     * @cfg {String} itemCls A css class to apply to the x-form-item of fields. This property cascades to child containers.
+     */
+    /**
+     * @cfg {String} buttonAlign Valid values are "left," "center" and "right" (defaults to "center")
+     */
+    buttonAlign:'center',
+
+    /**
+     * @cfg {Number} minButtonWidth Minimum width of all buttons in pixels (defaults to 75)
+     */
+    minButtonWidth:75,
+
+    /**
+     * @cfg {String} labelAlign Valid values are "left," "top" and "right" (defaults to "left").
+     * This property cascades to child containers if not set.
+     */
+    labelAlign:'left',
+
+    /**
+     * @cfg {Boolean} monitorValid If true the form monitors its valid state <b>client-side</b> and
+     * fires a looping event with that state. This is required to bind buttons to the valid
+     * state using the config value formBind:true on the button.
+     */
+    monitorValid : false,
+
+    /**
+     * @cfg {Number} monitorPoll The milliseconds to poll valid state, ignored if monitorValid is not true (defaults to 200)
+     */
+    monitorPoll : 200,
+
+    /**
+     * Opens a new {@link Roo.form.Column} container in the layout stack. If fields are passed after the config, the
+     * fields are added and the column is closed. If no fields are passed the column remains open
+     * until end() is called.
+     * @param {Object} config The config to pass to the column
+     * @param {Field} field1 (optional)
+     * @param {Field} field2 (optional)
+     * @param {Field} etc (optional)
+     * @return Column The column container object
+     */
+    column : function(c){
+        var col = new Roo.form.Column(c);
+        this.start(col);
+        if(arguments.length > 1){ // duplicate code required because of Opera
+            this.add.apply(this, Array.prototype.slice.call(arguments, 1));
+            this.end();
+        }
+        return col;
+    },
+
+    /**
+     * Opens a new {@link Roo.form.FieldSet} container in the layout stack. If fields are passed after the config, the
+     * fields are added and the fieldset is closed. If no fields are passed the fieldset remains open
+     * until end() is called.
+     * @param {Object} config The config to pass to the fieldset
+     * @param {Field} field1 (optional)
+     * @param {Field} field2 (optional)
+     * @param {Field} etc (optional)
+     * @return FieldSet The fieldset container object
+     */
+    fieldset : function(c){
+        var fs = new Roo.form.FieldSet(c);
+        this.start(fs);
+        if(arguments.length > 1){ // duplicate code required because of Opera
+            this.add.apply(this, Array.prototype.slice.call(arguments, 1));
+            this.end();
+        }
+        return fs;
+    },
+
+    /**
+     * Opens a new {@link Roo.form.Layout} container in the layout stack. If fields are passed after the config, the
+     * fields are added and the container is closed. If no fields are passed the container remains open
+     * until end() is called.
+     * @param {Object} config The config to pass to the Layout
+     * @param {Field} field1 (optional)
+     * @param {Field} field2 (optional)
+     * @param {Field} etc (optional)
+     * @return Layout The container object
+     */
+    container : function(c){
+        var l = new Roo.form.Layout(c);
+        this.start(l);
+        if(arguments.length > 1){ // duplicate code required because of Opera
+            this.add.apply(this, Array.prototype.slice.call(arguments, 1));
+            this.end();
+        }
+        return l;
+    },
+
+    /**
+     * Opens the passed container in the layout stack. The container can be any {@link Roo.form.Layout} or subclass.
+     * @param {Object} container A Roo.form.Layout or subclass of Layout
+     * @return {Form} this
+     */
+    start : function(c){
+        // cascade label info
+        Roo.applyIf(c, {'labelAlign': this.active.labelAlign, 'labelWidth': this.active.labelWidth, 'itemCls': this.active.itemCls});
+        this.active.stack.push(c);
+        c.ownerCt = this.active;
+        this.active = c;
+        return this;
+    },
+
+    /**
+     * Closes the current open container
+     * @return {Form} this
+     */
+    end : function(){
+        if(this.active == this.root){
+            return this;
+        }
+        this.active = this.active.ownerCt;
+        return this;
+    },
+
+    /**
+     * Add Roo.form components to the current open container (e.g. column, fieldset, etc.).  Fields added via this method
+     * can also be passed with an additional property of fieldLabel, which if supplied, will provide the text to display
+     * as the label of the field.
+     * @param {Field} field1
+     * @param {Field} field2 (optional)
+     * @param {Field} etc. (optional)
+     * @return {Form} this
+     */
+    add : function(){
+        this.active.stack.push.apply(this.active.stack, arguments);
+        this.allItems.push.apply(this.allItems,arguments);
+        var r = [];
+        for(var i = 0, a = arguments, len = a.length; i < len; i++) {
+            if(a[i].isFormField){
+                r.push(a[i]);
+            }
+        }
+        if(r.length > 0){
+            Roo.form.Form.superclass.add.apply(this, r);
+        }
+        return this;
+    },
+     /**
+     * Find any element that has been added to a form, using it's ID or name
+     * This can include framesets, columns etc. along with regular fields..
+     * @param {String} id - id or name to find.
+     
+     * @return {Element} e - or false if nothing found.
+     */
+    findbyId : function(id)
+    {
+        var ret = false;
+        if (!id) {
+            return ret;
+        }
+        Ext.each(this.allItems, function(f){
+            if (f.id == id || f.name == id ){
+                ret = f;
+                return false;
+            }
+        });
+        return ret;
+    },
+
+    
+    
+    /**
+     * Render this form into the passed container. This should only be called once!
+     * @param {String/HTMLElement/Element} container The element this component should be rendered into
+     * @return {Form} this
+     */
+    render : function(ct){
+        ct = Roo.get(ct);
+        var o = this.autoCreate || {
+            tag: 'form',
+            method : this.method || 'POST',
+            id : this.id || Roo.id()
+        };
+        this.initEl(ct.createChild(o));
+
+        this.root.render(this.el);
+
+        this.items.each(function(f){
+            f.render('x-form-el-'+f.id);
+        });
+
+        if(this.buttons.length > 0){
+            // tables are required to maintain order and for correct IE layout
+            var tb = this.el.createChild({cls:'x-form-btns-ct', cn: {
+                cls:"x-form-btns x-form-btns-"+this.buttonAlign,
+                html:'<table cellspacing="0"><tbody><tr></tr></tbody></table><div class="x-clear"></div>'
+            }}, null, true);
+            var tr = tb.getElementsByTagName('tr')[0];
+            for(var i = 0, len = this.buttons.length; i < len; i++) {
+                var b = this.buttons[i];
+                var td = document.createElement('td');
+                td.className = 'x-form-btn-td';
+                b.render(tr.appendChild(td));
+            }
+        }
+        if(this.monitorValid){ // initialize after render
+            this.startMonitoring();
+        }
+        this.fireEvent('rendered', this);
+        return this;
+    },
+
+    /**
+     * Adds a button to the footer of the form - this <b>must</b> be called before the form is rendered.
+     * @param {String/Object} config A string becomes the button text, an object can either be a Button config
+     * object or a valid Roo.DomHelper element config
+     * @param {Function} handler The function called when the button is clicked
+     * @param {Object} scope (optional) The scope of the handler function
+     * @return {Roo.Button}
+     */
+    addButton : function(config, handler, scope){
+        var bc = {
+            handler: handler,
+            scope: scope,
+            minWidth: this.minButtonWidth,
+            hideParent:true
+        };
+        if(typeof config == "string"){
+            bc.text = config;
+        }else{
+            Roo.apply(bc, config);
+        }
+        var btn = new Roo.Button(null, bc);
+        this.buttons.push(btn);
+        return btn;
+    },
+
+     /**
+     * Adds a series of form elements (using the xtype property as the factory method.
+     * Valid xtypes are:  TextField, TextArea .... Button, Layout, FieldSet, Column, (and 'end' to close a block)
+     * @param {Object} config 
+     */
+    
+    addxtype : function()
+    {
+        var ar = Array.prototype.slice.call(arguments, 0);
+        var ret = false;
+        for(var i = 0; i < ar.length; i++) {
+            if (!ar[i]) {
+                continue; // skip -- if this happends something invalid got sent, we 
+                // should ignore it, as basically that interface element will not show up
+                // and that should be pretty obvious!!
+            }
+            
+            if (Roo.form[ar[i].xtype]) {
+                ar[i].form = this;
+                var fe = Roo.factory(ar[i], Roo.form);
+                if (!ret) {
+                    ret = fe;
+                }
+                fe.form = this;
+                if (fe.store) {
+                    fe.store.form = this;
+                }
+                if (fe.isLayout) {  
+                         
+                    this.start(fe);
+                    this.allItems.push(fe);
+                    if (fe.items && fe.addxtype) {
+                        fe.addxtype.apply(fe, fe.items);
+                        delete fe.items;
+                    }
+                     this.end();
+                    continue;
+                }
+                
+                
+                 
+                this.add(fe);
+              //  console.log('adding ' + ar[i].xtype);
+            }
+            if (ar[i].xtype == 'Button') {  
+                //console.log('adding button');
+                //console.log(ar[i]);
+                this.addButton(ar[i]);
+                this.allItems.push(fe);
+                continue;
+            }
+            
+            if (ar[i].xtype == 'end') { // so we can add fieldsets... / layout etc.
+                alert('end is not supported on xtype any more, use items');
+            //    this.end();
+            //    //console.log('adding end');
+            }
+            
+        }
+        return ret;
+    },
+    
+    /**
+     * Starts monitoring of the valid state of this form. Usually this is done by passing the config
+     * option "monitorValid"
+     */
+    startMonitoring : function(){
+        if(!this.bound){
+            this.bound = true;
+            Roo.TaskMgr.start({
+                run : this.bindHandler,
+                interval : this.monitorPoll || 200,
+                scope: this
+            });
+        }
+    },
+
+    /**
+     * Stops monitoring of the valid state of this form
+     */
+    stopMonitoring : function(){
+        this.bound = false;
+    },
+
+    // private
+    bindHandler : function(){
+        if(!this.bound){
+            return false; // stops binding
+        }
+        var valid = true;
+        this.items.each(function(f){
+            if(!f.isValid(true)){
+                valid = false;
+                return false;
+            }
+        });
+        for(var i = 0, len = this.buttons.length; i < len; i++){
+            var btn = this.buttons[i];
+            if(btn.formBind === true && btn.disabled === valid){
+                btn.setDisabled(!valid);
+            }
+        }
+        this.fireEvent('clientvalidation', this, valid);
+    }
+    
+    
+    
+    
+    
+    
+    
+    
+});
+
+
+// back compat
+Roo.Form = Roo.form.Form;
diff --git a/Roo/form/GridField.js b/Roo/form/GridField.js
new file mode 100644 (file)
index 0000000..a7ca969
--- /dev/null
@@ -0,0 +1,125 @@
+//<script type="text/javascript">
+/**
+ * @class Roo.form.GridField
+ * @extends Roo.form.Field
+ * Embed a grid (or editable grid into a form)
+ * STATUS ALPHA
+ * @constructor
+ * Creates a new GridField
+ * @param {Object} config Configuration options
+ */
+Roo.form.GridField = function(config){
+    Roo.form.GridField.superclass.constructor.call(this, config);
+     
+};
+
+Roo.extend(Roo.form.GridField, Roo.form.Field,  {
+    /**
+     * @cfg {Number} width  - used to restrict width of grid..
+     */
+    width : 100,
+    /**
+     * @cfg {Number} height - used to restrict height of grid..
+     */
+    height : 50,
+     /**
+     * @cfg {Object} xgrid (xtype'd description of grid) Grid or EditorGrid
+     */
+    xgrid : false, 
+    /**
+     * @cfg {String/Object} autoCreate A DomHelper element spec, or true for a default element spec (defaults to
+     * {tag: "input", type: "checkbox", autocomplete: "off"})
+     */
+   // defaultAutoCreate : { tag: 'div' },
+    defaultAutoCreate : { tag: 'input', type: 'hidden', autocomplete: 'off'},
+    /**
+     * @cfg {String} addTitle Text to include for adding a title.
+     */
+    addTitle : false,
+    //
+    onResize : function(){
+        Roo.form.Field.superclass.onResize.apply(this, arguments);
+    },
+
+    initEvents : function(){
+        // Roo.form.Checkbox.superclass.initEvents.call(this);
+        // has no events...
+       
+    },
+
+
+    getResizeEl : function(){
+        return this.wrap;
+    },
+
+    getPositionEl : function(){
+        return this.wrap;
+    },
+
+    // private
+    onRender : function(ct, position){
+        
+        this.style = this.style || 'overflow: hidden; border:1px solid #c3daf9;';
+        var style = this.style;
+        delete this.style;
+        
+        Roo.form.DisplayImage.superclass.onRender.call(this, ct, position);
+        this.wrap = this.el.wrap({cls: ''}); // not sure why ive done thsi...
+        this.viewEl = this.wrap.createChild({ tag: 'div' });
+        if (style) {
+            this.viewEl.applyStyles(style);
+        }
+        if (this.width) {
+            this.viewEl.setWidth(this.width);
+        }
+        if (this.height) {
+            this.viewEl.setHeight(this.height);
+        }
+        //if(this.inputValue !== undefined){
+        //this.setValue(this.value);
+        
+        
+        this.grid = new Roo.grid[this.xgrid.xtype](this.viewEl, this.xgrid);
+        
+        
+        this.grid.render();
+        this.grid.getDataSource().on('remove', this.refreshValue, this);
+        this.grid.getDataSource().on('update', this.refreshValue, this);
+        this.grid.on('afteredit', this.refreshValue, this);
+    },
+     
+    
+    /**
+     * Sets the value of the item. 
+     * @param {String} either an object  or a string..
+     */
+    setValue : function(v){
+        //this.value = v;
+        v = v || []; // empty set..
+        // this does not seem smart - it really only affects memoryproxy grids..
+        if (this.grid && this.grid.getDataSource() && typeof(v) != 'undefined') {
+            var ds = this.grid.getDataSource();
+            // assumes a json reader..
+            var data = {}
+            data[ds.reader.meta.root ] =  typeof(v) == 'string' ? Roo.decode(v) : v;
+            ds.loadData( data);
+        }
+        Roo.form.GridField.superclass.setValue.call(this, v);
+        this.refreshValue();
+        // should load data in the grid really....
+    },
+    
+    // private
+    refreshValue: function() {
+         var val = [];
+        this.grid.getDataSource().each(function(r) {
+            val.push(r.data);
+        });
+        this.el.dom.value = Roo.encode(val);
+    }
+    
+     
+    
+    
+});
\ No newline at end of file
diff --git a/Roo/form/Hidden.js b/Roo/form/Hidden.js
new file mode 100644 (file)
index 0000000..7d11f0b
--- /dev/null
@@ -0,0 +1,43 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+/**
+ * @class Roo.form.Hidden
+ * @extends Roo.form.TextField
+ * Simple Hidden element used on forms 
+ * 
+ * usage: form.add(new Roo.form.HiddenField({ 'name' : 'test1' }));
+ * 
+ * @constructor
+ * Creates a new Hidden form element.
+ * @param {Object} config Configuration options
+ */
+
+
+
+// easy hidden field...
+Roo.form.Hidden = function(config){
+    Roo.form.Hidden.superclass.constructor.call(this, config);
+};
+  
+Roo.extend(Roo.form.Hidden, Roo.form.TextField, {
+    fieldLabel:      '',
+    inputType:      'hidden',
+    width:          50,
+    allowBlank:     true,
+    labelSeparator: '',
+    hidden:         true,
+    itemCls :       'x-form-item-display-none'
+
+
+});
+
+
diff --git a/Roo/form/HtmlEditor.js b/Roo/form/HtmlEditor.js
new file mode 100644 (file)
index 0000000..9526df3
--- /dev/null
@@ -0,0 +1,883 @@
+//<script type="text/javascript">
+
+/*
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ * licensing@extjs.com
+ * 
+ * http://www.extjs.com/license
+ */
+ /**
+  * 
+  * Known bugs:
+  * Default CSS appears to render it as fixed text by default (should really be Sans-Serif)
+  * - IE ? - no idea how much works there.
+  * 
+  * 
+  * 
+  */
+
+/**
+ * @class Ext.form.HtmlEditor
+ * @extends Ext.form.Field
+ * Provides a lightweight HTML Editor component.
+ * WARNING - THIS CURRENTlY ONLY WORKS ON FIREFOX - USE FCKeditor for a cross platform version
+ * 
+ * <br><br><b>Note: The focus/blur and validation marking functionality inherited from Ext.form.Field is NOT
+ * supported by this editor.</b><br/><br/>
+ * An Editor is a sensitive component that can't be used in all spots standard fields can be used. Putting an Editor within
+ * any element that has display set to 'none' can cause problems in Safari and Firefox.<br/><br/>
+ */
+Roo.form.HtmlEditor = Roo.extend(Roo.form.Field, {
+      /**
+     * @cfg {Array} toolbars Array of toolbars. - defaults to just the Standard one
+     */
+    toolbars : false,
+    /**
+     * @cfg {String} createLinkText The default text for the create link prompt
+     */
+    createLinkText : 'Please enter the URL for the link:',
+    /**
+     * @cfg {String} defaultLinkValue The default value for the create link prompt (defaults to http:/ /)
+     */
+    defaultLinkValue : 'http:/'+'/',
+   
+    
+    // id of frame..
+    frameId: false,
+    
+    // private properties
+    validationEvent : false,
+    deferHeight: true,
+    initialized : false,
+    activated : false,
+    sourceEditMode : false,
+    onFocus : Roo.emptyFn,
+    iframePad:3,
+    hideMode:'offsets',
+    defaultAutoCreate : {
+        tag: "textarea",
+        style:"width:500px;height:300px;",
+        autocomplete: "off"
+    },
+
+    // private
+    initComponent : function(){
+        this.addEvents({
+            /**
+             * @event initialize
+             * Fires when the editor is fully initialized (including the iframe)
+             * @param {HtmlEditor} this
+             */
+            initialize: true,
+            /**
+             * @event activate
+             * Fires when the editor is first receives the focus. Any insertion must wait
+             * until after this event.
+             * @param {HtmlEditor} this
+             */
+            activate: true,
+             /**
+             * @event beforesync
+             * Fires before the textarea is updated with content from the editor iframe. Return false
+             * to cancel the sync.
+             * @param {HtmlEditor} this
+             * @param {String} html
+             */
+            beforesync: true,
+             /**
+             * @event beforepush
+             * Fires before the iframe editor is updated with content from the textarea. Return false
+             * to cancel the push.
+             * @param {HtmlEditor} this
+             * @param {String} html
+             */
+            beforepush: true,
+             /**
+             * @event sync
+             * Fires when the textarea is updated with content from the editor iframe.
+             * @param {HtmlEditor} this
+             * @param {String} html
+             */
+            sync: true,
+             /**
+             * @event push
+             * Fires when the iframe editor is updated with content from the textarea.
+             * @param {HtmlEditor} this
+             * @param {String} html
+             */
+            push: true,
+             /**
+             * @event editmodechange
+             * Fires when the editor switches edit modes
+             * @param {HtmlEditor} this
+             * @param {Boolean} sourceEdit True if source edit, false if standard editing.
+             */
+            editmodechange: true,
+            /**
+             * @event editorevent
+             * Fires when on any editor (mouse up/down cursor movement etc.) - used for toolbar hooks.
+             * @param {HtmlEditor} this
+             */
+            editorevent: true
+        })
+    },
+
+    /**
+     * Protected method that will not generally be called directly. It
+     * is called when the editor creates its toolbar. Override this method if you need to
+     * add custom toolbar buttons.
+     * @param {HtmlEditor} editor
+     */
+    createToolbar : function(editor){
+        if (!editor.toolbars || !editor.toolbars.length) {
+            editor.toolbars = [ new Roo.form.HtmlEditor.ToolbarStandard() ]; // can be empty?
+        }
+        
+        for (var i =0 ; i < editor.toolbars.length;i++) {
+            editor.toolbars[i].init(editor);
+        }
+         
+        
+    },
+
+    /**
+     * Protected method that will not generally be called directly. It
+     * is called when the editor initializes the iframe with HTML contents. Override this method if you
+     * want to change the initialization markup of the iframe (e.g. to add stylesheets).
+     */
+    getDocMarkup : function(){
+        return '<html><head><style type="text/css">body{border:0;margin:0;padding:3px;height:98%;cursor:text;}</style></head><body></body></html>';
+    },
+
+    // private
+    onRender : function(ct, position){
+        Roo.form.HtmlEditor.superclass.onRender.call(this, ct, position);
+        this.el.dom.style.border = '0 none';
+        this.el.dom.setAttribute('tabIndex', -1);
+        this.el.addClass('x-hidden');
+        if(Roo.isIE){ // fix IE 1px bogus margin
+            this.el.applyStyles('margin-top:-1px;margin-bottom:-1px;')
+        }
+        this.wrap = this.el.wrap({
+            cls:'x-html-editor-wrap', cn:{cls:'x-html-editor-tb'}
+        });
+
+        this.frameId = Roo.id();
+        this.createToolbar(this);
+        
+        
+        
+        
+      
+        
+        var iframe = this.wrap.createChild({
+            tag: 'iframe',
+            id: this.frameId,
+            name: this.frameId,
+            frameBorder : 'no',
+            'src' : Roo.SSL_SECURE_URL ? Roo.SSL_SECURE_URL  :  "javascript:false"
+        });
+        
+       // console.log(iframe);
+        //this.wrap.dom.appendChild(iframe);
+
+        this.iframe = iframe.dom;
+
+         this.assignDocWin();
+        
+        this.doc.designMode = 'on';
+       
+        this.doc.open();
+        this.doc.write(this.getDocMarkup());
+        this.doc.close();
+
+        
+        var task = { // must defer to wait for browser to be ready
+            run : function(){
+                //console.log("run task?" + this.doc.readyState);
+                this.assignDocWin();
+                if(this.doc.body || this.doc.readyState == 'complete'){
+                    try {
+                        
+                       
+                        this.doc.designMode="on";
+                    } catch (e) {
+                        return;
+                    }
+                    Roo.TaskMgr.stop(task);
+                    this.initEditor.defer(10, this);
+                }
+            },
+            interval : 10,
+            duration:10000,
+            scope: this
+        };
+        Roo.TaskMgr.start(task);
+
+        if(!this.width){
+            this.setSize(this.el.getSize());
+        }
+    },
+
+    // private
+    onResize : function(w, h){
+        Roo.form.HtmlEditor.superclass.onResize.apply(this, arguments);
+        if(this.el && this.iframe){
+            if(typeof w == 'number'){
+                var aw = w - this.wrap.getFrameWidth('lr');
+                this.el.setWidth(this.adjustWidth('textarea', aw));
+                this.iframe.style.width = aw + 'px';
+            }
+            if(typeof h == 'number'){
+                var tbh = 0;
+                for (var i =0; i < this.toolbars.length;i++) {
+                    // fixme - ask toolbars for heights?
+                    tbh += this.toolbars[i].tb.el.getHeight();
+                }
+                
+                
+                
+                
+                var ah = h - this.wrap.getFrameWidth('tb') - tbh;// this.tb.el.getHeight();
+                this.el.setHeight(this.adjustWidth('textarea', ah));
+                this.iframe.style.height = ah + 'px';
+                if(this.doc){
+                    (this.doc.body || this.doc.documentElement).style.height = (ah - (this.iframePad*2)) + 'px';
+                }
+            }
+        }
+    },
+
+    /**
+     * Toggles the editor between standard and source edit mode.
+     * @param {Boolean} sourceEdit (optional) True for source edit, false for standard
+     */
+    toggleSourceEdit : function(sourceEditMode){
+        
+        this.sourceEditMode = sourceEditMode === true;
+        
+        if(this.sourceEditMode){
+          
+            this.syncValue();
+            this.iframe.className = 'x-hidden';
+            this.el.removeClass('x-hidden');
+            this.el.dom.removeAttribute('tabIndex');
+            this.el.focus();
+        }else{
+             
+            this.pushValue();
+            this.iframe.className = '';
+            this.el.addClass('x-hidden');
+            this.el.dom.setAttribute('tabIndex', -1);
+            this.deferFocus();
+        }
+        this.setSize(this.wrap.getSize());
+        this.fireEvent('editmodechange', this, this.sourceEditMode);
+    },
+
+    // private used internally
+    createLink : function(){
+        var url = prompt(this.createLinkText, this.defaultLinkValue);
+        if(url && url != 'http:/'+'/'){
+            this.relayCmd('createlink', url);
+        }
+    },
+
+    // private (for BoxComponent)
+    adjustSize : Roo.BoxComponent.prototype.adjustSize,
+
+    // private (for BoxComponent)
+    getResizeEl : function(){
+        return this.wrap;
+    },
+
+    // private (for BoxComponent)
+    getPositionEl : function(){
+        return this.wrap;
+    },
+
+    // private
+    initEvents : function(){
+        this.originalValue = this.getValue();
+    },
+
+    /**
+     * Overridden and disabled. The editor element does not support standard valid/invalid marking. @hide
+     * @method
+     */
+    markInvalid : Roo.emptyFn,
+    /**
+     * Overridden and disabled. The editor element does not support standard valid/invalid marking. @hide
+     * @method
+     */
+    clearInvalid : Roo.emptyFn,
+
+    setValue : function(v){
+        Roo.form.HtmlEditor.superclass.setValue.call(this, v);
+        this.pushValue();
+    },
+
+    /**
+     * Protected method that will not generally be called directly. If you need/want
+     * custom HTML cleanup, this is the method you should override.
+     * @param {String} html The HTML to be cleaned
+     * return {String} The cleaned HTML
+     */
+    cleanHtml : function(html){
+        html = String(html);
+        if(html.length > 5){
+            if(Roo.isSafari){ // strip safari nonsense
+                html = html.replace(/\sclass="(?:Apple-style-span|khtml-block-placeholder)"/gi, '');
+            }
+        }
+        if(html == '&nbsp;'){
+            html = '';
+        }
+        return html;
+    },
+
+    /**
+     * Protected method that will not generally be called directly. Syncs the contents
+     * of the editor iframe with the textarea.
+     */
+    syncValue : function(){
+        if(this.initialized){
+            var bd = (this.doc.body || this.doc.documentElement);
+            var html = bd.innerHTML;
+            if(Roo.isSafari){
+                var bs = bd.getAttribute('style'); // Safari puts text-align styles on the body element!
+                var m = bs.match(/text-align:(.*?);/i);
+                if(m && m[1]){
+                    html = '<div style="'+m[0]+'">' + html + '</div>';
+                }
+            }
+            html = this.cleanHtml(html);
+            if(this.fireEvent('beforesync', this, html) !== false){
+                this.el.dom.value = html;
+                this.fireEvent('sync', this, html);
+            }
+        }
+    },
+
+    /**
+     * Protected method that will not generally be called directly. Pushes the value of the textarea
+     * into the iframe editor.
+     */
+    pushValue : function(){
+        if(this.initialized){
+            var v = this.el.dom.value;
+            if(v.length < 1){
+                v = '&#160;';
+            }
+            if(this.fireEvent('beforepush', this, v) !== false){
+                (this.doc.body || this.doc.documentElement).innerHTML = v;
+                this.fireEvent('push', this, v);
+            }
+        }
+    },
+
+    // private
+    deferFocus : function(){
+        this.focus.defer(10, this);
+    },
+
+    // doc'ed in Field
+    focus : function(){
+        if(this.win && !this.sourceEditMode){
+            this.win.focus();
+        }else{
+            this.el.focus();
+        }
+    },
+    
+    assignDocWin: function()
+    {
+        var iframe = this.iframe;
+        
+         if(Roo.isIE){
+            this.doc = iframe.contentWindow.document;
+            this.win = iframe.contentWindow;
+        } else {
+            this.doc = (iframe.contentDocument || Roo.get(this.frameId).dom.document);
+            this.win = Roo.get(this.frameId).dom.contentWindow;
+        }
+    },
+    
+    // private
+    initEditor : function(){
+        //console.log("INIT EDITOR");
+        this.assignDocWin();
+        
+        
+        
+        this.doc.designMode="on";
+        this.doc.open();
+        this.doc.write(this.getDocMarkup());
+        this.doc.close();
+        
+        var dbody = (this.doc.body || this.doc.documentElement);
+        //var ss = this.el.getStyles('font-size', 'font-family', 'background-image', 'background-repeat');
+        // this copies styles from the containing element into thsi one..
+        // not sure why we need all of this..
+        var ss = this.el.getStyles('font-size', 'background-image', 'background-repeat');
+        ss['background-attachment'] = 'fixed'; // w3c
+        dbody.bgProperties = 'fixed'; // ie
+        Roo.DomHelper.applyStyles(dbody, ss);
+        Roo.EventManager.on(this.doc, {
+            'mousedown': this.onEditorEvent,
+            'dblclick': this.onEditorEvent,
+            'click': this.onEditorEvent,
+            'keyup': this.onEditorEvent,
+            buffer:100,
+            scope: this
+        });
+        if(Roo.isGecko){
+            Roo.EventManager.on(this.doc, 'keypress', this.applyCommand, this);
+        }
+        if(Roo.isIE || Roo.isSafari || Roo.isOpera){
+            Roo.EventManager.on(this.doc, 'keydown', this.fixKeys, this);
+        }
+        this.initialized = true;
+
+        this.fireEvent('initialize', this);
+        this.pushValue();
+    },
+
+    // private
+    onDestroy : function(){
+        
+        
+        
+        if(this.rendered){
+            
+            for (var i =0; i < this.toolbars.length;i++) {
+                // fixme - ask toolbars for heights?
+                this.toolbars[i].onDestroy();
+            }
+            
+            this.wrap.dom.innerHTML = '';
+            this.wrap.remove();
+        }
+    },
+
+    // private
+    onFirstFocus : function(){
+        
+        this.assignDocWin();
+        
+        
+        this.activated = true;
+        for (var i =0; i < this.toolbars.length;i++) {
+            this.toolbars[i].onFirstFocus();
+        }
+       
+        if(Roo.isGecko){ // prevent silly gecko errors
+            this.win.focus();
+            var s = this.win.getSelection();
+            if(!s.focusNode || s.focusNode.nodeType != 3){
+                var r = s.getRangeAt(0);
+                r.selectNodeContents((this.doc.body || this.doc.documentElement));
+                r.collapse(true);
+                this.deferFocus();
+            }
+            try{
+                this.execCmd('useCSS', true);
+                this.execCmd('styleWithCSS', false);
+            }catch(e){}
+        }
+        this.fireEvent('activate', this);
+    },
+
+    // private
+    adjustFont: function(btn){
+        var adjust = btn.cmd == 'increasefontsize' ? 1 : -1;
+        //if(Roo.isSafari){ // safari
+        //    adjust *= 2;
+       // }
+        var v = parseInt(this.doc.queryCommandValue('FontSize')|| 3, 10);
+        if(Roo.isSafari){ // safari
+            var sm = { 10 : 1, 13: 2, 16:3, 18:4, 24: 5, 32:6, 48: 7 };
+            v =  (v < 10) ? 10 : v;
+            v =  (v > 48) ? 48 : v;
+            v = typeof(sm[v]) == 'undefined' ? 1 : sm[v];
+            
+        }
+        
+        
+        v = Math.max(1, v+adjust);
+        
+        this.execCmd('FontSize', v  );
+    },
+
+    onEditorEvent : function(e){
+        this.fireEvent('editorevent', this, e);
+      //  this.updateToolbar();
+        this.syncValue();
+    },
+
+    insertTag : function(tg)
+    {
+        // could be a bit smarter... -> wrap the current selected tRoo..
+        
+        this.execCmd("formatblock",   tg);
+        
+    },
+    
+    insertText : function(txt)
+    {
+        
+        
+        range = this.createRange();
+        range.deleteContents();
+               //alert(Sender.getAttribute('label'));
+               
+        range.insertNode(this.doc.createTextNode(txt));
+    } ,
+    
+    // private
+    relayBtnCmd : function(btn){
+        this.relayCmd(btn.cmd);
+    },
+
+    /**
+     * Executes a Midas editor command on the editor document and performs necessary focus and
+     * toolbar updates. <b>This should only be called after the editor is initialized.</b>
+     * @param {String} cmd The Midas command
+     * @param {String/Boolean} value (optional) The value to pass to the command (defaults to null)
+     */
+    relayCmd : function(cmd, value){
+        this.win.focus();
+        this.execCmd(cmd, value);
+        this.fireEvent('editorevent', this);
+        //this.updateToolbar();
+        this.deferFocus();
+    },
+
+    /**
+     * Executes a Midas editor command directly on the editor document.
+     * For visual commands, you should use {@link #relayCmd} instead.
+     * <b>This should only be called after the editor is initialized.</b>
+     * @param {String} cmd The Midas command
+     * @param {String/Boolean} value (optional) The value to pass to the command (defaults to null)
+     */
+    execCmd : function(cmd, value){
+        this.doc.execCommand(cmd, false, value === undefined ? null : value);
+        this.syncValue();
+    },
+
+    // private
+    applyCommand : function(e){
+        if(e.ctrlKey){
+            var c = e.getCharCode(), cmd;
+            if(c > 0){
+                c = String.fromCharCode(c);
+                switch(c){
+                    case 'b':
+                        cmd = 'bold';
+                    break;
+                    case 'i':
+                        cmd = 'italic';
+                    break;
+                    case 'u':
+                        cmd = 'underline';
+                    break;
+                }
+                if(cmd){
+                    this.win.focus();
+                    this.execCmd(cmd);
+                    this.deferFocus();
+                    e.preventDefault();
+                }
+            }
+        }
+    },
+
+    /**
+     * Inserts the passed text at the current cursor position. Note: the editor must be initialized and activated
+     * to insert tRoo.
+     * @param {String} text
+     */
+    insertAtCursor : function(text){
+        if(!this.activated){
+            return;
+        }
+        if(Roo.isIE){
+            this.win.focus();
+            var r = this.doc.selection.createRange();
+            if(r){
+                r.collapse(true);
+                r.pasteHTML(text);
+                this.syncValue();
+                this.deferFocus();
+            }
+        }else if(Roo.isGecko || Roo.isOpera){
+            this.win.focus();
+            this.execCmd('InsertHTML', text);
+            this.deferFocus();
+        }else if(Roo.isSafari){
+            this.execCmd('InsertText', text);
+            this.deferFocus();
+        }
+    },
+
+    // private
+    fixKeys : function(){ // load time branching for fastest keydown performance
+        if(Roo.isIE){
+            return function(e){
+                var k = e.getKey(), r;
+                if(k == e.TAB){
+                    e.stopEvent();
+                    r = this.doc.selection.createRange();
+                    if(r){
+                        r.collapse(true);
+                        r.pasteHTML('&#160;&#160;&#160;&#160;');
+                        this.deferFocus();
+                    }
+                }else if(k == e.ENTER){
+                    r = this.doc.selection.createRange();
+                    if(r){
+                        var target = r.parentElement();
+                        if(!target || target.tagName.toLowerCase() != 'li'){
+                            e.stopEvent();
+                            r.pasteHTML('<br />');
+                            r.collapse(false);
+                            r.select();
+                        }
+                    }
+                }
+            };
+        }else if(Roo.isOpera){
+            return function(e){
+                var k = e.getKey();
+                if(k == e.TAB){
+                    e.stopEvent();
+                    this.win.focus();
+                    this.execCmd('InsertHTML','&#160;&#160;&#160;&#160;');
+                    this.deferFocus();
+                }
+            };
+        }else if(Roo.isSafari){
+            return function(e){
+                var k = e.getKey();
+                if(k == e.TAB){
+                    e.stopEvent();
+                    this.execCmd('InsertText','\t');
+                    this.deferFocus();
+                }
+             };
+        }
+    }(),
+    
+    getAllAncestors: function()
+    {
+        var p = this.getSelectedNode();
+        var a = [];
+        if (!p) {
+            a.push(p); // push blank onto stack..
+            p = this.getParentElement();
+        }
+        
+        
+        while (p && (p.nodeType == 1) && (p.tagName.toLowerCase() != 'body')) {
+            a.push(p);
+            p = p.parentNode;
+        }
+        a.push(this.doc.body);
+        return a;
+    },
+    lastSel : false,
+    lastSelNode : false,
+    
+    
+    getSelection : function() 
+    {
+        this.assignDocWin();
+        return Roo.isIE ? this.doc.selection : this.win.getSelection();
+    },
+    
+    getSelectedNode: function() 
+    {
+        // this may only work on Gecko!!!
+        
+        // should we cache this!!!!
+        
+        
+        
+         
+        var range = this.createRange(this.getSelection());
+        
+        if (Roo.isIE) {
+            var parent = range.parentElement();
+            while (true) {
+                var testRange = range.duplicate();
+                testRange.moveToElementText(parent);
+                if (testRange.inRange(range)) {
+                    break;
+                }
+                if ((parent.nodeType != 1) || (parent.tagName.toLowerCase() == 'body')) {
+                    break;
+                }
+                parent = parent.parentElement;
+            }
+            return parent;
+        }
+        
+        
+        var ar = range.endContainer.childNodes;
+        if (!ar.length) {
+            ar = range.commonAncestorContainer.childNodes;
+            //alert(ar.length);
+        }
+        var nodes = [];
+        var other_nodes = [];
+        var has_other_nodes = false;
+        for (var i=0;i<ar.length;i++) {
+            if ((ar[i].nodeType == 3) && (!ar[i].data.length)) { // empty text ? 
+                continue;
+            }
+            // fullly contained node.
+            
+            if (this.rangeIntersectsNode(range,ar[i]) && this.rangeCompareNode(range,ar[i]) == 3) {
+                nodes.push(ar[i]);
+                continue;
+            }
+            
+            // probably selected..
+            if ((ar[i].nodeType == 1) && this.rangeIntersectsNode(range,ar[i]) && (this.rangeCompareNode(range,ar[i]) > 0)) {
+                other_nodes.push(ar[i]);
+                continue;
+            }
+            if (!this.rangeIntersectsNode(range,ar[i])|| (this.rangeCompareNode(range,ar[i]) == 0))  {
+                continue;
+            }
+            
+            
+            has_other_nodes = true;
+        }
+        if (!nodes.length && other_nodes.length) {
+            nodes= other_nodes;
+        }
+        if (has_other_nodes || !nodes.length || (nodes.length > 1)) {
+            return false;
+        }
+        
+        return nodes[0];
+    },
+    createRange: function(sel)
+    {
+        // this has strange effects when using with 
+        // top toolbar - not sure if it's a great idea.
+        //this.editor.contentWindow.focus();
+        if (typeof sel != "undefined") {
+            try {
+                return sel.getRangeAt ? sel.getRangeAt(0) : sel.createRange();
+            } catch(e) {
+                return this.doc.createRange();
+            }
+        } else {
+            return this.doc.createRange();
+        }
+    },
+    getParentElement: function()
+    {
+        
+        this.assignDocWin();
+        var sel = Roo.isIE ? this.doc.selection : this.win.getSelection();
+        
+        var range = this.createRange(sel);
+         
+        try {
+            var p = range.commonAncestorContainer;
+            while (p.nodeType == 3) { // text node
+                p = p.parentNode;
+            }
+            return p;
+        } catch (e) {
+            return null;
+        }
+    
+    },
+    
+    
+    
+    // BC Hacks - cause I cant work out what i was trying to do..
+    rangeIntersectsNode : function(range, node)
+    {
+        var nodeRange = node.ownerDocument.createRange();
+        try {
+            nodeRange.selectNode(node);
+        }
+        catch (e) {
+            nodeRange.selectNodeContents(node);
+        }
+
+        return range.compareBoundaryPoints(Range.END_TO_START, nodeRange) == -1 &&
+                 range.compareBoundaryPoints(Range.START_TO_END, nodeRange) == 1;
+    },
+    rangeCompareNode : function(range, node) {
+        var nodeRange = node.ownerDocument.createRange();
+        try {
+            nodeRange.selectNode(node);
+        } catch (e) {
+            nodeRange.selectNodeContents(node);
+        }
+        var nodeIsBefore = range.compareBoundaryPoints(Range.START_TO_START, nodeRange) == 1;
+        var nodeIsAfter = range.compareBoundaryPoints(Range.END_TO_END, nodeRange) == -1;
+
+        if (nodeIsBefore && !nodeIsAfter)
+            return 0;
+        if (!nodeIsBefore && nodeIsAfter)
+            return 1;
+        if (nodeIsBefore && nodeIsAfter)
+            return 2;
+
+        return 3;
+    }
+
+    
+    
+    // hide stuff that is not compatible
+    /**
+     * @event blur
+     * @hide
+     */
+    /**
+     * @event change
+     * @hide
+     */
+    /**
+     * @event focus
+     * @hide
+     */
+    /**
+     * @event specialkey
+     * @hide
+     */
+    /**
+     * @cfg {String} fieldClass @hide
+     */
+    /**
+     * @cfg {String} focusClass @hide
+     */
+    /**
+     * @cfg {String} autoCreate @hide
+     */
+    /**
+     * @cfg {String} inputType @hide
+     */
+    /**
+     * @cfg {String} invalidClass @hide
+     */
+    /**
+     * @cfg {String} invalidText @hide
+     */
+    /**
+     * @cfg {String} msgFx @hide
+     */
+    /**
+     * @cfg {String} validateOnBlur @hide
+     */
+});
\ No newline at end of file
diff --git a/Roo/form/HtmlEditor/ToolbarContext.js b/Roo/form/HtmlEditor/ToolbarContext.js
new file mode 100644 (file)
index 0000000..28766b8
--- /dev/null
@@ -0,0 +1,400 @@
+// <script type="text/javascript">
+/*
+ * Based on
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *  
+ */
+
+/**
+ * @class Roo.form.HtmlEditor.ToolbarContext
+ * Context Toolbar
+ * 
+ * Usage:
+ *
+ new Roo.form.HtmlEditor({
+    ....
+    toolbars : [
+        new Roo.form.HtmlEditor.ToolbarStandard(),
+        new Roo.form.HtmlEditor.ToolbarContext()
+        })
+    }
+     
+ * 
+ * @config : {Object} disable List of elements to disable.. (not done yet.)
+ * 
+ * 
+ */
+
+Roo.form.HtmlEditor.ToolbarContext = function(config)
+{
+    
+    Roo.apply(this, config);
+    //Roo.form.HtmlEditorToolbar1.superclass.constructor.call(this, editor.wrap.dom.firstChild, [], config);
+    // dont call parent... till later.
+}
+Roo.form.HtmlEditor.ToolbarContext.types = {
+    'IMG' : {
+        width : {
+            title: "Width",
+            width: 40
+        },
+        height:  {
+            title: "Height",
+            width: 40
+        },
+        align: {
+            title: "Align",
+            opts : [ [""],[ "left"],[ "right"],[ "center"],[ "top"]],
+            width : 80
+            
+        },
+        border: {
+            title: "Border",
+            width: 40
+        },
+        alt: {
+            title: "Alt",
+            width: 120
+        },
+        src : {
+            title: "Src",
+            width: 220
+        }
+        
+    },
+    'A' : {
+        name : {
+            title: "Name",
+            width: 50
+        },
+        href:  {
+            title: "Href",
+            width: 220
+        } // border?
+        
+    },
+    'TABLE' : {
+        rows : {
+            title: "Rows",
+            width: 20
+        },
+        cols : {
+            title: "Cols",
+            width: 20
+        },
+        width : {
+            title: "Width",
+            width: 40
+        },
+        height : {
+            title: "Height",
+            width: 40
+        },
+        border : {
+            title: "Border",
+            width: 20
+        }
+    },
+    'TD' : {
+        width : {
+            title: "Width",
+            width: 40
+        },
+        height : {
+            title: "Height",
+            width: 40
+        },   
+        align: {
+            title: "Align",
+            opts : [[""],[ "left"],[ "center"],[ "right"],[ "justify"],[ "char"]],
+            width: 40
+        },
+        valign: {
+            title: "Valign",
+            opts : [[""],[ "top"],[ "middle"],[ "bottom"],[ "baseline"]],
+            width: 40
+        },
+        colspan: {
+            title: "Colspan",
+            width: 20
+            
+        }
+    },
+    'INPUT' : {
+        name : {
+            title: "name",
+            width: 120
+        },
+        value : {
+            title: "Value",
+            width: 120
+        },
+        width : {
+            title: "Width",
+            width: 40
+        }
+    },
+    'LABEL' : {
+        'for' : {
+            title: "For",
+            width: 120
+        }
+    },
+    'TEXTAREA' : {
+          name : {
+            title: "name",
+            width: 120
+        },
+        rows : {
+            title: "Rows",
+            width: 20
+        },
+        cols : {
+            title: "Cols",
+            width: 20
+        }
+    },
+    'SELECT' : {
+        name : {
+            title: "name",
+            width: 120
+        },
+        selectoptions : {
+            title: "Options",
+            width: 200
+        }
+    },
+    'BODY' : {
+        title : {
+            title: "title",
+            width: 120,
+            disabled : true
+        }
+    }
+};
+
+
+
+Roo.apply(Roo.form.HtmlEditor.ToolbarContext.prototype,  {
+    
+    tb: false,
+    
+    rendered: false,
+    
+    editor : false,
+    /**
+     * @cfg {Object} disable  List of toolbar elements to disable
+         
+     */
+    disable : false,
+    
+    
+    
+    toolbars : false,
+    
+    init : function(editor)
+    {
+        this.editor = editor;
+        
+        
+        var fid = editor.frameId;
+        var etb = this;
+        function btn(id, toggle, handler){
+            var xid = fid + '-'+ id ;
+            return {
+                id : xid,
+                cmd : id,
+                cls : 'x-btn-icon x-edit-'+id,
+                enableToggle:toggle !== false,
+                scope: editor, // was editor...
+                handler:handler||editor.relayBtnCmd,
+                clickEvent:'mousedown',
+                tooltip: etb.buttonTips[id] || undefined, ///tips ???
+                tabIndex:-1
+            };
+        }
+        // create a new element.
+        var wdiv = editor.wrap.createChild({
+                tag: 'div'
+            }, editor.wrap.dom.firstChild.nextSibling, true);
+        
+        // can we do this more than once??
+        
+         // stop form submits
+      
+        // disable everything...
+        var ty= Roo.form.HtmlEditor.ToolbarContext.types;
+        this.toolbars = {};
+           
+        for (var i in  ty) {
+            this.toolbars[i] = this.buildToolbar(ty[i],i);
+        }
+        this.tb = this.toolbars.BODY;
+        this.tb.el.show();
+        
+         
+        this.rendered = true;
+        
+        // the all the btns;
+        editor.on('editorevent', this.updateToolbar, this);
+        // other toolbars need to implement this..
+        //editor.on('editmodechange', this.updateToolbar, this);
+    },
+    
+    
+    
+    /**
+     * Protected method that will not generally be called directly. It triggers
+     * a toolbar update by reading the markup state of the current selection in the editor.
+     */
+    updateToolbar: function(){
+
+        if(!this.editor.activated){
+            this.editor.onFirstFocus();
+            return;
+        }
+
+        
+        var ans = this.editor.getAllAncestors();
+        
+        // pick
+        var ty= Roo.form.HtmlEditor.ToolbarContext.types;
+        var sel = ans.length ? (ans[0] ?  ans[0]  : ans[1]) : this.editor.doc.body;
+        sel = sel ? sel : this.editor.doc.body;
+        sel = sel.tagName.length ? sel : this.editor.doc.body;
+        var tn = sel.tagName.toUpperCase();
+        sel = typeof(ty[tn]) != 'undefined' ? sel : this.editor.doc.body;
+        tn = sel.tagName.toUpperCase();
+        if (this.tb.name  == tn) {
+            return; // no change
+        }
+        this.tb.el.hide();
+        ///console.log("show: " + tn);
+        this.tb =  this.toolbars[tn];
+        this.tb.el.show();
+        this.tb.fields.each(function(e) {
+            e.setValue(sel.getAttribute(e.name));
+        });
+        this.tb.selectedNode = sel;
+        
+        
+        Roo.menu.MenuMgr.hideAll();
+
+        //this.editorsyncValue();
+    },
+   
+       
+    // private
+    onDestroy : function(){
+        if(this.rendered){
+            
+            this.tb.items.each(function(item){
+                if(item.menu){
+                    item.menu.removeAll();
+                    if(item.menu.el){
+                        item.menu.el.destroy();
+                    }
+                }
+                item.destroy();
+            });
+             
+        }
+    },
+    onFirstFocus: function() {
+        // need to do this for all the toolbars..
+        this.tb.items.each(function(item){
+           item.enable();
+        });
+    },
+    buildToolbar: function(tlist, nm)
+    {
+        var editor = this.editor;
+         // create a new element.
+        var wdiv = editor.wrap.createChild({
+                tag: 'div'
+            }, editor.wrap.dom.firstChild.nextSibling, true);
+        
+       
+        var tb = new Roo.Toolbar(wdiv);
+        tb.add(nm+ ":&nbsp;");
+        for (var i in tlist) {
+            var item = tlist[i];
+            tb.add(item.title + ":&nbsp;");
+            if (item.opts) {
+                // fixme
+                
+              
+                tb.addField( new Roo.form.ComboBox({
+                    store: new Roo.data.SimpleStore({
+                        id : 'val',
+                        fields: ['val'],
+                        data : item.opts // from states.js
+                    }),
+                    name : i,
+                    displayField:'val',
+                    typeAhead: false,
+                    mode: 'local',
+                    editable : false,
+                    triggerAction: 'all',
+                    emptyText:'Select',
+                    selectOnFocus:true,
+                    width: item.width ? item.width  : 130,
+                    listeners : {
+                        'select': function(c, r, i) {
+                            tb.selectedNode.setAttribute(c.name, r.get('val'));
+                        }
+                    }
+
+                }));
+                continue;
+                    
+                
+                
+                
+                
+                tb.addField( new Roo.form.TextField({
+                    name: i,
+                    width: 100,
+                    //allowBlank:false,
+                    value: ''
+                }));
+                continue;
+            }
+            tb.addField( new Roo.form.TextField({
+                name: i,
+                width: item.width,
+                //allowBlank:true,
+                value: '',
+                listeners: {
+                    'change' : function(f, nv, ov) {
+                        tb.selectedNode.setAttribute(f.name, nv);
+                    }
+                }
+            }));
+             
+        }
+        tb.el.on('click', function(e){
+            e.preventDefault(); // what does this do?
+        });
+        tb.el.setVisibilityMode( Roo.Element.DISPLAY);
+        tb.el.hide();
+        tb.name = nm;
+        // dont need to disable them... as they will get hidden
+        return tb;
+         
+        
+    }
+    
+    
+    
+    
+});
+
+
+
+
+
diff --git a/Roo/form/HtmlEditor/ToolbarStandard.js b/Roo/form/HtmlEditor/ToolbarStandard.js
new file mode 100644 (file)
index 0000000..f7f42ef
--- /dev/null
@@ -0,0 +1,565 @@
+// <script type="text/javascript">
+/*
+ * Based on
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *  
+ */
+
+/**
+ * @class Roo.form.HtmlEditorToolbar1
+ * Basic Toolbar
+ * 
+ * Usage:
+ *
+ new Roo.form.HtmlEditor({
+    ....
+    toolbars : [
+        new Roo.form.HtmlEditorToolbar1({
+            disable : { fonts: 1 , format: 1, ..., ... , ...],
+            btns : [ .... ]
+        })
+    }
+     
+ * 
+ * @cfg {Object} disable List of elements to disable..
+ * @cfg {Array} btns List of additional buttons.
+ * 
+ * 
+ * NEEDS Extra CSS? 
+ * .x-html-editor-tb .x-edit-none .x-btn-text { background: none; }
+ */
+Roo.form.HtmlEditor.ToolbarStandard = function(config)
+{
+    
+    Roo.apply(this, config);
+    //Roo.form.HtmlEditorToolbar1.superclass.constructor.call(this, editor.wrap.dom.firstChild, [], config);
+    // dont call parent... till later.
+}
+
+Roo.apply(Roo.form.HtmlEditor.ToolbarStandard.prototype,  {
+    
+    tb: false,
+    
+    rendered: false,
+    
+    editor : false,
+    /**
+     * @cfg {Object} disable  List of toolbar elements to disable
+         
+     */
+    disable : false,
+      /**
+     * @cfg {Array} fontFamilies An array of available font families
+     */
+    fontFamilies : [
+        'Arial',
+        'Courier New',
+        'Tahoma',
+        'Times New Roman',
+        'Verdana'
+    ],
+    
+    specialChars : [
+           "&#169;",
+          "&#174;",     
+          "&#8482;",    
+          "&#163;" ,    
+         // "&#8212;",    
+          "&#8230;",    
+          "&#247;" ,    
+        //  "&#225;" ,     ?? a acute?
+           "&#8364;"    , //Euro
+       //   "&#8220;"    ,
+        //  "&#8221;"    ,
+        //  "&#8226;"    ,
+          "&#176;"  //   , // degrees
+
+         // "&#233;"     , // e ecute
+         // "&#250;"     , // u ecute?
+    ],
+    inputElements : [ 
+            "form", "input:text", "input:hidden", "input:checkbox", "input:radio", "input:password", 
+            "input:submit", "input:button", "select", "textarea", "label" ],
+    formats : [
+        ["p"] ,  
+        ["h1"],["h2"],["h3"],["h4"],["h5"],["h6"], 
+        ["pre"],[ "code"], 
+        ["abbr"],[ "acronym"],[ "address"],[ "cite"],[ "samp"],[ "var"]
+    ],
+     /**
+     * @cfg {String} defaultFont default font to use.
+     */
+    defaultFont: 'tahoma',
+   
+    fontSelect : false,
+    
+    
+    formatCombo : false,
+    
+    init : function(editor)
+    {
+        this.editor = editor;
+        
+        
+        var fid = editor.frameId;
+        var etb = this;
+        function btn(id, toggle, handler){
+            var xid = fid + '-'+ id ;
+            return {
+                id : xid,
+                cmd : id,
+                cls : 'x-btn-icon x-edit-'+id,
+                enableToggle:toggle !== false,
+                scope: editor, // was editor...
+                handler:handler||editor.relayBtnCmd,
+                clickEvent:'mousedown',
+                tooltip: etb.buttonTips[id] || undefined, ///tips ???
+                tabIndex:-1
+            };
+        }
+        
+        
+        
+        var tb = new Roo.Toolbar(editor.wrap.dom.firstChild);
+        this.tb = tb;
+         // stop form submits
+        tb.el.on('click', function(e){
+            e.preventDefault(); // what does this do?
+        });
+
+        if(!this.disable.font && !Roo.isSafari){
+            /* why no safari for fonts
+            editor.fontSelect = tb.el.createChild({
+                tag:'select',
+                tabIndex: -1,
+                cls:'x-font-select',
+                html: editor.createFontOptions()
+            });
+            editor.fontSelect.on('change', function(){
+                var font = editor.fontSelect.dom.value;
+                editor.relayCmd('fontname', font);
+                editor.deferFocus();
+            }, editor);
+            tb.add(
+                editor.fontSelect.dom,
+                '-'
+            );
+            */
+        };
+        if(!this.disable.formats){
+            this.formatCombo = new Roo.form.ComboBox({
+                store: new Roo.data.SimpleStore({
+                    id : 'tag',
+                    fields: ['tag'],
+                    data : this.formats // from states.js
+                }),
+                blockFocus : true,
+                //autoCreate : {tag: "div",  size: "20"},
+                displayField:'tag',
+                typeAhead: false,
+                mode: 'local',
+                editable : false,
+                triggerAction: 'all',
+                emptyText:'Add tag',
+                selectOnFocus:true,
+                width:135,
+                listeners : {
+                    'select': function(c, r, i) {
+                        editor.insertTag(r.get('tag'));
+                        editor.focus();
+                    }
+                }
+
+            });
+            tb.addField(this.formatCombo);
+            
+        }
+        
+        if(!this.disable.format){
+            tb.add(
+                btn('bold'),
+                btn('italic'),
+                btn('underline')
+            );
+        };
+        if(!this.disable.fontSize){
+            tb.add(
+                '-',
+                
+                
+                btn('increasefontsize', false, editor.adjustFont),
+                btn('decreasefontsize', false, editor.adjustFont)
+            );
+        };
+        
+        
+        if(this.disable.colors){
+            tb.add(
+                '-', {
+                    id:editor.frameId +'-forecolor',
+                    cls:'x-btn-icon x-edit-forecolor',
+                    clickEvent:'mousedown',
+                    tooltip: this.buttonTips['forecolor'] || undefined,
+                    tabIndex:-1,
+                    menu : new Roo.menu.ColorMenu({
+                        allowReselect: true,
+                        focus: Roo.emptyFn,
+                        value:'000000',
+                        plain:true,
+                        selectHandler: function(cp, color){
+                            editor.execCmd('forecolor', Roo.isSafari || Roo.isIE ? '#'+color : color);
+                            editor.deferFocus();
+                        },
+                        scope: editor,
+                        clickEvent:'mousedown'
+                    })
+                }, {
+                    id:editor.frameId +'backcolor',
+                    cls:'x-btn-icon x-edit-backcolor',
+                    clickEvent:'mousedown',
+                    tooltip: this.buttonTips['backcolor'] || undefined,
+                    tabIndex:-1,
+                    menu : new Roo.menu.ColorMenu({
+                        focus: Roo.emptyFn,
+                        value:'FFFFFF',
+                        plain:true,
+                        allowReselect: true,
+                        selectHandler: function(cp, color){
+                            if(Roo.isGecko){
+                                editor.execCmd('useCSS', false);
+                                editor.execCmd('hilitecolor', color);
+                                editor.execCmd('useCSS', true);
+                                editor.deferFocus();
+                            }else{
+                                editor.execCmd(Roo.isOpera ? 'hilitecolor' : 'backcolor', 
+                                    Roo.isSafari || Roo.isIE ? '#'+color : color);
+                                editor.deferFocus();
+                            }
+                        },
+                        scope:editor,
+                        clickEvent:'mousedown'
+                    })
+                }
+            );
+        };
+        // now add all the items...
+        
+
+        if(!this.disable.alignments){
+            tb.add(
+                '-',
+                btn('justifyleft'),
+                btn('justifycenter'),
+                btn('justifyright')
+            );
+        };
+
+        //if(!Roo.isSafari){
+            if(!this.disable.links){
+                tb.add(
+                    '-',
+                    btn('createlink', false, editor.createLink)    /// MOVE TO HERE?!!?!?!?!
+                );
+            };
+
+            if(!this.disable.lists){
+                tb.add(
+                    '-',
+                    btn('insertorderedlist'),
+                    btn('insertunorderedlist')
+                );
+            }
+            if(!this.disable.sourceEdit){
+                tb.add(
+                    '-',
+                    btn('sourceedit', true, function(btn){
+                        this.toggleSourceEdit(btn.pressed);
+                    })
+                );
+            }
+        //}
+        
+        var smenu = { };
+        // special menu.. - needs to be tidied up..
+        if (!this.disable.special) {
+            smenu = {
+                text: "&#169;",
+                cls: 'x-edit-none',
+                menu : {
+                    items : []
+                   }
+            };
+            for (var i =0; i < this.specialChars.length; i++) {
+                smenu.menu.items.push({
+                    
+                    text: this.specialChars[i],
+                    handler: function(a,b) {
+                        editor.insertAtCursor(String.fromCharCode(a.text.replace('&#','').replace(';', '')));
+                    },
+                    tabIndex:-1
+                });
+            }
+            
+            
+            tb.add(smenu);
+            
+            
+        }
+        if (this.btns) {
+            for(var i =0; i< this.btns.length;i++) {
+                var b = this.btns[i];
+                b.cls =  'x-edit-none';
+                b.scope = editor;
+                tb.add(b);
+            }
+        
+        }
+        
+        
+        
+        // disable everything...
+        
+        this.tb.items.each(function(item){
+           if(item.id != editor.frameId+ '-sourceedit'){
+                item.disable();
+            }
+        });
+        this.rendered = true;
+        
+        // the all the btns;
+        editor.on('editorevent', this.updateToolbar, this);
+        // other toolbars need to implement this..
+        //editor.on('editmodechange', this.updateToolbar, this);
+    },
+    
+    
+    
+    /**
+     * Protected method that will not generally be called directly. It triggers
+     * a toolbar update by reading the markup state of the current selection in the editor.
+     */
+    updateToolbar: function(){
+
+        if(!this.editor.activated){
+            this.editor.onFirstFocus();
+            return;
+        }
+
+        var btns = this.tb.items.map, 
+            doc = this.editor.doc,
+            frameId = this.editor.frameId;
+
+        if(!this.disable.font && !Roo.isSafari){
+            /*
+            var name = (doc.queryCommandValue('FontName')||this.editor.defaultFont).toLowerCase();
+            if(name != this.fontSelect.dom.value){
+                this.fontSelect.dom.value = name;
+            }
+            */
+        }
+        if(!this.disable.format){
+            btns[frameId + '-bold'].toggle(doc.queryCommandState('bold'));
+            btns[frameId + '-italic'].toggle(doc.queryCommandState('italic'));
+            btns[frameId + '-underline'].toggle(doc.queryCommandState('underline'));
+        }
+        if(!this.disable.alignments){
+            btns[frameId + '-justifyleft'].toggle(doc.queryCommandState('justifyleft'));
+            btns[frameId + '-justifycenter'].toggle(doc.queryCommandState('justifycenter'));
+            btns[frameId + '-justifyright'].toggle(doc.queryCommandState('justifyright'));
+        }
+        if(!Roo.isSafari && !this.disable.lists){
+            btns[frameId + '-insertorderedlist'].toggle(doc.queryCommandState('insertorderedlist'));
+            btns[frameId + '-insertunorderedlist'].toggle(doc.queryCommandState('insertunorderedlist'));
+        }
+        
+        var ans = this.editor.getAllAncestors();
+        if (this.formatCombo) {
+            
+            
+            var store = this.formatCombo.store;
+            this.formatCombo.setValue("");
+            for (var i =0; i < ans.length;i++) {
+                if (ans[i] && store.query('tag',ans[i].tagName.toLowerCase(), true).length) {
+                    // select it..
+                    this.formatCombo.setValue(ans[i].tagName.toLowerCase());
+                    break;
+                }
+            }
+        }
+        
+        
+        
+        // hides menus... - so this cant be on a menu...
+        Roo.menu.MenuMgr.hideAll();
+
+        //this.editorsyncValue();
+    },
+   
+    
+    createFontOptions : function(){
+        var buf = [], fs = this.fontFamilies, ff, lc;
+        for(var i = 0, len = fs.length; i< len; i++){
+            ff = fs[i];
+            lc = ff.toLowerCase();
+            buf.push(
+                '<option value="',lc,'" style="font-family:',ff,';"',
+                    (this.defaultFont == lc ? ' selected="true">' : '>'),
+                    ff,
+                '</option>'
+            );
+        }
+        return buf.join('');
+    },
+    
+    toggleSourceEdit : function(sourceEditMode){
+        if(sourceEditMode === undefined){
+            sourceEditMode = !this.sourceEditMode;
+        }
+        this.sourceEditMode = sourceEditMode === true;
+        var btn = this.tb.items.get(this.editor.frameId +'-sourceedit');
+        // just toggle the button?
+        if(btn.pressed !== this.editor.sourceEditMode){
+            btn.toggle(this.editor.sourceEditMode);
+            return;
+        }
+        
+        if(this.sourceEditMode){
+            this.tb.items.each(function(item){
+                if(item.cmd != 'sourceedit'){
+                    item.disable();
+                }
+            });
+          
+        }else{
+            if(this.initialized){
+                this.tb.items.each(function(item){
+                    item.enable();
+                });
+            }
+            
+        }
+        // tell the editor that it's been pressed..
+        this.editor.toggleSourceEdit(sourceEditMode);
+       
+    },
+     /**
+     * Object collection of toolbar tooltips for the buttons in the editor. The key
+     * is the command id associated with that button and the value is a valid QuickTips object.
+     * For example:
+<pre><code>
+{
+    bold : {
+        title: 'Bold (Ctrl+B)',
+        text: 'Make the selected text bold.',
+        cls: 'x-html-editor-tip'
+    },
+    italic : {
+        title: 'Italic (Ctrl+I)',
+        text: 'Make the selected text italic.',
+        cls: 'x-html-editor-tip'
+    },
+    ...
+</code></pre>
+    * @type Object
+     */
+    buttonTips : {
+        bold : {
+            title: 'Bold (Ctrl+B)',
+            text: 'Make the selected text bold.',
+            cls: 'x-html-editor-tip'
+        },
+        italic : {
+            title: 'Italic (Ctrl+I)',
+            text: 'Make the selected text italic.',
+            cls: 'x-html-editor-tip'
+        },
+        underline : {
+            title: 'Underline (Ctrl+U)',
+            text: 'Underline the selected text.',
+            cls: 'x-html-editor-tip'
+        },
+        increasefontsize : {
+            title: 'Grow Text',
+            text: 'Increase the font size.',
+            cls: 'x-html-editor-tip'
+        },
+        decreasefontsize : {
+            title: 'Shrink Text',
+            text: 'Decrease the font size.',
+            cls: 'x-html-editor-tip'
+        },
+        backcolor : {
+            title: 'Text Highlight Color',
+            text: 'Change the background color of the selected text.',
+            cls: 'x-html-editor-tip'
+        },
+        forecolor : {
+            title: 'Font Color',
+            text: 'Change the color of the selected text.',
+            cls: 'x-html-editor-tip'
+        },
+        justifyleft : {
+            title: 'Align Text Left',
+            text: 'Align text to the left.',
+            cls: 'x-html-editor-tip'
+        },
+        justifycenter : {
+            title: 'Center Text',
+            text: 'Center text in the editor.',
+            cls: 'x-html-editor-tip'
+        },
+        justifyright : {
+            title: 'Align Text Right',
+            text: 'Align text to the right.',
+            cls: 'x-html-editor-tip'
+        },
+        insertunorderedlist : {
+            title: 'Bullet List',
+            text: 'Start a bulleted list.',
+            cls: 'x-html-editor-tip'
+        },
+        insertorderedlist : {
+            title: 'Numbered List',
+            text: 'Start a numbered list.',
+            cls: 'x-html-editor-tip'
+        },
+        createlink : {
+            title: 'Hyperlink',
+            text: 'Make the selected text a hyperlink.',
+            cls: 'x-html-editor-tip'
+        },
+        sourceedit : {
+            title: 'Source Edit',
+            text: 'Switch to source editing mode.',
+            cls: 'x-html-editor-tip'
+        }
+    },
+    // private
+    onDestroy : function(){
+        if(this.rendered){
+            
+            this.tb.items.each(function(item){
+                if(item.menu){
+                    item.menu.removeAll();
+                    if(item.menu.el){
+                        item.menu.el.destroy();
+                    }
+                }
+                item.destroy();
+            });
+             
+        }
+    },
+    onFirstFocus: function() {
+        this.tb.items.each(function(item){
+           item.enable();
+        });
+    }
+});
+
+
+
+
diff --git a/Roo/form/Layout.js b/Roo/form/Layout.js
new file mode 100644 (file)
index 0000000..084abd1
--- /dev/null
@@ -0,0 +1,310 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+/**
+ * @class Roo.form.Layout
+ * @extends Roo.Component
+ * Creates a container for layout and rendering of fields in an {@link Roo.form.Form}.
+ * @constructor
+ * @param {Object} config Configuration options
+ */
+Roo.form.Layout = function(config){
+    var xitems = [];
+    if (config.items) {
+        xitems = config.items;
+        delete config.items;
+    }
+    Roo.form.Layout.superclass.constructor.call(this, config);
+    this.stack = [];
+    Roo.each(xitems, this.addxtype, this);
+     
+};
+
+Roo.extend(Roo.form.Layout, Roo.Component, {
+    /**
+     * @cfg {String/Object} autoCreate
+     * A DomHelper element spec used to autocreate the layout (defaults to {tag: 'div', cls: 'x-form-ct'})
+     */
+    /**
+     * @cfg {String/Object/Function} style
+     * A style specification string, e.g. "width:100px", or object in the form {width:"100px"}, or
+     * a function which returns such a specification.
+     */
+    /**
+     * @cfg {String} labelAlign
+     * Valid values are "left," "top" and "right" (defaults to "left")
+     */
+    /**
+     * @cfg {Number} labelWidth
+     * Fixed width in pixels of all field labels (defaults to undefined)
+     */
+    /**
+     * @cfg {Boolean} clear
+     * True to add a clearing element at the end of this layout, equivalent to CSS clear: both (defaults to true)
+     */
+    clear : true,
+    /**
+     * @cfg {String} labelSeparator
+     * The separator to use after field labels (defaults to ':')
+     */
+    labelSeparator : ':',
+    /**
+     * @cfg {Boolean} hideLabels
+     * True to suppress the display of field labels in this layout (defaults to false)
+     */
+    hideLabels : false,
+
+    // private
+    defaultAutoCreate : {tag: 'div', cls: 'x-form-ct'},
+    
+    isLayout : true,
+    
+    // private
+    onRender : function(ct, position){
+        if(this.el){ // from markup
+            this.el = Roo.get(this.el);
+        }else {  // generate
+            var cfg = this.getAutoCreate();
+            this.el = ct.createChild(cfg, position);
+        }
+        if(this.style){
+            this.el.applyStyles(this.style);
+        }
+        if(this.labelAlign){
+            this.el.addClass('x-form-label-'+this.labelAlign);
+        }
+        if(this.hideLabels){
+            this.labelStyle = "display:none";
+            this.elementStyle = "padding-left:0;";
+        }else{
+            if(typeof this.labelWidth == 'number'){
+                this.labelStyle = "width:"+this.labelWidth+"px;";
+                this.elementStyle = "padding-left:"+((this.labelWidth+(typeof this.labelPad == 'number' ? this.labelPad : 5))+'px')+";";
+            }
+            if(this.labelAlign == 'top'){
+                this.labelStyle = "width:auto;";
+                this.elementStyle = "padding-left:0;";
+            }
+        }
+        var stack = this.stack;
+        var slen = stack.length;
+        if(slen > 0){
+            if(!this.fieldTpl){
+                var t = new Roo.Template(
+                    '<div class="x-form-item {5}">',
+                        '<label for="{0}" style="{2}">{1}{4}</label>',
+                        '<div class="x-form-element" id="x-form-el-{0}" style="{3}">',
+                        '</div>',
+                    '</div><div class="x-form-clear-left"></div>'
+                );
+                t.disableFormats = true;
+                t.compile();
+                Roo.form.Layout.prototype.fieldTpl = t;
+            }
+            for(var i = 0; i < slen; i++) {
+                if(stack[i].isFormField){
+                    this.renderField(stack[i]);
+                }else{
+                    this.renderComponent(stack[i]);
+                }
+            }
+        }
+        if(this.clear){
+            this.el.createChild({cls:'x-form-clear'});
+        }
+    },
+
+    // private
+    renderField : function(f){
+        f.fieldEl = Roo.get(this.fieldTpl.append(this.el, [
+               f.id, //0
+               f.fieldLabel, //1
+               f.labelStyle||this.labelStyle||'', //2
+               this.elementStyle||'', //3
+               typeof f.labelSeparator == 'undefined' ? this.labelSeparator : f.labelSeparator, //4
+               f.itemCls||this.itemCls||''  //5
+       ], true).getPrevSibling());
+    },
+
+    // private
+    renderComponent : function(c){
+        c.render(c.isLayout ? this.el : this.el.createChild());    
+    },
+    /**
+     * Adds a object form elements (using the xtype property as the factory method.)
+     * Valid xtypes are:  TextField, TextArea .... Button, Layout, FieldSet, Column
+     * @param {Object} config 
+     */
+    addxtype : function(o)
+    {
+        // create the lement.
+        o.form = this.form;
+        var fe = Roo.factory(o, Roo.form);
+        this.form.allItems.push(fe);
+        this.stack.push(fe);
+        
+        if (fe.isFormField) {
+            this.form.items.add(fe);
+        }
+         
+        return fe;
+    }
+});
+
+/**
+ * @class Roo.form.Column
+ * @extends Roo.form.Layout
+ * Creates a column container for layout and rendering of fields in an {@link Roo.form.Form}.
+ * @constructor
+ * @param {Object} config Configuration options
+ */
+Roo.form.Column = function(config){
+    Roo.form.Column.superclass.constructor.call(this, config);
+};
+
+Roo.extend(Roo.form.Column, Roo.form.Layout, {
+    /**
+     * @cfg {Number/String} width
+     * The fixed width of the column in pixels or CSS value (defaults to "auto")
+     */
+    /**
+     * @cfg {String/Object} autoCreate
+     * A DomHelper element spec used to autocreate the column (defaults to {tag: 'div', cls: 'x-form-ct x-form-column'})
+     */
+
+    // private
+    defaultAutoCreate : {tag: 'div', cls: 'x-form-ct x-form-column'},
+
+    // private
+    onRender : function(ct, position){
+        Roo.form.Column.superclass.onRender.call(this, ct, position);
+        if(this.width){
+            this.el.setWidth(this.width);
+        }
+    }
+});
+
+
+/**
+ * @class Roo.form.Row
+ * @extends Roo.form.Layout
+ * Creates a row container for layout and rendering of fields in an {@link Roo.form.Form}.
+ * @constructor
+ * @param {Object} config Configuration options
+ */
+
+Roo.form.Row = function(config){
+    Roo.form.Row.superclass.constructor.call(this, config);
+};
+Roo.extend(Roo.form.Row, Roo.form.Layout, {
+      /**
+     * @cfg {Number/String} width
+     * The fixed width of the column in pixels or CSS value (defaults to "auto")
+     */
+    /**
+     * @cfg {Number/String} height
+     * The fixed height of the column in pixels or CSS value (defaults to "auto")
+     */
+    defaultAutoCreate : {tag: 'div', cls: 'x-form-ct x-form-row'},
+    
+    padWidth : 20,
+    // private
+    onRender : function(ct, position){
+        //console.log('row render');
+        if(!this.rowTpl){
+            var t = new Roo.Template(
+                '<div class="x-form-item {5}" style="float:left;width:{6}px">',
+                    '<label for="{0}" style="{2}">{1}{4}</label>',
+                    '<div class="x-form-element" id="x-form-el-{0}" style="{3}">',
+                    '</div>',
+                '</div>'
+            );
+            t.disableFormats = true;
+            t.compile();
+            Roo.form.Layout.prototype.rowTpl = t;
+        }
+        this.fieldTpl = this.rowTpl;
+        
+        //console.log('lw' + this.labelWidth +', la:' + this.labelAlign);
+        var labelWidth = 100;
+        
+        if ((this.labelAlign != 'top')) {
+            if (typeof this.labelWidth == 'number') {
+                labelWidth = this.labelWidth
+            }
+            this.padWidth =  20 + labelWidth;
+            
+        }
+        
+        Roo.form.Column.superclass.onRender.call(this, ct, position);
+        if(this.width){
+            this.el.setWidth(this.width);
+        }
+        if(this.height){
+            this.el.setHeight(this.height);
+        }
+    },
+    
+    // private
+    renderField : function(f){
+        f.fieldEl = this.fieldTpl.append(this.el, [
+               f.id, f.fieldLabel,
+               f.labelStyle||this.labelStyle||'',
+               this.elementStyle||'',
+               typeof f.labelSeparator == 'undefined' ? this.labelSeparator : f.labelSeparator,
+               f.itemCls||this.itemCls||'',
+               f.width ? f.width + this.padWidth : 160 + this.padWidth
+       ],true);
+    }
+});
+
+/**
+ * @class Roo.form.FieldSet
+ * @extends Roo.form.Layout
+ * Creates a fieldset container for layout and rendering of fields in an {@link Roo.form.Form}.
+ * @constructor
+ * @param {Object} config Configuration options
+ */
+Roo.form.FieldSet = function(config){
+    Roo.form.FieldSet.superclass.constructor.call(this, config);
+};
+
+Roo.extend(Roo.form.FieldSet, Roo.form.Layout, {
+    /**
+     * @cfg {String} legend
+     * The text to display as the legend for the FieldSet (defaults to '')
+     */
+    /**
+     * @cfg {String/Object} autoCreate
+     * A DomHelper element spec used to autocreate the fieldset (defaults to {tag: 'fieldset', cn: {tag:'legend'}})
+     */
+
+    // private
+    defaultAutoCreate : {tag: 'fieldset', cn: {tag:'legend'}},
+
+    // private
+    onRender : function(ct, position){
+        Roo.form.FieldSet.superclass.onRender.call(this, ct, position);
+        if(this.legend){
+            this.setLegend(this.legend);
+        }
+    },
+
+    // private
+    setLegend : function(text){
+        if(this.rendered){
+            this.el.child('legend').update(text);
+        }
+    }
+});
\ No newline at end of file
diff --git a/Roo/form/NumberField.js b/Roo/form/NumberField.js
new file mode 100644 (file)
index 0000000..db18e79
--- /dev/null
@@ -0,0 +1,150 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+
+/**
+ * @class Roo.form.NumberField
+ * @extends Roo.form.TextField
+ * Numeric text field that provides automatic keystroke filtering and numeric validation.
+ * @constructor
+ * Creates a new NumberField
+ * @param {Object} config Configuration options
+ */
+Roo.form.NumberField = function(config){
+    Roo.form.NumberField.superclass.constructor.call(this, config);
+};
+
+Roo.extend(Roo.form.NumberField, Roo.form.TextField,  {
+    /**
+     * @cfg {String} fieldClass The default CSS class for the field (defaults to "x-form-field x-form-num-field")
+     */
+    fieldClass: "x-form-field x-form-num-field",
+    /**
+     * @cfg {Boolean} allowDecimals False to disallow decimal values (defaults to true)
+     */
+    allowDecimals : true,
+    /**
+     * @cfg {String} decimalSeparator Character(s) to allow as the decimal separator (defaults to '.')
+     */
+    decimalSeparator : ".",
+    /**
+     * @cfg {Number} decimalPrecision The maximum precision to display after the decimal separator (defaults to 2)
+     */
+    decimalPrecision : 2,
+    /**
+     * @cfg {Boolean} allowNegative False to prevent entering a negative sign (defaults to true)
+     */
+    allowNegative : true,
+    /**
+     * @cfg {Number} minValue The minimum allowed value (defaults to Number.NEGATIVE_INFINITY)
+     */
+    minValue : Number.NEGATIVE_INFINITY,
+    /**
+     * @cfg {Number} maxValue The maximum allowed value (defaults to Number.MAX_VALUE)
+     */
+    maxValue : Number.MAX_VALUE,
+    /**
+     * @cfg {String} minText Error text to display if the minimum value validation fails (defaults to "The minimum value for this field is {minValue}")
+     */
+    minText : "The minimum value for this field is {0}",
+    /**
+     * @cfg {String} maxText Error text to display if the maximum value validation fails (defaults to "The maximum value for this field is {maxValue}")
+     */
+    maxText : "The maximum value for this field is {0}",
+    /**
+     * @cfg {String} nanText Error text to display if the value is not a valid number.  For example, this can happen
+     * if a valid character like '.' or '-' is left in the field with no number (defaults to "{value} is not a valid number")
+     */
+    nanText : "{0} is not a valid number",
+
+    // private
+    initEvents : function(){
+        Roo.form.NumberField.superclass.initEvents.call(this);
+        var allowed = "0123456789";
+        if(this.allowDecimals){
+            allowed += this.decimalSeparator;
+        }
+        if(this.allowNegative){
+            allowed += "-";
+        }
+        this.stripCharsRe = new RegExp('[^'+allowed+']', 'gi');
+        var keyPress = function(e){
+            var k = e.getKey();
+            if(!Roo.isIE && (e.isSpecialKey() || k == e.BACKSPACE || k == e.DELETE)){
+                return;
+            }
+            var c = e.getCharCode();
+            if(allowed.indexOf(String.fromCharCode(c)) === -1){
+                e.stopEvent();
+            }
+        };
+        this.el.on("keypress", keyPress, this);
+    },
+
+    // private
+    validateValue : function(value){
+        if(!Roo.form.NumberField.superclass.validateValue.call(this, value)){
+            return false;
+        }
+        if(value.length < 1){ // if it's blank and textfield didn't flag it then it's valid
+             return true;
+        }
+        var num = this.parseValue(value);
+        if(isNaN(num)){
+            this.markInvalid(String.format(this.nanText, value));
+            return false;
+        }
+        if(num < this.minValue){
+            this.markInvalid(String.format(this.minText, this.minValue));
+            return false;
+        }
+        if(num > this.maxValue){
+            this.markInvalid(String.format(this.maxText, this.maxValue));
+            return false;
+        }
+        return true;
+    },
+
+    getValue : function(){
+        return this.fixPrecision(this.parseValue(Roo.form.NumberField.superclass.getValue.call(this)));
+    },
+
+    // private
+    parseValue : function(value){
+        value = parseFloat(String(value).replace(this.decimalSeparator, "."));
+        return isNaN(value) ? '' : value;
+    },
+
+    // private
+    fixPrecision : function(value){
+        var nan = isNaN(value);
+        if(!this.allowDecimals || this.decimalPrecision == -1 || nan || !value){
+            return nan ? '' : value;
+        }
+        return parseFloat(value).toFixed(this.decimalPrecision);
+    },
+
+    setValue : function(v){
+        Roo.form.NumberField.superclass.setValue.call(this, String(v).replace(".", this.decimalSeparator));
+    },
+
+    // private
+    decimalPrecisionFcn : function(v){
+        return Math.floor(v);
+    },
+
+    beforeBlur : function(){
+        var v = this.parseValue(this.getRawValue());
+        if(v){
+            this.setValue(this.fixPrecision(v));
+        }
+    }
+});
\ No newline at end of file
diff --git a/Roo/form/Radio.js b/Roo/form/Radio.js
new file mode 100644 (file)
index 0000000..9a64eda
--- /dev/null
@@ -0,0 +1,34 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+/**
+ * @class Roo.form.Radio
+ * @extends Roo.form.Checkbox
+ * Single radio field.  Same as Checkbox, but provided as a convenience for automatically setting the input type.
+ * Radio grouping is handled automatically by the browser if you give each radio in a group the same name.
+ * @constructor
+ * Creates a new Radio
+ * @param {Object} config Configuration options
+ */
+Roo.form.Radio = function(){
+    Roo.form.Radio.superclass.constructor.apply(this, arguments);
+};
+Roo.extend(Roo.form.Radio, Roo.form.Checkbox, {
+    inputType: 'radio',
+
+    /**
+     * If this radio is part of a group, it will return the selected value
+     * @return {String}
+     */
+    getGroupValue : function(){
+        return this.el.up('form').child('input[name='+this.el.dom.name+']:checked', true).value;
+    }
+});
\ No newline at end of file
diff --git a/Roo/form/TextArea.js b/Roo/form/TextArea.js
new file mode 100644 (file)
index 0000000..0c21fad
--- /dev/null
@@ -0,0 +1,121 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+/**
+ * @class Roo.form.TextArea
+ * @extends Roo.form.TextField
+ * Multiline text field.  Can be used as a direct replacement for traditional textarea fields, plus adds
+ * support for auto-sizing.
+ * @constructor
+ * Creates a new TextArea
+ * @param {Object} config Configuration options
+ */
+Roo.form.TextArea = function(config){
+    Roo.form.TextArea.superclass.constructor.call(this, config);
+    // these are provided exchanges for backwards compat
+    // minHeight/maxHeight were replaced by growMin/growMax to be
+    // compatible with TextField growing config values
+    if(this.minHeight !== undefined){
+        this.growMin = this.minHeight;
+    }
+    if(this.maxHeight !== undefined){
+        this.growMax = this.maxHeight;
+    }
+};
+
+Roo.extend(Roo.form.TextArea, Roo.form.TextField,  {
+    /**
+     * @cfg {Number} growMin The minimum height to allow when grow = true (defaults to 60)
+     */
+    growMin : 60,
+    /**
+     * @cfg {Number} growMax The maximum height to allow when grow = true (defaults to 1000)
+     */
+    growMax: 1000,
+    /**
+     * @cfg {Boolean} preventScrollbars True to prevent scrollbars from appearing regardless of how much text is
+     * in the field (equivalent to setting overflow: hidden, defaults to false)
+     */
+    preventScrollbars: false,
+    /**
+     * @cfg {String/Object} autoCreate A DomHelper element spec, or true for a default element spec (defaults to
+     * {tag: "textarea", style: "width:300px;height:60px;", autocomplete: "off"})
+     */
+
+    // private
+    onRender : function(ct, position){
+        if(!this.el){
+            this.defaultAutoCreate = {
+                tag: "textarea",
+                style:"width:300px;height:60px;",
+                autocomplete: "off"
+            };
+        }
+        Roo.form.TextArea.superclass.onRender.call(this, ct, position);
+        if(this.grow){
+            this.textSizeEl = Roo.DomHelper.append(document.body, {
+                tag: "pre", cls: "x-form-grow-sizer"
+            });
+            if(this.preventScrollbars){
+                this.el.setStyle("overflow", "hidden");
+            }
+            this.el.setHeight(this.growMin);
+        }
+    },
+
+    onDestroy : function(){
+        if(this.textSizeEl){
+            this.textSizeEl.parentNode.removeChild(this.textSizeEl);
+        }
+        Roo.form.TextArea.superclass.onDestroy.call(this);
+    },
+
+    // private
+    onKeyUp : function(e){
+        if(!e.isNavKeyPress() || e.getKey() == e.ENTER){
+            this.autoSize();
+        }
+    },
+
+    /**
+     * Automatically grows the field to accomodate the height of the text up to the maximum field height allowed.
+     * This only takes effect if grow = true, and fires the autosize event if the height changes.
+     */
+    autoSize : function(){
+        if(!this.grow || !this.textSizeEl){
+            return;
+        }
+        var el = this.el;
+        var v = el.dom.value;
+        var ts = this.textSizeEl;
+
+        ts.innerHTML = '';
+        ts.appendChild(document.createTextNode(v));
+        v = ts.innerHTML;
+
+        Roo.fly(ts).setWidth(this.el.getWidth());
+        if(v.length < 1){
+            v = "&#160;&#160;";
+        }else{
+            if(Roo.isIE){
+                v = v.replace(/\n/g, '<p>&#160;</p>');
+            }
+            v += "&#160;\n&#160;";
+        }
+        ts.innerHTML = v;
+        var h = Math.min(this.growMax, Math.max(ts.offsetHeight, this.growMin));
+        if(h != this.lastHeight){
+            this.lastHeight = h;
+            this.el.setHeight(h);
+            this.fireEvent("autosize", this, h);
+        }
+    }
+});
\ No newline at end of file
diff --git a/Roo/form/TextField.js b/Roo/form/TextField.js
new file mode 100644 (file)
index 0000000..5b6fc33
--- /dev/null
@@ -0,0 +1,313 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+
+/**
+ * @class Roo.form.TextField
+ * @extends Roo.form.Field
+ * Basic text field.  Can be used as a direct replacement for traditional text inputs, or as the base
+ * class for more sophisticated input controls (like {@link Roo.form.TextArea} and {@link Roo.form.ComboBox}).
+ * @constructor
+ * Creates a new TextField
+ * @param {Object} config Configuration options
+ */
+Roo.form.TextField = function(config){
+    Roo.form.TextField.superclass.constructor.call(this, config);
+    this.addEvents({
+        /**
+         * @event autosize
+         * Fires when the autosize function is triggered.  The field may or may not have actually changed size
+         * according to the default logic, but this event provides a hook for the developer to apply additional
+         * logic at runtime to resize the field if needed.
+            * @param {Roo.form.Field} this This text field
+            * @param {Number} width The new field width
+            */
+        autosize : true
+    });
+};
+
+Roo.extend(Roo.form.TextField, Roo.form.Field,  {
+    /**
+     * @cfg {Boolean} grow True if this field should automatically grow and shrink to its content
+     */
+    grow : false,
+    /**
+     * @cfg {Number} growMin The minimum width to allow when grow = true (defaults to 30)
+     */
+    growMin : 30,
+    /**
+     * @cfg {Number} growMax The maximum width to allow when grow = true (defaults to 800)
+     */
+    growMax : 800,
+    /**
+     * @cfg {String} vtype A validation type name as defined in {@link Roo.form.VTypes} (defaults to null)
+     */
+    vtype : null,
+    /**
+     * @cfg {String} maskRe An input mask regular expression that will be used to filter keystrokes that don't match (defaults to null)
+     */
+    maskRe : null,
+    /**
+     * @cfg {Boolean} disableKeyFilter True to disable input keystroke filtering (defaults to false)
+     */
+    disableKeyFilter : false,
+    /**
+     * @cfg {Boolean} allowBlank False to validate that the value length > 0 (defaults to true)
+     */
+    allowBlank : true,
+    /**
+     * @cfg {Number} minLength Minimum input field length required (defaults to 0)
+     */
+    minLength : 0,
+    /**
+     * @cfg {Number} maxLength Maximum input field length allowed (defaults to Number.MAX_VALUE)
+     */
+    maxLength : Number.MAX_VALUE,
+    /**
+     * @cfg {String} minLengthText Error text to display if the minimum length validation fails (defaults to "The minimum length for this field is {minLength}")
+     */
+    minLengthText : "The minimum length for this field is {0}",
+    /**
+     * @cfg {String} maxLengthText Error text to display if the maximum length validation fails (defaults to "The maximum length for this field is {maxLength}")
+     */
+    maxLengthText : "The maximum length for this field is {0}",
+    /**
+     * @cfg {Boolean} selectOnFocus True to automatically select any existing field text when the field receives input focus (defaults to false)
+     */
+    selectOnFocus : false,
+    /**
+     * @cfg {String} blankText Error text to display if the allow blank validation fails (defaults to "This field is required")
+     */
+    blankText : "This field is required",
+    /**
+     * @cfg {Function} validator A custom validation function to be called during field validation (defaults to null).
+     * If available, this function will be called only after the basic validators all return true, and will be passed the
+     * current field value and expected to return boolean true if the value is valid or a string error message if invalid.
+     */
+    validator : null,
+    /**
+     * @cfg {RegExp} regex A JavaScript RegExp object to be tested against the field value during validation (defaults to null).
+     * If available, this regex will be evaluated only after the basic validators all return true, and will be passed the
+     * current field value.  If the test fails, the field will be marked invalid using {@link #regexText}.
+     */
+    regex : null,
+    /**
+     * @cfg {String} regexText The error text to display if {@link #regex} is used and the test fails during validation (defaults to "")
+     */
+    regexText : "",
+    /**
+     * @cfg {String} emptyText The default text to display in an empty field (defaults to null).
+     */
+    emptyText : null,
+    /**
+     * @cfg {String} emptyClass The CSS class to apply to an empty field to style the {@link #emptyText} (defaults to
+     * 'x-form-empty-field').  This class is automatically added and removed as needed depending on the current field value.
+     */
+    emptyClass : 'x-form-empty-field',
+
+    // private
+    initEvents : function(){
+        Roo.form.TextField.superclass.initEvents.call(this);
+        if(this.validationEvent == 'keyup'){
+            this.validationTask = new Roo.util.DelayedTask(this.validate, this);
+            this.el.on('keyup', this.filterValidation, this);
+        }
+        else if(this.validationEvent !== false){
+            this.el.on(this.validationEvent, this.validate, this, {buffer: this.validationDelay});
+        }
+        if(this.selectOnFocus || this.emptyText){
+            this.on("focus", this.preFocus, this);
+            if(this.emptyText){
+                this.on('blur', this.postBlur, this);
+                this.applyEmptyText();
+            }
+        }
+        if(this.maskRe || (this.vtype && this.disableKeyFilter !== true && (this.maskRe = Roo.form.VTypes[this.vtype+'Mask']))){
+            this.el.on("keypress", this.filterKeys, this);
+        }
+        if(this.grow){
+            this.el.on("keyup", this.onKeyUp,  this, {buffer:50});
+            this.el.on("click", this.autoSize,  this);
+        }
+    },
+
+    processValue : function(value){
+        if(this.stripCharsRe){
+            var newValue = value.replace(this.stripCharsRe, '');
+            if(newValue !== value){
+                this.setRawValue(newValue);
+                return newValue;
+            }
+        }
+        return value;
+    },
+
+    filterValidation : function(e){
+        if(!e.isNavKeyPress()){
+            this.validationTask.delay(this.validationDelay);
+        }
+    },
+
+    // private
+    onKeyUp : function(e){
+        if(!e.isNavKeyPress()){
+            this.autoSize();
+        }
+    },
+
+    /**
+     * Resets the current field value to the originally-loaded value and clears any validation messages.
+     * Also adds emptyText and emptyClass if the original value was blank.
+     */
+    reset : function(){
+        Roo.form.TextField.superclass.reset.call(this);
+        this.applyEmptyText();
+    },
+
+    applyEmptyText : function(){
+        if(this.rendered && this.emptyText && this.getRawValue().length < 1){
+            this.setRawValue(this.emptyText);
+            this.el.addClass(this.emptyClass);
+        }
+    },
+
+    // private
+    preFocus : function(){
+        if(this.emptyText){
+            if(this.el.dom.value == this.emptyText){
+                this.setRawValue('');
+            }
+            this.el.removeClass(this.emptyClass);
+        }
+        if(this.selectOnFocus){
+            this.el.dom.select();
+        }
+    },
+
+    // private
+    postBlur : function(){
+        this.applyEmptyText();
+    },
+
+    // private
+    filterKeys : function(e){
+        var k = e.getKey();
+        if(!Roo.isIE && (e.isNavKeyPress() || k == e.BACKSPACE || (k == e.DELETE && e.button == -1))){
+            return;
+        }
+        var c = e.getCharCode(), cc = String.fromCharCode(c);
+        if(Roo.isIE && (e.isSpecialKey() || !cc)){
+            return;
+        }
+        if(!this.maskRe.test(cc)){
+            e.stopEvent();
+        }
+    },
+
+    setValue : function(v){
+        if(this.emptyText && this.el && v !== undefined && v !== null && v !== ''){
+            this.el.removeClass(this.emptyClass);
+        }
+        Roo.form.TextField.superclass.setValue.apply(this, arguments);
+        this.applyEmptyText();
+        this.autoSize();
+    },
+
+    /**
+     * Validates a value according to the field's validation rules and marks the field as invalid
+     * if the validation fails
+     * @param {Mixed} value The value to validate
+     * @return {Boolean} True if the value is valid, else false
+     */
+    validateValue : function(value){
+        if(value.length < 1 || value === this.emptyText){ // if it's blank
+             if(this.allowBlank){
+                this.clearInvalid();
+                return true;
+             }else{
+                this.markInvalid(this.blankText);
+                return false;
+             }
+        }
+        if(value.length < this.minLength){
+            this.markInvalid(String.format(this.minLengthText, this.minLength));
+            return false;
+        }
+        if(value.length > this.maxLength){
+            this.markInvalid(String.format(this.maxLengthText, this.maxLength));
+            return false;
+        }
+        if(this.vtype){
+            var vt = Roo.form.VTypes;
+            if(!vt[this.vtype](value, this)){
+                this.markInvalid(this.vtypeText || vt[this.vtype +'Text']);
+                return false;
+            }
+        }
+        if(typeof this.validator == "function"){
+            var msg = this.validator(value);
+            if(msg !== true){
+                this.markInvalid(msg);
+                return false;
+            }
+        }
+        if(this.regex && !this.regex.test(value)){
+            this.markInvalid(this.regexText);
+            return false;
+        }
+        return true;
+    },
+
+    /**
+     * Selects text in this field
+     * @param {Number} start (optional) The index where the selection should start (defaults to 0)
+     * @param {Number} end (optional) The index where the selection should end (defaults to the text length)
+     */
+    selectText : function(start, end){
+        var v = this.getRawValue();
+        if(v.length > 0){
+            start = start === undefined ? 0 : start;
+            end = end === undefined ? v.length : end;
+            var d = this.el.dom;
+            if(d.setSelectionRange){
+                d.setSelectionRange(start, end);
+            }else if(d.createTextRange){
+                var range = d.createTextRange();
+                range.moveStart("character", start);
+                range.moveEnd("character", v.length-end);
+                range.select();
+            }
+        }
+    },
+
+    /**
+     * Automatically grows the field to accomodate the width of the text up to the maximum field width allowed.
+     * This only takes effect if grow = true, and fires the autosize event.
+     */
+    autoSize : function(){
+        if(!this.grow || !this.rendered){
+            return;
+        }
+        if(!this.metrics){
+            this.metrics = Roo.util.TextMetrics.createInstance(this.el);
+        }
+        var el = this.el;
+        var v = el.dom.value;
+        var d = document.createElement('div');
+        d.appendChild(document.createTextNode(v));
+        v = d.innerHTML;
+        d = null;
+        v += "&#160;";
+        var w = Math.min(this.growMax, Math.max(this.metrics.getWidth(v) + /* add extra padding */ 10, this.growMin));
+        this.el.setWidth(w);
+        this.fireEvent("autosize", this, w);
+    }
+});
\ No newline at end of file
diff --git a/Roo/form/TriggerField.js b/Roo/form/TriggerField.js
new file mode 100644 (file)
index 0000000..adb7a5a
--- /dev/null
@@ -0,0 +1,267 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+/**
+ * @class Roo.form.TriggerField
+ * @extends Roo.form.TextField
+ * Provides a convenient wrapper for TextFields that adds a clickable trigger button (looks like a combobox by default).
+ * The trigger has no default action, so you must assign a function to implement the trigger click handler by
+ * overriding {@link #onTriggerClick}. You can create a TriggerField directly, as it renders exactly like a combobox
+ * for which you can provide a custom implementation.  For example:
+ * <pre><code>
+var trigger = new Roo.form.TriggerField();
+trigger.onTriggerClick = myTriggerFn;
+trigger.applyTo('my-field');
+</code></pre>
+ *
+ * However, in general you will most likely want to use TriggerField as the base class for a reusable component.
+ * {@link Roo.form.DateField} and {@link Roo.form.ComboBox} are perfect examples of this.
+ * @cfg {String} triggerClass An additional CSS class used to style the trigger button.  The trigger will always get the
+ * class 'x-form-trigger' by default and triggerClass will be <b>appended</b> if specified.
+ * @constructor
+ * Create a new TriggerField.
+ * @param {Object} config Configuration options (valid {@Roo.form.TextField} config options will also be applied
+ * to the base TextField)
+ */
+Roo.form.TriggerField = function(config){
+    this.mimicing = false;
+    Roo.form.TriggerField.superclass.constructor.call(this, config);
+};
+
+Roo.extend(Roo.form.TriggerField, Roo.form.TextField,  {
+    /**
+     * @cfg {String} triggerClass A CSS class to apply to the trigger
+     */
+    /**
+     * @cfg {String/Object} autoCreate A DomHelper element spec, or true for a default element spec (defaults to
+     * {tag: "input", type: "text", size: "16", autocomplete: "off"})
+     */
+    defaultAutoCreate : {tag: "input", type: "text", size: "16", autocomplete: "off"},
+    /**
+     * @cfg {Boolean} hideTrigger True to hide the trigger element and display only the base text field (defaults to false)
+     */
+    hideTrigger:false,
+
+    /** @cfg {Boolean} grow @hide */
+    /** @cfg {Number} growMin @hide */
+    /** @cfg {Number} growMax @hide */
+
+    /**
+     * @hide 
+     * @method
+     */
+    autoSize: Roo.emptyFn,
+    // private
+    monitorTab : true,
+    // private
+    deferHeight : true,
+
+    
+    actionMode : 'wrap',
+    // private
+    onResize : function(w, h){
+        Roo.form.TriggerField.superclass.onResize.apply(this, arguments);
+        if(typeof w == 'number'){
+            this.el.setWidth(this.adjustWidth('input', w - this.trigger.getWidth()));
+        }
+    },
+
+    // private
+    adjustSize : Roo.BoxComponent.prototype.adjustSize,
+
+    // private
+    getResizeEl : function(){
+        return this.wrap;
+    },
+
+    // private
+    getPositionEl : function(){
+        return this.wrap;
+    },
+
+    // private
+    alignErrorIcon : function(){
+        this.errorIcon.alignTo(this.wrap, 'tl-tr', [2, 0]);
+    },
+
+    // private
+    onRender : function(ct, position){
+        Roo.form.TriggerField.superclass.onRender.call(this, ct, position);
+        this.wrap = this.el.wrap({cls: "x-form-field-wrap"});
+        this.trigger = this.wrap.createChild(this.triggerConfig ||
+                {tag: "img", src: Roo.BLANK_IMAGE_URL, cls: "x-form-trigger " + this.triggerClass});
+        if(this.hideTrigger){
+            this.trigger.setDisplayed(false);
+        }
+        this.initTrigger();
+        if(!this.width){
+            this.wrap.setWidth(this.el.getWidth()+this.trigger.getWidth());
+        }
+    },
+
+    // private
+    initTrigger : function(){
+        this.trigger.on("click", this.onTriggerClick, this, {preventDefault:true});
+        this.trigger.addClassOnOver('x-form-trigger-over');
+        this.trigger.addClassOnClick('x-form-trigger-click');
+    },
+
+    // private
+    onDestroy : function(){
+        if(this.trigger){
+            this.trigger.removeAllListeners();
+            this.trigger.remove();
+        }
+        if(this.wrap){
+            this.wrap.remove();
+        }
+        Roo.form.TriggerField.superclass.onDestroy.call(this);
+    },
+
+    // private
+    onFocus : function(){
+        Roo.form.TriggerField.superclass.onFocus.call(this);
+        if(!this.mimicing){
+            this.wrap.addClass('x-trigger-wrap-focus');
+            this.mimicing = true;
+            Roo.get(Roo.isIE ? document.body : document).on("mousedown", this.mimicBlur, this);
+            if(this.monitorTab){
+                this.el.on("keydown", this.checkTab, this);
+            }
+        }
+    },
+
+    // private
+    checkTab : function(e){
+        if(e.getKey() == e.TAB){
+            this.triggerBlur();
+        }
+    },
+
+    // private
+    onBlur : function(){
+        // do nothing
+    },
+
+    // private
+    mimicBlur : function(e, t){
+        if(!this.wrap.contains(t) && this.validateBlur()){
+            this.triggerBlur();
+        }
+    },
+
+    // private
+    triggerBlur : function(){
+        this.mimicing = false;
+        Roo.get(Roo.isIE ? document.body : document).un("mousedown", this.mimicBlur);
+        if(this.monitorTab){
+            this.el.un("keydown", this.checkTab, this);
+        }
+        this.wrap.removeClass('x-trigger-wrap-focus');
+        Roo.form.TriggerField.superclass.onBlur.call(this);
+    },
+
+    // private
+    // This should be overriden by any subclass that needs to check whether or not the field can be blurred.
+    validateBlur : function(e, t){
+        return true;
+    },
+
+    // private
+    onDisable : function(){
+        Roo.form.TriggerField.superclass.onDisable.call(this);
+        if(this.wrap){
+            this.wrap.addClass('x-item-disabled');
+        }
+    },
+
+    // private
+    onEnable : function(){
+        Roo.form.TriggerField.superclass.onEnable.call(this);
+        if(this.wrap){
+            this.wrap.removeClass('x-item-disabled');
+        }
+    },
+
+    // private
+    onShow : function(){
+        var ae = this.getActionEl();
+        
+        if(ae){
+            ae.dom.style.display = '';
+            ae.dom.style.visibility = 'visible';
+        }
+    },
+
+    // private
+    
+    onHide : function(){
+        var ae = this.getActionEl();
+        ae.dom.style.display = 'none';
+    },
+
+    /**
+     * The function that should handle the trigger's click event.  This method does nothing by default until overridden
+     * by an implementing function.
+     * @method
+     * @param {EventObject} e
+     */
+    onTriggerClick : Roo.emptyFn
+});
+
+// TwinTriggerField is not a public class to be used directly.  It is meant as an abstract base class
+// to be extended by an implementing class.  For an example of implementing this class, see the custom
+// SearchField implementation here: http://extjs.com/deploy/ext/examples/form/custom.html
+Roo.form.TwinTriggerField = Roo.extend(Roo.form.TriggerField, {
+    initComponent : function(){
+        Roo.form.TwinTriggerField.superclass.initComponent.call(this);
+
+        this.triggerConfig = {
+            tag:'span', cls:'x-form-twin-triggers', cn:[
+            {tag: "img", src: Roo.BLANK_IMAGE_URL, cls: "x-form-trigger " + this.trigger1Class},
+            {tag: "img", src: Roo.BLANK_IMAGE_URL, cls: "x-form-trigger " + this.trigger2Class}
+        ]};
+    },
+
+    getTrigger : function(index){
+        return this.triggers[index];
+    },
+
+    initTrigger : function(){
+        var ts = this.trigger.select('.x-form-trigger', true);
+        this.wrap.setStyle('overflow', 'hidden');
+        var triggerField = this;
+        ts.each(function(t, all, index){
+            t.hide = function(){
+                var w = triggerField.wrap.getWidth();
+                this.dom.style.display = 'none';
+                triggerField.el.setWidth(w-triggerField.trigger.getWidth());
+            };
+            t.show = function(){
+                var w = triggerField.wrap.getWidth();
+                this.dom.style.display = '';
+                triggerField.el.setWidth(w-triggerField.trigger.getWidth());
+            };
+            var triggerIndex = 'Trigger'+(index+1);
+
+            if(this['hide'+triggerIndex]){
+                t.dom.style.display = 'none';
+            }
+            t.on("click", this['on'+triggerIndex+'Click'], this, {preventDefault:true});
+            t.addClassOnOver('x-form-trigger-over');
+            t.addClassOnClick('x-form-trigger-click');
+        }, this);
+        this.triggers = ts.elements;
+    },
+
+    onTrigger1Click : Roo.emptyFn,
+    onTrigger2Click : Roo.emptyFn
+});
\ No newline at end of file
diff --git a/Roo/form/VTypes.js b/Roo/form/VTypes.js
new file mode 100644 (file)
index 0000000..6ac383c
--- /dev/null
@@ -0,0 +1,92 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+/**
+ * @class Roo.form.VTypes
+ * Overridable validation definitions. The validations provided are basic and intended to be easily customizable and extended.
+ * @singleton
+ */
+Roo.form.VTypes = function(){
+    // closure these in so they are only created once.
+    var alpha = /^[a-zA-Z_]+$/;
+    var alphanum = /^[a-zA-Z0-9_]+$/;
+    var email = /^([\w]+)(.[\w]+)*@([\w-]+\.){1,5}([A-Za-z]){2,4}$/;
+    var url = /(((https?)|(ftp)):\/\/([\-\w]+\.)+\w{2,3}(\/[%\-\w]+(\.\w{2,})?)*(([\w\-\.\?\\\/+@&#;`~=%!]*)(\.\w{2,})?)*\/?)/i;
+
+    // All these messages and functions are configurable
+    return {
+        /**
+         * The function used to validate email addresses
+         * @param {String} value The email address
+         */
+        'email' : function(v){
+            return email.test(v);
+        },
+        /**
+         * The error text to display when the email validation function returns false
+         * @type String
+         */
+        'emailText' : 'This field should be an e-mail address in the format "user@domain.com"',
+        /**
+         * The keystroke filter mask to be applied on email input
+         * @type RegExp
+         */
+        'emailMask' : /[a-z0-9_\.\-@]/i,
+
+        /**
+         * The function used to validate URLs
+         * @param {String} value The URL
+         */
+        'url' : function(v){
+            return url.test(v);
+        },
+        /**
+         * The error text to display when the url validation function returns false
+         * @type String
+         */
+        'urlText' : 'This field should be a URL in the format "http:/'+'/www.domain.com"',
+        
+        /**
+         * The function used to validate alpha values
+         * @param {String} value The value
+         */
+        'alpha' : function(v){
+            return alpha.test(v);
+        },
+        /**
+         * The error text to display when the alpha validation function returns false
+         * @type String
+         */
+        'alphaText' : 'This field should only contain letters and _',
+        /**
+         * The keystroke filter mask to be applied on alpha input
+         * @type RegExp
+         */
+        'alphaMask' : /[a-z_]/i,
+
+        /**
+         * The function used to validate alphanumeric values
+         * @param {String} value The value
+         */
+        'alphanum' : function(v){
+            return alphanum.test(v);
+        },
+        /**
+         * The error text to display when the alphanumeric validation function returns false
+         * @type String
+         */
+        'alphanumText' : 'This field should only contain letters, numbers and _',
+        /**
+         * The keystroke filter mask to be applied on alphanumeric input
+         * @type RegExp
+         */
+        'alphanumMask' : /[a-z0-9_]/i
+    };
+}();
\ No newline at end of file
diff --git a/Roo/grid/AbstractGridView.js b/Roo/grid/AbstractGridView.js
new file mode 100644 (file)
index 0000000..8e184d2
--- /dev/null
@@ -0,0 +1,100 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+Roo.grid.AbstractGridView = function(){
+       this.grid = null;
+       
+       this.events = {
+           "beforerowremoved" : true,
+           "beforerowsinserted" : true,
+           "beforerefresh" : true,
+           "rowremoved" : true,
+           "rowsinserted" : true,
+           "rowupdated" : true,
+           "refresh" : true
+       };
+    Roo.grid.AbstractGridView.superclass.constructor.call(this);
+};
+
+Roo.extend(Roo.grid.AbstractGridView, Roo.util.Observable, {
+    rowClass : "x-grid-row",
+    cellClass : "x-grid-cell",
+    tdClass : "x-grid-td",
+    hdClass : "x-grid-hd",
+    splitClass : "x-grid-hd-split",
+    
+       init: function(grid){
+        this.grid = grid;
+               var cid = this.grid.getGridEl().id;
+        this.colSelector = "#" + cid + " ." + this.cellClass + "-";
+        this.tdSelector = "#" + cid + " ." + this.tdClass + "-";
+        this.hdSelector = "#" + cid + " ." + this.hdClass + "-";
+        this.splitSelector = "#" + cid + " ." + this.splitClass + "-";
+       },
+       
+       getColumnRenderers : function(){
+       var renderers = [];
+       var cm = this.grid.colModel;
+        var colCount = cm.getColumnCount();
+        for(var i = 0; i < colCount; i++){
+            renderers[i] = cm.getRenderer(i);
+        }
+        return renderers;
+    },
+    
+    getColumnIds : function(){
+       var ids = [];
+       var cm = this.grid.colModel;
+        var colCount = cm.getColumnCount();
+        for(var i = 0; i < colCount; i++){
+            ids[i] = cm.getColumnId(i);
+        }
+        return ids;
+    },
+    
+    getDataIndexes : function(){
+       if(!this.indexMap){
+            this.indexMap = this.buildIndexMap();
+        }
+        return this.indexMap.colToData;
+    },
+    
+    getColumnIndexByDataIndex : function(dataIndex){
+        if(!this.indexMap){
+            this.indexMap = this.buildIndexMap();
+        }
+       return this.indexMap.dataToCol[dataIndex];
+    },
+    
+    /**
+     * Set a css style for a column dynamically. 
+     * @param {Number} colIndex The index of the column
+     * @param {String} name The css property name
+     * @param {String} value The css value
+     */
+    setCSSStyle : function(colIndex, name, value){
+        var selector = "#" + this.grid.id + " .x-grid-col-" + colIndex;
+        Roo.util.CSS.updateRule(selector, name, value);
+    },
+    
+    generateRules : function(cm){
+        var ruleBuf = [], rulesId = this.grid.id + '-cssrules';
+        Roo.util.CSS.removeStyleSheet(rulesId);
+        for(var i = 0, len = cm.getColumnCount(); i < len; i++){
+            var cid = cm.getColumnId(i);
+            ruleBuf.push(this.colSelector, cid, " {\n", cm.config[i].css, "}\n",
+                         this.tdSelector, cid, " {\n}\n",
+                         this.hdSelector, cid, " {\n}\n",
+                         this.splitSelector, cid, " {\n}\n");
+        }
+        return Roo.util.CSS.createStyleSheet(ruleBuf.join(""), rulesId);
+    }
+});
\ No newline at end of file
diff --git a/Roo/grid/AbstractSelectionModel.js b/Roo/grid/AbstractSelectionModel.js
new file mode 100644 (file)
index 0000000..a09533a
--- /dev/null
@@ -0,0 +1,52 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+
+/**
+ * @class Roo.grid.AbstractSelectionModel
+ * @extends Roo.util.Observable
+ * Abstract base class for grid SelectionModels.  It provides the interface that should be
+ * implemented by descendant classes.  This class should not be directly instantiated.
+ * @constructor
+ */
+Roo.grid.AbstractSelectionModel = function(){
+    this.locked = false;
+    Roo.grid.AbstractSelectionModel.superclass.constructor.call(this);
+};
+
+Roo.extend(Roo.grid.AbstractSelectionModel, Roo.util.Observable,  {
+    /** @ignore Called by the grid automatically. Do not call directly. */
+    init : function(grid){
+        this.grid = grid;
+        this.initEvents();
+    },
+
+    /**
+     * Locks the selections.
+     */
+    lock : function(){
+        this.locked = true;
+    },
+
+    /**
+     * Unlocks the selections.
+     */
+    unlock : function(){
+        this.locked = false;
+    },
+
+    /**
+     * Returns true if the selections are locked.
+     * @return {Boolean}
+     */
+    isLocked : function(){
+        return this.locked;
+    }
+});
\ No newline at end of file
diff --git a/Roo/grid/CellSelectionModel.js b/Roo/grid/CellSelectionModel.js
new file mode 100644 (file)
index 0000000..1d6cb81
--- /dev/null
@@ -0,0 +1,240 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+/**
+ * @class Roo.grid.CellSelectionModel
+ * @extends Roo.grid.AbstractSelectionModel
+ * This class provides the basic implementation for cell selection in a grid.
+ * @constructor
+ * @param {Object} config The object containing the configuration of this model.
+ */
+Roo.grid.CellSelectionModel = function(config){
+    Roo.apply(this, config);
+
+    this.selection = null;
+
+    this.addEvents({
+        /**
+            * @event beforerowselect
+            * Fires before a cell is selected.
+            * @param {SelectionModel} this
+            * @param {Number} rowIndex The selected row index
+            * @param {Number} colIndex The selected cell index
+            */
+           "beforecellselect" : true,
+        /**
+            * @event cellselect
+            * Fires when a cell is selected.
+            * @param {SelectionModel} this
+            * @param {Number} rowIndex The selected row index
+            * @param {Number} colIndex The selected cell index
+            */
+           "cellselect" : true,
+        /**
+            * @event selectionchange
+            * Fires when the active selection changes.
+            * @param {SelectionModel} this
+            * @param {Object} selection null for no selection or an object (o) with two properties
+               <ul>
+               <li>o.record: the record object for the row the selection is in</li>
+               <li>o.cell: An array of [rowIndex, columnIndex]</li>
+               </ul>
+            */
+           "selectionchange" : true
+    });
+    Roo.grid.CellSelectionModel.superclass.constructor.call(this);
+};
+
+Roo.extend(Roo.grid.CellSelectionModel, Roo.grid.AbstractSelectionModel,  {
+
+    /** @ignore */
+    initEvents : function(){
+        this.grid.on("mousedown", this.handleMouseDown, this);
+        this.grid.getGridEl().on(Roo.isIE ? "keydown" : "keypress", this.handleKeyDown, this);
+        var view = this.grid.view;
+        view.on("refresh", this.onViewChange, this);
+        view.on("rowupdated", this.onRowUpdated, this);
+        view.on("beforerowremoved", this.clearSelections, this);
+        view.on("beforerowsinserted", this.clearSelections, this);
+        if(this.grid.isEditor){
+            this.grid.on("beforeedit", this.beforeEdit,  this);
+        }
+    },
+
+       //private
+    beforeEdit : function(e){
+        this.select(e.row, e.column, false, true, e.record);
+    },
+
+       //private
+    onRowUpdated : function(v, index, r){
+        if(this.selection && this.selection.record == r){
+            v.onCellSelect(index, this.selection.cell[1]);
+        }
+    },
+
+       //private
+    onViewChange : function(){
+        this.clearSelections(true);
+    },
+
+       /**
+        * Returns the currently selected cell,.
+        * @return {Array} The selected cell (row, column) or null if none selected.
+        */
+    getSelectedCell : function(){
+        return this.selection ? this.selection.cell : null;
+    },
+
+    /**
+     * Clears all selections.
+     * @param {Boolean} true to prevent the gridview from being notified about the change.
+     */
+    clearSelections : function(preventNotify){
+        var s = this.selection;
+        if(s){
+            if(preventNotify !== true){
+                this.grid.view.onCellDeselect(s.cell[0], s.cell[1]);
+            }
+            this.selection = null;
+            this.fireEvent("selectionchange", this, null);
+        }
+    },
+
+    /**
+     * Returns true if there is a selection.
+     * @return {Boolean}
+     */
+    hasSelection : function(){
+        return this.selection ? true : false;
+    },
+
+    /** @ignore */
+    handleMouseDown : function(e, t){
+        var v = this.grid.getView();
+        if(this.isLocked()){
+            return;
+        };
+        var row = v.findRowIndex(t);
+        var cell = v.findCellIndex(t);
+        if(row !== false && cell !== false){
+            this.select(row, cell);
+        }
+    },
+
+    /**
+     * Selects a cell.
+     * @param {Number} rowIndex
+     * @param {Number} collIndex
+     */
+    select : function(rowIndex, colIndex, preventViewNotify, preventFocus, /*internal*/ r){
+        if(this.fireEvent("beforecellselect", this, rowIndex, colIndex) !== false){
+            this.clearSelections();
+            r = r || this.grid.dataSource.getAt(rowIndex);
+            this.selection = {
+                record : r,
+                cell : [rowIndex, colIndex]
+            };
+            if(!preventViewNotify){
+                var v = this.grid.getView();
+                v.onCellSelect(rowIndex, colIndex);
+                if(preventFocus !== true){
+                    v.focusCell(rowIndex, colIndex);
+                }
+            }
+            this.fireEvent("cellselect", this, rowIndex, colIndex);
+            this.fireEvent("selectionchange", this, this.selection);
+        }
+    },
+
+       //private
+    isSelectable : function(rowIndex, colIndex, cm){
+        return !cm.isHidden(colIndex);
+    },
+
+    /** @ignore */
+    handleKeyDown : function(e){
+        if(!e.isNavKeyPress()){
+            return;
+        }
+        var g = this.grid, s = this.selection;
+        if(!s){
+            e.stopEvent();
+            var cell = g.walkCells(0, 0, 1, this.isSelectable,  this);
+            if(cell){
+                this.select(cell[0], cell[1]);
+            }
+            return;
+        }
+        var sm = this;
+        var walk = function(row, col, step){
+            return g.walkCells(row, col, step, sm.isSelectable,  sm);
+        };
+        var k = e.getKey(), r = s.cell[0], c = s.cell[1];
+        var newCell;
+
+        switch(k){
+             case e.TAB:
+                 if(e.shiftKey){
+                     newCell = walk(r, c-1, -1);
+                 }else{
+                     newCell = walk(r, c+1, 1);
+                 }
+             break;
+             case e.DOWN:
+                 newCell = walk(r+1, c, 1);
+             break;
+             case e.UP:
+                 newCell = walk(r-1, c, -1);
+             break;
+             case e.RIGHT:
+                 newCell = walk(r, c+1, 1);
+             break;
+             case e.LEFT:
+                 newCell = walk(r, c-1, -1);
+             break;
+             case e.ENTER:
+                 if(g.isEditor && !g.editing){
+                    g.startEditing(r, c);
+                    e.stopEvent();
+                    return;
+                }
+             break;
+        };
+        if(newCell){
+            this.select(newCell[0], newCell[1]);
+            e.stopEvent();
+        }
+    },
+
+    acceptsNav : function(row, col, cm){
+        return !cm.isHidden(col) && cm.isCellEditable(col, row);
+    },
+
+    onEditorKey : function(field, e){
+        var k = e.getKey(), newCell, g = this.grid, ed = g.activeEditor;
+        if(k == e.TAB){
+            if(e.shiftKey){
+                newCell = g.walkCells(ed.row, ed.col-1, -1, this.acceptsNav, this);
+            }else{
+                newCell = g.walkCells(ed.row, ed.col+1, 1, this.acceptsNav, this);
+            }
+            e.stopEvent();
+        }else if(k == e.ENTER && !e.ctrlKey){
+            ed.completeEdit();
+            e.stopEvent();
+        }else if(k == e.ESC){
+            ed.cancelEdit();
+        }
+        if(newCell){
+            g.startEditing(newCell[0], newCell[1]);
+        }
+    }
+});
\ No newline at end of file
diff --git a/Roo/grid/ColumnModel.js b/Roo/grid/ColumnModel.js
new file mode 100644 (file)
index 0000000..c45ff42
--- /dev/null
@@ -0,0 +1,508 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+
+/**
+ * @class Roo.grid.ColumnModel
+ * @extends Roo.util.Observable
+ * This is the default implementation of a ColumnModel used by the Grid. It defines
+ * the columns in the grid.
+ * <br>Usage:<br>
+ <pre><code>
+ var colModel = new Roo.grid.ColumnModel([
+       {header: "Ticker", width: 60, sortable: true, locked: true},
+       {header: "Company Name", width: 150, sortable: true},
+       {header: "Market Cap.", width: 100, sortable: true},
+       {header: "$ Sales", width: 100, sortable: true, renderer: money},
+       {header: "Employees", width: 100, sortable: true, resizable: false}
+ ]);
+ </code></pre>
+ * <p>
+ * The config options listed for this class are options which may appear in each
+ * individual column definition.
+ * <br/>RooJS Fix - column id's are not sequential but use Roo.id() - fixes bugs with layouts.
+ * @constructor
+ * @param {Object} config An Array of column config objects. See this class's
+ * config objects for details.
+*/
+Roo.grid.ColumnModel = function(config){
+       /**
+     * The config passed into the constructor
+     */
+    this.config = config;
+    this.lookup = {};
+
+    // if no id, create one
+    // if the column does not have a dataIndex mapping,
+    // map it to the order it is in the config
+    for(var i = 0, len = config.length; i < len; i++){
+        var c = config[i];
+        if(typeof c.dataIndex == "undefined"){
+            c.dataIndex = i;
+        }
+        if(typeof c.renderer == "string"){
+            c.renderer = Roo.util.Format[c.renderer];
+        }
+        if(typeof c.id == "undefined"){
+            c.id = Roo.id();
+        }
+        if(c.editor && c.editor.xtype){
+            c.editor  = Roo.factory(c.editor, Roo.grid);
+        }
+        if(c.editor && c.editor.isFormField){
+            c.editor = new Roo.grid.GridEditor(c.editor);
+        }
+        this.lookup[c.id] = c;
+    }
+
+    /**
+     * The width of columns which have no width specified (defaults to 100)
+     * @type Number
+     */
+    this.defaultWidth = 100;
+
+    /**
+     * Default sortable of columns which have no sortable specified (defaults to false)
+     * @type Boolean
+     */
+    this.defaultSortable = false;
+
+    this.addEvents({
+        /**
+            * @event widthchange
+            * Fires when the width of a column changes.
+            * @param {ColumnModel} this
+            * @param {Number} columnIndex The column index
+            * @param {Number} newWidth The new width
+            */
+           "widthchange": true,
+        /**
+            * @event headerchange
+            * Fires when the text of a header changes.
+            * @param {ColumnModel} this
+            * @param {Number} columnIndex The column index
+            * @param {Number} newText The new header text
+            */
+           "headerchange": true,
+        /**
+            * @event hiddenchange
+            * Fires when a column is hidden or "unhidden".
+            * @param {ColumnModel} this
+            * @param {Number} columnIndex The column index
+            * @param {Boolean} hidden true if hidden, false otherwise
+            */
+           "hiddenchange": true,
+           /**
+         * @event columnmoved
+         * Fires when a column is moved.
+         * @param {ColumnModel} this
+         * @param {Number} oldIndex
+         * @param {Number} newIndex
+         */
+        "columnmoved" : true,
+        /**
+         * @event columlockchange
+         * Fires when a column's locked state is changed
+         * @param {ColumnModel} this
+         * @param {Number} colIndex
+         * @param {Boolean} locked true if locked
+         */
+        "columnlockchange" : true
+    });
+    Roo.grid.ColumnModel.superclass.constructor.call(this);
+};
+Roo.extend(Roo.grid.ColumnModel, Roo.util.Observable, {
+    /**
+     * @cfg {String} header The header text to display in the Grid view.
+     */
+    /**
+     * @cfg {String} dataIndex (Optional) The name of the field in the grid's {@link Roo.data.Store}'s
+     * {@link Roo.data.Record} definition from which to draw the column's value. If not
+     * specified, the column's index is used as an index into the Record's data Array.
+     */
+    /**
+     * @cfg {Number} width (Optional) The initial width in pixels of the column. Using this
+     * instead of {@link Roo.grid.Grid#autoSizeColumns} is more efficient.
+     */
+    /**
+     * @cfg {Boolean} sortable (Optional) True if sorting is to be allowed on this column.
+     * Defaults to the value of the {@link #defaultSortable} property.
+     * Whether local/remote sorting is used is specified in {@link Roo.data.Store#remoteSort}.
+     */
+    /**
+     * @cfg {Boolean} locked (Optional) True to lock the column in place while scrolling the Grid.  Defaults to false.
+     */
+    /**
+     * @cfg {Boolean} fixed (Optional) True if the column width cannot be changed.  Defaults to false.
+     */
+    /**
+     * @cfg {Boolean} resizable (Optional) False to disable column resizing. Defaults to true.
+     */
+    /**
+     * @cfg {Boolean} hidden (Optional) True to hide the column. Defaults to false.
+     */
+    /**
+     * @cfg {Function} renderer (Optional) A function used to generate HTML markup for a cell
+     * given the cell's data value. See {@link #setRenderer}. If not specified, the
+     * default renderer uses the raw data value.
+     */
+       /**
+     * @cfg {Roo.grid.GridEditor} editor (Optional) For grid editors - returns the grid editor 
+     */
+    /**
+     * @cfg {String} align (Optional) Set the CSS text-align property of the column.  Defaults to undefined.
+     */
+
+    /**
+     * Returns the id of the column at the specified index.
+     * @param {Number} index The column index
+     * @return {String} the id
+     */
+    getColumnId : function(index){
+        return this.config[index].id;
+    },
+
+    /**
+     * Returns the column for a specified id.
+     * @param {String} id The column id
+     * @return {Object} the column
+     */
+    getColumnById : function(id){
+        return this.lookup[id];
+    },
+
+    /**
+     * Returns the index for a specified column id.
+     * @param {String} id The column id
+     * @return {Number} the index, or -1 if not found
+     */
+    getIndexById : function(id){
+        for(var i = 0, len = this.config.length; i < len; i++){
+            if(this.config[i].id == id){
+                return i;
+            }
+        }
+        return -1;
+    },
+    /**
+     * Returns the index for a specified column dataIndex.
+     * @param {String} dataIndex The column dataIndex
+     * @return {Number} the index, or -1 if not found
+     */
+    
+    findColumnIndex : function(dataIndex){
+        for(var i = 0, len = this.config.length; i < len; i++){
+            if(this.config[i].dataIndex == dataIndex){
+                return i;
+            }
+        }
+        return -1;
+    },
+    
+    
+    moveColumn : function(oldIndex, newIndex){
+        var c = this.config[oldIndex];
+        this.config.splice(oldIndex, 1);
+        this.config.splice(newIndex, 0, c);
+        this.dataMap = null;
+        this.fireEvent("columnmoved", this, oldIndex, newIndex);
+    },
+
+    isLocked : function(colIndex){
+        return this.config[colIndex].locked === true;
+    },
+
+    setLocked : function(colIndex, value, suppressEvent){
+        if(this.isLocked(colIndex) == value){
+            return;
+        }
+        this.config[colIndex].locked = value;
+        if(!suppressEvent){
+            this.fireEvent("columnlockchange", this, colIndex, value);
+        }
+    },
+
+    getTotalLockedWidth : function(){
+        var totalWidth = 0;
+        for(var i = 0; i < this.config.length; i++){
+            if(this.isLocked(i) && !this.isHidden(i)){
+                this.totalWidth += this.getColumnWidth(i);
+            }
+        }
+        return totalWidth;
+    },
+
+    getLockedCount : function(){
+        for(var i = 0, len = this.config.length; i < len; i++){
+            if(!this.isLocked(i)){
+                return i;
+            }
+        }
+    },
+
+    /**
+     * Returns the number of columns.
+     * @return {Number}
+     */
+    getColumnCount : function(visibleOnly){
+        if(visibleOnly === true){
+            var c = 0;
+            for(var i = 0, len = this.config.length; i < len; i++){
+                if(!this.isHidden(i)){
+                    c++;
+                }
+            }
+            return c;
+        }
+        return this.config.length;
+    },
+
+    /**
+     * Returns the column configs that return true by the passed function that is called with (columnConfig, index)
+     * @param {Function} fn
+     * @param {Object} scope (optional)
+     * @return {Array} result
+     */
+    getColumnsBy : function(fn, scope){
+        var r = [];
+        for(var i = 0, len = this.config.length; i < len; i++){
+            var c = this.config[i];
+            if(fn.call(scope||this, c, i) === true){
+                r[r.length] = c;
+            }
+        }
+        return r;
+    },
+
+    /**
+     * Returns true if the specified column is sortable.
+     * @param {Number} col The column index
+     * @return {Boolean}
+     */
+    isSortable : function(col){
+        if(typeof this.config[col].sortable == "undefined"){
+            return this.defaultSortable;
+        }
+        return this.config[col].sortable;
+    },
+
+    /**
+     * Returns the rendering (formatting) function defined for the column.
+     * @param {Number} col The column index.
+     * @return {Function} The function used to render the cell. See {@link #setRenderer}.
+     */
+    getRenderer : function(col){
+        if(!this.config[col].renderer){
+            return Roo.grid.ColumnModel.defaultRenderer;
+        }
+        return this.config[col].renderer;
+    },
+
+    /**
+     * Sets the rendering (formatting) function for a column.
+     * @param {Number} col The column index
+     * @param {Function} fn The function to use to process the cell's raw data
+     * to return HTML markup for the grid view. The render function is called with
+     * the following parameters:<ul>
+     * <li>Data value.</li>
+     * <li>Cell metadata. An object in which you may set the following attributes:<ul>
+     * <li>css A CSS style string to apply to the table cell.</li>
+     * <li>attr An HTML attribute definition string to apply to the data container element <i>within</i> the table cell.</li></ul>
+     * <li>The {@link Roo.data.Record} from which the data was extracted.</li>
+     * <li>Row index</li>
+     * <li>Column index</li>
+     * <li>The {@link Roo.data.Store} object from which the Record was extracted</li></ul>
+     */
+    setRenderer : function(col, fn){
+        this.config[col].renderer = fn;
+    },
+
+    /**
+     * Returns the width for the specified column.
+     * @param {Number} col The column index
+     * @return {Number}
+     */
+    getColumnWidth : function(col){
+        return this.config[col].width || this.defaultWidth;
+    },
+
+    /**
+     * Sets the width for a column.
+     * @param {Number} col The column index
+     * @param {Number} width The new width
+     */
+    setColumnWidth : function(col, width, suppressEvent){
+        this.config[col].width = width;
+        this.totalWidth = null;
+        if(!suppressEvent){
+             this.fireEvent("widthchange", this, col, width);
+        }
+    },
+
+    /**
+     * Returns the total width of all columns.
+     * @param {Boolean} includeHidden True to include hidden column widths
+     * @return {Number}
+     */
+    getTotalWidth : function(includeHidden){
+        if(!this.totalWidth){
+            this.totalWidth = 0;
+            for(var i = 0, len = this.config.length; i < len; i++){
+                if(includeHidden || !this.isHidden(i)){
+                    this.totalWidth += this.getColumnWidth(i);
+                }
+            }
+        }
+        return this.totalWidth;
+    },
+
+    /**
+     * Returns the header for the specified column.
+     * @param {Number} col The column index
+     * @return {String}
+     */
+    getColumnHeader : function(col){
+        return this.config[col].header;
+    },
+
+    /**
+     * Sets the header for a column.
+     * @param {Number} col The column index
+     * @param {String} header The new header
+     */
+    setColumnHeader : function(col, header){
+        this.config[col].header = header;
+        this.fireEvent("headerchange", this, col, header);
+    },
+
+    /**
+     * Returns the tooltip for the specified column.
+     * @param {Number} col The column index
+     * @return {String}
+     */
+    getColumnTooltip : function(col){
+            return this.config[col].tooltip;
+    },
+    /**
+     * Sets the tooltip for a column.
+     * @param {Number} col The column index
+     * @param {String} tooltip The new tooltip
+     */
+    setColumnTooltip : function(col, tooltip){
+            this.config[col].tooltip = tooltip;
+    },
+
+    /**
+     * Returns the dataIndex for the specified column.
+     * @param {Number} col The column index
+     * @return {Number}
+     */
+    getDataIndex : function(col){
+        return this.config[col].dataIndex;
+    },
+
+    /**
+     * Sets the dataIndex for a column.
+     * @param {Number} col The column index
+     * @param {Number} dataIndex The new dataIndex
+     */
+    setDataIndex : function(col, dataIndex){
+        this.config[col].dataIndex = dataIndex;
+    },
+
+    
+    
+    /**
+     * Returns true if the cell is editable.
+     * @param {Number} colIndex The column index
+     * @param {Number} rowIndex The row index
+     * @return {Boolean}
+     */
+    isCellEditable : function(colIndex, rowIndex){
+        return (this.config[colIndex].editable || (typeof this.config[colIndex].editable == "undefined" && this.config[colIndex].editor)) ? true : false;
+    },
+
+    /**
+     * Returns the editor defined for the cell/column.
+     * return false or null to disable editing.
+     * @param {Number} colIndex The column index
+     * @param {Number} rowIndex The row index
+     * @return {Object}
+     */
+    getCellEditor : function(colIndex, rowIndex){
+        return this.config[colIndex].editor;
+    },
+
+    /**
+     * Sets if a column is editable.
+     * @param {Number} col The column index
+     * @param {Boolean} editable True if the column is editable
+     */
+    setEditable : function(col, editable){
+        this.config[col].editable = editable;
+    },
+
+
+    /**
+     * Returns true if the column is hidden.
+     * @param {Number} colIndex The column index
+     * @return {Boolean}
+     */
+    isHidden : function(colIndex){
+        return this.config[colIndex].hidden;
+    },
+
+
+    /**
+     * Returns true if the column width cannot be changed
+     */
+    isFixed : function(colIndex){
+        return this.config[colIndex].fixed;
+    },
+
+    /**
+     * Returns true if the column can be resized
+     * @return {Boolean}
+     */
+    isResizable : function(colIndex){
+        return colIndex >= 0 && this.config[colIndex].resizable !== false && this.config[colIndex].fixed !== true;
+    },
+    /**
+     * Sets if a column is hidden.
+     * @param {Number} colIndex The column index
+     * @param {Boolean} hidden True if the column is hidden
+     */
+    setHidden : function(colIndex, hidden){
+        this.config[colIndex].hidden = hidden;
+        this.totalWidth = null;
+        this.fireEvent("hiddenchange", this, colIndex, hidden);
+    },
+
+    /**
+     * Sets the editor for a column.
+     * @param {Number} col The column index
+     * @param {Object} editor The editor object
+     */
+    setEditor : function(col, editor){
+        this.config[col].editor = editor;
+    }
+});
+
+Roo.grid.ColumnModel.defaultRenderer = function(value){
+       if(typeof value == "string" && value.length < 1){
+           return "&#160;";
+       }
+       return value;
+};
+
+// Alias for backwards compatibility
+Roo.grid.DefaultColumnModel = Roo.grid.ColumnModel;
diff --git a/Roo/grid/EditorGrid.js b/Roo/grid/EditorGrid.js
new file mode 100644 (file)
index 0000000..e9c765a
--- /dev/null
@@ -0,0 +1,185 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+/**
+ * @class Roo.grid.EditorGrid
+ * @extends Roo.grid.Grid
+ * Class for creating and editable grid.
+ * @param {String/HTMLElement/Roo.Element} container The element into which this grid will be rendered - 
+ * The container MUST have some type of size defined for the grid to fill. The container will be 
+ * automatically set to position relative if it isn't already.
+ * @param {Object} dataSource The data model to bind to
+ * @param {Object} colModel The column model with info about this grid's columns
+ */
+Roo.grid.EditorGrid = function(container, config){
+    Roo.grid.EditorGrid.superclass.constructor.call(this, container, config);
+    this.getGridEl().addClass("xedit-grid");
+
+    if(!this.selModel){
+        this.selModel = new Roo.grid.CellSelectionModel();
+    }
+
+    this.activeEditor = null;
+
+       this.addEvents({
+           /**
+            * @event beforeedit
+            * Fires before cell editing is triggered. The edit event object has the following properties <br />
+            * <ul style="padding:5px;padding-left:16px;">
+            * <li>grid - This grid</li>
+            * <li>record - The record being edited</li>
+            * <li>field - The field name being edited</li>
+            * <li>value - The value for the field being edited.</li>
+            * <li>row - The grid row index</li>
+            * <li>column - The grid column index</li>
+            * <li>cancel - Set this to true to cancel the edit or return false from your handler.</li>
+            * </ul>
+            * @param {Object} e An edit event (see above for description)
+            */
+           "beforeedit" : true,
+           /**
+            * @event afteredit
+            * Fires after a cell is edited. <br />
+            * <ul style="padding:5px;padding-left:16px;">
+            * <li>grid - This grid</li>
+            * <li>record - The record being edited</li>
+            * <li>field - The field name being edited</li>
+            * <li>value - The value being set</li>
+            * <li>originalValue - The original value for the field, before the edit.</li>
+            * <li>row - The grid row index</li>
+            * <li>column - The grid column index</li>
+            * </ul>
+            * @param {Object} e An edit event (see above for description)
+            */
+           "afteredit" : true,
+           /**
+            * @event validateedit
+            * Fires after a cell is edited, but before the value is set in the record. 
+         * You can use this to modify the value being set in the field, Return false
+            * to cancel the change. The edit event object has the following properties <br />
+            * <ul style="padding:5px;padding-left:16px;">
+         * <li>editor - This editor</li>
+            * <li>grid - This grid</li>
+            * <li>record - The record being edited</li>
+            * <li>field - The field name being edited</li>
+            * <li>value - The value being set</li>
+            * <li>originalValue - The original value for the field, before the edit.</li>
+            * <li>row - The grid row index</li>
+            * <li>column - The grid column index</li>
+            * <li>cancel - Set this to true to cancel the edit or return false from your handler.</li>
+            * </ul>
+            * @param {Object} e An edit event (see above for description)
+            */
+           "validateedit" : true
+       });
+    this.on("bodyscroll", this.stopEditing,  this);
+    this.on(this.clicksToEdit == 1 ? "cellclick" : "celldblclick", this.onCellDblClick,  this);
+};
+
+Roo.extend(Roo.grid.EditorGrid, Roo.grid.Grid, {
+    /**
+     * @cfg {Number} clicksToEdit
+     * The number of clicks on a cell required to display the cell's editor (defaults to 2)
+     */
+    clicksToEdit: 2,
+
+    // private
+    isEditor : true,
+    // private
+    trackMouseOver: false, // causes very odd FF errors
+
+    onCellDblClick : function(g, row, col){
+        this.startEditing(row, col);
+    },
+
+    onEditComplete : function(ed, value, startValue){
+        this.editing = false;
+        this.activeEditor = null;
+        ed.un("specialkey", this.selModel.onEditorKey, this.selModel);
+        var r = ed.record;
+        var field = this.colModel.getDataIndex(ed.col);
+        var e = {
+            grid: this,
+            record: r,
+            field: field,
+            originalValue: startValue,
+            value: value,
+            row: ed.row,
+            column: ed.col,
+            cancel:false,
+            editor: ed
+        };
+        if(String(value) !== String(startValue)){
+            
+            if(this.fireEvent("validateedit", e) !== false && !e.cancel){
+                r.set(field, e.value);
+                delete e.cancel; //?? why!!!
+                this.fireEvent("afteredit", e);
+            }
+        } else {
+            this.fireEvent("afteredit", e); // always fir it!
+        }
+        this.view.focusCell(ed.row, ed.col);
+    },
+
+    /**
+     * Starts editing the specified for the specified row/column
+     * @param {Number} rowIndex
+     * @param {Number} colIndex
+     */
+    startEditing : function(row, col){
+        this.stopEditing();
+        if(this.colModel.isCellEditable(col, row)){
+            this.view.ensureVisible(row, col, true);
+            var r = this.dataSource.getAt(row);
+            var field = this.colModel.getDataIndex(col);
+            var e = {
+                grid: this,
+                record: r,
+                field: field,
+                value: r.data[field],
+                row: row,
+                column: col,
+                cancel:false
+            };
+            if(this.fireEvent("beforeedit", e) !== false && !e.cancel){
+                this.editing = true;
+                var ed = this.colModel.getCellEditor(col, row);
+                if (!ed) {
+                    return;
+                }
+                if(!ed.rendered){
+                    ed.render(ed.parentEl || document.body);
+                }
+                (function(){ // complex but required for focus issues in safari, ie and opera
+                    ed.row = row;
+                    ed.col = col;
+                    ed.record = r;
+                    ed.on("complete", this.onEditComplete, this, {single: true});
+                    ed.on("specialkey", this.selModel.onEditorKey, this.selModel);
+                    this.activeEditor = ed;
+                    var v = r.data[field];
+                    ed.startEdit(this.view.getCell(row, col), v);
+                }).defer(50, this);
+            }
+        }
+    },
+        
+    /**
+     * Stops any active editing
+     */
+    stopEditing : function(){
+        if(this.activeEditor){
+            this.activeEditor.completeEdit();
+        }
+        this.activeEditor = null;
+    }
+});
\ No newline at end of file
diff --git a/Roo/grid/Grid.js b/Roo/grid/Grid.js
new file mode 100644 (file)
index 0000000..8091de2
--- /dev/null
@@ -0,0 +1,650 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+/**
+ * @class Roo.grid.Grid
+ * @extends Roo.util.Observable
+ * This class represents the primary interface of a component based grid control.
+ * <br><br>Usage:<pre><code>
+ var grid = new Roo.grid.Grid("my-container-id", {
+     ds: myDataStore,
+     cm: myColModel,
+     selModel: mySelectionModel,
+     autoSizeColumns: true,
+     monitorWindowResize: false,
+     trackMouseOver: true
+ });
+ // set any options
+ grid.render();
+ * </code></pre>
+ * <b>Common Problems:</b><br/>
+ * - Grid does not resize properly when going smaller: Setting overflow hidden on the container
+ * element will correct this<br/>
+ * - If you get el.style[camel]= NaNpx or -2px or something related, be certain you have given your container element
+ * dimensions. The grid adapts to your container's size, if your container has no size defined then the results
+ * are unpredictable.<br/>
+ * - Do not render the grid into an element with display:none. Try using visibility:hidden. Otherwise there is no way for the
+ * grid to calculate dimensions/offsets.<br/>
+  * @constructor
+ * @param {String/HTMLElement/Roo.Element} container The element into which this grid will be rendered -
+ * The container MUST have some type of size defined for the grid to fill. The container will be
+ * automatically set to position relative if it isn't already.
+ * @param {Object} config A config object that sets properties on this grid.
+ */
+Roo.grid.Grid = function(container, config){
+       // initialize the container
+       this.container = Roo.get(container);
+       this.container.update("");
+       this.container.setStyle("overflow", "hidden");
+    this.container.addClass('x-grid-container');
+
+    this.id = this.container.id;
+
+    Roo.apply(this, config);
+    // check and correct shorthanded configs
+    if(this.ds){
+        this.dataSource = this.ds;
+        delete this.ds;
+    }
+    if(this.cm){
+        this.colModel = this.cm;
+        delete this.cm;
+    }
+    if(this.sm){
+        this.selModel = this.sm;
+        delete this.sm;
+    }
+
+    if (this.selModel) {
+        this.selModel = Roo.factory(this.selModel, Roo.grid);
+    }
+    if (typeof(this.colModel.config) == 'undefined') {
+        this.colModel = new Roo.grid.ColumnModel(this.colModel);
+    }
+    if (this.dataSource) {
+        this.dataSource= Roo.factory(this.dataSource, Roo.data);
+    }
+    
+    
+    
+    if(this.width){
+        this.container.setWidth(this.width);
+    }
+
+    if(this.height){
+        this.container.setHeight(this.height);
+    }
+    /** @private */
+       this.addEvents({
+           // raw events
+           /**
+            * @event click
+            * The raw click event for the entire grid.
+            * @param {Roo.EventObject} e
+            */
+           "click" : true,
+           /**
+            * @event dblclick
+            * The raw dblclick event for the entire grid.
+            * @param {Roo.EventObject} e
+            */
+           "dblclick" : true,
+           /**
+            * @event contextmenu
+            * The raw contextmenu event for the entire grid.
+            * @param {Roo.EventObject} e
+            */
+           "contextmenu" : true,
+           /**
+            * @event mousedown
+            * The raw mousedown event for the entire grid.
+            * @param {Roo.EventObject} e
+            */
+           "mousedown" : true,
+           /**
+            * @event mouseup
+            * The raw mouseup event for the entire grid.
+            * @param {Roo.EventObject} e
+            */
+           "mouseup" : true,
+           /**
+            * @event mouseover
+            * The raw mouseover event for the entire grid.
+            * @param {Roo.EventObject} e
+            */
+           "mouseover" : true,
+           /**
+            * @event mouseout
+            * The raw mouseout event for the entire grid.
+            * @param {Roo.EventObject} e
+            */
+           "mouseout" : true,
+           /**
+            * @event keypress
+            * The raw keypress event for the entire grid.
+            * @param {Roo.EventObject} e
+            */
+           "keypress" : true,
+           /**
+            * @event keydown
+            * The raw keydown event for the entire grid.
+            * @param {Roo.EventObject} e
+            */
+           "keydown" : true,
+
+           // custom events
+
+           /**
+            * @event cellclick
+            * Fires when a cell is clicked
+            * @param {Grid} this
+            * @param {Number} rowIndex
+            * @param {Number} columnIndex
+            * @param {Roo.EventObject} e
+            */
+           "cellclick" : true,
+           /**
+            * @event celldblclick
+            * Fires when a cell is double clicked
+            * @param {Grid} this
+            * @param {Number} rowIndex
+            * @param {Number} columnIndex
+            * @param {Roo.EventObject} e
+            */
+           "celldblclick" : true,
+           /**
+            * @event rowclick
+            * Fires when a row is clicked
+            * @param {Grid} this
+            * @param {Number} rowIndex
+            * @param {Roo.EventObject} e
+            */
+           "rowclick" : true,
+           /**
+            * @event rowdblclick
+            * Fires when a row is double clicked
+            * @param {Grid} this
+            * @param {Number} rowIndex
+            * @param {Roo.EventObject} e
+            */
+           "rowdblclick" : true,
+           /**
+            * @event headerclick
+            * Fires when a header is clicked
+            * @param {Grid} this
+            * @param {Number} columnIndex
+            * @param {Roo.EventObject} e
+            */
+           "headerclick" : true,
+           /**
+            * @event headerdblclick
+            * Fires when a header cell is double clicked
+            * @param {Grid} this
+            * @param {Number} columnIndex
+            * @param {Roo.EventObject} e
+            */
+           "headerdblclick" : true,
+           /**
+            * @event rowcontextmenu
+            * Fires when a row is right clicked
+            * @param {Grid} this
+            * @param {Number} rowIndex
+            * @param {Roo.EventObject} e
+            */
+           "rowcontextmenu" : true,
+           /**
+         * @event cellcontextmenu
+         * Fires when a cell is right clicked
+         * @param {Grid} this
+         * @param {Number} rowIndex
+         * @param {Number} cellIndex
+         * @param {Roo.EventObject} e
+         */
+         "cellcontextmenu" : true,
+           /**
+            * @event headercontextmenu
+            * Fires when a header is right clicked
+            * @param {Grid} this
+            * @param {Number} columnIndex
+            * @param {Roo.EventObject} e
+            */
+           "headercontextmenu" : true,
+           /**
+            * @event bodyscroll
+            * Fires when the body element is scrolled
+            * @param {Number} scrollLeft
+            * @param {Number} scrollTop
+            */
+           "bodyscroll" : true,
+           /**
+            * @event columnresize
+            * Fires when the user resizes a column
+            * @param {Number} columnIndex
+            * @param {Number} newSize
+            */
+           "columnresize" : true,
+           /**
+            * @event columnmove
+            * Fires when the user moves a column
+            * @param {Number} oldIndex
+            * @param {Number} newIndex
+            */
+           "columnmove" : true,
+           /**
+            * @event startdrag
+            * Fires when row(s) start being dragged
+            * @param {Grid} this
+            * @param {Roo.GridDD} dd The drag drop object
+            * @param {event} e The raw browser event
+            */
+           "startdrag" : true,
+           /**
+            * @event enddrag
+            * Fires when a drag operation is complete
+            * @param {Grid} this
+            * @param {Roo.GridDD} dd The drag drop object
+            * @param {event} e The raw browser event
+            */
+           "enddrag" : true,
+           /**
+            * @event dragdrop
+            * Fires when dragged row(s) are dropped on a valid DD target
+            * @param {Grid} this
+            * @param {Roo.GridDD} dd The drag drop object
+            * @param {String} targetId The target drag drop object
+            * @param {event} e The raw browser event
+            */
+           "dragdrop" : true,
+           /**
+            * @event dragover
+            * Fires while row(s) are being dragged. "targetId" is the id of the Yahoo.util.DD object the selected rows are being dragged over.
+            * @param {Grid} this
+            * @param {Roo.GridDD} dd The drag drop object
+            * @param {String} targetId The target drag drop object
+            * @param {event} e The raw browser event
+            */
+           "dragover" : true,
+           /**
+            * @event dragenter
+            *  Fires when the dragged row(s) first cross another DD target while being dragged
+            * @param {Grid} this
+            * @param {Roo.GridDD} dd The drag drop object
+            * @param {String} targetId The target drag drop object
+            * @param {event} e The raw browser event
+            */
+           "dragenter" : true,
+           /**
+            * @event dragout
+            * Fires when the dragged row(s) leave another DD target while being dragged
+            * @param {Grid} this
+            * @param {Roo.GridDD} dd The drag drop object
+            * @param {String} targetId The target drag drop object
+            * @param {event} e The raw browser event
+            */
+           "dragout" : true,
+        /**
+         * @event render
+         * Fires when the grid is rendered
+         * @param {Grid} grid
+         */
+        render : true
+    });
+
+    Roo.grid.Grid.superclass.constructor.call(this);
+};
+Roo.extend(Roo.grid.Grid, Roo.util.Observable, {
+    /**
+     * @cfg {Number} minColumnWidth The minimum width a column can be resized to. Default is 25.
+        */
+       minColumnWidth : 25,
+
+    /**
+        * @cfg {Boolean} autoSizeColumns True to automatically resize the columns to fit their content
+        * <b>on initial render.</b> It is more efficient to explicitly size the columns
+        * through the ColumnModel's {@link Roo.grid.ColumnModel#width} config option.  Default is false.
+        */
+       autoSizeColumns : false,
+
+       /**
+        * @cfg {Boolean} autoSizeHeaders True to measure headers with column data when auto sizing columns. Default is true.
+        */
+       autoSizeHeaders : true,
+
+       /**
+        * @cfg {Boolean} monitorWindowResize True to autoSize the grid when the window resizes. Default is true.
+        */
+       monitorWindowResize : true,
+
+       /**
+        * @cfg {Boolean} maxRowsToMeasure If autoSizeColumns is on, maxRowsToMeasure can be used to limit the number of
+        * rows measured to get a columns size. Default is 0 (all rows).
+        */
+       maxRowsToMeasure : 0,
+
+       /**
+        * @cfg {Boolean} trackMouseOver True to highlight rows when the mouse is over. Default is true.
+        */
+       trackMouseOver : true,
+
+       /**
+        * @cfg {Boolean} enableDragDrop True to enable drag and drop of rows. Default is false.
+        */
+       enableDragDrop : false,
+
+       /**
+        * @cfg {Boolean} enableColumnMove True to enable drag and drop reorder of columns. Default is true.
+        */
+       enableColumnMove : true,
+
+       /**
+        * @cfg {Boolean} enableColumnHide True to enable hiding of columns with the header context menu. Default is true.
+        */
+       enableColumnHide : true,
+
+       /**
+        * @cfg {Boolean} enableRowHeightSync True to manually sync row heights across locked and not locked rows. Default is false.
+        */
+       enableRowHeightSync : false,
+
+       /**
+        * @cfg {Boolean} stripeRows True to stripe the rows.  Default is true.
+        */
+       stripeRows : true,
+
+       /**
+        * @cfg {Boolean} autoHeight True to fit the height of the grid container to the height of the data. Default is false.
+        */
+       autoHeight : false,
+
+    /**
+     * @cfg {String} autoExpandColumn The id (or dataIndex) of a column in this grid that should expand to fill unused space. This id can not be 0. Default is false.
+     */
+    autoExpandColumn : false,
+
+    /**
+    * @cfg {Number} autoExpandMin The minimum width the autoExpandColumn can have (if enabled).
+    * Default is 50.
+    */
+    autoExpandMin : 50,
+
+    /**
+    * @cfg {Number} autoExpandMax The maximum width the autoExpandColumn can have (if enabled). Default is 1000.
+    */
+    autoExpandMax : 1000,
+
+    /**
+        * @cfg {Object} view The {@link Roo.grid.GridView} used by the grid. This can be set before a call to render().
+        */
+       view : null,
+
+       /**
+     * @cfg {Object} loadMask An {@link Roo.LoadMask} config or true to mask the grid while loading. Default is false.
+        */
+       loadMask : false,
+
+    // private
+    rendered : false,
+
+    /**
+    * @cfg {Boolean} autoWidth True to set the grid's width to the default total width of the grid's columns instead
+    * of a fixed width. Default is false.
+    */
+    /**
+    * @cfg {Number} maxHeight Sets the maximum height of the grid - ignored if autoHeight is not on.
+    */
+    /**
+     * Called once after all setup has been completed and the grid is ready to be rendered.
+     * @return {Roo.grid.Grid} this
+     */
+    render : function(){
+        var c = this.container;
+        // try to detect autoHeight/width mode
+        if((!c.dom.offsetHeight || c.dom.offsetHeight < 20) || c.getStyle("height") == "auto"){
+           this.autoHeight = true;
+       }
+       var view = this.getView();
+        view.init(this);
+
+        c.on("click", this.onClick, this);
+        c.on("dblclick", this.onDblClick, this);
+        c.on("contextmenu", this.onContextMenu, this);
+        c.on("keydown", this.onKeyDown, this);
+
+        this.relayEvents(c, ["mousedown","mouseup","mouseover","mouseout","keypress"]);
+
+        this.getSelectionModel().init(this);
+
+        view.render();
+
+        if(this.loadMask){
+            this.loadMask = new Roo.LoadMask(this.container,
+                    Roo.apply({store:this.dataSource}, this.loadMask));
+        }
+        
+        
+        if (this.toolbar && this.toolbar.xtype) {
+            this.toolbar.container = this.getView().getHeaderPanel(true);
+            this.toolbar = new Ext.Toolbar(this.toolbar);
+        }
+        if (this.footer && this.footer.xtype) {
+            this.footer.dataSource = this.getDataSource();
+            this.footer.container = this.getView().getFooterPanel(true);
+            this.footer = Roo.factory(this.footer, Roo);
+        }
+        this.rendered = true;
+        this.fireEvent('render', this);
+        return this;
+    },
+
+       /**
+        * Reconfigures the grid to use a different Store and Column Model.
+        * The View will be bound to the new objects and refreshed.
+        * @param {Roo.data.Store} dataSource The new {@link Roo.data.Store} object
+        * @param {Roo.grid.ColumnModel} The new {@link Roo.grid.ColumnModel} object
+        */
+    reconfigure : function(dataSource, colModel){
+        if(this.loadMask){
+            this.loadMask.destroy();
+            this.loadMask = new Roo.LoadMask(this.container,
+                    Roo.apply({store:dataSource}, this.loadMask));
+        }
+        this.view.bind(dataSource, colModel);
+        this.dataSource = dataSource;
+        this.colModel = colModel;
+        this.view.refresh(true);
+    },
+
+    // private
+    onKeyDown : function(e){
+        this.fireEvent("keydown", e);
+    },
+
+    /**
+     * Destroy this grid.
+     * @param {Boolean} removeEl True to remove the element
+     */
+    destroy : function(removeEl, keepListeners){
+        if(this.loadMask){
+            this.loadMask.destroy();
+        }
+        var c = this.container;
+        c.removeAllListeners();
+        this.view.destroy();
+        this.colModel.purgeListeners();
+        if(!keepListeners){
+            this.purgeListeners();
+        }
+        c.update("");
+        if(removeEl === true){
+            c.remove();
+        }
+    },
+
+    // private
+    processEvent : function(name, e){
+        this.fireEvent(name, e);
+        var t = e.getTarget();
+        var v = this.view;
+        var header = v.findHeaderIndex(t);
+        if(header !== false){
+            this.fireEvent("header" + name, this, header, e);
+        }else{
+            var row = v.findRowIndex(t);
+            var cell = v.findCellIndex(t);
+            if(row !== false){
+                this.fireEvent("row" + name, this, row, e);
+                if(cell !== false){
+                    this.fireEvent("cell" + name, this, row, cell, e);
+                }
+            }
+        }
+    },
+
+    // private
+    onClick : function(e){
+        this.processEvent("click", e);
+    },
+
+    // private
+    onContextMenu : function(e, t){
+        this.processEvent("contextmenu", e);
+    },
+
+    // private
+    onDblClick : function(e){
+        this.processEvent("dblclick", e);
+    },
+
+    // private
+    walkCells : function(row, col, step, fn, scope){
+        var cm = this.colModel, clen = cm.getColumnCount();
+        var ds = this.dataSource, rlen = ds.getCount(), first = true;
+        if(step < 0){
+            if(col < 0){
+                row--;
+                first = false;
+            }
+            while(row >= 0){
+                if(!first){
+                    col = clen-1;
+                }
+                first = false;
+                while(col >= 0){
+                    if(fn.call(scope || this, row, col, cm) === true){
+                        return [row, col];
+                    }
+                    col--;
+                }
+                row--;
+            }
+        } else {
+            if(col >= clen){
+                row++;
+                first = false;
+            }
+            while(row < rlen){
+                if(!first){
+                    col = 0;
+                }
+                first = false;
+                while(col < clen){
+                    if(fn.call(scope || this, row, col, cm) === true){
+                        return [row, col];
+                    }
+                    col++;
+                }
+                row++;
+            }
+        }
+        return null;
+    },
+
+    // private
+    getSelections : function(){
+        return this.selModel.getSelections();
+    },
+
+    /**
+     * Causes the grid to manually recalculate its dimensions. Generally this is done automatically,
+     * but if manual update is required this method will initiate it.
+     */
+    autoSize : function(){
+        if(this.rendered){
+            this.view.layout();
+            if(this.view.adjustForScroll){
+                this.view.adjustForScroll();
+            }
+        }
+    },
+
+    /**
+     * Returns the grid's underlying element.
+     * @return {Element} The element
+     */
+    getGridEl : function(){
+        return this.container;
+    },
+
+    // private for compatibility, overridden by editor grid
+    stopEditing : function(){},
+
+    /**
+     * Returns the grid's SelectionModel.
+     * @return {SelectionModel}
+     */
+    getSelectionModel : function(){
+        if(!this.selModel){
+            this.selModel = new Roo.grid.RowSelectionModel();
+        }
+        return this.selModel;
+    },
+
+    /**
+     * Returns the grid's DataSource.
+     * @return {DataSource}
+     */
+    getDataSource : function(){
+        return this.dataSource;
+    },
+
+    /**
+     * Returns the grid's ColumnModel.
+     * @return {ColumnModel}
+     */
+    getColumnModel : function(){
+        return this.colModel;
+    },
+
+    /**
+     * Returns the grid's GridView object.
+     * @return {GridView}
+     */
+    getView : function(){
+        if(!this.view){
+            this.view = new Roo.grid.GridView(this.viewConfig);
+        }
+        return this.view;
+    },
+    /**
+     * Called to get grid's drag proxy text, by default returns this.ddText.
+     * @return {String}
+     */
+    getDragDropText : function(){
+        var count = this.selModel.getCount();
+        return String.format(this.ddText, count, count == 1 ? '' : 's');
+    }
+});
+/**
+ * Configures the text is the drag proxy (defaults to "%0 selected row(s)").
+ * %0 is replaced with the number of selected rows.
+ * @type String
+ */
+Roo.grid.Grid.prototype.ddText = "{0} selected row{1}";
\ No newline at end of file
diff --git a/Roo/grid/GridDragZone.js b/Roo/grid/GridDragZone.js
new file mode 100644 (file)
index 0000000..89cde2d
--- /dev/null
@@ -0,0 +1,73 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+// private
+// This is a support class used internally by the Grid components
+Roo.grid.GridDragZone = function(grid, config){
+    this.view = grid.getView();
+    Roo.grid.GridDragZone.superclass.constructor.call(this, this.view.mainBody.dom, config);
+    if(this.view.lockedBody){
+        this.setHandleElId(Roo.id(this.view.mainBody.dom));
+        this.setOuterHandleElId(Roo.id(this.view.lockedBody.dom));
+    }
+    this.scroll = false;
+    this.grid = grid;
+    this.ddel = document.createElement('div');
+    this.ddel.className = 'x-grid-dd-wrap';
+};
+
+Roo.extend(Roo.grid.GridDragZone, Roo.dd.DragZone, {
+    ddGroup : "GridDD",
+
+    getDragData : function(e){
+        var t = Roo.lib.Event.getTarget(e);
+        var rowIndex = this.view.findRowIndex(t);
+        if(rowIndex !== false){
+            var sm = this.grid.selModel;
+            //if(!sm.isSelected(rowIndex) || e.hasModifier()){
+              //  sm.mouseDown(e, t);
+            //}
+            if (e.hasModifier()){
+                sm.handleMouseDown(e, t); // non modifier buttons are handled by row select.
+            }
+            return {grid: this.grid, ddel: this.ddel, rowIndex: rowIndex, selections:sm.getSelections()};
+        }
+        return false;
+    },
+
+    onInitDrag : function(e){
+        var data = this.dragData;
+        this.ddel.innerHTML = this.grid.getDragDropText();
+        this.proxy.update(this.ddel);
+        // fire start drag?
+    },
+
+    afterRepair : function(){
+        this.dragging = false;
+    },
+
+    getRepairXY : function(e, data){
+        return false;
+    },
+
+    onEndDrag : function(data, e){
+        // fire end drag?
+    },
+
+    onValidDrop : function(dd, e, id){
+        // fire drag drop?
+        this.hideProxy();
+    },
+
+    beforeInvalidDrop : function(e, id){
+
+    }
+});
\ No newline at end of file
diff --git a/Roo/grid/GridEditor.js b/Roo/grid/GridEditor.js
new file mode 100644 (file)
index 0000000..e42a521
--- /dev/null
@@ -0,0 +1,42 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+
+// private - not really -- you end up using it !
+// This is a support class used internally by the Grid components
+
+/**
+ * @class Roo.grid.GridEditor
+ * @extends Roo.Editor
+ * Class for creating and editable grid elements.
+ * @param {Object} config any settings (must include field)
+ */
+Roo.grid.GridEditor = function(field, config){
+    if (!config && field.field) {
+        config = field;
+        field = Roo.factory(config.field, Roo.form);
+    }
+    Roo.grid.GridEditor.superclass.constructor.call(this, field, config);
+    field.monitorTab = false;
+};
+
+Roo.extend(Roo.grid.GridEditor, Roo.Editor, {
+    
+    /**
+     * @cfg {Roo.form.Field} field Field to wrap (or xtyped)
+     */
+    
+    alignment: "tl-tl",
+    autoSize: "width",
+    hideEl : false,
+    cls: "x-small-editor x-grid-editor",
+    shim:false,
+    shadow:"frame"
+});
\ No newline at end of file
diff --git a/Roo/grid/GridView.js b/Roo/grid/GridView.js
new file mode 100644 (file)
index 0000000..03591d1
--- /dev/null
@@ -0,0 +1,1559 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+  
+/**
+ * @class Roo.grid.GridView
+ * @extends Roo.util.Observable
+ *
+ * @constructor
+ * @param {Object} config
+ */
+Roo.grid.GridView = function(config){
+    Roo.grid.GridView.superclass.constructor.call(this);
+    this.el = null;
+
+    Roo.apply(this, config);
+};
+
+Roo.extend(Roo.grid.GridView, Roo.grid.AbstractGridView, {
+
+    /**
+     * Override this function to apply custom css classes to rows during rendering
+     * @param {Record} record The record
+     * @param {Number} index
+     * @method getRowClass
+     */
+    rowClass : "x-grid-row",
+
+    cellClass : "x-grid-col",
+
+    tdClass : "x-grid-td",
+
+    hdClass : "x-grid-hd",
+
+    splitClass : "x-grid-split",
+
+    sortClasses : ["sort-asc", "sort-desc"],
+
+    enableMoveAnim : false,
+
+    hlColor: "C3DAF9",
+
+    dh : Roo.DomHelper,
+
+    fly : Roo.Element.fly,
+
+    css : Roo.util.CSS,
+
+    borderWidth: 1,
+
+    splitOffset: 3,
+
+    scrollIncrement : 22,
+
+    cellRE: /(?:.*?)x-grid-(?:hd|cell|csplit)-(?:[\d]+)-([\d]+)(?:.*?)/,
+
+    findRE: /\s?(?:x-grid-hd|x-grid-col|x-grid-csplit)\s/,
+
+    bind : function(ds, cm){
+        if(this.ds){
+            this.ds.un("load", this.onLoad, this);
+            this.ds.un("datachanged", this.onDataChange, this);
+            this.ds.un("add", this.onAdd, this);
+            this.ds.un("remove", this.onRemove, this);
+            this.ds.un("update", this.onUpdate, this);
+            this.ds.un("clear", this.onClear, this);
+        }
+        if(ds){
+            ds.on("load", this.onLoad, this);
+            ds.on("datachanged", this.onDataChange, this);
+            ds.on("add", this.onAdd, this);
+            ds.on("remove", this.onRemove, this);
+            ds.on("update", this.onUpdate, this);
+            ds.on("clear", this.onClear, this);
+        }
+        this.ds = ds;
+
+        if(this.cm){
+            this.cm.un("widthchange", this.onColWidthChange, this);
+            this.cm.un("headerchange", this.onHeaderChange, this);
+            this.cm.un("hiddenchange", this.onHiddenChange, this);
+            this.cm.un("columnmoved", this.onColumnMove, this);
+            this.cm.un("columnlockchange", this.onColumnLock, this);
+        }
+        if(cm){
+            this.generateRules(cm);
+            cm.on("widthchange", this.onColWidthChange, this);
+            cm.on("headerchange", this.onHeaderChange, this);
+            cm.on("hiddenchange", this.onHiddenChange, this);
+            cm.on("columnmoved", this.onColumnMove, this);
+            cm.on("columnlockchange", this.onColumnLock, this);
+        }
+        this.cm = cm;
+    },
+
+    init: function(grid){
+               Roo.grid.GridView.superclass.init.call(this, grid);
+
+               this.bind(grid.dataSource, grid.colModel);
+
+           grid.on("headerclick", this.handleHeaderClick, this);
+
+        if(grid.trackMouseOver){
+            grid.on("mouseover", this.onRowOver, this);
+               grid.on("mouseout", this.onRowOut, this);
+           }
+           grid.cancelTextSelection = function(){};
+               this.gridId = grid.id;
+
+               var tpls = this.templates || {};
+
+               if(!tpls.master){
+                   tpls.master = new Roo.Template(
+                      '<div class="x-grid" hidefocus="true">',
+                         '<div class="x-grid-topbar"></div>',
+                         '<div class="x-grid-scroller"><div></div></div>',
+                         '<div class="x-grid-locked">',
+                             '<div class="x-grid-header">{lockedHeader}</div>',
+                             '<div class="x-grid-body">{lockedBody}</div>',
+                         "</div>",
+                         '<div class="x-grid-viewport">',
+                             '<div class="x-grid-header">{header}</div>',
+                             '<div class="x-grid-body">{body}</div>',
+                         "</div>",
+                         '<div class="x-grid-bottombar"></div>',
+                         '<a href="#" class="x-grid-focus" tabIndex="-1"></a>',
+                         '<div class="x-grid-resize-proxy">&#160;</div>',
+                      "</div>"
+                   );
+                   tpls.master.disableformats = true;
+               }
+
+               if(!tpls.header){
+                   tpls.header = new Roo.Template(
+                      '<table border="0" cellspacing="0" cellpadding="0">',
+                      '<tbody><tr class="x-grid-hd-row">{cells}</tr></tbody>',
+                      "</table>{splits}"
+                   );
+                   tpls.header.disableformats = true;
+               }
+               tpls.header.compile();
+
+               if(!tpls.hcell){
+                   tpls.hcell = new Roo.Template(
+                       '<td class="x-grid-hd x-grid-td-{id} {cellId}"><div title="{title}" class="x-grid-hd-inner x-grid-hd-{id}">',
+                       '<div class="x-grid-hd-text" unselectable="on">{value}<img class="x-grid-sort-icon" src="', Roo.BLANK_IMAGE_URL, '" /></div>',
+                       "</div></td>"
+                    );
+                    tpls.hcell.disableFormats = true;
+               }
+               tpls.hcell.compile();
+
+               if(!tpls.hsplit){
+                   tpls.hsplit = new Roo.Template('<div class="x-grid-split {splitId} x-grid-split-{id}" style="{style}" unselectable="on">&#160;</div>');
+                   tpls.hsplit.disableFormats = true;
+               }
+               tpls.hsplit.compile();
+
+               if(!tpls.body){
+                   tpls.body = new Roo.Template(
+                      '<table border="0" cellspacing="0" cellpadding="0">',
+                      "<tbody>{rows}</tbody>",
+                      "</table>"
+                   );
+                   tpls.body.disableFormats = true;
+               }
+               tpls.body.compile();
+
+               if(!tpls.row){
+                   tpls.row = new Roo.Template('<tr class="x-grid-row {alt}">{cells}</tr>');
+                   tpls.row.disableFormats = true;
+               }
+               tpls.row.compile();
+
+               if(!tpls.cell){
+                   tpls.cell = new Roo.Template(
+                       '<td class="x-grid-col x-grid-td-{id} {cellId} {css}" tabIndex="0">',
+                       '<div class="x-grid-col-{id} x-grid-cell-inner"><div class="x-grid-cell-text" unselectable="on" {attr}>{value}</div></div>',
+                       "</td>"
+                   );
+            tpls.cell.disableFormats = true;
+        }
+               tpls.cell.compile();
+
+               this.templates = tpls;
+       },
+
+       // remap these for backwards compat
+    onColWidthChange : function(){
+        this.updateColumns.apply(this, arguments);
+    },
+    onHeaderChange : function(){
+        this.updateHeaders.apply(this, arguments);
+    }, 
+    onHiddenChange : function(){
+        this.handleHiddenChange.apply(this, arguments);
+    },
+    onColumnMove : function(){
+        this.handleColumnMove.apply(this, arguments);
+    },
+    onColumnLock : function(){
+        this.handleLockChange.apply(this, arguments);
+    },
+
+    onDataChange : function(){
+        this.refresh();
+        this.updateHeaderSortState();
+    },
+
+       onClear : function(){
+        this.refresh();
+    },
+
+       onUpdate : function(ds, record){
+        this.refreshRow(record);
+    },
+
+    refreshRow : function(record){
+        var ds = this.ds, index;
+        if(typeof record == 'number'){
+            index = record;
+            record = ds.getAt(index);
+        }else{
+            index = ds.indexOf(record);
+        }
+        this.insertRows(ds, index, index, true);
+        this.onRemove(ds, record, index+1, true);
+        this.syncRowHeights(index, index);
+        this.layout();
+        this.fireEvent("rowupdated", this, index, record);
+    },
+
+    onAdd : function(ds, records, index){
+        this.insertRows(ds, index, index + (records.length-1));
+    },
+
+    onRemove : function(ds, record, index, isUpdate){
+        if(isUpdate !== true){
+            this.fireEvent("beforerowremoved", this, index, record);
+        }
+        var bt = this.getBodyTable(), lt = this.getLockedTable();
+        if(bt.rows[index]){
+            bt.firstChild.removeChild(bt.rows[index]);
+        }
+        if(lt.rows[index]){
+            lt.firstChild.removeChild(lt.rows[index]);
+        }
+        if(isUpdate !== true){
+            this.stripeRows(index);
+            this.syncRowHeights(index, index);
+            this.layout();
+            this.fireEvent("rowremoved", this, index, record);
+        }
+    },
+
+    onLoad : function(){
+        this.scrollToTop();
+    },
+
+    /**
+     * Scrolls the grid to the top
+     */
+    scrollToTop : function(){
+        if(this.scroller){
+            this.scroller.dom.scrollTop = 0;
+            this.syncScroll();
+        }
+    },
+
+    /**
+     * Gets a panel in the header of the grid that can be used for toolbars etc.
+     * After modifying the contents of this panel a call to grid.autoSize() may be
+     * required to register any changes in size.
+     * @param {Boolean} doShow By default the header is hidden. Pass true to show the panel
+     * @return Roo.Element
+     */
+    getHeaderPanel : function(doShow){
+        if(doShow){
+            this.headerPanel.show();
+        }
+        return this.headerPanel;
+       },
+
+       /**
+     * Gets a panel in the footer of the grid that can be used for toolbars etc.
+     * After modifying the contents of this panel a call to grid.autoSize() may be
+     * required to register any changes in size.
+     * @param {Boolean} doShow By default the footer is hidden. Pass true to show the panel
+     * @return Roo.Element
+     */
+    getFooterPanel : function(doShow){
+        if(doShow){
+            this.footerPanel.show();
+        }
+        return this.footerPanel;
+       },
+
+       initElements : function(){
+           var E = Roo.Element;
+           var el = this.grid.getGridEl().dom.firstChild;
+           var cs = el.childNodes;
+
+           this.el = new E(el);
+           this.headerPanel = new E(el.firstChild);
+           this.headerPanel.enableDisplayMode("block");
+
+        this.scroller = new E(cs[1]);
+           this.scrollSizer = new E(this.scroller.dom.firstChild);
+
+           this.lockedWrap = new E(cs[2]);
+           this.lockedHd = new E(this.lockedWrap.dom.firstChild);
+           this.lockedBody = new E(this.lockedWrap.dom.childNodes[1]);
+
+           this.mainWrap = new E(cs[3]);
+           this.mainHd = new E(this.mainWrap.dom.firstChild);
+           this.mainBody = new E(this.mainWrap.dom.childNodes[1]);
+
+           this.footerPanel = new E(cs[4]);
+           this.footerPanel.enableDisplayMode("block");
+
+        this.focusEl = new E(cs[5]);
+        this.focusEl.swallowEvent("click", true);
+        this.resizeProxy = new E(cs[6]);
+
+           this.headerSelector = String.format(
+              '#{0} td.x-grid-hd, #{1} td.x-grid-hd',
+              this.lockedHd.id, this.mainHd.id
+           );
+
+           this.splitterSelector = String.format(
+              '#{0} div.x-grid-split, #{1} div.x-grid-split',
+              this.lockedHd.id, this.mainHd.id
+           );
+    },
+
+       getHeaderCell : function(index){
+           return Roo.DomQuery.select(this.headerSelector)[index];
+       },
+
+       getHeaderCellMeasure : function(index){
+           return this.getHeaderCell(index).firstChild;
+       },
+
+       getHeaderCellText : function(index){
+           return this.getHeaderCell(index).firstChild.firstChild;
+       },
+
+       getLockedTable : function(){
+           return this.lockedBody.dom.firstChild;
+       },
+
+       getBodyTable : function(){
+           return this.mainBody.dom.firstChild;
+       },
+
+       getLockedRow : function(index){
+           return this.getLockedTable().rows[index];
+       },
+
+       getRow : function(index){
+           return this.getBodyTable().rows[index];
+       },
+
+       getRowComposite : function(index){
+           if(!this.rowEl){
+               this.rowEl = new Roo.CompositeElementLite();
+           }
+        var els = [], lrow, mrow;
+        if(lrow = this.getLockedRow(index)){
+            els.push(lrow);
+        }
+        if(mrow = this.getRow(index)){
+            els.push(mrow);
+        }
+        this.rowEl.elements = els;
+           return this.rowEl;
+       },
+
+       getCell : function(rowIndex, colIndex){
+           var locked = this.cm.getLockedCount();
+           var source;
+           if(colIndex < locked){
+               source = this.lockedBody.dom.firstChild;
+           }else{
+               source = this.mainBody.dom.firstChild;
+               colIndex -= locked;
+           }
+        return source.rows[rowIndex].childNodes[colIndex];
+       },
+
+       getCellText : function(rowIndex, colIndex){
+           return this.getCell(rowIndex, colIndex).firstChild.firstChild;
+       },
+
+       getCellBox : function(cell){
+           var b = this.fly(cell).getBox();
+        if(Roo.isOpera){ // opera fails to report the Y
+            b.y = cell.offsetTop + this.mainBody.getY();
+        }
+        return b;
+    },
+
+    getCellIndex : function(cell){
+        var id = String(cell.className).match(this.cellRE);
+        if(id){
+            return parseInt(id[1], 10);
+        }
+        return 0;
+    },
+
+    findHeaderIndex : function(n){
+        var r = Roo.fly(n).findParent("td." + this.hdClass, 6);
+        return r ? this.getCellIndex(r) : false;
+    },
+
+    findHeaderCell : function(n){
+        var r = Roo.fly(n).findParent("td." + this.hdClass, 6);
+        return r ? r : false;
+    },
+
+    findRowIndex : function(n){
+        if(!n){
+            return false;
+        }
+        var r = Roo.fly(n).findParent("tr." + this.rowClass, 6);
+        return r ? r.rowIndex : false;
+    },
+
+    findCellIndex : function(node){
+        var stop = this.el.dom;
+        while(node && node != stop){
+            if(this.findRE.test(node.className)){
+                return this.getCellIndex(node);
+            }
+            node = node.parentNode;
+        }
+        return false;
+    },
+
+    getColumnId : function(index){
+           return this.cm.getColumnId(index);
+       },
+
+       getSplitters : function(){
+           if(this.splitterSelector){
+              return Roo.DomQuery.select(this.splitterSelector);
+           }else{
+               return null;
+           }
+       },
+
+       getSplitter : function(index){
+           return this.getSplitters()[index];
+       },
+
+    onRowOver : function(e, t){
+        var row;
+        if((row = this.findRowIndex(t)) !== false){
+            this.getRowComposite(row).addClass("x-grid-row-over");
+        }
+    },
+
+    onRowOut : function(e, t){
+        var row;
+        if((row = this.findRowIndex(t)) !== false && row !== this.findRowIndex(e.getRelatedTarget())){
+            this.getRowComposite(row).removeClass("x-grid-row-over");
+        }
+    },
+
+    renderHeaders : function(){
+           var cm = this.cm;
+        var ct = this.templates.hcell, ht = this.templates.header, st = this.templates.hsplit;
+        var cb = [], lb = [], sb = [], lsb = [], p = {};
+        for(var i = 0, len = cm.getColumnCount(); i < len; i++){
+            p.cellId = "x-grid-hd-0-" + i;
+            p.splitId = "x-grid-csplit-0-" + i;
+            p.id = cm.getColumnId(i);
+            p.title = cm.getColumnTooltip(i) || "";
+            p.value = cm.getColumnHeader(i) || "";
+            p.style = (this.grid.enableColumnResize === false || !cm.isResizable(i) || cm.isFixed(i)) ? 'cursor:default' : '';
+            if(!cm.isLocked(i)){
+                cb[cb.length] = ct.apply(p);
+                sb[sb.length] = st.apply(p);
+            }else{
+                lb[lb.length] = ct.apply(p);
+                lsb[lsb.length] = st.apply(p);
+            }
+        }
+        return [ht.apply({cells: lb.join(""), splits:lsb.join("")}),
+                ht.apply({cells: cb.join(""), splits:sb.join("")})];
+       },
+
+       updateHeaders : function(){
+        var html = this.renderHeaders();
+        this.lockedHd.update(html[0]);
+        this.mainHd.update(html[1]);
+    },
+
+    /**
+     * Focuses the specified row.
+     * @param {Number} row The row index
+     */
+    focusRow : function(row){
+        var x = this.scroller.dom.scrollLeft;
+        this.focusCell(row, 0, false);
+        this.scroller.dom.scrollLeft = x;
+    },
+
+    /**
+     * Focuses the specified cell.
+     * @param {Number} row The row index
+     * @param {Number} col The column index
+     * @param {Boolean} hscroll false to disable horizontal scrolling
+     */
+    focusCell : function(row, col, hscroll){
+        var el = this.ensureVisible(row, col, hscroll);
+        this.focusEl.alignTo(el, "tl-tl");
+        if(Roo.isGecko){
+            this.focusEl.focus();
+        }else{
+            this.focusEl.focus.defer(1, this.focusEl);
+        }
+    },
+
+    /**
+     * Scrolls the specified cell into view
+     * @param {Number} row The row index
+     * @param {Number} col The column index
+     * @param {Boolean} hscroll false to disable horizontal scrolling
+     */
+    ensureVisible : function(row, col, hscroll){
+        if(typeof row != "number"){
+            row = row.rowIndex;
+        }
+        if(row < 0 && row >= this.ds.getCount()){
+            return;
+        }
+        col = (col !== undefined ? col : 0);
+        var cm = this.grid.colModel;
+        while(cm.isHidden(col)){
+            col++;
+        }
+
+        var el = this.getCell(row, col);
+        if(!el){
+            return;
+        }
+        var c = this.scroller.dom;
+
+        var ctop = parseInt(el.offsetTop, 10);
+        var cleft = parseInt(el.offsetLeft, 10);
+        var cbot = ctop + el.offsetHeight;
+        var cright = cleft + el.offsetWidth;
+
+        var ch = c.clientHeight - this.mainHd.dom.offsetHeight;
+        var stop = parseInt(c.scrollTop, 10);
+        var sleft = parseInt(c.scrollLeft, 10);
+        var sbot = stop + ch;
+        var sright = sleft + c.clientWidth;
+
+        if(ctop < stop){
+               c.scrollTop = ctop;
+        }else if(cbot > sbot){
+            c.scrollTop = cbot-ch;
+        }
+
+        if(hscroll !== false){
+            if(cleft < sleft){
+                c.scrollLeft = cleft;
+            }else if(cright > sright){
+                c.scrollLeft = cright-c.clientWidth;
+            }
+        }
+        return el;
+    },
+
+    updateColumns : function(){
+        this.grid.stopEditing();
+        var cm = this.grid.colModel, colIds = this.getColumnIds();
+        //var totalWidth = cm.getTotalWidth();
+        var pos = 0;
+        for(var i = 0, len = cm.getColumnCount(); i < len; i++){
+            //if(cm.isHidden(i)) continue;
+            var w = cm.getColumnWidth(i);
+            this.css.updateRule(this.colSelector+colIds[i], "width", (w - this.borderWidth) + "px");
+            this.css.updateRule(this.hdSelector+colIds[i], "width", (w - this.borderWidth) + "px");
+        }
+        this.updateSplitters();
+    },
+
+    generateRules : function(cm){
+        var ruleBuf = [], rulesId = this.grid.id + '-cssrules';
+        Roo.util.CSS.removeStyleSheet(rulesId);
+        for(var i = 0, len = cm.getColumnCount(); i < len; i++){
+            var cid = cm.getColumnId(i);
+            var align = '';
+            if(cm.config[i].align){
+                align = 'text-align:'+cm.config[i].align+';';
+            }
+            var hidden = '';
+            if(cm.isHidden(i)){
+                hidden = 'display:none;';
+            }
+            var width = "width:" + (cm.getColumnWidth(i) - this.borderWidth) + "px;";
+            ruleBuf.push(
+                    this.colSelector, cid, " {\n", cm.config[i].css, align, width, "\n}\n",
+                    this.hdSelector, cid, " {\n", align, width, "}\n",
+                    this.tdSelector, cid, " {\n",hidden,"\n}\n",
+                    this.splitSelector, cid, " {\n", hidden , "\n}\n");
+        }
+        return Roo.util.CSS.createStyleSheet(ruleBuf.join(""), rulesId);
+    },
+
+    updateSplitters : function(){
+        var cm = this.cm, s = this.getSplitters();
+        if(s){ // splitters not created yet
+            var pos = 0, locked = true;
+            for(var i = 0, len = cm.getColumnCount(); i < len; i++){
+                if(cm.isHidden(i)) continue;
+                var w = cm.getColumnWidth(i);
+                if(!cm.isLocked(i) && locked){
+                    pos = 0;
+                    locked = false;
+                }
+                pos += w;
+                s[i].style.left = (pos-this.splitOffset) + "px";
+            }
+        }
+    },
+
+    handleHiddenChange : function(colModel, colIndex, hidden){
+        if(hidden){
+            this.hideColumn(colIndex);
+        }else{
+            this.unhideColumn(colIndex);
+        }
+    },
+
+    hideColumn : function(colIndex){
+        var cid = this.getColumnId(colIndex);
+        this.css.updateRule(this.tdSelector+cid, "display", "none");
+        this.css.updateRule(this.splitSelector+cid, "display", "none");
+        if(Roo.isSafari){
+            this.updateHeaders();
+        }
+        this.updateSplitters();
+        this.layout();
+    },
+
+    unhideColumn : function(colIndex){
+        var cid = this.getColumnId(colIndex);
+        this.css.updateRule(this.tdSelector+cid, "display", "");
+        this.css.updateRule(this.splitSelector+cid, "display", "");
+
+        if(Roo.isSafari){
+            this.updateHeaders();
+        }
+        this.updateSplitters();
+        this.layout();
+    },
+
+    insertRows : function(dm, firstRow, lastRow, isUpdate){
+        if(firstRow == 0 && lastRow == dm.getCount()-1){
+            this.refresh();
+        }else{
+            if(!isUpdate){
+                this.fireEvent("beforerowsinserted", this, firstRow, lastRow);
+            }
+            var s = this.getScrollState();
+            var markup = this.renderRows(firstRow, lastRow);
+            this.bufferRows(markup[0], this.getLockedTable(), firstRow);
+            this.bufferRows(markup[1], this.getBodyTable(), firstRow);
+            this.restoreScroll(s);
+            if(!isUpdate){
+                this.fireEvent("rowsinserted", this, firstRow, lastRow);
+                this.syncRowHeights(firstRow, lastRow);
+                this.stripeRows(firstRow);
+                this.layout();
+            }
+        }
+    },
+
+    bufferRows : function(markup, target, index){
+        var before = null, trows = target.rows, tbody = target.tBodies[0];
+        if(index < trows.length){
+            before = trows[index];
+        }
+        var b = document.createElement("div");
+        b.innerHTML = "<table><tbody>"+markup+"</tbody></table>";
+        var rows = b.firstChild.rows;
+        for(var i = 0, len = rows.length; i < len; i++){
+            if(before){
+                tbody.insertBefore(rows[0], before);
+            }else{
+                tbody.appendChild(rows[0]);
+            }
+        }
+        b.innerHTML = "";
+        b = null;
+    },
+
+    deleteRows : function(dm, firstRow, lastRow){
+        if(dm.getRowCount()<1){
+            this.fireEvent("beforerefresh", this);
+            this.mainBody.update("");
+            this.lockedBody.update("");
+            this.fireEvent("refresh", this);
+        }else{
+            this.fireEvent("beforerowsdeleted", this, firstRow, lastRow);
+            var bt = this.getBodyTable();
+            var tbody = bt.firstChild;
+            var rows = bt.rows;
+            for(var rowIndex = firstRow; rowIndex <= lastRow; rowIndex++){
+                tbody.removeChild(rows[firstRow]);
+            }
+            this.stripeRows(firstRow);
+            this.fireEvent("rowsdeleted", this, firstRow, lastRow);
+        }
+    },
+
+    updateRows : function(dataSource, firstRow, lastRow){
+        var s = this.getScrollState();
+        this.refresh();
+        this.restoreScroll(s);
+    },
+
+    handleSort : function(dataSource, sortColumnIndex, sortDir, noRefresh){
+        if(!noRefresh){
+           this.refresh();
+        }
+        this.updateHeaderSortState();
+    },
+
+    getScrollState : function(){
+        var sb = this.scroller.dom;
+        return {left: sb.scrollLeft, top: sb.scrollTop};
+    },
+
+    stripeRows : function(startRow){
+        if(!this.grid.stripeRows || this.ds.getCount() < 1){
+            return;
+        }
+        startRow = startRow || 0;
+        var rows = this.getBodyTable().rows;
+        var lrows = this.getLockedTable().rows;
+        var cls = ' x-grid-row-alt ';
+        for(var i = startRow, len = rows.length; i < len; i++){
+            var row = rows[i], lrow = lrows[i];
+            var isAlt = ((i+1) % 2 == 0);
+            var hasAlt = (' '+row.className + ' ').indexOf(cls) != -1;
+            if(isAlt == hasAlt){
+                continue;
+            }
+            if(isAlt){
+                row.className += " x-grid-row-alt";
+            }else{
+                row.className = row.className.replace("x-grid-row-alt", "");
+            }
+            if(lrow){
+                lrow.className = row.className;
+            }
+        }
+    },
+
+    restoreScroll : function(state){
+        var sb = this.scroller.dom;
+        sb.scrollLeft = state.left;
+        sb.scrollTop = state.top;
+        this.syncScroll();
+    },
+
+    syncScroll : function(){
+        var sb = this.scroller.dom;
+        var sh = this.mainHd.dom;
+        var bs = this.mainBody.dom;
+        var lv = this.lockedBody.dom;
+        sh.scrollLeft = bs.scrollLeft = sb.scrollLeft;
+        lv.scrollTop = bs.scrollTop = sb.scrollTop;
+    },
+
+    handleScroll : function(e){
+        this.syncScroll();
+        var sb = this.scroller.dom;
+        this.grid.fireEvent("bodyscroll", sb.scrollLeft, sb.scrollTop);
+        e.stopEvent();
+    },
+
+    handleWheel : function(e){
+        var d = e.getWheelDelta();
+        this.scroller.dom.scrollTop -= d*22;
+        // set this here to prevent jumpy scrolling on large tables
+        this.lockedBody.dom.scrollTop = this.mainBody.dom.scrollTop = this.scroller.dom.scrollTop;
+        e.stopEvent();
+    },
+
+    renderRows : function(startRow, endRow){
+        // pull in all the crap needed to render rows
+        var g = this.grid, cm = g.colModel, ds = g.dataSource, stripe = g.stripeRows;
+        var colCount = cm.getColumnCount();
+
+        if(ds.getCount() < 1){
+            return ["", ""];
+        }
+
+        // build a map for all the columns
+        var cs = [];
+        for(var i = 0; i < colCount; i++){
+            var name = cm.getDataIndex(i);
+            cs[i] = {
+                name : typeof name == 'undefined' ? ds.fields.get(i).name : name,
+                renderer : cm.getRenderer(i),
+                id : cm.getColumnId(i),
+                locked : cm.isLocked(i)
+            };
+        }
+
+        startRow = startRow || 0;
+        endRow = typeof endRow == "undefined"? ds.getCount()-1 : endRow;
+
+        // records to render
+        var rs = ds.getRange(startRow, endRow);
+
+        return this.doRender(cs, rs, ds, startRow, colCount, stripe);
+    },
+
+    // As much as I hate to duplicate code, this was branched because FireFox really hates
+    // [].join("") on strings. The performance difference was substantial enough to
+    // branch this function
+    doRender : Roo.isGecko ?
+            function(cs, rs, ds, startRow, colCount, stripe){
+                var ts = this.templates, ct = ts.cell, rt = ts.row;
+                // buffers
+                var buf = "", lbuf = "", cb, lcb, c, p = {}, rp = {}, r, rowIndex;
+                for(var j = 0, len = rs.length; j < len; j++){
+                    r = rs[j]; cb = ""; lcb = ""; rowIndex = (j+startRow);
+                    for(var i = 0; i < colCount; i++){
+                        c = cs[i];
+                        p.cellId = "x-grid-cell-" + rowIndex + "-" + i;
+                        p.id = c.id;
+                        p.css = p.attr = "";
+                        p.value = c.renderer(r.data[c.name], p, r, rowIndex, i, ds);
+                        if(p.value == undefined || p.value === "") p.value = "&#160;";
+                        if(r.dirty && typeof r.modified[c.name] !== 'undefined'){
+                            p.css += p.css ? ' x-grid-dirty-cell' : 'x-grid-dirty-cell';
+                        }
+                        var markup = ct.apply(p);
+                        if(!c.locked){
+                            cb+= markup;
+                        }else{
+                            lcb+= markup;
+                        }
+                    }
+                    var alt = [];
+                    if(stripe && ((rowIndex+1) % 2 == 0)){
+                        alt[0] = "x-grid-row-alt";
+                    }
+                    if(r.dirty){
+                        alt[1] = " x-grid-dirty-row";
+                    }
+                    rp.cells = lcb;
+                    if(this.getRowClass){
+                        alt[2] = this.getRowClass(r, rowIndex);
+                    }
+                    rp.alt = alt.join(" ");
+                    lbuf+= rt.apply(rp);
+                    rp.cells = cb;
+                    buf+=  rt.apply(rp);
+                }
+                return [lbuf, buf];
+            } :
+            function(cs, rs, ds, startRow, colCount, stripe){
+                var ts = this.templates, ct = ts.cell, rt = ts.row;
+                // buffers
+                var buf = [], lbuf = [], cb, lcb, c, p = {}, rp = {}, r, rowIndex;
+                for(var j = 0, len = rs.length; j < len; j++){
+                    r = rs[j]; cb = []; lcb = []; rowIndex = (j+startRow);
+                    for(var i = 0; i < colCount; i++){
+                        c = cs[i];
+                        p.cellId = "x-grid-cell-" + rowIndex + "-" + i;
+                        p.id = c.id;
+                        p.css = p.attr = "";
+                        p.value = c.renderer(r.data[c.name], p, r, rowIndex, i, ds);
+                        if(p.value == undefined || p.value === "") p.value = "&#160;";
+                        if(r.dirty && typeof r.modified[c.name] !== 'undefined'){
+                            p.css += p.css ? ' x-grid-dirty-cell' : 'x-grid-dirty-cell';
+                        }
+                        var markup = ct.apply(p);
+                        if(!c.locked){
+                            cb[cb.length] = markup;
+                        }else{
+                            lcb[lcb.length] = markup;
+                        }
+                    }
+                    var alt = [];
+                    if(stripe && ((rowIndex+1) % 2 == 0)){
+                        alt[0] = "x-grid-row-alt";
+                    }
+                    if(r.dirty){
+                        alt[1] = " x-grid-dirty-row";
+                    }
+                    rp.cells = lcb;
+                    if(this.getRowClass){
+                        alt[2] = this.getRowClass(r, rowIndex);
+                    }
+                    rp.alt = alt.join(" ");
+                    rp.cells = lcb.join("");
+                    lbuf[lbuf.length] = rt.apply(rp);
+                    rp.cells = cb.join("");
+                    buf[buf.length] =  rt.apply(rp);
+                }
+                return [lbuf.join(""), buf.join("")];
+            },
+
+    renderBody : function(){
+        var markup = this.renderRows();
+        var bt = this.templates.body;
+        return [bt.apply({rows: markup[0]}), bt.apply({rows: markup[1]})];
+    },
+
+    /**
+     * Refreshes the grid
+     * @param {Boolean} headersToo
+     */
+    refresh : function(headersToo){
+        this.fireEvent("beforerefresh", this);
+        this.grid.stopEditing();
+        var result = this.renderBody();
+        this.lockedBody.update(result[0]);
+        this.mainBody.update(result[1]);
+        if(headersToo === true){
+            this.updateHeaders();
+            this.updateColumns();
+            this.updateSplitters();
+            this.updateHeaderSortState();
+        }
+        this.syncRowHeights();
+        this.layout();
+        this.fireEvent("refresh", this);
+    },
+
+    handleColumnMove : function(cm, oldIndex, newIndex){
+        this.indexMap = null;
+        var s = this.getScrollState();
+        this.refresh(true);
+        this.restoreScroll(s);
+        this.afterMove(newIndex);
+    },
+
+    afterMove : function(colIndex){
+        if(this.enableMoveAnim && Roo.enableFx){
+            this.fly(this.getHeaderCell(colIndex).firstChild).highlight(this.hlColor);
+        }
+    },
+
+    updateCell : function(dm, rowIndex, dataIndex){
+        var colIndex = this.getColumnIndexByDataIndex(dataIndex);
+        if(typeof colIndex == "undefined"){ // not present in grid
+            return;
+        }
+        var cm = this.grid.colModel;
+        var cell = this.getCell(rowIndex, colIndex);
+        var cellText = this.getCellText(rowIndex, colIndex);
+
+        var p = {
+            cellId : "x-grid-cell-" + rowIndex + "-" + colIndex,
+            id : cm.getColumnId(colIndex),
+            css: colIndex == cm.getColumnCount()-1 ? "x-grid-col-last" : ""
+        };
+        var renderer = cm.getRenderer(colIndex);
+        var val = renderer(dm.getValueAt(rowIndex, dataIndex), p, rowIndex, colIndex, dm);
+        if(typeof val == "undefined" || val === "") val = "&#160;";
+        cellText.innerHTML = val;
+        cell.className = this.cellClass + " " + p.cellId + " " + p.css;
+        this.syncRowHeights(rowIndex, rowIndex);
+    },
+
+    calcColumnWidth : function(colIndex, maxRowsToMeasure){
+        var maxWidth = 0;
+        if(this.grid.autoSizeHeaders){
+            var h = this.getHeaderCellMeasure(colIndex);
+            maxWidth = Math.max(maxWidth, h.scrollWidth);
+        }
+        var tb, index;
+        if(this.cm.isLocked(colIndex)){
+            tb = this.getLockedTable();
+            index = colIndex;
+        }else{
+            tb = this.getBodyTable();
+            index = colIndex - this.cm.getLockedCount();
+        }
+        if(tb && tb.rows){
+            var rows = tb.rows;
+            var stopIndex = Math.min(maxRowsToMeasure || rows.length, rows.length);
+            for(var i = 0; i < stopIndex; i++){
+                var cell = rows[i].childNodes[index].firstChild;
+                maxWidth = Math.max(maxWidth, cell.scrollWidth);
+            }
+        }
+        return maxWidth + /*margin for error in IE*/ 5;
+    },
+    /**
+     * Autofit a column to its content.
+     * @param {Number} colIndex
+     * @param {Boolean} forceMinSize true to force the column to go smaller if possible
+     */
+     autoSizeColumn : function(colIndex, forceMinSize, suppressEvent){
+         if(this.cm.isHidden(colIndex)){
+             return; // can't calc a hidden column
+         }
+        if(forceMinSize){
+            var cid = this.cm.getColumnId(colIndex);
+            this.css.updateRule(this.colSelector + cid, "width", this.grid.minColumnWidth + "px");
+           if(this.grid.autoSizeHeaders){
+               this.css.updateRule(this.hdSelector + cid, "width", this.grid.minColumnWidth + "px");
+           }
+        }
+        var newWidth = this.calcColumnWidth(colIndex);
+        this.cm.setColumnWidth(colIndex,
+            Math.max(this.grid.minColumnWidth, newWidth), suppressEvent);
+        if(!suppressEvent){
+            this.grid.fireEvent("columnresize", colIndex, newWidth);
+        }
+    },
+
+    /**
+     * Autofits all columns to their content and then expands to fit any extra space in the grid
+     */
+     autoSizeColumns : function(){
+        var cm = this.grid.colModel;
+        var colCount = cm.getColumnCount();
+        for(var i = 0; i < colCount; i++){
+            this.autoSizeColumn(i, true, true);
+        }
+        if(cm.getTotalWidth() < this.scroller.dom.clientWidth){
+            this.fitColumns();
+        }else{
+            this.updateColumns();
+            this.layout();
+        }
+    },
+
+    /**
+     * Autofits all columns to the grid's width proportionate with their current size
+     * @param {Boolean} reserveScrollSpace Reserve space for a scrollbar
+     */
+    fitColumns : function(reserveScrollSpace){
+        var cm = this.grid.colModel;
+        var colCount = cm.getColumnCount();
+        var cols = [];
+        var width = 0;
+        var i, w;
+        for (i = 0; i < colCount; i++){
+            if(!cm.isHidden(i) && !cm.isFixed(i)){
+                w = cm.getColumnWidth(i);
+                cols.push(i);
+                cols.push(w);
+                width += w;
+            }
+        }
+        var avail = Math.min(this.scroller.dom.clientWidth, this.el.getWidth());
+        if(reserveScrollSpace){
+            avail -= 17;
+        }
+        var frac = (avail - cm.getTotalWidth())/width;
+        while (cols.length){
+            w = cols.pop();
+            i = cols.pop();
+            cm.setColumnWidth(i, Math.floor(w + w*frac), true);
+        }
+        this.updateColumns();
+        this.layout();
+    },
+
+    onRowSelect : function(rowIndex){
+        var row = this.getRowComposite(rowIndex);
+        row.addClass("x-grid-row-selected");
+    },
+
+    onRowDeselect : function(rowIndex){
+        var row = this.getRowComposite(rowIndex);
+        row.removeClass("x-grid-row-selected");
+    },
+
+    onCellSelect : function(row, col){
+        var cell = this.getCell(row, col);
+        if(cell){
+            Roo.fly(cell).addClass("x-grid-cell-selected");
+        }
+    },
+
+    onCellDeselect : function(row, col){
+        var cell = this.getCell(row, col);
+        if(cell){
+            Roo.fly(cell).removeClass("x-grid-cell-selected");
+        }
+    },
+
+    updateHeaderSortState : function(){
+        var state = this.ds.getSortState();
+        if(!state){
+            return;
+        }
+        this.sortState = state;
+        var sortColumn = this.cm.findColumnIndex(state.field);
+        if(sortColumn != -1){
+            var sortDir = state.direction;
+            var sc = this.sortClasses;
+            var hds = this.el.select(this.headerSelector).removeClass(sc);
+            hds.item(sortColumn).addClass(sc[sortDir == "DESC" ? 1 : 0]);
+        }
+    },
+
+    handleHeaderClick : function(g, index){
+        if(this.headersDisabled){
+            return;
+        }
+        var dm = g.dataSource, cm = g.colModel;
+           if(!cm.isSortable(index)){
+            return;
+        }
+           g.stopEditing();
+        dm.sort(cm.getDataIndex(index));
+    },
+
+
+    destroy : function(){
+        if(this.colMenu){
+            this.colMenu.removeAll();
+            Roo.menu.MenuMgr.unregister(this.colMenu);
+            this.colMenu.getEl().remove();
+            delete this.colMenu;
+        }
+        if(this.hmenu){
+            this.hmenu.removeAll();
+            Roo.menu.MenuMgr.unregister(this.hmenu);
+            this.hmenu.getEl().remove();
+            delete this.hmenu;
+        }
+        if(this.grid.enableColumnMove){
+            var dds = Roo.dd.DDM.ids['gridHeader' + this.grid.getGridEl().id];
+            if(dds){
+                for(var dd in dds){
+                    if(!dds[dd].config.isTarget && dds[dd].dragElId){
+                        var elid = dds[dd].dragElId;
+                        dds[dd].unreg();
+                        Roo.get(elid).remove();
+                    } else if(dds[dd].config.isTarget){
+                        dds[dd].proxyTop.remove();
+                        dds[dd].proxyBottom.remove();
+                        dds[dd].unreg();
+                    }
+                    if(Roo.dd.DDM.locationCache[dd]){
+                        delete Roo.dd.DDM.locationCache[dd];
+                    }
+                }
+                delete Roo.dd.DDM.ids['gridHeader' + this.grid.getGridEl().id];
+            }
+        }
+        Roo.util.CSS.removeStyleSheet(this.grid.id + '-cssrules');
+        this.bind(null, null);
+        Roo.EventManager.removeResizeListener(this.onWindowResize, this);
+    },
+
+    handleLockChange : function(){
+        this.refresh(true);
+    },
+
+    onDenyColumnLock : function(){
+
+    },
+
+    onDenyColumnHide : function(){
+
+    },
+
+    handleHdMenuClick : function(item){
+        var index = this.hdCtxIndex;
+        var cm = this.cm, ds = this.ds;
+        switch(item.id){
+            case "asc":
+                ds.sort(cm.getDataIndex(index), "ASC");
+                break;
+            case "desc":
+                ds.sort(cm.getDataIndex(index), "DESC");
+                break;
+            case "lock":
+                var lc = cm.getLockedCount();
+                if(cm.getColumnCount(true) <= lc+1){
+                    this.onDenyColumnLock();
+                    return;
+                }
+                if(lc != index){
+                    cm.setLocked(index, true, true);
+                    cm.moveColumn(index, lc);
+                    this.grid.fireEvent("columnmove", index, lc);
+                }else{
+                    cm.setLocked(index, true);
+                }
+            break;
+            case "unlock":
+                var lc = cm.getLockedCount();
+                if((lc-1) != index){
+                    cm.setLocked(index, false, true);
+                    cm.moveColumn(index, lc-1);
+                    this.grid.fireEvent("columnmove", index, lc-1);
+                }else{
+                    cm.setLocked(index, false);
+                }
+            break;
+            default:
+                index = cm.getIndexById(item.id.substr(4));
+                if(index != -1){
+                    if(item.checked && cm.getColumnCount(true) <= 1){
+                        this.onDenyColumnHide();
+                        return false;
+                    }
+                    cm.setHidden(index, item.checked);
+                }
+        }
+        return true;
+    },
+
+    beforeColMenuShow : function(){
+        var cm = this.cm,  colCount = cm.getColumnCount();
+        this.colMenu.removeAll();
+        for(var i = 0; i < colCount; i++){
+            this.colMenu.add(new Roo.menu.CheckItem({
+                id: "col-"+cm.getColumnId(i),
+                text: cm.getColumnHeader(i),
+                checked: !cm.isHidden(i),
+                hideOnClick:false
+            }));
+        }
+    },
+
+    handleHdCtx : function(g, index, e){
+        e.stopEvent();
+        var hd = this.getHeaderCell(index);
+        this.hdCtxIndex = index;
+        var ms = this.hmenu.items, cm = this.cm;
+        ms.get("asc").setDisabled(!cm.isSortable(index));
+        ms.get("desc").setDisabled(!cm.isSortable(index));
+        if(this.grid.enableColLock !== false){
+            ms.get("lock").setDisabled(cm.isLocked(index));
+            ms.get("unlock").setDisabled(!cm.isLocked(index));
+        }
+        this.hmenu.show(hd, "tl-bl");
+    },
+
+    handleHdOver : function(e){
+        var hd = this.findHeaderCell(e.getTarget());
+        if(hd && !this.headersDisabled){
+            if(this.grid.colModel.isSortable(this.getCellIndex(hd))){
+               this.fly(hd).addClass("x-grid-hd-over");
+            }
+        }
+    },
+
+    handleHdOut : function(e){
+        var hd = this.findHeaderCell(e.getTarget());
+        if(hd){
+            this.fly(hd).removeClass("x-grid-hd-over");
+        }
+    },
+
+    handleSplitDblClick : function(e, t){
+        var i = this.getCellIndex(t);
+        if(this.grid.enableColumnResize !== false && this.cm.isResizable(i) && !this.cm.isFixed(i)){
+            this.autoSizeColumn(i, true);
+            this.layout();
+        }
+    },
+
+    render : function(){
+
+        var cm = this.cm;
+        var colCount = cm.getColumnCount();
+
+        if(this.grid.monitorWindowResize === true){
+            Roo.EventManager.onWindowResize(this.onWindowResize, this, true);
+        }
+        var header = this.renderHeaders();
+        var body = this.templates.body.apply({rows:""});
+        var html = this.templates.master.apply({
+            lockedBody: body,
+            body: body,
+            lockedHeader: header[0],
+            header: header[1]
+        });
+
+        //this.updateColumns();
+
+        this.grid.getGridEl().dom.innerHTML = html;
+
+        this.initElements();
+
+        this.scroller.on("scroll", this.handleScroll, this);
+        this.lockedBody.on("mousewheel", this.handleWheel, this);
+        this.mainBody.on("mousewheel", this.handleWheel, this);
+
+        this.mainHd.on("mouseover", this.handleHdOver, this);
+        this.mainHd.on("mouseout", this.handleHdOut, this);
+        this.mainHd.on("dblclick", this.handleSplitDblClick, this,
+                {delegate: "."+this.splitClass});
+
+        this.lockedHd.on("mouseover", this.handleHdOver, this);
+        this.lockedHd.on("mouseout", this.handleHdOut, this);
+        this.lockedHd.on("dblclick", this.handleSplitDblClick, this,
+                {delegate: "."+this.splitClass});
+
+        if(this.grid.enableColumnResize !== false && Roo.grid.SplitDragZone){
+            new Roo.grid.SplitDragZone(this.grid, this.lockedHd.dom, this.mainHd.dom);
+        }
+
+        this.updateSplitters();
+
+        if(this.grid.enableColumnMove && Roo.grid.HeaderDragZone){
+            new Roo.grid.HeaderDragZone(this.grid, this.lockedHd.dom, this.mainHd.dom);
+            new Roo.grid.HeaderDropZone(this.grid, this.lockedHd.dom, this.mainHd.dom);
+        }
+
+        if(this.grid.enableCtxMenu !== false && Roo.menu.Menu){
+            this.hmenu = new Roo.menu.Menu({id: this.grid.id + "-hctx"});
+            this.hmenu.add(
+                {id:"asc", text: this.sortAscText, cls: "xg-hmenu-sort-asc"},
+                {id:"desc", text: this.sortDescText, cls: "xg-hmenu-sort-desc"}
+            );
+            if(this.grid.enableColLock !== false){
+                this.hmenu.add('-',
+                    {id:"lock", text: this.lockText, cls: "xg-hmenu-lock"},
+                    {id:"unlock", text: this.unlockText, cls: "xg-hmenu-unlock"}
+                );
+            }
+            if(this.grid.enableColumnHide !== false){
+
+                this.colMenu = new Roo.menu.Menu({id:this.grid.id + "-hcols-menu"});
+                this.colMenu.on("beforeshow", this.beforeColMenuShow, this);
+                this.colMenu.on("itemclick", this.handleHdMenuClick, this);
+
+                this.hmenu.add('-',
+                    {id:"columns", text: this.columnsText, menu: this.colMenu}
+                );
+            }
+            this.hmenu.on("itemclick", this.handleHdMenuClick, this);
+
+            this.grid.on("headercontextmenu", this.handleHdCtx, this);
+        }
+
+        if((this.grid.enableDragDrop || this.grid.enableDrag) && Roo.grid.GridDragZone){
+            this.dd = new Roo.grid.GridDragZone(this.grid, {
+                ddGroup : this.grid.ddGroup || 'GridDD'
+            });
+        }
+
+        /*
+        for(var i = 0; i < colCount; i++){
+            if(cm.isHidden(i)){
+                this.hideColumn(i);
+            }
+            if(cm.config[i].align){
+                this.css.updateRule(this.colSelector + i, "textAlign", cm.config[i].align);
+                this.css.updateRule(this.hdSelector + i, "textAlign", cm.config[i].align);
+            }
+        }*/
+        
+        this.updateHeaderSortState();
+
+        this.beforeInitialResize();
+        this.layout(true);
+
+        // two part rendering gives faster view to the user
+        this.renderPhase2.defer(1, this);
+    },
+
+    renderPhase2 : function(){
+        // render the rows now
+        this.refresh();
+        if(this.grid.autoSizeColumns){
+            this.autoSizeColumns();
+        }
+    },
+
+    beforeInitialResize : function(){
+
+    },
+
+    onColumnSplitterMoved : function(i, w){
+        this.userResized = true;
+        var cm = this.grid.colModel;
+        cm.setColumnWidth(i, w, true);
+        var cid = cm.getColumnId(i);
+        this.css.updateRule(this.colSelector + cid, "width", (w-this.borderWidth) + "px");
+        this.css.updateRule(this.hdSelector + cid, "width", (w-this.borderWidth) + "px");
+        this.updateSplitters();
+        this.layout();
+        this.grid.fireEvent("columnresize", i, w);
+    },
+
+    syncRowHeights : function(startIndex, endIndex){
+        if(this.grid.enableRowHeightSync === true && this.cm.getLockedCount() > 0){
+            startIndex = startIndex || 0;
+            var mrows = this.getBodyTable().rows;
+            var lrows = this.getLockedTable().rows;
+            var len = mrows.length-1;
+            endIndex = Math.min(endIndex || len, len);
+            for(var i = startIndex; i <= endIndex; i++){
+                var m = mrows[i], l = lrows[i];
+                var h = Math.max(m.offsetHeight, l.offsetHeight);
+                m.style.height = l.style.height = h + "px";
+            }
+        }
+    },
+
+    layout : function(initialRender, is2ndPass){
+        var g = this.grid;
+        var auto = g.autoHeight;
+        var scrollOffset = 16;
+        var c = g.getGridEl(), cm = this.cm,
+                expandCol = g.autoExpandColumn,
+                gv = this;
+        //c.beginMeasure();
+
+        if(!c.dom.offsetWidth){ // display:none?
+            if(initialRender){
+                this.lockedWrap.show();
+                this.mainWrap.show();
+            }
+            return;
+        }
+
+        var hasLock = this.cm.isLocked(0);
+
+        var tbh = this.headerPanel.getHeight();
+        var bbh = this.footerPanel.getHeight();
+
+        if(auto){
+            var ch = this.getBodyTable().offsetHeight + tbh + bbh + this.mainHd.getHeight();
+            var newHeight = ch + c.getBorderWidth("tb");
+            if(g.maxHeight){
+                newHeight = Math.min(g.maxHeight, newHeight);
+            }
+            c.setHeight(newHeight);
+        }
+
+        if(g.autoWidth){
+            c.setWidth(cm.getTotalWidth()+c.getBorderWidth('lr'));
+        }
+
+        var s = this.scroller;
+
+        var csize = c.getSize(true);
+
+        this.el.setSize(csize.width, csize.height);
+
+        this.headerPanel.setWidth(csize.width);
+        this.footerPanel.setWidth(csize.width);
+
+        var hdHeight = this.mainHd.getHeight();
+        var vw = csize.width;
+        var vh = csize.height - (tbh + bbh);
+
+        s.setSize(vw, vh);
+
+        var bt = this.getBodyTable();
+        var ltWidth = hasLock ?
+                      Math.max(this.getLockedTable().offsetWidth, this.lockedHd.dom.firstChild.offsetWidth) : 0;
+
+        var scrollHeight = bt.offsetHeight;
+        var scrollWidth = ltWidth + bt.offsetWidth;
+        var vscroll = false, hscroll = false;
+
+        this.scrollSizer.setSize(scrollWidth, scrollHeight+hdHeight);
+
+        var lw = this.lockedWrap, mw = this.mainWrap;
+        var lb = this.lockedBody, mb = this.mainBody;
+
+        setTimeout(function(){
+            var t = s.dom.offsetTop;
+            var w = s.dom.clientWidth,
+                h = s.dom.clientHeight;
+
+            lw.setTop(t);
+            lw.setSize(ltWidth, h);
+
+            mw.setLeftTop(ltWidth, t);
+            mw.setSize(w-ltWidth, h);
+
+            lb.setHeight(h-hdHeight);
+            mb.setHeight(h-hdHeight);
+
+            if(is2ndPass !== true && !gv.userResized && expandCol){
+                // high speed resize without full column calculation
+                
+                var ci = cm.getIndexById(expandCol);
+                if (ci < 0) {
+                    ci = cm.findColumnIndex(expandCol);
+                }
+                ci = Math.max(0, ci); // make sure it's got at least the first col.
+                var expandId = cm.getColumnId(ci);
+                var  tw = cm.getTotalWidth(false);
+                var currentWidth = cm.getColumnWidth(ci);
+                var cw = Math.min(Math.max(((w-tw)+currentWidth-2)-/*scrollbar*/(w <= s.dom.offsetWidth ? 0 : 18), g.autoExpandMin), g.autoExpandMax);
+                if(currentWidth != cw){
+                    cm.setColumnWidth(ci, cw, true);
+                    gv.css.updateRule(gv.colSelector+expandId, "width", (cw - gv.borderWidth) + "px");
+                    gv.css.updateRule(gv.hdSelector+expandId, "width", (cw - gv.borderWidth) + "px");
+                    gv.updateSplitters();
+                    gv.layout(false, true);
+                }
+            }
+
+            if(initialRender){
+                lw.show();
+                mw.show();
+            }
+            //c.endMeasure();
+        }, 10);
+    },
+
+    onWindowResize : function(){
+        if(!this.grid.monitorWindowResize || this.grid.autoHeight){
+            return;
+        }
+        this.layout();
+    },
+
+    appendFooter : function(parentEl){
+        return null;
+    },
+
+    sortAscText : "Sort Ascending",
+    sortDescText : "Sort Descending",
+    lockText : "Lock Column",
+    unlockText : "Unlock Column",
+    columnsText : "Columns"
+});
+
+
+Roo.grid.GridView.ColumnDragZone = function(grid, hd){
+    Roo.grid.GridView.ColumnDragZone.superclass.constructor.call(this, grid, hd, null);
+    this.proxy.el.addClass('x-grid3-col-dd');
+};
+
+Roo.extend(Roo.grid.GridView.ColumnDragZone, Roo.grid.HeaderDragZone, {
+    handleMouseDown : function(e){
+
+    },
+
+    callHandleMouseDown : function(e){
+        Roo.grid.GridView.ColumnDragZone.superclass.handleMouseDown.call(this, e);
+    }
+});
diff --git a/Roo/grid/HeaderDragZone.js b/Roo/grid/HeaderDragZone.js
new file mode 100644 (file)
index 0000000..a75440a
--- /dev/null
@@ -0,0 +1,58 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+
+// private
+// This is a support class used internally by the Grid components
+Roo.grid.HeaderDragZone = function(grid, hd, hd2){
+    this.grid = grid;
+    this.view = grid.getView();
+    this.ddGroup = "gridHeader" + this.grid.getGridEl().id;
+    Roo.grid.HeaderDragZone.superclass.constructor.call(this, hd);
+    if(hd2){
+        this.setHandleElId(Roo.id(hd));
+        this.setOuterHandleElId(Roo.id(hd2));
+    }
+    this.scroll = false;
+};
+Roo.extend(Roo.grid.HeaderDragZone, Roo.dd.DragZone, {
+    maxDragWidth: 120,
+    getDragData : function(e){
+        var t = Roo.lib.Event.getTarget(e);
+        var h = this.view.findHeaderCell(t);
+        if(h){
+            return {ddel: h.firstChild, header:h};
+        }
+        return false;
+    },
+
+    onInitDrag : function(e){
+        this.view.headersDisabled = true;
+        var clone = this.dragData.ddel.cloneNode(true);
+        clone.id = Roo.id();
+        clone.style.width = Math.min(this.dragData.header.offsetWidth,this.maxDragWidth) + "px";
+        this.proxy.update(clone);
+        return true;
+    },
+
+    afterValidDrop : function(){
+        var v = this.view;
+        setTimeout(function(){
+            v.headersDisabled = false;
+        }, 50);
+    },
+
+    afterInvalidDrop : function(){
+        var v = this.view;
+        setTimeout(function(){
+            v.headersDisabled = false;
+        }, 50);
+    }
+});
diff --git a/Roo/grid/HeaderDropZone.js b/Roo/grid/HeaderDropZone.js
new file mode 100644 (file)
index 0000000..12b1028
--- /dev/null
@@ -0,0 +1,157 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+// private
+// This is a support class used internally by the Grid components
+Roo.grid.HeaderDropZone = function(grid, hd, hd2){
+    this.grid = grid;
+    this.view = grid.getView();
+    // split the proxies so they don't interfere with mouse events
+    this.proxyTop = Roo.DomHelper.append(document.body, {
+        cls:"col-move-top", html:"&#160;"
+    }, true);
+    this.proxyBottom = Roo.DomHelper.append(document.body, {
+        cls:"col-move-bottom", html:"&#160;"
+    }, true);
+    this.proxyTop.hide = this.proxyBottom.hide = function(){
+        this.setLeftTop(-100,-100);
+        this.setStyle("visibility", "hidden");
+    };
+    this.ddGroup = "gridHeader" + this.grid.getGridEl().id;
+    // temporarily disabled
+    //Roo.dd.ScrollManager.register(this.view.scroller.dom);
+    Roo.grid.HeaderDropZone.superclass.constructor.call(this, grid.getGridEl().dom);
+};
+Roo.extend(Roo.grid.HeaderDropZone, Roo.dd.DropZone, {
+    proxyOffsets : [-4, -9],
+    fly: Roo.Element.fly,
+
+    getTargetFromEvent : function(e){
+        var t = Roo.lib.Event.getTarget(e);
+        var cindex = this.view.findCellIndex(t);
+        if(cindex !== false){
+            return this.view.getHeaderCell(cindex);
+        }
+    },
+
+    nextVisible : function(h){
+        var v = this.view, cm = this.grid.colModel;
+        h = h.nextSibling;
+        while(h){
+            if(!cm.isHidden(v.getCellIndex(h))){
+                return h;
+            }
+            h = h.nextSibling;
+        }
+        return null;
+    },
+
+    prevVisible : function(h){
+        var v = this.view, cm = this.grid.colModel;
+        h = h.prevSibling;
+        while(h){
+            if(!cm.isHidden(v.getCellIndex(h))){
+                return h;
+            }
+            h = h.prevSibling;
+        }
+        return null;
+    },
+
+    positionIndicator : function(h, n, e){
+        var x = Roo.lib.Event.getPageX(e);
+        var r = Roo.lib.Dom.getRegion(n.firstChild);
+        var px, pt, py = r.top + this.proxyOffsets[1];
+        if((r.right - x) <= (r.right-r.left)/2){
+            px = r.right+this.view.borderWidth;
+            pt = "after";
+        }else{
+            px = r.left;
+            pt = "before";
+        }
+        var oldIndex = this.view.getCellIndex(h);
+        var newIndex = this.view.getCellIndex(n);
+
+        if(this.grid.colModel.isFixed(newIndex)){
+            return false;
+        }
+
+        var locked = this.grid.colModel.isLocked(newIndex);
+
+        if(pt == "after"){
+            newIndex++;
+        }
+        if(oldIndex < newIndex){
+            newIndex--;
+        }
+        if(oldIndex == newIndex && (locked == this.grid.colModel.isLocked(oldIndex))){
+            return false;
+        }
+        px +=  this.proxyOffsets[0];
+        this.proxyTop.setLeftTop(px, py);
+        this.proxyTop.show();
+        if(!this.bottomOffset){
+            this.bottomOffset = this.view.mainHd.getHeight();
+        }
+        this.proxyBottom.setLeftTop(px, py+this.proxyTop.dom.offsetHeight+this.bottomOffset);
+        this.proxyBottom.show();
+        return pt;
+    },
+
+    onNodeEnter : function(n, dd, e, data){
+        if(data.header != n){
+            this.positionIndicator(data.header, n, e);
+        }
+    },
+
+    onNodeOver : function(n, dd, e, data){
+        var result = false;
+        if(data.header != n){
+            result = this.positionIndicator(data.header, n, e);
+        }
+        if(!result){
+            this.proxyTop.hide();
+            this.proxyBottom.hide();
+        }
+        return result ? this.dropAllowed : this.dropNotAllowed;
+    },
+
+    onNodeOut : function(n, dd, e, data){
+        this.proxyTop.hide();
+        this.proxyBottom.hide();
+    },
+
+    onNodeDrop : function(n, dd, e, data){
+        var h = data.header;
+        if(h != n){
+            var cm = this.grid.colModel;
+            var x = Roo.lib.Event.getPageX(e);
+            var r = Roo.lib.Dom.getRegion(n.firstChild);
+            var pt = (r.right - x) <= ((r.right-r.left)/2) ? "after" : "before";
+            var oldIndex = this.view.getCellIndex(h);
+            var newIndex = this.view.getCellIndex(n);
+            var locked = cm.isLocked(newIndex);
+            if(pt == "after"){
+                newIndex++;
+            }
+            if(oldIndex < newIndex){
+                newIndex--;
+            }
+            if(oldIndex == newIndex && (locked == cm.isLocked(oldIndex))){
+                return false;
+            }
+            cm.setLocked(oldIndex, locked, true);
+            cm.moveColumn(oldIndex, newIndex);
+            this.grid.fireEvent("columnmove", oldIndex, newIndex);
+            return true;
+        }
+        return false;
+    }
+});
diff --git a/Roo/grid/PropertyGrid.js b/Roo/grid/PropertyGrid.js
new file mode 100644 (file)
index 0000000..5343cd2
--- /dev/null
@@ -0,0 +1,280 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+  
+
+  
+Roo.grid.PropertyRecord = Roo.data.Record.create([
+    {name:'name',type:'string'},  'value'
+]);
+
+
+Roo.grid.PropertyStore = function(grid, source){
+    this.grid = grid;
+    this.store = new Roo.data.Store({
+        recordType : Roo.grid.PropertyRecord
+    });
+    this.store.on('update', this.onUpdate,  this);
+    if(source){
+        this.setSource(source);
+    }
+    Roo.grid.PropertyStore.superclass.constructor.call(this);
+};
+
+
+
+Roo.extend(Roo.grid.PropertyStore, Roo.util.Observable, {
+    setSource : function(o){
+        this.source = o;
+        this.store.removeAll();
+        var data = [];
+        for(var k in o){
+            if(this.isEditableValue(o[k])){
+                data.push(new Roo.grid.PropertyRecord({name: k, value: o[k]}, k));
+            }
+        }
+        this.store.loadRecords({records: data}, {}, true);
+    },
+
+    onUpdate : function(ds, record, type){
+        if(type == Roo.data.Record.EDIT){
+            var v = record.data['value'];
+            var oldValue = record.modified['value'];
+            if(this.grid.fireEvent('beforepropertychange', this.source, record.id, v, oldValue) !== false){
+                this.source[record.id] = v;
+                record.commit();
+                this.grid.fireEvent('propertychange', this.source, record.id, v, oldValue);
+            }else{
+                record.reject();
+            }
+        }
+    },
+
+    getProperty : function(row){
+       return this.store.getAt(row);
+    },
+
+    isEditableValue: function(val){
+        if(val && val instanceof Date){
+            return true;
+        }else if(typeof val == 'object' || typeof val == 'function'){
+            return false;
+        }
+        return true;
+    },
+
+    setValue : function(prop, value){
+        this.source[prop] = value;
+        this.store.getById(prop).set('value', value);
+    },
+
+    getSource : function(){
+        return this.source;
+    }
+});
+
+Roo.grid.PropertyColumnModel = function(grid, store){
+    this.grid = grid;
+    var g = Roo.grid;
+    g.PropertyColumnModel.superclass.constructor.call(this, [
+        {header: this.nameText, sortable: true, dataIndex:'name', id: 'name'},
+        {header: this.valueText, resizable:false, dataIndex: 'value', id: 'value'}
+    ]);
+    this.store = store;
+    this.bselect = Roo.DomHelper.append(document.body, {
+        tag: 'select', style:'display:none', cls: 'x-grid-editor', children: [
+            {tag: 'option', value: 'true', html: 'true'},
+            {tag: 'option', value: 'false', html: 'false'}
+        ]
+    });
+    Roo.id(this.bselect);
+    var f = Roo.form;
+    this.editors = {
+        'date' : new g.GridEditor(new f.DateField({selectOnFocus:true})),
+        'string' : new g.GridEditor(new f.TextField({selectOnFocus:true})),
+        'number' : new g.GridEditor(new f.NumberField({selectOnFocus:true, style:'text-align:left;'})),
+        'int' : new g.GridEditor(new f.NumberField({selectOnFocus:true, allowDecimals:false, style:'text-align:left;'})),
+        'boolean' : new g.GridEditor(new f.Field({el:this.bselect,selectOnFocus:true}))
+    };
+    this.renderCellDelegate = this.renderCell.createDelegate(this);
+    this.renderPropDelegate = this.renderProp.createDelegate(this);
+};
+
+Roo.extend(Roo.grid.PropertyColumnModel, Roo.grid.ColumnModel, {
+    
+    
+    nameText : 'Name',
+    valueText : 'Value',
+    
+    dateFormat : 'm/j/Y',
+    
+    
+    renderDate : function(dateVal){
+        return dateVal.dateFormat(this.dateFormat);
+    },
+
+    renderBool : function(bVal){
+        return bVal ? 'true' : 'false';
+    },
+
+    isCellEditable : function(colIndex, rowIndex){
+        return colIndex == 1;
+    },
+
+    getRenderer : function(col){
+        return col == 1 ?
+            this.renderCellDelegate : this.renderPropDelegate;
+    },
+
+    renderProp : function(v){
+        return this.getPropertyName(v);
+    },
+
+    renderCell : function(val){
+        var rv = val;
+        if(val instanceof Date){
+            rv = this.renderDate(val);
+        }else if(typeof val == 'boolean'){
+            rv = this.renderBool(val);
+        }
+        return Roo.util.Format.htmlEncode(rv);
+    },
+
+    getPropertyName : function(name){
+        var pn = this.grid.propertyNames;
+        return pn && pn[name] ? pn[name] : name;
+    },
+
+    getCellEditor : function(colIndex, rowIndex){
+        var p = this.store.getProperty(rowIndex);
+        var n = p.data['name'], val = p.data['value'];
+        
+        if(typeof(this.grid.customEditors[n]) == 'string'){
+            return this.editors[this.grid.customEditors[n]];
+        }
+        if(typeof(this.grid.customEditors[n]) != 'undefined'){
+            return this.grid.customEditors[n];
+        }
+        if(val instanceof Date){
+            return this.editors['date'];
+        }else if(typeof val == 'number'){
+            return this.editors['number'];
+        }else if(typeof val == 'boolean'){
+            return this.editors['boolean'];
+        }else{
+            return this.editors['string'];
+        }
+    }
+});
+
+/**
+ * @class Roo.grid.PropertyGrid
+ * @extends Roo.grid.EditorGrid
+ * This class represents the  interface of a component based property grid control.
+ * <br><br>Usage:<pre><code>
+ var grid = new Roo.grid.PropertyGrid("my-container-id", {
+      
+ });
+ // set any options
+ grid.render();
+ * </code></pre>
+  
+ * @constructor
+ * @param {String/HTMLElement/Roo.Element} container The element into which this grid will be rendered -
+ * The container MUST have some type of size defined for the grid to fill. The container will be
+ * automatically set to position relative if it isn't already.
+ * @param {Object} config A config object that sets properties on this grid.
+ */
+Roo.grid.PropertyGrid = function(container, config){
+    config = config || {};
+    var store = new Roo.grid.PropertyStore(this);
+    this.store = store;
+    var cm = new Roo.grid.PropertyColumnModel(this, store);
+    store.store.sort('name', 'ASC');
+    Roo.grid.PropertyGrid.superclass.constructor.call(this, container, Roo.apply({
+        ds: store.store,
+        cm: cm,
+        enableColLock:false,
+        enableColumnMove:false,
+        stripeRows:false,
+        trackMouseOver: false,
+        clicksToEdit:1
+    }, config));
+    this.getGridEl().addClass('x-props-grid');
+    this.lastEditRow = null;
+    this.on('columnresize', this.onColumnResize, this);
+    this.addEvents({
+         /**
+            * @event beforepropertychange
+            * Fires before a property changes (return false to stop?)
+            * @param {Roo.grid.PropertyGrid} grid property grid? (check could be store)
+            * @param {String} id Record Id
+            * @param {String} newval New Value
+         * @param {String} oldval Old Value
+            */
+        "beforepropertychange": true,
+        /**
+            * @event propertychange
+            * Fires after a property changes
+            * @param {Roo.grid.PropertyGrid} grid property grid? (check could be store)
+            * @param {String} id Record Id
+            * @param {String} newval New Value
+         * @param {String} oldval Old Value
+            */
+        "propertychange": true
+    });
+    this.customEditors = this.customEditors || {};
+};
+Roo.extend(Roo.grid.PropertyGrid, Roo.grid.EditorGrid, {
+    
+     /**
+     * @cfg {Object} customEditors map of colnames=> custom editors.
+     * the custom editor can be one of the standard ones (date|string|number|int|boolean), or a
+     * grid editor eg. Roo.grid.GridEditor(new Roo.form.TextArea({selectOnFocus:true})),
+     * false disables editing of the field.
+        */
+    
+      /**
+     * @cfg {Object} propertyNames map of property Names to their displayed value
+        */
+    
+    render : function(){
+        Roo.grid.PropertyGrid.superclass.render.call(this);
+        this.autoSize.defer(100, this);
+    },
+
+    autoSize : function(){
+        Roo.grid.PropertyGrid.superclass.autoSize.call(this);
+        if(this.view){
+            this.view.fitColumns();
+        }
+    },
+
+    onColumnResize : function(){
+        this.colModel.setColumnWidth(1, this.container.getWidth(true)-this.colModel.getColumnWidth(0));
+        this.autoSize();
+    },
+    /**
+     * Sets the data for the Grid
+     * accepts a Key => Value object of all the elements avaiable.
+     * @param {Object} data  to appear in grid.
+     */
+    setSource : function(source){
+        this.store.setSource(source);
+        //this.autoSize();
+    },
+    /**
+     * Gets all the data from the grid.
+     * @return {Object} data  data stored in grid
+     */
+    getSource : function(){
+        return this.store.getSource();
+    }
+});
\ No newline at end of file
diff --git a/Roo/grid/RowSelectionModel.js b/Roo/grid/RowSelectionModel.js
new file mode 100644 (file)
index 0000000..1decda3
--- /dev/null
@@ -0,0 +1,447 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+/**
+ * @extends Roo.grid.AbstractSelectionModel
+ * @class Roo.grid.RowSelectionModel
+ * The default SelectionModel used by {@link Roo.grid.Grid}.
+ * It supports multiple selections and keyboard selection/navigation. 
+ * @constructor
+ * @param {Object} config
+ */
+Roo.grid.RowSelectionModel = function(config){
+    Roo.apply(this, config);
+    this.selections = new Roo.util.MixedCollection(false, function(o){
+        return o.id;
+    });
+
+    this.last = false;
+    this.lastActive = false;
+
+    this.addEvents({
+        /**
+            * @event selectionchange
+            * Fires when the selection changes
+            * @param {SelectionModel} this
+            */
+           "selectionchange" : true,
+        /**
+            * @event afterselectionchange
+            * Fires after the selection changes (eg. by key press or clicking)
+            * @param {SelectionModel} this
+            */
+           "afterselectionchange" : true,
+        /**
+            * @event beforerowselect
+            * Fires when a row is selected being selected, return false to cancel.
+            * @param {SelectionModel} this
+            * @param {Number} rowIndex The selected index
+            * @param {Boolean} keepExisting False if other selections will be cleared
+            */
+           "beforerowselect" : true,
+        /**
+            * @event rowselect
+            * Fires when a row is selected.
+            * @param {SelectionModel} this
+            * @param {Number} rowIndex The selected index
+            * @param {Roo.data.Record} r The record
+            */
+           "rowselect" : true,
+        /**
+            * @event rowdeselect
+            * Fires when a row is deselected.
+            * @param {SelectionModel} this
+            * @param {Number} rowIndex The selected index
+            */
+        "rowdeselect" : true
+    });
+    Roo.grid.RowSelectionModel.superclass.constructor.call(this);
+    this.locked = false;
+};
+
+Roo.extend(Roo.grid.RowSelectionModel, Roo.grid.AbstractSelectionModel,  {
+    /**
+     * @cfg {Boolean} singleSelect
+     * True to allow selection of only one row at a time (defaults to false)
+     */
+    singleSelect : false,
+
+    // private
+    initEvents : function(){
+
+        if(!this.grid.enableDragDrop && !this.grid.enableDrag){
+            this.grid.on("mousedown", this.handleMouseDown, this);
+        }else{ // allow click to work like normal
+            this.grid.on("rowclick", this.handleDragableRowClick, this);
+        }
+
+        this.rowNav = new Roo.KeyNav(this.grid.getGridEl(), {
+            "up" : function(e){
+                if(!e.shiftKey){
+                    this.selectPrevious(e.shiftKey);
+                }else if(this.last !== false && this.lastActive !== false){
+                    var last = this.last;
+                    this.selectRange(this.last,  this.lastActive-1);
+                    this.grid.getView().focusRow(this.lastActive);
+                    if(last !== false){
+                        this.last = last;
+                    }
+                }else{
+                    this.selectFirstRow();
+                }
+                this.fireEvent("afterselectionchange", this);
+            },
+            "down" : function(e){
+                if(!e.shiftKey){
+                    this.selectNext(e.shiftKey);
+                }else if(this.last !== false && this.lastActive !== false){
+                    var last = this.last;
+                    this.selectRange(this.last,  this.lastActive+1);
+                    this.grid.getView().focusRow(this.lastActive);
+                    if(last !== false){
+                        this.last = last;
+                    }
+                }else{
+                    this.selectFirstRow();
+                }
+                this.fireEvent("afterselectionchange", this);
+            },
+            scope: this
+        });
+
+        var view = this.grid.view;
+        view.on("refresh", this.onRefresh, this);
+        view.on("rowupdated", this.onRowUpdated, this);
+        view.on("rowremoved", this.onRemove, this);
+    },
+
+    // private
+    onRefresh : function(){
+        var ds = this.grid.dataSource, i, v = this.grid.view;
+        var s = this.selections;
+        s.each(function(r){
+            if((i = ds.indexOfId(r.id)) != -1){
+                v.onRowSelect(i);
+            }else{
+                s.remove(r);
+            }
+        });
+    },
+
+    // private
+    onRemove : function(v, index, r){
+        this.selections.remove(r);
+    },
+
+    // private
+    onRowUpdated : function(v, index, r){
+        if(this.isSelected(r)){
+            v.onRowSelect(index);
+        }
+    },
+
+    /**
+     * Select records.
+     * @param {Array} records The records to select
+     * @param {Boolean} keepExisting (optional) True to keep existing selections
+     */
+    selectRecords : function(records, keepExisting){
+        if(!keepExisting){
+            this.clearSelections();
+        }
+        var ds = this.grid.dataSource;
+        for(var i = 0, len = records.length; i < len; i++){
+            this.selectRow(ds.indexOf(records[i]), true);
+        }
+    },
+
+    /**
+     * Gets the number of selected rows.
+     * @return {Number}
+     */
+    getCount : function(){
+        return this.selections.length;
+    },
+
+    /**
+     * Selects the first row in the grid.
+     */
+    selectFirstRow : function(){
+        this.selectRow(0);
+    },
+
+    /**
+     * Select the last row.
+     * @param {Boolean} keepExisting (optional) True to keep existing selections
+     */
+    selectLastRow : function(keepExisting){
+        this.selectRow(this.grid.dataSource.getCount() - 1, keepExisting);
+    },
+
+    /**
+     * Selects the row immediately following the last selected row.
+     * @param {Boolean} keepExisting (optional) True to keep existing selections
+     */
+    selectNext : function(keepExisting){
+        if(this.last !== false && (this.last+1) < this.grid.dataSource.getCount()){
+            this.selectRow(this.last+1, keepExisting);
+            this.grid.getView().focusRow(this.last);
+        }
+    },
+
+    /**
+     * Selects the row that precedes the last selected row.
+     * @param {Boolean} keepExisting (optional) True to keep existing selections
+     */
+    selectPrevious : function(keepExisting){
+        if(this.last){
+            this.selectRow(this.last-1, keepExisting);
+            this.grid.getView().focusRow(this.last);
+        }
+    },
+
+    /**
+     * Returns the selected records
+     * @return {Array} Array of selected records
+     */
+    getSelections : function(){
+        return [].concat(this.selections.items);
+    },
+
+    /**
+     * Returns the first selected record.
+     * @return {Record}
+     */
+    getSelected : function(){
+        return this.selections.itemAt(0);
+    },
+
+
+    /**
+     * Clears all selections.
+     */
+    clearSelections : function(fast){
+        if(this.locked) return;
+        if(fast !== true){
+            var ds = this.grid.dataSource;
+            var s = this.selections;
+            s.each(function(r){
+                this.deselectRow(ds.indexOfId(r.id));
+            }, this);
+            s.clear();
+        }else{
+            this.selections.clear();
+        }
+        this.last = false;
+    },
+
+
+    /**
+     * Selects all rows.
+     */
+    selectAll : function(){
+        if(this.locked) return;
+        this.selections.clear();
+        for(var i = 0, len = this.grid.dataSource.getCount(); i < len; i++){
+            this.selectRow(i, true);
+        }
+    },
+
+    /**
+     * Returns True if there is a selection.
+     * @return {Boolean}
+     */
+    hasSelection : function(){
+        return this.selections.length > 0;
+    },
+
+    /**
+     * Returns True if the specified row is selected.
+     * @param {Number/Record} record The record or index of the record to check
+     * @return {Boolean}
+     */
+    isSelected : function(index){
+        var r = typeof index == "number" ? this.grid.dataSource.getAt(index) : index;
+        return (r && this.selections.key(r.id) ? true : false);
+    },
+
+    /**
+     * Returns True if the specified record id is selected.
+     * @param {String} id The id of record to check
+     * @return {Boolean}
+     */
+    isIdSelected : function(id){
+        return (this.selections.key(id) ? true : false);
+    },
+
+    // private
+    handleMouseDown : function(e, t){
+        var view = this.grid.getView(), rowIndex;
+        if(this.isLocked() || (rowIndex = view.findRowIndex(t)) === false){
+            return;
+        };
+        if(e.shiftKey && this.last !== false){
+            var last = this.last;
+            this.selectRange(last, rowIndex, e.ctrlKey);
+            this.last = last; // reset the last
+            view.focusRow(rowIndex);
+        }else{
+            var isSelected = this.isSelected(rowIndex);
+            if(e.button !== 0 && isSelected){
+                view.focusRow(rowIndex);
+            }else if(e.ctrlKey && isSelected){
+                this.deselectRow(rowIndex);
+            }else if(!isSelected){
+                this.selectRow(rowIndex, e.button === 0 && (e.ctrlKey || e.shiftKey));
+                view.focusRow(rowIndex);
+            }
+        }
+        this.fireEvent("afterselectionchange", this);
+    },
+    // private
+    handleDragableRowClick :  function(grid, rowIndex, e) 
+    {
+        if(e.button === 0 && !e.shiftKey && !e.ctrlKey) {
+            this.selectRow(rowIndex, false);
+            grid.view.focusRow(rowIndex);
+             this.fireEvent("afterselectionchange", this);
+        }
+    },
+    
+    /**
+     * Selects multiple rows.
+     * @param {Array} rows Array of the indexes of the row to select
+     * @param {Boolean} keepExisting (optional) True to keep existing selections
+     */
+    selectRows : function(rows, keepExisting){
+        if(!keepExisting){
+            this.clearSelections();
+        }
+        for(var i = 0, len = rows.length; i < len; i++){
+            this.selectRow(rows[i], true);
+        }
+    },
+
+    /**
+     * Selects a range of rows. All rows in between startRow and endRow are also selected.
+     * @param {Number} startRow The index of the first row in the range
+     * @param {Number} endRow The index of the last row in the range
+     * @param {Boolean} keepExisting (optional) True to retain existing selections
+     */
+    selectRange : function(startRow, endRow, keepExisting){
+        if(this.locked) return;
+        if(!keepExisting){
+            this.clearSelections();
+        }
+        if(startRow <= endRow){
+            for(var i = startRow; i <= endRow; i++){
+                this.selectRow(i, true);
+            }
+        }else{
+            for(var i = startRow; i >= endRow; i--){
+                this.selectRow(i, true);
+            }
+        }
+    },
+
+    /**
+     * Deselects a range of rows. All rows in between startRow and endRow are also deselected.
+     * @param {Number} startRow The index of the first row in the range
+     * @param {Number} endRow The index of the last row in the range
+     */
+    deselectRange : function(startRow, endRow, preventViewNotify){
+        if(this.locked) return;
+        for(var i = startRow; i <= endRow; i++){
+            this.deselectRow(i, preventViewNotify);
+        }
+    },
+
+    /**
+     * Selects a row.
+     * @param {Number} row The index of the row to select
+     * @param {Boolean} keepExisting (optional) True to keep existing selections
+     */
+    selectRow : function(index, keepExisting, preventViewNotify){
+        if(this.locked || (index < 0 || index >= this.grid.dataSource.getCount())) return;
+        if(this.fireEvent("beforerowselect", this, index, keepExisting) !== false){
+            if(!keepExisting || this.singleSelect){
+                this.clearSelections();
+            }
+            var r = this.grid.dataSource.getAt(index);
+            this.selections.add(r);
+            this.last = this.lastActive = index;
+            if(!preventViewNotify){
+                this.grid.getView().onRowSelect(index);
+            }
+            this.fireEvent("rowselect", this, index, r);
+            this.fireEvent("selectionchange", this);
+        }
+    },
+
+    /**
+     * Deselects a row.
+     * @param {Number} row The index of the row to deselect
+     */
+    deselectRow : function(index, preventViewNotify){
+        if(this.locked) return;
+        if(this.last == index){
+            this.last = false;
+        }
+        if(this.lastActive == index){
+            this.lastActive = false;
+        }
+        var r = this.grid.dataSource.getAt(index);
+        this.selections.remove(r);
+        if(!preventViewNotify){
+            this.grid.getView().onRowDeselect(index);
+        }
+        this.fireEvent("rowdeselect", this, index);
+        this.fireEvent("selectionchange", this);
+    },
+
+    // private
+    restoreLast : function(){
+        if(this._last){
+            this.last = this._last;
+        }
+    },
+
+    // private
+    acceptsNav : function(row, col, cm){
+        return !cm.isHidden(col) && cm.isCellEditable(col, row);
+    },
+
+    // private
+    onEditorKey : function(field, e){
+        var k = e.getKey(), newCell, g = this.grid, ed = g.activeEditor;
+        if(k == e.TAB){
+            e.stopEvent();
+            ed.completeEdit();
+            if(e.shiftKey){
+                newCell = g.walkCells(ed.row, ed.col-1, -1, this.acceptsNav, this);
+            }else{
+                newCell = g.walkCells(ed.row, ed.col+1, 1, this.acceptsNav, this);
+            }
+        }else if(k == e.ENTER && !e.ctrlKey){
+            e.stopEvent();
+            ed.completeEdit();
+            if(e.shiftKey){
+                newCell = g.walkCells(ed.row-1, ed.col, -1, this.acceptsNav, this);
+            }else{
+                newCell = g.walkCells(ed.row+1, ed.col, 1, this.acceptsNav, this);
+            }
+        }else if(k == e.ESC){
+            ed.cancelEdit();
+        }
+        if(newCell){
+            g.startEditing(newCell[0], newCell[1]);
+        }
+    }
+});
\ No newline at end of file
diff --git a/Roo/grid/SplitDragZone.js b/Roo/grid/SplitDragZone.js
new file mode 100644 (file)
index 0000000..5f11ed5
--- /dev/null
@@ -0,0 +1,67 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+// private
+// This is a support class used internally by the Grid components
+Roo.grid.SplitDragZone = function(grid, hd, hd2){
+    this.grid = grid;
+    this.view = grid.getView();
+    this.proxy = this.view.resizeProxy;
+    Roo.grid.SplitDragZone.superclass.constructor.call(this, hd,
+        "gridSplitters" + this.grid.getGridEl().id, {
+        dragElId : Roo.id(this.proxy.dom), resizeFrame:false
+    });
+    this.setHandleElId(Roo.id(hd));
+    this.setOuterHandleElId(Roo.id(hd2));
+    this.scroll = false;
+};
+Roo.extend(Roo.grid.SplitDragZone, Roo.dd.DDProxy, {
+    fly: Roo.Element.fly,
+
+    b4StartDrag : function(x, y){
+        this.view.headersDisabled = true;
+        this.proxy.setHeight(this.view.mainWrap.getHeight());
+        var w = this.cm.getColumnWidth(this.cellIndex);
+        var minw = Math.max(w-this.grid.minColumnWidth, 0);
+        this.resetConstraints();
+        this.setXConstraint(minw, 1000);
+        this.setYConstraint(0, 0);
+        this.minX = x - minw;
+        this.maxX = x + 1000;
+        this.startPos = x;
+        Roo.dd.DDProxy.prototype.b4StartDrag.call(this, x, y);
+    },
+
+
+    handleMouseDown : function(e){
+        ev = Roo.EventObject.setEvent(e);
+        var t = this.fly(ev.getTarget());
+        if(t.hasClass("x-grid-split")){
+            this.cellIndex = this.view.getCellIndex(t.dom);
+            this.split = t.dom;
+            this.cm = this.grid.colModel;
+            if(this.cm.isResizable(this.cellIndex) && !this.cm.isFixed(this.cellIndex)){
+                Roo.grid.SplitDragZone.superclass.handleMouseDown.apply(this, arguments);
+            }
+        }
+    },
+
+    endDrag : function(e){
+        this.view.headersDisabled = false;
+        var endX = Math.max(this.minX, Roo.lib.Event.getPageX(e));
+        var diff = endX - this.startPos;
+        this.view.onColumnSplitterMoved(this.cellIndex, this.cm.getColumnWidth(this.cellIndex)+diff);
+    },
+
+    autoOffset : function(){
+        this.setDelta(0,0);
+    }
+});
\ No newline at end of file
diff --git a/Roo/lib/Ajax.js b/Roo/lib/Ajax.js
new file mode 100644 (file)
index 0000000..c7a6f9f
--- /dev/null
@@ -0,0 +1,478 @@
+/*
+ * Portions of this file are based on pieces of Yahoo User Interface Library
+ * Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+ * YUI licensed under the BSD License:
+ * http://developer.yahoo.net/yui/license.txt
+ * <script type="text/javascript">
+ *
+ */
+
+(function() {
+    
+    Roo.lib.Ajax = {
+        request : function(method, uri, cb, data, options) {
+            if(options){
+                var hs = options.headers;
+                if(hs){
+                    for(var h in hs){
+                        if(hs.hasOwnProperty(h)){
+                            this.initHeader(h, hs[h], false);
+                        }
+                    }
+                }
+                if(options.xmlData){
+                    this.initHeader('Content-Type', 'text/xml', false);
+                    method = 'POST';
+                    data = options.xmlData;
+                }
+            }
+
+            return this.asyncRequest(method, uri, cb, data);
+        },
+
+        serializeForm : function(form) {
+            if(typeof form == 'string') {
+                form = (document.getElementById(form) || document.forms[form]);
+            }
+
+            var el, name, val, disabled, data = '', hasSubmit = false;
+            for (var i = 0; i < form.elements.length; i++) {
+                el = form.elements[i];
+                disabled = form.elements[i].disabled;
+                name = form.elements[i].name;
+                val = form.elements[i].value;
+
+                if (!disabled && name){
+                    switch (el.type)
+                            {
+                        case 'select-one':
+                        case 'select-multiple':
+                            for (var j = 0; j < el.options.length; j++) {
+                                if (el.options[j].selected) {
+                                    if (Roo.isIE) {
+                                        data += encodeURIComponent(name) + '=' + encodeURIComponent(el.options[j].attributes['value'].specified ? el.options[j].value : el.options[j].text) + '&';
+                                    }
+                                    else {
+                                        data += encodeURIComponent(name) + '=' + encodeURIComponent(el.options[j].hasAttribute('value') ? el.options[j].value : el.options[j].text) + '&';
+                                    }
+                                }
+                            }
+                            break;
+                        case 'radio':
+                        case 'checkbox':
+                            if (el.checked) {
+                                data += encodeURIComponent(name) + '=' + encodeURIComponent(val) + '&';
+                            }
+                            break;
+                        case 'file':
+
+                        case undefined:
+
+                        case 'reset':
+
+                        case 'button':
+
+                            break;
+                        case 'submit':
+                            if(hasSubmit == false) {
+                                data += encodeURIComponent(name) + '=' + encodeURIComponent(val) + '&';
+                                hasSubmit = true;
+                            }
+                            break;
+                        default:
+                            data += encodeURIComponent(name) + '=' + encodeURIComponent(val) + '&';
+                            break;
+                    }
+                }
+            }
+            data = data.substr(0, data.length - 1);
+            return data;
+        },
+
+        headers:{},
+
+        hasHeaders:false,
+
+        useDefaultHeader:true,
+
+        defaultPostHeader:'application/x-www-form-urlencoded',
+
+        useDefaultXhrHeader:true,
+
+        defaultXhrHeader:'XMLHttpRequest',
+
+        hasDefaultHeaders:true,
+
+        defaultHeaders:{},
+
+        poll:{},
+
+        timeout:{},
+
+        pollInterval:50,
+
+        transactionId:0,
+
+        setProgId:function(id)
+        {
+            this.activeX.unshift(id);
+        },
+
+        setDefaultPostHeader:function(b)
+        {
+            this.useDefaultHeader = b;
+        },
+
+        setDefaultXhrHeader:function(b)
+        {
+            this.useDefaultXhrHeader = b;
+        },
+
+        setPollingInterval:function(i)
+        {
+            if (typeof i == 'number' && isFinite(i)) {
+                this.pollInterval = i;
+            }
+        },
+
+        createXhrObject:function(transactionId)
+        {
+            var obj,http;
+            try
+            {
+
+                http = new XMLHttpRequest();
+
+                obj = { conn:http, tId:transactionId };
+            }
+            catch(e)
+            {
+                for (var i = 0; i < this.activeX.length; ++i) {
+                    try
+                    {
+
+                        http = new ActiveXObject(this.activeX[i]);
+
+                        obj = { conn:http, tId:transactionId };
+                        break;
+                    }
+                    catch(e) {
+                    }
+                }
+            }
+            finally
+            {
+                return obj;
+            }
+        },
+
+        getConnectionObject:function()
+        {
+            var o;
+            var tId = this.transactionId;
+
+            try
+            {
+                o = this.createXhrObject(tId);
+                if (o) {
+                    this.transactionId++;
+                }
+            }
+            catch(e) {
+            }
+            finally
+            {
+                return o;
+            }
+        },
+
+        asyncRequest:function(method, uri, callback, postData)
+        {
+            var o = this.getConnectionObject();
+
+            if (!o) {
+                return null;
+            }
+            else {
+                o.conn.open(method, uri, true);
+
+                if (this.useDefaultXhrHeader) {
+                    if (!this.defaultHeaders['X-Requested-With']) {
+                        this.initHeader('X-Requested-With', this.defaultXhrHeader, true);
+                    }
+                }
+
+                if(postData && this.useDefaultHeader){
+                    this.initHeader('Content-Type', this.defaultPostHeader);
+                }
+
+                 if (this.hasDefaultHeaders || this.hasHeaders) {
+                    this.setHeader(o);
+                }
+
+                this.handleReadyState(o, callback);
+                o.conn.send(postData || null);
+
+                return o;
+            }
+        },
+
+        handleReadyState:function(o, callback)
+        {
+            var oConn = this;
+
+            if (callback && callback.timeout) {
+                this.timeout[o.tId] = window.setTimeout(function() {
+                    oConn.abort(o, callback, true);
+                }, callback.timeout);
+            }
+
+            this.poll[o.tId] = window.setInterval(
+                    function() {
+                        if (o.conn && o.conn.readyState == 4) {
+                            window.clearInterval(oConn.poll[o.tId]);
+                            delete oConn.poll[o.tId];
+
+                            if(callback && callback.timeout) {
+                                window.clearTimeout(oConn.timeout[o.tId]);
+                                delete oConn.timeout[o.tId];
+                            }
+
+                            oConn.handleTransactionResponse(o, callback);
+                        }
+                    }
+                    , this.pollInterval);
+        },
+
+        handleTransactionResponse:function(o, callback, isAbort)
+        {
+
+            if (!callback) {
+                this.releaseObject(o);
+                return;
+            }
+
+            var httpStatus, responseObject;
+
+            try
+            {
+                if (o.conn.status !== undefined && o.conn.status != 0) {
+                    httpStatus = o.conn.status;
+                }
+                else {
+                    httpStatus = 13030;
+                }
+            }
+            catch(e) {
+
+
+                httpStatus = 13030;
+            }
+
+            if (httpStatus >= 200 && httpStatus < 300) {
+                responseObject = this.createResponseObject(o, callback.argument);
+                if (callback.success) {
+                    if (!callback.scope) {
+                        callback.success(responseObject);
+                    }
+                    else {
+
+
+                        callback.success.apply(callback.scope, [responseObject]);
+                    }
+                }
+            }
+            else {
+                switch (httpStatus) {
+
+                    case 12002:
+                    case 12029:
+                    case 12030:
+                    case 12031:
+                    case 12152:
+                    case 13030:
+                        responseObject = this.createExceptionObject(o.tId, callback.argument, (isAbort ? isAbort : false));
+                        if (callback.failure) {
+                            if (!callback.scope) {
+                                callback.failure(responseObject);
+                            }
+                            else {
+                                callback.failure.apply(callback.scope, [responseObject]);
+                            }
+                        }
+                        break;
+                    default:
+                        responseObject = this.createResponseObject(o, callback.argument);
+                        if (callback.failure) {
+                            if (!callback.scope) {
+                                callback.failure(responseObject);
+                            }
+                            else {
+                                callback.failure.apply(callback.scope, [responseObject]);
+                            }
+                        }
+                }
+            }
+
+            this.releaseObject(o);
+            responseObject = null;
+        },
+
+        createResponseObject:function(o, callbackArg)
+        {
+            var obj = {};
+            var headerObj = {};
+
+            try
+            {
+                var headerStr = o.conn.getAllResponseHeaders();
+                var header = headerStr.split('\n');
+                for (var i = 0; i < header.length; i++) {
+                    var delimitPos = header[i].indexOf(':');
+                    if (delimitPos != -1) {
+                        headerObj[header[i].substring(0, delimitPos)] = header[i].substring(delimitPos + 2);
+                    }
+                }
+            }
+            catch(e) {
+            }
+
+            obj.tId = o.tId;
+            obj.status = o.conn.status;
+            obj.statusText = o.conn.statusText;
+            obj.getResponseHeader = headerObj;
+            obj.getAllResponseHeaders = headerStr;
+            obj.responseText = o.conn.responseText;
+            obj.responseXML = o.conn.responseXML;
+
+            if (typeof callbackArg !== undefined) {
+                obj.argument = callbackArg;
+            }
+
+            return obj;
+        },
+
+        createExceptionObject:function(tId, callbackArg, isAbort)
+        {
+            var COMM_CODE = 0;
+            var COMM_ERROR = 'communication failure';
+            var ABORT_CODE = -1;
+            var ABORT_ERROR = 'transaction aborted';
+
+            var obj = {};
+
+            obj.tId = tId;
+            if (isAbort) {
+                obj.status = ABORT_CODE;
+                obj.statusText = ABORT_ERROR;
+            }
+            else {
+                obj.status = COMM_CODE;
+                obj.statusText = COMM_ERROR;
+            }
+
+            if (callbackArg) {
+                obj.argument = callbackArg;
+            }
+
+            return obj;
+        },
+
+        initHeader:function(label, value, isDefault)
+        {
+            var headerObj = (isDefault) ? this.defaultHeaders : this.headers;
+
+            if (headerObj[label] === undefined) {
+                headerObj[label] = value;
+            }
+            else {
+
+
+                headerObj[label] = value + "," + headerObj[label];
+            }
+
+            if (isDefault) {
+                this.hasDefaultHeaders = true;
+            }
+            else {
+                this.hasHeaders = true;
+            }
+        },
+
+
+        setHeader:function(o)
+        {
+            if (this.hasDefaultHeaders) {
+                for (var prop in this.defaultHeaders) {
+                    if (this.defaultHeaders.hasOwnProperty(prop)) {
+                        o.conn.setRequestHeader(prop, this.defaultHeaders[prop]);
+                    }
+                }
+            }
+
+            if (this.hasHeaders) {
+                for (var prop in this.headers) {
+                    if (this.headers.hasOwnProperty(prop)) {
+                        o.conn.setRequestHeader(prop, this.headers[prop]);
+                    }
+                }
+                this.headers = {};
+                this.hasHeaders = false;
+            }
+        },
+
+        resetDefaultHeaders:function() {
+            delete this.defaultHeaders;
+            this.defaultHeaders = {};
+            this.hasDefaultHeaders = false;
+        },
+
+        abort:function(o, callback, isTimeout)
+        {
+            if(this.isCallInProgress(o)) {
+                o.conn.abort();
+                window.clearInterval(this.poll[o.tId]);
+                delete this.poll[o.tId];
+                if (isTimeout) {
+                    delete this.timeout[o.tId];
+                }
+
+                this.handleTransactionResponse(o, callback, true);
+
+                return true;
+            }
+            else {
+                return false;
+            }
+        },
+
+
+        isCallInProgress:function(o)
+        {
+            if (o && o.conn) {
+                return o.conn.readyState != 4 && o.conn.readyState != 0;
+            }
+            else {
+
+                return false;
+            }
+        },
+
+
+        releaseObject:function(o)
+        {
+
+            o.conn = null;
+
+            o = null;
+        },
+
+        activeX:[
+        'MSXML2.XMLHTTP.3.0',
+        'MSXML2.XMLHTTP',
+        'Microsoft.XMLHTTP'
+        ]
+
+
+    };
+})();
\ No newline at end of file
diff --git a/Roo/lib/Anim.js b/Roo/lib/Anim.js
new file mode 100644 (file)
index 0000000..c215763
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+ * Portions of this file are based on pieces of Yahoo User Interface Library
+ * Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+ * YUI licensed under the BSD License:
+ * http://developer.yahoo.net/yui/license.txt
+ * <script type="text/javascript">
+ *
+ */
+(function() {   
+
+    Roo.lib.Anim = {
+        scroll : function(el, args, duration, easing, cb, scope) {
+            this.run(el, args, duration, easing, cb, scope, Roo.lib.Scroll);
+        },
+
+        motion : function(el, args, duration, easing, cb, scope) {
+            this.run(el, args, duration, easing, cb, scope, Roo.lib.Motion);
+        },
+
+        color : function(el, args, duration, easing, cb, scope) {
+            this.run(el, args, duration, easing, cb, scope, Roo.lib.ColorAnim);
+        },
+
+        run : function(el, args, duration, easing, cb, scope, type) {
+            type = type || Roo.lib.AnimBase;
+            if (typeof easing == "string") {
+                easing = Roo.lib.Easing[easing];
+            }
+            var anim = new type(el, args, duration, easing);
+            anim.animateX(function() {
+                Roo.callback(cb, scope);
+            });
+            return anim;
+        }
+    };
+})();
\ No newline at end of file
diff --git a/Roo/lib/AnimBase.js b/Roo/lib/AnimBase.js
new file mode 100644 (file)
index 0000000..6da9528
--- /dev/null
@@ -0,0 +1,289 @@
+/*
+ * Portions of this file are based on pieces of Yahoo User Interface Library
+ * Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+ * YUI licensed under the BSD License:
+ * http://developer.yahoo.net/yui/license.txt
+ * <script type="text/javascript">
+ *
+ */
+
+(function() {    
+    var libFlyweight;
+    
+    function fly(el) {
+        if (!libFlyweight) {
+            libFlyweight = new Roo.Element.Flyweight();
+        }
+        libFlyweight.dom = el;
+        return libFlyweight;
+    }
+
+    // since this uses fly! - it cant be in DOM (which does not have fly yet..)
+    
+   
+    
+    Roo.lib.AnimBase = function(el, attributes, duration, method) {
+        if (el) {
+            this.init(el, attributes, duration, method);
+        }
+    };
+
+    Roo.lib.AnimBase.fly = fly;
+    
+    
+    
+    Roo.lib.AnimBase.prototype = {
+
+        toString: function() {
+            var el = this.getEl();
+            var id = el.id || el.tagName;
+            return ("Anim " + id);
+        },
+
+        patterns: {
+            noNegatives:        /width|height|opacity|padding/i,
+            offsetAttribute:  /^((width|height)|(top|left))$/,
+            defaultUnit:        /width|height|top$|bottom$|left$|right$/i,
+            offsetUnit:         /\d+(em|%|en|ex|pt|in|cm|mm|pc)$/i
+        },
+
+
+        doMethod: function(attr, start, end) {
+            return this.method(this.currentFrame, start, end - start, this.totalFrames);
+        },
+
+
+        setAttribute: function(attr, val, unit) {
+            if (this.patterns.noNegatives.test(attr)) {
+                val = (val > 0) ? val : 0;
+            }
+
+            Roo.fly(this.getEl(), '_anim').setStyle(attr, val + unit);
+        },
+
+
+        getAttribute: function(attr) {
+            var el = this.getEl();
+            var val = fly(el).getStyle(attr);
+
+            if (val !== 'auto' && !this.patterns.offsetUnit.test(val)) {
+                return parseFloat(val);
+            }
+
+            var a = this.patterns.offsetAttribute.exec(attr) || [];
+            var pos = !!( a[3] );
+            var box = !!( a[2] );
+
+
+            if (box || (fly(el).getStyle('position') == 'absolute' && pos)) {
+                val = el['offset' + a[0].charAt(0).toUpperCase() + a[0].substr(1)];
+            } else {
+                val = 0;
+            }
+
+            return val;
+        },
+
+
+        getDefaultUnit: function(attr) {
+            if (this.patterns.defaultUnit.test(attr)) {
+                return 'px';
+            }
+
+            return '';
+        },
+
+        animateX : function(callback, scope) {
+            var f = function() {
+                this.onComplete.removeListener(f);
+                if (typeof callback == "function") {
+                    callback.call(scope || this, this);
+                }
+            };
+            this.onComplete.addListener(f, this);
+            this.animate();
+        },
+
+
+        setRuntimeAttribute: function(attr) {
+            var start;
+            var end;
+            var attributes = this.attributes;
+
+            this.runtimeAttributes[attr] = {};
+
+            var isset = function(prop) {
+                return (typeof prop !== 'undefined');
+            };
+
+            if (!isset(attributes[attr]['to']) && !isset(attributes[attr]['by'])) {
+                return false;
+            }
+
+            start = ( isset(attributes[attr]['from']) ) ? attributes[attr]['from'] : this.getAttribute(attr);
+
+
+            if (isset(attributes[attr]['to'])) {
+                end = attributes[attr]['to'];
+            } else if (isset(attributes[attr]['by'])) {
+                if (start.constructor == Array) {
+                    end = [];
+                    for (var i = 0, len = start.length; i < len; ++i) {
+                        end[i] = start[i] + attributes[attr]['by'][i];
+                    }
+                } else {
+                    end = start + attributes[attr]['by'];
+                }
+            }
+
+            this.runtimeAttributes[attr].start = start;
+            this.runtimeAttributes[attr].end = end;
+
+
+            this.runtimeAttributes[attr].unit = ( isset(attributes[attr].unit) ) ? attributes[attr]['unit'] : this.getDefaultUnit(attr);
+        },
+
+
+        init: function(el, attributes, duration, method) {
+
+            var isAnimated = false;
+
+
+            var startTime = null;
+
+
+            var actualFrames = 0;
+
+
+            el = Roo.getDom(el);
+
+
+            this.attributes = attributes || {};
+
+
+            this.duration = duration || 1;
+
+
+            this.method = method || Roo.lib.Easing.easeNone;
+
+
+            this.useSeconds = true;
+
+
+            this.currentFrame = 0;
+
+
+            this.totalFrames = Roo.lib.AnimMgr.fps;
+
+
+            this.getEl = function() {
+                return el;
+            };
+
+
+            this.isAnimated = function() {
+                return isAnimated;
+            };
+
+
+            this.getStartTime = function() {
+                return startTime;
+            };
+
+            this.runtimeAttributes = {};
+
+
+            this.animate = function() {
+                if (this.isAnimated()) {
+                    return false;
+                }
+
+                this.currentFrame = 0;
+
+                this.totalFrames = ( this.useSeconds ) ? Math.ceil(Roo.lib.AnimMgr.fps * this.duration) : this.duration;
+
+                Roo.lib.AnimMgr.registerElement(this);
+            };
+
+
+            this.stop = function(finish) {
+                if (finish) {
+                    this.currentFrame = this.totalFrames;
+                    this._onTween.fire();
+                }
+                Roo.lib.AnimMgr.stop(this);
+            };
+
+            var onStart = function() {
+                this.onStart.fire();
+
+                this.runtimeAttributes = {};
+                for (var attr in this.attributes) {
+                    this.setRuntimeAttribute(attr);
+                }
+
+                isAnimated = true;
+                actualFrames = 0;
+                startTime = new Date();
+            };
+
+
+            var onTween = function() {
+                var data = {
+                    duration: new Date() - this.getStartTime(),
+                    currentFrame: this.currentFrame
+                };
+
+                data.toString = function() {
+                    return (
+                            'duration: ' + data.duration +
+                            ', currentFrame: ' + data.currentFrame
+                            );
+                };
+
+                this.onTween.fire(data);
+
+                var runtimeAttributes = this.runtimeAttributes;
+
+                for (var attr in runtimeAttributes) {
+                    this.setAttribute(attr, this.doMethod(attr, runtimeAttributes[attr].start, runtimeAttributes[attr].end), runtimeAttributes[attr].unit);
+                }
+
+                actualFrames += 1;
+            };
+
+            var onComplete = function() {
+                var actual_duration = (new Date() - startTime) / 1000 ;
+
+                var data = {
+                    duration: actual_duration,
+                    frames: actualFrames,
+                    fps: actualFrames / actual_duration
+                };
+
+                data.toString = function() {
+                    return (
+                            'duration: ' + data.duration +
+                            ', frames: ' + data.frames +
+                            ', fps: ' + data.fps
+                            );
+                };
+
+                isAnimated = false;
+                actualFrames = 0;
+                this.onComplete.fire(data);
+            };
+
+
+            this._onStart = new Roo.util.Event(this);
+            this.onStart = new Roo.util.Event(this);
+            this.onTween = new Roo.util.Event(this);
+            this._onTween = new Roo.util.Event(this);
+            this.onComplete = new Roo.util.Event(this);
+            this._onComplete = new Roo.util.Event(this);
+            this._onStart.addListener(onStart);
+            this._onTween.addListener(onTween);
+            this._onComplete.addListener(onComplete);
+        }
+    };
+})();
\ No newline at end of file
diff --git a/Roo/lib/AnimMgr.js b/Roo/lib/AnimMgr.js
new file mode 100644 (file)
index 0000000..2b1cb6a
--- /dev/null
@@ -0,0 +1,129 @@
+
+/*
+ * Portions of this file are based on pieces of Yahoo User Interface Library
+ * Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+ * YUI licensed under the BSD License:
+ * http://developer.yahoo.net/yui/license.txt
+ * <script type="text/javascript">
+ *
+ */
+
+Roo.lib.AnimMgr = new function() {
+
+        var thread = null;
+
+
+        var queue = [];
+
+
+        var tweenCount = 0;
+
+
+        this.fps = 1000;
+
+
+        this.delay = 1;
+
+
+        this.registerElement = function(tween) {
+            queue[queue.length] = tween;
+            tweenCount += 1;
+            tween._onStart.fire();
+            this.start();
+        };
+
+
+        this.unRegister = function(tween, index) {
+            tween._onComplete.fire();
+            index = index || getIndex(tween);
+            if (index != -1) {
+                queue.splice(index, 1);
+            }
+
+            tweenCount -= 1;
+            if (tweenCount <= 0) {
+                this.stop();
+            }
+        };
+
+
+        this.start = function() {
+            if (thread === null) {
+                thread = setInterval(this.run, this.delay);
+            }
+        };
+
+
+        this.stop = function(tween) {
+            if (!tween) {
+                clearInterval(thread);
+
+                for (var i = 0, len = queue.length; i < len; ++i) {
+                    if (queue[0].isAnimated()) {
+                        this.unRegister(queue[0], 0);
+                    }
+                }
+
+                queue = [];
+                thread = null;
+                tweenCount = 0;
+            }
+            else {
+                this.unRegister(tween);
+            }
+        };
+
+
+        this.run = function() {
+            for (var i = 0, len = queue.length; i < len; ++i) {
+                var tween = queue[i];
+                if (!tween || !tween.isAnimated()) {
+                    continue;
+                }
+
+                if (tween.currentFrame < tween.totalFrames || tween.totalFrames === null)
+                {
+                    tween.currentFrame += 1;
+
+                    if (tween.useSeconds) {
+                        correctFrame(tween);
+                    }
+                    tween._onTween.fire();
+                }
+                else {
+                    Roo.lib.AnimMgr.stop(tween, i);
+                }
+            }
+        };
+
+        var getIndex = function(anim) {
+            for (var i = 0, len = queue.length; i < len; ++i) {
+                if (queue[i] == anim) {
+                    return i;
+                }
+            }
+            return -1;
+        };
+
+
+        var correctFrame = function(tween) {
+            var frames = tween.totalFrames;
+            var frame = tween.currentFrame;
+            var expected = (tween.currentFrame * tween.duration * 1000 / tween.totalFrames);
+            var elapsed = (new Date() - tween.getStartTime());
+            var tweak = 0;
+
+            if (elapsed < tween.duration * 1000) {
+                tweak = Math.round((elapsed / expected - 1) * tween.currentFrame);
+            } else {
+                tweak = frames - (frame + 1);
+            }
+            if (tweak > 0 && isFinite(tweak)) {
+                if (tween.currentFrame + tweak >= frames) {
+                    tweak = frames - (frame + 1);
+                }
+
+                tween.currentFrame += tweak;
+            }
+        };
+    };
\ No newline at end of file
diff --git a/Roo/lib/Beizer.js b/Roo/lib/Beizer.js
new file mode 100644 (file)
index 0000000..dea1885
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * Portions of this file are based on pieces of Yahoo User Interface Library
+ * Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+ * YUI licensed under the BSD License:
+ * http://developer.yahoo.net/yui/license.txt
+ * <script type="text/javascript">
+ *
+ */
+Roo.lib.Bezier = new function() {
+
+        this.getPosition = function(points, t) {
+            var n = points.length;
+            var tmp = [];
+
+            for (var i = 0; i < n; ++i) {
+                tmp[i] = [points[i][0], points[i][1]];
+            }
+
+            for (var j = 1; j < n; ++j) {
+                for (i = 0; i < n - j; ++i) {
+                    tmp[i][0] = (1 - t) * tmp[i][0] + t * tmp[parseInt(i + 1, 10)][0];
+                    tmp[i][1] = (1 - t) * tmp[i][1] + t * tmp[parseInt(i + 1, 10)][1];
+                }
+            }
+
+            return [ tmp[0][0], tmp[0][1] ];
+
+        };
+    };
\ No newline at end of file
diff --git a/Roo/lib/ColorAnim.js b/Roo/lib/ColorAnim.js
new file mode 100644 (file)
index 0000000..a2b42a3
--- /dev/null
@@ -0,0 +1,144 @@
+/*
+ * Portions of this file are based on pieces of Yahoo User Interface Library
+ * Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+ * YUI licensed under the BSD License:
+ * http://developer.yahoo.net/yui/license.txt
+ * <script type="text/javascript">
+ *
+ */
+(function() {
+
+    Roo.lib.ColorAnim = function(el, attributes, duration, method) {
+        Roo.lib.ColorAnim.superclass.constructor.call(this, el, attributes, duration, method);
+    };
+
+    Roo.extend(Roo.lib.ColorAnim, Roo.lib.AnimBase);
+
+    var fly = Roo.lib.AnimBase.fly;
+    var Y = Roo.lib;
+    var superclass = Y.ColorAnim.superclass;
+    var proto = Y.ColorAnim.prototype;
+
+    proto.toString = function() {
+        var el = this.getEl();
+        var id = el.id || el.tagName;
+        return ("ColorAnim " + id);
+    };
+
+    proto.patterns.color = /color$/i;
+    proto.patterns.rgb = /^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i;
+    proto.patterns.hex = /^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i;
+    proto.patterns.hex3 = /^#?([0-9A-F]{1})([0-9A-F]{1})([0-9A-F]{1})$/i;
+    proto.patterns.transparent = /^transparent|rgba\(0, 0, 0, 0\)$/;
+
+
+    proto.parseColor = function(s) {
+        if (s.length == 3) {
+            return s;
+        }
+
+        var c = this.patterns.hex.exec(s);
+        if (c && c.length == 4) {
+            return [ parseInt(c[1], 16), parseInt(c[2], 16), parseInt(c[3], 16) ];
+        }
+
+        c = this.patterns.rgb.exec(s);
+        if (c && c.length == 4) {
+            return [ parseInt(c[1], 10), parseInt(c[2], 10), parseInt(c[3], 10) ];
+        }
+
+        c = this.patterns.hex3.exec(s);
+        if (c && c.length == 4) {
+            return [ parseInt(c[1] + c[1], 16), parseInt(c[2] + c[2], 16), parseInt(c[3] + c[3], 16) ];
+        }
+
+        return null;
+    };
+    // since this uses fly! - it cant be in ColorAnim (which does not have fly yet..)
+    proto.getAttribute = function(attr) {
+        var el = this.getEl();
+        if (this.patterns.color.test(attr)) {
+            var val = fly(el).getStyle(attr);
+
+            if (this.patterns.transparent.test(val)) {
+                var parent = el.parentNode;
+                val = fly(parent).getStyle(attr);
+
+                while (parent && this.patterns.transparent.test(val)) {
+                    parent = parent.parentNode;
+                    val = fly(parent).getStyle(attr);
+                    if (parent.tagName.toUpperCase() == 'HTML') {
+                        val = '#fff';
+                    }
+                }
+            }
+        } else {
+            val = superclass.getAttribute.call(this, attr);
+        }
+
+        return val;
+    };
+    proto.getAttribute = function(attr) {
+        var el = this.getEl();
+        if (this.patterns.color.test(attr)) {
+            var val = fly(el).getStyle(attr);
+
+            if (this.patterns.transparent.test(val)) {
+                var parent = el.parentNode;
+                val = fly(parent).getStyle(attr);
+
+                while (parent && this.patterns.transparent.test(val)) {
+                    parent = parent.parentNode;
+                    val = fly(parent).getStyle(attr);
+                    if (parent.tagName.toUpperCase() == 'HTML') {
+                        val = '#fff';
+                    }
+                }
+            }
+        } else {
+            val = superclass.getAttribute.call(this, attr);
+        }
+
+        return val;
+    };
+
+    proto.doMethod = function(attr, start, end) {
+        var val;
+
+        if (this.patterns.color.test(attr)) {
+            val = [];
+            for (var i = 0, len = start.length; i < len; ++i) {
+                val[i] = superclass.doMethod.call(this, attr, start[i], end[i]);
+            }
+
+            val = 'rgb(' + Math.floor(val[0]) + ',' + Math.floor(val[1]) + ',' + Math.floor(val[2]) + ')';
+        }
+        else {
+            val = superclass.doMethod.call(this, attr, start, end);
+        }
+
+        return val;
+    };
+
+    proto.setRuntimeAttribute = function(attr) {
+        superclass.setRuntimeAttribute.call(this, attr);
+
+        if (this.patterns.color.test(attr)) {
+            var attributes = this.attributes;
+            var start = this.parseColor(this.runtimeAttributes[attr].start);
+            var end = this.parseColor(this.runtimeAttributes[attr].end);
+
+            if (typeof attributes[attr]['to'] === 'undefined' && typeof attributes[attr]['by'] !== 'undefined') {
+                end = this.parseColor(attributes[attr].by);
+
+                for (var i = 0, len = start.length; i < len; ++i) {
+                    end[i] = start[i] + end[i];
+                }
+            }
+
+            this.runtimeAttributes[attr].start = start;
+            this.runtimeAttributes[attr].end = end;
+        }
+    };
+})();
+
diff --git a/Roo/lib/Dom.js b/Roo/lib/Dom.js
new file mode 100644 (file)
index 0000000..ada0fcc
--- /dev/null
@@ -0,0 +1,181 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+
+Roo.lib.Dom = {
+    getViewWidth : function(full) {
+        return full ? this.getDocumentWidth() : this.getViewportWidth();
+    },
+
+    getViewHeight : function(full) {
+        return full ? this.getDocumentHeight() : this.getViewportHeight();
+    },
+
+    getDocumentHeight: function() {
+        var scrollHeight = (document.compatMode != "CSS1Compat") ? document.body.scrollHeight : document.documentElement.scrollHeight;
+        return Math.max(scrollHeight, this.getViewportHeight());
+    },
+
+    getDocumentWidth: function() {
+        var scrollWidth = (document.compatMode != "CSS1Compat") ? document.body.scrollWidth : document.documentElement.scrollWidth;
+        return Math.max(scrollWidth, this.getViewportWidth());
+    },
+
+    getViewportHeight: function() {
+        var height = self.innerHeight;
+        var mode = document.compatMode;
+
+        if ((mode || Roo.isIE) && !Roo.isOpera) {
+            height = (mode == "CSS1Compat") ?
+                     document.documentElement.clientHeight :
+                     document.body.clientHeight;
+        }
+
+        return height;
+    },
+
+    getViewportWidth: function() {
+        var width = self.innerWidth;
+        var mode = document.compatMode;
+
+        if (mode || Roo.isIE) {
+            width = (mode == "CSS1Compat") ?
+                    document.documentElement.clientWidth :
+                    document.body.clientWidth;
+        }
+        return width;
+    },
+
+    isAncestor : function(p, c) {
+        p = Roo.getDom(p);
+        c = Roo.getDom(c);
+        if (!p || !c) {
+            return false;
+        }
+
+        if (p.contains && !Roo.isSafari) {
+            return p.contains(c);
+        } else if (p.compareDocumentPosition) {
+            return !!(p.compareDocumentPosition(c) & 16);
+        } else {
+            var parent = c.parentNode;
+            while (parent) {
+                if (parent == p) {
+                    return true;
+                }
+                else if (!parent.tagName || parent.tagName.toUpperCase() == "HTML") {
+                    return false;
+                }
+                parent = parent.parentNode;
+            }
+            return false;
+        }
+    },
+
+    getRegion : function(el) {
+        return Roo.lib.Region.getRegion(el);
+    },
+
+    getY : function(el) {
+        return this.getXY(el)[1];
+    },
+
+    getX : function(el) {
+        return this.getXY(el)[0];
+    },
+
+    getXY : function(el) {
+        var p, pe, b, scroll, bd = document.body;
+        el = Roo.getDom(el);
+        var fly = Roo.lib.AnimBase.fly;
+        if (el.getBoundingClientRect) {
+            b = el.getBoundingClientRect();
+            scroll = fly(document).getScroll();
+            return [b.left + scroll.left, b.top + scroll.top];
+        }
+        var x = 0, y = 0;
+
+        p = el;
+
+        var hasAbsolute = fly(el).getStyle("position") == "absolute";
+
+        while (p) {
+
+            x += p.offsetLeft;
+            y += p.offsetTop;
+
+            if (!hasAbsolute && fly(p).getStyle("position") == "absolute") {
+                hasAbsolute = true;
+            }
+
+            if (Roo.isGecko) {
+                pe = fly(p);
+
+                var bt = parseInt(pe.getStyle("borderTopWidth"), 10) || 0;
+                var bl = parseInt(pe.getStyle("borderLeftWidth"), 10) || 0;
+
+
+                x += bl;
+                y += bt;
+
+
+                if (p != el && pe.getStyle('overflow') != 'visible') {
+                    x += bl;
+                    y += bt;
+                }
+            }
+            p = p.offsetParent;
+        }
+
+        if (Roo.isSafari && hasAbsolute) {
+            x -= bd.offsetLeft;
+            y -= bd.offsetTop;
+        }
+
+        if (Roo.isGecko && !hasAbsolute) {
+            var dbd = fly(bd);
+            x += parseInt(dbd.getStyle("borderLeftWidth"), 10) || 0;
+            y += parseInt(dbd.getStyle("borderTopWidth"), 10) || 0;
+        }
+
+        p = el.parentNode;
+        while (p && p != bd) {
+            if (!Roo.isOpera || (p.tagName != 'TR' && fly(p).getStyle("display") != "inline")) {
+                x -= p.scrollLeft;
+                y -= p.scrollTop;
+            }
+            p = p.parentNode;
+        }
+        return [x, y];
+    },
+  
+
+
+    setXY : function(el, xy) {
+        el = Roo.fly(el, '_setXY');
+        el.position();
+        var pts = el.translatePoints(xy);
+        if (xy[0] !== false) {
+            el.dom.style.left = pts.left + "px";
+        }
+        if (xy[1] !== false) {
+            el.dom.style.top = pts.top + "px";
+        }
+    },
+
+    setX : function(el, x) {
+        this.setXY(el, [x, false]);
+    },
+
+    setY : function(el, y) {
+        this.setXY(el, [false, y]);
+    }
+};
diff --git a/Roo/lib/Easing.js b/Roo/lib/Easing.js
new file mode 100644 (file)
index 0000000..11b76c1
--- /dev/null
@@ -0,0 +1,184 @@
+/*
+ * Portions of this file are based on pieces of Yahoo User Interface Library
+ * Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+ * YUI licensed under the BSD License:
+ * http://developer.yahoo.net/yui/license.txt
+ * <script type="text/javascript">
+ *
+ */
+Roo.lib.Easing = {
+
+
+    easeNone: function (t, b, c, d) {
+        return c * t / d + b;
+    },
+
+
+    easeIn: function (t, b, c, d) {
+        return c * (t /= d) * t + b;
+    },
+
+
+    easeOut: function (t, b, c, d) {
+        return -c * (t /= d) * (t - 2) + b;
+    },
+
+
+    easeBoth: function (t, b, c, d) {
+        if ((t /= d / 2) < 1) {
+            return c / 2 * t * t + b;
+        }
+
+        return -c / 2 * ((--t) * (t - 2) - 1) + b;
+    },
+
+
+    easeInStrong: function (t, b, c, d) {
+        return c * (t /= d) * t * t * t + b;
+    },
+
+
+    easeOutStrong: function (t, b, c, d) {
+        return -c * ((t = t / d - 1) * t * t * t - 1) + b;
+    },
+
+
+    easeBothStrong: function (t, b, c, d) {
+        if ((t /= d / 2) < 1) {
+            return c / 2 * t * t * t * t + b;
+        }
+
+        return -c / 2 * ((t -= 2) * t * t * t - 2) + b;
+    },
+
+
+
+    elasticIn: function (t, b, c, d, a, p) {
+        if (t == 0) {
+            return b;
+        }
+        if ((t /= d) == 1) {
+            return b + c;
+        }
+        if (!p) {
+            p = d * .3;
+        }
+
+        if (!a || a < Math.abs(c)) {
+            a = c;
+            var s = p / 4;
+        }
+        else {
+            var s = p / (2 * Math.PI) * Math.asin(c / a);
+        }
+
+        return -(a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p)) + b;
+    },
+
+
+    elasticOut: function (t, b, c, d, a, p) {
+        if (t == 0) {
+            return b;
+        }
+        if ((t /= d) == 1) {
+            return b + c;
+        }
+        if (!p) {
+            p = d * .3;
+        }
+
+        if (!a || a < Math.abs(c)) {
+            a = c;
+            var s = p / 4;
+        }
+        else {
+            var s = p / (2 * Math.PI) * Math.asin(c / a);
+        }
+
+        return a * Math.pow(2, -10 * t) * Math.sin((t * d - s) * (2 * Math.PI) / p) + c + b;
+    },
+
+
+    elasticBoth: function (t, b, c, d, a, p) {
+        if (t == 0) {
+            return b;
+        }
+
+        if ((t /= d / 2) == 2) {
+            return b + c;
+        }
+
+        if (!p) {
+            p = d * (.3 * 1.5);
+        }
+
+        if (!a || a < Math.abs(c)) {
+            a = c;
+            var s = p / 4;
+        }
+        else {
+            var s = p / (2 * Math.PI) * Math.asin(c / a);
+        }
+
+        if (t < 1) {
+            return -.5 * (a * Math.pow(2, 10 * (t -= 1)) *
+                          Math.sin((t * d - s) * (2 * Math.PI) / p)) + b;
+        }
+        return a * Math.pow(2, -10 * (t -= 1)) *
+               Math.sin((t * d - s) * (2 * Math.PI) / p) * .5 + c + b;
+    },
+
+
+
+    backIn: function (t, b, c, d, s) {
+        if (typeof s == 'undefined') {
+            s = 1.70158;
+        }
+        return c * (t /= d) * t * ((s + 1) * t - s) + b;
+    },
+
+
+    backOut: function (t, b, c, d, s) {
+        if (typeof s == 'undefined') {
+            s = 1.70158;
+        }
+        return c * ((t = t / d - 1) * t * ((s + 1) * t + s) + 1) + b;
+    },
+
+
+    backBoth: function (t, b, c, d, s) {
+        if (typeof s == 'undefined') {
+            s = 1.70158;
+        }
+
+        if ((t /= d / 2 ) < 1) {
+            return c / 2 * (t * t * (((s *= (1.525)) + 1) * t - s)) + b;
+        }
+        return c / 2 * ((t -= 2) * t * (((s *= (1.525)) + 1) * t + s) + 2) + b;
+    },
+
+
+    bounceIn: function (t, b, c, d) {
+        return c - Roo.lib.Easing.bounceOut(d - t, 0, c, d) + b;
+    },
+
+
+    bounceOut: function (t, b, c, d) {
+        if ((t /= d) < (1 / 2.75)) {
+            return c * (7.5625 * t * t) + b;
+        } else if (t < (2 / 2.75)) {
+            return c * (7.5625 * (t -= (1.5 / 2.75)) * t + .75) + b;
+        } else if (t < (2.5 / 2.75)) {
+            return c * (7.5625 * (t -= (2.25 / 2.75)) * t + .9375) + b;
+        }
+        return c * (7.5625 * (t -= (2.625 / 2.75)) * t + .984375) + b;
+    },
+
+
+    bounceBoth: function (t, b, c, d) {
+        if (t < d / 2) {
+            return Roo.lib.Easing.bounceIn(t * 2, 0, c, d) * .5 + b;
+        }
+        return Roo.lib.Easing.bounceOut(t * 2 - d, 0, c, d) * .5 + c * .5 + b;
+    }
+};
\ No newline at end of file
diff --git a/Roo/lib/Event.js b/Roo/lib/Event.js
new file mode 100644 (file)
index 0000000..0b1197f
--- /dev/null
@@ -0,0 +1,519 @@
+/*
+ * Portions of this file are based on pieces of Yahoo User Interface Library
+ * Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+ * YUI licensed under the BSD License:
+ * http://developer.yahoo.net/yui/license.txt
+ * <script type="text/javascript">
+ *
+ */
+
+Roo.lib.Event = function() {
+    var loadComplete = false;
+    var listeners = [];
+    var unloadListeners = [];
+    var retryCount = 0;
+    var onAvailStack = [];
+    var counter = 0;
+    var lastError = null;
+
+    return {
+        POLL_RETRYS: 200,
+        POLL_INTERVAL: 20,
+        EL: 0,
+        TYPE: 1,
+        FN: 2,
+        WFN: 3,
+        OBJ: 3,
+        ADJ_SCOPE: 4,
+        _interval: null,
+
+        startInterval: function() {
+            if (!this._interval) {
+                var self = this;
+                var callback = function() {
+                    self._tryPreloadAttach();
+                };
+                this._interval = setInterval(callback, this.POLL_INTERVAL);
+
+            }
+        },
+
+        onAvailable: function(p_id, p_fn, p_obj, p_override) {
+            onAvailStack.push({ id:         p_id,
+                fn:         p_fn,
+                obj:        p_obj,
+                override:   p_override,
+                checkReady: false    });
+
+            retryCount = this.POLL_RETRYS;
+            this.startInterval();
+        },
+
+
+        addListener: function(el, eventName, fn) {
+            el = Roo.getDom(el);
+            if (!el || !fn) {
+                return false;
+            }
+
+            if ("unload" == eventName) {
+                unloadListeners[unloadListeners.length] =
+                [el, eventName, fn];
+                return true;
+            }
+
+            var wrappedFn = function(e) {
+                return fn(Roo.lib.Event.getEvent(e));
+            };
+
+            var li = [el, eventName, fn, wrappedFn];
+
+            var index = listeners.length;
+            listeners[index] = li;
+
+            this.doAdd(el, eventName, wrappedFn, false);
+            return true;
+
+        },
+
+
+        removeListener: function(el, eventName, fn) {
+            var i, len;
+
+            el = Roo.getDom(el);
+
+            if(!fn) {
+                return this.purgeElement(el, false, eventName);
+            }
+
+
+            if ("unload" == eventName) {
+
+                for (i = 0,len = unloadListeners.length; i < len; i++) {
+                    var li = unloadListeners[i];
+                    if (li &&
+                        li[0] == el &&
+                        li[1] == eventName &&
+                        li[2] == fn) {
+                        unloadListeners.splice(i, 1);
+                        return true;
+                    }
+                }
+
+                return false;
+            }
+
+            var cacheItem = null;
+
+
+            var index = arguments[3];
+
+            if ("undefined" == typeof index) {
+                index = this._getCacheIndex(el, eventName, fn);
+            }
+
+            if (index >= 0) {
+                cacheItem = listeners[index];
+            }
+
+            if (!el || !cacheItem) {
+                return false;
+            }
+
+            this.doRemove(el, eventName, cacheItem[this.WFN], false);
+
+            delete listeners[index][this.WFN];
+            delete listeners[index][this.FN];
+            listeners.splice(index, 1);
+
+            return true;
+
+        },
+
+
+        getTarget: function(ev, resolveTextNode) {
+            ev = ev.browserEvent || ev;
+            var t = ev.target || ev.srcElement;
+            return this.resolveTextNode(t);
+        },
+
+
+        resolveTextNode: function(node) {
+            if (Roo.isSafari && node && 3 == node.nodeType) {
+                return node.parentNode;
+            } else {
+                return node;
+            }
+        },
+
+
+        getPageX: function(ev) {
+            ev = ev.browserEvent || ev;
+            var x = ev.pageX;
+            if (!x && 0 !== x) {
+                x = ev.clientX || 0;
+
+                if (Roo.isIE) {
+                    x += this.getScroll()[1];
+                }
+            }
+
+            return x;
+        },
+
+
+        getPageY: function(ev) {
+            ev = ev.browserEvent || ev;
+            var y = ev.pageY;
+            if (!y && 0 !== y) {
+                y = ev.clientY || 0;
+
+                if (Roo.isIE) {
+                    y += this.getScroll()[0];
+                }
+            }
+
+
+            return y;
+        },
+
+
+        getXY: function(ev) {
+            ev = ev.browserEvent || ev;
+            return [this.getPageX(ev), this.getPageY(ev)];
+        },
+
+
+        getRelatedTarget: function(ev) {
+            ev = ev.browserEvent || ev;
+            var t = ev.relatedTarget;
+            if (!t) {
+                if (ev.type == "mouseout") {
+                    t = ev.toElement;
+                } else if (ev.type == "mouseover") {
+                    t = ev.fromElement;
+                }
+            }
+
+            return this.resolveTextNode(t);
+        },
+
+
+        getTime: function(ev) {
+            ev = ev.browserEvent || ev;
+            if (!ev.time) {
+                var t = new Date().getTime();
+                try {
+                    ev.time = t;
+                } catch(ex) {
+                    this.lastError = ex;
+                    return t;
+                }
+            }
+
+            return ev.time;
+        },
+
+
+        stopEvent: function(ev) {
+            this.stopPropagation(ev);
+            this.preventDefault(ev);
+        },
+
+
+        stopPropagation: function(ev) {
+            ev = ev.browserEvent || ev;
+            if (ev.stopPropagation) {
+                ev.stopPropagation();
+            } else {
+                ev.cancelBubble = true;
+            }
+        },
+
+
+        preventDefault: function(ev) {
+            ev = ev.browserEvent || ev;
+            if(ev.preventDefault) {
+                ev.preventDefault();
+            } else {
+                ev.returnValue = false;
+            }
+        },
+
+
+        getEvent: function(e) {
+            var ev = e || window.event;
+            if (!ev) {
+                var c = this.getEvent.caller;
+                while (c) {
+                    ev = c.arguments[0];
+                    if (ev && Event == ev.constructor) {
+                        break;
+                    }
+                    c = c.caller;
+                }
+            }
+            return ev;
+        },
+
+
+        getCharCode: function(ev) {
+            ev = ev.browserEvent || ev;
+            return ev.charCode || ev.keyCode || 0;
+        },
+
+
+        _getCacheIndex: function(el, eventName, fn) {
+            for (var i = 0,len = listeners.length; i < len; ++i) {
+                var li = listeners[i];
+                if (li &&
+                    li[this.FN] == fn &&
+                    li[this.EL] == el &&
+                    li[this.TYPE] == eventName) {
+                    return i;
+                }
+            }
+
+            return -1;
+        },
+
+
+        elCache: {},
+
+
+        getEl: function(id) {
+            return document.getElementById(id);
+        },
+
+
+        clearCache: function() {
+        },
+
+
+        _load: function(e) {
+            loadComplete = true;
+            var EU = Roo.lib.Event;
+
+
+            if (Roo.isIE) {
+                EU.doRemove(window, "load", EU._load);
+            }
+        },
+
+
+        _tryPreloadAttach: function() {
+
+            if (this.locked) {
+                return false;
+            }
+
+            this.locked = true;
+
+
+            var tryAgain = !loadComplete;
+            if (!tryAgain) {
+                tryAgain = (retryCount > 0);
+            }
+
+
+            var notAvail = [];
+            for (var i = 0,len = onAvailStack.length; i < len; ++i) {
+                var item = onAvailStack[i];
+                if (item) {
+                    var el = this.getEl(item.id);
+
+                    if (el) {
+                        if (!item.checkReady ||
+                            loadComplete ||
+                            el.nextSibling ||
+                            (document && document.body)) {
+
+                            var scope = el;
+                            if (item.override) {
+                                if (item.override === true) {
+                                    scope = item.obj;
+                                } else {
+                                    scope = item.override;
+                                }
+                            }
+                            item.fn.call(scope, item.obj);
+                            onAvailStack[i] = null;
+                        }
+                    } else {
+                        notAvail.push(item);
+                    }
+                }
+            }
+
+            retryCount = (notAvail.length === 0) ? 0 : retryCount - 1;
+
+            if (tryAgain) {
+
+                this.startInterval();
+            } else {
+                clearInterval(this._interval);
+                this._interval = null;
+            }
+
+            this.locked = false;
+
+            return true;
+
+        },
+
+
+        purgeElement: function(el, recurse, eventName) {
+            var elListeners = this.getListeners(el, eventName);
+            if (elListeners) {
+                for (var i = 0,len = elListeners.length; i < len; ++i) {
+                    var l = elListeners[i];
+                    this.removeListener(el, l.type, l.fn);
+                }
+            }
+
+            if (recurse && el && el.childNodes) {
+                for (i = 0,len = el.childNodes.length; i < len; ++i) {
+                    this.purgeElement(el.childNodes[i], recurse, eventName);
+                }
+            }
+        },
+
+
+        getListeners: function(el, eventName) {
+            var results = [], searchLists;
+            if (!eventName) {
+                searchLists = [listeners, unloadListeners];
+            } else if (eventName == "unload") {
+                searchLists = [unloadListeners];
+            } else {
+                searchLists = [listeners];
+            }
+
+            for (var j = 0; j < searchLists.length; ++j) {
+                var searchList = searchLists[j];
+                if (searchList && searchList.length > 0) {
+                    for (var i = 0,len = searchList.length; i < len; ++i) {
+                        var l = searchList[i];
+                        if (l && l[this.EL] === el &&
+                            (!eventName || eventName === l[this.TYPE])) {
+                            results.push({
+                                type:   l[this.TYPE],
+                                fn:     l[this.FN],
+                                obj:    l[this.OBJ],
+                                adjust: l[this.ADJ_SCOPE],
+                                index:  i
+                            });
+                        }
+                    }
+                }
+            }
+
+            return (results.length) ? results : null;
+        },
+
+
+        _unload: function(e) {
+
+            var EU = Roo.lib.Event, i, j, l, len, index;
+
+            for (i = 0,len = unloadListeners.length; i < len; ++i) {
+                l = unloadListeners[i];
+                if (l) {
+                    var scope = window;
+                    if (l[EU.ADJ_SCOPE]) {
+                        if (l[EU.ADJ_SCOPE] === true) {
+                            scope = l[EU.OBJ];
+                        } else {
+                            scope = l[EU.ADJ_SCOPE];
+                        }
+                    }
+                    l[EU.FN].call(scope, EU.getEvent(e), l[EU.OBJ]);
+                    unloadListeners[i] = null;
+                    l = null;
+                    scope = null;
+                }
+            }
+
+            unloadListeners = null;
+
+            if (listeners && listeners.length > 0) {
+                j = listeners.length;
+                while (j) {
+                    index = j - 1;
+                    l = listeners[index];
+                    if (l) {
+                        EU.removeListener(l[EU.EL], l[EU.TYPE],
+                                l[EU.FN], index);
+                    }
+                    j = j - 1;
+                }
+                l = null;
+
+                EU.clearCache();
+            }
+
+            EU.doRemove(window, "unload", EU._unload);
+
+        },
+
+
+        getScroll: function() {
+            var dd = document.documentElement, db = document.body;
+            if (dd && (dd.scrollTop || dd.scrollLeft)) {
+                return [dd.scrollTop, dd.scrollLeft];
+            } else if (db) {
+                return [db.scrollTop, db.scrollLeft];
+            } else {
+                return [0, 0];
+            }
+        },
+
+
+        doAdd: function () {
+            if (window.addEventListener) {
+                return function(el, eventName, fn, capture) {
+                    el.addEventListener(eventName, fn, (capture));
+                };
+            } else if (window.attachEvent) {
+                return function(el, eventName, fn, capture) {
+                    el.attachEvent("on" + eventName, fn);
+                };
+            } else {
+                return function() {
+                };
+            }
+        }(),
+
+
+        doRemove: function() {
+            if (window.removeEventListener) {
+                return function (el, eventName, fn, capture) {
+                    el.removeEventListener(eventName, fn, (capture));
+                };
+            } else if (window.detachEvent) {
+                return function (el, eventName, fn) {
+                    el.detachEvent("on" + eventName, fn);
+                };
+            } else {
+                return function() {
+                };
+            }
+        }()
+    };
+    
+}();
+(function() {     
+   
+    var E = Roo.lib.Event;
+    E.on = E.addListener;
+    E.un = E.removeListener;
+
+    if (document && document.body) {
+        E._load();
+    } else {
+        E.doAdd(window, "load", E._load);
+    }
+    E.doAdd(window, "unload", E._unload);
+    E._tryPreloadAttach();
+})();
+
diff --git a/Roo/lib/Motion.js b/Roo/lib/Motion.js
new file mode 100644 (file)
index 0000000..53c19af
--- /dev/null
@@ -0,0 +1,137 @@
+/*
+ * Portions of this file are based on pieces of Yahoo User Interface Library
+ * Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+ * YUI licensed under the BSD License:
+ * http://developer.yahoo.net/yui/license.txt
+ * <script type="text/javascript">
+ *
+ */
+    (function() {
+        Roo.lib.Motion = function(el, attributes, duration, method) {
+            if (el) {
+                Roo.lib.Motion.superclass.constructor.call(this, el, attributes, duration, method);
+            }
+        };
+
+        Roo.extend(Roo.lib.Motion, Roo.lib.ColorAnim);
+
+
+        var Y = Roo.lib;
+        var superclass = Y.Motion.superclass;
+        var proto = Y.Motion.prototype;
+
+        proto.toString = function() {
+            var el = this.getEl();
+            var id = el.id || el.tagName;
+            return ("Motion " + id);
+        };
+
+        proto.patterns.points = /^points$/i;
+
+        proto.setAttribute = function(attr, val, unit) {
+            if (this.patterns.points.test(attr)) {
+                unit = unit || 'px';
+                superclass.setAttribute.call(this, 'left', val[0], unit);
+                superclass.setAttribute.call(this, 'top', val[1], unit);
+            } else {
+                superclass.setAttribute.call(this, attr, val, unit);
+            }
+        };
+
+        proto.getAttribute = function(attr) {
+            if (this.patterns.points.test(attr)) {
+                var val = [
+                        superclass.getAttribute.call(this, 'left'),
+                        superclass.getAttribute.call(this, 'top')
+                        ];
+            } else {
+                val = superclass.getAttribute.call(this, attr);
+            }
+
+            return val;
+        };
+
+        proto.doMethod = function(attr, start, end) {
+            var val = null;
+
+            if (this.patterns.points.test(attr)) {
+                var t = this.method(this.currentFrame, 0, 100, this.totalFrames) / 100;
+                val = Y.Bezier.getPosition(this.runtimeAttributes[attr], t);
+            } else {
+                val = superclass.doMethod.call(this, attr, start, end);
+            }
+            return val;
+        };
+
+        proto.setRuntimeAttribute = function(attr) {
+            if (this.patterns.points.test(attr)) {
+                var el = this.getEl();
+                var attributes = this.attributes;
+                var start;
+                var control = attributes['points']['control'] || [];
+                var end;
+                var i, len;
+
+                if (control.length > 0 && !(control[0] instanceof Array)) {
+                    control = [control];
+                } else {
+                    var tmp = [];
+                    for (i = 0,len = control.length; i < len; ++i) {
+                        tmp[i] = control[i];
+                    }
+                    control = tmp;
+                }
+
+                Roo.fly(el).position();
+
+                if (isset(attributes['points']['from'])) {
+                    Roo.lib.Dom.setXY(el, attributes['points']['from']);
+                }
+                else {
+                    Roo.lib.Dom.setXY(el, Roo.lib.Dom.getXY(el));
+                }
+
+                start = this.getAttribute('points');
+
+
+                if (isset(attributes['points']['to'])) {
+                    end = translateValues.call(this, attributes['points']['to'], start);
+
+                    var pageXY = Roo.lib.Dom.getXY(this.getEl());
+                    for (i = 0,len = control.length; i < len; ++i) {
+                        control[i] = translateValues.call(this, control[i], start);
+                    }
+
+
+                } else if (isset(attributes['points']['by'])) {
+                    end = [ start[0] + attributes['points']['by'][0], start[1] + attributes['points']['by'][1] ];
+
+                    for (i = 0,len = control.length; i < len; ++i) {
+                        control[i] = [ start[0] + control[i][0], start[1] + control[i][1] ];
+                    }
+                }
+
+                this.runtimeAttributes[attr] = [start];
+
+                if (control.length > 0) {
+                    this.runtimeAttributes[attr] = this.runtimeAttributes[attr].concat(control);
+                }
+
+                this.runtimeAttributes[attr][this.runtimeAttributes[attr].length] = end;
+            }
+            else {
+                superclass.setRuntimeAttribute.call(this, attr);
+            }
+        };
+
+        var translateValues = function(val, start) {
+            var pageXY = Roo.lib.Dom.getXY(this.getEl());
+            val = [ val[0] - pageXY[0] + start[0], val[1] - pageXY[1] + start[1] ];
+
+            return val;
+        };
+
+        var isset = function(prop) {
+            return (typeof prop !== 'undefined');
+        };
+    })();
diff --git a/Roo/lib/Point.js b/Roo/lib/Point.js
new file mode 100644 (file)
index 0000000..ea27a27
--- /dev/null
@@ -0,0 +1,21 @@
+/*
+ * Portions of this file are based on pieces of Yahoo User Interface Library
+ * Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+ * YUI licensed under the BSD License:
+ * http://developer.yahoo.net/yui/license.txt
+ * <script type="text/javascript">
+ *
+ */
+//@@dep Roo.lib.Region
+
+
+Roo.lib.Point = function(x, y) {
+    if (x instanceof Array) {
+        y = x[1];
+        x = x[0];
+    }
+    this.x = this.right = this.left = this[0] = x;
+    this.y = this.top = this.bottom = this[1] = y;
+};
+
+Roo.lib.Point.prototype = new Roo.lib.Region();
diff --git a/Roo/lib/Region.js b/Roo/lib/Region.js
new file mode 100644 (file)
index 0000000..dfff0e7
--- /dev/null
@@ -0,0 +1,72 @@
+/*
+ * Portions of this file are based on pieces of Yahoo User Interface Library
+ * Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+ * YUI licensed under the BSD License:
+ * http://developer.yahoo.net/yui/license.txt
+ * <script type="text/javascript">
+ *
+ */
+
+Roo.lib.Region = function(t, r, b, l) {
+    this.top = t;
+    this[1] = t;
+    this.right = r;
+    this.bottom = b;
+    this.left = l;
+    this[0] = l;
+};
+
+
+Roo.lib.Region.prototype = {
+    contains : function(region) {
+        return ( region.left >= this.left &&
+                 region.right <= this.right &&
+                 region.top >= this.top &&
+                 region.bottom <= this.bottom    );
+
+    },
+
+    getArea : function() {
+        return ( (this.bottom - this.top) * (this.right - this.left) );
+    },
+
+    intersect : function(region) {
+        var t = Math.max(this.top, region.top);
+        var r = Math.min(this.right, region.right);
+        var b = Math.min(this.bottom, region.bottom);
+        var l = Math.max(this.left, region.left);
+
+        if (b >= t && r >= l) {
+            return new Roo.lib.Region(t, r, b, l);
+        } else {
+            return null;
+        }
+    },
+    union : function(region) {
+        var t = Math.min(this.top, region.top);
+        var r = Math.max(this.right, region.right);
+        var b = Math.max(this.bottom, region.bottom);
+        var l = Math.min(this.left, region.left);
+
+        return new Roo.lib.Region(t, r, b, l);
+    },
+
+    adjust : function(t, l, b, r) {
+        this.top += t;
+        this.left += l;
+        this.right += r;
+        this.bottom += b;
+        return this;
+    }
+};
+
+Roo.lib.Region.getRegion = function(el) {
+    var p = Roo.lib.Dom.getXY(el);
+
+    var t = p[1];
+    var r = p[0] + el.offsetWidth;
+    var b = p[1] + el.offsetHeight;
+    var l = p[0];
+
+    return new Roo.lib.Region(t, r, b, l);
+};
diff --git a/Roo/lib/Scroll.js b/Roo/lib/Scroll.js
new file mode 100644 (file)
index 0000000..d11db8b
--- /dev/null
@@ -0,0 +1,67 @@
+/*
+ * Portions of this file are based on pieces of Yahoo User Interface Library
+ * Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+ * YUI licensed under the BSD License:
+ * http://developer.yahoo.net/yui/license.txt
+ * <script type="text/javascript">
+ *
+ */
+    (function() {
+        Roo.lib.Scroll = function(el, attributes, duration, method) {
+            if (el) {
+                Roo.lib.Scroll.superclass.constructor.call(this, el, attributes, duration, method);
+            }
+        };
+
+        Roo.extend(Roo.lib.Scroll, Roo.lib.ColorAnim);
+
+
+        var Y = Roo.lib;
+        var superclass = Y.Scroll.superclass;
+        var proto = Y.Scroll.prototype;
+
+        proto.toString = function() {
+            var el = this.getEl();
+            var id = el.id || el.tagName;
+            return ("Scroll " + id);
+        };
+
+        proto.doMethod = function(attr, start, end) {
+            var val = null;
+
+            if (attr == 'scroll') {
+                val = [
+                        this.method(this.currentFrame, start[0], end[0] - start[0], this.totalFrames),
+                        this.method(this.currentFrame, start[1], end[1] - start[1], this.totalFrames)
+                        ];
+
+            } else {
+                val = superclass.doMethod.call(this, attr, start, end);
+            }
+            return val;
+        };
+
+        proto.getAttribute = function(attr) {
+            var val = null;
+            var el = this.getEl();
+
+            if (attr == 'scroll') {
+                val = [ el.scrollLeft, el.scrollTop ];
+            } else {
+                val = superclass.getAttribute.call(this, attr);
+            }
+
+            return val;
+        };
+
+        proto.setAttribute = function(attr, val, unit) {
+            var el = this.getEl();
+
+            if (attr == 'scroll') {
+                el.scrollLeft = val[0];
+                el.scrollTop = val[1];
+            } else {
+                superclass.setAttribute.call(this, attr, val, unit);
+            }
+        };
+    })();
diff --git a/Roo/menu/Adapter.js b/Roo/menu/Adapter.js
new file mode 100644 (file)
index 0000000..dfa2389
--- /dev/null
@@ -0,0 +1,61 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+/**
+ * @class Roo.menu.Adapter
+ * @extends Roo.menu.BaseItem
+ * A base utility class that adapts a non-menu component so that it can be wrapped by a menu item and added to a menu.
+ * It provides basic rendering, activation management and enable/disable logic required to work in menus.
+ * @constructor
+ * Creates a new Adapter
+ * @param {Object} config Configuration options
+ */
+Roo.menu.Adapter = function(component, config){
+    Roo.menu.Adapter.superclass.constructor.call(this, config);
+    this.component = component;
+};
+Roo.extend(Roo.menu.Adapter, Roo.menu.BaseItem, {
+    // private
+    canActivate : true,
+
+    // private
+    onRender : function(container, position){
+        this.component.render(container);
+        this.el = this.component.getEl();
+    },
+
+    // private
+    activate : function(){
+        if(this.disabled){
+            return false;
+        }
+        this.component.focus();
+        this.fireEvent("activate", this);
+        return true;
+    },
+
+    // private
+    deactivate : function(){
+        this.fireEvent("deactivate", this);
+    },
+
+    // private
+    disable : function(){
+        this.component.disable();
+        Roo.menu.Adapter.superclass.disable.call(this);
+    },
+
+    // private
+    enable : function(){
+        this.component.enable();
+        Roo.menu.Adapter.superclass.enable.call(this);
+    }
+});
\ No newline at end of file
diff --git a/Roo/menu/BaseItem.js b/Roo/menu/BaseItem.js
new file mode 100644 (file)
index 0000000..5fa7326
--- /dev/null
@@ -0,0 +1,142 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+
+/**
+ * @class Roo.menu.BaseItem
+ * @extends Roo.Component
+ * The base class for all items that render into menus.  BaseItem provides default rendering, activated state
+ * management and base configuration options shared by all menu components.
+ * @constructor
+ * Creates a new BaseItem
+ * @param {Object} config Configuration options
+ */
+Roo.menu.BaseItem = function(config){
+    Roo.menu.BaseItem.superclass.constructor.call(this, config);
+
+    this.addEvents({
+        /**
+         * @event click
+         * Fires when this item is clicked
+         * @param {Roo.menu.BaseItem} this
+         * @param {Roo.EventObject} e
+         */
+        click: true,
+        /**
+         * @event activate
+         * Fires when this item is activated
+         * @param {Roo.menu.BaseItem} this
+         */
+        activate : true,
+        /**
+         * @event deactivate
+         * Fires when this item is deactivated
+         * @param {Roo.menu.BaseItem} this
+         */
+        deactivate : true
+    });
+
+    if(this.handler){
+        this.on("click", this.handler, this.scope, true);
+    }
+};
+
+Roo.extend(Roo.menu.BaseItem, Roo.Component, {
+    /**
+     * @cfg {Function} handler
+     * A function that will handle the click event of this menu item (defaults to undefined)
+     */
+    /**
+     * @cfg {Boolean} canActivate True if this item can be visually activated (defaults to false)
+     */
+    canActivate : false,
+    /**
+     * @cfg {String} activeClass The CSS class to use when the item becomes activated (defaults to "x-menu-item-active")
+     */
+    activeClass : "x-menu-item-active",
+    /**
+     * @cfg {Boolean} hideOnClick True to hide the containing menu after this item is clicked (defaults to true)
+     */
+    hideOnClick : true,
+    /**
+     * @cfg {Number} hideDelay Length of time in milliseconds to wait before hiding after a click (defaults to 100)
+     */
+    hideDelay : 100,
+
+    // private
+    ctype: "Roo.menu.BaseItem",
+
+    // private
+    actionMode : "container",
+
+    // private
+    render : function(container, parentMenu){
+        this.parentMenu = parentMenu;
+        Roo.menu.BaseItem.superclass.render.call(this, container);
+        this.container.menuItemId = this.id;
+    },
+
+    // private
+    onRender : function(container, position){
+        this.el = Roo.get(this.el);
+        container.dom.appendChild(this.el.dom);
+    },
+
+    // private
+    onClick : function(e){
+        if(!this.disabled && this.fireEvent("click", this, e) !== false
+                && this.parentMenu.fireEvent("itemclick", this, e) !== false){
+            this.handleClick(e);
+        }else{
+            e.stopEvent();
+        }
+    },
+
+    // private
+    activate : function(){
+        if(this.disabled){
+            return false;
+        }
+        var li = this.container;
+        li.addClass(this.activeClass);
+        this.region = li.getRegion().adjust(2, 2, -2, -2);
+        this.fireEvent("activate", this);
+        return true;
+    },
+
+    // private
+    deactivate : function(){
+        this.container.removeClass(this.activeClass);
+        this.fireEvent("deactivate", this);
+    },
+
+    // private
+    shouldDeactivate : function(e){
+        return !this.region || !this.region.contains(e.getPoint());
+    },
+
+    // private
+    handleClick : function(e){
+        if(this.hideOnClick){
+            this.parentMenu.hide.defer(this.hideDelay, this.parentMenu, [true]);
+        }
+    },
+
+    // private
+    expandMenu : function(autoActivate){
+        // do nothing
+    },
+
+    // private
+    hideMenu : function(){
+        // do nothing
+    }
+});
\ No newline at end of file
diff --git a/Roo/menu/CheckItem.js b/Roo/menu/CheckItem.js
new file mode 100644 (file)
index 0000000..f15ad76
--- /dev/null
@@ -0,0 +1,112 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+/**
+ * @class Roo.menu.CheckItem
+ * @extends Roo.menu.Item
+ * Adds a menu item that contains a checkbox by default, but can also be part of a radio group.
+ * @constructor
+ * Creates a new CheckItem
+ * @param {Object} config Configuration options
+ */
+Roo.menu.CheckItem = function(config){
+    Roo.menu.CheckItem.superclass.constructor.call(this, config);
+    this.addEvents({
+        /**
+         * @event beforecheckchange
+         * Fires before the checked value is set, providing an opportunity to cancel if needed
+         * @param {Roo.menu.CheckItem} this
+         * @param {Boolean} checked The new checked value that will be set
+         */
+        "beforecheckchange" : true,
+        /**
+         * @event checkchange
+         * Fires after the checked value has been set
+         * @param {Roo.menu.CheckItem} this
+         * @param {Boolean} checked The checked value that was set
+         */
+        "checkchange" : true
+    });
+    if(this.checkHandler){
+        this.on('checkchange', this.checkHandler, this.scope);
+    }
+};
+Roo.extend(Roo.menu.CheckItem, Roo.menu.Item, {
+    /**
+     * @cfg {String} group
+     * All check items with the same group name will automatically be grouped into a single-select
+     * radio button group (defaults to '')
+     */
+    /**
+     * @cfg {String} itemCls The default CSS class to use for check items (defaults to "x-menu-item x-menu-check-item")
+     */
+    itemCls : "x-menu-item x-menu-check-item",
+    /**
+     * @cfg {String} groupClass The default CSS class to use for radio group check items (defaults to "x-menu-group-item")
+     */
+    groupClass : "x-menu-group-item",
+
+    /**
+     * @cfg {Boolean} checked True to initialize this checkbox as checked (defaults to false).  Note that
+     * if this checkbox is part of a radio group (group = true) only the last item in the group that is
+     * initialized with checked = true will be rendered as checked.
+     */
+    checked: false,
+
+    // private
+    ctype: "Roo.menu.CheckItem",
+
+    // private
+    onRender : function(c){
+        Roo.menu.CheckItem.superclass.onRender.apply(this, arguments);
+        if(this.group){
+            this.el.addClass(this.groupClass);
+        }
+        Roo.menu.MenuMgr.registerCheckable(this);
+        if(this.checked){
+            this.checked = false;
+            this.setChecked(true, true);
+        }
+    },
+
+    // private
+    destroy : function(){
+        if(this.rendered){
+            Roo.menu.MenuMgr.unregisterCheckable(this);
+        }
+        Roo.menu.CheckItem.superclass.destroy.apply(this, arguments);
+    },
+
+    /**
+     * Set the checked state of this item
+     * @param {Boolean} checked The new checked value
+     * @param {Boolean} suppressEvent (optional) True to prevent the checkchange event from firing (defaults to false)
+     */
+    setChecked : function(state, suppressEvent){
+        if(this.checked != state && this.fireEvent("beforecheckchange", this, state) !== false){
+            if(this.container){
+                this.container[state ? "addClass" : "removeClass"]("x-menu-item-checked");
+            }
+            this.checked = state;
+            if(suppressEvent !== true){
+                this.fireEvent("checkchange", this, state);
+            }
+        }
+    },
+
+    // private
+    handleClick : function(e){
+       if(!this.disabled && !(this.checked && this.group)){// disable unselect on radio item
+           this.setChecked(!this.checked);
+       }
+       Roo.menu.CheckItem.superclass.handleClick.apply(this, arguments);
+    }
+});
\ No newline at end of file
diff --git a/Roo/menu/ColorItem.js b/Roo/menu/ColorItem.js
new file mode 100644 (file)
index 0000000..d7c002c
--- /dev/null
@@ -0,0 +1,29 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+/**
+ * @class Roo.menu.ColorItem
+ * @extends Roo.menu.Adapter
+ * A menu item that wraps the {@link Roo.ColorPalette} component.
+ * @constructor
+ * Creates a new ColorItem
+ * @param {Object} config Configuration options
+ */
+Roo.menu.ColorItem = function(config){
+    Roo.menu.ColorItem.superclass.constructor.call(this, new Roo.ColorPalette(config), config);
+    /** The Roo.ColorPalette object @type Roo.ColorPalette */
+    this.palette = this.component;
+    this.relayEvents(this.palette, ["select"]);
+    if(this.selectHandler){
+        this.on('select', this.selectHandler, this.scope);
+    }
+};
+Roo.extend(Roo.menu.ColorItem, Roo.menu.Adapter);
\ No newline at end of file
diff --git a/Roo/menu/ColorMenu.js b/Roo/menu/ColorMenu.js
new file mode 100644 (file)
index 0000000..5500661
--- /dev/null
@@ -0,0 +1,38 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+
+/**
+ * @class Roo.menu.ColorMenu
+ * @extends Roo.menu.Menu
+ * A menu containing a {@link Roo.menu.ColorItem} component (which provides a basic color picker).
+ * @constructor
+ * Creates a new ColorMenu
+ * @param {Object} config Configuration options
+ */
+Roo.menu.ColorMenu = function(config){
+    Roo.menu.ColorMenu.superclass.constructor.call(this, config);
+    this.plain = true;
+    var ci = new Roo.menu.ColorItem(config);
+    this.add(ci);
+    /**
+     * The {@link Roo.ColorPalette} instance for this ColorMenu
+     * @type ColorPalette
+     */
+    this.palette = ci.palette;
+    /**
+     * @event select
+     * @param {ColorPalette} palette
+     * @param {String} color
+     */
+    this.relayEvents(ci, ["select"]);
+};
+Roo.extend(Roo.menu.ColorMenu, Roo.menu.Menu);
\ No newline at end of file
diff --git a/Roo/menu/DateItem.js b/Roo/menu/DateItem.js
new file mode 100644 (file)
index 0000000..99de776
--- /dev/null
@@ -0,0 +1,40 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+/**
+ * @class Roo.menu.DateItem
+ * @extends Roo.menu.Adapter
+ * A menu item that wraps the {@link Roo.DatPicker} component.
+ * @constructor
+ * Creates a new DateItem
+ * @param {Object} config Configuration options
+ */
+Roo.menu.DateItem = function(config){
+    Roo.menu.DateItem.superclass.constructor.call(this, new Roo.DatePicker(config), config);
+    /** The Roo.DatePicker object @type Roo.DatePicker */
+    this.picker = this.component;
+    this.addEvents({select: true});
+    
+    this.picker.on("render", function(picker){
+        picker.getEl().swallowEvent("click");
+        picker.container.addClass("x-menu-date-item");
+    });
+
+    this.picker.on("select", this.onSelect, this);
+};
+
+Roo.extend(Roo.menu.DateItem, Roo.menu.Adapter, {
+    // private
+    onSelect : function(picker, date){
+        this.fireEvent("select", this, date, picker);
+        Roo.menu.DateItem.superclass.handleClick.call(this);
+    }
+});
\ No newline at end of file
diff --git a/Roo/menu/DateMenu.js b/Roo/menu/DateMenu.js
new file mode 100644 (file)
index 0000000..e7b13fe
--- /dev/null
@@ -0,0 +1,46 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+
+/**
+ * @class Roo.menu.DateMenu
+ * @extends Roo.menu.Menu
+ * A menu containing a {@link Roo.menu.DateItem} component (which provides a date picker).
+ * @constructor
+ * Creates a new DateMenu
+ * @param {Object} config Configuration options
+ */
+Roo.menu.DateMenu = function(config){
+    Roo.menu.DateMenu.superclass.constructor.call(this, config);
+    this.plain = true;
+    var di = new Roo.menu.DateItem(config);
+    this.add(di);
+    /**
+     * The {@link Roo.DatePicker} instance for this DateMenu
+     * @type DatePicker
+     */
+    this.picker = di.picker;
+    /**
+     * @event select
+     * @param {DatePicker} picker
+     * @param {Date} date
+     */
+    this.relayEvents(di, ["select"]);
+
+    this.on('beforeshow', function(){
+        if(this.picker){
+            this.picker.hideMonthPicker(true);
+        }
+    }, this);
+};
+Roo.extend(Roo.menu.DateMenu, Roo.menu.Menu, {
+    cls:'x-date-menu'
+});
\ No newline at end of file
diff --git a/Roo/menu/Item.js b/Roo/menu/Item.js
new file mode 100644 (file)
index 0000000..75620a0
--- /dev/null
@@ -0,0 +1,153 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+/**
+ * @class Roo.menu.Item
+ * @extends Roo.menu.BaseItem
+ * A base class for all menu items that require menu-related functionality (like sub-menus) and are not static
+ * display items.  Item extends the base functionality of {@link Roo.menu.BaseItem} by adding menu-specific
+ * activation and click handling.
+ * @constructor
+ * Creates a new Item
+ * @param {Object} config Configuration options
+ */
+Roo.menu.Item = function(config){
+    Roo.menu.Item.superclass.constructor.call(this, config);
+    if(this.menu){
+        this.menu = Roo.menu.MenuMgr.get(this.menu);
+    }
+};
+Roo.extend(Roo.menu.Item, Roo.menu.BaseItem, {
+    /**
+     * @cfg {String} icon
+     * The path to an icon to display in this menu item (defaults to Roo.BLANK_IMAGE_URL)
+     */
+    /**
+     * @cfg {String} itemCls The default CSS class to use for menu items (defaults to "x-menu-item")
+     */
+    itemCls : "x-menu-item",
+    /**
+     * @cfg {Boolean} canActivate True if this item can be visually activated (defaults to true)
+     */
+    canActivate : true,
+    /**
+     * @cfg {Number} showDelay Length of time in milliseconds to wait before showing this item (defaults to 200)
+     */
+    showDelay: 200,
+    // doc'd in BaseItem
+    hideDelay: 200,
+
+    // private
+    ctype: "Roo.menu.Item",
+    
+    // private
+    onRender : function(container, position){
+        var el = document.createElement("a");
+        el.hideFocus = true;
+        el.unselectable = "on";
+        el.href = this.href || "#";
+        if(this.hrefTarget){
+            el.target = this.hrefTarget;
+        }
+        el.className = this.itemCls + (this.menu ?  " x-menu-item-arrow" : "") + (this.cls ?  " " + this.cls : "");
+        el.innerHTML = String.format(
+                '<img src="{0}" class="x-menu-item-icon {2}" />{1}',
+                this.icon || Roo.BLANK_IMAGE_URL, this.text, this.iconCls || '');
+        this.el = el;
+        Roo.menu.Item.superclass.onRender.call(this, container, position);
+    },
+
+    /**
+     * Sets the text to display in this menu item
+     * @param {String} text The text to display
+     */
+    setText : function(text){
+        this.text = text;
+        if(this.rendered){
+            this.el.update(String.format(
+                '<img src="{0}" class="x-menu-item-icon {2}">{1}',
+                this.icon || Roo.BLANK_IMAGE_URL, this.text, this.iconCls || ''));
+            this.parentMenu.autoWidth();
+        }
+    },
+
+    // private
+    handleClick : function(e){
+        if(!this.href){ // if no link defined, stop the event automatically
+            e.stopEvent();
+        }
+        Roo.menu.Item.superclass.handleClick.apply(this, arguments);
+    },
+
+    // private
+    activate : function(autoExpand){
+        if(Roo.menu.Item.superclass.activate.apply(this, arguments)){
+            this.focus();
+            if(autoExpand){
+                this.expandMenu();
+            }
+        }
+        return true;
+    },
+
+    // private
+    shouldDeactivate : function(e){
+        if(Roo.menu.Item.superclass.shouldDeactivate.call(this, e)){
+            if(this.menu && this.menu.isVisible()){
+                return !this.menu.getEl().getRegion().contains(e.getPoint());
+            }
+            return true;
+        }
+        return false;
+    },
+
+    // private
+    deactivate : function(){
+        Roo.menu.Item.superclass.deactivate.apply(this, arguments);
+        this.hideMenu();
+    },
+
+    // private
+    expandMenu : function(autoActivate){
+        if(!this.disabled && this.menu){
+            clearTimeout(this.hideTimer);
+            delete this.hideTimer;
+            if(!this.menu.isVisible() && !this.showTimer){
+                this.showTimer = this.deferExpand.defer(this.showDelay, this, [autoActivate]);
+            }else if (this.menu.isVisible() && autoActivate){
+                this.menu.tryActivate(0, 1);
+            }
+        }
+    },
+
+    // private
+    deferExpand : function(autoActivate){
+        delete this.showTimer;
+        this.menu.show(this.container, this.parentMenu.subMenuAlign || "tl-tr?", this.parentMenu);
+        if(autoActivate){
+            this.menu.tryActivate(0, 1);
+        }
+    },
+
+    // private
+    hideMenu : function(){
+        clearTimeout(this.showTimer);
+        delete this.showTimer;
+        if(!this.hideTimer && this.menu && this.menu.isVisible()){
+            this.hideTimer = this.deferHide.defer(this.hideDelay, this);
+        }
+    },
+
+    // private
+    deferHide : function(){
+        delete this.hideTimer;
+        this.menu.hide();
+    }
+});
\ No newline at end of file
diff --git a/Roo/menu/Menu.js b/Roo/menu/Menu.js
new file mode 100644 (file)
index 0000000..2f3c87f
--- /dev/null
@@ -0,0 +1,539 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+/**
+ * @class Roo.menu.Menu
+ * @extends Roo.util.Observable
+ * A menu object.  This is the container to which you add all other menu items.  Menu can also serve a as a base class
+ * when you want a specialzed menu based off of another component (like {@link Roo.menu.DateMenu} for example).
+ * @constructor
+ * Creates a new Menu
+ * @param {Object} config Configuration options
+ */
+Roo.menu.Menu = function(config){
+    Roo.apply(this, config);
+    this.id = this.id || Roo.id();
+    this.addEvents({
+        /**
+         * @event beforeshow
+         * Fires before this menu is displayed
+         * @param {Roo.menu.Menu} this
+         */
+        beforeshow : true,
+        /**
+         * @event beforehide
+         * Fires before this menu is hidden
+         * @param {Roo.menu.Menu} this
+         */
+        beforehide : true,
+        /**
+         * @event show
+         * Fires after this menu is displayed
+         * @param {Roo.menu.Menu} this
+         */
+        show : true,
+        /**
+         * @event hide
+         * Fires after this menu is hidden
+         * @param {Roo.menu.Menu} this
+         */
+        hide : true,
+        /**
+         * @event click
+         * Fires when this menu is clicked (or when the enter key is pressed while it is active)
+         * @param {Roo.menu.Menu} this
+         * @param {Roo.menu.Item} menuItem The menu item that was clicked
+         * @param {Roo.EventObject} e
+         */
+        click : true,
+        /**
+         * @event mouseover
+         * Fires when the mouse is hovering over this menu
+         * @param {Roo.menu.Menu} this
+         * @param {Roo.EventObject} e
+         * @param {Roo.menu.Item} menuItem The menu item that was clicked
+         */
+        mouseover : true,
+        /**
+         * @event mouseout
+         * Fires when the mouse exits this menu
+         * @param {Roo.menu.Menu} this
+         * @param {Roo.EventObject} e
+         * @param {Roo.menu.Item} menuItem The menu item that was clicked
+         */
+        mouseout : true,
+        /**
+         * @event itemclick
+         * Fires when a menu item contained in this menu is clicked
+         * @param {Roo.menu.BaseItem} baseItem The BaseItem that was clicked
+         * @param {Roo.EventObject} e
+         */
+        itemclick: true
+    });
+    if (this.registerMenu) {
+        Roo.menu.MenuMgr.register(this);
+    }
+    
+    var mis = this.items;
+    this.items = new Roo.util.MixedCollection();
+    if(mis){
+        this.add.apply(this, mis);
+    }
+};
+
+Roo.extend(Roo.menu.Menu, Roo.util.Observable, {
+    /**
+     * @cfg {Number} minWidth The minimum width of the menu in pixels (defaults to 120)
+     */
+    minWidth : 120,
+    /**
+     * @cfg {Boolean/String} shadow True or "sides" for the default effect, "frame" for 4-way shadow, and "drop"
+     * for bottom-right shadow (defaults to "sides")
+     */
+    shadow : "sides",
+    /**
+     * @cfg {String} subMenuAlign The {@link Roo.Element#alignTo} anchor position value to use for submenus of
+     * this menu (defaults to "tl-tr?")
+     */
+    subMenuAlign : "tl-tr?",
+    /**
+     * @cfg {String} defaultAlign The default {@link Roo.Element#alignTo) anchor position value for this menu
+     * relative to its element of origin (defaults to "tl-bl?")
+     */
+    defaultAlign : "tl-bl?",
+    /**
+     * @cfg {Boolean} allowOtherMenus True to allow multiple menus to be displayed at the same time (defaults to false)
+     */
+    allowOtherMenus : false,
+    /**
+     * @cfg {Boolean} registerMenu True (default) - means that clicking on screen etc. hides it.
+     */
+    registerMenu : true,
+
+    hidden:true,
+
+    // private
+    render : function(){
+        if(this.el){
+            return;
+        }
+        var el = this.el = new Roo.Layer({
+            cls: "x-menu",
+            shadow:this.shadow,
+            constrain: false,
+            parentEl: this.parentEl || document.body,
+            zindex:15000
+        });
+
+        this.keyNav = new Roo.menu.MenuNav(this);
+
+        if(this.plain){
+            el.addClass("x-menu-plain");
+        }
+        if(this.cls){
+            el.addClass(this.cls);
+        }
+        // generic focus element
+        this.focusEl = el.createChild({
+            tag: "a", cls: "x-menu-focus", href: "#", onclick: "return false;", tabIndex:"-1"
+        });
+        var ul = el.createChild({tag: "ul", cls: "x-menu-list"});
+        ul.on("click", this.onClick, this);
+        ul.on("mouseover", this.onMouseOver, this);
+        ul.on("mouseout", this.onMouseOut, this);
+        this.items.each(function(item){
+            var li = document.createElement("li");
+            li.className = "x-menu-list-item";
+            ul.dom.appendChild(li);
+            item.render(li, this);
+        }, this);
+        this.ul = ul;
+        this.autoWidth();
+    },
+
+    // private
+    autoWidth : function(){
+        var el = this.el, ul = this.ul;
+        if(!el){
+            return;
+        }
+        var w = this.width;
+        if(w){
+            el.setWidth(w);
+        }else if(Roo.isIE){
+            el.setWidth(this.minWidth);
+            var t = el.dom.offsetWidth; // force recalc
+            el.setWidth(ul.getWidth()+el.getFrameWidth("lr"));
+        }
+    },
+
+    // private
+    delayAutoWidth : function(){
+        if(this.rendered){
+            if(!this.awTask){
+                this.awTask = new Roo.util.DelayedTask(this.autoWidth, this);
+            }
+            this.awTask.delay(20);
+        }
+    },
+
+    // private
+    findTargetItem : function(e){
+        var t = e.getTarget(".x-menu-list-item", this.ul,  true);
+        if(t && t.menuItemId){
+            return this.items.get(t.menuItemId);
+        }
+    },
+
+    // private
+    onClick : function(e){
+        var t;
+        if(t = this.findTargetItem(e)){
+            t.onClick(e);
+            this.fireEvent("click", this, t, e);
+        }
+    },
+
+    // private
+    setActiveItem : function(item, autoExpand){
+        if(item != this.activeItem){
+            if(this.activeItem){
+                this.activeItem.deactivate();
+            }
+            this.activeItem = item;
+            item.activate(autoExpand);
+        }else if(autoExpand){
+            item.expandMenu();
+        }
+    },
+
+    // private
+    tryActivate : function(start, step){
+        var items = this.items;
+        for(var i = start, len = items.length; i >= 0 && i < len; i+= step){
+            var item = items.get(i);
+            if(!item.disabled && item.canActivate){
+                this.setActiveItem(item, false);
+                return item;
+            }
+        }
+        return false;
+    },
+
+    // private
+    onMouseOver : function(e){
+        var t;
+        if(t = this.findTargetItem(e)){
+            if(t.canActivate && !t.disabled){
+                this.setActiveItem(t, true);
+            }
+        }
+        this.fireEvent("mouseover", this, e, t);
+    },
+
+    // private
+    onMouseOut : function(e){
+        var t;
+        if(t = this.findTargetItem(e)){
+            if(t == this.activeItem && t.shouldDeactivate(e)){
+                this.activeItem.deactivate();
+                delete this.activeItem;
+            }
+        }
+        this.fireEvent("mouseout", this, e, t);
+    },
+
+    /**
+     * Read-only.  Returns true if the menu is currently displayed, else false.
+     * @type Boolean
+     */
+    isVisible : function(){
+        return this.el && !this.hidden;
+    },
+
+    /**
+     * Displays this menu relative to another element
+     * @param {String/HTMLElement/Roo.Element} element The element to align to
+     * @param {String} position (optional) The {@link Roo.Element#alignTo} anchor position to use in aligning to
+     * the element (defaults to this.defaultAlign)
+     * @param {Roo.menu.Menu} parentMenu (optional) This menu's parent menu, if applicable (defaults to undefined)
+     */
+    show : function(el, pos, parentMenu){
+        this.parentMenu = parentMenu;
+        if(!this.el){
+            this.render();
+        }
+        this.fireEvent("beforeshow", this);
+        this.showAt(this.el.getAlignToXY(el, pos || this.defaultAlign), parentMenu, false);
+    },
+
+    /**
+     * Displays this menu at a specific xy position
+     * @param {Array} xyPosition Contains X & Y [x, y] values for the position at which to show the menu (coordinates are page-based)
+     * @param {Roo.menu.Menu} parentMenu (optional) This menu's parent menu, if applicable (defaults to undefined)
+     */
+    showAt : function(xy, parentMenu, /* private: */_e){
+        this.parentMenu = parentMenu;
+        if(!this.el){
+            this.render();
+        }
+        if(_e !== false){
+            this.fireEvent("beforeshow", this);
+            xy = this.el.adjustForConstraints(xy);
+        }
+        this.el.setXY(xy);
+        this.el.show();
+        this.hidden = false;
+        this.focus();
+        this.fireEvent("show", this);
+    },
+
+    focus : function(){
+        if(!this.hidden){
+            this.doFocus.defer(50, this);
+        }
+    },
+
+    doFocus : function(){
+        if(!this.hidden){
+            this.focusEl.focus();
+        }
+    },
+
+    /**
+     * Hides this menu and optionally all parent menus
+     * @param {Boolean} deep (optional) True to hide all parent menus recursively, if any (defaults to false)
+     */
+    hide : function(deep){
+        if(this.el && this.isVisible()){
+            this.fireEvent("beforehide", this);
+            if(this.activeItem){
+                this.activeItem.deactivate();
+                this.activeItem = null;
+            }
+            this.el.hide();
+            this.hidden = true;
+            this.fireEvent("hide", this);
+        }
+        if(deep === true && this.parentMenu){
+            this.parentMenu.hide(true);
+        }
+    },
+
+    /**
+     * Addds one or more items of any type supported by the Menu class, or that can be converted into menu items.
+     * Any of the following are valid:
+     * <ul>
+     * <li>Any menu item object based on {@link Roo.menu.Item}</li>
+     * <li>An HTMLElement object which will be converted to a menu item</li>
+     * <li>A menu item config object that will be created as a new menu item</li>
+     * <li>A string, which can either be '-' or 'separator' to add a menu separator, otherwise
+     * it will be converted into a {@link Roo.menu.TextItem} and added</li>
+     * </ul>
+     * Usage:
+     * <pre><code>
+// Create the menu
+var menu = new Roo.menu.Menu();
+
+// Create a menu item to add by reference
+var menuItem = new Roo.menu.Item({ text: 'New Item!' });
+
+// Add a bunch of items at once using different methods.
+// Only the last item added will be returned.
+var item = menu.add(
+    menuItem,                // add existing item by ref
+    'Dynamic Item',          // new TextItem
+    '-',                     // new separator
+    { text: 'Config Item' }  // new item by config
+);
+</code></pre>
+     * @param {Mixed} args One or more menu items, menu item configs or other objects that can be converted to menu items
+     * @return {Roo.menu.Item} The menu item that was added, or the last one if multiple items were added
+     */
+    add : function(){
+        var a = arguments, l = a.length, item;
+        for(var i = 0; i < l; i++){
+            var el = a[i];
+            if(el.render){ // some kind of Item
+                item = this.addItem(el);
+            }else if(typeof el == "string"){ // string
+                if(el == "separator" || el == "-"){
+                    item = this.addSeparator();
+                }else{
+                    item = this.addText(el);
+                }
+            }else if(el.tagName || el.el){ // element
+                item = this.addElement(el);
+            }else if(typeof el == "object"){ // must be menu item config?
+                item = this.addMenuItem(el);
+            }
+        }
+        return item;
+    },
+
+    /**
+     * Returns this menu's underlying {@link Roo.Element} object
+     * @return {Roo.Element} The element
+     */
+    getEl : function(){
+        if(!this.el){
+            this.render();
+        }
+        return this.el;
+    },
+
+    /**
+     * Adds a separator bar to the menu
+     * @return {Roo.menu.Item} The menu item that was added
+     */
+    addSeparator : function(){
+        return this.addItem(new Roo.menu.Separator());
+    },
+
+    /**
+     * Adds an {@link Roo.Element} object to the menu
+     * @param {String/HTMLElement/Roo.Element} el The element or DOM node to add, or its id
+     * @return {Roo.menu.Item} The menu item that was added
+     */
+    addElement : function(el){
+        return this.addItem(new Roo.menu.BaseItem(el));
+    },
+
+    /**
+     * Adds an existing object based on {@link Roo.menu.Item} to the menu
+     * @param {Roo.menu.Item} item The menu item to add
+     * @return {Roo.menu.Item} The menu item that was added
+     */
+    addItem : function(item){
+        this.items.add(item);
+        if(this.ul){
+            var li = document.createElement("li");
+            li.className = "x-menu-list-item";
+            this.ul.dom.appendChild(li);
+            item.render(li, this);
+            this.delayAutoWidth();
+        }
+        return item;
+    },
+
+    /**
+     * Creates a new {@link Roo.menu.Item} based an the supplied config object and adds it to the menu
+     * @param {Object} config A MenuItem config object
+     * @return {Roo.menu.Item} The menu item that was added
+     */
+    addMenuItem : function(config){
+        if(!(config instanceof Roo.menu.Item)){
+            if(typeof config.checked == "boolean"){ // must be check menu item config?
+                config = new Roo.menu.CheckItem(config);
+            }else{
+                config = new Roo.menu.Item(config);
+            }
+        }
+        return this.addItem(config);
+    },
+
+    /**
+     * Creates a new {@link Roo.menu.TextItem} with the supplied text and adds it to the menu
+     * @param {String} text The text to display in the menu item
+     * @return {Roo.menu.Item} The menu item that was added
+     */
+    addText : function(text){
+        return this.addItem(new Roo.menu.TextItem(text));
+    },
+
+    /**
+     * Inserts an existing object based on {@link Roo.menu.Item} to the menu at a specified index
+     * @param {Number} index The index in the menu's list of current items where the new item should be inserted
+     * @param {Roo.menu.Item} item The menu item to add
+     * @return {Roo.menu.Item} The menu item that was added
+     */
+    insert : function(index, item){
+        this.items.insert(index, item);
+        if(this.ul){
+            var li = document.createElement("li");
+            li.className = "x-menu-list-item";
+            this.ul.dom.insertBefore(li, this.ul.dom.childNodes[index]);
+            item.render(li, this);
+            this.delayAutoWidth();
+        }
+        return item;
+    },
+
+    /**
+     * Removes an {@link Roo.menu.Item} from the menu and destroys the object
+     * @param {Roo.menu.Item} item The menu item to remove
+     */
+    remove : function(item){
+        this.items.removeKey(item.id);
+        item.destroy();
+    },
+
+    /**
+     * Removes and destroys all items in the menu
+     */
+    removeAll : function(){
+        var f;
+        while(f = this.items.first()){
+            this.remove(f);
+        }
+    }
+});
+
+// MenuNav is a private utility class used internally by the Menu
+Roo.menu.MenuNav = function(menu){
+    Roo.menu.MenuNav.superclass.constructor.call(this, menu.el);
+    this.scope = this.menu = menu;
+};
+
+Roo.extend(Roo.menu.MenuNav, Roo.KeyNav, {
+    doRelay : function(e, h){
+        var k = e.getKey();
+        if(!this.menu.activeItem && e.isNavKeyPress() && k != e.SPACE && k != e.RETURN){
+            this.menu.tryActivate(0, 1);
+            return false;
+        }
+        return h.call(this.scope || this, e, this.menu);
+    },
+
+    up : function(e, m){
+        if(!m.tryActivate(m.items.indexOf(m.activeItem)-1, -1)){
+            m.tryActivate(m.items.length-1, -1);
+        }
+    },
+
+    down : function(e, m){
+        if(!m.tryActivate(m.items.indexOf(m.activeItem)+1, 1)){
+            m.tryActivate(0, 1);
+        }
+    },
+
+    right : function(e, m){
+        if(m.activeItem){
+            m.activeItem.expandMenu(true);
+        }
+    },
+
+    left : function(e, m){
+        m.hide();
+        if(m.parentMenu && m.parentMenu.activeItem){
+            m.parentMenu.activeItem.activate();
+        }
+    },
+
+    enter : function(e, m){
+        if(m.activeItem){
+            e.stopPropagation();
+            m.activeItem.onClick(e);
+            m.fireEvent("click", this, m.activeItem);
+            return true;
+        }
+    }
+});
\ No newline at end of file
diff --git a/Roo/menu/MenuMgr.js b/Roo/menu/MenuMgr.js
new file mode 100644 (file)
index 0000000..e182cc2
--- /dev/null
@@ -0,0 +1,188 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+/**
+ * @class Roo.menu.MenuMgr
+ * Provides a common registry of all menu items on a page so that they can be easily accessed by id.
+ * @singleton
+ */
+Roo.menu.MenuMgr = function(){
+   var menus, active, groups = {}, attached = false, lastShow = new Date();
+
+   // private - called when first menu is created
+   function init(){
+       menus = {};
+       active = new Roo.util.MixedCollection();
+       Roo.get(document).addKeyListener(27, function(){
+           if(active.length > 0){
+               hideAll();
+           }
+       });
+   }
+
+   // private
+   function hideAll(){
+       if(active && active.length > 0){
+           var c = active.clone();
+           c.each(function(m){
+               m.hide();
+           });
+       }
+   }
+
+   // private
+   function onHide(m){
+       active.remove(m);
+       if(active.length < 1){
+           Roo.get(document).un("mousedown", onMouseDown);
+           attached = false;
+       }
+   }
+
+   // private
+   function onShow(m){
+       var last = active.last();
+       lastShow = new Date();
+       active.add(m);
+       if(!attached){
+           Roo.get(document).on("mousedown", onMouseDown);
+           attached = true;
+       }
+       if(m.parentMenu){
+          m.getEl().setZIndex(parseInt(m.parentMenu.getEl().getStyle("z-index"), 10) + 3);
+          m.parentMenu.activeChild = m;
+       }else if(last && last.isVisible()){
+          m.getEl().setZIndex(parseInt(last.getEl().getStyle("z-index"), 10) + 3);
+       }
+   }
+
+   // private
+   function onBeforeHide(m){
+       if(m.activeChild){
+           m.activeChild.hide();
+       }
+       if(m.autoHideTimer){
+           clearTimeout(m.autoHideTimer);
+           delete m.autoHideTimer;
+       }
+   }
+
+   // private
+   function onBeforeShow(m){
+       var pm = m.parentMenu;
+       if(!pm && !m.allowOtherMenus){
+           hideAll();
+       }else if(pm && pm.activeChild && active != m){
+           pm.activeChild.hide();
+       }
+   }
+
+   // private
+   function onMouseDown(e){
+       if(lastShow.getElapsed() > 50 && active.length > 0 && !e.getTarget(".x-menu")){
+           hideAll();
+       }
+   }
+
+   // private
+   function onBeforeCheck(mi, state){
+       if(state){
+           var g = groups[mi.group];
+           for(var i = 0, l = g.length; i < l; i++){
+               if(g[i] != mi){
+                   g[i].setChecked(false);
+               }
+           }
+       }
+   }
+
+   return {
+
+       /**
+        * Hides all menus that are currently visible
+        */
+       hideAll : function(){
+            hideAll();  
+       },
+
+       // private
+       register : function(menu){
+           if(!menus){
+               init();
+           }
+           menus[menu.id] = menu;
+           menu.on("beforehide", onBeforeHide);
+           menu.on("hide", onHide);
+           menu.on("beforeshow", onBeforeShow);
+           menu.on("show", onShow);
+           var g = menu.group;
+           if(g && menu.events["checkchange"]){
+               if(!groups[g]){
+                   groups[g] = [];
+               }
+               groups[g].push(menu);
+               menu.on("checkchange", onCheck);
+           }
+       },
+
+        /**
+         * Returns a {@link Roo.menu.Menu} object
+         * @param {String/Object} menu The string menu id, an existing menu object reference, or a Menu config that will
+         * be used to generate and return a new Menu instance.
+         */
+       get : function(menu){
+           if(typeof menu == "string"){ // menu id
+               return menus[menu];
+           }else if(menu.events){  // menu instance
+               return menu;
+           }else if(typeof menu.length == 'number'){ // array of menu items?
+               return new Roo.menu.Menu({items:menu});
+           }else{ // otherwise, must be a config
+               return new Roo.menu.Menu(menu);
+           }
+       },
+
+       // private
+       unregister : function(menu){
+           delete menus[menu.id];
+           menu.un("beforehide", onBeforeHide);
+           menu.un("hide", onHide);
+           menu.un("beforeshow", onBeforeShow);
+           menu.un("show", onShow);
+           var g = menu.group;
+           if(g && menu.events["checkchange"]){
+               groups[g].remove(menu);
+               menu.un("checkchange", onCheck);
+           }
+       },
+
+       // private
+       registerCheckable : function(menuItem){
+           var g = menuItem.group;
+           if(g){
+               if(!groups[g]){
+                   groups[g] = [];
+               }
+               groups[g].push(menuItem);
+               menuItem.on("beforecheckchange", onBeforeCheck);
+           }
+       },
+
+       // private
+       unregisterCheckable : function(menuItem){
+           var g = menuItem.group;
+           if(g){
+               groups[g].remove(menuItem);
+               menuItem.un("beforecheckchange", onBeforeCheck);
+           }
+       }
+   };
+}();
\ No newline at end of file
diff --git a/Roo/menu/Separator.js b/Roo/menu/Separator.js
new file mode 100644 (file)
index 0000000..82bd615
--- /dev/null
@@ -0,0 +1,43 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+
+/**
+ * @class Roo.menu.Separator
+ * @extends Roo.menu.BaseItem
+ * Adds a separator bar to a menu, used to divide logical groups of menu items. Generally you will
+ * add one of these by using "-" in you call to add() or in your items config rather than creating one directly.
+ * @constructor
+ * @param {Object} config Configuration options
+ */
+Roo.menu.Separator = function(config){
+    Roo.menu.Separator.superclass.constructor.call(this, config);
+};
+
+Roo.extend(Roo.menu.Separator, Roo.menu.BaseItem, {
+    /**
+     * @cfg {String} itemCls The default CSS class to use for separators (defaults to "x-menu-sep")
+     */
+    itemCls : "x-menu-sep",
+    /**
+     * @cfg {Boolean} hideOnClick True to hide the containing menu after this item is clicked (defaults to false)
+     */
+    hideOnClick : false,
+
+    // private
+    onRender : function(li){
+        var s = document.createElement("span");
+        s.className = this.itemCls;
+        s.innerHTML = "&#160;";
+        this.el = s;
+        li.addClass("x-menu-sep-li");
+        Roo.menu.Separator.superclass.onRender.apply(this, arguments);
+    }
+});
\ No newline at end of file
diff --git a/Roo/menu/TextItem.js b/Roo/menu/TextItem.js
new file mode 100644 (file)
index 0000000..765ed1f
--- /dev/null
@@ -0,0 +1,43 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+
+/**
+ * @class Roo.menu.TextItem
+ * @extends Roo.menu.BaseItem
+ * Adds a static text string to a menu, usually used as either a heading or group separator.
+ * @constructor
+ * Creates a new TextItem
+ * @param {String} text The text to display
+ */
+Roo.menu.TextItem = function(text){
+    this.text = text;
+    Roo.menu.TextItem.superclass.constructor.call(this);
+};
+
+Roo.extend(Roo.menu.TextItem, Roo.menu.BaseItem, {
+    /**
+     * @cfg {Boolean} hideOnClick True to hide the containing menu after this item is clicked (defaults to false)
+     */
+    hideOnClick : false,
+    /**
+     * @cfg {String} itemCls The default CSS class to use for text items (defaults to "x-menu-text")
+     */
+    itemCls : "x-menu-text",
+
+    // private
+    onRender : function(){
+        var s = document.createElement("span");
+        s.className = this.itemCls;
+        s.innerHTML = this.text;
+        this.el = s;
+        Roo.menu.TextItem.superclass.onRender.apply(this, arguments);
+    }
+});
\ No newline at end of file
diff --git a/Roo/state/CookieProvider.js b/Roo/state/CookieProvider.js
new file mode 100644 (file)
index 0000000..d132d94
--- /dev/null
@@ -0,0 +1,94 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+/**
+ * @class Roo.state.CookieProvider
+ * @extends Roo.state.Provider
+ * The default Provider implementation which saves state via cookies.
+ * <br />Usage:
+ <pre><code>
+   var cp = new Roo.state.CookieProvider({
+       path: "/cgi-bin/",
+       expires: new Date(new Date().getTime()+(1000*60*60*24*30)); //30 days
+       domain: "roojs.com"
+   })
+   Roo.state.Manager.setProvider(cp);
+ </code></pre>
+ * @cfg {String} path The path for which the cookie is active (defaults to root '/' which makes it active for all pages in the site)
+ * @cfg {Date} expires The cookie expiration date (defaults to 7 days from now)
+ * @cfg {String} domain The domain to save the cookie for.  Note that you cannot specify a different domain than
+ * your page is on, but you can specify a sub-domain, or simply the domain itself like 'roojs.com' to include
+ * all sub-domains if you need to access cookies across different sub-domains (defaults to null which uses the same
+ * domain the page is running on including the 'www' like 'www.roojs.com')
+ * @cfg {Boolean} secure True if the site is using SSL (defaults to false)
+ * @constructor
+ * Create a new CookieProvider
+ * @param {Object} config The configuration object
+ */
+Roo.state.CookieProvider = function(config){
+    Roo.state.CookieProvider.superclass.constructor.call(this);
+    this.path = "/";
+    this.expires = new Date(new Date().getTime()+(1000*60*60*24*7)); //7 days
+    this.domain = null;
+    this.secure = false;
+    Roo.apply(this, config);
+    this.state = this.readCookies();
+};
+
+Roo.extend(Roo.state.CookieProvider, Roo.state.Provider, {
+    // private
+    set : function(name, value){
+        if(typeof value == "undefined" || value === null){
+            this.clear(name);
+            return;
+        }
+        this.setCookie(name, value);
+        Roo.state.CookieProvider.superclass.set.call(this, name, value);
+    },
+
+    // private
+    clear : function(name){
+        this.clearCookie(name);
+        Roo.state.CookieProvider.superclass.clear.call(this, name);
+    },
+
+    // private
+    readCookies : function(){
+        var cookies = {};
+        var c = document.cookie + ";";
+        var re = /\s?(.*?)=(.*?);/g;
+       var matches;
+       while((matches = re.exec(c)) != null){
+            var name = matches[1];
+            var value = matches[2];
+            if(name && name.substring(0,3) == "ys-"){
+                cookies[name.substr(3)] = this.decodeValue(value);
+            }
+        }
+        return cookies;
+    },
+
+    // private
+    setCookie : function(name, value){
+        document.cookie = "ys-"+ name + "=" + this.encodeValue(value) +
+           ((this.expires == null) ? "" : ("; expires=" + this.expires.toGMTString())) +
+           ((this.path == null) ? "" : ("; path=" + this.path)) +
+           ((this.domain == null) ? "" : ("; domain=" + this.domain)) +
+           ((this.secure == true) ? "; secure" : "");
+    },
+
+    // private
+    clearCookie : function(name){
+        document.cookie = "ys-" + name + "=null; expires=Thu, 01-Jan-70 00:00:01 GMT" +
+           ((this.path == null) ? "" : ("; path=" + this.path)) +
+           ((this.domain == null) ? "" : ("; domain=" + this.domain)) +
+           ((this.secure == true) ? "; secure" : "");
+    }
+});
\ No newline at end of file
diff --git a/Roo/state/Manager.js b/Roo/state/Manager.js
new file mode 100644 (file)
index 0000000..956a5cc
--- /dev/null
@@ -0,0 +1,77 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+/**
+ * @class Roo.state.Manager
+ * This is the global state manager. By default all components that are "state aware" check this class
+ * for state information if you don't pass them a custom state provider. In order for this class
+ * to be useful, it must be initialized with a provider when your application initializes.
+ <pre><code>
+// in your initialization function
+init : function(){
+   Roo.state.Manager.setProvider(new Roo.state.CookieProvider());
+   ...
+   // supposed you have a {@link Roo.BorderLayout}
+   var layout = new Roo.BorderLayout(...);
+   layout.restoreState();
+   // or a {Roo.BasicDialog}
+   var dialog = new Roo.BasicDialog(...);
+   dialog.restoreState();
+ </code></pre>
+ * @singleton
+ */
+Roo.state.Manager = function(){
+    var provider = new Roo.state.Provider();
+    
+    return {
+        /**
+         * Configures the default state provider for your application
+         * @param {Provider} stateProvider The state provider to set
+         */
+        setProvider : function(stateProvider){
+            provider = stateProvider;
+        },
+        
+        /**
+         * Returns the current value for a key
+         * @param {String} name The key name
+         * @param {Mixed} defaultValue The default value to return if the key lookup does not match
+         * @return {Mixed} The state data
+         */
+        get : function(key, defaultValue){
+            return provider.get(key, defaultValue);
+        },
+        
+        /**
+         * Sets the value for a key
+         * @param {String} name The key name
+         * @param {Mixed} value The state data
+         */
+         set : function(key, value){
+            provider.set(key, value);
+        },
+        
+        /**
+         * Clears a value from the state
+         * @param {String} name The key name
+         */
+        clear : function(key){
+            provider.clear(key);
+        },
+        
+        /**
+         * Gets the currently configured state provider
+         * @return {Provider} The state provider
+         */
+        getProvider : function(){
+            return provider;
+        }
+    };
+}();
diff --git a/Roo/state/Provider.js b/Roo/state/Provider.js
new file mode 100644 (file)
index 0000000..cab2afd
--- /dev/null
@@ -0,0 +1,135 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+
+/**
+ * @class Roo.state.Provider
+ * Abstract base class for state provider implementations. This class provides methods
+ * for encoding and decoding <b>typed</b> variables including dates and defines the 
+ * Provider interface.
+ */
+Roo.state.Provider = function(){
+    /**
+     * @event statechange
+     * Fires when a state change occurs.
+     * @param {Provider} this This state provider
+     * @param {String} key The state key which was changed
+     * @param {String} value The encoded value for the state
+     */
+    this.addEvents({
+        "statechange": true
+    });
+    this.state = {};
+    Roo.state.Provider.superclass.constructor.call(this);
+};
+Roo.extend(Roo.state.Provider, Roo.util.Observable, {
+    /**
+     * Returns the current value for a key
+     * @param {String} name The key name
+     * @param {Mixed} defaultValue A default value to return if the key's value is not found
+     * @return {Mixed} The state data
+     */
+    get : function(name, defaultValue){
+        return typeof this.state[name] == "undefined" ?
+            defaultValue : this.state[name];
+    },
+    
+    /**
+     * Clears a value from the state
+     * @param {String} name The key name
+     */
+    clear : function(name){
+        delete this.state[name];
+        this.fireEvent("statechange", this, name, null);
+    },
+    
+    /**
+     * Sets the value for a key
+     * @param {String} name The key name
+     * @param {Mixed} value The value to set
+     */
+    set : function(name, value){
+        this.state[name] = value;
+        this.fireEvent("statechange", this, name, value);
+    },
+    
+    /**
+     * Decodes a string previously encoded with {@link #encodeValue}.
+     * @param {String} value The value to decode
+     * @return {Mixed} The decoded value
+     */
+    decodeValue : function(cookie){
+        var re = /^(a|n|d|b|s|o)\:(.*)$/;
+        var matches = re.exec(unescape(cookie));
+        if(!matches || !matches[1]) return; // non state cookie
+        var type = matches[1];
+        var v = matches[2];
+        switch(type){
+            case "n":
+                return parseFloat(v);
+            case "d":
+                return new Date(Date.parse(v));
+            case "b":
+                return (v == "1");
+            case "a":
+                var all = [];
+                var values = v.split("^");
+                for(var i = 0, len = values.length; i < len; i++){
+                    all.push(this.decodeValue(values[i]));
+                }
+                return all;
+           case "o":
+                var all = {};
+                var values = v.split("^");
+                for(var i = 0, len = values.length; i < len; i++){
+                    var kv = values[i].split("=");
+                    all[kv[0]] = this.decodeValue(kv[1]);
+                }
+                return all;
+           default:
+                return v;
+        }
+    },
+    
+    /**
+     * Encodes a value including type information.  Decode with {@link #decodeValue}.
+     * @param {Mixed} value The value to encode
+     * @return {String} The encoded value
+     */
+    encodeValue : function(v){
+        var enc;
+        if(typeof v == "number"){
+            enc = "n:" + v;
+        }else if(typeof v == "boolean"){
+            enc = "b:" + (v ? "1" : "0");
+        }else if(v instanceof Date){
+            enc = "d:" + v.toGMTString();
+        }else if(v instanceof Array){
+            var flat = "";
+            for(var i = 0, len = v.length; i < len; i++){
+                flat += this.encodeValue(v[i]);
+                if(i != len-1) flat += "^";
+            }
+            enc = "a:" + flat;
+        }else if(typeof v == "object"){
+            var flat = "";
+            for(var key in v){
+                if(typeof v[key] != "function"){
+                    flat += key + "=" + this.encodeValue(v[key]) + "^";
+                }
+            }
+            enc = "o:" + flat.substring(0, flat.length-1);
+        }else{
+            enc = "s:" + v;
+        }
+        return escape(enc);        
+    }
+});
+
diff --git a/Roo/tree/AsyncTreeNode.js b/Roo/tree/AsyncTreeNode.js
new file mode 100644 (file)
index 0000000..6bdbd28
--- /dev/null
@@ -0,0 +1,116 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+/**
+ * @class Roo.tree.AsyncTreeNode
+ * @extends Roo.tree.TreeNode
+ * @cfg {TreeLoader} loader A TreeLoader to be used by this node (defaults to the loader defined on the tree)
+ * @constructor
+ * @param {Object/String} attributes The attributes/config for the node or just a string with the text for the node 
+ */
+ Roo.tree.AsyncTreeNode = function(config){
+    this.loaded = false;
+    this.loading = false;
+    Roo.tree.AsyncTreeNode.superclass.constructor.apply(this, arguments);
+    /**
+    * @event beforeload
+    * Fires before this node is loaded, return false to cancel
+    * @param {Node} this This node
+    */
+    this.addEvents({'beforeload':true, 'load': true});
+    /**
+    * @event load
+    * Fires when this node is loaded
+    * @param {Node} this This node
+    */
+    /**
+     * The loader used by this node (defaults to using the tree's defined loader)
+     * @type TreeLoader
+     * @property loader
+     */
+};
+Roo.extend(Roo.tree.AsyncTreeNode, Roo.tree.TreeNode, {
+    expand : function(deep, anim, callback){
+        if(this.loading){ // if an async load is already running, waiting til it's done
+            var timer;
+            var f = function(){
+                if(!this.loading){ // done loading
+                    clearInterval(timer);
+                    this.expand(deep, anim, callback);
+                }
+            }.createDelegate(this);
+            timer = setInterval(f, 200);
+            return;
+        }
+        if(!this.loaded){
+            if(this.fireEvent("beforeload", this) === false){
+                return;
+            }
+            this.loading = true;
+            this.ui.beforeLoad(this);
+            var loader = this.loader || this.attributes.loader || this.getOwnerTree().getLoader();
+            if(loader){
+                loader.load(this, this.loadComplete.createDelegate(this, [deep, anim, callback]));
+                return;
+            }
+        }
+        Roo.tree.AsyncTreeNode.superclass.expand.call(this, deep, anim, callback);
+    },
+    
+    /**
+     * Returns true if this node is currently loading
+     * @return {Boolean}
+     */
+    isLoading : function(){
+        return this.loading;  
+    },
+    
+    loadComplete : function(deep, anim, callback){
+        this.loading = false;
+        this.loaded = true;
+        this.ui.afterLoad(this);
+        this.fireEvent("load", this);
+        this.expand(deep, anim, callback);
+    },
+    
+    /**
+     * Returns true if this node has been loaded
+     * @return {Boolean}
+     */
+    isLoaded : function(){
+        return this.loaded;
+    },
+    
+    hasChildNodes : function(){
+        if(!this.isLeaf() && !this.loaded){
+            return true;
+        }else{
+            return Roo.tree.AsyncTreeNode.superclass.hasChildNodes.call(this);
+        }
+    },
+
+    /**
+     * Trigger a reload for this node
+     * @param {Function} callback
+     */
+    reload : function(callback){
+        this.collapse(false, false);
+        while(this.firstChild){
+            this.removeChild(this.firstChild);
+        }
+        this.childrenRendered = false;
+        this.loaded = false;
+        if(this.isHiddenRoot()){
+            this.expanded = false;
+        }
+        this.expand(false, false, callback);
+    }
+});
\ No newline at end of file
diff --git a/Roo/tree/ColumnNodeUI.js b/Roo/tree/ColumnNodeUI.js
new file mode 100644 (file)
index 0000000..2f2ccfb
--- /dev/null
@@ -0,0 +1,150 @@
+//<Script type="text/javascript">
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+/**
+ * Not documented??? - probably should be...
+ */
+
+Roo.tree.ColumnNodeUI = Roo.extend(Roo.tree.TreeNodeUI, {
+    //focus: Roo.emptyFn, // prevent odd scrolling behavior
+    
+    renderElements : function(n, a, targetNode, bulkRender){
+        //consel.log("renderElements?");
+        this.indentMarkup = n.parentNode ? n.parentNode.ui.getChildIndent() : '';
+
+        var t = n.getOwnerTree();
+        var tid = Pman.Tab.Document_TypesTree.tree.el.id;
+        
+        var cols = t.columns;
+        var bw = t.borderWidth;
+        var c = cols[0];
+        var href = a.href ? a.href : Roo.isGecko ? "" : "#";
+         var cb = typeof a.checked == "boolean";
+        var tx = String.format('{0}',n.text || (c.renderer ? c.renderer(a[c.dataIndex], n, a) : a[c.dataIndex]));
+        var colcls = 'x-t-' + tid + '-c0';
+        var buf = [
+            '<li class="x-tree-node">',
+            
+                
+                '<div class="x-tree-node-el ', a.cls,'">',
+                    // extran...
+                    '<div class="x-tree-col ', colcls, '" style="width:', c.width-bw, 'px;">',
+                
+                
+                        '<span class="x-tree-node-indent">',this.indentMarkup,'</span>',
+                        '<img src="', this.emptyIcon, '" class="x-tree-ec-icon  " />',
+                        '<img src="', a.icon || this.emptyIcon, '" class="x-tree-node-icon',
+                           (a.icon ? ' x-tree-node-inline-icon' : ''),
+                           (a.iconCls ? ' '+a.iconCls : ''),
+                           '" unselectable="on" />',
+                        (cb ? ('<input class="x-tree-node-cb" type="checkbox" ' + 
+                             (a.checked ? 'checked="checked" />' : ' />')) : ''),
+                             
+                        '<a class="x-tree-node-anchor" hidefocus="on" href="',href,'" tabIndex="1" ',
+                            (a.hrefTarget ? ' target="' +a.hrefTarget + '"' : ''), '>',
+                            '<span unselectable="on" qtip="' + tx + '">',
+                             tx,
+                             '</span></a>' ,
+                    '</div>',
+                     '<a class="x-tree-node-anchor" hidefocus="on" href="',href,'" tabIndex="1" ',
+                            (a.hrefTarget ? ' target="' +a.hrefTarget + '"' : ''), '>',
+                 ];
+        
+        for(var i = 1, len = cols.length; i < len; i++){
+            c = cols[i];
+            colcls = 'x-t-' + tid + '-c' +i;
+            tx = String.format('{0}', (c.renderer ? c.renderer(a[c.dataIndex], n, a) : a[c.dataIndex]));
+            buf.push('<div class="x-tree-col ', colcls, ' ' ,(c.cls?c.cls:''),'" style="width:',c.width-bw,'px;">',
+                        '<div class="x-tree-col-text" qtip="' + tx +'">',tx,"</div>",
+                      "</div>");
+         }
+         
+         buf.push(
+            '</a>',
+            '<div class="x-clear"></div></div>',
+            '<ul class="x-tree-node-ct" style="display:none;"></ul>',
+            "</li>");
+        
+        if(bulkRender !== true && n.nextSibling && n.nextSibling.ui.getEl()){
+            this.wrap = Roo.DomHelper.insertHtml("beforeBegin",
+                                n.nextSibling.ui.getEl(), buf.join(""));
+        }else{
+            this.wrap = Roo.DomHelper.insertHtml("beforeEnd", targetNode, buf.join(""));
+        }
+        var el = this.wrap.firstChild;
+        this.elRow = el;
+        this.elNode = el.firstChild;
+        this.ranchor = el.childNodes[1];
+        this.ctNode = this.wrap.childNodes[1];
+        var cs = el.firstChild.childNodes;
+        this.indentNode = cs[0];
+        this.ecNode = cs[1];
+        this.iconNode = cs[2];
+        var index = 3;
+        if(cb){
+            this.checkbox = cs[3];
+            index++;
+        }
+        this.anchor = cs[index];
+        
+        this.textNode = cs[index].firstChild;
+        
+        //el.on("click", this.onClick, this);
+        //el.on("dblclick", this.onDblClick, this);
+        
+        
+       // console.log(this);
+    },
+    initEvents : function(){
+        Roo.tree.ColumnNodeUI.superclass.initEvents.call(this);
+        
+            
+        var a = this.ranchor;
+
+        var el = Roo.get(a);
+
+        if(Roo.isOpera){ // opera render bug ignores the CSS
+            el.setStyle("text-decoration", "none");
+        }
+
+        el.on("click", this.onClick, this);
+        el.on("dblclick", this.onDblClick, this);
+        el.on("contextmenu", this.onContextMenu, this);
+        
+    },
+    
+    /*onSelectedChange : function(state){
+        if(state){
+            this.focus();
+            this.addClass("x-tree-selected");
+        }else{
+            //this.blur();
+            this.removeClass("x-tree-selected");
+        }
+    },*/
+    addClass : function(cls){
+        if(this.elRow){
+            Roo.fly(this.elRow).addClass(cls);
+        }
+        
+    },
+    
+    
+    removeClass : function(cls){
+        if(this.elRow){
+            Roo.fly(this.elRow).removeClass(cls);
+        }
+    }
+
+    
+    
+});
\ No newline at end of file
diff --git a/Roo/tree/ColumnTree.js b/Roo/tree/ColumnTree.js
new file mode 100644 (file)
index 0000000..0c1a8ab
--- /dev/null
@@ -0,0 +1,113 @@
+//<Script type="text/javascript">
+
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+
+/**
+ * @class Roo.tree.ColumnTree
+ * @extends Roo.data.TreePanel
+ * @cfg {Object} columns  Including width, header, renderer, cls, dataIndex 
+ * @cfg {int} borderWidth  compined right/left border allowance
+ * @constructor
+ * @param {String/HTMLElement/Element} el The container element
+ * @param {Object} config
+ */
+Roo.tree.ColumnTree =  function(el, config)
+{
+   Roo.tree.ColumnTree.superclass.constructor.call(this, el , config);
+   this.addEvents({
+        /**
+        * @event resize
+        * Fire this event on a container when it resizes
+        * @param {int} w Width
+        * @param {int} h Height
+        */
+       "resize" : true
+    });
+    this.on('resize', this.onResize, this);
+};
+
+Roo.extend(Roo.tree.ColumnTree, Roo.tree.TreePanel, {
+    //lines:false,
+    
+    
+    borderWidth: Roo.isBorderBox ? 0 : 2, 
+    headEls : false,
+    
+    render : function(){
+        // add the header.....
+       
+        Roo.tree.ColumnTree.superclass.render.apply(this);
+        
+        this.el.addClass('x-column-tree');
+        
+        this.headers = this.el.createChild(
+            {cls:'x-tree-headers'},this.innerCt.dom);
+   
+        var cols = this.columns, c;
+        var totalWidth = 0;
+        this.headEls = [];
+        var  len = cols.length;
+        for(var i = 0; i < len; i++){
+             c = cols[i];
+             totalWidth += c.width;
+            this.headEls.push(this.headers.createChild({
+                 cls:'x-tree-hd ' + (c.cls?c.cls+'-hd':''),
+                 cn: {
+                     cls:'x-tree-hd-text',
+                     html: c.header
+                 },
+                 style:'width:'+(c.width-this.borderWidth)+'px;'
+             }));
+        }
+        this.headers.createChild({cls:'x-clear'});
+        // prevent floats from wrapping when clipped
+        this.headers.setWidth(totalWidth);
+        //this.innerCt.setWidth(totalWidth);
+        this.innerCt.setStyle({ overflow: 'auto' });
+        this.onResize(this.width, this.height);
+             
+        
+    },
+    onResize : function(w,h)
+    {
+        this.height = h;
+        this.width = w;
+        // resize cols..
+        this.innerCt.setWidth(this.width);
+        this.innerCt.setHeight(this.height-20);
+        
+        // headers...
+        var cols = this.columns, c;
+        var totalWidth = 0;
+        var expEl = false;
+        var len = cols.length;
+        for(var i = 0; i < len; i++){
+            c = cols[i];
+            if (this.autoExpandColumn !== false && c.dataIndex == this.autoExpandColumn) {
+                // it's the expander..
+                expEl  = this.headEls[i];
+                continue;
+            }
+            totalWidth += c.width;
+            
+        }
+        if (expEl) {
+            expEl.setWidth(  ((w - totalWidth)-this.borderWidth - 20));
+        }
+        this.headers.setWidth(w-20);
+
+        
+        
+        
+    }
+});
diff --git a/Roo/tree/TreeDragZone.js b/Roo/tree/TreeDragZone.js
new file mode 100644 (file)
index 0000000..54fec3b
--- /dev/null
@@ -0,0 +1,55 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+
+if(Roo.dd.DragZone){
+Roo.tree.TreeDragZone = function(tree, config){
+    Roo.tree.TreeDragZone.superclass.constructor.call(this, tree.getTreeEl(), config);
+    this.tree = tree;
+};
+
+Roo.extend(Roo.tree.TreeDragZone, Roo.dd.DragZone, {
+    ddGroup : "TreeDD",
+    
+    onBeforeDrag : function(data, e){
+        var n = data.node;
+        return n && n.draggable && !n.disabled;
+    },
+    
+    onInitDrag : function(e){
+        var data = this.dragData;
+        this.tree.getSelectionModel().select(data.node);
+        this.proxy.update("");
+        data.node.ui.appendDDGhost(this.proxy.ghost.dom);
+        this.tree.fireEvent("startdrag", this.tree, data.node, e);
+    },
+    
+    getRepairXY : function(e, data){
+        return data.node.ui.getDDRepairXY();
+    },
+    
+    onEndDrag : function(data, e){
+        this.tree.fireEvent("enddrag", this.tree, data.node, e);
+    },
+    
+    onValidDrop : function(dd, e, id){
+        this.tree.fireEvent("dragdrop", this.tree, this.dragData.node, dd, e);
+        this.hideProxy();
+    },
+    
+    beforeInvalidDrop : function(e, id){
+        // this scrolls the original position back into view
+        var sm = this.tree.getSelectionModel();
+        sm.clearSelections();
+        sm.select(this.dragData.node);
+    }
+});
+}
\ No newline at end of file
diff --git a/Roo/tree/TreeDropZone.js b/Roo/tree/TreeDropZone.js
new file mode 100644 (file)
index 0000000..4db21a1
--- /dev/null
@@ -0,0 +1,245 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+
+if(Roo.dd.DropZone){
+    
+Roo.tree.TreeDropZone = function(tree, config){
+    this.allowParentInsert = false;
+    this.allowContainerDrop = false;
+    this.appendOnly = false;
+    Roo.tree.TreeDropZone.superclass.constructor.call(this, tree.innerCt, config);
+    this.tree = tree;
+    this.lastInsertClass = "x-tree-no-status";
+    this.dragOverData = {};
+};
+
+Roo.extend(Roo.tree.TreeDropZone, Roo.dd.DropZone, {
+    ddGroup : "TreeDD",
+    
+    expandDelay : 1000,
+    
+    expandNode : function(node){
+        if(node.hasChildNodes() && !node.isExpanded()){
+            node.expand(false, null, this.triggerCacheRefresh.createDelegate(this));
+        }
+    },
+    
+    queueExpand : function(node){
+        this.expandProcId = this.expandNode.defer(this.expandDelay, this, [node]);
+    },
+    
+    cancelExpand : function(){
+        if(this.expandProcId){
+            clearTimeout(this.expandProcId);
+            this.expandProcId = false;
+        }
+    },
+    
+    isValidDropPoint : function(n, pt, dd, e, data){
+        if(!n || !data){ return false; }
+        var targetNode = n.node;
+        var dropNode = data.node;
+        // default drop rules
+        if(!(targetNode && targetNode.isTarget && pt)){
+            return false;
+        }
+        if(pt == "append" && targetNode.allowChildren === false){
+            return false;
+        }
+        if((pt == "above" || pt == "below") && (targetNode.parentNode && targetNode.parentNode.allowChildren === false)){
+            return false;
+        }
+        if(dropNode && (targetNode == dropNode || dropNode.contains(targetNode))){
+            return false;
+        }
+        // reuse the object
+        var overEvent = this.dragOverData;
+        overEvent.tree = this.tree;
+        overEvent.target = targetNode;
+        overEvent.data = data;
+        overEvent.point = pt;
+        overEvent.source = dd;
+        overEvent.rawEvent = e;
+        overEvent.dropNode = dropNode;
+        overEvent.cancel = false;  
+        var result = this.tree.fireEvent("nodedragover", overEvent);
+        return overEvent.cancel === false && result !== false;
+    },
+    
+    getDropPoint : function(e, n, dd){
+        var tn = n.node;
+        if(tn.isRoot){
+            return tn.allowChildren !== false ? "append" : false; // always append for root
+        }
+        var dragEl = n.ddel;
+        var t = Roo.lib.Dom.getY(dragEl), b = t + dragEl.offsetHeight;
+        var y = Roo.lib.Event.getPageY(e);
+        var noAppend = tn.allowChildren === false || tn.isLeaf();
+        if(this.appendOnly || tn.parentNode.allowChildren === false){
+            return noAppend ? false : "append";
+        }
+        var noBelow = false;
+        if(!this.allowParentInsert){
+            noBelow = tn.hasChildNodes() && tn.isExpanded();
+        }
+        var q = (b - t) / (noAppend ? 2 : 3);
+        if(y >= t && y < (t + q)){
+            return "above";
+        }else if(!noBelow && (noAppend || y >= b-q && y <= b)){
+            return "below";
+        }else{
+            return "append";
+        }
+    },
+    
+    onNodeEnter : function(n, dd, e, data){
+        this.cancelExpand();
+    },
+    
+    onNodeOver : function(n, dd, e, data){
+        var pt = this.getDropPoint(e, n, dd);
+        var node = n.node;
+        
+        // auto node expand check
+        if(!this.expandProcId && pt == "append" && node.hasChildNodes() && !n.node.isExpanded()){
+            this.queueExpand(node);
+        }else if(pt != "append"){
+            this.cancelExpand();
+        }
+        
+        // set the insert point style on the target node
+        var returnCls = this.dropNotAllowed;
+        if(this.isValidDropPoint(n, pt, dd, e, data)){
+           if(pt){
+               var el = n.ddel;
+               var cls;
+               if(pt == "above"){
+                   returnCls = n.node.isFirst() ? "x-tree-drop-ok-above" : "x-tree-drop-ok-between";
+                   cls = "x-tree-drag-insert-above";
+               }else if(pt == "below"){
+                   returnCls = n.node.isLast() ? "x-tree-drop-ok-below" : "x-tree-drop-ok-between";
+                   cls = "x-tree-drag-insert-below";
+               }else{
+                   returnCls = "x-tree-drop-ok-append";
+                   cls = "x-tree-drag-append";
+               }
+               if(this.lastInsertClass != cls){
+                   Roo.fly(el).replaceClass(this.lastInsertClass, cls);
+                   this.lastInsertClass = cls;
+               }
+           }
+       }
+       return returnCls;
+    },
+    
+    onNodeOut : function(n, dd, e, data){
+        this.cancelExpand();
+        this.removeDropIndicators(n);
+    },
+    
+    onNodeDrop : function(n, dd, e, data){
+        var point = this.getDropPoint(e, n, dd);
+        var targetNode = n.node;
+        targetNode.ui.startDrop();
+        if(!this.isValidDropPoint(n, point, dd, e, data)){
+            targetNode.ui.endDrop();
+            return false;
+        }
+        // first try to find the drop node
+        var dropNode = data.node || (dd.getTreeNode ? dd.getTreeNode(data, targetNode, point, e) : null);
+        var dropEvent = {
+            tree : this.tree,
+            target: targetNode,
+            data: data,
+            point: point,
+            source: dd,
+            rawEvent: e,
+            dropNode: dropNode,
+            cancel: !dropNode   
+        };
+        var retval = this.tree.fireEvent("beforenodedrop", dropEvent);
+        if(retval === false || dropEvent.cancel === true || !dropEvent.dropNode){
+            targetNode.ui.endDrop();
+            return false;
+        }
+        // allow target changing
+        targetNode = dropEvent.target;
+        if(point == "append" && !targetNode.isExpanded()){
+            targetNode.expand(false, null, function(){
+                this.completeDrop(dropEvent);
+            }.createDelegate(this));
+        }else{
+            this.completeDrop(dropEvent);
+        }
+        return true;
+    },
+    
+    completeDrop : function(de){
+        var ns = de.dropNode, p = de.point, t = de.target;
+        if(!(ns instanceof Array)){
+            ns = [ns];
+        }
+        var n;
+        for(var i = 0, len = ns.length; i < len; i++){
+            n = ns[i];
+            if(p == "above"){
+                t.parentNode.insertBefore(n, t);
+            }else if(p == "below"){
+                t.parentNode.insertBefore(n, t.nextSibling);
+            }else{
+                t.appendChild(n);
+            }
+        }
+        n.ui.focus();
+        if(this.tree.hlDrop){
+            n.ui.highlight();
+        }
+        t.ui.endDrop();
+        this.tree.fireEvent("nodedrop", de);
+    },
+    
+    afterNodeMoved : function(dd, data, e, targetNode, dropNode){
+        if(this.tree.hlDrop){
+            dropNode.ui.focus();
+            dropNode.ui.highlight();
+        }
+        this.tree.fireEvent("nodedrop", this.tree, targetNode, data, dd, e);
+    },
+    
+    getTree : function(){
+        return this.tree;
+    },
+    
+    removeDropIndicators : function(n){
+        if(n && n.ddel){
+            var el = n.ddel;
+            Roo.fly(el).removeClass([
+                    "x-tree-drag-insert-above",
+                    "x-tree-drag-insert-below",
+                    "x-tree-drag-append"]);
+            this.lastInsertClass = "_noclass";
+        }
+    },
+    
+    beforeDragDrop : function(target, e, id){
+        this.cancelExpand();
+        return true;
+    },
+    
+    afterRepair : function(data){
+        if(data && Roo.enableFx){
+            data.node.ui.highlight();
+        }
+        this.hideProxy();
+    }    
+});
+
+}
\ No newline at end of file
diff --git a/Roo/tree/TreeEditor.js b/Roo/tree/TreeEditor.js
new file mode 100644 (file)
index 0000000..9e75e88
--- /dev/null
@@ -0,0 +1,130 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+/**
+ * @class Roo.tree.TreeEditor
+ * @extends Roo.Editor
+ * Provides editor functionality for inline tree node editing.  Any valid {@link Roo.form.Field} can be used
+ * as the editor field.
+ * @constructor
+ * @param {TreePanel} tree
+ * @param {Object} config Either a prebuilt {@link Roo.form.Field} instance or a Field config object
+ */
+Roo.tree.TreeEditor = function(tree, config){
+    config = config || {};
+    var field = config.events ? config : new Roo.form.TextField(config);
+    Roo.tree.TreeEditor.superclass.constructor.call(this, field);
+
+    this.tree = tree;
+
+    tree.on('beforeclick', this.beforeNodeClick, this);
+    tree.getTreeEl().on('mousedown', this.hide, this);
+    this.on('complete', this.updateNode, this);
+    this.on('beforestartedit', this.fitToTree, this);
+    this.on('startedit', this.bindScroll, this, {delay:10});
+    this.on('specialkey', this.onSpecialKey, this);
+};
+
+Roo.extend(Roo.tree.TreeEditor, Roo.Editor, {
+    /**
+     * @cfg {String} alignment
+     * The position to align to (see {@link Roo.Element#alignTo} for more details, defaults to "l-l").
+     */
+    alignment: "l-l",
+    // inherit
+    autoSize: false,
+    /**
+     * @cfg {Boolean} hideEl
+     * True to hide the bound element while the editor is displayed (defaults to false)
+     */
+    hideEl : false,
+    /**
+     * @cfg {String} cls
+     * CSS class to apply to the editor (defaults to "x-small-editor x-tree-editor")
+     */
+    cls: "x-small-editor x-tree-editor",
+    /**
+     * @cfg {Boolean} shim
+     * True to shim the editor if selects/iframes could be displayed beneath it (defaults to false)
+     */
+    shim:false,
+    // inherit
+    shadow:"frame",
+    /**
+     * @cfg {Number} maxWidth
+     * The maximum width in pixels of the editor field (defaults to 250).  Note that if the maxWidth would exceed
+     * the containing tree element's size, it will be automatically limited for you to the container width, taking
+     * scroll and client offsets into account prior to each edit.
+     */
+    maxWidth: 250,
+
+    editDelay : 350,
+
+    // private
+    fitToTree : function(ed, el){
+        var td = this.tree.getTreeEl().dom, nd = el.dom;
+        if(td.scrollLeft >  nd.offsetLeft){ // ensure the node left point is visible
+            td.scrollLeft = nd.offsetLeft;
+        }
+        var w = Math.min(
+                this.maxWidth,
+                (td.clientWidth > 20 ? td.clientWidth : td.offsetWidth) - Math.max(0, nd.offsetLeft-td.scrollLeft) - /*cushion*/5);
+        this.setSize(w, '');
+    },
+
+    // private
+    triggerEdit : function(node){
+        this.completeEdit();
+        this.editNode = node;
+        this.startEdit(node.ui.textNode, node.text);
+    },
+
+    // private
+    bindScroll : function(){
+        this.tree.getTreeEl().on('scroll', this.cancelEdit, this);
+    },
+
+    // private
+    beforeNodeClick : function(node, e){
+        var sinceLast = (this.lastClick ? this.lastClick.getElapsed() : 0);
+        this.lastClick = new Date();
+        if(sinceLast > this.editDelay && this.tree.getSelectionModel().isSelected(node)){
+            e.stopEvent();
+            this.triggerEdit(node);
+            return false;
+        }
+    },
+
+    // private
+    updateNode : function(ed, value){
+        this.tree.getTreeEl().un('scroll', this.cancelEdit, this);
+        this.editNode.setText(value);
+    },
+
+    // private
+    onHide : function(){
+        Roo.tree.TreeEditor.superclass.onHide.call(this);
+        if(this.editNode){
+            this.editNode.ui.focus();
+        }
+    },
+
+    // private
+    onSpecialKey : function(field, e){
+        var k = e.getKey();
+        if(k == e.ESC){
+            e.stopEvent();
+            this.cancelEdit();
+        }else if(k == e.ENTER && !e.hasModifier()){
+            e.stopEvent();
+            this.completeEdit();
+        }
+    }
+});
\ No newline at end of file
diff --git a/Roo/tree/TreeFilter.js b/Roo/tree/TreeFilter.js
new file mode 100644 (file)
index 0000000..3e3ed11
--- /dev/null
@@ -0,0 +1,119 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+
+/**
+* @class Roo.tree.TreeFilter
+* Note this class is experimental and doesn't update the indent (lines) or expand collapse icons of the nodes
+* @param {TreePanel} tree
+* @param {Object} config (optional)
+ */
+Roo.tree.TreeFilter = function(tree, config){
+    this.tree = tree;
+    this.filtered = {};
+    Roo.apply(this, config);
+};
+
+Roo.tree.TreeFilter.prototype = {
+    clearBlank:false,
+    reverse:false,
+    autoClear:false,
+    remove:false,
+
+     /**
+     * Filter the data by a specific attribute.
+     * @param {String/RegExp} value Either string that the attribute value
+     * should start with or a RegExp to test against the attribute
+     * @param {String} attr (optional) The attribute passed in your node's attributes collection. Defaults to "text".
+     * @param {TreeNode} startNode (optional) The node to start the filter at.
+     */
+    filter : function(value, attr, startNode){
+        attr = attr || "text";
+        var f;
+        if(typeof value == "string"){
+            var vlen = value.length;
+            // auto clear empty filter
+            if(vlen == 0 && this.clearBlank){
+                this.clear();
+                return;
+            }
+            value = value.toLowerCase();
+            f = function(n){
+                return n.attributes[attr].substr(0, vlen).toLowerCase() == value;
+            };
+        }else if(value.exec){ // regex?
+            f = function(n){
+                return value.test(n.attributes[attr]);
+            };
+        }else{
+            throw 'Illegal filter type, must be string or regex';
+        }
+        this.filterBy(f, null, startNode);
+       },
+
+    /**
+     * Filter by a function. The passed function will be called with each
+     * node in the tree (or from the startNode). If the function returns true, the node is kept
+     * otherwise it is filtered. If a node is filtered, its children are also filtered.
+     * @param {Function} fn The filter function
+     * @param {Object} scope (optional) The scope of the function (defaults to the current node)
+     */
+    filterBy : function(fn, scope, startNode){
+        startNode = startNode || this.tree.root;
+        if(this.autoClear){
+            this.clear();
+        }
+        var af = this.filtered, rv = this.reverse;
+        var f = function(n){
+            if(n == startNode){
+                return true;
+            }
+            if(af[n.id]){
+                return false;
+            }
+            var m = fn.call(scope || n, n);
+            if(!m || rv){
+                af[n.id] = n;
+                n.ui.hide();
+                return false;
+            }
+            return true;
+        };
+        startNode.cascade(f);
+        if(this.remove){
+           for(var id in af){
+               if(typeof id != "function"){
+                   var n = af[id];
+                   if(n && n.parentNode){
+                       n.parentNode.removeChild(n);
+                   }
+               }
+           }
+        }
+    },
+
+    /**
+     * Clears the current filter. Note: with the "remove" option
+     * set a filter cannot be cleared.
+     */
+    clear : function(){
+        var t = this.tree;
+        var af = this.filtered;
+        for(var id in af){
+            if(typeof id != "function"){
+                var n = af[id];
+                if(n){
+                    n.ui.show();
+                }
+            }
+        }
+        this.filtered = {};
+    }
+};
diff --git a/Roo/tree/TreeLoader.js b/Roo/tree/TreeLoader.js
new file mode 100644 (file)
index 0000000..89c5aff
--- /dev/null
@@ -0,0 +1,252 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+/**
+ * @class Roo.tree.TreeLoader
+ * @extends Roo.util.Observable
+ * A TreeLoader provides for lazy loading of an {@link Roo.tree.TreeNode}'s child
+ * nodes from a specified URL. The response must be a javascript Array definition
+ * who's elements are node definition objects. eg:
+ * <pre><code>
+   [{ 'id': 1, 'text': 'A folder Node', 'leaf': false },
+    { 'id': 2, 'text': 'A leaf Node', 'leaf': true }]
+</code></pre>
+ * <br><br>
+ * A server request is sent, and child nodes are loaded only when a node is expanded.
+ * The loading node's id is passed to the server under the parameter name "node" to
+ * enable the server to produce the correct child nodes.
+ * <br><br>
+ * To pass extra parameters, an event handler may be attached to the "beforeload"
+ * event, and the parameters specified in the TreeLoader's baseParams property:
+ * <pre><code>
+    myTreeLoader.on("beforeload", function(treeLoader, node) {
+        this.baseParams.category = node.attributes.category;
+    }, this);
+</code></pre><
+ * This would pass an HTTP parameter called "category" to the server containing
+ * the value of the Node's "category" attribute.
+ * @constructor
+ * Creates a new Treeloader.
+ * @param {Object} config A config object containing config properties.
+ */
+Roo.tree.TreeLoader = function(config){
+    this.baseParams = {};
+    this.requestMethod = "POST";
+    Roo.apply(this, config);
+
+    this.addEvents({
+        /**
+         * @event beforeload
+         * Fires before a network request is made to retrieve the Json text which specifies a node's children.
+         * @param {Object} This TreeLoader object.
+         * @param {Object} node The {@link Roo.tree.TreeNode} object being loaded.
+         * @param {Object} callback The callback function specified in the {@link #load} call.
+         */
+        "beforeload" : true,
+        /**
+         * @event load
+         * Fires when the node has been successfuly loaded.
+         * @param {Object} This TreeLoader object.
+         * @param {Object} node The {@link Roo.tree.TreeNode} object being loaded.
+         * @param {Object} response The response object containing the data from the server.
+         */
+        "load" : true,
+        /**
+         * @event loadexception
+         * Fires if the network request failed.
+         * @param {Object} This TreeLoader object.
+         * @param {Object} node The {@link Roo.tree.TreeNode} object being loaded.
+         * @param {Object} response The response object containing the data from the server.
+         */
+        "loadexception" : true
+    });
+
+    Roo.tree.TreeLoader.superclass.constructor.call(this);
+};
+
+Roo.extend(Roo.tree.TreeLoader, Roo.util.Observable, {
+    /**
+    * @cfg {String} dataUrl The URL from which to request a Json string which
+    * specifies an array of node definition object representing the child nodes
+    * to be loaded.
+    */
+    /**
+    * @cfg {Object} baseParams (optional) An object containing properties which
+    * specify HTTP parameters to be passed to each request for child nodes.
+    */
+    /**
+    * @cfg {Object} baseAttrs (optional) An object containing attributes to be added to all nodes
+    * created by this loader. If the attributes sent by the server have an attribute in this object,
+    * they take priority.
+    */
+    /**
+    * @cfg {Object} uiProviders (optional) An object containing properties which
+    * specify custom {@link Roo.tree.TreeNodeUI} implementations. If the optional
+    * <i>uiProvider</i> attribute of a returned child node is a string rather
+    * than a reference to a TreeNodeUI implementation, this that string value
+    * is used as a property name in the uiProviders object. You can define the provider named
+    * 'default' , and this will be used for all nodes (if no uiProvider is delivered by the node data)
+    */
+    uiProviders : {},
+
+    /**
+    * @cfg {Boolean} clearOnLoad (optional) Default to true. Remove previously existing
+    * child nodes before loading.
+    */
+    clearOnLoad : true,
+
+    /**
+    * @cfg {String} root (optional) Default to false. Use this to read data from an object 
+    * property on loading, rather than expecting an array. (eg. more compatible to a standard
+    * Grid query { data : [ .....] }
+    */
+    
+    root : false,
+     /**
+    * @cfg {String} queryParam (optional) 
+    * Name of the query as it will be passed on the querystring (defaults to 'node')
+    * eg. the request will be ?node=[id]
+    */
+    
+    
+    queryParam: false,
+    
+    /**
+     * Load an {@link Roo.tree.TreeNode} from the URL specified in the constructor.
+     * This is called automatically when a node is expanded, but may be used to reload
+     * a node (or append new children if the {@link #clearOnLoad} option is false.)
+     * @param {Roo.tree.TreeNode} node
+     * @param {Function} callback
+     */
+    load : function(node, callback){
+        if(this.clearOnLoad){
+            while(node.firstChild){
+                node.removeChild(node.firstChild);
+            }
+        }
+        if(node.attributes.children){ // preloaded json children
+            var cs = node.attributes.children;
+            for(var i = 0, len = cs.length; i < len; i++){
+                node.appendChild(this.createNode(cs[i]));
+            }
+            if(typeof callback == "function"){
+                callback();
+            }
+        }else if(this.dataUrl){
+            this.requestData(node, callback);
+        }
+    },
+
+    getParams: function(node){
+        var buf = [], bp = this.baseParams;
+        for(var key in bp){
+            if(typeof bp[key] != "function"){
+                buf.push(encodeURIComponent(key), "=", encodeURIComponent(bp[key]), "&");
+            }
+        }
+        var n = this.queryParam === false ? 'node' : this.queryParam;
+        buf.push(n + "=", encodeURIComponent(node.id));
+        return buf.join("");
+    },
+
+    requestData : function(node, callback){
+        if(this.fireEvent("beforeload", this, node, callback) !== false){
+            this.transId = Roo.Ajax.request({
+                method:this.requestMethod,
+                url: this.dataUrl||this.url,
+                success: this.handleResponse,
+                failure: this.handleFailure,
+                scope: this,
+                argument: {callback: callback, node: node},
+                params: this.getParams(node)
+            });
+        }else{
+            // if the load is cancelled, make sure we notify
+            // the node that we are done
+            if(typeof callback == "function"){
+                callback();
+            }
+        }
+    },
+
+    isLoading : function(){
+        return this.transId ? true : false;
+    },
+
+    abort : function(){
+        if(this.isLoading()){
+            Roo.Ajax.abort(this.transId);
+        }
+    },
+
+    /**
+    * Override this function for custom TreeNode node implementation
+    */
+    createNode : function(attr){
+        // apply baseAttrs, nice idea Corey!
+        if(this.baseAttrs){
+            Roo.applyIf(attr, this.baseAttrs);
+        }
+        if(this.applyLoader !== false){
+            attr.loader = this;
+        }
+        if(typeof(attr.uiProvider) == 'string'){
+            
+           attr.uiProvider = this.uiProviders[attr.uiProvider] || 
+                /**  eval:var:attr */ eval(attr.uiProvider);
+        }
+        if(typeof(this.uiProviders['default']) != 'undefined') {
+            attr.uiProvider = this.uiProviders['default'];
+        }
+        attr.leaf  = typeof(attr.leaf) == 'string' ? attr.leaf * 1 : attr.leaf;
+        return(attr.leaf ?
+                        new Roo.tree.TreeNode(attr) :
+                        new Roo.tree.AsyncTreeNode(attr));
+    },
+
+    processResponse : function(response, node, callback){
+        var json = response.responseText;
+        try {
+            
+            var o = /**  eval:var:zzzzzzzzzz */ eval("("+json+")");
+            if (this.root !== false) {
+                o = o[this.root];
+            }
+            
+            for(var i = 0, len = o.length; i < len; i++){
+                var n = this.createNode(o[i]);
+                if(n){
+                    node.appendChild(n);
+                }
+            }
+            if(typeof callback == "function"){
+                callback(this, node);
+            }
+        }catch(e){
+            this.handleFailure(response);
+        }
+    },
+
+    handleResponse : function(response){
+        this.transId = false;
+        var a = response.argument;
+        this.processResponse(response, a.node, a.callback);
+        this.fireEvent("load", this, a.node, response);
+    },
+
+    handleFailure : function(response){
+        this.transId = false;
+        var a = response.argument;
+        this.fireEvent("loadexception", this, a.node, response);
+        if(typeof a.callback == "function"){
+            a.callback(this, a.node);
+        }
+    }
+});
\ No newline at end of file
diff --git a/Roo/tree/TreeNode.js b/Roo/tree/TreeNode.js
new file mode 100644 (file)
index 0000000..bd96f85
--- /dev/null
@@ -0,0 +1,483 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+/**
+ * @class Roo.tree.TreeNode
+ * @extends Roo.data.Node
+ * @cfg {String} text The text for this node
+ * @cfg {Boolean} expanded true to start the node expanded
+ * @cfg {Boolean} allowDrag false to make this node undraggable if DD is on (defaults to true)
+ * @cfg {Boolean} allowDrop false if this node cannot be drop on
+ * @cfg {Boolean} disabled true to start the node disabled
+ * @cfg {String} icon The path to an icon for the node. The preferred way to do this
+ * is to use the cls or iconCls attributes and add the icon via a CSS background image.
+ * @cfg {String} cls A css class to be added to the node
+ * @cfg {String} iconCls A css class to be added to the nodes icon element for applying css background images
+ * @cfg {String} href URL of the link used for the node (defaults to #)
+ * @cfg {String} hrefTarget target frame for the link
+ * @cfg {String} qtip An Ext QuickTip for the node
+ * @cfg {String} qtipCfg An Ext QuickTip config for the node (used instead of qtip)
+ * @cfg {Boolean} singleClickExpand True for single click expand on this node
+ * @cfg {Function} uiProvider A UI <b>class</b> to use for this node (defaults to Roo.tree.TreeNodeUI)
+ * @cfg {Boolean} checked True to render a checked checkbox for this node, false to render an unchecked checkbox
+ * (defaults to undefined with no checkbox rendered)
+ * @constructor
+ * @param {Object/String} attributes The attributes/config for the node or just a string with the text for the node
+ */
+Roo.tree.TreeNode = function(attributes){
+    attributes = attributes || {};
+    if(typeof attributes == "string"){
+        attributes = {text: attributes};
+    }
+    this.childrenRendered = false;
+    this.rendered = false;
+    Roo.tree.TreeNode.superclass.constructor.call(this, attributes);
+    this.expanded = attributes.expanded === true;
+    this.isTarget = attributes.isTarget !== false;
+    this.draggable = attributes.draggable !== false && attributes.allowDrag !== false;
+    this.allowChildren = attributes.allowChildren !== false && attributes.allowDrop !== false;
+
+    /**
+     * Read-only. The text for this node. To change it use setText().
+     * @type String
+     */
+    this.text = attributes.text;
+    /**
+     * True if this node is disabled.
+     * @type Boolean
+     */
+    this.disabled = attributes.disabled === true;
+
+    this.addEvents({
+        /**
+        * @event textchange
+        * Fires when the text for this node is changed
+        * @param {Node} this This node
+        * @param {String} text The new text
+        * @param {String} oldText The old text
+        */
+        "textchange" : true,
+        /**
+        * @event beforeexpand
+        * Fires before this node is expanded, return false to cancel.
+        * @param {Node} this This node
+        * @param {Boolean} deep
+        * @param {Boolean} anim
+        */
+        "beforeexpand" : true,
+        /**
+        * @event beforecollapse
+        * Fires before this node is collapsed, return false to cancel.
+        * @param {Node} this This node
+        * @param {Boolean} deep
+        * @param {Boolean} anim
+        */
+        "beforecollapse" : true,
+        /**
+        * @event expand
+        * Fires when this node is expanded
+        * @param {Node} this This node
+        */
+        "expand" : true,
+        /**
+        * @event disabledchange
+        * Fires when the disabled status of this node changes
+        * @param {Node} this This node
+        * @param {Boolean} disabled
+        */
+        "disabledchange" : true,
+        /**
+        * @event collapse
+        * Fires when this node is collapsed
+        * @param {Node} this This node
+        */
+        "collapse" : true,
+        /**
+        * @event beforeclick
+        * Fires before click processing. Return false to cancel the default action.
+        * @param {Node} this This node
+        * @param {Roo.EventObject} e The event object
+        */
+        "beforeclick":true,
+        /**
+        * @event checkchange
+        * Fires when a node with a checkbox's checked property changes
+        * @param {Node} this This node
+        * @param {Boolean} checked
+        */
+        "checkchange":true,
+        /**
+        * @event click
+        * Fires when this node is clicked
+        * @param {Node} this This node
+        * @param {Roo.EventObject} e The event object
+        */
+        "click":true,
+        /**
+        * @event dblclick
+        * Fires when this node is double clicked
+        * @param {Node} this This node
+        * @param {Roo.EventObject} e The event object
+        */
+        "dblclick":true,
+        /**
+        * @event contextmenu
+        * Fires when this node is right clicked
+        * @param {Node} this This node
+        * @param {Roo.EventObject} e The event object
+        */
+        "contextmenu":true,
+        /**
+        * @event beforechildrenrendered
+        * Fires right before the child nodes for this node are rendered
+        * @param {Node} this This node
+        */
+        "beforechildrenrendered":true
+    });
+
+    var uiClass = this.attributes.uiProvider || Roo.tree.TreeNodeUI;
+
+    /**
+     * Read-only. The UI for this node
+     * @type TreeNodeUI
+     */
+    this.ui = new uiClass(this);
+};
+Roo.extend(Roo.tree.TreeNode, Roo.data.Node, {
+    preventHScroll: true,
+    /**
+     * Returns true if this node is expanded
+     * @return {Boolean}
+     */
+    isExpanded : function(){
+        return this.expanded;
+    },
+
+    /**
+     * Returns the UI object for this node
+     * @return {TreeNodeUI}
+     */
+    getUI : function(){
+        return this.ui;
+    },
+
+    // private override
+    setFirstChild : function(node){
+        var of = this.firstChild;
+        Roo.tree.TreeNode.superclass.setFirstChild.call(this, node);
+        if(this.childrenRendered && of && node != of){
+            of.renderIndent(true, true);
+        }
+        if(this.rendered){
+            this.renderIndent(true, true);
+        }
+    },
+
+    // private override
+    setLastChild : function(node){
+        var ol = this.lastChild;
+        Roo.tree.TreeNode.superclass.setLastChild.call(this, node);
+        if(this.childrenRendered && ol && node != ol){
+            ol.renderIndent(true, true);
+        }
+        if(this.rendered){
+            this.renderIndent(true, true);
+        }
+    },
+
+    // these methods are overridden to provide lazy rendering support
+    // private override
+    appendChild : function(){
+        var node = Roo.tree.TreeNode.superclass.appendChild.apply(this, arguments);
+        if(node && this.childrenRendered){
+            node.render();
+        }
+        this.ui.updateExpandIcon();
+        return node;
+    },
+
+    // private override
+    removeChild : function(node){
+        this.ownerTree.getSelectionModel().unselect(node);
+        Roo.tree.TreeNode.superclass.removeChild.apply(this, arguments);
+        // if it's been rendered remove dom node
+        if(this.childrenRendered){
+            node.ui.remove();
+        }
+        if(this.childNodes.length < 1){
+            this.collapse(false, false);
+        }else{
+            this.ui.updateExpandIcon();
+        }
+        if(!this.firstChild) {
+            this.childrenRendered = false;
+        }
+        return node;
+    },
+
+    // private override
+    insertBefore : function(node, refNode){
+        var newNode = Roo.tree.TreeNode.superclass.insertBefore.apply(this, arguments);
+        if(newNode && refNode && this.childrenRendered){
+            node.render();
+        }
+        this.ui.updateExpandIcon();
+        return newNode;
+    },
+
+    /**
+     * Sets the text for this node
+     * @param {String} text
+     */
+    setText : function(text){
+        var oldText = this.text;
+        this.text = text;
+        this.attributes.text = text;
+        if(this.rendered){ // event without subscribing
+            this.ui.onTextChange(this, text, oldText);
+        }
+        this.fireEvent("textchange", this, text, oldText);
+    },
+
+    /**
+     * Triggers selection of this node
+     */
+    select : function(){
+        this.getOwnerTree().getSelectionModel().select(this);
+    },
+
+    /**
+     * Triggers deselection of this node
+     */
+    unselect : function(){
+        this.getOwnerTree().getSelectionModel().unselect(this);
+    },
+
+    /**
+     * Returns true if this node is selected
+     * @return {Boolean}
+     */
+    isSelected : function(){
+        return this.getOwnerTree().getSelectionModel().isSelected(this);
+    },
+
+    /**
+     * Expand this node.
+     * @param {Boolean} deep (optional) True to expand all children as well
+     * @param {Boolean} anim (optional) false to cancel the default animation
+     * @param {Function} callback (optional) A callback to be called when
+     * expanding this node completes (does not wait for deep expand to complete).
+     * Called with 1 parameter, this node.
+     */
+    expand : function(deep, anim, callback){
+        if(!this.expanded){
+            if(this.fireEvent("beforeexpand", this, deep, anim) === false){
+                return;
+            }
+            if(!this.childrenRendered){
+                this.renderChildren();
+            }
+            this.expanded = true;
+            if(!this.isHiddenRoot() && (this.getOwnerTree().animate && anim !== false) || anim){
+                this.ui.animExpand(function(){
+                    this.fireEvent("expand", this);
+                    if(typeof callback == "function"){
+                        callback(this);
+                    }
+                    if(deep === true){
+                        this.expandChildNodes(true);
+                    }
+                }.createDelegate(this));
+                return;
+            }else{
+                this.ui.expand();
+                this.fireEvent("expand", this);
+                if(typeof callback == "function"){
+                    callback(this);
+                }
+            }
+        }else{
+           if(typeof callback == "function"){
+               callback(this);
+           }
+        }
+        if(deep === true){
+            this.expandChildNodes(true);
+        }
+    },
+
+    isHiddenRoot : function(){
+        return this.isRoot && !this.getOwnerTree().rootVisible;
+    },
+
+    /**
+     * Collapse this node.
+     * @param {Boolean} deep (optional) True to collapse all children as well
+     * @param {Boolean} anim (optional) false to cancel the default animation
+     */
+    collapse : function(deep, anim){
+        if(this.expanded && !this.isHiddenRoot()){
+            if(this.fireEvent("beforecollapse", this, deep, anim) === false){
+                return;
+            }
+            this.expanded = false;
+            if((this.getOwnerTree().animate && anim !== false) || anim){
+                this.ui.animCollapse(function(){
+                    this.fireEvent("collapse", this);
+                    if(deep === true){
+                        this.collapseChildNodes(true);
+                    }
+                }.createDelegate(this));
+                return;
+            }else{
+                this.ui.collapse();
+                this.fireEvent("collapse", this);
+            }
+        }
+        if(deep === true){
+            var cs = this.childNodes;
+            for(var i = 0, len = cs.length; i < len; i++) {
+               cs[i].collapse(true, false);
+            }
+        }
+    },
+
+    // private
+    delayedExpand : function(delay){
+        if(!this.expandProcId){
+            this.expandProcId = this.expand.defer(delay, this);
+        }
+    },
+
+    // private
+    cancelExpand : function(){
+        if(this.expandProcId){
+            clearTimeout(this.expandProcId);
+        }
+        this.expandProcId = false;
+    },
+
+    /**
+     * Toggles expanded/collapsed state of the node
+     */
+    toggle : function(){
+        if(this.expanded){
+            this.collapse();
+        }else{
+            this.expand();
+        }
+    },
+
+    /**
+     * Ensures all parent nodes are expanded
+     */
+    ensureVisible : function(callback){
+        var tree = this.getOwnerTree();
+        tree.expandPath(this.parentNode.getPath(), false, function(){
+            tree.getTreeEl().scrollChildIntoView(this.ui.anchor);
+            Roo.callback(callback);
+        }.createDelegate(this));
+    },
+
+    /**
+     * Expand all child nodes
+     * @param {Boolean} deep (optional) true if the child nodes should also expand their child nodes
+     */
+    expandChildNodes : function(deep){
+        var cs = this.childNodes;
+        for(var i = 0, len = cs.length; i < len; i++) {
+               cs[i].expand(deep);
+        }
+    },
+
+    /**
+     * Collapse all child nodes
+     * @param {Boolean} deep (optional) true if the child nodes should also collapse their child nodes
+     */
+    collapseChildNodes : function(deep){
+        var cs = this.childNodes;
+        for(var i = 0, len = cs.length; i < len; i++) {
+               cs[i].collapse(deep);
+        }
+    },
+
+    /**
+     * Disables this node
+     */
+    disable : function(){
+        this.disabled = true;
+        this.unselect();
+        if(this.rendered && this.ui.onDisableChange){ // event without subscribing
+            this.ui.onDisableChange(this, true);
+        }
+        this.fireEvent("disabledchange", this, true);
+    },
+
+    /**
+     * Enables this node
+     */
+    enable : function(){
+        this.disabled = false;
+        if(this.rendered && this.ui.onDisableChange){ // event without subscribing
+            this.ui.onDisableChange(this, false);
+        }
+        this.fireEvent("disabledchange", this, false);
+    },
+
+    // private
+    renderChildren : function(suppressEvent){
+        if(suppressEvent !== false){
+            this.fireEvent("beforechildrenrendered", this);
+        }
+        var cs = this.childNodes;
+        for(var i = 0, len = cs.length; i < len; i++){
+            cs[i].render(true);
+        }
+        this.childrenRendered = true;
+    },
+
+    // private
+    sort : function(fn, scope){
+        Roo.tree.TreeNode.superclass.sort.apply(this, arguments);
+        if(this.childrenRendered){
+            var cs = this.childNodes;
+            for(var i = 0, len = cs.length; i < len; i++){
+                cs[i].render(true);
+            }
+        }
+    },
+
+    // private
+    render : function(bulkRender){
+        this.ui.render(bulkRender);
+        if(!this.rendered){
+            this.rendered = true;
+            if(this.expanded){
+                this.expanded = false;
+                this.expand(false, false);
+            }
+        }
+    },
+
+    // private
+    renderIndent : function(deep, refresh){
+        if(refresh){
+            this.ui.childIndent = null;
+        }
+        this.ui.renderIndent();
+        if(deep === true && this.childrenRendered){
+            var cs = this.childNodes;
+            for(var i = 0, len = cs.length; i < len; i++){
+                cs[i].renderIndent(true, refresh);
+            }
+        }
+    }
+});
\ No newline at end of file
diff --git a/Roo/tree/TreeNodeUI.js b/Roo/tree/TreeNodeUI.js
new file mode 100644 (file)
index 0000000..697735b
--- /dev/null
@@ -0,0 +1,528 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+/**
+ * @class Roo.tree.TreeNodeUI
+ * @constructor
+ * @param {Object} node The node to render
+ * The TreeNode UI implementation is separate from the
+ * tree implementation. Unless you are customizing the tree UI,
+ * you should never have to use this directly.
+ */
+Roo.tree.TreeNodeUI = function(node){
+    this.node = node;
+    this.rendered = false;
+    this.animating = false;
+    this.emptyIcon = Roo.BLANK_IMAGE_URL;
+};
+
+Roo.tree.TreeNodeUI.prototype = {
+    removeChild : function(node){
+        if(this.rendered){
+            this.ctNode.removeChild(node.ui.getEl());
+        }
+    },
+
+    beforeLoad : function(){
+         this.addClass("x-tree-node-loading");
+    },
+
+    afterLoad : function(){
+         this.removeClass("x-tree-node-loading");
+    },
+
+    onTextChange : function(node, text, oldText){
+        if(this.rendered){
+            this.textNode.innerHTML = text;
+        }
+    },
+
+    onDisableChange : function(node, state){
+        this.disabled = state;
+        if(state){
+            this.addClass("x-tree-node-disabled");
+        }else{
+            this.removeClass("x-tree-node-disabled");
+        }
+    },
+
+    onSelectedChange : function(state){
+        if(state){
+            this.focus();
+            this.addClass("x-tree-selected");
+        }else{
+            //this.blur();
+            this.removeClass("x-tree-selected");
+        }
+    },
+
+    onMove : function(tree, node, oldParent, newParent, index, refNode){
+        this.childIndent = null;
+        if(this.rendered){
+            var targetNode = newParent.ui.getContainer();
+            if(!targetNode){//target not rendered
+                this.holder = document.createElement("div");
+                this.holder.appendChild(this.wrap);
+                return;
+            }
+            var insertBefore = refNode ? refNode.ui.getEl() : null;
+            if(insertBefore){
+                targetNode.insertBefore(this.wrap, insertBefore);
+            }else{
+                targetNode.appendChild(this.wrap);
+            }
+            this.node.renderIndent(true);
+        }
+    },
+
+    addClass : function(cls){
+        if(this.elNode){
+            Roo.fly(this.elNode).addClass(cls);
+        }
+    },
+
+    removeClass : function(cls){
+        if(this.elNode){
+            Roo.fly(this.elNode).removeClass(cls);
+        }
+    },
+
+    remove : function(){
+        if(this.rendered){
+            this.holder = document.createElement("div");
+            this.holder.appendChild(this.wrap);
+        }
+    },
+
+    fireEvent : function(){
+        return this.node.fireEvent.apply(this.node, arguments);
+    },
+
+    initEvents : function(){
+        this.node.on("move", this.onMove, this);
+        var E = Roo.EventManager;
+        var a = this.anchor;
+
+        var el = Roo.fly(a, '_treeui');
+
+        if(Roo.isOpera){ // opera render bug ignores the CSS
+            el.setStyle("text-decoration", "none");
+        }
+
+        el.on("click", this.onClick, this);
+        el.on("dblclick", this.onDblClick, this);
+
+        if(this.checkbox){
+            Roo.EventManager.on(this.checkbox,
+                    Roo.isIE ? 'click' : 'change', this.onCheckChange, this);
+        }
+
+        el.on("contextmenu", this.onContextMenu, this);
+
+        var icon = Roo.fly(this.iconNode);
+        icon.on("click", this.onClick, this);
+        icon.on("dblclick", this.onDblClick, this);
+        icon.on("contextmenu", this.onContextMenu, this);
+        E.on(this.ecNode, "click", this.ecClick, this, true);
+
+        if(this.node.disabled){
+            this.addClass("x-tree-node-disabled");
+        }
+        if(this.node.hidden){
+            this.addClass("x-tree-node-disabled");
+        }
+        var ot = this.node.getOwnerTree();
+        var dd = ot.enableDD || ot.enableDrag || ot.enableDrop;
+        if(dd && (!this.node.isRoot || ot.rootVisible)){
+            Roo.dd.Registry.register(this.elNode, {
+                node: this.node,
+                handles: this.getDDHandles(),
+                isHandle: false
+            });
+        }
+    },
+
+    getDDHandles : function(){
+        return [this.iconNode, this.textNode];
+    },
+
+    hide : function(){
+        if(this.rendered){
+            this.wrap.style.display = "none";
+        }
+    },
+
+    show : function(){
+        if(this.rendered){
+            this.wrap.style.display = "";
+        }
+    },
+
+    onContextMenu : function(e){
+        if (this.node.hasListener("contextmenu") || this.node.getOwnerTree().hasListener("contextmenu")) {
+            e.preventDefault();
+            this.focus();
+            this.fireEvent("contextmenu", this.node, e);
+        }
+    },
+
+    onClick : function(e){
+        if(this.dropping){
+            e.stopEvent();
+            return;
+        }
+        if(this.fireEvent("beforeclick", this.node, e) !== false){
+            if(!this.disabled && this.node.attributes.href){
+                this.fireEvent("click", this.node, e);
+                return;
+            }
+            e.preventDefault();
+            if(this.disabled){
+                return;
+            }
+
+            if(this.node.attributes.singleClickExpand && !this.animating && this.node.hasChildNodes()){
+                this.node.toggle();
+            }
+
+            this.fireEvent("click", this.node, e);
+        }else{
+            e.stopEvent();
+        }
+    },
+
+    onDblClick : function(e){
+        e.preventDefault();
+        if(this.disabled){
+            return;
+        }
+        if(this.checkbox){
+            this.toggleCheck();
+        }
+        if(!this.animating && this.node.hasChildNodes()){
+            this.node.toggle();
+        }
+        this.fireEvent("dblclick", this.node, e);
+    },
+
+    onCheckChange : function(){
+        var checked = this.checkbox.checked;
+        this.node.attributes.checked = checked;
+        this.fireEvent('checkchange', this.node, checked);
+    },
+
+    ecClick : function(e){
+        if(!this.animating && this.node.hasChildNodes()){
+            this.node.toggle();
+        }
+    },
+
+    startDrop : function(){
+        this.dropping = true;
+    },
+
+    // delayed drop so the click event doesn't get fired on a drop
+    endDrop : function(){
+       setTimeout(function(){
+           this.dropping = false;
+       }.createDelegate(this), 50);
+    },
+
+    expand : function(){
+        this.updateExpandIcon();
+        this.ctNode.style.display = "";
+    },
+
+    focus : function(){
+        if(!this.node.preventHScroll){
+            try{this.anchor.focus();
+            }catch(e){}
+        }else if(!Roo.isIE){
+            try{
+                var noscroll = this.node.getOwnerTree().getTreeEl().dom;
+                var l = noscroll.scrollLeft;
+                this.anchor.focus();
+                noscroll.scrollLeft = l;
+            }catch(e){}
+        }
+    },
+
+    toggleCheck : function(value){
+        var cb = this.checkbox;
+        if(cb){
+            cb.checked = (value === undefined ? !cb.checked : value);
+        }
+    },
+
+    blur : function(){
+        try{
+            this.anchor.blur();
+        }catch(e){}
+    },
+
+    animExpand : function(callback){
+        var ct = Roo.get(this.ctNode);
+        ct.stopFx();
+        if(!this.node.hasChildNodes()){
+            this.updateExpandIcon();
+            this.ctNode.style.display = "";
+            Roo.callback(callback);
+            return;
+        }
+        this.animating = true;
+        this.updateExpandIcon();
+
+        ct.slideIn('t', {
+           callback : function(){
+               this.animating = false;
+               Roo.callback(callback);
+            },
+            scope: this,
+            duration: this.node.ownerTree.duration || .25
+        });
+    },
+
+    highlight : function(){
+        var tree = this.node.getOwnerTree();
+        Roo.fly(this.wrap).highlight(
+            tree.hlColor || "C3DAF9",
+            {endColor: tree.hlBaseColor}
+        );
+    },
+
+    collapse : function(){
+        this.updateExpandIcon();
+        this.ctNode.style.display = "none";
+    },
+
+    animCollapse : function(callback){
+        var ct = Roo.get(this.ctNode);
+        ct.enableDisplayMode('block');
+        ct.stopFx();
+
+        this.animating = true;
+        this.updateExpandIcon();
+
+        ct.slideOut('t', {
+            callback : function(){
+               this.animating = false;
+               Roo.callback(callback);
+            },
+            scope: this,
+            duration: this.node.ownerTree.duration || .25
+        });
+    },
+
+    getContainer : function(){
+        return this.ctNode;
+    },
+
+    getEl : function(){
+        return this.wrap;
+    },
+
+    appendDDGhost : function(ghostNode){
+        ghostNode.appendChild(this.elNode.cloneNode(true));
+    },
+
+    getDDRepairXY : function(){
+        return Roo.lib.Dom.getXY(this.iconNode);
+    },
+
+    onRender : function(){
+        this.render();
+    },
+
+    render : function(bulkRender){
+        var n = this.node, a = n.attributes;
+        var targetNode = n.parentNode ?
+              n.parentNode.ui.getContainer() : n.ownerTree.innerCt.dom;
+
+        if(!this.rendered){
+            this.rendered = true;
+
+            this.renderElements(n, a, targetNode, bulkRender);
+
+            if(a.qtip){
+               if(this.textNode.setAttributeNS){
+                   this.textNode.setAttributeNS("ext", "qtip", a.qtip);
+                   if(a.qtipTitle){
+                       this.textNode.setAttributeNS("ext", "qtitle", a.qtipTitle);
+                   }
+               }else{
+                   this.textNode.setAttribute("ext:qtip", a.qtip);
+                   if(a.qtipTitle){
+                       this.textNode.setAttribute("ext:qtitle", a.qtipTitle);
+                   }
+               }
+            }else if(a.qtipCfg){
+                a.qtipCfg.target = Roo.id(this.textNode);
+                Roo.QuickTips.register(a.qtipCfg);
+            }
+            this.initEvents();
+            if(!this.node.expanded){
+                this.updateExpandIcon();
+            }
+        }else{
+            if(bulkRender === true) {
+                targetNode.appendChild(this.wrap);
+            }
+        }
+    },
+
+    renderElements : function(n, a, targetNode, bulkRender){
+        // add some indent caching, this helps performance when rendering a large tree
+        this.indentMarkup = n.parentNode ? n.parentNode.ui.getChildIndent() : '';
+        var t = n.getOwnerTree();
+        var txt = t.renderer ? t.renderer(n.attributes) : Roo.util.Format.htmlEncode(n.text);
+        var tip = t.rendererTip ? t.rendererTip(n.attributes) : txt;
+        var cb = typeof a.checked == 'boolean';
+        var href = a.href ? a.href : Roo.isGecko ? "" : "#";
+        var buf = ['<li class="x-tree-node"><div class="x-tree-node-el ', a.cls,'">',
+            '<span class="x-tree-node-indent">',this.indentMarkup,"</span>",
+            '<img src="', this.emptyIcon, '" class="x-tree-ec-icon" />',
+            '<img src="', a.icon || this.emptyIcon, '" class="x-tree-node-icon',(a.icon ? " x-tree-node-inline-icon" : ""),(a.iconCls ? " "+a.iconCls : ""),'" unselectable="on" />',
+            cb ? ('<input class="x-tree-node-cb" type="checkbox" ' + (a.checked ? 'checked="checked" />' : ' />')) : '',
+            '<a hidefocus="on" href="',href,'" tabIndex="1" ',
+             a.hrefTarget ? ' target="'+a.hrefTarget+'"' : "", 
+                '><span unselectable="on" qtip="' , tip ,'">',txt,"</span></a></div>",
+            '<ul class="x-tree-node-ct" style="display:none;"></ul>',
+            "</li>"];
+
+        if(bulkRender !== true && n.nextSibling && n.nextSibling.ui.getEl()){
+            this.wrap = Roo.DomHelper.insertHtml("beforeBegin",
+                                n.nextSibling.ui.getEl(), buf.join(""));
+        }else{
+            this.wrap = Roo.DomHelper.insertHtml("beforeEnd", targetNode, buf.join(""));
+        }
+
+        this.elNode = this.wrap.childNodes[0];
+        this.ctNode = this.wrap.childNodes[1];
+        var cs = this.elNode.childNodes;
+        this.indentNode = cs[0];
+        this.ecNode = cs[1];
+        this.iconNode = cs[2];
+        var index = 3;
+        if(cb){
+            this.checkbox = cs[3];
+            index++;
+        }
+        this.anchor = cs[index];
+        this.textNode = cs[index].firstChild;
+    },
+
+    getAnchor : function(){
+        return this.anchor;
+    },
+
+    getTextEl : function(){
+        return this.textNode;
+    },
+
+    getIconEl : function(){
+        return this.iconNode;
+    },
+
+    isChecked : function(){
+        return this.checkbox ? this.checkbox.checked : false;
+    },
+
+    updateExpandIcon : function(){
+        if(this.rendered){
+            var n = this.node, c1, c2;
+            var cls = n.isLast() ? "x-tree-elbow-end" : "x-tree-elbow";
+            var hasChild = n.hasChildNodes();
+            if(hasChild){
+                if(n.expanded){
+                    cls += "-minus";
+                    c1 = "x-tree-node-collapsed";
+                    c2 = "x-tree-node-expanded";
+                }else{
+                    cls += "-plus";
+                    c1 = "x-tree-node-expanded";
+                    c2 = "x-tree-node-collapsed";
+                }
+                if(this.wasLeaf){
+                    this.removeClass("x-tree-node-leaf");
+                    this.wasLeaf = false;
+                }
+                if(this.c1 != c1 || this.c2 != c2){
+                    Roo.fly(this.elNode).replaceClass(c1, c2);
+                    this.c1 = c1; this.c2 = c2;
+                }
+            }else{
+                if(!this.wasLeaf){
+                    Roo.fly(this.elNode).replaceClass("x-tree-node-expanded", "x-tree-node-leaf");
+                    delete this.c1;
+                    delete this.c2;
+                    this.wasLeaf = true;
+                }
+            }
+            var ecc = "x-tree-ec-icon "+cls;
+            if(this.ecc != ecc){
+                this.ecNode.className = ecc;
+                this.ecc = ecc;
+            }
+        }
+    },
+
+    getChildIndent : function(){
+        if(!this.childIndent){
+            var buf = [];
+            var p = this.node;
+            while(p){
+                if(!p.isRoot || (p.isRoot && p.ownerTree.rootVisible)){
+                    if(!p.isLast()) {
+                        buf.unshift('<img src="'+this.emptyIcon+'" class="x-tree-elbow-line" />');
+                    } else {
+                        buf.unshift('<img src="'+this.emptyIcon+'" class="x-tree-icon" />');
+                    }
+                }
+                p = p.parentNode;
+            }
+            this.childIndent = buf.join("");
+        }
+        return this.childIndent;
+    },
+
+    renderIndent : function(){
+        if(this.rendered){
+            var indent = "";
+            var p = this.node.parentNode;
+            if(p){
+                indent = p.ui.getChildIndent();
+            }
+            if(this.indentMarkup != indent){ // don't rerender if not required
+                this.indentNode.innerHTML = indent;
+                this.indentMarkup = indent;
+            }
+            this.updateExpandIcon();
+        }
+    }
+};
+
+Roo.tree.RootTreeNodeUI = function(){
+    Roo.tree.RootTreeNodeUI.superclass.constructor.apply(this, arguments);
+};
+Roo.extend(Roo.tree.RootTreeNodeUI, Roo.tree.TreeNodeUI, {
+    render : function(){
+        if(!this.rendered){
+            var targetNode = this.node.ownerTree.innerCt.dom;
+            this.node.expanded = true;
+            targetNode.innerHTML = '<div class="x-tree-root-node"></div>';
+            this.wrap = this.ctNode = targetNode.firstChild;
+        }
+    },
+    collapse : function(){
+    },
+    expand : function(){
+    }
+});
\ No newline at end of file
diff --git a/Roo/tree/TreePanel.js b/Roo/tree/TreePanel.js
new file mode 100644 (file)
index 0000000..dbe4a8b
--- /dev/null
@@ -0,0 +1,459 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+
+/**
+ * @class Roo.tree.TreePanel
+ * @extends Roo.data.Tree
+
+ * @cfg {Boolean} rootVisible false to hide the root node (defaults to true)
+ * @cfg {Boolean} lines false to disable tree lines (defaults to true)
+ * @cfg {Boolean} enableDD true to enable drag and drop
+ * @cfg {Boolean} enableDrag true to enable just drag
+ * @cfg {Boolean} enableDrop true to enable just drop
+ * @cfg {Object} dragConfig Custom config to pass to the {@link Roo.tree.TreeDragZone} instance
+ * @cfg {Object} dropConfig Custom config to pass to the {@link Roo.tree.TreeDropZone} instance
+ * @cfg {String} ddGroup The DD group this TreePanel belongs to
+ * @cfg {String} ddAppendOnly True if the tree should only allow append drops (use for trees which are sorted)
+ * @cfg {Boolean} ddScroll true to enable YUI body scrolling
+ * @cfg {Boolean} containerScroll true to register this container with ScrollManager
+ * @cfg {Boolean} hlDrop false to disable node highlight on drop (defaults to the value of Roo.enableFx)
+ * @cfg {String} hlColor The color of the node highlight (defaults to C3DAF9)
+ * @cfg {Boolean} animate true to enable animated expand/collapse (defaults to the value of Roo.enableFx)
+ * @cfg {Boolean} singleExpand true if only 1 node per branch may be expanded
+ * @cfg {Boolean} selModel A tree selection model to use with this TreePanel (defaults to a {@link Roo.tree.DefaultSelectionModel})
+ * @cfg {Boolean} loader A TreeLoader for use with this TreePanel
+ * @cfg {String} pathSeparator The token used to separate sub-paths in path strings (defaults to '/')
+ * @cfg {Function} renderer Sets the rendering (formatting) function for the nodes. to return HTML markup for the tree view. The render function is called with  the following parameters:<ul><li>The {Object} The data for the node.</li></ul>
+ * @cfg {Function} rendererTip Sets the rendering (formatting) function for the nodes hovertip to return HTML markup for the tree view. The render function is called with  the following parameters:<ul><li>The {Object} The data for the node.</li></ul>
+ * 
+ * @constructor
+ * @param {String/HTMLElement/Element} el The container element
+ * @param {Object} config
+ */
+Roo.tree.TreePanel = function(el, config){
+    var root = false;
+    var loader = false;
+    if (config.root) {
+        root = config.root;
+        delete config.root;
+    }
+    if (config.loader) {
+        loader = config.loader;
+        delete config.loader;
+    }
+    
+    Roo.apply(this, config);
+    Roo.tree.TreePanel.superclass.constructor.call(this);
+    this.el = Roo.get(el);
+    this.el.addClass('x-tree');
+    //console.log(root);
+    if (root) {
+        this.setRootNode( Roo.factory(root, Roo.tree));
+    }
+    if (loader) {
+        this.loader = Roo.factory(loader, Roo.tree);
+    }
+   /**
+    * Read-only. The id of the container element becomes this TreePanel's id.
+    */
+   this.id = this.el.id;
+   this.addEvents({
+        /**
+        * @event beforeload
+        * Fires before a node is loaded, return false to cancel
+        * @param {Node} node The node being loaded
+        */
+        "beforeload" : true,
+        /**
+        * @event load
+        * Fires when a node is loaded
+        * @param {Node} node The node that was loaded
+        */
+        "load" : true,
+        /**
+        * @event textchange
+        * Fires when the text for a node is changed
+        * @param {Node} node The node
+        * @param {String} text The new text
+        * @param {String} oldText The old text
+        */
+        "textchange" : true,
+        /**
+        * @event beforeexpand
+        * Fires before a node is expanded, return false to cancel.
+        * @param {Node} node The node
+        * @param {Boolean} deep
+        * @param {Boolean} anim
+        */
+        "beforeexpand" : true,
+        /**
+        * @event beforecollapse
+        * Fires before a node is collapsed, return false to cancel.
+        * @param {Node} node The node
+        * @param {Boolean} deep
+        * @param {Boolean} anim
+        */
+        "beforecollapse" : true,
+        /**
+        * @event expand
+        * Fires when a node is expanded
+        * @param {Node} node The node
+        */
+        "expand" : true,
+        /**
+        * @event disabledchange
+        * Fires when the disabled status of a node changes
+        * @param {Node} node The node
+        * @param {Boolean} disabled
+        */
+        "disabledchange" : true,
+        /**
+        * @event collapse
+        * Fires when a node is collapsed
+        * @param {Node} node The node
+        */
+        "collapse" : true,
+        /**
+        * @event beforeclick
+        * Fires before click processing on a node. Return false to cancel the default action.
+        * @param {Node} node The node
+        * @param {Roo.EventObject} e The event object
+        */
+        "beforeclick":true,
+        /**
+        * @event checkchange
+        * Fires when a node with a checkbox's checked property changes
+        * @param {Node} this This node
+        * @param {Boolean} checked
+        */
+        "checkchange":true,
+        /**
+        * @event click
+        * Fires when a node is clicked
+        * @param {Node} node The node
+        * @param {Roo.EventObject} e The event object
+        */
+        "click":true,
+        /**
+        * @event dblclick
+        * Fires when a node is double clicked
+        * @param {Node} node The node
+        * @param {Roo.EventObject} e The event object
+        */
+        "dblclick":true,
+        /**
+        * @event contextmenu
+        * Fires when a node is right clicked
+        * @param {Node} node The node
+        * @param {Roo.EventObject} e The event object
+        */
+        "contextmenu":true,
+        /**
+        * @event beforechildrenrendered
+        * Fires right before the child nodes for a node are rendered
+        * @param {Node} node The node
+        */
+        "beforechildrenrendered":true,
+       /**
+            * @event startdrag
+            * Fires when a node starts being dragged
+            * @param {Roo.tree.TreePanel} this
+            * @param {Roo.tree.TreeNode} node
+            * @param {event} e The raw browser event
+            */ 
+           "startdrag" : true,
+           /**
+            * @event enddrag
+            * Fires when a drag operation is complete
+            * @param {Roo.tree.TreePanel} this
+            * @param {Roo.tree.TreeNode} node
+            * @param {event} e The raw browser event
+            */
+           "enddrag" : true,
+           /**
+            * @event dragdrop
+            * Fires when a dragged node is dropped on a valid DD target
+            * @param {Roo.tree.TreePanel} this
+            * @param {Roo.tree.TreeNode} node
+            * @param {DD} dd The dd it was dropped on
+            * @param {event} e The raw browser event
+            */
+           "dragdrop" : true,
+           /**
+            * @event beforenodedrop
+            * Fires when a DD object is dropped on a node in this tree for preprocessing. Return false to cancel the drop. The dropEvent
+            * passed to handlers has the following properties:<br />
+            * <ul style="padding:5px;padding-left:16px;">
+            * <li>tree - The TreePanel</li>
+            * <li>target - The node being targeted for the drop</li>
+            * <li>data - The drag data from the drag source</li>
+            * <li>point - The point of the drop - append, above or below</li>
+            * <li>source - The drag source</li>
+            * <li>rawEvent - Raw mouse event</li>
+            * <li>dropNode - Drop node(s) provided by the source <b>OR</b> you can supply node(s)
+            * to be inserted by setting them on this object.</li>
+            * <li>cancel - Set this to true to cancel the drop.</li>
+            * </ul>
+            * @param {Object} dropEvent
+            */
+           "beforenodedrop" : true,
+           /**
+            * @event nodedrop
+            * Fires after a DD object is dropped on a node in this tree. The dropEvent
+            * passed to handlers has the following properties:<br />
+            * <ul style="padding:5px;padding-left:16px;">
+            * <li>tree - The TreePanel</li>
+            * <li>target - The node being targeted for the drop</li>
+            * <li>data - The drag data from the drag source</li>
+            * <li>point - The point of the drop - append, above or below</li>
+            * <li>source - The drag source</li>
+            * <li>rawEvent - Raw mouse event</li>
+            * <li>dropNode - Dropped node(s).</li>
+            * </ul>
+            * @param {Object} dropEvent
+            */
+           "nodedrop" : true,
+            /**
+            * @event nodedragover
+            * Fires when a tree node is being targeted for a drag drop, return false to signal drop not allowed. The dragOverEvent
+            * passed to handlers has the following properties:<br />
+            * <ul style="padding:5px;padding-left:16px;">
+            * <li>tree - The TreePanel</li>
+            * <li>target - The node being targeted for the drop</li>
+            * <li>data - The drag data from the drag source</li>
+            * <li>point - The point of the drop - append, above or below</li>
+            * <li>source - The drag source</li>
+            * <li>rawEvent - Raw mouse event</li>
+            * <li>dropNode - Drop node(s) provided by the source.</li>
+            * <li>cancel - Set this to true to signal drop not allowed.</li>
+            * </ul>
+            * @param {Object} dragOverEvent
+            */
+           "nodedragover" : true
+        
+   });
+   if(this.singleExpand){
+       this.on("beforeexpand", this.restrictExpand, this);
+   }
+};
+Roo.extend(Roo.tree.TreePanel, Roo.data.Tree, {
+    rootVisible : true,
+    animate: Roo.enableFx,
+    lines : true,
+    enableDD : false,
+    hlDrop : Roo.enableFx,
+  
+    renderer: false,
+    
+    rendererTip: false,
+    // private
+    restrictExpand : function(node){
+        var p = node.parentNode;
+        if(p){
+            if(p.expandedChild && p.expandedChild.parentNode == p){
+                p.expandedChild.collapse();
+            }
+            p.expandedChild = node;
+        }
+    },
+
+    // private override
+    setRootNode : function(node){
+        Roo.tree.TreePanel.superclass.setRootNode.call(this, node);
+        if(!this.rootVisible){
+            node.ui = new Roo.tree.RootTreeNodeUI(node);
+        }
+        return node;
+    },
+
+    /**
+     * Returns the container element for this TreePanel
+     */
+    getEl : function(){
+        return this.el;
+    },
+
+    /**
+     * Returns the default TreeLoader for this TreePanel
+     */
+    getLoader : function(){
+        return this.loader;
+    },
+
+    /**
+     * Expand all nodes
+     */
+    expandAll : function(){
+        this.root.expand(true);
+    },
+
+    /**
+     * Collapse all nodes
+     */
+    collapseAll : function(){
+        this.root.collapse(true);
+    },
+
+    /**
+     * Returns the selection model used by this TreePanel
+     */
+    getSelectionModel : function(){
+        if(!this.selModel){
+            this.selModel = new Roo.tree.DefaultSelectionModel();
+        }
+        return this.selModel;
+    },
+
+    /**
+     * Retrieve an array of checked nodes, or an array of a specific attribute of checked nodes (e.g. "id")
+     * @param {String} attribute (optional) Defaults to null (return the actual nodes)
+     * @param {TreeNode} startNode (optional) The node to start from, defaults to the root
+     * @return {Array}
+     */
+    getChecked : function(a, startNode){
+        startNode = startNode || this.root;
+        var r = [];
+        var f = function(){
+            if(this.attributes.checked){
+                r.push(!a ? this : (a == 'id' ? this.id : this.attributes[a]));
+            }
+        }
+        startNode.cascade(f);
+        return r;
+    },
+
+    /**
+     * Expands a specified path in this TreePanel. A path can be retrieved from a node with {@link Roo.data.Node#getPath}
+     * @param {String} path
+     * @param {String} attr (optional) The attribute used in the path (see {@link Roo.data.Node#getPath} for more info)
+     * @param {Function} callback (optional) The callback to call when the expand is complete. The callback will be called with
+     * (bSuccess, oLastNode) where bSuccess is if the expand was successful and oLastNode is the last node that was expanded.
+     */
+    expandPath : function(path, attr, callback){
+        attr = attr || "id";
+        var keys = path.split(this.pathSeparator);
+        var curNode = this.root;
+        if(curNode.attributes[attr] != keys[1]){ // invalid root
+            if(callback){
+                callback(false, null);
+            }
+            return;
+        }
+        var index = 1;
+        var f = function(){
+            if(++index == keys.length){
+                if(callback){
+                    callback(true, curNode);
+                }
+                return;
+            }
+            var c = curNode.findChild(attr, keys[index]);
+            if(!c){
+                if(callback){
+                    callback(false, curNode);
+                }
+                return;
+            }
+            curNode = c;
+            c.expand(false, false, f);
+        };
+        curNode.expand(false, false, f);
+    },
+
+    /**
+     * Selects the node in this tree at the specified path. A path can be retrieved from a node with {@link Roo.data.Node#getPath}
+     * @param {String} path
+     * @param {String} attr (optional) The attribute used in the path (see {@link Roo.data.Node#getPath} for more info)
+     * @param {Function} callback (optional) The callback to call when the selection is complete. The callback will be called with
+     * (bSuccess, oSelNode) where bSuccess is if the selection was successful and oSelNode is the selected node.
+     */
+    selectPath : function(path, attr, callback){
+        attr = attr || "id";
+        var keys = path.split(this.pathSeparator);
+        var v = keys.pop();
+        if(keys.length > 0){
+            var f = function(success, node){
+                if(success && node){
+                    var n = node.findChild(attr, v);
+                    if(n){
+                        n.select();
+                        if(callback){
+                            callback(true, n);
+                        }
+                    }else if(callback){
+                        callback(false, n);
+                    }
+                }else{
+                    if(callback){
+                        callback(false, n);
+                    }
+                }
+            };
+            this.expandPath(keys.join(this.pathSeparator), attr, f);
+        }else{
+            this.root.select();
+            if(callback){
+                callback(true, this.root);
+            }
+        }
+    },
+
+    getTreeEl : function(){
+        return this.el;
+    },
+
+    /**
+     * Trigger rendering of this TreePanel
+     */
+    render : function(){
+        if (this.innerCt) {
+            return this; // stop it rendering more than once!!
+        }
+        
+        this.innerCt = this.el.createChild({tag:"ul",
+               cls:"x-tree-root-ct " +
+               (this.lines ? "x-tree-lines" : "x-tree-no-lines")});
+
+        if(this.containerScroll){
+            Roo.dd.ScrollManager.register(this.el);
+        }
+        if((this.enableDD || this.enableDrop) && !this.dropZone){
+           /**
+            * The dropZone used by this tree if drop is enabled
+            * @type Roo.tree.TreeDropZone
+            */
+             this.dropZone = new Roo.tree.TreeDropZone(this, this.dropConfig || {
+               ddGroup: this.ddGroup || "TreeDD", appendOnly: this.ddAppendOnly === true
+           });
+        }
+        if((this.enableDD || this.enableDrag) && !this.dragZone){
+           /**
+            * The dragZone used by this tree if drag is enabled
+            * @type Roo.tree.TreeDragZone
+            */
+            this.dragZone = new Roo.tree.TreeDragZone(this, this.dragConfig || {
+               ddGroup: this.ddGroup || "TreeDD",
+               scroll: this.ddScroll
+           });
+        }
+        this.getSelectionModel().init(this);
+        if (!this.root) {
+            console.log("ROOT not set in tree");
+            return;
+        }
+        this.root.render();
+        if(!this.rootVisible){
+            this.root.renderChildren();
+        }
+        return this;
+    }
+});
\ No newline at end of file
diff --git a/Roo/tree/TreeSelectionModel.js b/Roo/tree/TreeSelectionModel.js
new file mode 100644 (file)
index 0000000..d356791
--- /dev/null
@@ -0,0 +1,324 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+
+/**
+ * @class Roo.tree.DefaultSelectionModel
+ * @extends Roo.util.Observable
+ * The default single selection for a TreePanel.
+ */
+Roo.tree.DefaultSelectionModel = function(){
+   this.selNode = null;
+   
+   this.addEvents({
+       /**
+        * @event selectionchange
+        * Fires when the selected node changes
+        * @param {DefaultSelectionModel} this
+        * @param {TreeNode} node the new selection
+        */
+       "selectionchange" : true,
+
+       /**
+        * @event beforeselect
+        * Fires before the selected node changes, return false to cancel the change
+        * @param {DefaultSelectionModel} this
+        * @param {TreeNode} node the new selection
+        * @param {TreeNode} node the old selection
+        */
+       "beforeselect" : true
+   });
+};
+
+Roo.extend(Roo.tree.DefaultSelectionModel, Roo.util.Observable, {
+    init : function(tree){
+        this.tree = tree;
+        tree.getTreeEl().on("keydown", this.onKeyDown, this);
+        tree.on("click", this.onNodeClick, this);
+    },
+    
+    onNodeClick : function(node, e){
+        if (e.ctrlKey && this.selNode == node)  {
+            this.unselect(node);
+            return;
+        }
+        this.select(node);
+    },
+    
+    /**
+     * Select a node.
+     * @param {TreeNode} node The node to select
+     * @return {TreeNode} The selected node
+     */
+    select : function(node){
+        var last = this.selNode;
+        if(last != node && this.fireEvent('beforeselect', this, node, last) !== false){
+            if(last){
+                last.ui.onSelectedChange(false);
+            }
+            this.selNode = node;
+            node.ui.onSelectedChange(true);
+            this.fireEvent("selectionchange", this, node, last);
+        }
+        return node;
+    },
+    
+    /**
+     * Deselect a node.
+     * @param {TreeNode} node The node to unselect
+     */
+    unselect : function(node){
+        if(this.selNode == node){
+            this.clearSelections();
+        }    
+    },
+    
+    /**
+     * Clear all selections
+     */
+    clearSelections : function(){
+        var n = this.selNode;
+        if(n){
+            n.ui.onSelectedChange(false);
+            this.selNode = null;
+            this.fireEvent("selectionchange", this, null);
+        }
+        return n;
+    },
+    
+    /**
+     * Get the selected node
+     * @return {TreeNode} The selected node
+     */
+    getSelectedNode : function(){
+        return this.selNode;    
+    },
+    
+    /**
+     * Returns true if the node is selected
+     * @param {TreeNode} node The node to check
+     * @return {Boolean}
+     */
+    isSelected : function(node){
+        return this.selNode == node;  
+    },
+
+    /**
+     * Selects the node above the selected node in the tree, intelligently walking the nodes
+     * @return TreeNode The new selection
+     */
+    selectPrevious : function(){
+        var s = this.selNode || this.lastSelNode;
+        if(!s){
+            return null;
+        }
+        var ps = s.previousSibling;
+        if(ps){
+            if(!ps.isExpanded() || ps.childNodes.length < 1){
+                return this.select(ps);
+            } else{
+                var lc = ps.lastChild;
+                while(lc && lc.isExpanded() && lc.childNodes.length > 0){
+                    lc = lc.lastChild;
+                }
+                return this.select(lc);
+            }
+        } else if(s.parentNode && (this.tree.rootVisible || !s.parentNode.isRoot)){
+            return this.select(s.parentNode);
+        }
+        return null;
+    },
+
+    /**
+     * Selects the node above the selected node in the tree, intelligently walking the nodes
+     * @return TreeNode The new selection
+     */
+    selectNext : function(){
+        var s = this.selNode || this.lastSelNode;
+        if(!s){
+            return null;
+        }
+        if(s.firstChild && s.isExpanded()){
+             return this.select(s.firstChild);
+         }else if(s.nextSibling){
+             return this.select(s.nextSibling);
+         }else if(s.parentNode){
+            var newS = null;
+            s.parentNode.bubble(function(){
+                if(this.nextSibling){
+                    newS = this.getOwnerTree().selModel.select(this.nextSibling);
+                    return false;
+                }
+            });
+            return newS;
+         }
+        return null;
+    },
+
+    onKeyDown : function(e){
+        var s = this.selNode || this.lastSelNode;
+        // undesirable, but required
+        var sm = this;
+        if(!s){
+            return;
+        }
+        var k = e.getKey();
+        switch(k){
+             case e.DOWN:
+                 e.stopEvent();
+                 this.selectNext();
+             break;
+             case e.UP:
+                 e.stopEvent();
+                 this.selectPrevious();
+             break;
+             case e.RIGHT:
+                 e.preventDefault();
+                 if(s.hasChildNodes()){
+                     if(!s.isExpanded()){
+                         s.expand();
+                     }else if(s.firstChild){
+                         this.select(s.firstChild, e);
+                     }
+                 }
+             break;
+             case e.LEFT:
+                 e.preventDefault();
+                 if(s.hasChildNodes() && s.isExpanded()){
+                     s.collapse();
+                 }else if(s.parentNode && (this.tree.rootVisible || s.parentNode != this.tree.getRootNode())){
+                     this.select(s.parentNode, e);
+                 }
+             break;
+        };
+    }
+});
+
+/**
+ * @class Roo.tree.MultiSelectionModel
+ * @extends Roo.util.Observable
+ * Multi selection for a TreePanel.
+ */
+Roo.tree.MultiSelectionModel = function(){
+   this.selNodes = [];
+   this.selMap = {};
+   this.addEvents({
+       /**
+        * @event selectionchange
+        * Fires when the selected nodes change
+        * @param {MultiSelectionModel} this
+        * @param {Array} nodes Array of the selected nodes
+        */
+       "selectionchange" : true
+   });
+};
+
+Roo.extend(Roo.tree.MultiSelectionModel, Roo.util.Observable, {
+    init : function(tree){
+        this.tree = tree;
+        tree.getTreeEl().on("keydown", this.onKeyDown, this);
+        tree.on("click", this.onNodeClick, this);
+    },
+    
+    onNodeClick : function(node, e){
+        this.select(node, e, e.ctrlKey);
+    },
+    
+    /**
+     * Select a node.
+     * @param {TreeNode} node The node to select
+     * @param {EventObject} e (optional) An event associated with the selection
+     * @param {Boolean} keepExisting True to retain existing selections
+     * @return {TreeNode} The selected node
+     */
+    select : function(node, e, keepExisting){
+        if(keepExisting !== true){
+            this.clearSelections(true);
+        }
+        if(this.isSelected(node)){
+            this.lastSelNode = node;
+            return node;
+        }
+        this.selNodes.push(node);
+        this.selMap[node.id] = node;
+        this.lastSelNode = node;
+        node.ui.onSelectedChange(true);
+        this.fireEvent("selectionchange", this, this.selNodes);
+        return node;
+    },
+    
+    /**
+     * Deselect a node.
+     * @param {TreeNode} node The node to unselect
+     */
+    unselect : function(node){
+        if(this.selMap[node.id]){
+            node.ui.onSelectedChange(false);
+            var sn = this.selNodes;
+            var index = -1;
+            if(sn.indexOf){
+                index = sn.indexOf(node);
+            }else{
+                for(var i = 0, len = sn.length; i < len; i++){
+                    if(sn[i] == node){
+                        index = i;
+                        break;
+                    }
+                }
+            }
+            if(index != -1){
+                this.selNodes.splice(index, 1);
+            }
+            delete this.selMap[node.id];
+            this.fireEvent("selectionchange", this, this.selNodes);
+        }
+    },
+    
+    /**
+     * Clear all selections
+     */
+    clearSelections : function(suppressEvent){
+        var sn = this.selNodes;
+        if(sn.length > 0){
+            for(var i = 0, len = sn.length; i < len; i++){
+                sn[i].ui.onSelectedChange(false);
+            }
+            this.selNodes = [];
+            this.selMap = {};
+            if(suppressEvent !== true){
+                this.fireEvent("selectionchange", this, this.selNodes);
+            }
+        }
+    },
+    
+    /**
+     * Returns true if the node is selected
+     * @param {TreeNode} node The node to check
+     * @return {Boolean}
+     */
+    isSelected : function(node){
+        return this.selMap[node.id] ? true : false;  
+    },
+    
+    /**
+     * Returns an array of the selected nodes
+     * @return {Array}
+     */
+    getSelectedNodes : function(){
+        return this.selNodes;    
+    },
+
+    onKeyDown : Roo.tree.DefaultSelectionModel.prototype.onKeyDown,
+
+    selectNext : Roo.tree.DefaultSelectionModel.prototype.selectNext,
+
+    selectPrevious : Roo.tree.DefaultSelectionModel.prototype.selectPrevious
+});
\ No newline at end of file
diff --git a/Roo/tree/TreeSorter.js b/Roo/tree/TreeSorter.js
new file mode 100644 (file)
index 0000000..bd66332
--- /dev/null
@@ -0,0 +1,75 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+
+/**
+ * @class Roo.tree.TreeSorter
+ * Provides sorting of nodes in a TreePanel
+ * 
+ * @cfg {Boolean} folderSort True to sort leaf nodes under non leaf nodes
+ * @cfg {String} property The named attribute on the node to sort by (defaults to text)
+ * @cfg {String} dir The direction to sort (asc or desc) (defaults to asc)
+ * @cfg {String} leafAttr The attribute used to determine leaf nodes in folder sort (defaults to "leaf")
+ * @cfg {Boolean} caseSensitive true for case sensitive sort (defaults to false)
+ * @cfg {Function} sortType A custom "casting" function used to convert node values before sorting
+ * @constructor
+ * @param {TreePanel} tree
+ * @param {Object} config
+ */
+Roo.tree.TreeSorter = function(tree, config){
+    Roo.apply(this, config);
+    tree.on("beforechildrenrendered", this.doSort, this);
+    tree.on("append", this.updateSort, this);
+    tree.on("insert", this.updateSort, this);
+    
+    var dsc = this.dir && this.dir.toLowerCase() == "desc";
+    var p = this.property || "text";
+    var sortType = this.sortType;
+    var fs = this.folderSort;
+    var cs = this.caseSensitive === true;
+    var leafAttr = this.leafAttr || 'leaf';
+
+    this.sortFn = function(n1, n2){
+        if(fs){
+            if(n1.attributes[leafAttr] && !n2.attributes[leafAttr]){
+                return 1;
+            }
+            if(!n1.attributes[leafAttr] && n2.attributes[leafAttr]){
+                return -1;
+            }
+        }
+       var v1 = sortType ? sortType(n1) : (cs ? n1.attributes[p] : n1.attributes[p].toUpperCase());
+       var v2 = sortType ? sortType(n2) : (cs ? n2.attributes[p] : n2.attributes[p].toUpperCase());
+       if(v1 < v2){
+                       return dsc ? +1 : -1;
+               }else if(v1 > v2){
+                       return dsc ? -1 : +1;
+        }else{
+               return 0;
+        }
+    };
+};
+
+Roo.tree.TreeSorter.prototype = {
+    doSort : function(node){
+        node.sort(this.sortFn);
+    },
+    
+    compareNodes : function(n1, n2){
+        return (n1.text.toUpperCase() > n2.text.toUpperCase() ? 1 : -1);
+    },
+    
+    updateSort : function(tree, node){
+        if(node.childrenRendered){
+            this.doSort.defer(1, this, [node]);
+        }
+    }
+};
\ No newline at end of file
diff --git a/Roo/util/CSS.js b/Roo/util/CSS.js
new file mode 100644 (file)
index 0000000..41e286f
--- /dev/null
@@ -0,0 +1,167 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+
+/**
+ * @class Roo.util.CSS
+ * Utility class for manipulating CSS rules
+ * @singleton
+ */
+Roo.util.CSS = function(){
+       var rules = null;
+       var doc = document;
+
+    var camelRe = /(-[a-z])/gi;
+    var camelFn = function(m, a){ return a.charAt(1).toUpperCase(); };
+
+   return {
+   /**
+    * Very simple dynamic creation of stylesheets from a text blob of rules.  The text will wrapped in a style
+    * tag and appended to the HEAD of the document.
+    * @param {String} cssText The text containing the css rules
+    * @param {String} id An id to add to the stylesheet for later removal
+    * @return {StyleSheet}
+    */
+   createStyleSheet : function(cssText, id){
+       var ss;
+       var head = doc.getElementsByTagName("head")[0];
+       var rules = doc.createElement("style");
+       rules.setAttribute("type", "text/css");
+       if(id){
+           rules.setAttribute("id", id);
+       }
+       if(Roo.isIE){
+           head.appendChild(rules);
+           ss = rules.styleSheet;
+           ss.cssText = cssText;
+       }else{
+           try{
+                rules.appendChild(doc.createTextNode(cssText));
+           }catch(e){
+               rules.cssText = cssText; 
+           }
+           head.appendChild(rules);
+           ss = rules.styleSheet ? rules.styleSheet : (rules.sheet || doc.styleSheets[doc.styleSheets.length-1]);
+       }
+       this.cacheStyleSheet(ss);
+       return ss;
+   },
+
+   /**
+    * Removes a style or link tag by id
+    * @param {String} id The id of the tag
+    */
+   removeStyleSheet : function(id){
+       var existing = doc.getElementById(id);
+       if(existing){
+           existing.parentNode.removeChild(existing);
+       }
+   },
+
+   /**
+    * Dynamically swaps an existing stylesheet reference for a new one
+    * @param {String} id The id of an existing link tag to remove
+    * @param {String} url The href of the new stylesheet to include
+    */
+   swapStyleSheet : function(id, url){
+       this.removeStyleSheet(id);
+       var ss = doc.createElement("link");
+       ss.setAttribute("rel", "stylesheet");
+       ss.setAttribute("type", "text/css");
+       ss.setAttribute("id", id);
+       ss.setAttribute("href", url);
+       doc.getElementsByTagName("head")[0].appendChild(ss);
+   },
+   
+   /**
+    * Refresh the rule cache if you have dynamically added stylesheets
+    * @return {Object} An object (hash) of rules indexed by selector
+    */
+   refreshCache : function(){
+       return this.getRules(true);
+   },
+
+   // private
+   cacheStyleSheet : function(ss){
+       if(!rules){
+           rules = {};
+       }
+       try{// try catch for cross domain access issue
+           var ssRules = ss.cssRules || ss.rules;
+           for(var j = ssRules.length-1; j >= 0; --j){
+               rules[ssRules[j].selectorText] = ssRules[j];
+           }
+       }catch(e){}
+   },
+   
+   /**
+    * Gets all css rules for the document
+    * @param {Boolean} refreshCache true to refresh the internal cache
+    * @return {Object} An object (hash) of rules indexed by selector
+    */
+   getRules : function(refreshCache){
+               if(rules == null || refreshCache){
+                       rules = {};
+                       var ds = doc.styleSheets;
+                       for(var i =0, len = ds.length; i < len; i++){
+                           try{
+                       this.cacheStyleSheet(ds[i]);
+                   }catch(e){} 
+               }
+               }
+               return rules;
+       },
+       
+       /**
+    * Gets an an individual CSS rule by selector(s)
+    * @param {String/Array} selector The CSS selector or an array of selectors to try. The first selector that is found is returned.
+    * @param {Boolean} refreshCache true to refresh the internal cache if you have recently updated any rules or added styles dynamically
+    * @return {CSSRule} The CSS rule or null if one is not found
+    */
+   getRule : function(selector, refreshCache){
+               var rs = this.getRules(refreshCache);
+               if(!(selector instanceof Array)){
+                   return rs[selector];
+               }
+               for(var i = 0; i < selector.length; i++){
+                       if(rs[selector[i]]){
+                               return rs[selector[i]];
+                       }
+               }
+               return null;
+       },
+       
+       
+       /**
+    * Updates a rule property
+    * @param {String/Array} selector If it's an array it tries each selector until it finds one. Stops immediately once one is found.
+    * @param {String} property The css property
+    * @param {String} value The new value for the property
+    * @return {Boolean} true If a rule was found and updated
+    */
+   updateRule : function(selector, property, value){
+               if(!(selector instanceof Array)){
+                       var rule = this.getRule(selector);
+                       if(rule){
+                               rule.style[property.replace(camelRe, camelFn)] = value;
+                               return true;
+                       }
+               }else{
+                       for(var i = 0; i < selector.length; i++){
+                               if(this.updateRule(selector[i], property, value)){
+                                       return true;
+                               }
+                       }
+               }
+               return false;
+       }
+   };  
+}();
\ No newline at end of file
diff --git a/Roo/util/ClickRepeater.js b/Roo/util/ClickRepeater.js
new file mode 100644 (file)
index 0000000..eff5449
--- /dev/null
@@ -0,0 +1,174 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+
+
+/**
+ * @class Roo.util.ClickRepeater
+ * @extends Roo.util.Observable
+ * 
+ * A wrapper class which can be applied to any element. Fires a "click" event while the
+ * mouse is pressed. The interval between firings may be specified in the config but
+ * defaults to 10 milliseconds.
+ * 
+ * Optionally, a CSS class may be applied to the element during the time it is pressed.
+ * 
+ * @cfg {String/HTMLElement/Element} el The element to act as a button.
+ * @cfg {Number} delay The initial delay before the repeating event begins firing.
+ * Similar to an autorepeat key delay.
+ * @cfg {Number} interval The interval between firings of the "click" event. Default 10 ms.
+ * @cfg {String} pressClass A CSS class name to be applied to the element while pressed.
+ * @cfg {Boolean} accelerate True if autorepeating should start slowly and accelerate.
+ *           "interval" and "delay" are ignored. "immediate" is honored.
+ * @cfg {Boolean} preventDefault True to prevent the default click event
+ * @cfg {Boolean} stopDefault True to stop the default click event
+ * 
+ * @history
+ *     2007-02-02 jvs Original code contributed by Nige "Animal" White
+ *     2007-02-02 jvs Renamed to ClickRepeater
+ *   2007-02-03 jvs Modifications for FF Mac and Safari 
+ *
+ *  @constructor
+ * @param {String/HTMLElement/Element} el The element to listen on
+ * @param {Object} config
+ **/
+Roo.util.ClickRepeater = function(el, config)
+{
+    this.el = Roo.get(el);
+    this.el.unselectable();
+
+    Roo.apply(this, config);
+
+    this.addEvents({
+    /**
+     * @event mousedown
+     * Fires when the mouse button is depressed.
+     * @param {Roo.util.ClickRepeater} this
+     */
+        "mousedown" : true,
+    /**
+     * @event click
+     * Fires on a specified interval during the time the element is pressed.
+     * @param {Roo.util.ClickRepeater} this
+     */
+        "click" : true,
+    /**
+     * @event mouseup
+     * Fires when the mouse key is released.
+     * @param {Roo.util.ClickRepeater} this
+     */
+        "mouseup" : true
+    });
+
+    this.el.on("mousedown", this.handleMouseDown, this);
+    if(this.preventDefault || this.stopDefault){
+        this.el.on("click", function(e){
+            if(this.preventDefault){
+                e.preventDefault();
+            }
+            if(this.stopDefault){
+                e.stopEvent();
+            }
+        }, this);
+    }
+
+    // allow inline handler
+    if(this.handler){
+        this.on("click", this.handler,  this.scope || this);
+    }
+
+    Roo.util.ClickRepeater.superclass.constructor.call(this);
+};
+
+Roo.extend(Roo.util.ClickRepeater, Roo.util.Observable, {
+    interval : 20,
+    delay: 250,
+    preventDefault : true,
+    stopDefault : false,
+    timer : 0,
+
+    // private
+    handleMouseDown : function(){
+        clearTimeout(this.timer);
+        this.el.blur();
+        if(this.pressClass){
+            this.el.addClass(this.pressClass);
+        }
+        this.mousedownTime = new Date();
+
+        Roo.get(document).on("mouseup", this.handleMouseUp, this);
+        this.el.on("mouseout", this.handleMouseOut, this);
+
+        this.fireEvent("mousedown", this);
+        this.fireEvent("click", this);
+        
+        this.timer = this.click.defer(this.delay || this.interval, this);
+    },
+
+    // private
+    click : function(){
+        this.fireEvent("click", this);
+        this.timer = this.click.defer(this.getInterval(), this);
+    },
+
+    // private
+    getInterval: function(){
+        if(!this.accelerate){
+            return this.interval;
+        }
+        var pressTime = this.mousedownTime.getElapsed();
+        if(pressTime < 500){
+            return 400;
+        }else if(pressTime < 1700){
+            return 320;
+        }else if(pressTime < 2600){
+            return 250;
+        }else if(pressTime < 3500){
+            return 180;
+        }else if(pressTime < 4400){
+            return 140;
+        }else if(pressTime < 5300){
+            return 80;
+        }else if(pressTime < 6200){
+            return 50;
+        }else{
+            return 10;
+        }
+    },
+
+    // private
+    handleMouseOut : function(){
+        clearTimeout(this.timer);
+        if(this.pressClass){
+            this.el.removeClass(this.pressClass);
+        }
+        this.el.on("mouseover", this.handleMouseReturn, this);
+    },
+
+    // private
+    handleMouseReturn : function(){
+        this.el.un("mouseover", this.handleMouseReturn);
+        if(this.pressClass){
+            this.el.addClass(this.pressClass);
+        }
+        this.click();
+    },
+
+    // private
+    handleMouseUp : function(){
+        clearTimeout(this.timer);
+        this.el.un("mouseover", this.handleMouseReturn);
+        this.el.un("mouseout", this.handleMouseOut);
+        Roo.get(document).un("mouseup", this.handleMouseUp);
+        this.el.removeClass(this.pressClass);
+        this.fireEvent("mouseup", this);
+    }
+});
\ No newline at end of file
diff --git a/Roo/util/DelayedTask.js b/Roo/util/DelayedTask.js
new file mode 100644 (file)
index 0000000..4605215
--- /dev/null
@@ -0,0 +1,65 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+
+/**
+ * @class Roo.util.DelayedTask
+ * Provides a convenient method of performing setTimeout where a new
+ * timeout cancels the old timeout. An example would be performing validation on a keypress.
+ * You can use this class to buffer
+ * the keypress events for a certain number of milliseconds, and perform only if they stop
+ * for that amount of time.
+ * @constructor The parameters to this constructor serve as defaults and are not required.
+ * @param {Function} fn (optional) The default function to timeout
+ * @param {Object} scope (optional) The default scope of that timeout
+ * @param {Array} args (optional) The default Array of arguments
+ */
+Roo.util.DelayedTask = function(fn, scope, args){
+    var id = null, d, t;
+
+    var call = function(){
+        var now = new Date().getTime();
+        if(now - t >= d){
+            clearInterval(id);
+            id = null;
+            fn.apply(scope, args || []);
+        }
+    };
+    /**
+     * Cancels any pending timeout and queues a new one
+     * @param {Number} delay The milliseconds to delay
+     * @param {Function} newFn (optional) Overrides function passed to constructor
+     * @param {Object} newScope (optional) Overrides scope passed to constructor
+     * @param {Array} newArgs (optional) Overrides args passed to constructor
+     */
+    this.delay = function(delay, newFn, newScope, newArgs){
+        if(id && delay != d){
+            this.cancel();
+        }
+        d = delay;
+        t = new Date().getTime();
+        fn = newFn || fn;
+        scope = newScope || scope;
+        args = newArgs || args;
+        if(!id){
+            id = setInterval(call, d);
+        }
+    };
+
+    /**
+     * Cancel the last queued timeout
+     */
+    this.cancel = function(){
+        if(id){
+            clearInterval(id);
+            id = null;
+        }
+    };
+};
\ No newline at end of file
diff --git a/Roo/util/Format.js b/Roo/util/Format.js
new file mode 100644 (file)
index 0000000..2ce760e
--- /dev/null
@@ -0,0 +1,178 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+/**
+ * @class Roo.util.Format
+ * Reusable data formatting functions
+ * @singleton
+ */
+Roo.util.Format = function(){
+    var trimRe = /^\s+|\s+$/g;
+    return {
+        /**
+         * Truncate a string and add an ellipsis ('...') to the end if it exceeds the specified length
+         * @param {String} value The string to truncate
+         * @param {Number} length The maximum length to allow before truncating
+         * @return {String} The converted text
+         */
+        ellipsis : function(value, len){
+            if(value && value.length > len){
+                return value.substr(0, len-3)+"...";
+            }
+            return value;
+        },
+
+        /**
+         * Checks a reference and converts it to empty string if it is undefined
+         * @param {Mixed} value Reference to check
+         * @return {Mixed} Empty string if converted, otherwise the original value
+         */
+        undef : function(value){
+            return typeof value != "undefined" ? value : "";
+        },
+
+        /**
+         * Convert certain characters (&, <, >, and ') to their HTML character equivalents for literal display in web pages.
+         * @param {String} value The string to encode
+         * @return {String} The encoded text
+         */
+        htmlEncode : function(value){
+            return !value ? value : String(value).replace(/&/g, "&amp;").replace(/>/g, "&gt;").replace(/</g, "&lt;").replace(/"/g, "&quot;");
+        },
+
+        /**
+         * Convert certain characters (&, <, >, and ') from their HTML character equivalents.
+         * @param {String} value The string to decode
+         * @return {String} The decoded text
+         */
+        htmlDecode : function(value){
+            return !value ? value : String(value).replace(/&amp;/g, "&").replace(/&gt;/g, ">").replace(/&lt;/g, "<").replace(/&quot;/g, '"');
+        },
+
+        /**
+         * Trims any whitespace from either side of a string
+         * @param {String} value The text to trim
+         * @return {String} The trimmed text
+         */
+        trim : function(value){
+            return String(value).replace(trimRe, "");
+        },
+
+        /**
+         * Returns a substring from within an original string
+         * @param {String} value The original text
+         * @param {Number} start The start index of the substring
+         * @param {Number} length The length of the substring
+         * @return {String} The substring
+         */
+        substr : function(value, start, length){
+            return String(value).substr(start, length);
+        },
+
+        /**
+         * Converts a string to all lower case letters
+         * @param {String} value The text to convert
+         * @return {String} The converted text
+         */
+        lowercase : function(value){
+            return String(value).toLowerCase();
+        },
+
+        /**
+         * Converts a string to all upper case letters
+         * @param {String} value The text to convert
+         * @return {String} The converted text
+         */
+        uppercase : function(value){
+            return String(value).toUpperCase();
+        },
+
+        /**
+         * Converts the first character only of a string to upper case
+         * @param {String} value The text to convert
+         * @return {String} The converted text
+         */
+        capitalize : function(value){
+            return !value ? value : value.charAt(0).toUpperCase() + value.substr(1).toLowerCase();
+        },
+
+        // private
+        call : function(value, fn){
+            if(arguments.length > 2){
+                var args = Array.prototype.slice.call(arguments, 2);
+                args.unshift(value);
+                 
+                return /** eval:var:value */  eval(fn).apply(window, args);
+            }else{
+                /** eval:var:value */
+                return /** eval:var:value */ eval(fn).call(window, value);
+            }
+        },
+
+        /**
+         * Format a number as US currency
+         * @param {Number/String} value The numeric value to format
+         * @return {String} The formatted currency string
+         */
+        usMoney : function(v){
+            v = (Math.round((v-0)*100))/100;
+            v = (v == Math.floor(v)) ? v + ".00" : ((v*10 == Math.floor(v*10)) ? v + "0" : v);
+            v = String(v);
+            var ps = v.split('.');
+            var whole = ps[0];
+            var sub = ps[1] ? '.'+ ps[1] : '.00';
+            var r = /(\d+)(\d{3})/;
+            while (r.test(whole)) {
+                whole = whole.replace(r, '$1' + ',' + '$2');
+            }
+            return "$" + whole + sub ;
+        },
+
+        /**
+         * Parse a value into a formatted date using the specified format pattern.
+         * @param {Mixed} value The value to format
+         * @param {String} format (optional) Any valid date format string (defaults to 'm/d/Y')
+         * @return {String} The formatted date string
+         */
+        date : function(v, format){
+            if(!v){
+                return "";
+            }
+            if(!(v instanceof Date)){
+                v = new Date(Date.parse(v));
+            }
+            return v.dateFormat(format || "m/d/Y");
+        },
+
+        /**
+         * Returns a date rendering function that can be reused to apply a date format multiple times efficiently
+         * @param {String} format Any valid date format string
+         * @return {Function} The date formatting function
+         */
+        dateRenderer : function(format){
+            return function(v){
+                return Roo.util.Format.date(v, format);  
+            };
+        },
+
+        // private
+        stripTagsRE : /<\/?[^>]+>/gi,
+        
+        /**
+         * Strips all HTML tags
+         * @param {Mixed} value The text from which to strip tags
+         * @return {String} The stripped text
+         */
+        stripTags : function(v){
+            return !v ? v : String(v).replace(this.stripTagsRE, "");
+        }
+    };
+}();
\ No newline at end of file
diff --git a/Roo/util/JSON.js b/Roo/util/JSON.js
new file mode 100644 (file)
index 0000000..931fb3b
--- /dev/null
@@ -0,0 +1,148 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+/**
+ * @class Roo.util.JSON
+ * Modified version of Douglas Crockford"s json.js that doesn"t
+ * mess with the Object prototype 
+ * http://www.json.org/js.html
+ * @singleton
+ */
+Roo.util.JSON = new (function(){
+    var useHasOwn = {}.hasOwnProperty ? true : false;
+    
+    // crashes Safari in some instances
+    //var validRE = /^("(\\.|[^"\\\n\r])*?"|[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t])+?$/;
+    
+    var pad = function(n) {
+        return n < 10 ? "0" + n : n;
+    };
+    
+    var m = {
+        "\b": '\\b',
+        "\t": '\\t',
+        "\n": '\\n',
+        "\f": '\\f',
+        "\r": '\\r',
+        '"' : '\\"',
+        "\\": '\\\\'
+    };
+
+    var encodeString = function(s){
+        if (/["\\\x00-\x1f]/.test(s)) {
+            return '"' + s.replace(/([\x00-\x1f\\"])/g, function(a, b) {
+                var c = m[b];
+                if(c){
+                    return c;
+                }
+                c = b.charCodeAt();
+                return "\\u00" +
+                    Math.floor(c / 16).toString(16) +
+                    (c % 16).toString(16);
+            }) + '"';
+        }
+        return '"' + s + '"';
+    };
+    
+    var encodeArray = function(o){
+        var a = ["["], b, i, l = o.length, v;
+            for (i = 0; i < l; i += 1) {
+                v = o[i];
+                switch (typeof v) {
+                    case "undefined":
+                    case "function":
+                    case "unknown":
+                        break;
+                    default:
+                        if (b) {
+                            a.push(',');
+                        }
+                        a.push(v === null ? "null" : Roo.util.JSON.encode(v));
+                        b = true;
+                }
+            }
+            a.push("]");
+            return a.join("");
+    };
+    
+    var encodeDate = function(o){
+        return '"' + o.getFullYear() + "-" +
+                pad(o.getMonth() + 1) + "-" +
+                pad(o.getDate()) + "T" +
+                pad(o.getHours()) + ":" +
+                pad(o.getMinutes()) + ":" +
+                pad(o.getSeconds()) + '"';
+    };
+    
+    /**
+     * Encodes an Object, Array or other value
+     * @param {Mixed} o The variable to encode
+     * @return {String} The JSON string
+     */
+    this.encode = function(o){
+        if(typeof o == "undefined" || o === null){
+            return "null";
+        }else if(o instanceof Array){
+            return encodeArray(o);
+        }else if(o instanceof Date){
+            return encodeDate(o);
+        }else if(typeof o == "string"){
+            return encodeString(o);
+        }else if(typeof o == "number"){
+            return isFinite(o) ? String(o) : "null";
+        }else if(typeof o == "boolean"){
+            return String(o);
+        }else {
+            var a = ["{"], b, i, v;
+            for (i in o) {
+                if(!useHasOwn || o.hasOwnProperty(i)) {
+                    v = o[i];
+                    switch (typeof v) {
+                    case "undefined":
+                    case "function":
+                    case "unknown":
+                        break;
+                    default:
+                        if(b){
+                            a.push(',');
+                        }
+                        a.push(this.encode(i), ":",
+                                v === null ? "null" : this.encode(v));
+                        b = true;
+                    }
+                }
+            }
+            a.push("}");
+            return a.join("");
+        }
+    };
+    
+    /**
+     * Decodes (parses) a JSON string to an object. If the JSON is invalid, this function throws a SyntaxError.
+     * @param {String} json The JSON string
+     * @return {Object} The resulting object
+     */
+    this.decode = function(json){
+        /**
+         * eval:var:json
+         */
+        return eval("(" + json + ')');
+    };
+})();
+/** 
+ * Shorthand for {@link Roo.util.JSON#encode}
+ * @member Roo encode 
+ * @method */
+Roo.encode = Roo.util.JSON.encode;
+/** 
+ * Shorthand for {@link Roo.util.JSON#decode}
+ * @member Roo decode 
+ * @method */
+Roo.decode = Roo.util.JSON.decode;
diff --git a/Roo/util/MixedCollection.js b/Roo/util/MixedCollection.js
new file mode 100644 (file)
index 0000000..8643f3c
--- /dev/null
@@ -0,0 +1,520 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+
+/**
+ * @class Roo.util.MixedCollection
+ * @extends Roo.util.Observable
+ * A Collection class that maintains both numeric indexes and keys and exposes events.
+ * @constructor
+ * @param {Boolean} allowFunctions True if the addAll function should add function references to the
+ * collection (defaults to false)
+ * @param {Function} keyFn A function that can accept an item of the type(s) stored in this MixedCollection
+ * and return the key value for that item.  This is used when available to look up the key on items that
+ * were passed without an explicit key parameter to a MixedCollection method.  Passing this parameter is
+ * equivalent to providing an implementation for the {@link #getKey} method.
+ */
+Roo.util.MixedCollection = function(allowFunctions, keyFn){
+    this.items = [];
+    this.map = {};
+    this.keys = [];
+    this.length = 0;
+    this.addEvents({
+        /**
+         * @event clear
+         * Fires when the collection is cleared.
+         */
+        "clear" : true,
+        /**
+         * @event add
+         * Fires when an item is added to the collection.
+         * @param {Number} index The index at which the item was added.
+         * @param {Object} o The item added.
+         * @param {String} key The key associated with the added item.
+         */
+        "add" : true,
+        /**
+         * @event replace
+         * Fires when an item is replaced in the collection.
+         * @param {String} key he key associated with the new added.
+         * @param {Object} old The item being replaced.
+         * @param {Object} new The new item.
+         */
+        "replace" : true,
+        /**
+         * @event remove
+         * Fires when an item is removed from the collection.
+         * @param {Object} o The item being removed.
+         * @param {String} key (optional) The key associated with the removed item.
+         */
+        "remove" : true,
+        "sort" : true
+    });
+    this.allowFunctions = allowFunctions === true;
+    if(keyFn){
+        this.getKey = keyFn;
+    }
+    Roo.util.MixedCollection.superclass.constructor.call(this);
+};
+
+Roo.extend(Roo.util.MixedCollection, Roo.util.Observable, {
+    allowFunctions : false,
+    
+/**
+ * Adds an item to the collection.
+ * @param {String} key The key to associate with the item
+ * @param {Object} o The item to add.
+ * @return {Object} The item added.
+ */
+    add : function(key, o){
+        if(arguments.length == 1){
+            o = arguments[0];
+            key = this.getKey(o);
+        }
+        if(typeof key == "undefined" || key === null){
+            this.length++;
+            this.items.push(o);
+            this.keys.push(null);
+        }else{
+            var old = this.map[key];
+            if(old){
+                return this.replace(key, o);
+            }
+            this.length++;
+            this.items.push(o);
+            this.map[key] = o;
+            this.keys.push(key);
+        }
+        this.fireEvent("add", this.length-1, o, key);
+        return o;
+    },
+   
+/**
+  * MixedCollection has a generic way to fetch keys if you implement getKey.
+<pre><code>
+// normal way
+var mc = new Roo.util.MixedCollection();
+mc.add(someEl.dom.id, someEl);
+mc.add(otherEl.dom.id, otherEl);
+//and so on
+
+// using getKey
+var mc = new Roo.util.MixedCollection();
+mc.getKey = function(el){
+   return el.dom.id;
+};
+mc.add(someEl);
+mc.add(otherEl);
+
+// or via the constructor
+var mc = new Roo.util.MixedCollection(false, function(el){
+   return el.dom.id;
+});
+mc.add(someEl);
+mc.add(otherEl);
+</code></pre>
+ * @param o {Object} The item for which to find the key.
+ * @return {Object} The key for the passed item.
+ */
+    getKey : function(o){
+         return o.id; 
+    },
+   
+/**
+ * Replaces an item in the collection.
+ * @param {String} key The key associated with the item to replace, or the item to replace.
+ * @param o {Object} o (optional) If the first parameter passed was a key, the item to associate with that key.
+ * @return {Object}  The new item.
+ */
+    replace : function(key, o){
+        if(arguments.length == 1){
+            o = arguments[0];
+            key = this.getKey(o);
+        }
+        var old = this.item(key);
+        if(typeof key == "undefined" || key === null || typeof old == "undefined"){
+             return this.add(key, o);
+        }
+        var index = this.indexOfKey(key);
+        this.items[index] = o;
+        this.map[key] = o;
+        this.fireEvent("replace", key, old, o);
+        return o;
+    },
+   
+/**
+ * Adds all elements of an Array or an Object to the collection.
+ * @param {Object/Array} objs An Object containing properties which will be added to the collection, or
+ * an Array of values, each of which are added to the collection.
+ */
+    addAll : function(objs){
+        if(arguments.length > 1 || objs instanceof Array){
+            var args = arguments.length > 1 ? arguments : objs;
+            for(var i = 0, len = args.length; i < len; i++){
+                this.add(args[i]);
+            }
+        }else{
+            for(var key in objs){
+                if(this.allowFunctions || typeof objs[key] != "function"){
+                    this.add(key, objs[key]);
+                }
+            }
+        }
+    },
+   
+/**
+ * Executes the specified function once for every item in the collection, passing each
+ * item as the first and only parameter. returning false from the function will stop the iteration.
+ * @param {Function} fn The function to execute for each item.
+ * @param {Object} scope (optional) The scope in which to execute the function.
+ */
+    each : function(fn, scope){
+        var items = [].concat(this.items); // each safe for removal
+        for(var i = 0, len = items.length; i < len; i++){
+            if(fn.call(scope || items[i], items[i], i, len) === false){
+                break;
+            }
+        }
+    },
+   
+/**
+ * Executes the specified function once for every key in the collection, passing each
+ * key, and its associated item as the first two parameters.
+ * @param {Function} fn The function to execute for each item.
+ * @param {Object} scope (optional) The scope in which to execute the function.
+ */
+    eachKey : function(fn, scope){
+        for(var i = 0, len = this.keys.length; i < len; i++){
+            fn.call(scope || window, this.keys[i], this.items[i], i, len);
+        }
+    },
+   
+/**
+ * Returns the first item in the collection which elicits a true return value from the
+ * passed selection function.
+ * @param {Function} fn The selection function to execute for each item.
+ * @param {Object} scope (optional) The scope in which to execute the function.
+ * @return {Object} The first item in the collection which returned true from the selection function.
+ */
+    find : function(fn, scope){
+        for(var i = 0, len = this.items.length; i < len; i++){
+            if(fn.call(scope || window, this.items[i], this.keys[i])){
+                return this.items[i];
+            }
+        }
+        return null;
+    },
+   
+/**
+ * Inserts an item at the specified index in the collection.
+ * @param {Number} index The index to insert the item at.
+ * @param {String} key The key to associate with the new item, or the item itself.
+ * @param {Object} o  (optional) If the second parameter was a key, the new item.
+ * @return {Object} The item inserted.
+ */
+    insert : function(index, key, o){
+        if(arguments.length == 2){
+            o = arguments[1];
+            key = this.getKey(o);
+        }
+        if(index >= this.length){
+            return this.add(key, o);
+        }
+        this.length++;
+        this.items.splice(index, 0, o);
+        if(typeof key != "undefined" && key != null){
+            this.map[key] = o;
+        }
+        this.keys.splice(index, 0, key);
+        this.fireEvent("add", index, o, key);
+        return o;
+    },
+   
+/**
+ * Removed an item from the collection.
+ * @param {Object} o The item to remove.
+ * @return {Object} The item removed.
+ */
+    remove : function(o){
+        return this.removeAt(this.indexOf(o));
+    },
+   
+/**
+ * Remove an item from a specified index in the collection.
+ * @param {Number} index The index within the collection of the item to remove.
+ */
+    removeAt : function(index){
+        if(index < this.length && index >= 0){
+            this.length--;
+            var o = this.items[index];
+            this.items.splice(index, 1);
+            var key = this.keys[index];
+            if(typeof key != "undefined"){
+                delete this.map[key];
+            }
+            this.keys.splice(index, 1);
+            this.fireEvent("remove", o, key);
+        }
+    },
+   
+/**
+ * Removed an item associated with the passed key fom the collection.
+ * @param {String} key The key of the item to remove.
+ */
+    removeKey : function(key){
+        return this.removeAt(this.indexOfKey(key));
+    },
+   
+/**
+ * Returns the number of items in the collection.
+ * @return {Number} the number of items in the collection.
+ */
+    getCount : function(){
+        return this.length; 
+    },
+   
+/**
+ * Returns index within the collection of the passed Object.
+ * @param {Object} o The item to find the index of.
+ * @return {Number} index of the item.
+ */
+    indexOf : function(o){
+        if(!this.items.indexOf){
+            for(var i = 0, len = this.items.length; i < len; i++){
+                if(this.items[i] == o) return i;
+            }
+            return -1;
+        }else{
+            return this.items.indexOf(o);
+        }
+    },
+   
+/**
+ * Returns index within the collection of the passed key.
+ * @param {String} key The key to find the index of.
+ * @return {Number} index of the key.
+ */
+    indexOfKey : function(key){
+        if(!this.keys.indexOf){
+            for(var i = 0, len = this.keys.length; i < len; i++){
+                if(this.keys[i] == key) return i;
+            }
+            return -1;
+        }else{
+            return this.keys.indexOf(key);
+        }
+    },
+   
+/**
+ * Returns the item associated with the passed key OR index. Key has priority over index.
+ * @param {String/Number} key The key or index of the item.
+ * @return {Object} The item associated with the passed key.
+ */
+    item : function(key){
+        var item = typeof this.map[key] != "undefined" ? this.map[key] : this.items[key];
+        return typeof item != 'function' || this.allowFunctions ? item : null; // for prototype!
+    },
+    
+/**
+ * Returns the item at the specified index.
+ * @param {Number} index The index of the item.
+ * @return {Object}
+ */
+    itemAt : function(index){
+        return this.items[index];
+    },
+    
+/**
+ * Returns the item associated with the passed key.
+ * @param {String/Number} key The key of the item.
+ * @return {Object} The item associated with the passed key.
+ */
+    key : function(key){
+        return this.map[key];
+    },
+   
+/**
+ * Returns true if the collection contains the passed Object as an item.
+ * @param {Object} o  The Object to look for in the collection.
+ * @return {Boolean} True if the collection contains the Object as an item.
+ */
+    contains : function(o){
+        return this.indexOf(o) != -1;
+    },
+   
+/**
+ * Returns true if the collection contains the passed Object as a key.
+ * @param {String} key The key to look for in the collection.
+ * @return {Boolean} True if the collection contains the Object as a key.
+ */
+    containsKey : function(key){
+        return typeof this.map[key] != "undefined";
+    },
+   
+/**
+ * Removes all items from the collection.
+ */
+    clear : function(){
+        this.length = 0;
+        this.items = [];
+        this.keys = [];
+        this.map = {};
+        this.fireEvent("clear");
+    },
+   
+/**
+ * Returns the first item in the collection.
+ * @return {Object} the first item in the collection..
+ */
+    first : function(){
+        return this.items[0]; 
+    },
+   
+/**
+ * Returns the last item in the collection.
+ * @return {Object} the last item in the collection..
+ */
+    last : function(){
+        return this.items[this.length-1];   
+    },
+    
+    _sort : function(property, dir, fn){
+        var dsc = String(dir).toUpperCase() == "DESC" ? -1 : 1;
+        fn = fn || function(a, b){
+            return a-b;
+        };
+        var c = [], k = this.keys, items = this.items;
+        for(var i = 0, len = items.length; i < len; i++){
+            c[c.length] = {key: k[i], value: items[i], index: i};
+        }
+        c.sort(function(a, b){
+            var v = fn(a[property], b[property]) * dsc;
+            if(v == 0){
+                v = (a.index < b.index ? -1 : 1);
+            }
+            return v;
+        });
+        for(var i = 0, len = c.length; i < len; i++){
+            items[i] = c[i].value;
+            k[i] = c[i].key;
+        }
+        this.fireEvent("sort", this);
+    },
+    
+    /**
+     * Sorts this collection with the passed comparison function
+     * @param {String} direction (optional) "ASC" or "DESC"
+     * @param {Function} fn (optional) comparison function
+     */
+    sort : function(dir, fn){
+        this._sort("value", dir, fn);
+    },
+    
+    /**
+     * Sorts this collection by keys
+     * @param {String} direction (optional) "ASC" or "DESC"
+     * @param {Function} fn (optional) a comparison function (defaults to case insensitive string)
+     */
+    keySort : function(dir, fn){
+        this._sort("key", dir, fn || function(a, b){
+            return String(a).toUpperCase()-String(b).toUpperCase();
+        });
+    },
+    
+    /**
+     * Returns a range of items in this collection
+     * @param {Number} startIndex (optional) defaults to 0
+     * @param {Number} endIndex (optional) default to the last item
+     * @return {Array} An array of items
+     */
+    getRange : function(start, end){
+        var items = this.items;
+        if(items.length < 1){
+            return [];
+        }
+        start = start || 0;
+        end = Math.min(typeof end == "undefined" ? this.length-1 : end, this.length-1);
+        var r = [];
+        if(start <= end){
+            for(var i = start; i <= end; i++) {
+                   r[r.length] = items[i];
+            }
+        }else{
+            for(var i = start; i >= end; i--) {
+                   r[r.length] = items[i];
+            }
+        }
+        return r;
+    },
+        
+    /**
+     * Filter the <i>objects</i> in this collection by a specific property. 
+     * Returns a new collection that has been filtered.
+     * @param {String} property A property on your objects
+     * @param {String/RegExp} value Either string that the property values 
+     * should start with or a RegExp to test against the property
+     * @return {MixedCollection} The new filtered collection
+     */
+    filter : function(property, value){
+        if(!value.exec){ // not a regex
+            value = String(value);
+            if(value.length == 0){
+                return this.clone();
+            }
+            value = new RegExp("^" + Roo.escapeRe(value), "i");
+        }
+        return this.filterBy(function(o){
+            return o && value.test(o[property]);
+        });
+       },
+    
+    /**
+     * Filter by a function. * Returns a new collection that has been filtered.
+     * The passed function will be called with each 
+     * object in the collection. If the function returns true, the value is included 
+     * otherwise it is filtered.
+     * @param {Function} fn The function to be called, it will receive the args o (the object), k (the key)
+     * @param {Object} scope (optional) The scope of the function (defaults to this) 
+     * @return {MixedCollection} The new filtered collection
+     */
+    filterBy : function(fn, scope){
+        var r = new Roo.util.MixedCollection();
+        r.getKey = this.getKey;
+        var k = this.keys, it = this.items;
+        for(var i = 0, len = it.length; i < len; i++){
+            if(fn.call(scope||this, it[i], k[i])){
+                               r.add(k[i], it[i]);
+                       }
+        }
+        return r;
+    },
+    
+    /**
+     * Creates a duplicate of this collection
+     * @return {MixedCollection}
+     */
+    clone : function(){
+        var r = new Roo.util.MixedCollection();
+        var k = this.keys, it = this.items;
+        for(var i = 0, len = it.length; i < len; i++){
+            r.add(k[i], it[i]);
+        }
+        r.getKey = this.getKey;
+        return r;
+    }
+});
+/**
+ * Returns the item associated with the passed key or index.
+ * @method
+ * @param {String/Number} key The key or index of the item.
+ * @return {Object} The item associated with the passed key.
+ */
+Roo.util.MixedCollection.prototype.get = Roo.util.MixedCollection.prototype.item;
\ No newline at end of file
diff --git a/Roo/util/Observable.js b/Roo/util/Observable.js
new file mode 100644 (file)
index 0000000..19eb731
--- /dev/null
@@ -0,0 +1,372 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+
+/**
+ * @class Roo.util.Observable
+ * Base class that provides a common interface for publishing events. Subclasses are expected to
+ * to have a property "events" with all the events defined.<br>
+ * For example:
+ * <pre><code>
+ Employee = function(name){
+    this.name = name;
+    this.addEvents({
+        "fired" : true,
+        "quit" : true
+    });
+ }
+ Roo.extend(Employee, Roo.util.Observable);
+</code></pre>
+ * @param {Object} config properties to use (incuding events / listeners)
+ */
+
+Roo.util.Observable = function(cfg){
+    
+    cfg = cfg|| {};
+    this.addEvents(cfg.events || {});
+    if (cfg.events) {
+        delete cfg.events; // make sure
+    }
+     
+    Roo.apply(this, cfg);
+    
+    if(this.listeners){
+        this.on(this.listeners);
+        delete this.listeners;
+    }
+};
+Roo.util.Observable.prototype = {
+    /** 
+ * @cfg {Object} listeners  list of events and functions to call for this object, 
+ * For example :
+ * <pre><code>
+    listeners :  { 
+       'click' : function(e) {
+           ..... 
+        } ,
+        .... 
+    } 
+  </code></pre>
+ */
+    
+    
+    /**
+     * Fires the specified event with the passed parameters (minus the event name).
+     * @param {String} eventName
+     * @param {Object...} args Variable number of parameters are passed to handlers
+     * @return {Boolean} returns false if any of the handlers return false otherwise it returns true
+     */
+    fireEvent : function(){
+        var ce = this.events[arguments[0].toLowerCase()];
+        if(typeof ce == "object"){
+            return ce.fire.apply(ce, Array.prototype.slice.call(arguments, 1));
+        }else{
+            return true;
+        }
+    },
+
+    // private
+    filterOptRe : /^(?:scope|delay|buffer|single)$/,
+
+    /**
+     * Appends an event handler to this component
+     * @param {String}   eventName The type of event to listen for
+     * @param {Function} handler The method the event invokes
+     * @param {Object}   scope (optional) The scope in which to execute the handler
+     * function. The handler function's "this" context.
+     * @param {Object}   options (optional) An object containing handler configuration
+     * properties. This may contain any of the following properties:<ul>
+     * <li>scope {Object} The scope in which to execute the handler function. The handler function's "this" context.</li>
+     * <li>delay {Number} The number of milliseconds to delay the invocation of the handler after te event fires.</li>
+     * <li>single {Boolean} True to add a handler to handle just the next firing of the event, and then remove itself.</li>
+     * <li>buffer {Number} Causes the handler to be scheduled to run in an {@link Roo.util.DelayedTask} delayed
+     * by the specified number of milliseconds. If the event fires again within that time, the original
+     * handler is <em>not</em> invoked, but the new handler is scheduled in its place.</li>
+     * </ul><br>
+     * <p>
+     * <b>Combining Options</b><br>
+     * Using the options argument, it is possible to combine different types of listeners:<br>
+     * <br>
+     * A normalized, delayed, one-time listener that auto stops the event and passes a custom argument (forumId)
+               <pre><code>
+               el.on('click', this.onClick, this, {
+                       single: true,
+               delay: 100,
+               forumId: 4
+               });
+               </code></pre>
+     * <p>
+     * <b>Attaching multiple handlers in 1 call</b><br>
+     * The method also allows for a single argument to be passed which is a config object containing properties
+     * which specify multiple handlers.
+     * <pre><code>
+               el.on({
+                       'click': {
+                       fn: this.onClick,
+                       scope: this,
+                       delay: 100
+               }, 
+               'mouseover': {
+                       fn: this.onMouseOver,
+                       scope: this
+               },
+               'mouseout': {
+                       fn: this.onMouseOut,
+                       scope: this
+               }
+               });
+               </code></pre>
+     * <p>
+     * Or a shorthand syntax which passes the same scope object to all handlers:
+       <pre><code>
+               el.on({
+                       'click': this.onClick,
+               'mouseover': this.onMouseOver,
+               'mouseout': this.onMouseOut,
+               scope: this
+               });
+               </code></pre>
+     */
+    addListener : function(eventName, fn, scope, o){
+        if(typeof eventName == "object"){
+            o = eventName;
+            for(var e in o){
+                if(this.filterOptRe.test(e)){
+                    continue;
+                }
+                if(typeof o[e] == "function"){
+                    // shared options
+                    this.addListener(e, o[e], o.scope,  o);
+                }else{
+                    // individual options
+                    this.addListener(e, o[e].fn, o[e].scope, o[e]);
+                }
+            }
+            return;
+        }
+        o = (!o || typeof o == "boolean") ? {} : o;
+        eventName = eventName.toLowerCase();
+        var ce = this.events[eventName] || true;
+        if(typeof ce == "boolean"){
+            ce = new Roo.util.Event(this, eventName);
+            this.events[eventName] = ce;
+        }
+        ce.addListener(fn, scope, o);
+    },
+
+    /**
+     * Removes a listener
+     * @param {String}   eventName     The type of event to listen for
+     * @param {Function} handler        The handler to remove
+     * @param {Object}   scope  (optional) The scope (this object) for the handler
+     */
+    removeListener : function(eventName, fn, scope){
+        var ce = this.events[eventName.toLowerCase()];
+        if(typeof ce == "object"){
+            ce.removeListener(fn, scope);
+        }
+    },
+
+    /**
+     * Removes all listeners for this object
+     */
+    purgeListeners : function(){
+        for(var evt in this.events){
+            if(typeof this.events[evt] == "object"){
+                 this.events[evt].clearListeners();
+            }
+        }
+    },
+
+    relayEvents : function(o, events){
+        var createHandler = function(ename){
+            return function(){
+                return this.fireEvent.apply(this, Roo.combine(ename, Array.prototype.slice.call(arguments, 0)));
+            };
+        };
+        for(var i = 0, len = events.length; i < len; i++){
+            var ename = events[i];
+            if(!this.events[ename]){ this.events[ename] = true; };
+            o.on(ename, createHandler(ename), this);
+        }
+    },
+
+    /**
+     * Used to define events on this Observable
+     * @param {Object} object The object with the events defined
+     */
+    addEvents : function(o){
+        if(!this.events){
+            this.events = {};
+        }
+        Roo.applyIf(this.events, o);
+    },
+
+    /**
+     * Checks to see if this object has any listeners for a specified event
+     * @param {String} eventName The name of the event to check for
+     * @return {Boolean} True if the event is being listened for, else false
+     */
+    hasListener : function(eventName){
+        var e = this.events[eventName];
+        return typeof e == "object" && e.listeners.length > 0;
+    }
+};
+/**
+ * Appends an event handler to this element (shorthand for addListener)
+ * @param {String}   eventName     The type of event to listen for
+ * @param {Function} handler        The method the event invokes
+ * @param {Object}   scope (optional) The scope in which to execute the handler
+ * function. The handler function's "this" context.
+ * @param {Object}   options  (optional)
+ * @method
+ */
+Roo.util.Observable.prototype.on = Roo.util.Observable.prototype.addListener;
+/**
+ * Removes a listener (shorthand for removeListener)
+ * @param {String}   eventName     The type of event to listen for
+ * @param {Function} handler        The handler to remove
+ * @param {Object}   scope  (optional) The scope (this object) for the handler
+ * @method
+ */
+Roo.util.Observable.prototype.un = Roo.util.Observable.prototype.removeListener;
+
+/**
+ * Starts capture on the specified Observable. All events will be passed
+ * to the supplied function with the event name + standard signature of the event
+ * <b>before</b> the event is fired. If the supplied function returns false,
+ * the event will not fire.
+ * @param {Observable} o The Observable to capture
+ * @param {Function} fn The function to call
+ * @param {Object} scope (optional) The scope (this object) for the fn
+ * @static
+ */
+Roo.util.Observable.capture = function(o, fn, scope){
+    o.fireEvent = o.fireEvent.createInterceptor(fn, scope);
+};
+
+/**
+ * Removes <b>all</b> added captures from the Observable.
+ * @param {Observable} o The Observable to release
+ * @static
+ */
+Roo.util.Observable.releaseCapture = function(o){
+    o.fireEvent = Roo.util.Observable.prototype.fireEvent;
+};
+
+(function(){
+
+    var createBuffered = function(h, o, scope){
+        var task = new Roo.util.DelayedTask();
+        return function(){
+            task.delay(o.buffer, h, scope, Array.prototype.slice.call(arguments, 0));
+        };
+    };
+
+    var createSingle = function(h, e, fn, scope){
+        return function(){
+            e.removeListener(fn, scope);
+            return h.apply(scope, arguments);
+        };
+    };
+
+    var createDelayed = function(h, o, scope){
+        return function(){
+            var args = Array.prototype.slice.call(arguments, 0);
+            setTimeout(function(){
+                h.apply(scope, args);
+            }, o.delay || 10);
+        };
+    };
+
+    Roo.util.Event = function(obj, name){
+        this.name = name;
+        this.obj = obj;
+        this.listeners = [];
+    };
+
+    Roo.util.Event.prototype = {
+        addListener : function(fn, scope, options){
+            var o = options || {};
+            scope = scope || this.obj;
+            if(!this.isListening(fn, scope)){
+                var l = {fn: fn, scope: scope, options: o};
+                var h = fn;
+                if(o.delay){
+                    h = createDelayed(h, o, scope);
+                }
+                if(o.single){
+                    h = createSingle(h, this, fn, scope);
+                }
+                if(o.buffer){
+                    h = createBuffered(h, o, scope);
+                }
+                l.fireFn = h;
+                if(!this.firing){ // if we are currently firing this event, don't disturb the listener loop
+                    this.listeners.push(l);
+                }else{
+                    this.listeners = this.listeners.slice(0);
+                    this.listeners.push(l);
+                }
+            }
+        },
+
+        findListener : function(fn, scope){
+            scope = scope || this.obj;
+            var ls = this.listeners;
+            for(var i = 0, len = ls.length; i < len; i++){
+                var l = ls[i];
+                if(l.fn == fn && l.scope == scope){
+                    return i;
+                }
+            }
+            return -1;
+        },
+
+        isListening : function(fn, scope){
+            return this.findListener(fn, scope) != -1;
+        },
+
+        removeListener : function(fn, scope){
+            var index;
+            if((index = this.findListener(fn, scope)) != -1){
+                if(!this.firing){
+                    this.listeners.splice(index, 1);
+                }else{
+                    this.listeners = this.listeners.slice(0);
+                    this.listeners.splice(index, 1);
+                }
+                return true;
+            }
+            return false;
+        },
+
+        clearListeners : function(){
+            this.listeners = [];
+        },
+
+        fire : function(){
+            var ls = this.listeners, scope, len = ls.length;
+            if(len > 0){
+                this.firing = true;
+                var args = Array.prototype.slice.call(arguments, 0);
+                for(var i = 0; i < len; i++){
+                    var l = ls[i];
+                    if(l.fireFn.apply(l.scope||this.obj||window, arguments) === false){
+                        this.firing = false;
+                        return false;
+                    }
+                }
+                this.firing = false;
+            }
+            return true;
+        }
+    };
+})();
\ No newline at end of file
diff --git a/Roo/util/TaskRunner.js b/Roo/util/TaskRunner.js
new file mode 100644 (file)
index 0000000..bc8ece8
--- /dev/null
@@ -0,0 +1,98 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+Roo.util.TaskRunner = function(interval){
+    interval = interval || 10;
+    var tasks = [], removeQueue = [];
+    var id = 0;
+    var running = false;
+
+    var stopThread = function(){
+        running = false;
+        clearInterval(id);
+        id = 0;
+    };
+
+    var startThread = function(){
+        if(!running){
+            running = true;
+            id = setInterval(runTasks, interval);
+        }
+    };
+
+    var removeTask = function(task){
+        removeQueue.push(task);
+        if(task.onStop){
+            task.onStop();
+        }
+    };
+
+    var runTasks = function(){
+        if(removeQueue.length > 0){
+            for(var i = 0, len = removeQueue.length; i < len; i++){
+                tasks.remove(removeQueue[i]);
+            }
+            removeQueue = [];
+            if(tasks.length < 1){
+                stopThread();
+                return;
+            }
+        }
+        var now = new Date().getTime();
+        for(var i = 0, len = tasks.length; i < len; ++i){
+            var t = tasks[i];
+            var itime = now - t.taskRunTime;
+            if(t.interval <= itime){
+                var rt = t.run.apply(t.scope || t, t.args || [++t.taskRunCount]);
+                t.taskRunTime = now;
+                if(rt === false || t.taskRunCount === t.repeat){
+                    removeTask(t);
+                    return;
+                }
+            }
+            if(t.duration && t.duration <= (now - t.taskStartTime)){
+                removeTask(t);
+            }
+        }
+    };
+
+    /**
+     * Queues a new task.
+     * @param {Object} task
+     */
+    this.start = function(task){
+        tasks.push(task);
+        task.taskStartTime = new Date().getTime();
+        task.taskRunTime = 0;
+        task.taskRunCount = 0;
+        startThread();
+        return task;
+    };
+
+    this.stop = function(task){
+        removeTask(task);
+        return task;
+    };
+
+    this.stopAll = function(){
+        stopThread();
+        for(var i = 0, len = tasks.length; i < len; i++){
+            if(tasks[i].onStop){
+                tasks[i].onStop();
+            }
+        }
+        tasks = [];
+        removeQueue = [];
+    };
+};
+
+Roo.TaskMgr = new Roo.util.TaskRunner();
\ No newline at end of file
diff --git a/Roo/util/TextMetrics.js b/Roo/util/TextMetrics.js
new file mode 100644 (file)
index 0000000..f4ad453
--- /dev/null
@@ -0,0 +1,125 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+
+/**
+ * @class Roo.util.TextMetrics
+ * Provides precise pixel measurements for blocks of text so that you can determine exactly how high and
+ * wide, in pixels, a given block of text will be.
+ * @singleton
+ */
+Roo.util.TextMetrics = function(){
+    var shared;
+    return {
+        /**
+         * Measures the size of the specified text
+         * @param {String/HTMLElement} el The element, dom node or id from which to copy existing CSS styles
+         * that can affect the size of the rendered text
+         * @param {String} text The text to measure
+         * @param {Number} fixedWidth (optional) If the text will be multiline, you have to set a fixed width
+         * in order to accurately measure the text height
+         * @return {Object} An object containing the text's size {width: (width), height: (height)}
+         */
+        measure : function(el, text, fixedWidth){
+            if(!shared){
+                shared = Roo.util.TextMetrics.Instance(el, fixedWidth);
+            }
+            shared.bind(el);
+            shared.setFixedWidth(fixedWidth || 'auto');
+            return shared.getSize(text);
+        },
+
+        /**
+         * Return a unique TextMetrics instance that can be bound directly to an element and reused.  This reduces
+         * the overhead of multiple calls to initialize the style properties on each measurement.
+         * @param {String/HTMLElement} el The element, dom node or id that the instance will be bound to
+         * @param {Number} fixedWidth (optional) If the text will be multiline, you have to set a fixed width
+         * in order to accurately measure the text height
+         * @return {Roo.util.TextMetrics.Instance} instance The new instance
+         */
+        createInstance : function(el, fixedWidth){
+            return Roo.util.TextMetrics.Instance(el, fixedWidth);
+        }
+    };
+}();
+
+Roo.util.TextMetrics.Instance = function(bindTo, fixedWidth){
+    var ml = new Roo.Element(document.createElement('div'));
+    document.body.appendChild(ml.dom);
+    ml.position('absolute');
+    ml.setLeftTop(-1000, -1000);
+    ml.hide();
+
+    if(fixedWidth){
+        ml.setWidth(fixedWidth);
+    }
+
+    var instance = {
+        /**
+         * Returns the size of the specified text based on the internal element's style and width properties
+         * @param {String} text The text to measure
+         * @return {Object} An object containing the text's size {width: (width), height: (height)}
+         */
+        getSize : function(text){
+            ml.update(text);
+            var s = ml.getSize();
+            ml.update('');
+            return s;
+        },
+
+        /**
+         * Binds this TextMetrics instance to an element from which to copy existing CSS styles
+         * that can affect the size of the rendered text
+         * @param {String/HTMLElement} el The element, dom node or id
+         */
+        bind : function(el){
+            ml.setStyle(
+                Roo.fly(el).getStyles('font-size','font-style', 'font-weight', 'font-family','line-height')
+            );
+        },
+
+        /**
+         * Sets a fixed width on the internal measurement element.  If the text will be multiline, you have
+         * to set a fixed width in order to accurately measure the text height.
+         * @param {Number} width The width to set on the element
+         */
+        setFixedWidth : function(width){
+            ml.setWidth(width);
+        },
+
+        /**
+         * Returns the measured width of the specified text
+         * @param {String} text The text to measure
+         * @return {Number} width The width in pixels
+         */
+        getWidth : function(text){
+            ml.dom.style.width = 'auto';
+            return this.getSize(text).width;
+        },
+
+        /**
+         * Returns the measured height of the specified text.  For multiline text, be sure to call
+         * {@link #setFixedWidth} if necessary.
+         * @param {String} text The text to measure
+         * @return {Number} height The height in pixels
+         */
+        getHeight : function(text){
+            return this.getSize(text).height;
+        }
+    };
+
+    instance.bind(bindTo);
+
+    return instance;
+};
+
+// backwards compat
+Roo.Element.measureText = Roo.util.TextMetrics.measure;
\ No newline at end of file
diff --git a/String.js b/String.js
new file mode 100644 (file)
index 0000000..d533253
--- /dev/null
+++ b/String.js
@@ -0,0 +1,91 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+
+Roo.applyIf(String, {
+    
+    /** @scope String */
+    
+    /**
+     * Escapes the passed string for ' and \
+     * @param {String} string The string to escape
+     * @return {String} The escaped string
+     * @static
+     */
+    escape : function(string) {
+        return string.replace(/('|\\)/g, "\\$1");
+    },
+
+    /**
+     * Pads the left side of a string with a specified character.  This is especially useful
+     * for normalizing number and date strings.  Example usage:
+     * <pre><code>
+var s = String.leftPad('123', 5, '0');
+// s now contains the string: '00123'
+</code></pre>
+     * @param {String} string The original string
+     * @param {Number} size The total length of the output string
+     * @param {String} char (optional) The character with which to pad the original string (defaults to empty string " ")
+     * @return {String} The padded string
+     * @static
+     */
+    leftPad : function (val, size, ch) {
+        var result = new String(val);
+        if(ch === null || ch === undefined || ch === '') {
+            ch = " ";
+        }
+        while (result.length < size) {
+            result = ch + result;
+        }
+        return result;
+    },
+
+    /**
+     * Allows you to define a tokenized string and pass an arbitrary number of arguments to replace the tokens.  Each
+     * token must be unique, and must increment in the format {0}, {1}, etc.  Example usage:
+     * <pre><code>
+var cls = 'my-class', text = 'Some text';
+var s = String.format('<div class="{0}">{1}</div>', cls, text);
+// s now contains the string: '<div class="my-class">Some text</div>'
+</code></pre>
+     * @param {String} string The tokenized string to be formatted
+     * @param {String} value1 The value to replace token {0}
+     * @param {String} value2 Etc...
+     * @return {String} The formatted string
+     * @static
+     */
+    format : function(format){
+        var args = Array.prototype.slice.call(arguments, 1);
+        return format.replace(/\{(\d+)\}/g, function(m, i){
+            return Roo.util.Format.htmlEncode(args[i]);
+        });
+    }
+});
+
+/**
+ * Utility function that allows you to easily switch a string between two alternating values.  The passed value
+ * is compared to the current string, and if they are equal, the other value that was passed in is returned.  If
+ * they are already different, the first value passed in is returned.  Note that this method returns the new value
+ * but does not change the current string.
+ * <pre><code>
+// alternate sort directions
+sort = sort.toggle('ASC', 'DESC');
+
+// instead of conditional logic:
+sort = (sort == 'ASC' ? 'DESC' : 'ASC');
+</code></pre>
+ * @param {String} value The value to compare to the current string
+ * @param {String} other The new value to use if the string already equals the first value passed in
+ * @return {String} The new value
+ */
+String.prototype.toggle = function(value, other){
+    return this == value ? other : value;
+};
\ No newline at end of file
diff --git a/buildSDK/bundle_build.js b/buildSDK/bundle_build.js
new file mode 100644 (file)
index 0000000..f986dbc
--- /dev/null
@@ -0,0 +1,85 @@
+/**
+ * Usage:
+ * 
+ * In the top level Roojs directory.. (you need to change the path of the jstoolkit)
+ * 
+ * roolite buildSDK/bundle_build.js -L/home/svn/svn/rooscript/examples/jstoolkit2
+ * 
+ * later we will have additional sections in the dep builder for adding/removeing files from list 
+ * for smaller builds..
+ * <script type="text/javascript">
+ */
+// pack needs to be in the include path!!
+
+include 'lib/Array.js';
+include 'lib/JSDOC.js';
+include 'lib/JSDOC/Identifier.js';
+include 'lib/JSDOC/TokenReader.js';
+include 'lib/JSDOC/Token.js';
+include 'lib/JSDOC/TokenStream.js';
+
+include 'lib/JSDOC/CompressWhite.js';
+include 'lib/JSDOC/Scope.js';
+include 'lib/JSDOC/ScopeParser.js';
+include 'lib/JSDOC/Packer.js';
+
+
+
+var argv = new Array();
+    var gotsep = false;
+    for (var i = 0 ; i < arguments.length; i++) {
+        if (arguments[i] == '--') {
+            gotsep = true;
+            continue;
+        }
+        if (!gotsep) {
+            continue;
+        }
+        argv.push(arguments[i]);
+    }
+
+function main() {
+
+   
+    println(argv.toSource());
+    
+    var files = [];
+    var spath = File.getcwd();
+    var flist = File.read(spath+"/buildSDK/dependancy_order.txt" ).split("\n");
+    for(var i = 0; i < flist.length;i++) {
+        var f = flist[i];
+        if (/^\s*\//.test(f) || !/[a-z]+/i.test(f)) {
+            continue;
+        }
+        //println("ADD"+ f.replace(/\./g, '/'));
+        files.push(spath + '/' + f.replace(/\./g, '/').replace(/\s+/g,'')+'.js');
+        
+    }
+     
+    
+    println(files.toSource());
+    
+      
+    var bpath = spath + '/build';
+    if (!File.exists(bpath)) {
+        File.mkdir(bpath);
+    }
+    
+    
+    var debugfile = spath + "/roojs-debug.js";
+    
+    
+    var allfile = spath + "/roojs-all.js";
+    
+    
+    var pk = new JSDOC.Packer(files, spath);
+    pk.translate = false;
+    pk.packFiles(bpath, allfile, debugfile);
+     
+    
+    println("Finished!");
+  
+}
+
+main();
+    
\ No newline at end of file
diff --git a/buildSDK/cssmini.js b/buildSDK/cssmini.js
new file mode 100644 (file)
index 0000000..b56e6df
--- /dev/null
@@ -0,0 +1,221 @@
+/**
+ * YUI Compressor
+ * Author: Julien Lecomte <jlecomte@yahoo-inc.com>
+ * Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+ * Code licensed under the BSD License:
+ *     http://developer.yahoo.net/yui/license.txt
+ *
+ * This code is a port of Isaac Schlueter's cssmin utility.
+ <script type="text/javascript">
+ */ 
+  
+  
+// let's see if this works..
+// should be run from top level..
+
+var pa = File.getcwd();
+//println(pack(File.read(pa+'/css/basic-dialog.css')));
+File.write(pa+'/css/roojs.css',
+    
+    pack(File.read(pa+'/css/reset-min.css'))+"\n"+
+    pack(File.read(pa+'/css/core.css'))+"\n"+
+    pack(File.read(pa+'/css/tabs.css'))+"\n"+
+    pack(File.read(pa+'/css/form.css'))+"\n"+
+    pack(File.read(pa+'/css/button.css')) +"\n"+
+    pack(File.read(pa+'/css/toolbar.css'))+"\n"+
+    pack(File.read(pa+'/css/resizable.css'))+"\n"+
+    pack(File.read(pa+'/css/grid.css'))+"\n"+
+    pack(File.read(pa+'/css/layout.css'))+"\n"+
+    pack(File.read(pa+'/css/basic-dialog.css'))+"\n"+
+    pack(File.read(pa+'/css/dd.css'))+"\n"+
+    pack(File.read(pa+'/css/tree.css'))+"\n" +
+    pack(File.read(pa+'/css/qtips.css'))+"\n"+
+    pack(File.read(pa+'/css/date.css')) +"\n"+
+    //pack(File.read(pa+'/css/menu.css')) +"\n"+
+    //pack(File.read(pa+'/css/box.css')) +"\n"+
+    pack(File.read(pa+'/css/combo.css')) +"\n"+
+    
+    pack(File.read(pa+'/css/inline-editor.css'))+"\n"
+    
+  
+    
+    
+);
+println("written css/roojs.css");
+// and the themese...
+//ytheme-aero.css
+//ytheme-gray.css
+//ytheme-vista.css
+
+  
+  
+  
+  
+  
+        // string manip!?
+function pack(istr) {
+    
+        
+        function removeComments(str)
+        {
+            var r = ''; //ret
+            var si =0;
+            var  iemac = false;
+            
+            while ((si = str.indexOf("/*")) > -1) {
+                ei = str.indexOf("*/");
+                 
+                
+                if (ei >= si + 2) {
+                    if (str.charAt(ei-1) == '\\') {   // eg. /* \*/
+                        si = ei+2;
+                        iemac = true;
+                        // Looks like a comment to hide rules from IE Mac.
+                        // Leave this comment, and the following one, alone...
+                        // shunt:
+                        
+                        r += str.substring(0, ei) ;
+                        str = str.substring(ei);
+                        continue;
+                    }
+                    if (iemac) {
+                        si = ei + 2;
+                        iemac = false;    
+                        r += str.substring(0, ei) ;
+                        str = str.substring(ei+2);
+                        continue;
+                    }
+                    
+                    r += str.substring(0, si) ;
+                    str = str.substring(ei+2);
+                    continue;
+                }
+                // did not find end..
+                r += str.substring(0, 2);
+                str = str.substring(2);
+                    
+                    
+            }
+                r += str;
+            return r;
+        }
+        
+        istr = removeComments(istr);
+        //println("after comments remove: " + istr);
+        
+        // Normalize all whitespace strings to single spaces. Easier to work with that way.
+        istr = istr.replace(/\s+/g, ' ');
+
+        // Make a pseudo class for the Box Model Hack ????
+        //css = css.replaceAll("\"\\\\\"}\\\\\"\"", "___PSEUDOCLASSBMH___");
+        istr = istr.replace(/"\\"\}\\"/g, "___PSEUDOCLASSBMH___");
+
+        // Remove the spaces before the things that should not have spaces before them.
+        // But, be careful not to turn "p :link {...}" into "p:link{...}"
+        // Swap out any pseudo-class colons with the token, and then swap back.
+        
+        istr = istr.replace(/(^|\})(([^\{:])+:)+([^\{]*\{)/g, function(m) {
+            return m.replace(/:/g, "___PSEUDOCLASSCOLON___");
+        });
+        
+        
+        istr = istr.replace(/\s+([!{};:>+\(\)\],])/g, "$1");
+        istr = istr.replace(/___PSEUDOCLASSCOLON___/g, ":");
+
+        // Remove the spaces after the things that should not have spaces after them.
+        istr = istr.replace(/([!{}:;>+\(\[,])\s+/g, "$1");
+
+        // Add the semicolon where it's missing.
+        istr = istr.replace(/([^;\}])\}/g, "$1;}");
+
+        // Replace 0(px,em,%) with 0.
+        istr = istr.replace(/([\s:])(0)(px|em|%|in|cm|mm|pc|pt|ex)/g, "$1$2");
+
+        // Replace 0 0 0 0; with 0. (by this time, we have reduced spaces etc..
+        istr = istr.replace(/:0 0 0 0;/g, ":0;");
+        istr = istr.replace(/:0 0 0;/g, ":0;");
+        istr = istr.replace(/:0 0;/g, ":0;");
+        // Replace background-position:0; with background-position:0 0;
+        istr = istr.replace(/background-position:0;/g, "background-position:0 0;");
+
+        // Replace 0.6 to .6, but only when preceded by : or a white-space
+        istr = istr.replace(/(:|\s)0+\.(\d+)/g, "$1.$2");
+
+        // Shorten colors from rgb(51,102,153) to #336699
+        // This makes it more likely that it'll get further compressed in the next step.
+        
+        istr = istr.replace(/rgb\s*\(\s*([0-9,\s]+)\s*\)/g, function(m, c)
+            {
+                var rgb = c.split(',');
+                var hx = '';
+                for (var  i = 0; i < rgb.length; i++) {
+                    var val = parseInt(rgb[i]);
+                    if (val < 16) {
+                        hx+="0";
+                    }
+                    hx+=val.toString(16);
+                    
+                }
+                return '#' + hx;
+            });
+        
+         
+
+        // Shorten colors from #AABBCC to #ABC. Note that we want to make sure
+        // the color is not preceded by either ", " or =. Indeed, the property
+        //     filter: chroma(color="#FFFFFF");
+        // would become
+        //     filter: chroma(color="#FFF");
+        // which makes the filter break in IE.
+        
+        istr = istr.replace(/([^"'=\s])(\s*)#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])/g, 
+                function(m, g1,g2,g3,g4,g5,g6,g7,g8) {
+                    
+                     
+                        
+                        if (g3.toLowerCase() == g4.toLowerCase() &&
+                            g5.toLowerCase() == g6.toLowerCase() &&
+                            g7.toLowerCase() == g8.toLowerCase()) {
+                                
+                                return g1+g2+'#' + g3+g5+g7;
+                        }
+                     
+                   
+                    return m;
+                    
+                });
+         
+        // Remove empty rules.
+        istr = istr.replace(/[^\}]+\{;\}/g, "");
+/*
+        if (linebreakpos >= 0) {
+            // Some source control tools don't like it when files containing lines longer
+            // than, say 8000 characters, are checked in. The linebreak option is used in
+            // that case to split long lines after a specific column.
+            int i = 0;
+            int linestartpos = 0;
+            sb = new StringBuffer(css);
+            while (i < sb.length()) {
+                char c = sb.charAt(i++);
+                if (c == '}' && i - linestartpos > linebreakpos) {
+                    sb.insert(i, '\n');
+                    linestartpos = i;
+                }
+            }
+
+            css = sb.toString();
+        }
+*/
+        // Replace the pseudo class for the Box Model Hack
+        istr = istr.replace(/___PSEUDOCLASSBMH___/g, "\"\\\\\"}\\\\\"\"");
+
+        // Trim the final string (for any leading or trailing white spaces)
+        istr = istr.replace(/^\s+/g, '');
+        istr = istr.replace(/\s+$/g, '');
+
+
+        // Write the output...
+        return istr;
+}
\ No newline at end of file
diff --git a/buildSDK/cssminiX.js b/buildSDK/cssminiX.js
new file mode 100644 (file)
index 0000000..b6db059
--- /dev/null
@@ -0,0 +1,220 @@
+/**
+ * YUI Compressor
+ * Author: Julien Lecomte <jlecomte@yahoo-inc.com>
+ * Copyright (c) 2007, Yahoo! Inc. All rights reserved.
+ * Code licensed under the BSD License:
+ *     http://developer.yahoo.net/yui/license.txt
+ *
+ * This code is a port of Isaac Schlueter's cssmin utility.
+ <script type="text/javascript">
+ */ 
+  
+  
+// let's see if this works..
+// should be run from top level..
+
+var pa = File.getcwd();
+//println(pack(File.read(pa+'/css/basic-dialog.css')));
+File.write(pa+'/cssX/roojs.css',
+    
+    pack(File.read(pa+'/cssX/reset-min.css'))+"\n"+
+    pack(File.read(pa+'/cssX/core.css'))+"\n"+
+    pack(File.read(pa+'/cssX/tabs.css'))+"\n"+
+    pack(File.read(pa+'/cssX/form.css'))+"\n"+
+    pack(File.read(pa+'/cssX/button.css')) +"\n"+
+    pack(File.read(pa+'/cssX/toolbar.css'))+"\n"+
+    pack(File.read(pa+'/cssX/resizable.css'))+"\n"+
+    pack(File.read(pa+'/cssX/grid.css'))+"\n"+
+    pack(File.read(pa+'/cssX/layout.css'))+"\n"+
+    pack(File.read(pa+'/cssX/basic-dialog.css'))+"\n"+
+    pack(File.read(pa+'/cssX/dd.css'))+"\n"+
+    pack(File.read(pa+'/cssX/tree.css'))+"\n" +
+    pack(File.read(pa+'/cssX/qtips.css'))+"\n"+
+    pack(File.read(pa+'/cssX/date-picker.css')) +"\n"+
+    pack(File.read(pa+'/cssX/menu.css')) +"\n"+
+    pack(File.read(pa+'/cssX/box.css')) +"\n"+
+    pack(File.read(pa+'/cssX/combo.css')) +"\n"+
+    pack(File.read(pa+'/cssX/editor.css'))+"\n"
+    
+  
+    
+    
+);
+println("written cssX/roojs.css");
+// and the themese...
+//ytheme-aero.css
+//ytheme-gray.css
+//ytheme-vista.css
+
+  
+  
+  
+  
+  
+        // string manip!?
+function pack(istr) {
+    
+        
+        function removeComments(str)
+        {
+            var r = ''; //ret
+            var si =0;
+            var  iemac = false;
+            
+            while ((si = str.indexOf("/*")) > -1) {
+                ei = str.indexOf("*/");
+                 
+                
+                if (ei >= si + 2) {
+                    if (str.charAt(ei-1) == '\\') {   // eg. /* \*/
+                        si = ei+2;
+                        iemac = true;
+                        // Looks like a comment to hide rules from IE Mac.
+                        // Leave this comment, and the following one, alone...
+                        // shunt:
+                        
+                        r += str.substring(0, ei) ;
+                        str = str.substring(ei);
+                        continue;
+                    }
+                    if (iemac) {
+                        si = ei + 2;
+                        iemac = false;    
+                        r += str.substring(0, ei) ;
+                        str = str.substring(ei+2);
+                        continue;
+                    }
+                    
+                    r += str.substring(0, si) ;
+                    str = str.substring(ei+2);
+                    continue;
+                }
+                // did not find end..
+                r += str.substring(0, 2);
+                str = str.substring(2);
+                    
+                    
+            }
+                r += str;
+            return r;
+        }
+        
+        istr = removeComments(istr);
+        //println("after comments remove: " + istr);
+        
+        // Normalize all whitespace strings to single spaces. Easier to work with that way.
+        istr = istr.replace(/\s+/g, ' ');
+
+        // Make a pseudo class for the Box Model Hack ????
+        //css = css.replaceAll("\"\\\\\"}\\\\\"\"", "___PSEUDOCLASSBMH___");
+        istr = istr.replace(/"\\"\}\\"/g, "___PSEUDOCLASSBMH___");
+
+        // Remove the spaces before the things that should not have spaces before them.
+        // But, be careful not to turn "p :link {...}" into "p:link{...}"
+        // Swap out any pseudo-class colons with the token, and then swap back.
+        
+        istr = istr.replace(/(^|\})(([^\{:])+:)+([^\{]*\{)/g, function(m) {
+            return m.replace(/:/g, "___PSEUDOCLASSCOLON___");
+        });
+        
+        
+        istr = istr.replace(/\s+([!{};:>+\(\)\],])/g, "$1");
+        istr = istr.replace(/___PSEUDOCLASSCOLON___/g, ":");
+
+        // Remove the spaces after the things that should not have spaces after them.
+        istr = istr.replace(/([!{}:;>+\(\[,])\s+/g, "$1");
+
+        // Add the semicolon where it's missing.
+        istr = istr.replace(/([^;\}])\}/g, "$1;}");
+
+        // Replace 0(px,em,%) with 0.
+        istr = istr.replace(/([\s:])(0)(px|em|%|in|cm|mm|pc|pt|ex)/g, "$1$2");
+
+        // Replace 0 0 0 0; with 0. (by this time, we have reduced spaces etc..
+        istr = istr.replace(/:0 0 0 0;/g, ":0;");
+        istr = istr.replace(/:0 0 0;/g, ":0;");
+        istr = istr.replace(/:0 0;/g, ":0;");
+        // Replace background-position:0; with background-position:0 0;
+        istr = istr.replace(/background-position:0;/g, "background-position:0 0;");
+
+        // Replace 0.6 to .6, but only when preceded by : or a white-space
+        istr = istr.replace(/(:|\s)0+\.(\d+)/g, "$1.$2");
+
+        // Shorten colors from rgb(51,102,153) to #336699
+        // This makes it more likely that it'll get further compressed in the next step.
+        
+        istr = istr.replace(/rgb\s*\(\s*([0-9,\s]+)\s*\)/g, function(m, c)
+            {
+                var rgb = c.split(',');
+                var hx = '';
+                for (var  i = 0; i < rgb.length; i++) {
+                    var val = parseInt(rgb[i]);
+                    if (val < 16) {
+                        hx+="0";
+                    }
+                    hx+=val.toString(16);
+                    
+                }
+                return '#' + hx;
+            });
+        
+         
+
+        // Shorten colors from #AABBCC to #ABC. Note that we want to make sure
+        // the color is not preceded by either ", " or =. Indeed, the property
+        //     filter: chroma(color="#FFFFFF");
+        // would become
+        //     filter: chroma(color="#FFF");
+        // which makes the filter break in IE.
+        
+        istr = istr.replace(/([^"'=\s])(\s*)#([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])([0-9a-fA-F])/g, 
+                function(m, g1,g2,g3,g4,g5,g6,g7,g8) {
+                    
+                     
+                        
+                        if (g3.toLowerCase() == g4.toLowerCase() &&
+                            g5.toLowerCase() == g6.toLowerCase() &&
+                            g7.toLowerCase() == g8.toLowerCase()) {
+                                
+                                return g1+g2+'#' + g3+g5+g7;
+                        }
+                     
+                   
+                    return m;
+                    
+                });
+         
+        // Remove empty rules.
+        istr = istr.replace(/[^\}]+\{;\}/g, "");
+/*
+        if (linebreakpos >= 0) {
+            // Some source control tools don't like it when files containing lines longer
+            // than, say 8000 characters, are checked in. The linebreak option is used in
+            // that case to split long lines after a specific column.
+            int i = 0;
+            int linestartpos = 0;
+            sb = new StringBuffer(css);
+            while (i < sb.length()) {
+                char c = sb.charAt(i++);
+                if (c == '}' && i - linestartpos > linebreakpos) {
+                    sb.insert(i, '\n');
+                    linestartpos = i;
+                }
+            }
+
+            css = sb.toString();
+        }
+*/
+        // Replace the pseudo class for the Box Model Hack
+        istr = istr.replace(/___PSEUDOCLASSBMH___/g, "\"\\\\\"}\\\\\"\"");
+
+        // Trim the final string (for any leading or trailing white spaces)
+        istr = istr.replace(/^\s+/g, '');
+        istr = istr.replace(/\s+$/g, '');
+
+
+        // Write the output...
+        return istr;
+}
\ No newline at end of file
diff --git a/buildSDK/debugLoader.js b/buildSDK/debugLoader.js
new file mode 100644 (file)
index 0000000..d79e1c4
--- /dev/null
@@ -0,0 +1,105 @@
+//<script type="text/javascript">
+// file to load 
+
+// could probably do this with anon-functions..
+
+
+
+// -----------------------------------
+// this stuff doesnt work!!!
+
+// -----------------------------------
+
+function RooDebugLoader(fn)
+{
+    
+    // these fire off too fast for the thing to work correctly...
+    window.setTimeout(function() {
+            //console.log("load" + fn);
+            if (typeof(fn) == 'string') {
+                RooDebugLoader.realLoad(fn);
+                return;
+            }
+            fn.call();
+            
+        }, RooDebugLoader.timer);
+    RooDebugLoader.timer += 200;
+}
+    
+ RooDebugLoader.realLoad = function (fn)   
+    function getpath()
+    {
+        if (typeof(RooDebugLoader.path) != 'undefined'){
+            return RooDebugLoader.path;
+        }
+        var sts = document.getElementsByTagName('script');
+        for (var i =0;i<sts.length;i++) {
+            if (/\/roojs-debug.js$/.test(sts[i].getAttribute('src'))) {
+                RooDebugLoader.path = sts[i].getAttribute('src').replace(/\/roojs-debug.js$/,'')
+                return RooDebugLoader.path;
+            }
+        }
+        alert("can not find path to roojs-debug.js");
+        throw "oops";
+        
+        
+    }
+    
+    var html_doc = document.getElementsByTagName('head')[0];
+    
+    if (/\.js$/.test(fn)) {
+            
+        
+        var js = document.createElement('script');
+        js.setAttribute('language', 'javascript');
+        js.setAttribute('type', 'text/javascript');
+        //js.setAttribute('src', getpath() + '/' + fn +'?_ts='+Math.random());
+        js.setAttribute('src', getpath() + '/' + fn);
+        html_doc.appendChild(js);
+        return
+    }
+    if (/\.css$/.test(fn)) {
+            
+        //<link rel="stylesheet" type="text/css" href="App_Themes/HCCCommonStyle.css" />
+        var js = document.createElement('link');
+        js.setAttribute('rel', 'stylesheet');
+        js.setAttribute('type', 'text/css');
+        
+        js.setAttribute('href', getpath() + '/' + fn);
+        html_doc.appendChild(js);
+    }
+}
+RooDebugLoader.timer = 200;
+RooDebugLoader.loaded = false;
+RooDebugLoader.onload = function()
+{
+    if (RooDebugLoader.loaded) {
+        return false;
+    }
+    if (!document || !document.getElementsByTagName('script').length) {
+        window.setTimeout(RooDebugLoader.onload, 100);
+    }
+    RooDebugLoader.loaded = true;
+    RooDebugLoader.loader();
+}
+//RooDebugLoader.onload();
+window.setTimeout(RooDebugLoader.onload, 100);
+
+RooDebugLoader.loader = function () {
+    
+RooDebugLoader('css/reset-min.css');
+RooDebugLoader('css/core.css');
+RooDebugLoader('css/basic-dialog.css');
+RooDebugLoader('css/button.css');
+RooDebugLoader('css/inline-editor.css');
+RooDebugLoader('css/layout.css');
+RooDebugLoader('css/qtips.css');
+RooDebugLoader('css/resizable.css')
+RooDebugLoader('css/tabs.css');
+RooDebugLoader('css/toolbar.css');
+RooDebugLoader('css/tree.css');
+RooDebugLoader('css/ytheme-gray.css');
+
+
+
+
diff --git a/buildSDK/dependancy_order.txt b/buildSDK/dependancy_order.txt
new file mode 100644 (file)
index 0000000..1178a86
--- /dev/null
@@ -0,0 +1,239 @@
+
+// list of files to be build in order.. 
+// -- to make your own.. 
+//   - just copy this file, and add // infront of the files 
+//     that you dont think you need.!!!
+
+Roo 
+Function
+String
+Number
+Array
+Date
+    
+//not sure how many of these are requ..
+//was adapter/...
+Roo.lib.Dom
+Roo.lib.Event
+Roo.lib.Ajax
+Roo.lib.Region
+//Roo.DomHelper - in twice -- should it be here???
+Roo.lib.Point
+Roo.lib.Anim
+Roo.lib.AnimBase
+Roo.lib.AnimMgr
+Roo.lib.Beizer
+Roo.lib.ColorAnim
+Roo.lib.Easing
+Roo.lib.Motion
+Roo.lib.Scroll
+
+// --- end if base ---
+
+
+Roo.DomHelper
+Roo.Template
+Roo.DomQuery
+Roo.util.Observable
+Roo.EventManager
+Roo.Element
+Roo.Fx
+Roo.CompositeElement
+Roo.CompositeElementLite
+Roo.data.Connection
+Roo.Ajax
+Roo.UpdateManager
+
+
+// -- these two have bits in and out of core...
+
+
+// probably outside of core..
+Roo.util.DelayedTask
+// TaskRunner includes Roo.TaskMgr
+Roo.util.TaskRunner
+Roo.util.MixedCollection
+Roo.util.JSON
+Roo.util.Format
+Roo.MasterTemplate
+Roo.util.CSS
+Roo.util.ClickRepeater
+Roo.KeyNav
+Roo.KeyMap
+Roo.util.TextMetrics
+Roo.state.Provider
+Roo.state.Manager
+Roo.state.CookieProvider
+
+//             *** ALL can be Optional (need drag /drop ?) - although windows/split  bar/grid etc. uses them..
+Roo.dd.DragDrop
+Roo.dd.DragDropMgr
+Roo.dd.DD
+Roo.dd.DDProxy
+Roo.dd.DDTarget
+Roo.dd.ScrollManager
+Roo.dd.Registry
+Roo.dd.StatusProxy
+Roo.dd.DragSource
+Roo.dd.DropTarget
+Roo.dd.DragZone
+Roo.dd.DropZone
+
+Roo.data.SortTypes
+Roo.data.Record
+Roo.data.Store
+Roo.data.SimpleStore
+Roo.data.JsonStore
+Roo.data.Field
+Roo.data.DataReader
+Roo.data.DataProxy
+//             *** Can be Optional (if needed?)
+Roo.data.MemoryProxy
+Roo.data.HttpProxy
+//             *** Can be Optional (external scripts?)
+Roo.data.ScriptTagProxy
+Roo.data.JsonReader
+//             *** Can be Optional ***
+Roo.data.XmlReader
+//             *** Can be Optional (needed for Tree?)
+Roo.data.ArrayReader
+Roo.data.Tree
+
+Roo.ComponentMgr
+Roo.Component
+Roo.Layer
+Roo.Shadow
+Roo.BoxComponent
+Roo.SplitBar
+Roo.View
+
+//             *** Can be Optional -- check deps..***
+Roo.JsonView
+//             *** Can be Optional ***
+Roo.ColorPalette
+//             *** Can be Optional ***
+Roo.DatePicker
+
+Roo.TabPanel
+Roo.Button
+Roo.SplitButton
+
+Roo.Toolbar
+Roo.PagingToolbar
+Roo.Resizable
+Roo.Editor
+Roo.BasicDialog
+Roo.MessageBox
+Roo.QuickTips
+
+Roo.tree.TreePanel
+Roo.tree.TreeSelectionModel
+Roo.tree.TreeNode
+Roo.tree.AsyncTreeNode
+Roo.tree.TreeNodeUI
+Roo.tree.TreeLoader
+//             *** Can be Optional - only if you used it..***
+Roo.tree.TreeFilter
+Roo.tree.TreeSorter
+Roo.tree.TreeDropZone
+Roo.tree.TreeDragZone
+Roo.tree.TreeEditor
+//             our extended version.
+Roo.tree.ColumnNodeUI
+Roo.tree.ColumnTree
+
+
+
+Roo.menu.Menu
+Roo.menu.MenuMgr
+Roo.menu.BaseItem
+Roo.menu.Adapter
+Roo.menu.TextItem
+Roo.menu.Separator
+Roo.menu.Item
+Roo.menu.CheckItem
+Roo.menu.DateItem
+Roo.menu.ColorItem
+Roo.menu.DateMenu
+Roo.menu.ColorMenu
+
+Roo.form.Field
+Roo.form.TextField
+Roo.form.Hidden
+Roo.form.TriggerField
+Roo.form.TextArea
+Roo.form.NumberField
+Roo.form.DateField
+Roo.form.ComboBox
+Roo.form.Checkbox
+Roo.form.Radio
+Roo.form.HtmlEditor
+Roo.form.HtmlEditor.ToolbarStandard
+Roo.form.HtmlEditor.ToolbarContext
+Roo.form.BasicForm
+Roo.form.Form
+Roo.form.Action
+Roo.form.Layout
+Roo.form.VTypes
+Roo.form.FCKeditor
+Roo.form.GridField
+
+// Must be after view and form.field as it uses both.
+Roo.DDView
+
+Roo.LayoutManager
+Roo.BorderLayout
+Roo.BasicLayoutRegion
+Roo.LayoutRegion
+Roo.SplitLayoutRegion
+Roo.CenterLayoutRegion
+Roo.LayoutStateManager
+Roo.ContentPanel
+//             *** Can be Optional *** - only if you use it..
+Roo.ReaderLayout
+
+Roo.grid.Grid
+Roo.grid.AbstractGridView
+
+Roo.grid.HeaderDragZone
+Roo.grid.HeaderDropZone
+Roo.grid.GridView
+Roo.grid.SplitDragZone
+Roo.grid.GridDragZone
+Roo.grid.ColumnModel
+Roo.grid.AbstractSelectionModel
+Roo.grid.RowSelectionModel
+//             *** Can be Optional (if you do not have editable or cell selection grids.)***
+Roo.grid.CellSelectionModel
+//             *** Can be Optional (if you do not have editable grids.)***
+Roo.grid.EditorGrid
+Roo.grid.GridEditor
+//             *** Can be Optional ***
+Roo.grid.PropertyGrid
+
+
+
+Roo.LoadMask
+//             *** Can be Optional ***
+Roo.XTemplate
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/buildSDK/doc_build.txt b/buildSDK/doc_build.txt
new file mode 100644 (file)
index 0000000..d2a22f8
--- /dev/null
@@ -0,0 +1,9 @@
+
+#// in top level directory..
+
+mjslite buildSDK/bundle_build.js -L/usr/src/gtkDS/examples/jstoolkit2/ -- buildSDK/dependancy_order.txt
+
+#// for the docs..
+
+mjslite buildSDK/docs_build.js -L/usr/src/gtkDS/examples/jstoolkit2/
+
diff --git a/buildSDK/doc_templates/allclasses.tmpl b/buildSDK/doc_templates/allclasses.tmpl
new file mode 100644 (file)
index 0000000..32f4358
--- /dev/null
@@ -0,0 +1,17 @@
+<div align="center">{+new Link().toFile("index.html").withText("Class Index")+}
+| {+new Link().toFile("files.html").withText("File Index")+}</div>
+<hr />
+<h2>Classes</h2>
+<ul class="classList">
+       <for each="thisClass" in="data">
+       <li>{!
+               if (thisClass.alias == "_global_") {
+                       output += "<i>"+new Link().toClass(thisClass.alias)+"</i>";
+               }
+               else {
+                       output += new Link().toClass(thisClass.alias);
+               }
+       !}</li>
+       </for>
+</ul>
+<hr />
\ No newline at end of file
diff --git a/buildSDK/doc_templates/allfiles.tmpl b/buildSDK/doc_templates/allfiles.tmpl
new file mode 100644 (file)
index 0000000..2605c76
--- /dev/null
@@ -0,0 +1,49 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+       <head>
+               <meta http-equiv="content-type" content="text/html; charset={+IO.encoding+}"" />
+               {! Link.base = ""; /* all generated links will be relative to this */ !}
+               <title>JsDoc Reference - File Index</title>
+               <meta name="generator" content="JsDoc Toolkit" />
+               
+               <style type="text/css">
+               {+includeStatic("static/default.css")+}
+               </style>
+       </head>
+       
+       <body>
+               {+includeStatic("static/header.html")+}
+               
+               <div id="index">
+                       {+JSDOC.publish.classesIndex+}
+               </div>
+               
+               <div id="content">
+                       <h1 class="classTitle">File Index</h1>
+                       
+                       <for each="item" in="data">
+                       <div>
+                               <h2>{+new Link().toSrc(item.alias)+}</h2>
+                               <if test="item.desc">{+resolveLinks(summarize(item.desc))+}</if>
+                               <dl>
+                                       <if test="item.author">
+                                               <dt class="heading">Author:</dt>
+                                               <dd>{+item.author+}</dd>
+                                       </if>
+                                       <if test="item.version">
+                                               <dt class="heading">Version:</dt>
+                                                       <dd>{+item.version+}</dd>
+                                       </if>
+                               </dl>
+                       </div>
+                       <hr />
+                       </for>
+                       
+               </div>
+               <div class="fineprint" style="clear:both">
+                       <if test="JSDOC.opt.D.hasOwnProperty('copyright')">&copy;{+JSDOC.opt.D.copyright+}<br /></if>
+                       Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blankt">JsDoc Toolkit</a> {+JSDOC.VERSION+} on {+new Date()+}
+               </div>
+       </body>
+</html>
\ No newline at end of file
diff --git a/buildSDK/doc_templates/class.tmpl b/buildSDK/doc_templates/class.tmpl
new file mode 100644 (file)
index 0000000..cf73124
--- /dev/null
@@ -0,0 +1,766 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+
+       <head>
+               <meta http-equiv="content-type" content="text/html; charset={+IO.encoding+}" />
+               <meta name="generator" content="JsDoc Toolkit" />
+               {! Link.base = "../"; /* all generated links will be relative to this */ !}
+               
+               <title>JsDoc Reference - {+data.alias+}</title>
+               
+               
+       <link rel="stylesheet" type="text/css" href="../../css/roojs.css" />            
+       <link rel="stylesheet" type="text/css" href="../default.css" />
+       
+       
+       <script type="text/javascript" src="../page.js">
+       
+       </script>
+        
+               
+       </head>
+
+       <body onload="RooDocsPage.onload();">
+        
+       
+<div class="body-wrap">
+
+    <!-- ============================== links to methods. ================================= -->        
+
+    <div class="top-tools">
+    <!--
+        <a class="inner-link" href="#{+data.alias+}-props"><img src="resources/s.gif" class="item-icon icon-prop">Properties</a>
+        <a class="inner-link" href="#{+data.alias+}-methods"><img src="resources/s.gif" class="item-icon icon-method">Methods</a>
+        <a class="inner-link" href="#{+data.alias+}-events"><img src="resources/s.gif" class="item-icon icon-event">Events</a>
+        <a class="inner-link" href="#{+data.alias+}-configs"><img src="resources/s.gif" class="item-icon icon-config">Config Options</a>
+        <a class="bookmark" href="NEED_TO_CREATE_DIRECT_LINK_HREF"><img src="resources/s.gif" class="item-icon icon-fav">Direct Link</a>
+       -->
+    </div>
+
+    
+<!-- ============================== inheritance Block. ================================= -->   
+       <if test="data.augments.length">
+               <div class="inheritance res-block">
+                  <pre class="res-block-inner">{!
+                               var iblock_indent = 0;
+                                data.augments.reverse().map(
+                                       function($) {  
+                                               output += iblock_indent ? ('<img src="../../images/default/s.gif" height="1" width="' + 
+                                                       iblock_indent + '"/><img src="../../images/default/tree/elbow-end.gif" class="elbow"/>') : '';
+                                               output += new Link().toSymbol($) + "\n"; 
+                                               iblock_indent += 20;
+                                       }
+                               )
+                       !}<img src="../../images/default/s.gif" height="1"  width="{+ iblock_indent +}"/><img class="elbow" src="../../images/default/tree/elbow-end.gif"/>{+data.alias+} 
+
+                  </pre>
+               </div>
+       </if>
+<!-- ============================== class title / details ============================ -->
+    
+    {! 
+                       var fullpath = data.alias.split('.');
+                       var cls = fullpath.pop();
+                       var packge = fullpath.join(".");
+                        
+                       
+                       
+       !}
+    <h1 class="classTitle">
+                               {!
+                                       var classType = "";
+                                       
+                                       if (data.isBuiltin()) {
+                                               classType += "Built-In ";
+                                       }
+                                       
+                                       if (data.isNamespace) {
+                                               if (data.is('FUNCTION')) {
+                                                       classType += "Function ";
+                                               }
+                                               classType += "Namespace ";
+                                       }
+                                       else {
+                                               classType += "Class ";
+                                       }
+                               !}
+                               {+classType+}{+data.alias+}
+                       </h1>
+                       
+    <table cellspacing="0" class="class-summary-table">
+       <if test="packge.length">
+               <tr><td class="label">Package:</td><td class="hd-info">{+packge+}</td></tr>
+       </if>
+        <tr><td class="label">Defined In:</td><td class="hd-info">
+                       <if test="data.srcFile.length">{# isn't defined in any file #}
+                                       {+new Link().toSrc(data.srcFile)+}.
+                       </if>
+       </td></tr>
+        <tr><td class="label">Class:</td><td class="hd-info">{+cls+}</td></tr>
+       
+       <if test="data.childClasses.length">
+        <tr><td class="label">Subclasses:</td><td class="hd-info">
+               {+
+                       data.childClasses
+                       .sort()
+                       .map(
+                               function($) { return new Link().toSymbol($); }
+                       )
+                       .join(", ")
+               +}
+
+       
+       
+       </td></tr>
+       </if>
+       <if test="data.augments.length">
+       
+               <tr><td class="label">Extends:</td><td class="hd-info">
+                       {+
+                               new Link().toSymbol(data.augments[data.augments.length -1])
+                               
+                       +}
+       
+               </td></tr>    
+       </if>
+       
+    </table>
+
+    
+<!-- ============================== class summary ========================== -->                       
+    <div class="description">
+       {+resolveLinks(data.desc)+}
+    </div>
+
+       
+<!-- ============================== Class comment block... ========================== -->                                      
+
+<div class="comments">
+       <b>Class Comments / Notes</B> =>  
+       <u onclick="parent.CommentDialog.showCommentId = '{+data.alias+}';">[Add Your comment/notes about this class]</u>
+       <br/>
+       <iframe frameborder="0"  id="comments-{+data.memberOf+}" style="border: none;width:100%;" 
+               src="/blog.php/GtkDjsComments/{+data.alias+}.html"></iframe>
+</div>
+       
+
+               
+<!-- ============================== config options ========================== -->                                              
+                
+    
+    {!
+       
+        
+        
+       var cfgProperties = [];
+       if (!data.comment.getTag('singleton').length) {
+               cfgProperties = data.configToArray();
+               cfgProperties = cfgProperties.sort(makeSortby("name"));
+               
+       }
+       
+               
+               
+       !}
+               
+    <div class="hr"></div>
+    <a id="{+data.alias+}-configs"></a>
+               
+    <if test="!cfgProperties.length">
+    
+     <table cellspacing="0" class="member-table">
+      <caption class="Empty">Config Options - Has None</caption>
+     </table>
+    
+    </if>
+     
+    <if test="cfgProperties.length">
+       
+      <table cellspacing="0" class="member-table">   
+      <caption>Config Options (Usually are also Properties)</caption>
+    
+       
+        <tr>
+            <th class="sig-header" colspan="2">Options</th>
+           
+            <th class="msource-header">Defined By</th>
+        </tr>
+       
+       
+       
+       <for each="dtag" in="cfgProperties">
+       
+               <tr class="config-row expandable config-row-alt{+$dtag_i % 2+}{+ ((dtag.memberOf == data.alias) ?   " notInherited" : "") +}">
+                  <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>
+                   <td class="sig">
+
+                       <a id="{+dtag.memberOf+}-cfg-{+dtag.name+}" name=".{+dtag.name+}"></a>
+                       <div class="fixedFont">
+                               <b  class="itemname">{+dtag.name+}</b> : {+((dtag.type) ? (new Link().toSymbol(dtag.type)) : "" )+}
+                               
+                               
+                       </div>
+                 
+                       <div class="mdesc">
+                           <div class="short">{+resolveLinks(summarize(dtag.desc))+}</div> 
+                       </div>
+                       
+                       <div class="mdesc">
+                           <div class="long">{+resolveLinks(dtag.desc)+}</div> 
+                       </div>
+                       
+                       
+
+                   </td>
+                   <td class="msource">
+                       {# - fixme - add inheritied as link here #}
+                       {+ (dtag.memberOf == data.alias) ? dtag.memberOf :  new Link().toSymbol(dtag.memberOf) +}
+                               
+                   </td>
+               </tr>
+        </for>
+        
+    </table>
+  </if>                
+  
+  
+  
+  
+  
+  
+  
+  
+  <!-- ============================== public properties ==================== -->       
+  
+  
+  
+    <a id="{+data.alias+}-props"></a>      
+    
+    {! 
+               var ownProperties = [];
+               var psorted = data.properties.sort(makeSortby("name"));
+               psorted.filter(
+                       
+                       function($){
+                               if (/$.hide/.test($.desc)) {
+                                       return false;
+                               }
+                               if ( !$.isNamespace || (($.memberOf != data.alias) && $.isStatic)) {
+                                       if ($.isStatic)  ownProperties.push($);
+                               }
+                               return true;
+               
+                       }
+               );
+     
+    !}
+
+    <if test="!ownProperties.length">
+    
+     <table cellspacing="0" class="member-table">
+      <caption class="Empty">Public Properties - Has None</caption>
+     </table>
+    
+    </if>
+     
+    <if test="ownProperties.length">
+       
+      <table cellspacing="0" class="member-table">   
+      <caption>Public Properties </caption>
+        <tr>
+            <th class="sig-header" colspan="2">Property</th>
+           <th class="sig-header">Description</th>
+            <th class="msource-header">Defined By</th>
+        </tr>
+        
+      
+                    
+         
+       <for each="member" in="ownProperties">   
+        
+       
+       
+          <tr class="property-row config-row-alt{+$member_i % 2+}{!
+
+               if (member.memberOf == data.alias) {
+                       output += " notInherited";
+                }
+                 
+                !}">
+            <td class="micon">
+                <a class="exi" href="#expand">&nbsp;</a>
+            </td>
+            <td class="sig">
+               <a id="{+member.memberOf+}-prop-{+member.name+}" name=".{+member.name+}"></a>
+              <div class="fixedFont">
+                   <span class="attributes">{!
+                       if (member.isPrivate) output += "&lt;private&gt; ";
+                       if (member.isInner) output += "&lt;inner&gt; ";
+                       
+                       if (member.isConstant) output += "&lt;constant&gt; ";
+                       if (member.isStatic) output += ""+data.alias +".";
+                    !}</span><b  class="itemname">{+member.name+}</b> :
+                    <span type="etype">{+((member.type) ? (new Link().toSymbol(member.type)) : "" )+}</span>
+                    </div>
+           </td>
+           <td class="sig">
+               <div class="mdesc">
+
+
+                  <div class="short">
+                       {+resolveLinks(summarize(member.desc))+}
+                  
+                  
+                  
+                  </div> 
+                   
+                    <div class="long">
+                   
+                       {+resolveLinks(member.desc)+}                        
+                
+                </div>
+                </div>
+            </td>
+           
+            <td class="msource">  
+           {+ (member.memberOf == data.alias) ? member.memberOf :  new Link().toSymbol(member.memberOf) +}
+           </td>             
+                
+          </tr>
+        </for>
+        
+        
+       
+      
+        <!-- TODO: implement this alt row.  also notice non-linked "Defined by" when property is a part of this class.     
+        <tr class="property-row alt">
+             
+        -->
+
+    </table>
+  
+    </if>
+  <!-- ============================== methods summary / details ======================== -->
+  
+  
+  <a id="{+data.alias+}-methods"></a>
+       <!-- constructor?? -->
+       {! 
+               var ownMethods = [];
+       
+               if (data.comment.getTag('class').length && 
+                       !data.isBuiltin() && 
+                       !data.comment.getTag('singleton').length &&
+                       !data.comment.getTag('static').length
+                       ) {
+                       data.isInherited = false;
+                       ownMethods.push(data);
+               }
+               
+               var msorted = data.methods.sort(makeSortby("name"));
+       !}
+       <!-- static's first 
+       
+       
+       -->
+       {!
+               msorted.filter(
+                               function($){
+                                       
+                                       if (/@hide/.test($.desc)) {
+                                               return false;
+                                       }
+                                       
+                                       if (!$.isEvent && (data.comment.getTag("instanceOf").length || data.comment.getTag("singleton").length)) {
+                                               if ($.isStatic && (data.comment.getTag("instanceOf").length || data.comment.getTag("singleton").length) &&
+                                                       ($.memberOf != data.alias)) {
+                                                               return true;
+                                                       }
+                                               $.isInherited = ($.memberOf != data.alias);
+                                               ownMethods.push($);
+                                               return true;
+                                       }
+                                       
+                                       
+                                       if ($.isNamespace || $.isEvent || (($.memberOf != data.alias) && $.isStatic)){
+                                               return true;
+                                       }
+                                       if ($.isStatic) {
+                                               $.isInherited = ($.memberOf != data.alias);
+                                               ownMethods.push($);
+                                       }
+                                       
+                                       return true;
+                               }
+                       );
+       !}
+       <!-- then dynamics first -->
+       {!      
+               msorted.filter(
+                               function($){
+                                       if (/@hide/.test($.desc)) {
+                                               return false;
+                                       }
+                                       if (data.comment.getTag("instanceOf").length  || data.comment.getTag("singleton").length) {
+                                               return true;
+                                       }
+                                       if ($.isNamespace || $.isEvent || (($.memberOf != data.alias) && $.isStatic)){
+                                               
+                                               return true;
+                                       }
+                                       if (!$.isStatic) {
+                                               $.isInherited = ($.memberOf != data.alias);
+                                               ownMethods.push($);
+                                       }
+                                       
+                                       return true;
+                               }
+                       );
+                
+       !}
+  
+  
+    <if test="!ownMethods.length">
+    
+     <table cellspacing="0" class="member-table">
+      <caption class="Empty">Public Methods - Has None</caption>
+     </table>
+    
+    </if>
+    <if test="ownMethods.length">
+    
+      <table cellspacing="0" class="member-table">
+      <caption>Public Methods</caption>
+        <tr>
+            <th class="sig-header" colspan="2">Method</th>            
+            <th class="msource-header">Defined By</th>
+
+        </tr>
+        
+       
+       
+        
+       
+        <for each="member" in="ownMethods">
+         
+          <tr class="method-row config-row-alt{+$member_i % 2+}{!
+                 if (member.is("CONSTRUCTOR") && !member.params.length) {
+                         output += '';
+                } else {
+                         output += ' expandable';
+                       }
+                 
+                 
+               if (!member.isInherited) {
+                       output += " notInherited";
+                }
+                 
+                !}">
+            <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>
+          
+          
+            <td class="sig">
+                <a id="{+member.memberOf+}-method-{+member.name+}"   name=".{+member.name+}"></a>
+               <div class="fixedFont">
+                       <span class="attributes">{!
+                                       if (member.is('CONSTRUCTOR')) {
+                                               output += "new <B>" + member.memberOf + (member.memberOf.length ? "." : "") +"</B>";
+                                       } else {
+                                               
+                                               
+                                               if (member.isPrivate) output += "&lt;private&gt; ";
+                                               if (member.isInner) output += "&lt;inner&gt; ";
+                                               if (member.isStatic || data.comment.getTag("singleton").length || data.comment.getTag("instanceOf").length) {
+                                                       output +=  data.alias + ".";    
+                                               }
+                                       }
+                               !}</span><b class="itemname">{+member.name+}</b>
+                               
+                                {+makeSignature(member.params)+} 
+                       
+                               <if test="member.returns.length">
+                                        : 
+                                       <for each="item" in="member.returns">
+                                               <if test="$item_i > 0"> or </if>
+                                               {+((item.type) ? (new Link().toSymbol(item.type)) : "" )+}
+                                       
+                                       </for>
+                                       
+                               </if>
+                       
+               </div>
+                <div class="mdesc">
+               <if test="!member.is('CONSTRUCTOR')">
+                   <div class="short">{+resolveLinks(summarize(member.desc))+}</div> 
+                </if>
+                <if test="member.is('CONSTRUCTOR')">
+                       <div class="short">Create a new {+data.alias +}</div> 
+                </if>
+                
+                    <div class="long">
+                       <if test="!member.is('CONSTRUCTOR')">
+                               {+resolveLinks(member.desc)+}
+                   
+                               <if test="member.example">
+                                       <pre class="code">{+member.example+}</pre>
+                               </if>
+                       </if>
+                       
+                       <if test="member.is('CONSTRUCTOR')">
+                               Create a new {+data.alias +}
+                       </if>
+                       <if test="member.params.length">
+                               <dl class="detailList">
+                               <dt class="heading">Parameters:</dt>
+                               <for each="item" in="member.params">
+                                       <dt>
+                                               {+((item.type)?"<span class=\"fixedFont\">"+(new Link().toSymbol(item.type))+"</span> " : "")+} <b>{+item.name+}</b>
+                                               <if test="item.isOptional"><i>Optional
+                                                       <if test="item.defaultValue">, 
+                                                       Default: {+item.defaultValue+}
+                                               </if></i></if>
+                                       </dt>
+                                       <dd>{+resolveLinks(item.desc)+}</dd>
+                               </for>
+                               </dl>
+                       </if>
+                       <if test="member.deprecated">
+                               <dl class="detailList">
+                               <dt class="heading">Deprecated:</dt>
+                               <dt>
+                                       {+member.deprecated+}
+                               </dt>
+                               </dl>
+                       </if>
+                       <if test="member.since.length">
+                               <dl class="detailList">
+                               <dt class="heading">Since:</dt>
+                                       <dd>{+ member.since +}</dd>
+                               </dl>
+                               </dl>
+                       </if>
+                       <if test="member.exceptions.length">
+                               <dl class="detailList">
+                               <dt class="heading">Throws:</dt>
+                               <for each="item" in="member.exceptions">
+                                       <dt>
+                                               {+((item.type)?"<span class=\"fixedFont\">{"+(new Link().toSymbol(item.type))+"}</span> " : "")+} <b>{+item.name+}</b>
+                                       </dt>
+                                       <dd>{+resolveLinks(item.desc)+}</dd>
+                               </for>
+                               </dl>
+                       </if>
+                       <if test="member.returns.length">
+                               <dl class="detailList">
+                               <dt class="heading">Returns:</dt>
+                               <for each="item" in="member.returns">
+                                       <dd>{+((item.type)?"<span class=\"fixedFont\">"+(new Link().toSymbol(item.type))+"</span> " : "")+} {+resolveLinks(item.desc)+}</dd>
+                               </for>
+                               </dl>
+                       </if>
+                       <if test="member.requires.length">
+                               <dl class="detailList">
+                               <dt class="heading">Requires:</dt>
+                               <for each="item" in="member.requires">
+                                       <dd>{+ resolveLinks(item) +}</dd>
+                               </for>
+                               </dl>
+                       </if>
+                       <if test="member.see.length">
+                               <dl class="detailList">
+                               <dt class="heading">See:</dt>
+                               <for each="item" in="member.see">
+                                       <dd>{+ new Link().toSymbol(item) +}</dd>
+                               </for>
+                               </dl>
+                       </if>
+
+                   
+                   
+                    
+                    </div>                    
+                </div>
+
+            </td>
+            <td class="msource">
+               <if test="!member.is('CONSTRUCTOR')">
+                       {+ (member.memberOf == data.alias) ? member.memberOf :  new Link().toSymbol(member.memberOf) +}
+               </if>&nbsp;
+            </td>
+        </tr>
+       </for>
+                                                      
+    </table>
+</if>
+  
+  <!-- ============================== events summary / details ======================== -->
+  
+  
+  <a id="{+data.alias+}-events"></a>
+    
+  
+       {! 
+               
+               
+               var ownEvents = data.methods.filter(
+                               function($){
+                                       
+                                       return $.isEvent && !$.comment.getTag('hide').length;
+                                               
+                               }
+                       ).sort(makeSortby("name"));
+                
+       !}
+   <if test="!ownEvents.length">
+    
+     <table cellspacing="0" class="member-table">
+      <caption class="Empty">Events - Has None</caption>
+     </table>
+    
+    </if>
+  
+    
+    <if test="ownEvents.length">
+    
+      <table cellspacing="0" class="member-table">
+               <caption>Events</caption>
+             <thead>
+               <tr>
+                   <th class="sig-header" colspan="2">Event</th>            
+                   <th class="msource-header">Defined By</th>
+
+               </tr>
+             </thead>  
+       
+       
+        
+       
+        <for each="member" in="ownEvents">
+          <tr class="method-row expandable config-row-alt{+$member_i % 2+}{!
+
+               if (member.memberOf == data.alias) {
+                       output += " notInherited";
+                }
+                 
+                !}">
+            <td class="micon"><a class="exi" href="#expand">&nbsp;</a></td>
+           
+            <td class="sig">
+                <a id="{+member.memberOf+}-event-{+member.name+}"></a>
+                
+              <div class="fixedFont">
+               <b class="itemname">{+member.name.substring(1)+}</b> {+makeSignature(member.params)+} 
+               
+               </div>
+
+                <div class="mdesc">
+
+                   <div class="short">{+resolveLinks(summarize(member.desc))+}
+                  
+               </div> 
+                   
+                    <div class="long">
+                   
+                       {+resolveLinks(member.desc)+}
+                   
+                       <if test="member.example">
+                               <pre class="code">{+member.example+}</pre>
+                       </if>
+                       
+               
+                       <if test="member.params.length">
+                               <dl class="detailList">
+                               <dt class="heading">Parameters:</dt>
+                               <for each="item" in="member.params">
+                                       <dt>
+                                               {+((item.type)?"<span class=\"fixedFont\">"+(new Link().toSymbol(item.type))+"</span> " : "")+}<b>{+item.name+}</b>
+                                               <if test="item.isOptional"><i>Optional
+                                                       <if test="item.defaultValue">, 
+                                                       Default: {+item.defaultValue+}
+                                               </if></i></if>
+                                       </dt>
+                                       <dd>{+resolveLinks(item.desc)+}</dd>
+                               </for>
+                               </dl>
+                       </if>
+                       <if test="member.deprecated">
+                               <dl class="detailList">
+                               <dt class="heading">Deprecated:</dt>
+                               <dt>
+                                       {+member.deprecated+}
+                               </dt>
+                               </dl>
+                       </if>
+                       <if test="member.since.length">
+                               <dl class="detailList">
+                               <dt class="heading">Since:</dt>
+                                       <dd>{+ member.since +}</dd>
+                               </dl>
+                               </dl>
+                       </if>
+                       <if test="member.exceptions.length">
+                               <dl class="detailList">
+                               <dt class="heading">Throws:</dt>
+                               <for each="item" in="member.exceptions">
+                                       <dt>
+                                               {+((item.type)?"<span class=\"light fixedFont\">{"+(new Link().toSymbol(item.type))+"}</span> " : "")+} <b>{+item.name+}</b>
+                                       </dt>
+                                       <dd>{+resolveLinks(item.desc)+}</dd>
+                               </for>
+                               </dl>
+                       </if>
+                       <if test="member.returns.length">
+                               <dl class="detailList">
+                               <dt class="heading">Returns:</dt>
+                               <for each="item" in="member.returns">
+                                       <dd>{+((item.type)?"<span class=\"light fixedFont\">{"+(new Link().toSymbol(item.type))+"}</span> " : "")+}{+resolveLinks(item.desc)+}</dd>
+                               </for>
+                               </dl>
+                       </if>
+                       <if test="member.requires.length">
+                               <dl class="detailList">
+                               <dt class="heading">Requires:</dt>
+                               <for each="item" in="member.requires">
+                                       <dd>{+ resolveLinks(item) +}</dd>
+                               </for>
+                               </dl>
+                       </if>
+                       <if test="member.see.length">
+                               <dl class="detailList">
+                               <dt class="heading">See:</dt>
+                               <for each="item" in="member.see">
+                                       <dd>{+ new Link().toSymbol(item) +}</dd>
+                               </for>
+                               </dl>
+                       </if>
+
+                   
+                   
+                    
+                    </div>                    
+                </div>
+
+            </td>
+            <td class="msource">
+                {+ (member.memberOf == data.alias) ? member.memberOf :  new Link().toSymbol(member.memberOf) +}
+            </td>
+        </tr>
+       </for>
+                                                      
+    </table>
+</if>
+  
+  
+  
+<!-- ============================== footer ================================= -->
+               <div class="fineprint" style="clear:both">
+                       <if test="JSDOC.opt.D['copyright']">&copy;{+JSDOC.opt.D.copyright+}<br /></if>
+                       Documentation generated by <a href="http://www.akbkhome.com/rooscript">RooScript/Jstoolkit</a> 
+                       Based on 
+                       <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> on {+new Date()+}
+               </div>
+       </body>
+</html>
diff --git a/buildSDK/doc_templates/class.tmpl_original b/buildSDK/doc_templates/class.tmpl_original
new file mode 100644 (file)
index 0000000..be38b00
--- /dev/null
@@ -0,0 +1,485 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
+        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+       <head>
+               <meta http-equiv="content-type" content="text/html; charset={+IO.encoding+}" />
+               <meta name="generator" content="JsDoc Toolkit" />
+               {! Link.base = "../"; /* all generated links will be relative to this */ !}
+               <title>JsDoc Reference - {+data.alias+}</title>
+
+               <style type="text/css">
+                       {+includeStatic("static/default.css")+}
+               </style>
+       </head>
+
+       <body>
+<!-- ============================== header ================================= -->       
+               <!-- begin static/header.html -->
+               {+includeStatic("static/header.html")+}
+               <!-- end static/header.html -->
+
+<!-- ============================== classes index ============================ -->
+               <div id="index">
+                       <!-- begin publish.classesIndex -->
+                       {+publish.classesIndex+}
+                       <!-- end publish.classesIndex -->
+               </div>
+               
+               <div id="content">
+<!-- ============================== class title ============================ -->
+                       <h1 class="classTitle">
+                               {!
+                                       var classType = "";
+                                       
+                                       if (data.isBuiltin()) {
+                                               classType += "Built-In ";
+                                       }
+                                       
+                                       if (data.isNamespace) {
+                                               if (data.is('FUNCTION')) {
+                                                       classType += "Function ";
+                                               }
+                                               classType += "Namespace ";
+                                       }
+                                       else {
+                                               classType += "Class ";
+                                       }
+                               !}
+                               {+classType+}{+data.alias+}
+                       </h1>
+
+<!-- ============================== class summary ========================== -->                       
+                       <p class="description">
+                               <if test="data.augments.length"><br />Extends
+                                       {+
+                                               data.augments
+                                               .sort()
+                                               .map(
+                                                       function($) { return new Link().toSymbol($); }
+                                               )
+                                               .join(", ")
+                                       +}.<br />
+                               </if>
+                       
+                               {+resolveLinks(data.classDesc)+}
+                               
+                               <if test="data.srcFile.length">{# isn't defined in any file #}
+                                       <br /><i>Defined in: </i> {+new Link().toSrc(data.srcFile)+}.
+                               </if>
+                       </p>
+
+<!-- ============================== constructor summary ==================== -->                       
+                       <if test="!data.isBuiltin() && (data.isNamespace || data.is('CONSTRUCTOR'))">
+                       <table class="summaryTable" cellspacing="0" summary="A summary of the constructor documented in the class {+data.alias+}.">
+                               <caption>{+classType+}Summary</caption>
+                               <thead>
+                                       <tr>
+                                               <th scope="col">Constructor Attributes</th>
+                                               <th scope="col">Constructor Name and Description</th>
+                                       </tr>
+                               </thead>
+                               <tbody>
+                                       <tr>
+                                               <td class="attributes">{!
+                                                       if (data.isPrivate) output += "&lt;private&gt; ";
+                                                       if (data.isInner) output += "&lt;inner&gt; ";
+                                               !}&nbsp;</td>
+                                               <td class="nameDescription" {!if (data.comment.getTag("hilited").length){output += 'style="color: red"'}!}>
+                                                       <div class="fixedFont">
+                                                               <b>{+ new Link().toSymbol(data.alias).inner('constructor')+}</b><if test="classType != 'Namespace '">{+ makeSignature(data.params) +}</if>
+                                                       </div>
+                                                       <div class="description">{+resolveLinks(summarize(data.desc))+}</div>
+                                               </td>
+                                       </tr>
+                               </tbody>
+                       </table>
+                       </if>
+
+<!-- ============================== properties summary ===================== -->
+                       <if test="data.properties.length">
+                               {! var ownProperties = data.properties.filter(function($){return $.memberOf == data.alias && !$.isNamespace}).sort(makeSortby("name")); !}
+                               <if test="ownProperties.length">
+                               <table class="summaryTable" cellspacing="0" summary="A summary of the fields documented in the class {+data.alias+}.">
+                                       <caption>Field Summary</caption>
+                                       <thead>
+                                               <tr>
+                                                       <th scope="col">Field Attributes</th>
+                                                       <th scope="col">Field Name and Description</th>
+                                               </tr>
+                                       </thead>
+                                       <tbody>
+                                       <for each="member" in="ownProperties">
+                                               <tr>
+                                                       <td class="attributes">{!
+                                                               if (member.isPrivate) output += "&lt;private&gt; ";
+                                                               if (member.isInner) output += "&lt;inner&gt; ";
+                                                               if (member.isStatic) output += "&lt;static&gt; ";
+                                                               if (member.isConstant) output += "&lt;constant&gt; ";
+                                                       !}&nbsp;</td>
+                                                       <td class="nameDescription">
+                                                               <div class="fixedFont">
+                                                               <if test="member.isStatic && member.memberOf != '_global_'">{+member.memberOf+}.</if><b>{+new Link().toSymbol(member.alias).withText(member.name)+}</b>
+                                                               </div>
+                                                               <div class="description">{+resolveLinks(summarize(member.desc))+}</div>
+                                                       </td>
+                                               </tr>
+                                       </for>
+                                       </tbody>
+                               </table>
+                               </if>
+                               
+                               <if test="data.inheritsFrom.length">
+                               <dl class="inheritsList">
+                               {!
+                                       var borrowedMembers = data.properties.filter(function($) {return $.memberOf != data.alias});
+                                       
+                                       var contributers = [];
+                                       borrowedMembers.map(function($) {if (contributers.indexOf($.memberOf) < 0) contributers.push($.memberOf)});
+                                       for (var i = 0, l = contributers.length; i < l; i++) {
+                                               output +=
+                                                       "<dt>Fields borrowed from class "+new Link().toSymbol(contributers[i])+": </dt>"
+                                                       +
+                                                       "<dd>" +
+                                                       borrowedMembers
+                                                       .filter(
+                                                               function($) { return $.memberOf == contributers[i] }
+                                                       )
+                                                       .sort(makeSortby("name"))
+                                                       .map(
+                                                               function($) { return new Link().toSymbol($.alias).withText($.name) }
+                                                       )
+                                                       .join(", ")
+                                                       +
+                                                       "</dd>";
+                                       }
+                               !}
+                               </dl>
+                               </if>
+                       </if>
+
+<!-- ============================== methods summary ======================== -->
+                       <if test="data.methods.length">
+                               {! var ownMethods = data.methods.filter(function($){return $.memberOf == data.alias  && !$.isNamespace}).sort(makeSortby("name")); !}
+                               <if test="ownMethods.length">
+                               <table class="summaryTable" cellspacing="0" summary="A summary of the methods documented in the class {+data.alias+}.">
+                                       <caption>Method Summary</caption>
+                                       <thead>
+                                               <tr>
+                                                       <th scope="col">Method Attributes</th>
+                                                       <th scope="col">Method Name and Description</th>
+                                               </tr>
+                                       </thead>
+                                       <tbody>
+                                       <for each="member" in="ownMethods">
+                                               <tr>
+                                                       <td class="attributes">{!
+                                                               if (member.isPrivate) output += "&lt;private&gt; ";
+                                                               if (member.isInner) output += "&lt;inner&gt; ";
+                                                               if (member.isStatic) output += "&lt;static&gt; ";
+                                                       !}&nbsp;</td>
+                                                       <td class="nameDescription">
+                                                               <div class="fixedFont"><if test="member.isStatic && member.memberOf != '_global_'">{+member.memberOf+}.</if><b>{+new Link().toSymbol(member.alias).withText(member.name)+}</b>{+makeSignature(member.params)+}
+                                                               </div>
+                                                               <div class="description">{+resolveLinks(summarize(member.desc))+}</div>
+                                                       </td>
+                                               </tr>
+                                       </for>
+                                       </tbody>
+                               </table>
+                               </if>
+                               
+                               <if test="data.inheritsFrom.length">
+                               <dl class="inheritsList">
+                               {!
+                                       var borrowedMembers = data.methods.filter(function($) {return $.memberOf != data.alias});
+                                       var contributers = [];
+                                       borrowedMembers.map(function($) {if (contributers.indexOf($.memberOf) < 0) contributers.push($.memberOf)});
+                                       for (var i = 0, l = contributers.length; i < l; i++) {
+                                               output +=
+                                                       "<dt>Methods borrowed from class "+new Link().toSymbol(contributers[i])+": </dt>"
+                                                       +
+                                                       "<dd>" +
+                                                       borrowedMembers
+                                                       .filter(
+                                                               function($) { return $.memberOf == contributers[i] }
+                                                       )
+                                                       .sort(makeSortby("name"))
+                                                       .map(
+                                                               function($) { return new Link().toSymbol($.alias).withText($.name) }
+                                                       )
+                                                       .join(", ")
+                                                       +
+                                                       "</dd>";
+                                       }
+                               
+                               !}
+                               </dl>
+                               </if>
+                       </if>
+
+<!-- ============================== constructor details ==================== -->               
+                       <if test="!data.isBuiltin() && (data.isNamespace || data.is('CONSTRUCTOR'))">
+                       <div class="details"><a name="constructor"> </a>
+                               <div class="sectionTitle">
+                                       {+classType+}Detail
+                               </div>
+                               
+                               <div class="fixedFont">{!
+                                       if (data.isPrivate) output += "&lt;private&gt; ";
+                                       if (data.isInner) output += "&lt;inner&gt; ";
+                               !}
+                                               <b>{+ data.alias +}</b><if test="classType != 'Namespace '">{+ makeSignature(data.params) +}</if>
+                               </div>
+                               
+                               <div class="description">
+                                       {+resolveLinks(data.desc)+}
+                                       <if test="data.author"><br /><i>Author: </i>{+data.author+}.</if>
+                               </div>
+                               
+                               <if test="data.example">
+                               <pre class="code">{+data.example+}</pre>
+                               </if>
+                               
+                               
+                                       <if test="data.params.length">
+                                               <dl class="detailList">
+                                               <dt class="heading">Parameters:</dt>
+                                               <for each="item" in="data.params">
+                                                       <dt>
+                                                               {+((item.type)?""+("<span class=\"light fixedFont\">{"+(new Link().toSymbol(item.type)+"}</span> ")) : "")+} <b>{+item.name+}</b>
+                                                               <if test="item.isOptional"><i>Optional<if test="item.defaultValue">, Default: {+item.defaultValue+}</if></i></if>
+                                                       </dt>
+                                                               <dd>{+resolveLinks(item.desc)+}</dd>
+                                               </for>
+                                               </dl>
+                                       </if>
+                                       <if test="data.deprecated">
+                                               <dl class="detailList">
+                                               <dt class="heading">Deprecated:</dt>
+                                               <dt>
+                                                       {+resolveLinks(data.deprecated)+}
+                                               </dt>
+                                               </dl>
+                                       </if>
+                                       <if test="data.since.length">
+                                               <dl class="detailList">
+                                               <dt class="heading">Since:</dt>
+                                               <for each="item" in="data.since">
+                                                       <dd>{+ item +}</dd>
+                                               </for>
+                                               </dl>
+                                       </if>
+                                       <if test="data.exceptions.length">
+                                               <dl class="detailList">
+                                               <dt class="heading">Throws:</dt>
+                                               <for each="item" in="data.exceptions">
+                                                       <dt>
+                                                               {+((item.type)?"<span class=\"light fixedFont\">{"+(new Link().toSymbol(item.type))+"}</span> " : "")+} <b>{+item.name+}</b>
+                                                       </dt>
+                                                               <dd>{+resolveLinks(item.desc)+}</dd>
+                                               </for>
+                                               </dl>
+                                       </if>
+                                       <if test="data.returns.length">
+                                               <dl class="detailList">
+                                               <dt class="heading">Returns:</dt>
+                                               <for each="item" in="data.returns">
+                                                               <dd>{+((item.type)?"<span class=\"light fixedFont\">{"+(new Link().toSymbol(item.type))+"}</span> " : "")+}{+resolveLinks(item.desc)+}</dd>
+                                               </for>
+                                               </dl>
+                                       </if>
+                                       <if test="data.requires.length">
+                                               <dl class="detailList">
+                                               <dt class="heading">Requires:</dt>
+                                               <for each="item" in="data.requires">
+                                                       <dd>{+ resolveLinks(item) +}</dd>
+                                               </for>
+                                               </dl>
+                                       </if>
+                                       <if test="data.see.length">
+                                               <dl class="detailList">
+                                               <dt class="heading">See:</dt>
+                                               <for each="item" in="data.see">
+                                                       <dd>{+ new Link().toSymbol(item) +}</dd>
+                                               </for>
+                                               </dl>
+                                       </if>
+
+                       </div>
+                       </if>
+
+<!-- ============================== field details ========================== -->               
+                       <if test="isdefined(typeof(ownProperties)) && ownProperties.length">
+                               <div class="sectionTitle">
+                                       Field Detail
+                               </div>
+                               <for each="member" in="ownProperties">
+                                       <a name="{+Link.symbolNameToLinkName(member)+}"> </a>
+                                       <div class="fixedFont">{!
+                                               if (member.isPrivate) output += "&lt;private&gt; ";
+                                               if (member.isInner) output += "&lt;inner&gt; ";
+                                               if (member.isStatic) output += "&lt;static&gt; ";
+                                               if (member.isConstant) output += "&lt;constant&gt; ";
+                                       !}
+                                       
+                                       <if test="member.type"><span class="light">{{+new Link().toSymbol(member.type)+}}</span></if>
+                                       <if test="member.isStatic && member.memberOf != '_global_'"><span class="light">{+member.memberOf+}.</span></if><b>{+member.name+}</b>
+                                       
+                                       </div>
+                                       <div class="description">
+                                               {+resolveLinks(member.desc)+}
+                                               <if test="member.srcFile != data.srcFile">
+                                                       <br />
+                                                       <i>Defined in: </i> {+new Link().toSrc(member.srcFile)+}.
+                                               </if>
+                                               <if test="member.author"><br /><i>Author: </i>{+member.author+}.</if>
+                                       </div>
+                                       
+                                       <if test="member.example">
+                                       <pre class="code">{+member.example+}</pre>
+                                       </if>
+                               
+                                       
+                                               <if test="member.deprecated">
+                                                       <dl class="detailList">
+                                                       <dt class="heading">Deprecated:</dt>
+                                                       <dt>
+                                                               {+ member.deprecated +}
+                                                       </dt>
+                                                       </dl>
+                                               </if>
+                                               <if test="member.since.length">
+                                                       <dl class="detailList">
+                                                       <dt class="heading">Since:</dt>
+                                                               <dd>{+ member.since +}</dd>
+                                                       </dl>
+                                               </if>
+                                               <if test="member.see.length">
+                                                       <dl class="detailList">
+                                                       <dt class="heading">See:</dt>
+                                                       <for each="item" in="member.see">
+                                                       <dd>{+ new Link().toSymbol(item) +}</dd>
+                                                       </for>
+                                                       </dl>
+                                               </if>
+                                               <if test="member.defaultValue">
+                                                       <dl class="detailList">
+                                                       <dt class="heading">Default Value:</dt>
+                                                       <dd>
+                                                               {+resolveLinks(member.defaultValue)+}
+                                                       </dd>
+                                                       </dl>
+                                               </if>
+
+                                       <if test="!$member_last"><hr /></if>
+                               </for>
+                       </if>
+
+<!-- ============================== method details ========================= -->               
+                       <if test="isdefined(typeof(ownMethods)) && ownMethods.length">
+                               <div class="sectionTitle">
+                                       Method Detail
+                               </div>
+                               <for each="member" in="ownMethods">
+                                       <a name="{+Link.symbolNameToLinkName(member)+}"> </a>
+                                       <div class="fixedFont">{!
+                                               if (member.isPrivate) output += "&lt;private&gt; ";
+                                               if (member.isInner) output += "&lt;inner&gt; ";
+                                               if (member.isStatic) output += "&lt;static&gt; ";
+                                       !}
+                                       
+                                       <if test="member.type"><span class="light">{{+new Link().toSymbol(member.type)+}}</span></if>
+                                       <if test="member.isStatic && member.memberOf != '_global_'"><span class="light">{+member.memberOf+}.</span></if><b>{+member.name+}</b>{+makeSignature(member.params)+}
+                                       
+                                       </div>
+                                       <div class="description">
+                                               {+resolveLinks(member.desc)+}
+                                               <if test="member.srcFile != data.srcFile">
+                                                       <br />
+                                                       <i>Defined in: </i> {+new Link().toSrc(member.srcFile)+}.
+                                               </if>
+                                               <if test="member.author"><br /><i>Author: </i>{+member.author+}.</if>
+                                       </div>
+                                       
+                                       <if test="member.example">
+                                       <pre class="code">{+member.example+}</pre>
+                                       </if>
+                                       
+                                       
+                                               <if test="member.params.length">
+                                                       <dl class="detailList">
+                                                       <dt class="heading">Parameters:</dt>
+                                                       <for each="item" in="member.params">
+                                                               <dt>
+                                                                       {+((item.type)?"<span class=\"light fixedFont\">{"+(new Link().toSymbol(item.type))+"}</span> " : "")+}<b>{+item.name+}</b>
+                                                                       <if test="item.isOptional"><i>Optional<if test="item.defaultValue">, Default: {+item.defaultValue+}</if></i></if>
+                                                               </dt>
+                                                               <dd>{+resolveLinks(item.desc)+}</dd>
+                                                       </for>
+                                                       </dl>
+                                               </if>
+                                               <if test="member.deprecated">
+                                                       <dl class="detailList">
+                                                       <dt class="heading">Deprecated:</dt>
+                                                       <dt>
+                                                               {+member.deprecated+}
+                                                       </dt>
+                                                       </dl>
+                                               </if>
+                                               <if test="member.since.length">
+                                                       <dl class="detailList">
+                                                       <dt class="heading">Since:</dt>
+                                                               <dd>{+ member.since +}</dd>
+                                                       </dl>
+                                                       </dl>
+                                               </if>
+                                               <if test="member.exceptions.length">
+                                                       <dl class="detailList">
+                                                       <dt class="heading">Throws:</dt>
+                                                       <for each="item" in="member.exceptions">
+                                                               <dt>
+                                                                       {+((item.type)?"<span class=\"light fixedFont\">{"+(new Link().toSymbol(item.type))+"}</span> " : "")+} <b>{+item.name+}</b>
+                                                               </dt>
+                                                               <dd>{+resolveLinks(item.desc)+}</dd>
+                                                       </for>
+                                                       </dl>
+                                               </if>
+                                               <if test="member.returns.length">
+                                                       <dl class="detailList">
+                                                       <dt class="heading">Returns:</dt>
+                                                       <for each="item" in="member.returns">
+                                                               <dd>{+((item.type)?"<span class=\"light fixedFont\">{"+(new Link().toSymbol(item.type))+"}</span> " : "")+}{+resolveLinks(item.desc)+}</dd>
+                                                       </for>
+                                                       </dl>
+                                               </if>
+                                               <if test="member.requires.length">
+                                                       <dl class="detailList">
+                                                       <dt class="heading">Requires:</dt>
+                                                       <for each="item" in="member.requires">
+                                                               <dd>{+ resolveLinks(item) +}</dd>
+                                                       </for>
+                                                       </dl>
+                                               </if>
+                                               <if test="member.see.length">
+                                                       <dl class="detailList">
+                                                       <dt class="heading">See:</dt>
+                                                       <for each="item" in="member.see">
+                                                               <dd>{+ new Link().toSymbol(item) +}</dd>
+                                                       </for>
+                                                       </dl>
+                                               </if>
+
+                                       <if test="!$member_last"><hr /></if>
+                               </for>
+                       </if>
+                       
+                       <hr />
+               </div>
+               
+<!-- ============================== footer ================================= -->
+               <div class="fineprint" style="clear:both">
+                       <if test="JSDOC.opt.D.copyright">&copy;{+JSDOC.opt.D.copyright+}<br /></if>
+                       Documentation generated by <a href="http://www.jsdoctoolkit.org/" target="_blank">JsDoc Toolkit</a> {+JSDOC.VERSION+} on {+new Date()+}
+               </div>
+       </body>
+</html>
diff --git a/buildSDK/doc_templates/index.tmpl b/buildSDK/doc_templates/index.tmpl
new file mode 100644 (file)
index 0000000..327e81c
--- /dev/null
@@ -0,0 +1,63 @@
+
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
+        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+       <meta http-equiv="content-type" content="text/html; charset=utf-8" />
+       <title>RooJS(1) Generated Documentation</title>
+</head>
+
+
+<html>
+<head>
+  <title>RooJS (1) - Manual</title>
+   
+
+    <!--
+    <link rel="stylesheet" type="text/css" href="http://www.akbkhome.com/extjs/resources/css/ytheme-aero.css" />
+    <script type="text/javascript" src="http://www.akbkhome.com/extjs/adapter/yui/yui-utilities.js"></script>     
+    <script type="text/javascript" src="http://www.akbkhome.com/extjs/adapter/yui/ext-yui-adapter.js"></script> 
+
+    <script type="text/javascript" src="http://www.akbkhome.com/extjs/ext-all.js"></script>
+    -->
+    <link rel="stylesheet" type="text/css" href="../css/roojs.css" />
+    <script type="text/javascript" src="../roojs-all.js"></script>     
+<script type="text/javascript">
+Ext = Roo;
+</script>
+   
+    <link rel="stylesheet" type="text/css" href="../css/highlight-js.css" />
+   
+    <script type="text/javascript" src="./doc.js"></script>
+<link rel="stylesheet" type="text/css" href="./default.css" />
+
+
+<script type="text/javascript">   
+    
+var baseURL = ".";   
+
+Ext.BLANK_IMAGE_URL =  "../images/gray/s.gif";
+
+
+</script>
+
+<div class="x-layout-inactive-content">
+
+
+<ul id="classlist">
+
+       <for each="thisClass" in="data">
+       <li><div 
+               roo:isc="{+ (thisClass.isNamespace || (thisClass.comment && thisClass.comment.getTag('class').length && !thisClass.isBuiltin())) ? "yes": "no" +}"
+               roo:isns="{+ thisClass.isNamespace ? "yes": "no" +}">{+thisClass.alias+}</div>
+       
+       </li>
+       </for>  
+       </ul>   
+</div>         
+
+
+</html>
+
+               
+                        
\ No newline at end of file
diff --git a/buildSDK/doc_templates/publish.js b/buildSDK/doc_templates/publish.js
new file mode 100644 (file)
index 0000000..7b3601a
--- /dev/null
@@ -0,0 +1,434 @@
+//<script type="text/javascript">
+// not we use xxx = function() - as this get's loaded by a nested eval..
+// 
+
+
+JSON = new (function(){
+    var useHasOwn = {}.hasOwnProperty ? true : false;
+    
+    // crashes Safari in some instances
+    //var validRE = /^("(\\.|[^"\\\n\r])*?"|[,:{}\[\]0-9.\-+Eaeflnr-u \n\r\t])+?$/;
+    
+    var pad = function(n) {
+        return n < 10 ? "0" + n : n;
+    };
+    
+    var m = {
+        "\b": '\\b',
+        "\t": '\\t',
+        "\n": '\\n',
+        "\f": '\\f',
+        "\r": '\\r',
+        '"' : '\\"',
+        "\\": '\\\\'
+    };
+
+    var encodeString = function(s){
+        if (/["\\\x00-\x1f]/.test(s)) {
+            return '"' + s.replace(/([\x00-\x1f\\"])/g, function(a, b) {
+                var c = m[b];
+                if(c){
+                    return c;
+                }
+                c = b.charCodeAt();
+                return "\\u00" +
+                    Math.floor(c / 16).toString(16) +
+                    (c % 16).toString(16);
+            }) + '"';
+        }
+        return '"' + s + '"';
+    };
+    
+    var encodeArray = function(o){
+        var a = ["["], b, i, l = o.length, v;
+            for (i = 0; i < l; i += 1) {
+                v = o[i];
+                switch (typeof v) {
+                    case "undefined":
+                    case "function":
+                    case "unknown":
+                        break;
+                    default:
+                        if (b) {
+                            a.push(',');
+                        }
+                        a.push(v === null ? "null" : JSON.encode(v));
+                        b = true;
+                }
+            }
+            a.push("]");
+            return a.join("");
+    };
+    
+    var encodeDate = function(o){
+        return '"' + o.getFullYear() + "-" +
+                pad(o.getMonth() + 1) + "-" +
+                pad(o.getDate()) + "T" +
+                pad(o.getHours()) + ":" +
+                pad(o.getMinutes()) + ":" +
+                pad(o.getSeconds()) + '"';
+    };
+    
+    /**
+     * Encodes an Object, Array or other value
+     * @param {Mixed} o The variable to encode
+     * @return {String} The JSON string
+     */
+    this.encode = function(o){
+        if(typeof o == "undefined" || o === null){
+            return "null";
+        }else if(o instanceof Array){
+            return encodeArray(o);
+        }else if(o instanceof Date){
+            return encodeDate(o);
+        }else if(typeof o == "string"){
+            return encodeString(o);
+        }else if(typeof o == "number"){
+            return isFinite(o) ? String(o) : "null";
+        }else if(typeof o == "boolean"){
+            return String(o);
+        }else {
+            var a = ["{"], b, i, v;
+            for (i in o) {
+                if(!useHasOwn || o.hasOwnProperty(i)) {
+                    v = o[i];
+                    switch (typeof v) {
+                    case "undefined":
+                    case "function":
+                    case "unknown":
+                        break;
+                    default:
+                        if(b){
+                            a.push(',');
+                        }
+                        a.push(this.encode(i), ":",
+                                v === null ? "null" : this.encode(v));
+                        b = true;
+                    }
+                }
+            }
+            a.push("}");
+            return a.join("");
+        }
+    };
+    
+    /**
+     * Decodes (parses) a JSON string to an object. If the JSON is invalid, this function throws a SyntaxError.
+     * @param {String} json The JSON string
+     * @return {Object} The resulting object
+     */
+    this.decode = function(json){
+        /**
+         * eval:var:json
+         */
+        return eval("(" + json + ')');
+    };
+})();
+
+
+
+publish  = function(symbolSet) {
+       publish.conf = {  // trailing slash expected for dirs
+               ext: ".html",
+               
+               templatesDir: JSDOC.opt.t + "/",
+               symbolsDir: "symbols/",
+               srcDir: "symbols/src/"
+       };
+  
+       publish.conf.outDir = (JSDOC.opt.d.length > 0 ? JSDOC.opt.d : "/tmp/jsdoc/");
+       
+    
+    
+    
+       if (JSDOC.opt.s && defined(Link) && Link.prototype._makeSrcLink) {
+               Link.prototype._makeSrcLink = function(srcFilePath) {
+                       return "&lt;"+srcFilePath+"&gt;";
+               }
+       }
+       
+    println(publish.conf.outDir);
+    
+    if (!File.exists(publish.conf.outDir))
+        File.mkdir(publish.conf.outDir);
+    if (!File.exists(publish.conf.outDir+"symbols"))
+        File.mkdir(publish.conf.outDir+"symbols");
+    if (!File.exists(publish.conf.outDir+"symbols/src"))
+        File.mkdir(publish.conf.outDir+"symbols/src");
+    
+    IO.copyFile (publish.conf.templatesDir+"static/default.css", publish.conf.outDir, "default.css");
+    IO.copyFile (publish.conf.templatesDir+"static/doc.js", publish.conf.outDir, "doc.js");
+    IO.copyFile (publish.conf.templatesDir+"static/page.js", publish.conf.outDir, "page.js");
+  
+    
+       //IO.mkPath((publish.conf.outDir+"symbols/src").split("/"));
+               
+       // used to check the details of things being linked to
+       Link.symbolSet = symbolSet;
+
+       //try {
+               var classTemplate = new JSDOC.JsPlate(publish.conf.templatesDir+"class.tmpl");
+               var classesTemplate = new JSDOC.JsPlate(publish.conf.templatesDir+"allclasses.tmpl");
+       //}
+       //atch(e) {
+       //      print(e.message);
+       ///     quit();
+       //}
+       
+       // filters
+    
+    classTemplate.symbolSet = symbolSet;
+    
+    
+       function hasNoParent($) {return ($.memberOf == "")}
+       function isaFile($) {return ($.is("FILE"))}
+       function isaClass($) { return ($.is("CONSTRUCTOR") || $.isNamespace); }
+       
+       var symbols = symbolSet.toArray();
+       
+       var files = JSDOC.opt.srcFiles;
+       for (var i = 0, l = files.length; i < l; i++) {
+               var file = files[i];
+               var srcDir = publish.conf.outDir + "symbols/src/";
+               makeSrcFile(file, srcDir);
+       }
+       
+       var classes = symbols.filter(isaClass).sort(makeSortby("alias"));
+       
+       Link.base = "../";
+       publish.classesIndex = classesTemplate.process(classes); // kept in memory
+       
+    IO.makeDir(publish.conf.outDir+"json");
+    
+       for (var i = 0, l = classes.length; i < l; i++) {
+               var symbol = classes[i];
+               var output = "";
+        
+               output = classTemplate.process(symbol);
+               println("write " + publish.conf.outDir+"symbols/" +symbol.alias+publish.conf.ext);
+               IO.saveFile(publish.conf.outDir+"symbols/", symbol.alias+publish.conf.ext, output);
+        // dump out a 
+        IO.saveFile(publish.conf.outDir+"json/",  symbol.alias+'.json' , publish.jsonRender(symbol));
+        
+        
+       }
+       
+       // regenrate the index with different relative links
+       Link.base = "";
+       publish.classesIndex = classesTemplate.process(classes);
+       
+       try {
+               var classesindexTemplate = new JSDOC.JsPlate(publish.conf.templatesDir+"index.tmpl");
+       }
+       catch(e) { print(e.message); quit(); }
+       
+       var classesIndex = classesindexTemplate.process(classes);
+       IO.saveFile(publish.conf.outDir, "index"+publish.conf.ext, classesIndex);
+       classesindexTemplate = classesIndex = classes = null;
+       
+       try {
+               var fileindexTemplate = new JSDOC.JsPlate(publish.conf.templatesDir+"allfiles.tmpl");
+       }
+       catch(e) { print(e.message); quit(); }
+       
+       var documentedFiles = symbols.filter(isaFile);
+       var allFiles = [];
+       
+       for (var i = 0; i < files.length; i++) {
+               allFiles.push(new JSDOC.Symbol(files[i], [], "FILE", new JSDOC.DocComment("/** */")));
+       }
+       
+       for (var i = 0; i < documentedFiles.length; i++) {
+               var offset = files.indexOf(documentedFiles[i].alias);
+               allFiles[offset] = documentedFiles[i];
+       }
+               
+       allFiles = allFiles.sort(makeSortby("name"));
+
+       var filesIndex = fileindexTemplate.process(allFiles);
+       IO.saveFile(publish.conf.outDir, "files"+publish.conf.ext, filesIndex);
+       fileindexTemplate = filesIndex = files = null;
+}
+
+publish.jsonRender = function(data)
+{
+    // what we need to output to be usefull...
+    // a) props..
+    var cfgProperties = [];
+       if (!data.comment.getTag('singleton').length) {
+               cfgProperties = data.configToArray();
+               cfgProperties = cfgProperties.sort(makeSortby("name"));
+               
+       }
+    var props = []; 
+    //println(cfgProperties.toSource());
+    var p ='';
+    for(var i =0; i < cfgProperties.length;i++) {
+        p = cfgProperties[i];
+        props.push( {
+            name : p.name,
+            type : p.type,
+            desc : p.desc,
+            memberOf : p.memberOf == data.alias ? '' : p.memberOf
+        });
+    }
+    
+     
+    var ownEvents = data.methods.filter( function(e){
+            return e.isEvent && !e.comment.getTag('hide').length;
+        }).sort(makeSortby("name"));
+                
+    
+    var events = [];
+    var m;
+       for(var i =0; i < ownEvents.length;i++) {
+        m = ownEvents[i];
+        events.push( {
+            name : m.name.substring(1),
+            sig : makeFuncSkel(m.params),
+            type : 'function',
+            desc : m.desc
+        });
+    }
+    //println(props.toSource());
+    // we need to output:
+    //classname => {
+    //    propname => 
+    //        type=>
+    //        desc=>
+    //    }
+
+    var ret = {
+        props : props,
+        events: events
+    };
+    return JSON.encode(ret);
+       
+    
+    // b) methods
+    // c) events
+    
+    
+}
+
+
+
+/** Just the first sentence. */
+summarize = function(desc) {
+       if (typeof desc != "undefined")
+               return desc.match(/([\w\W]+?\.)[^a-z0-9]/i)? RegExp.$1 : desc;
+}
+
+/** make a symbol sorter by some attribute */
+makeSortby = function(attribute) {
+       return function(a, b) {
+               if (a[attribute] != undefined && b[attribute] != undefined) {
+                       a = a[attribute]; //.toLowerCase();
+                       b = b[attribute];//.toLowerCase();
+                       if (a < b) return -1;
+                       if (a > b) return 1;
+                       return 0;
+               }
+       }
+}
+/*
+function include(path) {
+       var path = publish.conf.templatesDir+path;
+       return IO.readFile(path);
+}
+*/
+
+function makeSrcFile(path, srcDir, name) {
+       if (JSDOC.opt.s) return;
+       
+       if (!name) {
+               name = path.replace(/\.\.?[\\\/]/g, "").replace(/[\\\/]/g, "_");
+               name = name.replace(/\:/g, "_");
+       }
+       
+       var src = {path: path, name:name, charset: IO.encoding, hilited: ""};
+       
+       if (JSDOC.hasOwnProperty('PluginManager')) {
+               JSDOC.PluginManager.run("onPublishSrc", src);
+       }
+
+       if (src.hilited) {
+               IO.saveFile(srcDir, name+publish.conf.ext, src.hilited);
+       }
+}
+
+makeSignature= function(params) {
+       if (!params) return "()";
+       var signature = "("     +
+        params.filter(
+            function($) {
+                return $.name.indexOf(".") == -1; // don't show config params in signature
+            }
+        ).map(
+            function($) {
+                $.defaultValue = typeof($.defaultValue) == 'undefined' ? false : $.defaultValue;
+                
+                return "" +
+                    ($.isOptional ? "[" : "") +
+                    (($.type) ? (new Link().toSymbol($.type)) + " " : "") + 
+                    "<B><i>" +$.name + "</i></B>" +
+                    ($.defaultValue ? "=" +item.defaultValue : "") +
+                    ($.isOptional ? "]" : "");
+                
+                 
+            }
+        ).join(", ")
+       +
+       ")";
+       return signature;
+}
+
+makeFuncSkel =  function(params) {
+       if (!params) return "function ()\n{\n\n}";
+       return "function ("     +
+        params.filter(
+            function($) {
+                return $.name.indexOf(".") == -1; // don't show config params in signature
+            }
+        ).map( function($) { return $.name == 'this' ? '_self' : $.name; } ).join(", ")
+       +
+       ")\n{\n\n}";
+       
+}
+
+/** Find symbol {@link ...} strings in text and turn into html links */
+resolveLinks = function (str, from) {
+    if (typeof(str) == 'undefined') {
+        return '';
+    }
+       str = str.replace(/\{@link ([^} ]+) ?\}/gi,
+               function(match, symbolName) {
+                       return new Link().toSymbol(symbolName);
+               }
+       );
+       
+    str = str.replace(/\{([a-z\.\/]+)\}/gi,
+               function(match, symbolName) {
+            //println("got match " + symbolName);
+            bits = symbolName.split('/');
+            var mret = '';
+            for(var i = 0; i < bits.length; i++) {
+                
+                mret += (mret.length ? '&nbsp;|&nbsp;' : '') + new Link().toSymbol(bits[i]);
+            }
+            
+            return mret; //new Link().toSymbol(symbolName);
+               }
+       );
+    
+    // look for aaaa.\S+  ??? this might work???
+    /*
+    str = str.replace(/\([a-z]+\.\S+)/gi,
+               function(match, symbolName) {
+            return new Link().toSymbol(symbolName);
+               }
+       );
+    */
+    
+       return str;
+}
\ No newline at end of file
diff --git a/buildSDK/doc_templates/static/default.css b/buildSDK/doc_templates/static/default.css
new file mode 100644 (file)
index 0000000..04ce73f
--- /dev/null
@@ -0,0 +1,415 @@
+/* default.css 
+/<style>
+/ */
+body
+{
+       font: 12px "Lucida Grande", Tahoma, Arial, Helvetica, sans-serif;
+       /* width: 800px; */
+}
+
+.header
+{
+       clear: both;
+       background-color: #ccc;
+       padding: 8px;
+}
+
+h1
+{
+       font-size: 150%;
+       font-weight: bold;
+       padding: 0;
+       margin: 1em 0 0 .3em;
+}
+
+hr
+{
+       border: none 0;
+       border-top: 1px solid #7F8FB1;
+       height: 1px;
+}
+
+pre.code
+{
+       display: block;
+       padding: 8px;
+       border: 1px dashed #ccc;
+}
+
+#index
+{
+       margin-top: 24px;
+       float: left;
+       width: 160px;
+       position: absolute;
+       left: 8px;
+       background-color: #F3F3F3;
+       padding: 8px;
+}
+
+#content
+{
+       margin-left: 190px;
+       width: 600px;
+}
+
+.classList
+{
+       list-style-type: none;
+       padding: 0;
+       margin: 0 0 0 8px;
+       font-family: arial, sans-serif;
+       font-size: 1em;
+       overflow: auto;
+}
+
+.classList li
+{
+       padding: 0;
+       margin: 0 0 8px 0;
+}
+
+.summaryTable { width: 100%; }
+
+h1.classTitle
+{
+       font-size:170%;
+       line-height:130%;
+}
+
+h2 { font-size: 110%; }
+
+/* --------- the labels at the top of the page... -------- */
+.class-summary-table .label
+{
+    vertical-align: top;
+    margin-bottom: 4px;
+}
+
+.class-summary-table 
+{
+    margin-left:10px;
+    margin-top:5px;
+    
+}
+.class-summary-table  td
+{
+    font-size:12px;
+    padding:2px 10px 2px 2px;
+}
+.elbow
+{
+    vertical-align: middle;
+    padding-right: 2px;
+   }
+    
+/** ---------------------   Caption above tables -----------------------**/
+caption.Empty,
+caption, 
+div.sectionTitle
+{
+       background-color: #7F8FB1;
+       color: #fff;
+       font-size:130%;
+       text-align: left;
+       padding: 2px 6px 2px 6px;
+       border: 1px #7F8FB1 solid;
+    width: 100%;
+    font-weight: bold;
+}
+
+div.sectionTitle { margin-bottom: 8px; }
+.summaryTable thead { display: none; }
+
+.summaryTable td
+{
+       vertical-align: top;
+       padding: 4px;
+       border-bottom: 1px #7F8FB1 solid;
+       border-right: 1px #7F8FB1 solid;
+}
+
+/*col#summaryAttributes {}*/
+.summaryTable td.attributes
+{
+       border-left: 1px #7F8FB1 solid;
+       width: 140px;
+       text-align: right;
+}
+
+td.attributes, .fixedFont
+{
+       line-height: 15px;
+/*     color: #002EBE; */
+       font-family: "Courier New",Courier,monospace;
+       font-size: 13px;
+    margin-left: 10px;
+}
+.itemname
+{
+    color: #002EBE; 
+}
+
+
+.summaryTable td.nameDescription
+{
+       text-align: left;
+       font-size: 13px;
+       line-height: 15px;
+}
+
+.summaryTable td.nameDescription, .description
+{
+       font: 13px Palatino,Garamond,serif;
+       line-height: 15px;
+       padding: 4px;
+       padding-left: 4px;
+}
+
+.summaryTable { margin-bottom: 8px; }
+
+ul.inheritsList
+{
+       list-style: square;
+       margin-left: 20px;
+       padding-left: 0;
+}
+
+.detailList {
+       margin-left: 20px; 
+    padding-top: 10px;
+       line-height: 20px;
+    clear: left;
+}
+.detailList dt 
+{ 
+    margin-left: 20px; 
+    clear: left;
+    float: left;
+    
+}
+
+.detailList .heading
+{
+       font-weight: bold;
+       padding-bottom: 6px;
+       margin-left: 0;
+    
+}
+
+.light, td.attributes, .light a:link, .light a:visited
+{
+       color: #777;
+       font-style: italic;
+}
+
+.fineprint
+{
+       text-align: right;
+       font-size: 10px;
+}
+
+.detailList dd
+{
+    clear: none;
+    float: left;
+    margin-left: 10px;
+    
+    
+}
+
+
+.detailList dt 
+{
+    
+    
+    margin-bottom::    12px;
+    margin-left:       20px;
+}
+/** ----------------------- RooJS extra stuff  ----------------------- */
+
+.body-wrap {
+    margin: 5px;
+}
+
+.top-tools  {
+    text-align:right;
+}
+.inner-link {
+    margin-left: 10px;
+}
+.inheritance {
+    float:right;
+    margin-top:20px;
+    width:300px;
+}
+.res-block {
+    margin-bottom:15px;
+    padding-top:5px;
+   /* width:210px; */
+}
+.inheritance pre {
+    border:0pt none;
+    font-size:11px;
+    /* line-height:18px !important; */
+    margin:0pt;
+    padding:0pt 8px 5px !important;
+    text-align:left;
+    background-color: #f8f8f8;
+}
+div.hr { 
+    background:#CCCCCC none repeat scroll 0%;
+    height:1px;
+    line-height:1px;
+    margin:5px 0pt;
+    overflow:hidden;
+        clear: both;
+}
+/** ----------------------- RooJS table stuff  ----------------------- */
+
+.member-table {
+    margin-bottom:10px;
+    width:100%;
+}
+
+.member-table th { 
+    background-color:#eee;
+    border-left:1px solid #EEE;
+    border-right:1px solid #DDD;
+    border-top:1px solid #EEE;
+    padding:3px;
+    text-align:left;
+    vertical-align:middle;
+    
+    
+    font-size:11px;
+    white-space:nowrap;
+    
+}
+
+.member-table td.micon {
+    background:#F9F9F9;
+    border-right:1px solid #D0D0D0;
+    padding:0px;
+    width:16px;
+}
+
+.member-table td.micon a {
+   
+    display:block;
+    
+    text-decoration: none;
+    
+     height:18px;
+    width:16px;
+}
+
+.member-table td.micon,
+.member-table td.sig, 
+.member-table td.msource {
+    border-top:1px solid #D0D0D0;
+    vertical-align:top;
+    padding: 5px;
+    font-size: 13px;
+}
+.expanded .mdesc .short{ 
+    display:none;
+}
+.expanded .mdesc .comments,
+.expanded .mdesc .long { 
+    display:block;
+    margin-top: 10px;
+    margin-left: 10px;
+}
+
+
+.mdesc .comments,
+.mdesc .long { 
+    display:none;
+}
+.mdesc .short { 
+    color: #666;
+    margin-left: 10px;
+}
+
+.expandable td.micon a {
+    background:transparent url(http://devel.akbkhome.com/extjs/resources/images/default/tree/elbow-plus-nl.gif) no-repeat scroll 0px 0px;
+    cursor:pointer}
+
+.expanded  td.micon a {
+    background:transparent url(http://devel.akbkhome.com/extjs/resources/images/default/tree/elbow-minus-nl.gif) no-repeat scroll 0px 0px;
+    cursor:pointer;
+
+}
+
+
+/* ---- table with no contents */
+
+caption.Empty 
+{
+    background-color:#EEEEEE;
+    border:medium none;
+    color:#666666;
+    font-size:10pt;
+    font-style:italic;
+    font-weight: normal;
+}
+
+
+/* fix up lists back to normal */
+
+
+.body-wrap ul 
+{
+    ist-style-image:   none;
+    list-style-position:       outside;
+    list-style-type:   disc;
+    padding-left: 40px;
+}
+
+.long pre,
+.description pre  {
+    background:#F8F8F8 none repeat scroll 0% 0%;
+    border-color:#ccc;
+    border-style:solid;
+    border-width:1px 1px 1px 5px;
+    font-size:12px !important;
+    line-height:14px !important;
+    margin:10px 10px 10px 0px;
+    padding:10px;
+}
+
+
+.comments {
+    background:#F8F8F8 none repeat scroll 0% 0%;
+    border-color:#f30;
+    border-style:solid;
+    border-width:1px 15px 1px 15px;
+    font-size:12px !important;
+    line-height:14px !important;
+    margin:10px 10px 10px 0px;
+    padding:10px;
+    width:95%;
+    float:left;
+    
+}
+
+
+/** methods etc. defined in this class are highlighted. **/
+
+/** -------- alternating rows.. ---- */
+
+.config-row-alt0 {
+    background-color : #f8f8f8;
+}
+.notInherited td.micon,
+.notInherited td.msource
+{
+    
+    background-color: #fcc; 
+    /*border: 1px solid red; */
+}
+td.msource 
+{
+    width: 160px;
+}
diff --git a/buildSDK/doc_templates/static/doc.js b/buildSDK/doc_templates/static/doc.js
new file mode 100644 (file)
index 0000000..67a46a8
--- /dev/null
@@ -0,0 +1,613 @@
+//<script type="text/javascript">
+
+
+Roo.onReady(function(){
+
+    Roo.QuickTips.init();
+      MainBody.init();
+   
+    
+    
+});
+MainBody = {
+    layout: false,
+    cookie: false,
+    init: function() 
+    {
+        
+        this.cookie = new Roo.state.CookieProvider({})
+        
+        MainBody.layout = new Roo.BorderLayout(document.body, {
+            north: {
+                split:true,
+                initialSize: 30,
+                titlebar: false,
+                collapsible: false
+                
+            },
+            west: {
+                split:true,
+                initialSize: 200,
+                titlebar: true,
+                collapsible: true
+                
+            },
+            center: {
+                autoScroll: false,
+                titlebar: true,
+                resizeTabs:true,
+                minTabWidth: 100,
+                preferredTabWidth:250
+            }
+        });
+        var layout = MainBody.layout;
+        MainBody.layout.beginUpdate();
+        var hd = this.layout.getEl().createChild( {
+                tag:'div' , 
+                style: 'background-colour:#000; font-weight: bold;' + 
+                    'font-size:16px;'  +
+                    'font-family:Arial,Verdana,\'Bitstream Vera Sans\',Helvetica,sans-serif;', 
+                html: '<img src="../images/roojs_logo.jpg" height="25" align="right"/>' + 
+                    '<div style="margin-left:10px;margin-top:3px;">Roo Version 1.1.1 - Documentation</div>'
+        });
+        layout.add('north', new Roo.ContentPanel(hd, {fitToFrame:true, closable:false }));
+         
+        //innerLayout.add('south', new Roo.ContentPanel('inner1', "More Information"));
+        //innerLayout.add('center', new Roo.ContentPanel('inner2')); // right bottom Tree
+        
+         
+        //alert("initing");
+       
+        ClassTree.init();
+        
+        //var frame = this.layout.getEl().createChild({ tag:'div' , frameborder: "no"});
+        var frame = this.layout.getEl().createChild({ tag:'iframe' , id:'viewFrame', name:'viewFrame',frameborder: "no"});
+                   
+                   
+     
+        
+        this.preview = new Roo.ContentPanel(frame, {title: 
+            '&nbsp;<a target="viewFrame" href="/roojs1/buildSDK/indexPage.html">Contents / Examples</a>' + 
+            ' | Class Details',
+            fitToFrame:true,
+            autoScroll: true
+        });
+        
+        //// ---- HANLE CLICKS ON OUR CHILD PAGE???
+        /*
+        this.preview.getEl().on('click', function(e, target)
+        {
+            //console.log("click pressed?");
+            
+            if(target = e.getTarget('a:not(.exi)', 3)) {
+                var cls = Roo.fly(target).getAttributeNS('roo', 'cls');
+                e.stopEvent();
+                if(cls){
+                    var member = Roo.fly(target).getAttributeNS('roo', 'member');
+                    //this.loadClass(target.href, cls, member);
+                    
+                    if (/^src\//.test(cls)) {
+                        cls = cls.replace(/.js$/, ''); // get rid of .js for source links..
+                    }
+                    
+                    
+                    MainBody.loadPage("symbols/"+ cls +".html");
+                    return;
+                }
+                if(target.className == 'inner-link'){ // go to #
+                    this.getActiveTab().scrollToSection(target.href.split('#')[1]);
+                    return;
+                }
+                window.open(target.href);
+                
+                return; // no more...
+            }
+            if(target = e.getTarget('.micon', 2)){
+                
+                e.stopEvent();
+                var tr = Roo.fly(target.parentNode);
+                if(tr.hasClass('expandable')){
+                    tr.toggleClass('expanded');
+                }
+            }
+          
+        });
+        */
+         
+        window.setInterval(function() {
+            // check 
+            //console.log("check");
+                if (CommentDialog.showCommentId.length) {
+                    var id  = '' + CommentDialog.showCommentId;
+                    if (Roo.isSafari) {
+                        Roo.get(document.getElementsByTagName('iframe')[0]).setVisible(false);
+                    }
+                   // alert(id);
+                    CommentDialog.showCommentId= '';
+                    
+                    
+                    
+                    CommentDialog.show(id);
+                }
+            }, 500); // check every half second..
+        
+        
+        
+        
+        var cp = this.layout.add('center',   this.preview);
+        MainBody.loadPage("/roojs1/buildSDK/indexPage.html");
+        
+        
+        MainBody.layout.endUpdate();
+      
+        CommentDialog.build();
+        
+        Roo.get(document.getElementsByTagName('iframe')[0]).setVisibilityMode(Roo.Element.DISPLAY);
+        
+    },
+    
+    
+    loadPage: function(src) {
+        this.preview.el.dom.src = src;
+
+        //this.preview.load(src);
+    } 
+    
+    
+}
+
+
+ClassTree = {
+    tree: false,
+    
+    init : function () 
+    {
+        if (this.tree) {
+            return;
+           }
+        
+        var ct = MainBody.layout.getEl().createChild({tag:'div'});
+        var viewEl = ct.createChild({tag:'div'});
+        var folders = MainBody.layout.add('west', 
+            new Roo.ContentPanel(ct, {
+                title:'Tree', 
+                fitToFrame:true,
+                autoScroll:true,
+                autoCreate:true,
+               // toolbar: tb,
+                resizeEl:viewEl
+            }));
+        this.tree = new Roo.tree.TreePanel(viewEl, {
+            animate:true, 
+            enableDD:false,
+            containerScroll: true,
+            ddGroup: 'organizerDD',
+            rootVisible:false,
+            listeners : {
+                
+                click : function(node, e) {
+                    // do stuff.
+                    // load: 
+                    //console.log(node.attributes.openUrl);
+                    if (!node.attributes.openUrl) {
+                        return;
+                    }
+                    MainBody.loadPage("symbols/"+ node.attributes.openUrl  +".html");
+                     
+                    //MainBody.layout.getRegion('center').getPanel(0).setTitle(ClassTree.getTitleHtml(file)); // methods
+                }
+                
+                
+            }
+        });
+        new Roo.tree.TreeSorter(this.tree, {folderSort:true});
+        var root = new Roo.tree.TreeNode({
+            text: '', 
+            allowDrag:false,
+            allowDrop:false
+        });
+        this.tree.setRootNode(root);
+        // loop through 
+        function addNodes(parent, ar, pref) 
+        {
+            for(var nm in ar) {
+                if (nm.substring(0,1) == "_") { // skip desc..
+                    continue;
+                }
+                //console.log("nm : " + nm + " = isNS:"+ar[nm]._isNS + " ? PN:" + nd.getDepth());
+                var hasChildNodes = ar[nm]._hasChildren && (ar[nm]._isNS || (parent.getDepth() < 1));
+                    
+                
+                var nd = new Roo.tree.TreeNode( {
+                        text:pref +nm, 
+                        cls:  'album-node'  ,  
+                        allowDrag:false,
+                        leaf : !hasChildNodes,
+                        openUrl: ar[nm].hasOwnProperty('_full') ? ar[nm]._full : false,
+                        isNS : ar[nm]._isNS
+                });
+                
+                // add a duplacate reference - if it's got children and 
+                /*
+                if (ar[nm]._hasChildren && (!ar[nm]._isNS) {
+                    //console.log("Adding node.." + nm);
+                    var xn = new Roo.tree.TreeNode( {
+                            text:    nm,
+                            cls:  'album-node'  ,  
+                            allowDrag:false,
+                            leaf : true,
+                            openUrl: ar[nm].hasOwnProperty('_full') ? ar[nm]._full : false
+                            
+                            
+                    });    
+                    parent.appendChild(xn);
+                }
+                */
+                parent.appendChild(nd);
+                
+                //if (typeof(ar[nm]) == "object") {
+                
+                if (ar[nm]._hasChildren) {
+                    //console.log("nm : " + nm + " = isNS:"+ar[nm]._isNS + " ? PN:" + nd.getDepth());
+                    
+                    if (hasChildNodes) {
+                        // namespace -- make a tre..
+                        addNodes(nd, ar[nm],'');
+                        
+                        
+                        
+                    } else {
+                        addNodes(parent, ar[nm],  pref + nm + '.');
+                        
+                        
+                        
+                        
+                        
+                    }
+                    
+                }
+            }
+             
+            
+        }
+        ClassTree.load();
+        // class tree comes from outside!!!
+        addNodes(root, ClassTree.nodes,'');
+        
+        this.tree.render();
+        
+        
+        root.eachChild(function(n) { n.expand(); });
+        //new Roo.tree.TreeSorter(this.tree);
+        ///this.tree.expand();
+          
+       },
+    nodes : { },
+    load: function(file)
+    {
+        
+        ClassTree.nodes = { _hasChildren: true, _isNameSpace: true };
+           
+        Roo.get('classlist').select('li').each( function(n) {
+            var dvs = n.select('div');
+            
+            var cn = {
+                name : dvs.item(0).dom.innerHTML,
+                desc : '', //dvs.item(1).dom.innerHTML
+                isNS : dvs.item(0).getAttributeNS('roo','isns') == "yes"
+            }
+            //console.log("ADD: " + cn.name);
+            var nbits = cn.name.split(".");
+            
+            // top is where we stick everything in...
+            
+            var top=  ClassTree.nodes;
+            
+            for (var  i = 0; i < nbits.length; i++) {
+                // is the last one..
+                var nm = nbits[i];
+                
+                if (i == (nbits.length-1)) {
+                    if (top.hasOwnProperty(nm)) {
+                        top[nm]._full = cn.name;
+                        top[nm]._desc = cn.desc;
+                        break; // all done..
+                    }
+                    top._hasChildren =true;
+                    top[nm] = {
+                      ///  _parent : "Object", // not sure abou this bit!!!
+                        _full : cn.name,
+                        _desc : cn.name,
+                        _hasChildren : false ,
+                        _isNS : cn.isNS
+                    }
+                    break;
+                }
+                // not the top.
+                if (top.hasOwnProperty(nm)) {
+                    top = top[nm];
+                    continue;
+                }
+                top[nm] = { _hasChildren : false };
+                top = top[nm];
+            }
+            
+            
+            
+            
+        });
+       
+        //console.log(ClassTree.nodes);
+        
+        
+        
+        // load page into right hand panel....
+    }
+    /*
+    getTitleHtml : function (file)
+    {
+        var bits = file.split(".");
+        // what about 'Gtk/G etc.'
+        if (bits.length < 2) {
+            return file;
+        }
+        // should not really happen..
+        if (!(bits[0] in classtree)) {
+            return file;
+        }
+        if (!(bits[1] in classtree[bits[0]])) {
+            return file;
+        }
+        var parent = classtree[bits[0]][bits[1]]._parent;
+        if (bits.length == 3) {
+            if (!(bits[2] in classtree[bits[0]][bits[1]])) {
+                return file;
+            }
+            parent = classtree[bits[0]][bits[1]][bits[2]]._parent;
+        }
+        
+        // add parent...
+        var ret = "<u onclick=\"ClassTree.load('"+file+"')\">" + file + "</u>&nbsp;&gt;&nbsp;";
+        return ret + ClassTree.getTitleHtml(parent);
+    }
+    */
+    
+    
+}
+     
+     
+     
+     
+     
+     
+     
+
+CommentDialog = {
+    
+    dialog : false,
+    form: false,
+    ids: false,
+    showCommentId: '', /// id of comment to show as scoping on konq/safari is borked
+    show: function (cls) {
+        this.build();
+        this.ids = cls;
+        this.form.reset();
+        this.form.setValues( {
+                "comment[title]" : "General Comment",
+                "comment[wikifile]" : cls
+                });
+        this.form.setValues( MainBody.cookie.state );
+        
+        this.dialog.show();
+        if (this.form.getValues()["comment[author]"].length) {
+            CommentDialog.form.items.items[4].focus();
+        } else {
+            CommentDialog.form.items.items[0].focus();
+        }
+        
+    },
+    build: function ()
+    {
+        
+        if (this.dialog) {
+            return;
+        }
+  
+        this.dialog = new Roo.LayoutDialog(Roo.id(), { 
+                autoCreate: true,
+                modal:true,
+                title: "Add Comment",
+                //autoTabs:true,
+                titlebar: true,
+                
+                modal:true,
+                width:550,
+                height:450,
+                shadow:true,
+                 
+                
+                center:{
+                    autoScroll:false 
+                 
+                } 
+               
+        });
+             
+        this.dialog.addKeyListener(27, this.hide, this);
+        this.dialog.addButton('Cancel', this.hide, this);
+        this.dialog.addButton('Submit', this.submit, this);
+    
+        var layout = this.dialog.getLayout();
+        var cd = this;
+        // create the dialog....
+        this.form = new Roo.form.Form({
+            labelWidth: 160,
+            
+            listeners : {
+                actionfailed : function(f, act) {
+                    cd.dialog.el.unmask();    
+                    Roo.MessageBox.alert("Error", "Saving failed = fix errors and try again");
+                    // we dont do loads....
+                    
+                              
+                },
+                actioncomplete: function(f, act) {
+                     
+                    cd.dialog.el.unmask();    
+                    cd.hide();
+                    cd.form.reset();
+                    //hopefully this hsould work!
+                    var p = parent;
+                    while (p.parent != p) {
+                        p = p.parent;
+                    }
+                    console.log("trying : " + "comments-" + cd.ids);
+                    p.frames[0].document.getElementById("comments-" + cd.ids).contentDocument.location.reload();
+             
+                    // unmask?? 
+                }
+            }
+            
+            
+             
+        });
+            // simple array store
+        var ctypes = new Roo.data.SimpleStore({
+            fields: ['value'],
+            data : [
+                [ "General Comment" ],
+                [ "Example Code" ],
+                [ "Introduction" ],
+                [ "Bug" ]
+            ]
+        });
+        
+       this.form.add( 
+             
+          
+                new Roo.form.TextField({
+                    fieldLabel: 'Your Name',
+                    name: 'comment[author]',
+                    width: 300,
+                    allowBlank:false,
+                    autoCreate: {tag: "input", type: "text", size: "20", autocomplete: "on"} 
+                }),
+                new Roo.form.TextField({
+                    fieldLabel: 'Your Email address',
+                    name: 'comment[email]',
+                    width: 300,
+                    allowBlank:false,
+                    vtype: "email",
+                    autoCreate: {tag: "input", type: "text", size: "20", autocomplete: "on"} 
+                    
+                }),
+                new Roo.form.TextField({
+                    fieldLabel: 'Your Web site (optional)',
+                    name: 'comment[url]',
+                    width: 300,
+                    allowBlank:true,
+                    vtype: "url"
+                }),
+                new Roo.form.ComboBox({
+                    fieldLabel: 'Type of Comment',
+                    name: 'comment[title]',
+                    editable: false,
+                    forceSelection: true,
+                    store: ctypes,
+                    displayField:'value',
+                    typeAhead: false,
+                    mode: 'local',
+                    triggerAction: 'all',
+                    defaultValue: "General Comment",
+                    allowBlank:false,
+                    selectOnFocus:true
+                    
+                }),
+                new Roo.form.TextArea({
+                    fieldLabel: 'Comment',
+                    name: 'comment[body]',
+                    width:300,
+                    growMin:200,
+                    grow: true,
+                    allowBlank:false
+                }),
+                new Roo.form.Hidden({
+                    name: 'comment[wikifile]',
+                    value : ''
+                }),
+                new Roo.form.Hidden({
+                    name: 'jsonRequest',
+                    value : 'yes'
+                })
+                
+                
+        );
+        
+        
+        var ef = layout.getEl().createChild({tag: 'div', style: 'margin: 5px'});
+        ef.dom.style.margin = 10;
+        ef.dom.style.position = "fixed";
+             
+            //console.log("form container");
+            //console.log(ef);
+            
+            
+        
+        var vp = layout.add('center', new Roo.ContentPanel(ef, {
+            autoCreate : true,
+            fitToFrame:true
+        }));
+        
+        this.form.render(ef.dom);
+       
+       
+        
+    
+    },
+    submit: function()
+    {
+        
+        
+        var cd = typeof(CommentDialog) == "undefined" ? parent.CommentDialog : CommentDialog;
+        if (!cd.form.isValid()) {
+            Roo.MessageBox.alert("Error", "Please Fill in all the details");
+            return;
+        }
+        var p = cd.form.getValues();
+        
+        var mb = typeof(MainBody) == "undefined" ? parent.MainBody : MainBody;
+        
+        mb.cookie.set("comment[author]", p["comment[author]"]);
+        mb.cookie.set("comment[email]", p["comment[email]"]);
+        mb.cookie.set("comment[url]", p["comment[url]"]);
+        cd.dialog.el.mask("Saving Data");    
+        
+        
+        cd.form.doAction('submit', {
+                url: '/blog.php/GtkDjsComments/' + cd.ids + '.html',
+                method: 'POST'
+        });
+        
+        
+         
+        
+    },
+    hide : function()
+    {
+        
+        if (Roo.isSafari) {
+            Roo.get(document.getElementsByTagName('iframe')[0]).setVisible(true);  
+        }
+        this.dialog.hide();
+    }
+        
+        
+       
+    
+}
+
+     
+     
+     
+     
+     
\ No newline at end of file
diff --git a/buildSDK/doc_templates/static/header.html b/buildSDK/doc_templates/static/header.html
new file mode 100644 (file)
index 0000000..353b735
--- /dev/null
@@ -0,0 +1,2 @@
+<div id="header">
+</div>
\ No newline at end of file
diff --git a/buildSDK/doc_templates/static/index.html b/buildSDK/doc_templates/static/index.html
new file mode 100644 (file)
index 0000000..59eb3c3
--- /dev/null
@@ -0,0 +1,32 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Frameset//EN"
+        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+       <meta http-equiv="content-type" content="text/html; charset=utf-8" />
+       <title>Generated Javascript Documentation</title>
+</head>
+
+
+<html>
+<head>
+  <title>RooJS (1) - Manual</title>
+       <link rel="stylesheet" type="text/css" href="http://www.akbkhome.com/extjs/resources/css/ext-all.css" />
+
+    
+    <link rel="stylesheet" type="text/css" href="http://www.akbkhome.com/extjs/resources/css/ytheme-aero.css" /><!-- LIBS -->     
+    <script type="text/javascript" src="http://www.akbkhome.com/extjs/adapter/yui/yui-utilities.js"></script>     
+    <script type="text/javascript" src="http://www.akbkhome.com/extjs/adapter/yui/ext-yui-adapter.js"></script>     <!-- ENDLIBS -->
+
+    <script type="text/javascript" src="http://www.akbkhome.com/extjs/ext-all.js"></script>
+    <script type="text/javascript" src="./doc.js"></script>
+<link rel="stylesheet" type="text/css" href="./default.css" />
+
+<script type="text/javascript">
+   
+    
+var baseURL = ".";   
+Ext.BLANK_IMAGE_URL =  "http://www.akbkhome.com/extjs/resources/images/gray/s.gif";
+</script>
+</html>
\ No newline at end of file
diff --git a/buildSDK/doc_templates/static/page.js b/buildSDK/doc_templates/static/page.js
new file mode 100644 (file)
index 0000000..3f27f9d
--- /dev/null
@@ -0,0 +1,242 @@
+//<script type="text/javascript">
+/* -- IE kludge as usual! */
+if (!Array.prototype.indexOf)
+{
+  Array.prototype.indexOf = function(elt /*, from*/)
+  {
+    var len = this.length;
+
+    var from = Number(arguments[1]) || 0;
+    from = (from < 0)
+         ? Math.ceil(from)
+         : Math.floor(from);
+    if (from < 0)
+      from += len;
+
+    for (; from < len; from++)
+    {
+      if (from in this &&
+          this[from] === elt)
+        return from;
+    }
+    return -1;
+  };
+}
+
+
+
+RooDocsPage = {
+    
+    isIE: function() {
+        var ua = navigator.userAgent.toLowerCase();
+        return ua.indexOf("msie") > -1;
+        
+    },
+    
+    
+    onload : function()
+    {
+        //console.log("loading");
+        
+        this.addEvent(document,'click', function(e) {
+            var ev = e || window.event;
+            var t = ev.target || ev.srcElement;
+            //console.log(t);
+            return RooDocsPage.clicked(t);
+            
+        });
+        
+        
+        
+    },
+    addEvent: function(el, eventName, fn)
+    {
+        
+        if (window.addEventListener) {
+            capture = false;
+            el.addEventListener(eventName, fn, (capture));
+            return;
+        } 
+        if (window.attachEvent) {
+            el.attachEvent("on" + eventName, fn);
+            return;
+         
+        }
+    },
+    clicked : function(t)
+    {
+        
+        
+        var classAr = t.className.split(' ');
+        //console.log(classAr)
+        if ((t.nodeName == 'a') && (classAr.indexOf('exi') < 0) && (classAr.indexOf('micon') < 0)) {
+            // link clicked...
+            return false;
+            /*
+            var cls  = this.getAttributeNS(t,'roo', 'cls');
+            if (cls) {
+                
+                var member = this.getAttributeNS(t,'roo', 'member');
+                //this.loadClass(target.href, cls, member);
+                
+                if (/^src\//.test(cls)) {
+                    cls = cls.replace(/.js$/, ''); // get rid of .js for source links..
+                }
+                
+                
+                document.location = "symbols/"+ cls +".html";
+                return;
+            }
+            */
+        }
+            
+           
+        
+        
+        if (classAr.indexOf('exi') > -1 || classAr.indexOf('micon') > -1) {
+            
+            var tr = t;
+            //console.log(tr.parentNode);
+            while (tr.parentNode) {
+                ///console.log(tr.nodeName);
+                if (tr.nodeName.toUpperCase() =='TR') {
+                    break;
+                }
+                tr = tr.parentNode;
+            }
+            if (tr.nodeName.toUpperCase() != 'TR') { // no tr!
+                return false;
+            }
+            //console.log(tr.className)
+            if (tr.className.match(/expandable/)) {
+                
+                if (!/expanded/.test(tr.className)) {
+                    
+                    tr.className += " expanded";
+                    
+                    this.loadComments(tr);
+                    
+                  //  console.log("ADDED:"+ tr.className);
+                } else {
+                    tr.className = tr.className.replace(/ expanded/,'');
+                    //console.log("REMOVED:"+ tr.className);
+                }
+            }
+            return true;
+            
+            
+            
+        }
+        return false;
+    },
+    
+    getAttributeNS : function(d,ns,name) {
+        if (this.isIE()) {
+            // ie uses attribute stuff...
+            var type = typeof d[ns+":"+name];
+            if(type != 'undefined' && type != 'unknown'){
+                return d[ns+":"+name];
+            }
+            return d[name];
+            
+        } 
+        return d.getAttributeNS(ns, name) || d.getAttribute(ns+":"+name) || d.getAttribute(name) || d[name];
+    },
+    loadComments: function(tr)
+    {
+        // first look for  'a' tag with id -
+        var a_s = tr.getElementsByTagName('a');
+        
+        if (a_s.length < 2) return; 
+        var id = a_s[1].getAttribute('id');
+        
+        
+        
+        // then see if we have a comment-{id}
+        
+        if (document.getElementById('comments-' + id)) {
+            // we already have it... assume it's loaded and does not need refeshing...
+            return;
+        }
+        
+        // then if not create it....
+        var div_s = tr.getElementsByTagName('div');
+        var pdiv = false;
+        for (var i=0;i<div_s.length;i++) {
+            
+            if (div_s[i].className != "long") {
+                continue
+            }
+            pdiv = div_s[i].parentNode; // parent of the <div class="long"
+            
+        }
+        if (!pdiv) { // we dont have a parent to add it to...
+            return; 
+        }
+        
+        var cdiv = document.createElement("div");
+        cdiv.className = "comments";
+        var cb = document.createElement("b");
+        cb.appendChild(document.createTextNode("Element Comment / Notes"));
+        cdiv.appendChild(cb);
+        cdiv.appendChild(document.createTextNode(" => "));
+        var cu = document.createElement("u");
+        cu.appendChild(document.createTextNode("[Add Your comment/notes about this element]"));
+        
+        cu.setAttribute("onclick", "parent.CommentDialog.showCommentId = '" +   id  + "';");
+        cdiv.appendChild(cu);
+        cdiv.appendChild(document.createElement("br"));
+        var ciframe = document.createElement("iframe");
+        ciframe.setAttribute('height', '50');
+        ciframe.setAttribute('frameborder', '50');
+        ciframe.setAttribute('src', '/blog.php/GtkDjsComments/' + id + '.html');
+        ciframe.setAttribute('style', 'border: medium none ; width: 100%;');
+        ciframe.setAttribute('id', 'comments-' + id);
+        cdiv.appendChild(ciframe);
+        pdiv.appendChild(cdiv);
+        
+    }
+    
+    
+}
+
+
+ /*
+this.preview.getEl().on('click', function(e, target)
+        {
+            //console.log("click pressed?");
+            
+            if(target = e.getTarget('a:not(.exi)', 3)) {
+                var cls = Ext.fly(target).getAttributeNS('roo', 'cls');
+                e.stopEvent();
+                if(cls){
+                    var member = Ext.fly(target).getAttributeNS('roo', 'member');
+                    //this.loadClass(target.href, cls, member);
+                    
+                    if (/^src\//.test(cls)) {
+                        cls = cls.replace(/.js$/, ''); // get rid of .js for source links..
+                    }
+                    
+                    
+                    MainBody.loadPage("symbols/"+ cls +".html");
+                    return;
+                }
+                if(target.className == 'inner-link'){ // go to #
+                    this.getActiveTab().scrollToSection(target.href.split('#')[1]);
+                    return;
+                }
+                window.open(target.href);
+                
+                return; // no more...
+            }
+            if(target = e.getTarget('.micon', 2)){
+                
+                e.stopEvent();
+                var tr = Ext.fly(target.parentNode);
+                if(tr.hasClass('expandable')){
+                    tr.toggleClass('expanded');
+                }
+            }
+          
+        });
+*/
\ No newline at end of file
diff --git a/buildSDK/doc_templates/symbol.tmpl b/buildSDK/doc_templates/symbol.tmpl
new file mode 100644 (file)
index 0000000..f8f4bd1
--- /dev/null
@@ -0,0 +1,35 @@
+<symbol alias="{+data.alias+}">
+       <name>{+data.name+}</name>
+       <memberOf>{+data.memberOf+}</memberOf>
+       <isStatic>{+data.isStatic+}</isStatic>
+       <isa>{+data.isa+}</isa>
+       <desc>{+data.desc+}</desc>
+       <classDesc>{+data.classDesc+}</classDesc>
+       
+       <methods><for each="method" in="data.methods">
+               <method>
+                       <name>{+method.name+}</name>
+                       <memberOf>{+method.memberOf+}</memberOf>
+                       <isStatic>{+method.isStatic+}</isStatic>
+                       <desc>{+method.desc+}</desc>
+                       <params><for each="param" in="method.params">
+                               <param>
+                                       <type>{+param.type+}</type>
+                                       <name>{+param.name+}</name>
+                                       <desc>{+param.desc+}</desc>
+                                       <defaultValue>{+param.defaultValue+}</defaultValue>
+                               </param></for>
+                       </params>
+               </method></for>
+       </methods>
+       
+       <properties><for each="property" in="data.properties">
+               <property>
+                       <name>{+property.name+}</name>
+                       <memberOf>{+property.memberOf+}</memberOf>
+                       <isStatic>{+property.isStatic+}</isStatic>
+                       <desc>{+property.desc+}</desc>
+                       <type>{+property.type+}</type>
+               </property></for>
+       </properties>
+</symbol>
diff --git a/buildSDK/docs_build.js b/buildSDK/docs_build.js
new file mode 100644 (file)
index 0000000..3d0697d
--- /dev/null
@@ -0,0 +1,81 @@
+//<script type="text/javascript">
+
+/**
+ * @version $Id: main.js 570 2008-04-07 23:54:50Z micmath $
+ * 
+ * 
+ * Usage:
+ * 
+ * - in the top level directory.
+ * roolite -L/path/to/rooscript/examples/jstoolkit buildSDK/docs_build.js
+ * 
+ * 
+ * 
+ * 
+ */
+
+
+
+include "lib/JSDOC.js";
+//include "frame/Opt.js";
+
+
+var cwd = File.getcwd();
+
+if (!File.exists(cwd+'/Roo.js')) {
+    throw "needs to be run from the same directory as Roo.js";
+}
+       // configure it!!! -- see buildDocs.js in the rooscript/jstookit/exammples directory..
+    
+JSDOC.build(
+    {
+        _ : [ "Roo.js", "Array.js", "Date.js" , "Function.js" , "Number.js", "String.js", "Roo" ],
+        // these are commented out for test builds
+        //_ : [         "Roo.js",  "Roo/Component.js", "Roo/util/Observable.js", "Roo/DatePicker.js", "Roo/data/Connection.js", "Roo/BasicLayoutRegion.js",
+        //    "Roo/form/Action.js" , "Roo/grid/GridEditor.js", "Roo/Editor.js"   ],
+        //_ : [   "Roo/form/BasicForm.js" ],
+        //_ : [         "Roo.js"],
+        t : cwd + "/buildSDK/doc_templates/", // fixme - I think we should move doc templates to here...
+        r : true,
+        d : cwd + '/docs/',
+        v : true,
+        
+        //C: true, // true = disable caching.
+        C: false, // true = disable caching.
+        
+        c: false,
+        x: false,
+        p: false,
+        a: false,
+        e: '',
+        n: false,
+        o: false,
+        s: false,
+        T: false,
+        h: false,
+        D: [],
+        H: [],
+         
+        usage : function()
+        {
+            throw "oops - something has gone wrong";
+        },
+        LOG : {
+            warn : function(str) {
+                println("Warn: " +str );
+            },
+            inform : function(str) {
+                println("Inform: " +str );
+            },
+            close : function() { },
+            flush : function() { },
+            out: false,
+            warnings : [],
+            verbose : false
+                
+        }
+        
+    }
+);
diff --git a/buildSDK/doctree.txt b/buildSDK/doctree.txt
new file mode 100644 (file)
index 0000000..37c9cb3
--- /dev/null
@@ -0,0 +1,167 @@
+
+1. RooJS1 Core
+    1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.html - Main Roo Utils]
+    1. Dom/CSS/Text/JSON
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.util.CSS.html Roo.util.CSS]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.util.Format.html Roo.util.Format]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.util.TextMetrics.html Roo.util.TextMetrics]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.data.JSON.html Roo.data.JSON]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.DomHelper.html Roo.DomHelper]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.DomQuery.html Roo.DomQuery]
+    1. Element/Selection
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.Element.html Roo.Element]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.CompositeElement.html Roo.CompositeElement]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.CompositeElementLite.html Roo.CompositeElementLite]
+    1. Effects / Masks / Tips
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.Fx.html Roo.Fx]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.LoadMask.html Roo.LoadMask]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.QuickTips.html Roo.QuickTips]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.Resizable.html Roo.Resizable]
+    1. State
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.state.CookieProvider.html Roo.state.CookieProvider]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.state.Manager.html Roo.state.Manager]
+    1. DragDrop
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.dd.DD.html Roo.dd.DD]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.dd.DDProxy.html Roo.dd.DDProxy]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.dd.DDTarget.html Roo.dd.DDTarget]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.dd.DragDrop.html Roo.dd.DragDrop]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.dd.DragDropMgr.html Roo.dd.DragDropMgr]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.dd.DragZone.html Roo.dd.DragZone]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.dd.DropTarget.html Roo.dd.DropTarget]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.dd.DropZone.html Roo.dd.DropZone]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.dd.Registry.html Roo.dd.Registry]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.dd.ScrollManager.html Roo.dd.ScrollManager]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.dd.StatusProxy.html Roo.dd.StatusProxy]
+    1. Signals / Events
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.util.Observable.html Roo.util.Observable]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.util.DelayedTask.html Roo.util.DelayedTask]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.util.TaskRunner.html Roo.util.TaskRunner]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.EventObject.html Roo.EventObject]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.Shadow.html Roo.Shadow]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.util.ClickRepeater.html Roo.util.ClickRepeater]
+    1. AJAX
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.data.Connection.html Roo.data.Connection]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.Ajax.html Roo.Ajax]
+    1. Store
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.util.MixedCollection.html Roo.util.MixedCollection]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.data.JsonStore.html Roo.data.JsonStore]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.data.Store.html Roo.data.Store]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.data.SimpleStore.html Roo.data.SimpleStore]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.data.Record.html Roo.data.Record]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.data.SortTypes.html Roo.data.SortTypes]
+    1. DataReaders
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.data.ArrayReader.html Roo.data.ArrayReader]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.data.DataReader.html Roo.data.DataReader]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.data.JsonReader.html Roo.data.JsonReader]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.data.XmlReader.html Roo.data.XmlReader]
+    1. DataProxies
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.data.DataProxy.html Roo.data.DataProxy]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.data.HttpProxy.html Roo.data.HttpProxy]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.data.MemoryProxy.html Roo.data.MemoryProxy]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.data.ScriptTagProxy.html Roo.data.ScriptTagProxy]
+    1. TreeData
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.data.Node.html Roo.data.Node]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.data.Tree.html Roo.data.Tree]
+    1. Keys
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.KeyMap.html Roo.KeyMap]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.KeyNav.html Roo.KeyNav]
+    1. Managers
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.ComponentMgr.html Roo.ComponentMgr]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.DialogManager.html Roo.DialogManager]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.EventManager.html Roo.EventManager]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.LayoutManager.html Roo.LayoutManager]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.UpdateManager.html Roo.UpdateManager]
+    1. Templates
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.MasterTemplate.html Roo.MasterTemplate]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.Template.html Roo.Template]
+1. Widgets
+      1. Hierachy /roojs1/docs/hierachy.html
+      1. Gallery http://www.roojs.com/trac/wiki/RooJS1/Gallery
+      1. Windows
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.BasicDialog.html Roo.BasicDialog]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.LayoutDialog.html Roo.LayoutDialog]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.MessageBox.html Roo.MessageBox]
+      1. Buttons
+        1. Button
+        1. SplitButton
+      1. Form / Entry
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.form.Action.html Roo.form.Action]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.form.BasicForm.html Roo.form.BasicForm]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.form.Checkbox.html Roo.form.Checkbox]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.form.Column.html Roo.form.Column]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.form.ComboBox.html Roo.form.ComboBox]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.form.DateField.html Roo.form.DateField]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.form.FieldSet.html Roo.form.FieldSet]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.form.Form.html Roo.form.Form]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.form.HtmlEditor.html Roo.form.HtmlEditor]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.form.NumberField.html Roo.form.NumberField]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.form.Radio.html Roo.form.Radio]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.form.TextArea.html Roo.form.TextArea]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.form.TextField.html Roo.form.TextField]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.form.VTypes.html Roo.form.VTypes]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.DatePicker.html Roo.DatePicker]
+    1. Tree
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.tree.TreePanel.html Roo.tree.TreePanel]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.tree.TreeEditor.html Roo.tree.TreeEditor]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.tree.AsyncTreeNode.html Roo.tree.AsyncTreeNode]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.tree.TreeNode.html Roo.tree.TreeNode]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.tree.TreeFilter.html Roo.tree.TreeFilter]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.tree.TreeLoader.html Roo.tree.TreeLoader]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.tree.TreeSorter.html Roo.tree.TreeSorter]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.tree.DefaultSelectionModel.html Roo.tree.DefaultSelectionModel]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.tree.MultiSelectionModel.html Roo.tree.MultiSelectionModel]
+    1. Grid
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.grid.GridPanel.html Roo.grid.GridPanel]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.grid.CellSelectionModel.html Roo.grid.CellSelectionModel]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.grid.RowSelectionModel.html Roo.grid.RowSelectionModel]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.grid.ColumnModel.html Roo.grid.ColumnModel]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.grid.EditorGrid.html Roo.grid.EditorGrid]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.grid.Grid.html Roo.grid.Grid]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.grid.GridEditor.html Roo.grid.GridEditor]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.grid.GridView.html Roo.grid.GridView]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.PagingToolbar.html Roo.PagingToolbar]
+    1. Menu / Toolbars
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.menu.CheckItem.html Roo.menu.CheckItem]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.menu.ColorItem.html Roo.menu.ColorItem]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.menu.DateItem.html Roo.menu.DateItem]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.menu.DateMenu.html Roo.menu.DateMenu]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.menu.Menu.html Roo.menu.Menu]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.menu.MenuMgr.html Roo.menu.MenuMgr]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.menu.Separator.html Roo.menu.Separator]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.menu.TextItem.html Roo.menu.TextItem]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.Toolbar.html Roo.Toolbar]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.Toolbar.Button.html Roo.Toolbar.Button]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.Toolbar.Fill.html Roo.Toolbar.Fill]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.Toolbar.Separator.html Roo.Toolbar.Separator]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.Toolbar.Spacer.html Roo.Toolbar.Spacer]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.Toolbar.SplitButton.html Roo.Toolbar.SplitButton]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.Toolbar.TextItem.html Roo.Toolbar.TextItem]
+    1. View / Layers
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.JsonView.html Roo.JsonView]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.Layer.html Roo.Layer]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.View.html Roo.View]
+    1. Layout
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.BasicLayoutRegion.html Roo.BasicLayoutRegion]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.BorderRegion.html Roo.BorderRegion]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.ContentPanel.html Roo.ContentPanel]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.LayoutRegion.html Roo.LayoutRegion]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.NestedLayoutPanel.html Roo.NestedLayoutPanel]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.ReaderLayout.html Roo.ReaderLayout]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.SplitBar.html Roo.SplitBar]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.SplitLayoutRegion.html Roo.SplitLayoutRegion]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.TabPanel.html Roo.TabPanel]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.TabPanelItem.html Roo.TabPanelItem]
+Abstract Base Clases
+    1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.BoxComponent.html Roo.BoxComponent]
+    1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.Component.html Roo.Component]
+    1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.form.Field.html Roo.form.Field]
+    1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.form.Layout.html Roo.form.Layout]
+    1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.form.TriggerField.html Roo.form.TriggerField]
+    1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.grid.AbstractGridView.html Roo.grid.AbstractGridView]
+    1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.grid.AbstractSelectionModel.html Roo.grid.AbstractSelectionModel]
+    1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.menu.Adapter.html Roo.menu.Adapter]
+    1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.menu.BaseItem.html Roo.menu.BaseItem]
+    1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.menu.Item.html Roo.menu.Item] ??
+    1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.state.Provider.html Roo.state.Provider]
+    1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.Editor.html Roo.Editor]
+    1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.Toolbar.Item.html Roo.Toolbar.Item]
diff --git a/buildSDK/indexPage.html b/buildSDK/indexPage.html
new file mode 100644 (file)
index 0000000..381bd65
--- /dev/null
@@ -0,0 +1,303 @@
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+       <meta http-equiv="content-type" content="text/html; charset=utf-8" />
+       <title>RooJS(1) Generated Documentation</title>
+</head>
+
+
+<html>
+<head>
+  <title>RooJS (1) - Manual</title>
+
+    
+    <style>
+   body, table, td {
+       font:normal 11px tahoma,arial,helvetica,sans-serif;
+      }
+    
+    
+    </style>
+<a href="http://www.akbkhome.com/roojs1/docs" target="_top"><h1>  View Documentation Interface  </h1></a>
+<h3>  Download Latest Release <a href="http://devel.akbkhome.com/roojs1-current.tgz">roojs1-current.tgz</a></h3>
+
+<h3 id="toc0"> RooJS1 Documentation Contents</h3>
+<TABLE><TR><TD valign="top">
+
+<ul>
+    <li><a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.html" >Roo</a> Core Class - Essential Reading</li>
+    <li><b> Dom / CSS / Text</b><ul>
+        <li>Roo.util.<a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.util.CSS.html" >CSS</a></li>
+        <li>Roo.util.<a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.util.Format.html" >Format</a> Various Text Formating / Encoding</li>
+        <li>Roo.<a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.DomHelper.html" >DomHelper</a> DOM creation </li>
+        <li>Roo.<a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.DomQuery.html" >DomQuery</a> DOM locating elements</li>
+        <li>Roo.util.<a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.util.TextMetrics.html" >TextMetrics</a> Text size calculations</li>
+    </ul></li>
+    <li><b>Element / Selection</b><ul>
+        <li>Roo.<a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.Element.html" >Element</a> Core Element methods (see also Roo.get())</li>
+        <li>Roo.<a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.CompositeElement.html" >CompositeElement</a></li>
+        <li>Roo.<a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.CompositeElementLite.html" >CompositeElementLite</a></li>
+    </ul></li>
+    <li><b>Effects / Masks / Tips</b><ul>
+        <li>Roo.<a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.Fx.html" >Fx</a></li>
+        <li>Roo.<a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.LoadMask.html" >LoadMask</a></li>
+        <li>Roo.<a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.QuickTips.html" >QuickTips</a></li>
+        <li>Roo.<a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.Resizable.html" >Resizable</a></li>
+        <li><b>Examples</b><ul>
+                <li><a href="http://www.akbkhome.com/roojs1/examples/resizable/basic.html" >Resizing elements</a> With animation, snapping etc. (Works, needs a few replacement images)</li>
+        </ul></li>
+    </ul></li>
+</ul>
+
+<ul>
+    <li><b>State</b><ul>
+                    <li>Roo.state.<a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.state.CookieProvider.html" >CookieProvider</a></li>
+    </ul></li>
+</ul>
+
+<ul>
+    <li><b>Drag and Drop</b><ul>
+        <li><a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.dd.DD.html" >Roo.dd.DD</a></li>
+        <li><a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.dd.DDProxy.html" >Roo.dd.DDProxy</a></li>
+        <li><a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.dd.DDTarget.html" >Roo.dd.DDTarget</a></li>
+        <li><a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.dd.DragDrop.html" >Roo.dd.DragDrop</a></li>
+        <li><a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.dd.DragDropMgr.html" >Roo.dd.DragDropMgr</a></li>
+        <li><a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.dd.DragZone.html" >Roo.dd.DragZone</a></li>
+        <li><a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.dd.DropTarget.html" >Roo.dd.DropTarget</a></li>
+        <li><a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.dd.DropZone.html" >Roo.dd.DropZone</a></li>
+        <li><a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.dd.Registry.html" >Roo.dd.Registry</a></li>
+        <li><a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.dd.ScrollManager.html" >Roo.dd.ScrollManager</a></li>
+        <li><a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.dd.StatusProxy.html" >Roo.dd.StatusProxy</a></li>
+    </ul></li>
+    <li><b>Signals / Events</b><ul>
+        <li><a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.util.Observable.html" >Roo.util.Observable</a></li>
+        <li><a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.util.DelayedTask.html" >Roo.util.DelayedTask</a></li>
+        <li><a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.util.TaskRunner.html" >Roo.util.TaskRunner</a></li>
+        <li><a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.EventObject.html" >Roo.EventObject</a></li>
+        <li><a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.Shadow.html" >Roo.Shadow</a></li>
+        <li><a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.util.ClickRepeater.html" >Roo.util.ClickRepeater</a></li>
+    </ul></li>
+    <li><b>AJAX</b><ul>
+        <li><a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.data.Connection.html" >Roo.data.Connection</a></li>
+        <li><a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.Ajax.html" >Roo.Ajax</a></li>
+    </ul></li>
+    <li><b>Store</b><ul>
+        <li><a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.util.MixedCollection.html" >Roo.util.MixedCollection</a></li>
+        <li><a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.data.JsonStore.html" >Roo.data.JsonStore</a></li>
+        <li><a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.data.Store.html" >Roo.data.Store</a></li>
+        <li><a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.data.SimpleStore.html" >Roo.data.SimpleStore</a></li>
+        <li><a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.data.Record.html" >Roo.data.Record</a></li>
+        <li><a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.data.SortTypes.html" >Roo.data.SortTypes</a></li>
+    </ul></li>
+    <li><b>Data Readers</b><ul>
+        <li><a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.data.ArrayReader.html" >Roo.data.ArrayReader</a></li>
+        <li><a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.data.DataReader.html" >Roo.data.DataReader</a></li>
+        <li><a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.data.JsonReader.html" >Roo.data.JsonReader</a></li>
+        <li><a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.data.XmlReader.html" >Roo.data.XmlReader</a></li>
+    </ul></li>
+    <li><b>Data Proxies</b><ul>
+        <li><a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.data.DataProxy.html" >Roo.data.DataProxy</a></li>
+        <li><a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.data.HttpProxy.html" >Roo.data.HttpProxy</a></li>
+        <li><a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.data.MemoryProxy.html" >Roo.data.MemoryProxy</a></li>
+        <li><a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.data.ScriptTagProxy.html" >Roo.data.ScriptTagProxy</a></li>
+    </ul></li>
+    <li><b>Tree Data</b><ul>
+        <li><a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.data.Node.html" >Roo.data.Node</a></li>
+        <li><a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.data.Tree.html" >Roo.data.Tree</a></li>
+    </ul></li>
+    <li><b>Keys</b><ul>
+        <li><a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.KeyMap.html" >Roo.KeyMap</a></li>
+        <li><a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.KeyNav.html" >Roo.KeyNav</a></li>
+    </ul></li>
+    <li><b>Managers</b><ul>
+        <li><a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.ComponentMgr.html" >Roo.ComponentMgr</a></li>
+        <li><a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.DialogManager.html" >Roo.DialogManager</a></li>
+        <li><a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.EventManager.html" >Roo.EventManager</a></li>
+        <li><a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.LayoutManager.html" >Roo.LayoutManager</a></li>
+        <li><a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.UpdateManager.html" >Roo.UpdateManager</a></li>
+        <li><a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.state.Manager.html" >Roo.state.Manager</a></li>
+    </ul></li>
+    <li><b>Templates</b><ul>
+        <li><a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.MasterTemplate.html" >Roo.MasterTemplate</a></li>
+        <li><a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.Template.html" >Roo.Template</a></li>
+    </ul></li>
+</ul>
+
+<p><br />
+<b>Abstract Base Classes</b></p>
+
+<ul>
+    <li><a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.BoxComponent.html" >Roo.BoxComponent</a></li>
+    <li><a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.Component.html" >Roo.Component</a></li>
+    <li><a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.form.Field.html" >Roo.form.Field</a></li>
+    <li><a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.form.Layout.html" >Roo.form.Layout</a></li>
+    <li><a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.form.TriggerField.html" >Roo.form.TriggerField</a></li>
+    <li><a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.grid.AbstractGridView.html" >Roo.grid.AbstractGridView</a></li>
+    <li><a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.grid.AbstractSelectionModel.html" >Roo.grid.AbstractSelectionModel</a></li>
+    <li><a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.menu.Adapter.html" >Roo.menu.Adapter</a></li>
+    <li><a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.menu.BaseItem.html" >Roo.menu.BaseItem</a></li>
+    <li><a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.menu.Item.html" >Roo.menu.Item</a> </li>
+    <li><a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.state.Provider.html" >Roo.state.Provider</a></li>
+    <li><a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.Editor.html" >Roo.Editor</a></li>
+    <li><a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.Toolbar.Item.html" >Roo.Toolbar.Item</a></li>
+</ul>
+
+</TD><TD valign="top">
+ <p><b>Widgets</b></p>
+
+<ul>
+    <li><a href="http://www.roojs.com/trac/wiki/RooJS1/Gallery" >Gallery</a></li>
+    <li><b>Windows and Dialogs</b><ul>
+        <li>Roo.<a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.BasicDialog.html" >BasicDialog</a></li>
+        <li>Roo.<a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.LayoutDialog.html" >LayoutDialog</a></li>
+        <li>Roo.<a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.MessageBox.html" >MessageBox</a></li>
+        <li><b>Examples</b><ul>
+            <li><a href="http://www.akbkhome.com/roojs1/examples/dialog/hello.html" >Simple Hello World</a></li>
+            <li><a href="http://www.akbkhome.com/roojs1/examples/dialog/layout.html" >Dialog with Layout</a></li>
+            <li><a href="http://www.akbkhome.com/roojs1/examples/dialog/msg-box.html" >Various Standard Message Boxes</a></li>
+            <li><a href="http://www.akbkhome.com/roojs1/examples/dialog/blog.html" >Simple Blog Post interface</a></li>
+        </ul></li>
+    </ul></li>
+</ul>
+
+<ul>
+    <li><b>Buttons</b><ul>
+        <li>Roo.<a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.Button.html" >Button</a></li>
+        <li>Roo.<a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.SplitButton.html" >SplitButton</a></li>
+    </ul></li>
+    <li><b>Form / Entry</b><ul>
+        <li>Core Form  / Layout<ul>
+            <li>Roo.form.<a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.form.Form.html" >Form</a></li>
+            <li>Roo.form.<a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.form.BasicForm.html" >BasicForm</a></li>
+            <li>Roo.form.<a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.form.Column.html" >Column</a></li>
+            <li>Roo.form.<a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.form.FieldSet.html" >FieldSet</a></li>
+        </ul></li>
+        <li>Form Elements<ul>
+            <li>Roo.form.<a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.form.Hidden.html" >Hidden</a></li>
+            <li>Roo.form.<a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.form.TextField.html" >TextField</a></li>
+            <li>Roo.form.<a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.form.DateField.html" >DateField</a></li>
+            <li>Roo.form.<a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.form.NumberField.html" >NumberField</a> </li>
+            <li>Roo.form.<a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.form.TextArea.html" >TextArea</a></li>
+            <li>Roo.form.<a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.form.Checkbox.html" >Checkbox</a></li>
+            <li>Roo.form.<a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.form.Radio.html" >Radio</a></li>
+            <li>Roo.form.<a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.form.ComboBox.html" >ComboBox</a></li>
+        </ul></li>
+        <li>Html Editor<ul>
+            <li>Roo.form.<a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.form.HtmlEditor.html" >HtmlEditor</a> (broken on IE)</li>
+            <li>Roo.form.<a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.form.FCKeditor.html" >FCKeditor</a> embeded FCKeditor (slow but works)</li>
+        </ul></li>
+        <li>Other<ul>
+            <li>Roo.form.<a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.form.Action.html" >Action</a> What happens when you load and save a form.</li>
+            <li>Roo.form.<a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.form.VTypes.html" >VTypes</a> Various types of Validation for form elements.</li>
+            <li>Roo.<a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.DatePicker.html" >DatePicker</a> Date Picker (not really a form element...)</li>
+        </ul></li>
+        <li><b>Examples</b><ul>
+            <li><a href="http://www.akbkhome.com/roojs1/examples/form/dynamic.html" >Dynamic Forms</a></li>
+            <li><a href="http://www.akbkhome.com/roojs1/examples/form/combos.html" >Combox boxes</a></li>
+            <li><a href="http://www.akbkhome.com/roojs1/examples/form/custom.html" >Custom</a> -  Autocomplete example - (Broken until we sort out a Json callback for trac)</li>
+            <li><a href="http://www.akbkhome.com/roojs1/examples/form/forum-search.html" >Search forum</a> - (Broken until we sort out a Json callback for trac)</li>
+            <li><a href="http://www.akbkhome.com/roojs1/examples/form/xml-form.html" >Form from/to xml</a> </li>
+            <li><a href="http://www.akbkhome.com/roojs1/examples/form/fck.html" >FCK editor example</a></li>
+        </ul></li>
+    </ul></li>
+    <li><b>Tree</b><ul>
+        <li><a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.tree.TreePanel.html" >Roo.tree.TreePanel</a></li>
+        <li><a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.tree.TreeEditor.html" >Roo.tree.TreeEditor</a></li>
+        <li><a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.tree.AsyncTreeNode.html" >Roo.tree.AsyncTreeNode</a></li>
+        <li><a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.tree.TreeNode.html" >Roo.tree.TreeNode</a></li>
+        <li><a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.tree.TreeFilter.html" >Roo.tree.TreeFilter</a></li>
+        <li><a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.tree.TreeLoader.html" >Roo.tree.TreeLoader</a></li>
+        <li><a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.tree.TreeSorter.html" >Roo.tree.TreeSorter</a></li>
+        <li><a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.tree.DefaultSelectionModel.html" >Roo.tree.DefaultSelectionModel</a></li>
+        <li><a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.tree.MultiSelectionModel.html" >Roo.tree.MultiSelectionModel</a></li>
+        <li><b>Examples</b><ul>
+            <li><a href="http://www.akbkhome.com/roojs1/examples/tree/two-trees.html" >Two Trees</a> (need to rename it!)</li>
+            <li><a href="http://www.akbkhome.com/roojs1/examples/tree/reorder.html" >Re-orderable Trees</a></li>
+            <li><a href="http://www.akbkhome.com/roojs1/examples/tree/dependency.html" >The Roo Dependancy tree</a> (needs some css tidy up.)</li>
+            <li><a href="http://www.akbkhome.com/roojs1/examples/tree/organizer.html" >Organizer</a> (needs some css tidy up.)</li>
+        </ul></li>
+    </ul></li>
+</ul>
+
+<ul>
+    <li><b>Grid</b><ul>
+        <li><a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.grid.GridPanel.html" >Roo.grid.GridPanel</a></li>
+        <li><a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.grid.CellSelectionModel.html" >Roo.grid.CellSelectionModel</a></li>
+        <li><a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.grid.RowSelectionModel.html" >Roo.grid.RowSelectionModel</a></li>
+        <li><a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.grid.ColumnModel.html" >Roo.grid.ColumnModel</a></li>
+        <li><a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.grid.EditorGrid.html" >Roo.grid.EditorGrid</a></li>
+        <li><a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.grid.Grid.html" >Roo.grid.Grid</a></li>
+        <li><a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.grid.GridEditor.html" >Roo.grid.GridEditor</a></li>
+        <li><a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.grid.GridView.html" >Roo.grid.GridView</a></li>
+        <li><a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.PagingToolbar.html" >Roo.PagingToolbar</a></li>
+        <li><b>Examples</b><ul>
+            <li><a href="http://www.akbkhome.com/roojs1/examples/grid/array-grid.html" >Grid from Array</a></li>
+            <li><a href="http://www.akbkhome.com/roojs1/examples/grid/custom-grid.html" >Property Grid</a> </li>
+            <li><a href="http://www.akbkhome.com/roojs1/examples/grid/from-markup.html" >Grid from HTML markup</a> IE: css broken</li>
+            <li><a href="http://www.akbkhome.com/roojs1/examples/grid/paging.html" >Paging Grid</a> FF: minor tidy up req, IE: Broken slightly when scrolling.</li>
+            <li><a href="http://www.akbkhome.com/roojs1/examples/grid/edit-grid.html" >Editable Grid</a> </li>
+        </ul></li>
+    </ul></li>
+    <li><b>Menu / Toolbars</b><ul>
+        <li><a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.menu.CheckItem.html" >Roo.menu.CheckItem</a></li>
+        <li><a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.menu.ColorItem.html" >Roo.menu.ColorItem</a></li>
+        <li><a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.menu.DateItem.html" >Roo.menu.DateItem</a></li>
+        <li><a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.menu.DateMenu.html" >Roo.menu.DateMenu</a></li>
+        <li><a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.menu.Menu.html" >Roo.menu.Menu</a></li>
+        <li><a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.menu.MenuMgr.html" >Roo.menu.MenuMgr</a></li>
+        <li><a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.menu.Separator.html" >Roo.menu.Separator</a></li>
+        <li><a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.menu.TextItem.html" >Roo.menu.TextItem</a></li>
+        <li><a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.Toolbar.html" >Roo.Toolbar</a></li>
+        <li><a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.Toolbar.Button.html" >Roo.Toolbar.Button</a></li>
+        <li><a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.Toolbar.Fill.html" >Roo.Toolbar.Fill</a></li>
+        <li><a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.Toolbar.Separator.html" >Roo.Toolbar.Separator</a></li>
+        <li><a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.Toolbar.Spacer.html" >Roo.Toolbar.Spacer</a></li>
+        <li><a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.Toolbar.SplitButton.html" >Roo.Toolbar.SplitButton</a></li>
+        <li><a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.Toolbar.TextItem.html" >Roo.Toolbar.TextItem</a></li>
+        <li><b>Examples</b><ul>
+            <li><a href="http://www.akbkhome.com/roojs1/examples/menu/menus.html" >Toolbar / Menus example</a> Minor css tweaking needed</li>
+        </ul></li>
+    </ul></li>
+</ul>
+
+<ul>
+    <li><b>View / Layers</b><ul>
+        <li><a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.JsonView.html" >Roo.JsonView</a></li>
+        <li><a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.Layer.html" >Roo.Layer</a></li>
+        <li><a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.View.html" >Roo.View</a></li>
+        <li><b>Examples</b><ul>
+            <li><a href="http://www.akbkhome.com/roojs1/examples/view/chooser.html" >Image Chooser</a>  </li>
+        </ul></li>
+    </ul></li>
+</ul>
+
+<ul>
+    <li><b>Layout / Tabs</b><ul>
+        <li><a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.BasicLayoutRegion.html" >Roo.BasicLayoutRegion</a></li>
+        <li><a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.BorderRegion.html" >Roo.BorderRegion</a></li>
+        <li><a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.ContentPanel.html" >Roo.ContentPanel</a></li>
+        <li><a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.LayoutRegion.html" >Roo.LayoutRegion</a></li>
+        <li><a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.NestedLayoutPanel.html" >Roo.NestedLayoutPanel</a></li>
+        <li><a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.ReaderLayout.html" >Roo.ReaderLayout</a></li>
+        <li><a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.SplitBar.html" >Roo.SplitBar</a></li>
+        <li><a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.SplitLayoutRegion.html" >Roo.SplitLayoutRegion</a></li>
+        <li><a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.TabPanel.html" >Roo.TabPanel</a></li>
+        <li><a href="http://www.akbkhome.com/roojs1/docs/symbols/Roo.TabPanelItem.html" >Roo.TabPanelItem</a></li>
+        <li><b>Examples</b><ul>
+            <li><a href="http://www.akbkhome.com/roojs1/examples/layout/simple.html" >Simple Layout</a></li>
+            <li><a href="http://www.akbkhome.com/roojs1/examples/layout/nested.html" >Nested Layout</a> </li>
+            <li><a href="http://www.akbkhome.com/roojs1/examples/layout/complex.html" >Complex Layout</a> Broken - needs converting to Roo JS</li>
+            <li><a href="http://www.akbkhome.com/roojs1/examples/tabs/tabs.html" >Basic Tabs</a> (borders broken on tab boxes)</li>
+            <li><a href="http://www.akbkhome.com/roojs1/examples/tabs/tabs-adv.html" >Advanced Tabs</a> (dynamic adding of tabs)</li>
+        </ul></li>
+    </ul></li>
+</ul>
+
+</TD></TR><TABLE>
+
+
+
+
+
+</body>
+</html>
\ No newline at end of file
diff --git a/buildSDK/logo_ideas.svg b/buildSDK/logo_ideas.svg
new file mode 100644 (file)
index 0000000..32469c0
--- /dev/null
@@ -0,0 +1,282 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:xlink="http://www.w3.org/1999/xlink"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="744.09448819"
+   height="1052.3622047"
+   id="svg2"
+   sodipodi:version="0.32"
+   inkscape:version="0.46"
+   sodipodi:docname="logo_ideas.svg"
+   inkscape:output_extension="org.inkscape.output.svg.inkscape">
+  <defs
+     id="defs4">
+    <inkscape:perspective
+       sodipodi:type="inkscape:persp3d"
+       inkscape:vp_x="0 : 526.18109 : 1"
+       inkscape:vp_y="0 : 1000 : 0"
+       inkscape:vp_z="744.09448 : 526.18109 : 1"
+       inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
+       id="perspective10" />
+    <inkscape:perspective
+       id="perspective2390"
+       inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
+       inkscape:vp_z="744.09448 : 526.18109 : 1"
+       inkscape:vp_y="0 : 1000 : 0"
+       inkscape:vp_x="0 : 526.18109 : 1"
+       sodipodi:type="inkscape:persp3d" />
+    <inkscape:perspective
+       id="perspective3261"
+       inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
+       inkscape:vp_z="744.09448 : 526.18109 : 1"
+       inkscape:vp_y="0 : 1000 : 0"
+       inkscape:vp_x="0 : 526.18109 : 1"
+       sodipodi:type="inkscape:persp3d" />
+  </defs>
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     gridtolerance="10000"
+     guidetolerance="10"
+     objecttolerance="10"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="0.9899495"
+     inkscape:cx="382.92833"
+     inkscape:cy="482.10302"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer2"
+     showgrid="false"
+     inkscape:snap-global="false"
+     inkscape:window-width="949"
+     inkscape:window-height="684"
+     inkscape:window-x="1280"
+     inkscape:window-y="167" />
+  <metadata
+     id="metadata7">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     inkscape:label="Layer 1"
+     inkscape:groupmode="layer"
+     id="layer1"
+     sodipodi:insensitive="true"
+     style="display:none">
+    <image
+       y="116.00504"
+       x="23.57143"
+       id="image2392"
+       height="461.28571"
+       width="676.15167"
+       sodipodi:absref="/home/alan/mailfort/pastedpic_07222008_101014.png"
+       xlink:href="/home/alan/mailfort/pastedpic_07222008_101014.png" />
+  </g>
+  <g
+     inkscape:groupmode="layer"
+     id="layer2"
+     inkscape:label="draw"
+     style="display:inline">
+    <g
+       id="g3199"
+       style="fill:#d45500;stroke:#d45500"
+       transform="matrix(0.464739,0,0,0.4878929,169.50636,-42.156552)">
+      <path
+         id="path3197"
+         d="M 392.44426,366.4686 L 400.52548,374.04475 L 436.89098,389.19704 L 448.50773,390.71227 L 495.47982,393.23765 L 560.12959,321.01174 L 366.68537,282.12087 L 392.44426,366.4686 z"
+         style="fill:#d45500;fill-rule:evenodd;stroke:#d45500;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+      <path
+         sodipodi:nodetypes="cscscsccccc"
+         id="path2399"
+         d="M 602.47812,266.12558 C 602.47812,266.12558 548.72702,321.16473 520.22856,300.80869 C 456.58895,255.35182 455.5788,253.33152 455.5788,253.33152 C 455.5788,253.33152 413.15239,222.01679 348.50263,228.07771 C 283.85287,234.13862 255.56859,278.58533 255.56859,278.58533 C 255.56859,278.58533 151.52288,414.95593 128.28937,426.0676 C 105.05586,437.17928 56.568543,427.07776 56.568543,427.07776 L 82.480622,454.53045 L 139.2357,449.25996 L 303.14752,270.36436 L 554.43754,320.77339"
+         style="fill:#d45500;fill-opacity:1;fill-rule:evenodd;stroke:#d45500;stroke-width:5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+      <path
+         sodipodi:nodetypes="csssss"
+         id="path2401"
+         d="M 81.465214,455.12218 C 81.465214,455.12218 131.31983,458.89756 151.52288,443.74527 C 171.72594,428.59298 261.12443,353.33662 268.1955,346.26555 C 271.73104,342.73002 365.67522,292.98 377.29198,284.39371 C 383.10035,280.10056 323.24881,264.88514 303.2983,269.3677 C 283.34779,273.85025 199.75766,380.86328 203.54573,380.61075"
+         style="fill:#d45500;fill-rule:evenodd;stroke:#d45500;stroke-width:5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+      <path
+         sodipodi:nodetypes="csssccsscccccssssc"
+         id="path2403"
+         d="M 284.98557,326.67527 C 284.98557,326.67527 279.81226,337.17418 285.87317,349.29601 C 291.93409,361.41784 305.06607,366.4686 304.05592,370.50921 C 303.04576,374.54982 277.79195,413.94577 265.67012,422.02699 C 253.54829,430.10821 224.25387,443.2402 224.25387,443.2402 L 223.24371,443.2402 C 223.24371,443.2402 222.23356,485.6666 222.23356,504.8595 C 222.23356,524.0524 216.17264,530.11332 207.08127,531.12347 C 197.9899,532.13362 197.9899,533.14377 197.9899,533.14377 L 214.15234,545.2656 L 249.50768,537.18438 L 250.51783,480.61584 L 250.51783,475.56508 C 250.51783,475.56508 254.55844,464.4534 283.85287,445.2605 C 313.14729,426.0676 351.53309,417.98638 360.62446,408.89501 C 369.71583,399.80364 398.0001,373.53967 398.0001,362.42799 C 398.0001,351.31632 390.92904,298.78838 378.8072,293.73762 C 366.68537,288.68686 368.70568,288.68686 368.70568,288.68686"
+         style="fill:#d45500;fill-rule:evenodd;stroke:#d45500;stroke-width:5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+      <path
+         id="path2405"
+         d="M 394.96965,372.52952 C 394.96965,372.52952 417.193,387.68181 434.36559,391.72242 C 451.53819,395.76303 452.54834,392.73257 452.54834,392.73257"
+         style="fill:#d45500;fill-rule:evenodd;stroke:#d45500;stroke-width:5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+      <path
+         id="path2407"
+         d="M 517.1981,340.20464 C 517.1981,340.20464 513.15749,320.00159 490.93414,326.0625 C 468.71078,332.12342 457.5991,336.16403 454.56865,349.29601 C 451.53819,362.42799 450.52804,388.69196 454.56865,396.77318 C 458.60926,404.8544 466.69048,432.12852 461.63971,434.14882 C 456.58895,436.16913 446.48743,424.0473 446.48743,424.0473"
+         style="fill:#d45500;fill-rule:evenodd;stroke:#d45500;stroke-width:5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+      <path
+         id="path2409"
+         d="M 477.80215,376.57013 C 477.80215,376.57013 483.86307,398.79349 481.84276,408.89501 C 479.82246,418.99654 473.76154,413.94577 475.78185,437.17928 C 477.80215,460.41279 483.86307,461.42294 466.69048,461.42294 C 449.51788,461.42294 439.41636,438.18944 439.41636,438.18944 L 445.47727,422.02699"
+         style="fill:#d45500;fill-rule:evenodd;stroke:#d45500;stroke-width:5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+      <path
+         sodipodi:nodetypes="cssssssssssc"
+         id="path2413"
+         d="M 483.86307,393.74272 C 483.86307,393.74272 519.21841,396.77318 533.36054,392.73257 C 547.50268,388.69196 552.55344,390.71227 565.68543,376.57013 C 578.81741,362.42799 578.81741,363.43815 590.93924,356.36708 C 603.06107,349.29601 597.00015,339.19449 612.15244,344.24525 C 627.30473,349.29601 632.35549,350.30616 639.42656,355.35693 C 646.49763,360.40769 649.52809,365.45845 656.59915,362.42799 C 663.67022,359.39754 669.73114,360.40769 667.71083,346.26555 C 665.69053,332.12342 675.79205,345.2554 660.63976,325.05235 C 645.48748,304.8493 642.45702,292.72747 629.32504,286.66655 C 616.19305,280.60564 610.643,274.0897 606.09153,269.49396 C 603.21163,266.58606 602.14021,265.96106 602.14021,265.96106"
+         style="fill:#d45500;fill-opacity:1;fill-rule:evenodd;stroke:#d45500;stroke-width:5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+      <path
+         id="path2415"
+         d="M 620.23366,280.60564 C 620.23366,280.60564 617.20321,275.55488 625.28443,263.43304 C 633.36565,251.31121 633.36565,247.2706 633.36565,247.2706 L 613.1626,260.40259 L 605.08137,267.47365 L 604.07122,268.48381"
+         style="fill:#d45500;fill-rule:evenodd;stroke:#d45500;stroke-width:5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+      <path
+         id="path2417"
+         d="M 571.74634,248.28076 C 571.74634,248.28076 566.69558,258.38228 570.73619,271.51427 C 574.7768,284.64625 573.76665,284.64625 582.85802,290.70716 C 591.94939,296.76808 600.03061,301.81884 603.06107,296.76808 C 606.09153,291.71732 608.11183,275.55488 600.03061,267.47365 C 591.94939,259.39243 571.74634,250.30106 571.74634,248.28076 z"
+         style="fill:#d45500;fill-opacity:1;fill-rule:evenodd;stroke:#d45500;stroke-width:5;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+      <path
+         transform="translate(-7.1428571,-5.7142857)"
+         d="M 639.28571,316.46933 A 6.7857141,6.9642859 0 1 1 625.71429,316.46933 A 6.7857141,6.9642859 0 1 1 639.28571,316.46933 z"
+         sodipodi:ry="6.9642859"
+         sodipodi:rx="6.7857141"
+         sodipodi:cy="316.46933"
+         sodipodi:cx="632.5"
+         id="path2419"
+         style="opacity:1;fill:#d45500;fill-opacity:1;stroke:#d45500;stroke-width:5;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+         sodipodi:type="arc" />
+    </g>
+    <text
+       xml:space="preserve"
+       style="font-size:84.23834991px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;fill:#550000;fill-opacity:1;stroke:#550000;stroke-width:0.2681025px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Sans;-inkscape-font-specification:Sans Bold"
+       x="202.01106"
+       y="216.93089"
+       id="text3191"
+       sodipodi:linespacing="100%"
+       transform="scale(0.9666105,1.0345429)"><tspan
+         sodipodi:role="line"
+         id="tspan3193"
+         x="202.01106"
+         y="216.93089"
+         style="stroke-width:0.2681025">RooJS</tspan></text>
+    <g
+       id="g3326"
+       transform="matrix(0.4163074,0,0,0.4163074,-163.15532,88.183512)">
+      <path
+         sodipodi:nodetypes="ccccc"
+         id="rect3318"
+         d="M 24.037054,997.20734 L 249.22259,1002.8286 L 251.59867,1234.1014 L 24.037054,1234.1014 L 24.037054,997.20734 z"
+         style="fill:#000000;fill-opacity:1;stroke:#000000;stroke-width:4.08194256;stroke-linecap:round;stroke-miterlimit:4;stroke-dashoffset:0;stroke-opacity:1"
+         transform="matrix(0.7257412,-0.6879678,0.6879678,0.7257412,0,0)" />
+      <path
+         style="fill:#ab8721"
+         d="M 845.5,891.18539 C 843.85,889.2262 841.47597,887.21768 840.22437,886.72201 C 838.97278,886.22634 837.66582,885.0835 837.32003,884.18237 C 836.97423,883.28124 835.41076,881.23397 833.84565,879.63288 C 832.28054,878.0318 831,876.06234 831,875.2563 C 831,874.45026 830.5913,873.79078 830.09178,873.79078 C 828.92941,873.79078 822.16478,867.08745 814.5,858.34029 C 811.2,854.57428 807.0375,849.91597 805.25,847.98849 C 803.4625,846.06101 802,843.87801 802,843.13738 C 802,842.39675 801.49137,841.79078 800.86972,841.79078 C 799.48158,841.79078 786,828.19702 786,826.79733 C 786,826.24373 785.325,825.79078 784.5,825.79078 C 783.675,825.79078 783,825.13161 783,824.32596 C 783,823.52031 782.1,822.37948 781,821.79078 C 779.9,821.20208 779,820.06125 779,819.2556 C 779,818.44995 778.4375,817.75577 777.75,817.71297 C 776.31324,817.62354 765,804.42941 765,802.84321 C 765,802.26437 764.19702,801.79078 763.21561,801.79078 C 762.23419,801.79078 760.64818,800.46521 759.69113,798.84506 C 758.19054,796.30476 747.83309,785.18109 729.37925,766.29078 C 726.69279,763.54078 723.97399,760.12108 723.33748,758.69145 C 722.70096,757.26181 720.75495,755.01181 719.01302,753.69145 C 713.96196,749.86281 705,740.57594 705,739.1704 C 705,738.67269 703.80071,737.37117 702.33492,736.27813 C 699.17096,733.91877 698.5615,733.29587 694,727.75938 C 692.075,725.42293 689.7125,722.79916 688.75,721.92879 C 687.7875,721.05842 687,719.12286 687,717.62756 C 687,716.13225 686.55,714.6307 686,714.29078 C 684.5179,713.37479 684.78822,704.23341 686.41235,700.34631 C 687.18914,698.48718 688.65164,696.01898 689.66235,694.86142 C 694.15244,689.71892 697.12866,686.79078 697.8655,686.79078 C 698.3036,686.79078 699.26412,685.66578 700,684.29078 C 700.73588,682.91578 701.99016,681.79078 702.78729,681.79078 C 704.21225,681.79078 709.95278,676.00775 709.98403,674.54078 C 709.99281,674.12828 710.42954,673.79078 710.95454,673.79078 C 711.47954,673.79078 712.98579,672.77828 714.30176,671.54078 C 715.61773,670.30328 718.65905,667.71578 721.06024,665.79078 C 723.46143,663.86578 726.39429,661.27828 727.5777,660.04078 C 728.7611,658.80328 730.19209,657.79078 730.75768,657.79078 C 731.32327,657.79078 732.05599,657.08726 732.38595,656.2274 C 732.71591,655.36754 733.43905,654.9441 733.99294,655.28641 C 735.31183,656.10153 735.28928,657.79078 733.95951,657.79078 C 732.21729,657.79078 727,662.07844 727,663.51022 C 727,664.24905 726.24976,665.14145 725.33279,665.49332 C 724.41583,665.84519 721.99348,667.85607 719.94981,669.96193 C 717.90614,672.0678 715.84388,673.81162 715.36702,673.83708 C 714.89016,673.86255 713.15,675.64172 711.5,677.79078 C 709.85,679.93984 708.09802,681.71901 707.60672,681.74448 C 707.11541,681.76994 703.65924,684.94346 699.92633,688.79675 C 689.08086,699.99196 686.67998,710.52995 692.77015,720.20682 C 695.15473,723.99576 697.56789,726.69185 712.5,742.24991 C 716.35,746.2613 721.70238,751.96152 724.39418,754.91707 C 727.08598,757.87261 733.52461,764.79078 738.70225,770.29078 C 756.23482,788.91492 759.49386,792.40557 762.56709,795.85161 C 764.25399,797.74316 770.66649,804.79245 776.81709,811.51671 C 782.96769,818.24097 788,824.20347 788,824.76671 C 788,825.32995 788.675,825.79078 789.5,825.79078 C 790.325,825.79078 791.00762,826.12828 791.01694,826.54078 C 791.02626,826.95328 793.09354,829.54078 795.6109,832.29078 C 802.09836,839.3778 813.80231,852.07853 818.43585,857.05967 C 820.60057,859.38678 826.43578,865.79078 831.403,871.29078 C 843.32092,884.48701 846.66806,887.76095 851.75,891.19277 C 854.0875,892.77128 856,894.22658 856,894.42678 C 856,894.62698 854.3125,894.78106 852.25,894.76917 C 849.19342,894.75155 847.94526,894.08887 845.5,891.18539 z M 873,890.79078 C 873,890.24078 873.3977,889.79078 873.88379,889.79078 C 874.36987,889.79078 877.85737,886.83083 881.63379,883.2131 C 901.7241,863.96704 914.49059,851.67291 923.16914,843.21457 C 928.48717,838.03149 933.05959,833.79078 933.33007,833.79078 C 933.60056,833.79078 936.22444,831.31858 939.16093,828.29701 C 942.09742,825.27544 945.07215,822.80044 945.77144,822.79701 C 946.47073,822.79358 947.55546,821.66578 948.18195,820.29078 C 948.80845,818.91578 949.9238,817.79078 950.66052,817.79078 C 951.39723,817.79078 952,817.35661 952,816.82596 C 952,816.29531 952.9,815.37948 954,814.79078 C 955.20305,814.14693 956,814.10329 956,814.68128 C 956,815.95043 946.23787,825.79078 944.9788,825.79078 C 944.44046,825.79078 944,826.27273 944,826.86179 C 944,827.45084 941.67389,830.03834 938.83087,832.61179 C 929.07754,841.44031 923,847.61815 923,848.70394 C 923,849.3017 922.56955,849.79078 922.04346,849.79078 C 921.51736,849.79078 919.15486,851.58517 916.79346,853.77831 C 914.43205,855.97146 911.9375,857.77146 911.25,857.77831 C 910.5625,857.78517 910,858.49976 910,859.3663 C 910,860.9162 897.28242,873.69626 895.6779,873.75876 C 895.22574,873.77637 891.53877,877.21719 887.48463,881.40503 C 879.12756,890.03768 873,894.00822 873,890.79078 z M 857.2536,884.68312 C 853.37775,883.55172 846.03803,876.40506 825.46851,853.73413 C 804.5847,830.71679 799.75661,825.44617 794.37514,819.79078 C 790.97329,816.21578 786.23472,811.08972 783.84498,808.39953 C 781.45524,805.70935 775.62369,799.40935 770.88598,794.39953 C 766.14827,789.38972 760.52327,783.26324 758.38598,780.78513 C 756.24869,778.30702 752.7,774.41288 750.5,772.13148 C 748.3,769.85008 743.125,764.27921 739,759.75177 C 734.875,755.22433 727.86852,747.75426 723.43005,743.15163 C 718.99158,738.549 712.91658,731.88581 709.93005,728.34455 C 706.94352,724.8033 704.05,721.86095 703.5,721.80602 C 701.48906,721.60515 698.13828,714.7457 697.4809,709.4842 C 696.84093,704.36209 696.97972,703.87915 700.15294,700.18613 C 701.99382,698.04369 703.91625,696.11453 704.425,695.89911 C 704.93375,695.6837 706.76809,694.1087 708.50132,692.39911 C 712.8799,688.08026 723.91999,678.45775 725.60557,677.49109 C 726.37251,677.05126 727,676.03876 727,675.24109 C 727,674.44342 727.3375,673.77872 727.75,673.76398 C 728.1625,673.74924 730.975,671.44268 734,668.63829 C 737.025,665.83391 740.5125,662.86921 741.75,662.05008 C 742.9875,661.23096 744,659.93751 744,659.17577 C 744,658.41403 744.37205,657.79078 744.82677,657.79078 C 745.2815,657.79078 747.869,655.72617 750.57677,653.20277 C 753.28455,650.67936 756.49495,647.9391 757.71101,647.11331 C 758.92706,646.28751 760.16388,644.86462 760.4595,643.95132 C 760.75512,643.03802 762.51153,641.26216 764.36264,640.00497 C 766.21375,638.74777 771.14026,634.47277 775.31044,630.50497 C 779.48063,626.53716 784.82926,621.59757 787.1963,619.5281 C 789.56333,617.45862 794.2,613.26626 797.5,610.21173 C 800.8,607.15721 805.42687,603.00042 807.78193,600.97442 C 810.13699,598.94842 816.55277,592.90328 822.03922,587.54078 C 827.52567,582.17828 832.26673,577.79078 832.57491,577.79078 C 832.88309,577.79078 836.70152,574.19078 841.06032,569.79078 C 845.41912,565.39078 849.20334,561.79078 849.4697,561.79078 C 849.73606,561.79078 852.50934,559.31578 855.63255,556.29078 C 859.00356,553.02577 862.20138,550.79078 863.50192,550.79078 C 864.70686,550.79078 867.13297,550.07229 868.89326,549.19414 C 870.89664,548.19472 873.09207,547.84806 874.76264,548.26734 C 878.56294,549.22116 886.38768,555.20693 890.67707,560.44157 C 892.69162,562.90006 899.40744,570.17188 905.6011,576.60117 C 911.79477,583.03045 920.28074,591.89078 924.45882,596.29078 C 928.63689,600.69078 936.99287,609.43777 943.02766,615.72853 C 949.06245,622.0193 954,627.32181 954,627.5119 C 954,627.70199 957.7125,631.59257 962.25,636.15762 C 976.30752,650.3005 997.77332,673.13227 1001.1807,677.56564 C 1002.9667,679.88947 1004.7225,681.79078 1005.0824,681.79078 C 1005.9467,681.79078 1015,690.86004 1015,691.72585 C 1015,692.0954 1018.0375,695.36309 1021.75,698.98737 C 1025.4625,702.61165 1030.2294,707.53758 1032.343,709.93388 C 1035.99,714.06853 1036.1596,714.55824 1035.666,719.53395 C 1035.38,722.41769 1034.2603,726.01769 1033.1778,727.53395 C 1031.1271,730.40655 1021.6583,739.62316 999.01113,760.79078 C 977.85124,780.56826 964.97751,792.70134 958.5,798.97124 C 955.2,802.16547 951.7125,804.78159 950.75,804.78485 C 949.7875,804.78811 949,805.45711 949,806.27151 C 949,807.61887 938.83281,817.86416 922.11077,833.36728 C 918.59669,836.6252 911.35702,843.56578 906.02261,848.79078 C 888.6045,865.85163 872.23942,881.03752 869.34086,882.82942 C 865.55174,885.17185 861.20924,885.83781 857.2536,884.68312 z M 869.24179,860.29078 C 868.92653,854.18588 867.3519,852.79078 860.77665,852.79078 C 856.67113,852.79078 855.80827,853.13265 855.09785,855.04078 C 854.08517,857.76076 854.71086,859.47139 858,862.97529 C 860.05986,865.16964 861.29226,865.60791 865,865.46465 L 869.5,865.29078 L 869.24179,860.29078 z M 946.47792,794.23208 C 948.00188,793.08012 948.21605,792.35685 947.41109,791.08071 C 945.98009,788.8121 944.82705,788.29326 934.5,785.27094 C 919.80614,780.97063 915.5529,779.55931 914.55,778.65109 C 914.0275,778.17792 912.655,777.79078 911.5,777.79078 C 910.345,777.79078 908.9725,777.41949 908.45,776.96569 C 907.9275,776.51188 902.92031,774.67178 897.32292,772.87656 C 887.31797,769.66773 887.11689,769.54214 885.43481,765.45165 C 884.16847,762.37216 883.59616,757.22175 883.23273,745.63422 L 882.74167,729.97766 L 886.44645,723.87894 C 890.65936,716.94373 892.7868,715.37902 896.22562,716.68646 C 901.43246,718.6661 901.6545,719.95251 899.09152,733.29078 C 897.32414,742.4886 896.4435,744.0985 893.9187,742.74727 C 891.59846,741.50551 891.28617,741.61628 890.97659,743.79078 C 890.5456,746.81804 891.06547,747.61795 894.16639,748.69894 C 896.70198,749.58285 897.79768,749.49814 899.66639,748.27371 C 900.94988,747.43274 902,746.32258 902,745.80668 C 902,745.29079 902.91021,744.0207 904.02269,742.98426 C 905.13517,741.94783 907.95369,738.2515 910.28607,734.77019 C 914.73861,728.12432 922.03978,721.96963 925.60448,721.85717 C 926.76194,721.82066 929.23694,720.16513 931.10448,718.17824 C 937.17258,711.7223 943.43935,705.79078 944.19208,705.79078 C 944.59671,705.79078 946.64528,703.94951 948.74447,701.69907 C 952.31755,697.86853 953.03796,697.55218 960.03059,696.74298 C 964.13876,696.26757 970.54715,695.85884 974.27144,695.83469 C 980.43957,695.79469 981.1409,695.57563 982.14312,693.37602 C 983.11626,691.24019 982.85389,690.60685 979.87168,687.89309 C 974.33169,682.8518 973.03062,681.79078 972.38878,681.79078 C 972.05261,681.79078 969.62766,679.99078 967,677.79078 C 964.37234,675.59078 961.49739,673.79078 960.61122,673.79078 C 959.72505,673.79078 959,673.37653 959,672.87024 C 959,672.36394 957.71433,671.66731 956.14295,671.32218 C 954.57157,670.97704 951.60338,669.15354 949.54697,667.26994 C 945.42203,663.49164 936.28269,658.79078 933.06193,658.79078 C 929.71465,658.79078 930.54944,662.79876 934.88448,667.54122 C 937.02094,669.87848 939.44084,671.79078 940.26203,671.79078 C 941.08323,671.79078 942.27886,672.42186 942.919,673.19318 C 945.91147,676.79889 931.11047,681.31261 924.5,678.81025 C 920.21106,677.18669 915.01485,673.50059 915.00683,672.07596 C 915.00307,671.40781 914.1,670.37948 913,669.79078 C 911.9,669.20208 911,668.22303 911,667.61513 C 911,665.87816 906.7381,657.79078 905.82274,657.79078 C 905.37024,657.79078 905,657.19817 905,656.47387 C 905,654.447 891.94104,641.79078 889.84967,641.79078 C 888.83235,641.79078 888,641.39776 888,640.91741 C 888,640.43706 884.49452,638.64516 880.21003,636.93542 C 873.32537,634.18807 871.61121,633.88756 865.46003,634.34959 C 857.79946,634.92499 844.39961,638.41271 841.92126,640.47627 C 841.05295,641.19925 840.0954,641.79078 839.79337,641.79078 C 838.9838,641.79078 827.97855,651.75856 824.50095,655.64157 C 814.50445,666.80345 791.0487,689.79078 789.65587,689.79078 C 788.74514,689.79078 787.99715,690.12828 787.99368,690.54078 C 787.98571,691.4863 784.21748,693.73261 771,700.67103 C 760.62185,706.11897 760.40443,706.18156 752.26391,706.06486 C 745.65357,705.97009 743.45178,705.5366 741.10954,703.86878 C 739.50449,702.72588 737.7976,701.79078 737.31647,701.79078 C 735.88865,701.79078 729.14354,694.81841 728.44637,692.62181 C 727.62364,690.02962 724.23232,686.60585 723.56191,687.69061 C 722.52872,689.36234 726.7221,701.55024 729.5669,705.14393 C 734.09331,710.86191 743.42106,716.36653 751,717.79232 C 758.38449,719.18154 762.48479,718.60502 776,714.27724 C 780.675,712.78023 786.70613,710.941 789.40251,710.19006 C 792.09889,709.43912 795.05932,708.14208 795.98125,707.30775 C 796.90318,706.47342 797.9273,705.79078 798.25707,705.79078 C 799.54538,705.79078 811,698.50659 811,697.68732 C 811,696.52755 817.66346,693.79078 820.48727,693.79078 C 821.72092,693.79078 823.87445,694.69078 825.27287,695.79078 C 826.67129,696.89078 828.2307,697.79078 828.73821,697.79078 C 829.76633,697.79078 836,706.11837 836,707.49185 C 836,709.73774 850.38858,721.75761 853.15437,721.8222 C 857.67655,721.92781 868.62716,749.27436 873.00184,771.38656 C 874.41254,778.51705 875.90027,779.74457 886,782.11127 C 908.59675,787.40644 918.96652,789.76094 922.34075,790.36258 C 924.45316,790.73924 929.17816,792.10518 932.84075,793.398 C 940.5558,796.12127 943.72241,796.31495 946.47792,794.23208 z M 942.81955,739.96245 C 943.0233,738.57779 942.60907,737.79078 941.67654,737.79078 C 940.02933,737.79078 938.6811,740.46577 939.5884,741.93381 C 940.5492,743.48842 942.47347,742.3144 942.81955,739.96245 z M 874.42857,574.21935 C 875.31899,573.32893 876,570.96065 876,568.75454 C 876,563.87557 873.61035,562.32221 867.51161,563.23677 C 863.44495,563.8466 863.2279,564.05501 862.72062,567.83704 C 861.80502,574.66338 862.55975,575.79078 868.0452,575.79078 C 871.08636,575.79078 873.43542,575.2125 874.42857,574.21935 z M 959,810.91322 C 959,809.60981 961.58284,807.70695 962.33333,808.45745 C 963.08383,809.20794 961.18097,811.79078 959.87756,811.79078 C 959.3949,811.79078 959,811.39588 959,810.91322 z M 963.89508,805.54078 C 964.86113,802.92395 968,801.88516 968,804.18227 C 968,805.02825 967.12958,806.18625 966.06574,806.7556 C 963.2841,808.24429 962.96331,808.06475 963.89508,805.54078 z M 971.12066,797.79078 C 973.43334,795.59078 975.37542,793.79078 975.4364,793.79078 C 975.49738,793.79078 979.29533,790.19078 983.8763,785.79078 C 988.45726,781.39078 992.83412,777.79078 993.60266,777.79078 C 994.3712,777.79078 995,777.29936 995,776.69874 C 995,775.57276 1003.8663,766.70567 1017.6315,754.06516 C 1038.7404,734.68093 1039.8753,733.4424 1042.5417,726.88038 C 1044.6824,721.61222 1044.9359,720.04573 1044.0564,717.52267 C 1043.4754,715.85599 1043,713.67947 1043,712.68597 C 1043,709.99285 1034.421,697.79078 1032.5276,697.79078 C 1031.9246,697.79078 1030.6166,696.41172 1029.6209,694.7262 C 1028.6253,693.04068 1026.7282,691.16845 1025.4053,690.56569 C 1024.0824,689.96292 1023,689.0839 1023,688.6123 C 1023,688.1407 1020.3,684.96114 1017,681.54662 C 1013.7,678.13209 1011,674.99017 1011,674.56458 C 1011,674.13899 1010.325,673.79078 1009.5,673.79078 C 1008.675,673.79078 1008,673.41403 1008,672.95355 C 1008,672.49307 1006.3125,670.32355 1004.25,668.13239 C 1002.1875,665.94123 997.47046,660.91798 993.76768,656.96962 C 990.06491,653.02126 986.60773,649.79078 986.08507,649.79078 C 985.56241,649.79078 984.8389,648.85856 984.47728,647.71919 C 984.11565,646.57981 980.927,642.75481 977.39137,639.21919 C 973.85575,635.68356 971.28423,632.79078 971.6769,632.79078 C 972.06956,632.79078 970.67134,631.21578 968.56972,629.29078 C 966.46811,627.36578 964.35518,625.79078 963.87431,625.79078 C 963.39344,625.79078 963,625.11578 963,624.29078 C 963,622.43615 965.61229,622.3129 966.70031,624.11619 C 967.14014,624.84517 968.2875,625.73104 969.25,626.08481 C 970.2125,626.43857 971,627.64213 971,628.7594 C 971,629.8984 971.65894,630.79078 972.5,630.79078 C 973.325,630.79078 974,631.46578 974,632.29078 C 974,633.11578 974.3375,633.79399 974.75,633.7979 C 975.50969,633.80512 979.71875,637.80784 987.09822,645.54078 C 989.32887,647.87828 991.45681,649.80288 991.82698,649.81768 C 992.19714,649.83247 993.60296,651.63247 994.95103,653.81768 C 996.29909,656.00288 997.98659,657.79078 998.70103,657.79078 C 999.41546,657.79078 1000,658.12854 1000,658.54135 C 1000,658.95416 1003.375,662.8467 1007.5,667.19143 C 1011.625,671.53616 1015,675.29286 1015,675.53965 C 1015,676.34668 1021.1884,681.79078 1022.1058,681.79078 C 1022.5976,681.79078 1023,682.70192 1023,683.81553 C 1023,685.05513 1023.9694,686.20886 1025.5,686.79078 C 1026.875,687.31355 1028,688.18503 1028,688.72739 C 1028,689.92887 1035.8172,697.79078 1037.0118,697.79078 C 1037.4812,697.79078 1038.1195,698.57828 1038.4302,699.54078 C 1038.7409,700.50328 1040.5635,702.99486 1042.4804,705.07763 C 1047.2459,710.25567 1049.5243,718.13001 1047.9493,723.979 C 1047.3119,726.34619 1046.6268,729.13239 1046.4269,730.17054 C 1046.2269,731.2087 1045.1491,732.69847 1044.0317,733.48115 C 1042.9143,734.26382 1042,735.55367 1042,736.34748 C 1042,737.1413 1041.4128,737.79078 1040.6951,737.79078 C 1039.9773,737.79078 1035.9933,741.05328 1031.8417,745.04078 C 1027.6901,749.02828 1020.1465,756.11578 1015.0782,760.79078 C 1010.0098,765.46578 1004.0246,771.20328 1001.7777,773.54078 C 999.53079,775.87828 997.11694,777.79078 996.41359,777.79078 C 995.71024,777.79078 994.86548,778.63926 994.53633,779.6763 C 994.20719,780.71333 992.26437,782.72771 990.21895,784.1527 C 988.17353,785.57768 985.24332,788.3292 983.70737,790.26718 C 982.17142,792.20516 980.43154,793.79078 979.84096,793.79078 C 979.25039,793.79078 977.07196,795.59078 975,797.79078 C 972.86426,800.05851 970.29803,801.79078 969.0743,801.79078 C 967.20401,801.79078 967.47726,801.25666 971.12066,797.79078 z M 735,654.24121 C 735,653.45402 741.57433,646.79078 742.35102,646.79078 C 742.70796,646.79078 743,647.46578 743,648.29078 C 743,649.11578 742.59723,649.79078 742.10496,649.79078 C 741.61269,649.79078 740.15019,650.90801 738.85496,652.2735 C 736.62466,654.6248 735,655.45409 735,654.24121 z M 746,642.8498 C 746,642.26734 746.45,641.79078 747,641.79078 C 747.55,641.79078 748,641.98922 748,642.23176 C 748,642.4743 747.55,642.95086 747,643.29078 C 746.45,643.6307 746,643.43226 746,642.8498 z M 749,641.24897 C 749,640.14697 752.99959,636.45703 753.57277,637.03022 C 753.89941,637.35686 753.22917,638.56161 752.08333,639.70745 C 750.01214,641.77864 749,642.28466 749,641.24897 z M 757.81467,633.28137 C 759.08773,632.34935 760.40023,631.85768 760.73133,632.18878 C 761.53208,632.98953 760.98703,633.40268 758,634.25914 L 755.5,634.97595 L 757.81467,633.28137 z M 958.2,619.59078 C 957.54,618.93078 957,618.03002 957,617.5891 C 957,617.14817 951.6,611.40726 945,604.83152 C 933.98866,593.86066 931.54999,590.79078 933.8462,590.79078 C 934.3116,590.79078 938.4741,594.67096 943.0962,599.4134 C 947.71829,604.15584 953.8625,610.34121 956.75,613.15866 C 961.91704,618.20034 963.25772,620.79078 960.7,620.79078 C 959.985,620.79078 958.86,620.25078 958.2,619.59078 z M 775,617.3498 C 775,617.10726 775.45,616.6307 776,616.29078 C 776.55,615.95086 777,616.1493 777,616.73176 C 777,617.31422 776.55,617.79078 776,617.79078 C 775.45,617.79078 775,617.59234 775,617.3498 z M 787.2619,605.1003 C 788.19167,604.17054 789.23316,603.6906 789.57633,604.03377 C 790.56051,605.01796 789.04964,606.79078 787.2267,606.79078 C 785.70022,606.79078 785.70296,606.65925 787.2619,605.1003 z M 791.5,601.79078 C 791.83992,601.24078 792.56803,600.79078 793.11803,600.79078 C 793.66803,600.79078 793.83992,601.24078 793.5,601.79078 C 793.16008,602.34078 792.43197,602.79078 791.88197,602.79078 C 791.33197,602.79078 791.16008,602.34078 791.5,601.79078 z M 927.44862,585.59173 C 926.3416,584.31854 923.87528,582.04747 921.96793,580.5449 C 918.83636,578.07793 918.71712,577.81188 920.73857,577.80187 C 923.05058,577.79042 927,580.53477 927,582.15278 C 927,582.65741 927.73692,583.60914 928.6376,584.26774 C 929.53828,584.92633 930.09209,586.0145 929.86829,586.6859 C 929.60619,587.4722 928.74511,587.08283 927.44862,585.59173 z M 918.05844,575.11916 C 915.06197,573.02035 909,566.63831 909,565.58244 C 909,564.0468 910.87642,564.81805 912.67742,567.09394 C 913.67984,568.36068 915.175,569.6605 916,569.98244 C 917.28654,570.48447 921.71318,576.79078 920.77904,576.79078 C 920.59533,576.79078 919.37106,576.03855 918.05844,575.11916 z M 902.55887,558.25898 C 901.49125,557.45147 901.09865,556.79078 901.68643,556.79078 C 902.2742,556.79078 903.31531,557.46578 904,558.29078 C 905.5572,560.1671 905.06734,560.15629 902.55887,558.25898 z M 894.7561,550.54078 C 893.3914,548.75328 890.77757,545.82828 888.94758,544.04078 C 887.11759,542.25328 886.12309,540.79078 886.73758,540.79078 C 887.35207,540.79078 888.73976,541.91578 889.82134,543.29078 C 890.90292,544.66578 892.28558,545.79078 892.89392,545.79078 C 893.50226,545.79078 894,546.46578 894,547.29078 C 894,548.11578 894.65917,548.79078 895.46482,548.79078 C 896.74469,548.79078 899,551.61967 899,553.22504 C 899,554.73528 896.98586,553.46133 894.7561,550.54078 z"
+         id="path3305" />
+      <text
+         transform="scale(0.9666105,1.0345429)"
+         sodipodi:linespacing="100%"
+         id="text3322"
+         y="763.72729"
+         x="1072.431"
+         style="font-size:208.1971283px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;fill:#550000;fill-opacity:1;stroke:#550000;stroke-width:0.6626218px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;display:inline;font-family:Sans;-inkscape-font-specification:Sans Bold"
+         xml:space="preserve"><tspan
+           style="stroke-width:0.6626218"
+           y="763.72729"
+           x="1072.431"
+           id="tspan3324"
+           sodipodi:role="line">RooJS</tspan></text>
+    </g>
+    <text
+       xml:space="preserve"
+       style="font-size:84.23834991px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-align:start;line-height:100%;writing-mode:lr-tb;text-anchor:start;fill:#550000;fill-opacity:1;stroke:#550000;stroke-width:0.2681025px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;display:inline;font-family:Sans;-inkscape-font-specification:Sans Bold"
+       x="351.95795"
+       y="614.00769"
+       id="text14667"
+       sodipodi:linespacing="100%"
+       transform="scale(0.9666105,1.0345429)"
+       inkscape:export-filename="/mnt/webdav/roojs1/buildSDK/rect14671.png"
+       inkscape:export-xdpi="49.420258"
+       inkscape:export-ydpi="49.420258"><tspan
+         sodipodi:role="line"
+         id="tspan14669"
+         x="351.95795"
+         y="614.00769"
+         style="stroke-width:0.2681025">RooJS</tspan></text>
+    <g
+       id="g14643"
+       style="fill:#d45500;stroke:#d45500;stroke-width:1.8428067;display:inline"
+       transform="matrix(0.2523355,0,0,0.2646036,169.71783,489.95954)"
+       inkscape:export-filename="/mnt/webdav/roojs1/buildSDK/rect14671.png"
+       inkscape:export-xdpi="49.420258"
+       inkscape:export-ydpi="49.420258">
+      <path
+         id="path14645"
+         d="M 392.44426,366.4686 L 400.52548,374.04475 L 436.89098,389.19704 L 448.50773,390.71227 L 495.47982,393.23765 L 560.12959,321.01174 L 366.68537,282.12087 L 392.44426,366.4686 z"
+         style="fill:#d45500;fill-rule:evenodd;stroke:#d45500;stroke-width:1.8428067px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1" />
+      <path
+         sodipodi:nodetypes="cscscsccccc"
+         id="path14647"
+         d="M 602.47812,266.12558 C 602.47812,266.12558 548.72702,321.16473 520.22856,300.80869 C 456.58895,255.35182 455.5788,253.33152 455.5788,253.33152 C 455.5788,253.33152 413.15239,222.01679 348.50263,228.07771 C 283.85287,234.13862 255.56859,278.58533 255.56859,278.58533 C 255.56859,278.58533 151.52288,414.95593 128.28937,426.0676 C 105.05586,437.17928 56.568543,427.07776 56.568543,427.07776 L 82.480622,454.53045 L 139.2357,449.25996 L 303.14752,270.36436 L 554.43754,320.77339"
+         style="fill:#d45500;fill-opacity:1;fill-rule:evenodd;stroke:#d45500;stroke-width:9.21403313;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+      <path
+         sodipodi:nodetypes="csssss"
+         id="path14649"
+         d="M 81.465214,455.12218 C 81.465214,455.12218 131.31983,458.89756 151.52288,443.74527 C 171.72594,428.59298 261.12443,353.33662 268.1955,346.26555 C 271.73104,342.73002 365.67522,292.98 377.29198,284.39371 C 383.10035,280.10056 323.24881,264.88514 303.2983,269.3677 C 283.34779,273.85025 199.75766,380.86328 203.54573,380.61075"
+         style="fill:#d45500;fill-rule:evenodd;stroke:#d45500;stroke-width:9.21403313;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+      <path
+         sodipodi:nodetypes="csssccsscccccssssc"
+         id="path14651"
+         d="M 284.98557,326.67527 C 284.98557,326.67527 279.81226,337.17418 285.87317,349.29601 C 291.93409,361.41784 305.06607,366.4686 304.05592,370.50921 C 303.04576,374.54982 277.79195,413.94577 265.67012,422.02699 C 253.54829,430.10821 224.25387,443.2402 224.25387,443.2402 L 223.24371,443.2402 C 223.24371,443.2402 222.23356,485.6666 222.23356,504.8595 C 222.23356,524.0524 216.17264,530.11332 207.08127,531.12347 C 197.9899,532.13362 197.9899,533.14377 197.9899,533.14377 L 214.15234,545.2656 L 249.50768,537.18438 L 250.51783,480.61584 L 250.51783,475.56508 C 250.51783,475.56508 254.55844,464.4534 283.85287,445.2605 C 313.14729,426.0676 351.53309,417.98638 360.62446,408.89501 C 369.71583,399.80364 398.0001,373.53967 398.0001,362.42799 C 398.0001,351.31632 390.92904,298.78838 378.8072,293.73762 C 366.68537,288.68686 368.70568,288.68686 368.70568,288.68686"
+         style="fill:#d45500;fill-rule:evenodd;stroke:#d45500;stroke-width:9.21403313;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+      <path
+         id="path14653"
+         d="M 394.96965,372.52952 C 394.96965,372.52952 417.193,387.68181 434.36559,391.72242 C 451.53819,395.76303 452.54834,392.73257 452.54834,392.73257"
+         style="fill:#d45500;fill-rule:evenodd;stroke:#d45500;stroke-width:9.21403313;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+      <path
+         id="path14655"
+         d="M 517.1981,340.20464 C 517.1981,340.20464 513.15749,320.00159 490.93414,326.0625 C 468.71078,332.12342 457.5991,336.16403 454.56865,349.29601 C 451.53819,362.42799 450.52804,388.69196 454.56865,396.77318 C 458.60926,404.8544 466.69048,432.12852 461.63971,434.14882 C 456.58895,436.16913 446.48743,424.0473 446.48743,424.0473"
+         style="fill:#d45500;fill-rule:evenodd;stroke:#d45500;stroke-width:9.21403313;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+      <path
+         id="path14657"
+         d="M 477.80215,376.57013 C 477.80215,376.57013 483.86307,398.79349 481.84276,408.89501 C 479.82246,418.99654 473.76154,413.94577 475.78185,437.17928 C 477.80215,460.41279 483.86307,461.42294 466.69048,461.42294 C 449.51788,461.42294 439.41636,438.18944 439.41636,438.18944 L 445.47727,422.02699"
+         style="fill:#d45500;fill-rule:evenodd;stroke:#d45500;stroke-width:9.21403313;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+      <path
+         sodipodi:nodetypes="cssssssssssc"
+         id="path14659"
+         d="M 483.86307,393.74272 C 483.86307,393.74272 519.21841,396.77318 533.36054,392.73257 C 547.50268,388.69196 552.55344,390.71227 565.68543,376.57013 C 578.81741,362.42799 578.81741,363.43815 590.93924,356.36708 C 603.06107,349.29601 597.00015,339.19449 612.15244,344.24525 C 627.30473,349.29601 632.35549,350.30616 639.42656,355.35693 C 646.49763,360.40769 649.52809,365.45845 656.59915,362.42799 C 663.67022,359.39754 669.73114,360.40769 667.71083,346.26555 C 665.69053,332.12342 675.79205,345.2554 660.63976,325.05235 C 645.48748,304.8493 642.45702,292.72747 629.32504,286.66655 C 616.19305,280.60564 610.643,274.0897 606.09153,269.49396 C 603.21163,266.58606 602.14021,265.96106 602.14021,265.96106"
+         style="fill:#d45500;fill-opacity:1;fill-rule:evenodd;stroke:#d45500;stroke-width:9.21403313;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+      <path
+         id="path14661"
+         d="M 620.23366,280.60564 C 620.23366,280.60564 617.20321,275.55488 625.28443,263.43304 C 633.36565,251.31121 633.36565,247.2706 633.36565,247.2706 L 613.1626,260.40259 L 605.08137,267.47365 L 604.07122,268.48381"
+         style="fill:#d45500;fill-rule:evenodd;stroke:#d45500;stroke-width:9.21403313;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+      <path
+         id="path14663"
+         d="M 571.74634,248.28076 C 571.74634,248.28076 566.69558,258.38228 570.73619,271.51427 C 574.7768,284.64625 573.76665,284.64625 582.85802,290.70716 C 591.94939,296.76808 600.03061,301.81884 603.06107,296.76808 C 606.09153,291.71732 608.11183,275.55488 600.03061,267.47365 C 591.94939,259.39243 571.74634,250.30106 571.74634,248.28076 z"
+         style="fill:#d45500;fill-opacity:1;fill-rule:evenodd;stroke:#d45500;stroke-width:9.21403313;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1" />
+      <path
+         transform="translate(-7.1428571,-5.7142857)"
+         d="M 639.28571,316.46933 A 6.7857141,6.9642859 0 1 1 625.71429,316.46933 A 6.7857141,6.9642859 0 1 1 639.28571,316.46933 z"
+         sodipodi:ry="6.9642859"
+         sodipodi:rx="6.7857141"
+         sodipodi:cy="316.46933"
+         sodipodi:cx="632.5"
+         id="path14665"
+         style="opacity:1;fill:#d45500;fill-opacity:1;stroke:#d45500;stroke-width:9.21403313;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+         sodipodi:type="arc" />
+    </g>
+    <rect
+       style="opacity:1;fill:#550000;fill-opacity:1;stroke:none;stroke-width:2;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+       id="rect14671"
+       width="326.42859"
+       height="12.589286"
+       x="184.0179"
+       y="640.25635"
+       inkscape:export-xdpi="49.420258"
+       inkscape:export-ydpi="49.420258" />
+  </g>
+</svg>
diff --git a/buildSDK/make_src_highlighted.js b/buildSDK/make_src_highlighted.js
new file mode 100644 (file)
index 0000000..dad6edc
--- /dev/null
@@ -0,0 +1,77 @@
+
+/**
+ * Make the highlighted docs = needs more work....
+ * 
+ * In the top level Roojs directory.. (you need to change the path of the jstoolkit)
+ * 
+ * 
+ * roolite buildSDK/make_src_highlighted.js -L../rooscript/examples/jstoolkit2 
+ * 
+ * put's the resulting files in docs/symbols/src
+ *  (make sure it exists first..)
+ *
+ * Uses the dependancy order file.. (could do this recursively, it's pretty simple..)
+ * 
+ * <script type="text/javascript">
+ */
+
+include 'prettyPrint.js'; 
+function main()
+{
+    
+    var files = [];
+    var spath = File.getcwd();
+    var flist = File.read(spath+"/buildSDK/dependancy_order.txt" ).split("\n");
+    for(var i = 0; i < flist.length;i++) {
+        var f = flist[i];
+        if (/^\s*\//.test(f) || !/[a-z]+/i.test(f)) {
+            continue;
+        }
+        //println("ADD"+ f.replace(/\./g, '/'));
+        files.push(spath + '/' + f.replace(/\./g, '/').replace(/\s+/g,'')+'.js');
+        
+    }
+    
+     for(var i=0; i < files.length; i++)  {
+        
+        println("reading " +files[i] );
+        if (!File.exists(files[i])) {
+            throw "missing file: " + files[i];
+            continue;
+        }
+        
+        var prettyfile = spath + '/docs/symbols/src/' +files[i].substr(spath.length+1).replace(/\//g, '.').replace(/\.js$/, '.html');
+        // should do timestamp stuff!
+        if (File.exists(prettyfile) &&
+            File.getTimes(prettyfile)[0] > File.getTimes(files[i])[0]
+            ) {
+            File.chmod(prettyfile, 0644);
+            continue;
+        }
+        
+        var str = File.read(files[i]);
+        
+        // probably want do do templating or something here..
+        // we probably want to do some sexy replacement on the comments using our parsed info on the file!? ;)
+        
+        var pretty = toPretty(str);
+        
+        
+        
+        
+        println("write : " + prettyfile);
+        //throw "done";
+        File.write(prettyfile, 
+            '<html><head>' +
+            '<title>' + files[i].substr(spath.length+1) + '</title>' +
+            '<link rel="stylesheet" type="text/css" href="../../../css/highlight-js.css"/>' + 
+            '</head><body class="highlightpage">' +
+            pretty +
+            '</body></html>');
+            
+        File.chmod(prettyfile, 0644);
+    }
+}
+main();      
+   
\ No newline at end of file
diff --git a/buildSDK/rect14671.png b/buildSDK/rect14671.png
new file mode 100644 (file)
index 0000000..e6d5e90
Binary files /dev/null and b/buildSDK/rect14671.png differ
diff --git a/buildSDK/release.sh b/buildSDK/release.sh
new file mode 100644 (file)
index 0000000..b90fd90
--- /dev/null
@@ -0,0 +1,12 @@
+#!/bin/sh
+DATE=`/bin/date +%Y%m%d`
+
+rm /home/www/devel/roojs1-current.tgz
+rm /home/www/devel/roojs1-${DATE}.tgz
+
+
+cd /home/svn/svn
+tar cvzf /home/www/devel/roojs1-${DATE}.tgz roojs1
+
+ln -s /home/www/devel/roojs1-${DATE}.tgz /home/www/devel/roojs1-current.tgz
\ No newline at end of file
diff --git a/buildSDK/renderWiki.php b/buildSDK/renderWiki.php
new file mode 100644 (file)
index 0000000..f25ee78
--- /dev/null
@@ -0,0 +1,52 @@
+<?php exit;
+?>
+
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+       <meta http-equiv="content-type" content="text/html; charset=utf-8" />
+       <title>RooJS(1) Generated Documentation</title>
+</head>
+
+
+<html>
+<head>
+  <title>RooJS (1) - Manual</title>
+
+    
+    <style>
+   body, table, td {
+       font:normal 11px tahoma,arial,helvetica,sans-serif;
+      }
+    
+    
+    </style>
+<a href="http://www.akbkhome.com/roojs1/docs" target="_top"><h1>  View Documentation Interface  </h1></a>
+
+<?php
+// load the class file
+ set_include_path('/home/alan/Text_Wiki-1.2.0');
+require_once 'Text/Wiki.php';
+
+$wiki =& new Text_Wiki();
+$text = file_get_contents(dirname(__FILE__).'/wiki_index.txt');
+// transform the wiki text into XHTML
+$xhtml = $wiki->transform($text, 'Xhtml');
+$xhtml = str_replace( 'onclick="window.open(this.href, \'_blank\'); return false;"', '', $xhtml);
+$xhtml = str_replace( '<p>&lt;TSTART&gt;</p>', '<TABLE><TR><TD valign="top">', $xhtml);
+$xhtml = str_replace( '&lt;TSEP&gt;<br />', '</TD><TD valign="top">', $xhtml);
+$xhtml = str_replace( '<p>&lt;TEND&gt;</p>', '</TD></TR><TABLE>', $xhtml);
+
+
+
+// display the transformed text
+echo $xhtml;
+?>
+
+
+
+
+</body>
+</html>
\ No newline at end of file
diff --git a/buildSDK/roojs_logo.jpg b/buildSDK/roojs_logo.jpg
new file mode 100644 (file)
index 0000000..ba46d8a
Binary files /dev/null and b/buildSDK/roojs_logo.jpg differ
diff --git a/buildSDK/wiki_index.txt b/buildSDK/wiki_index.txt
new file mode 100644 (file)
index 0000000..41953cb
--- /dev/null
@@ -0,0 +1,226 @@
+
++++ ``RooJS1`` Documentation Contents
+
+<TSTART>
+
+* [http://www.akbkhome.com/roojs1/docs/symbols/Roo.html Roo] Core Class - Essential Reading
+* ''' Dom / CSS / Text'''
+ * Roo.util.[http://www.akbkhome.com/roojs1/docs/symbols/Roo.util.CSS.html CSS]
+ * Roo.util.[http://www.akbkhome.com/roojs1/docs/symbols/Roo.util.Format.html Format] Various Text Formating / Encoding
+ * Roo.[http://www.akbkhome.com/roojs1/docs/symbols/Roo.DomHelper.html DomHelper] DOM creation 
+ * Roo.[http://www.akbkhome.com/roojs1/docs/symbols/Roo.DomQuery.html DomQuery] DOM locating elements
+ * Roo.util.[http://www.akbkhome.com/roojs1/docs/symbols/Roo.util.TextMetrics.html TextMetrics] Text size calculations
+* '''Element / Selection'''
+ * Roo.[http://www.akbkhome.com/roojs1/docs/symbols/Roo.Element.html Element] Core Element methods (see also Roo.get())
+ * Roo.[http://www.akbkhome.com/roojs1/docs/symbols/Roo.CompositeElement.html CompositeElement]
+ * Roo.[http://www.akbkhome.com/roojs1/docs/symbols/Roo.CompositeElementLite.html CompositeElementLite]
+* '''Effects / Masks / Tips'''
+ * Roo.[http://www.akbkhome.com/roojs1/docs/symbols/Roo.Fx.html Fx]
+ * Roo.[http://www.akbkhome.com/roojs1/docs/symbols/Roo.LoadMask.html LoadMask]
+ * Roo.[http://www.akbkhome.com/roojs1/docs/symbols/Roo.QuickTips.html QuickTips]
+ * Roo.[http://www.akbkhome.com/roojs1/docs/symbols/Roo.Resizable.html Resizable]
+ * '''Examples'''
+   * [http://www.akbkhome.com/roojs1/examples/resizable/basic.html Resizing elements] With animation, snapping etc. (Works, needs a few replacement images)
+
+* '''State'''
+    * Roo.state.[http://www.akbkhome.com/roojs1/docs/symbols/Roo.state.CookieProvider.html CookieProvider]
+
+* '''Drag and Drop'''
+ * [http://www.akbkhome.com/roojs1/docs/symbols/Roo.dd.DD.html Roo.dd.DD]
+ * [http://www.akbkhome.com/roojs1/docs/symbols/Roo.dd.DDProxy.html Roo.dd.DDProxy]
+ * [http://www.akbkhome.com/roojs1/docs/symbols/Roo.dd.DDTarget.html Roo.dd.DDTarget]
+ * [http://www.akbkhome.com/roojs1/docs/symbols/Roo.dd.DragDrop.html Roo.dd.DragDrop]
+ * [http://www.akbkhome.com/roojs1/docs/symbols/Roo.dd.DragDropMgr.html Roo.dd.DragDropMgr]
+ * [http://www.akbkhome.com/roojs1/docs/symbols/Roo.dd.DragZone.html Roo.dd.DragZone]
+ * [http://www.akbkhome.com/roojs1/docs/symbols/Roo.dd.DropTarget.html Roo.dd.DropTarget]
+ * [http://www.akbkhome.com/roojs1/docs/symbols/Roo.dd.DropZone.html Roo.dd.DropZone]
+ * [http://www.akbkhome.com/roojs1/docs/symbols/Roo.dd.Registry.html Roo.dd.Registry]
+ * [http://www.akbkhome.com/roojs1/docs/symbols/Roo.dd.ScrollManager.html Roo.dd.ScrollManager]
+ * [http://www.akbkhome.com/roojs1/docs/symbols/Roo.dd.StatusProxy.html Roo.dd.StatusProxy]
+* '''Signals / Events'''
+ * [http://www.akbkhome.com/roojs1/docs/symbols/Roo.util.Observable.html Roo.util.Observable]
+ * [http://www.akbkhome.com/roojs1/docs/symbols/Roo.util.DelayedTask.html Roo.util.DelayedTask]
+ * [http://www.akbkhome.com/roojs1/docs/symbols/Roo.util.TaskRunner.html Roo.util.TaskRunner]
+ * [http://www.akbkhome.com/roojs1/docs/symbols/Roo.EventObject.html Roo.EventObject]
+ * [http://www.akbkhome.com/roojs1/docs/symbols/Roo.Shadow.html Roo.Shadow]
+ * [http://www.akbkhome.com/roojs1/docs/symbols/Roo.util.ClickRepeater.html Roo.util.ClickRepeater]
+* '''AJAX'''
+ * [http://www.akbkhome.com/roojs1/docs/symbols/Roo.data.Connection.html Roo.data.Connection]
+ * [http://www.akbkhome.com/roojs1/docs/symbols/Roo.Ajax.html Roo.Ajax]
+* '''Store'''
+ * [http://www.akbkhome.com/roojs1/docs/symbols/Roo.util.MixedCollection.html Roo.util.MixedCollection]
+ * [http://www.akbkhome.com/roojs1/docs/symbols/Roo.data.JsonStore.html Roo.data.JsonStore]
+ * [http://www.akbkhome.com/roojs1/docs/symbols/Roo.data.Store.html Roo.data.Store]
+ * [http://www.akbkhome.com/roojs1/docs/symbols/Roo.data.SimpleStore.html Roo.data.SimpleStore]
+ * [http://www.akbkhome.com/roojs1/docs/symbols/Roo.data.Record.html Roo.data.Record]
+ * [http://www.akbkhome.com/roojs1/docs/symbols/Roo.data.SortTypes.html Roo.data.SortTypes]
+* '''Data Readers'''
+ * [http://www.akbkhome.com/roojs1/docs/symbols/Roo.data.ArrayReader.html Roo.data.ArrayReader]
+ * [http://www.akbkhome.com/roojs1/docs/symbols/Roo.data.DataReader.html Roo.data.DataReader]
+ * [http://www.akbkhome.com/roojs1/docs/symbols/Roo.data.JsonReader.html Roo.data.JsonReader]
+ * [http://www.akbkhome.com/roojs1/docs/symbols/Roo.data.XmlReader.html Roo.data.XmlReader]
+* '''Data Proxies'''
+ * [http://www.akbkhome.com/roojs1/docs/symbols/Roo.data.DataProxy.html Roo.data.DataProxy]
+ * [http://www.akbkhome.com/roojs1/docs/symbols/Roo.data.HttpProxy.html Roo.data.HttpProxy]
+ * [http://www.akbkhome.com/roojs1/docs/symbols/Roo.data.MemoryProxy.html Roo.data.MemoryProxy]
+ * [http://www.akbkhome.com/roojs1/docs/symbols/Roo.data.ScriptTagProxy.html Roo.data.ScriptTagProxy]
+* '''Tree Data'''
+ * [http://www.akbkhome.com/roojs1/docs/symbols/Roo.data.Node.html Roo.data.Node]
+ * [http://www.akbkhome.com/roojs1/docs/symbols/Roo.data.Tree.html Roo.data.Tree]
+* '''Keys'''
+ * [http://www.akbkhome.com/roojs1/docs/symbols/Roo.KeyMap.html Roo.KeyMap]
+ * [http://www.akbkhome.com/roojs1/docs/symbols/Roo.KeyNav.html Roo.KeyNav]
+* '''Managers'''
+ * [http://www.akbkhome.com/roojs1/docs/symbols/Roo.ComponentMgr.html Roo.ComponentMgr]
+ * [http://www.akbkhome.com/roojs1/docs/symbols/Roo.DialogManager.html Roo.DialogManager]
+ * [http://www.akbkhome.com/roojs1/docs/symbols/Roo.EventManager.html Roo.EventManager]
+ * [http://www.akbkhome.com/roojs1/docs/symbols/Roo.LayoutManager.html Roo.LayoutManager]
+ * [http://www.akbkhome.com/roojs1/docs/symbols/Roo.UpdateManager.html Roo.UpdateManager]
+ * [http://www.akbkhome.com/roojs1/docs/symbols/Roo.state.Manager.html Roo.state.Manager]
+* '''Templates'''
+ * [http://www.akbkhome.com/roojs1/docs/symbols/Roo.MasterTemplate.html Roo.MasterTemplate]
+ * [http://www.akbkhome.com/roojs1/docs/symbols/Roo.Template.html Roo.Template]
+
+'''Abstract Base Classes'''
+* [http://www.akbkhome.com/roojs1/docs/symbols/Roo.BoxComponent.html Roo.BoxComponent]
+* [http://www.akbkhome.com/roojs1/docs/symbols/Roo.Component.html Roo.Component]
+* [http://www.akbkhome.com/roojs1/docs/symbols/Roo.form.Field.html Roo.form.Field]
+* [http://www.akbkhome.com/roojs1/docs/symbols/Roo.form.Layout.html Roo.form.Layout]
+* [http://www.akbkhome.com/roojs1/docs/symbols/Roo.form.TriggerField.html Roo.form.TriggerField]
+* [http://www.akbkhome.com/roojs1/docs/symbols/Roo.grid.AbstractGridView.html Roo.grid.AbstractGridView]
+* [http://www.akbkhome.com/roojs1/docs/symbols/Roo.grid.AbstractSelectionModel.html Roo.grid.AbstractSelectionModel]
+* [http://www.akbkhome.com/roojs1/docs/symbols/Roo.menu.Adapter.html Roo.menu.Adapter]
+* [http://www.akbkhome.com/roojs1/docs/symbols/Roo.menu.BaseItem.html Roo.menu.BaseItem]
+* [http://www.akbkhome.com/roojs1/docs/symbols/Roo.menu.Item.html Roo.menu.Item] 
+* [http://www.akbkhome.com/roojs1/docs/symbols/Roo.state.Provider.html Roo.state.Provider]
+* [http://www.akbkhome.com/roojs1/docs/symbols/Roo.Editor.html Roo.Editor]
+* [http://www.akbkhome.com/roojs1/docs/symbols/Roo.Toolbar.Item.html Roo.Toolbar.Item]
+<TSEP>
+'''Widgets'''
+
+* [http://www.roojs.com/trac/wiki/RooJS1/Gallery Gallery]
+* '''Windows and Dialogs'''
+ * Roo.[http://www.akbkhome.com/roojs1/docs/symbols/Roo.BasicDialog.html BasicDialog]
+ * Roo.[http://www.akbkhome.com/roojs1/docs/symbols/Roo.LayoutDialog.html LayoutDialog]
+ * Roo.[http://www.akbkhome.com/roojs1/docs/symbols/Roo.MessageBox.html MessageBox]
+ * '''Examples'''
+  * [http://www.akbkhome.com/roojs1/examples/dialog/hello.html Simple Hello World]
+  * [http://www.akbkhome.com/roojs1/examples/dialog/layout.html Dialog with Layout]
+  * [http://www.akbkhome.com/roojs1/examples/dialog/msg-box.html Various Standard Message Boxes]
+  * [http://www.akbkhome.com/roojs1/examples/dialog/blog.html Simple Blog Post interface]
+
+* '''Buttons'''
+ * Roo.[http://www.akbkhome.com/roojs1/docs/symbols/Roo.Button.html Button]
+ * Roo.[http://www.akbkhome.com/roojs1/docs/symbols/Roo.SplitButton.html SplitButton]
+* '''Form / Entry'''
+ * Core Form  / Layout
+  * Roo.form.[http://www.akbkhome.com/roojs1/docs/symbols/Roo.form.Form.html Form]
+  * Roo.form.[http://www.akbkhome.com/roojs1/docs/symbols/Roo.form.BasicForm.html BasicForm]
+  * Roo.form.[http://www.akbkhome.com/roojs1/docs/symbols/Roo.form.Column.html Column]
+  * Roo.form.[http://www.akbkhome.com/roojs1/docs/symbols/Roo.form.FieldSet.html FieldSet]
+ * Form Elements
+  * Roo.form.[http://www.akbkhome.com/roojs1/docs/symbols/Roo.form.TextField.html TextField]
+  * Roo.form.[http://www.akbkhome.com/roojs1/docs/symbols/Roo.form.DateField.html DateField]
+  * Roo.form.[http://www.akbkhome.com/roojs1/docs/symbols/Roo.form.NumberField.html NumberField] 
+  * Roo.form.[http://www.akbkhome.com/roojs1/docs/symbols/Roo.form.TextArea.html TextArea]
+  * Roo.form.[http://www.akbkhome.com/roojs1/docs/symbols/Roo.form.Checkbox.html Checkbox]
+  * Roo.form.[http://www.akbkhome.com/roojs1/docs/symbols/Roo.form.Radio.html Radio]
+  * Roo.form.[http://www.akbkhome.com/roojs1/docs/symbols/Roo.form.ComboBox.html ComboBox]
+ * Html Editor
+  * Roo.form.[http://www.akbkhome.com/roojs1/docs/symbols/Roo.form.HtmlEditor.html HtmlEditor]
+  * Roo.form.[http://www.akbkhome.com/roojs1/docs/symbols/Roo.form.FCKeditor.html FCKeditor] embeded FCKeditor
+ * Other
+  * Roo.form.[http://www.akbkhome.com/roojs1/docs/symbols/Roo.form.Action.html Action] What happens when you load and save a form.
+  * Roo.form.[http://www.akbkhome.com/roojs1/docs/symbols/Roo.form.VTypes.html VTypes] Various types of Validation for form elements.
+  * Roo.[http://www.akbkhome.com/roojs1/docs/symbols/Roo.DatePicker.html DatePicker] Date Picker (not really a form element...)
+ * '''Examples'''
+  * [http://www.akbkhome.com/roojs1/examples/form/dynamic.html Dynamic Forms]
+  * [http://www.akbkhome.com/roojs1/examples/form/combos.html Combox boxes]
+  * [http://www.akbkhome.com/roojs1/examples/form/custom.html Custom] -  Autocomplete example - (Broken until we sort out a Json callback for trac)
+  * [http://www.akbkhome.com/roojs1/examples/form/forum-search.html Search forum] - (Broken until we sort out a Json callback for trac)
+  * [http://www.akbkhome.com/roojs1/examples/form/xml-form.html Form from/to xml] 
+  * [http://www.akbkhome.com/roojs1/examples/form/fck.html FCK editor example]
+* '''Tree'''
+ * [http://www.akbkhome.com/roojs1/docs/symbols/Roo.tree.TreePanel.html Roo.tree.TreePanel]
+ * [http://www.akbkhome.com/roojs1/docs/symbols/Roo.tree.TreeEditor.html Roo.tree.TreeEditor]
+ * [http://www.akbkhome.com/roojs1/docs/symbols/Roo.tree.AsyncTreeNode.html Roo.tree.AsyncTreeNode]
+ * [http://www.akbkhome.com/roojs1/docs/symbols/Roo.tree.TreeNode.html Roo.tree.TreeNode]
+ * [http://www.akbkhome.com/roojs1/docs/symbols/Roo.tree.TreeFilter.html Roo.tree.TreeFilter]
+ * [http://www.akbkhome.com/roojs1/docs/symbols/Roo.tree.TreeLoader.html Roo.tree.TreeLoader]
+ * [http://www.akbkhome.com/roojs1/docs/symbols/Roo.tree.TreeSorter.html Roo.tree.TreeSorter]
+ * [http://www.akbkhome.com/roojs1/docs/symbols/Roo.tree.DefaultSelectionModel.html Roo.tree.DefaultSelectionModel]
+ * [http://www.akbkhome.com/roojs1/docs/symbols/Roo.tree.MultiSelectionModel.html Roo.tree.MultiSelectionModel]
+ * '''Examples'''
+  * [http://www.akbkhome.com/roojs1/examples/tree/two-trees.html Two Trees] (need to rename it!)
+  * [http://www.akbkhome.com/roojs1/examples/tree/reorder.html Re-orderable Trees]
+  * [http://www.akbkhome.com/roojs1/examples/tree/dependency.html The Roo Dependancy tree] (needs some css tidy up.)
+  * [http://www.akbkhome.com/roojs1/examples/tree/organizer.html Organizer] (needs some css tidy up.)
+
+* '''Grid'''
+ * [http://www.akbkhome.com/roojs1/docs/symbols/Roo.grid.GridPanel.html Roo.grid.GridPanel]
+ * [http://www.akbkhome.com/roojs1/docs/symbols/Roo.grid.CellSelectionModel.html Roo.grid.CellSelectionModel]
+ * [http://www.akbkhome.com/roojs1/docs/symbols/Roo.grid.RowSelectionModel.html Roo.grid.RowSelectionModel]
+ * [http://www.akbkhome.com/roojs1/docs/symbols/Roo.grid.ColumnModel.html Roo.grid.ColumnModel]
+ * [http://www.akbkhome.com/roojs1/docs/symbols/Roo.grid.EditorGrid.html Roo.grid.EditorGrid]
+ * [http://www.akbkhome.com/roojs1/docs/symbols/Roo.grid.Grid.html Roo.grid.Grid]
+ * [http://www.akbkhome.com/roojs1/docs/symbols/Roo.grid.GridEditor.html Roo.grid.GridEditor]
+ * [http://www.akbkhome.com/roojs1/docs/symbols/Roo.grid.GridView.html Roo.grid.GridView]
+ * [http://www.akbkhome.com/roojs1/docs/symbols/Roo.PagingToolbar.html Roo.PagingToolbar]
+ * '''Examples'''
+  * [http://www.akbkhome.com/roojs1/examples/grid/array-grid.html Grid from Array]
+  * [http://www.akbkhome.com/roojs1/examples/grid/custom-grid.html Property Grid] 
+  * [http://www.akbkhome.com/roojs1/examples/grid/from-markup.html Grid from HTML markup] IE: css broken
+  * [http://www.akbkhome.com/roojs1/examples/grid/paging.html Paging Grid] FF: minor tidy up req, IE: Broken slightly when scrolling.
+  * [http://www.akbkhome.com/roojs1/examples/grid/edit-grid.html Editable Grid] 
+* '''Menu / Toolbars'''
+ * [http://www.akbkhome.com/roojs1/docs/symbols/Roo.menu.CheckItem.html Roo.menu.CheckItem]
+ * [http://www.akbkhome.com/roojs1/docs/symbols/Roo.menu.ColorItem.html Roo.menu.ColorItem]
+ * [http://www.akbkhome.com/roojs1/docs/symbols/Roo.menu.DateItem.html Roo.menu.DateItem]
+ * [http://www.akbkhome.com/roojs1/docs/symbols/Roo.menu.DateMenu.html Roo.menu.DateMenu]
+ * [http://www.akbkhome.com/roojs1/docs/symbols/Roo.menu.Menu.html Roo.menu.Menu]
+ * [http://www.akbkhome.com/roojs1/docs/symbols/Roo.menu.MenuMgr.html Roo.menu.MenuMgr]
+ * [http://www.akbkhome.com/roojs1/docs/symbols/Roo.menu.Separator.html Roo.menu.Separator]
+ * [http://www.akbkhome.com/roojs1/docs/symbols/Roo.menu.TextItem.html Roo.menu.TextItem]
+ * [http://www.akbkhome.com/roojs1/docs/symbols/Roo.Toolbar.html Roo.Toolbar]
+ * [http://www.akbkhome.com/roojs1/docs/symbols/Roo.Toolbar.Button.html Roo.Toolbar.Button]
+ * [http://www.akbkhome.com/roojs1/docs/symbols/Roo.Toolbar.Fill.html Roo.Toolbar.Fill]
+ * [http://www.akbkhome.com/roojs1/docs/symbols/Roo.Toolbar.Separator.html Roo.Toolbar.Separator]
+ * [http://www.akbkhome.com/roojs1/docs/symbols/Roo.Toolbar.Spacer.html Roo.Toolbar.Spacer]
+ * [http://www.akbkhome.com/roojs1/docs/symbols/Roo.Toolbar.SplitButton.html Roo.Toolbar.SplitButton]
+ * [http://www.akbkhome.com/roojs1/docs/symbols/Roo.Toolbar.TextItem.html Roo.Toolbar.TextItem]
+ * '''Examples'''
+  * [http://www.akbkhome.com/roojs1/examples/menu/menus.html Toolbar / Menus example] Minor css tweaking needed
+
+
+
+* '''View / Layers'''
+ * [http://www.akbkhome.com/roojs1/docs/symbols/Roo.JsonView.html Roo.JsonView]
+ * [http://www.akbkhome.com/roojs1/docs/symbols/Roo.Layer.html Roo.Layer]
+ * [http://www.akbkhome.com/roojs1/docs/symbols/Roo.View.html Roo.View]
+ * '''Examples'''
+  * [http://www.akbkhome.com/roojs1/examples/view/chooser.html Image Chooser]  
+
+* '''Layout / Tabs'''
+ * [http://www.akbkhome.com/roojs1/docs/symbols/Roo.BasicLayoutRegion.html Roo.BasicLayoutRegion]
+ * [http://www.akbkhome.com/roojs1/docs/symbols/Roo.BorderRegion.html Roo.BorderRegion]
+ * [http://www.akbkhome.com/roojs1/docs/symbols/Roo.ContentPanel.html Roo.ContentPanel]
+ * [http://www.akbkhome.com/roojs1/docs/symbols/Roo.LayoutRegion.html Roo.LayoutRegion]
+ * [http://www.akbkhome.com/roojs1/docs/symbols/Roo.NestedLayoutPanel.html Roo.NestedLayoutPanel]
+ * [http://www.akbkhome.com/roojs1/docs/symbols/Roo.ReaderLayout.html Roo.ReaderLayout]
+ * [http://www.akbkhome.com/roojs1/docs/symbols/Roo.SplitBar.html Roo.SplitBar]
+ * [http://www.akbkhome.com/roojs1/docs/symbols/Roo.SplitLayoutRegion.html Roo.SplitLayoutRegion]
+ * [http://www.akbkhome.com/roojs1/docs/symbols/Roo.TabPanel.html Roo.TabPanel]
+ * [http://www.akbkhome.com/roojs1/docs/symbols/Roo.TabPanelItem.html Roo.TabPanelItem]
+ * '''Examples'''
+  * [http://www.akbkhome.com/roojs1/examples/layout/simple.html Simple Layout]
+  * [http://www.akbkhome.com/roojs1/examples/layout/nested.html Nested Layout] 
+  * [http://www.akbkhome.com/roojs1/examples/layout/complex.html Complex Layout] Broken - needs converting to ``Roo JS``
+  * [http://www.akbkhome.com/roojs1/examples/tabs/tabs.html Basic Tabs] (borders broken on tab boxes)
+  * [http://www.akbkhome.com/roojs1/examples/tabs/tabs-adv.html Advanced Tabs] (dynamic adding of tabs)
+<TEND>
diff --git a/buildSDK/~doctree.txt b/buildSDK/~doctree.txt
new file mode 100644 (file)
index 0000000..d1cd52f
--- /dev/null
@@ -0,0 +1,168 @@
+
+  1. RooJS1 Core
+    1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.html - Main Roo Utils]
+    1. Dom/CSS/Text/JSON
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.util.CSS.html Roo.util.CSS]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.util.Format.html Roo.util.Format]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.util.TextMetrics.html Roo.util.TextMetrics]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.data.JSON.html Roo.data.JSON]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.DomHelper.html Roo.DomHelper]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.DomQuery.html Roo.DomQuery]
+    1. Element/Selection
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.Element.html Roo.Element]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.CompositeElement.html Roo.CompositeElement]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.CompositeElementLite.html Roo.CompositeElementLite]
+    1. Effects / Masks / Tips
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.Fx.html Roo.Fx]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.LoadMask.html Roo.LoadMask]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.QuickTips.html Roo.QuickTips]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.Resizable.html Roo.Resizable]
+    1. State
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.state.CookieProvider.html Roo.state.CookieProvider]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.state.Manager.html Roo.state.Manager]
+    1. Drag abd Drop
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.dd.DD.html Roo.dd.DD]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.dd.DDProxy.html Roo.dd.DDProxy]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.dd.DDTarget.html Roo.dd.DDTarget]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.dd.DragDrop.html Roo.dd.DragDrop]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.dd.DragDropMgr.html Roo.dd.DragDropMgr]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.dd.DragZone.html Roo.dd.DragZone]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.dd.DropTarget.html Roo.dd.DropTarget]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.dd.DropZone.html Roo.dd.DropZone]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.dd.Registry.html Roo.dd.Registry]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.dd.ScrollManager.html Roo.dd.ScrollManager]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.dd.StatusProxy.html Roo.dd.StatusProxy]
+    1. Signals / Events
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.util.Observable.html Roo.util.Observable]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.util.DelayedTask.html Roo.util.DelayedTask]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.util.TaskRunner.html Roo.util.TaskRunner]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.EventObject.html Roo.EventObject]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.Shadow.html Roo.Shadow]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.util.ClickRepeater.html Roo.util.ClickRepeater]
+    1. AJAX
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.data.Connection.html Roo.data.Connection]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.Ajax.html Roo.Ajax]
+    1. Store
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.util.MixedCollection.html Roo.util.MixedCollection]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.data.JsonStore.html Roo.data.JsonStore]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.data.Store.html Roo.data.Store]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.data.SimpleStore.html Roo.data.SimpleStore]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.data.Record.html Roo.data.Record]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.data.SortTypes.html Roo.data.SortTypes]
+    1. Data Readers
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.data.ArrayReader.html Roo.data.ArrayReader]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.data.DataReader.html Roo.data.DataReader]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.data.JsonReader.html Roo.data.JsonReader]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.data.XmlReader.html Roo.data.XmlReader]
+    1. Data Proxies
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.data.DataProxy.html Roo.data.DataProxy]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.data.HttpProxy.html Roo.data.HttpProxy]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.data.MemoryProxy.html Roo.data.MemoryProxy]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.data.ScriptTagProxy.html Roo.data.ScriptTagProxy]
+    1. Tree Data
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.data.Node.html Roo.data.Node]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.data.Tree.html Roo.data.Tree]
+    1. Keys
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.KeyMap.html Roo.KeyMap]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.KeyNav.html Roo.KeyNav]
+    1. Managers
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.ComponentMgr.html Roo.ComponentMgr]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.DialogManager.html Roo.DialogManager]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.EventManager.html Roo.EventManager]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.LayoutManager.html Roo.LayoutManager]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.UpdateManager.html Roo.UpdateManager]
+    1. Templates
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.MasterTemplate.html Roo.MasterTemplate]
+        1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.Template.html Roo.Template]
+       
+  1. Widgets
+   1. Hierachy /roojs1/docs/hierachy.html
+   1. Gallery http://www.roojs.com/trac/wiki/RooJS1/Gallery
+   1. Windows
+     1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.BasicDialog.html Roo.BasicDialog]
+     1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.LayoutDialog.html Roo.LayoutDialog]
+     1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.MessageBox.html Roo.MessageBox]
+   1. Buttons
+     1. Button
+     1. SplitButton
+   1. Form / Entry
+     1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.form.Action.html Roo.form.Action]
+     1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.form.BasicForm.html Roo.form.BasicForm]
+     1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.form.Checkbox.html Roo.form.Checkbox]
+     1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.form.Column.html Roo.form.Column]
+     1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.form.ComboBox.html Roo.form.ComboBox]
+     1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.form.DateField.html Roo.form.DateField]
+     1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.form.FieldSet.html Roo.form.FieldSet]
+     1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.form.Form.html Roo.form.Form]
+     1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.form.HtmlEditor.html Roo.form.HtmlEditor]
+     1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.form.NumberField.html Roo.form.NumberField]
+     1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.form.Radio.html Roo.form.Radio]
+     1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.form.TextArea.html Roo.form.TextArea]
+     1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.form.TextField.html Roo.form.TextField]
+     1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.form.VTypes.html Roo.form.VTypes]
+     1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.DatePicker.html Roo.DatePicker]
+   1. Tree
+     1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.tree.TreePanel.html Roo.tree.TreePanel]
+     1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.tree.TreeEditor.html Roo.tree.TreeEditor]
+     1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.tree.AsyncTreeNode.html Roo.tree.AsyncTreeNode]
+     1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.tree.TreeNode.html Roo.tree.TreeNode]
+     1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.tree.TreeFilter.html Roo.tree.TreeFilter]
+     1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.tree.TreeLoader.html Roo.tree.TreeLoader]
+     1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.tree.TreeSorter.html Roo.tree.TreeSorter]
+     1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.tree.DefaultSelectionModel.html Roo.tree.DefaultSelectionModel]
+     1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.tree.MultiSelectionModel.html Roo.tree.MultiSelectionModel]
+   1. Grid
+     1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.grid.GridPanel.html Roo.grid.GridPanel]
+     1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.grid.CellSelectionModel.html Roo.grid.CellSelectionModel]
+     1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.grid.RowSelectionModel.html Roo.grid.RowSelectionModel]
+     1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.grid.ColumnModel.html Roo.grid.ColumnModel]
+     1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.grid.EditorGrid.html Roo.grid.EditorGrid]
+     1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.grid.Grid.html Roo.grid.Grid]
+     1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.grid.GridEditor.html Roo.grid.GridEditor]
+     1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.grid.GridView.html Roo.grid.GridView]
+     1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.PagingToolbar.html Roo.PagingToolbar]
+   1. Menu / Toolbars
+     1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.menu.CheckItem.html Roo.menu.CheckItem]
+     1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.menu.ColorItem.html Roo.menu.ColorItem]
+     1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.menu.DateItem.html Roo.menu.DateItem]
+     1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.menu.DateMenu.html Roo.menu.DateMenu]
+     1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.menu.Menu.html Roo.menu.Menu]
+     1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.menu.MenuMgr.html Roo.menu.MenuMgr]
+     1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.menu.Separator.html Roo.menu.Separator]
+     1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.menu.TextItem.html Roo.menu.TextItem]
+     1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.Toolbar.html Roo.Toolbar]
+     1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.Toolbar.Button.html Roo.Toolbar.Button]
+     1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.Toolbar.Fill.html Roo.Toolbar.Fill]
+     1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.Toolbar.Separator.html Roo.Toolbar.Separator]
+     1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.Toolbar.Spacer.html Roo.Toolbar.Spacer]
+     1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.Toolbar.SplitButton.html Roo.Toolbar.SplitButton]
+     1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.Toolbar.TextItem.html Roo.Toolbar.TextItem]
+   1. View / Layers
+     1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.JsonView.html Roo.JsonView]
+     1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.Layer.html Roo.Layer]
+     1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.View.html Roo.View]
+   1. Layout
+     1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.BasicLayoutRegion.html Roo.BasicLayoutRegion]
+     1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.BorderRegion.html Roo.BorderRegion]
+     1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.ContentPanel.html Roo.ContentPanel]
+     1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.LayoutRegion.html Roo.LayoutRegion]
+     1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.NestedLayoutPanel.html Roo.NestedLayoutPanel]
+     1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.ReaderLayout.html Roo.ReaderLayout]
+     1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.SplitBar.html Roo.SplitBar]
+     1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.SplitLayoutRegion.html Roo.SplitLayoutRegion]
+     1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.TabPanel.html Roo.TabPanel]
+     1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.TabPanelItem.html Roo.TabPanelItem]
+1. Abstract Base Clases
+    1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.BoxComponent.html Roo.BoxComponent]
+    1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.Component.html Roo.Component]
+    1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.form.Field.html Roo.form.Field]
+    1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.form.Layout.html Roo.form.Layout]
+    1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.form.TriggerField.html Roo.form.TriggerField]
+    1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.grid.AbstractGridView.html Roo.grid.AbstractGridView]
+    1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.grid.AbstractSelectionModel.html Roo.grid.AbstractSelectionModel]
+    1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.menu.Adapter.html Roo.menu.Adapter]
+    1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.menu.BaseItem.html Roo.menu.BaseItem]
+    1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.menu.Item.html Roo.menu.Item] 
+    1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.state.Provider.html Roo.state.Provider]
+    1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.Editor.html Roo.Editor]
+    1. [http://www.akbkhome.com/roojs1/docs/symbols/Roo.Toolbar.Item.html Roo.Toolbar.Item]
diff --git a/css/basic-dialog.css b/css/basic-dialog.css
new file mode 100644 (file)
index 0000000..0fb7f09
--- /dev/null
@@ -0,0 +1,222 @@
+.x-dlg-proxy {\r
+       background-image: url(../images/default/gradient-bg.gif);\r
+       background-color:#c3daf9;\r
+       border:1px solid #6593cf;\r
+       z-index:10001;\r
+       overflow:hidden;\r
+       position:absolute;\r
+       left:0;top:0;\r
+}\r
+.x-dlg-shadow{\r
+       background:#aaaaaa;\r
+       position:absolute;\r
+       left:0;top:0;\r
+}\r
+.x-dlg-focus{\r
+       -moz-outline:0 none;\r
+       outline:0 none;\r
+       width:0;\r
+       height:0;\r
+       overflow:hidden;\r
+       position:absolute;\r
+       top:0;\r
+       left:0;\r
+}\r
+.x-dlg-mask{\r
+       z-index:10000;   \r
+   display:none;\r
+   position:absolute;\r
+   top:0;\r
+   left:0;\r
+   -moz-opacity: 0.5;\r
+   opacity:.50;\r
+   filter: alpha(opacity=50);\r
+   background-color:#CCC;\r
+}\r
+body.masked{\r
+}\r
+body.masked select {\r
+       visibility:hidden;\r
+}\r
+body.masked .x-dlg select {\r
+       visibility:visible;\r
+}\r
+.x-dlg{\r
+       z-index:10001;\r
+       overflow:hidden;\r
+       position:absolute;\r
+       left:300;top:0;\r
+}\r
+.x-resizable-proxy{\r
+       z-index:10002;\r
+}\r
+.x-dlg .x-dlg-hd {\r
+       background: url(../images/default/basic-dialog/hd-sprite.gif) repeat-x 0 -82px;\r
+       background-color:navy;\r
+       color:#ffffff;\r
+       font:bold 12px "sans serif", tahoma, verdana, helvetica;\r
+       overflow:hidden;\r
+       padding:5px;\r
+}\r
+.x-dlg .x-dlg-hd-left {\r
+       background: url(../images/default/basic-dialog/hd-sprite.gif) no-repeat 0 -41px;\r
+       padding-left:3px;\r
+       margin:0px;\r
+}\r
+.x-dlg .x-dlg-hd-right {\r
+       background: url(../images/default/basic-dialog/hd-sprite.gif) no-repeat right 0;\r
+       padding-right:3px;\r
+}\r
+.x-dlg .x-dlg-dlg-body{\r
+       background:url(../images/default/layout/gradient-bg.gif);\r
+       border:1px solid #6593cf;\r
+       border-top:0 none;\r
+       padding:10px;\r
+       overflow:hidden;\r
+}\r
+.x-dlg .x-dlg-bd{\r
+       overflow:hidden;\r
+}\r
+.x-dlg .x-dlg-ft{\r
+       overflow:hidden;\r
+       padding:5px;\r
+       padding-bottom:0;\r
+}\r
+.x-dlg .roo-tabbody{\r
+       background:white;\r
+       overflow:auto;\r
+}\r
+.x-dlg .x-tabs-top .roo-tabbody{\r
+       border:1px solid #6593cf;\r
+       border-top:0 none;\r
+}\r
+.x-dlg .x-tabs-bottom .roo-tabbody{\r
+       border:1px solid #6593cf;\r
+       border-bottom:0 none;\r
+}\r
+.x-dlg .x-layout-container  .roo-tabbody{\r
+       border:0 none;\r
+}\r
+.x-dlg .inner-tab{\r
+       margin:5px;\r
+}\r
+.x-dlg .x-dlg-ft .x-btn{\r
+       margin-right:5px;\r
+       float:right;\r
+       clear:none;\r
+}\r
+.x-dlg .x-dlg-ft .x-dlg-btns td {\r
+       border:0;\r
+       padding:0;\r
+}\r
+.x-dlg .x-dlg-ft .x-dlg-btns-right table{\r
+       float:right;\r
+       clear:none;\r
+}\r
+.x-dlg .x-dlg-ft .x-dlg-btns-left table{\r
+       float:left;\r
+       clear:none;\r
+}\r
+.x-dlg .x-dlg-ft .x-dlg-btns-center{\r
+       text-align:center; /*ie*/\r
+}\r
+.x-dlg .x-dlg-ft .x-dlg-btns-center table{\r
+       margin:0 auto; /*everyone else*/\r
+}\r
+.x-dlg-draggable .x-dlg-hd{\r
+       cursor:move;\r
+}\r
+.x-dlg-closable .x-dlg-hd{\r
+       padding-right:22px;\r
+}\r
+.x-dlg .x-dlg-close {\r
+       position:absolute;\r
+       top:4px;\r
+       right:4px;\r
+       z-index:6;\r
+       height:15px;\r
+       width:15px;\r
+       margin:0;\r
+       padding:0;\r
+       line-height:1px;\r
+       font-size:1px;\r
+       background-repeat:no-repeat;\r
+       cursor:pointer;\r
+       visibility:inherit;\r
+       background-image:url(../images/default/basic-dialog/close.gif);\r
+}\r
+.x-dlg div.x-resizable-handle-east{\r
+       background-image:url(../images/default/sizer/e-handle-dark.gif);\r
+       border:0;\r
+       background-position:left;\r
+       margin-right:0;\r
+}\r
+.x-dlg div.x-resizable-handle-south{\r
+       background-image:url(../images/default/sizer/s-handle-dark.gif);\r
+       border:0;\r
+       height:6px;\r
+}\r
+.x-dlg div.x-resizable-handle-west{\r
+       background-image:url(../images/default/sizer/e-handle-dark.gif);\r
+       border:0;\r
+       background-position:1px;\r
+}\r
+.x-dlg div.x-resizable-handle-north{\r
+       background-image:url(../images/default/s.gif);\r
+       border:0;\r
+}\r
+.x-dlg div.x-resizable-handle-northeast, .x-theme-gray .x-dlg div.x-resizable-handle-northeast{\r
+       background-image:url(../images/default/s.gif);\r
+       border:0;\r
+}\r
+.x-dlg div.x-resizable-handle-northwest, .x-theme-gray .x-dlg div.x-resizable-handle-northwest{\r
+       background-image:url(../images/default/s.gif);\r
+       border:0;\r
+}\r
+.x-dlg div.x-resizable-handle-southeast{\r
+       background-image:url(../images/default/sizer/corners-sprite.gif);\r
+       background-position: top left;\r
+       width:8px;\r
+       height:8px;\r
+       border:0;\r
+}\r
+.x-dlg div.x-resizable-handle-southwest{\r
+       background-image:url(../images/default/sizer/corners-sprite.gif);\r
+       background-position: top right;\r
+       margin-left:1px;\r
+       margin-bottom:1px;\r
+       border:0;\r
+}\r
+\r
+#x-msg-box .x-dlg-ft .x-btn{\r
+       float:none;\r
+       clear:none;\r
+       margin:0 3px;\r
+}\r
+\r
+#x-msg-box .x-dlg-bd {\r
+       padding:5px;\r
+       overflow:hidden !important;\r
+}\r
+#x-msg-box .roo-mb-input {\r
+       margin-top:4px;\r
+       width:95%;\r
+}\r
+#x-msg-box .roo-mb-textarea {\r
+       margin-top:4px;\r
+       font:normal 13px verdana,tahoma,sans-serif;\r
+}\r
+#x-msg-box .roo-mb-progress-wrap {\r
+       margin-top:4px;\r
+       border:1px solid #6593cf;\r
+}\r
+#x-msg-box .roo-mb-progress {\r
+       height:18px;\r
+       background:transparent url(../images/default/basic-dialog/progress2.gif) repeat-x 1px 1px;\r
+}\r
+#x-msg-box .roo-mb-progress-bar {\r
+       height:18px;\r
+       overflow:hidden;\r
+       width:0;\r
+       background:#8bb8f3;\r
+}
\ No newline at end of file
diff --git a/css/button.css b/css/button.css
new file mode 100644 (file)
index 0000000..8230b36
--- /dev/null
@@ -0,0 +1,175 @@
+
+
+/* ------------ BUTTON FONTS ------------------ */
+
+.x-btn
+{
+       font:normal 9px arial, tahoma, verdana, helvetica;
+       white-space: nowrap;
+    text-decoration:none !important;
+    color:black !important;
+    -moz-user-select: none;
+       -khtml-user-select: none;
+    cursor:pointer;
+    /** no sure **/
+    vertical-align: middle;
+    text-align:center;
+    border: 0px none;
+}
+/* override em (which is what the <button> is wrapped in) */
+.x-btn em
+{
+    font-weight: normal;
+    font-style: normal;
+}
+/* -------- BUTTON LEFT RIGHT MAKE SMALL */
+.x-toolbar .x-btn-left, 
+.x-toolbar .x-btn-right,
+
+.x-btn-left, 
+.x-btn-right
+{\r
+       font-size:1px;\r
+       line-height:1px;
+    width: 3px;\r
+}
+
+
+.x-btn-left i 
+.x-btn-right i 
+{
+    display: block;
+    overflow: hidden
+    width: 3px;
+    line-height: 1px;
+    font-size: 1px;
+    /*
+    padding: 0px;
+    margin: 0px;
+    */
+    
+}
+
+/* -------- BUTTON BACKGROUND IMAGE -------------- */\r
+.x-btn-left,
+.x-btn-center,
+.x-btn-right
+
+{
+    background-image :url(../images/default/basic-dialog/btn-sprite.gif);
+    background-repeat: no-repeat;
+    /* might have height, and padding / margin zero'd */
+    height:21px;
+    
+    \r
+}
+.x-btn-left
+{
+    background-position:0 0;
+}
+.x-btn-right
+{\r
+       background-position:0 -21px;
+}
+.x-btn-center
+{
+       background-position: 0 -42px;
+    background-repeat: repeat-x;
+    width:auto; 
+    /* ??? not sure **/
+    padding:0 5px;
+    
+}
+/* -------------------------- BUTTON OVER -------------------------- */
+.x-btn-over .x-btn-left
+{
+       background-position:0 -63px;
+}
+.x-btn-over .x-btn-right
+{
+       background-position:0 -84px;
+}
+.x-btn-over .x-btn-center
+{
+       background-position:0 -105px;
+}
+/* -------------------------- BUTTON CLICK -------------------------- */
+.x-btn-click .x-btn-left
+{
+       background-position:0 -63px; /* FIXME */
+}
+.x-btn-click .x-btn-right
+{
+       background-position:0 -84px; /* FIXME */
+}
+.x-btn-click .x-btn-center
+{
+       background-position:0 -126px;
+}
+
+/* -------------------------- BUTTON FOCUS -------------------------- */\r
+/* ??? any special settings ?? */\r
+/* -------------------------- BUTTON DISABLED -------------------------- */ 
+.x-btn .x-btn-disabled
+{
+       cursor:default;
+}
+.x-btn-disabled .x-btn-center
+{
+       color:gray;
+}
+/* -------------------------- BUTTON ELEMENT -------------------------- */ 
+.x-btn button {
+    font-size: 11px;
+    background: none;
+    cursor:pointer;
+    margin: 0px;
+    outline: none;
+    color: -moz-use-text-color;
+    overflow: visible;
+    width: auto;
+    border: 0px none;
+}
+.roo-gecko .x-btn button
+{
+    padding-left: 0px;
+    padding-right: 0px;
+}\r
+/* -------------------------- BUTTON WITH ICONS  -------------------------- */ 
+.x-btn-text-icon .x-btn-center .x-btn-text
+{
+   background-position:0 2px; 
+    /* padding : 3px 0 2px 18px; */
+    padding : 0 0 2px 18px; 
+
+}
+/* -------------------------- BUTTON WITH MENUS  -------------------------- */ 
+button.x-btn-menu-arrow-el
+{
+    display: block;
+    background: url(../images/default/grid/sort_desc.gif) no-repeat scroll left 7px;
+}
+
+.x-btn-text-icon .x-btn-with-menu .x-btn-center em
+{
+    display: block;
+    background: url(../images/default/grid/sort_desc.gif) no-repeat scroll right 6px;
+}
+
+.x-btn-with-menu .x-btn-center em
+{
+    display: block;
+    /* ??? background: url(../images/default/grid/sort_desc.gif) no-repeat scroll right 3px */
+    padding-right: 14px;
+    
+}
+.x-btn-pressed .x-btn-center .x-btn-text
+{
+    /* padding : 3px 0 2px 18px; */
+    padding : 0 0 2px 0px; 
+}
+\r
+  
\ No newline at end of file
diff --git a/css/combo.css b/css/combo.css
new file mode 100644 (file)
index 0000000..ba1cde1
--- /dev/null
@@ -0,0 +1,80 @@
+/**
+ * based on : http://home.exetel.com.au/cweatures/combosample/combotest.html
+ */
+
+
+
+
+/*
+.dojoComboBoxInputInvalid {
+ color: red;
+}
+*/
+/* the drop down area */
+.x-combo-list {
+        /** see for for the font stuff... */
+     
+     background-color: white;
+     border: 1px solid #afafaf;
+      
+     cursor: default;
+}
+.x-combo-list-inner {
+    overflow: auto;
+   
+}
+.x-combo-list-item {
+     padding-left: 2px;
+     padding-top: 0px;
+     margin: 0px;
+     padding-bottom: 2px;
+     white-space: nowrap;
+}
+.x-combo-selected {
+     background-color: #ABC9C2;
+     color: black;
+     border: 1px solid #5e8a7f;
+}
+
+/* The div holding the arrow background image */
+
+/** --- dummy for date... */
+  
+
+.x-form-date-trigger,
+.x-form-arrow-trigger 
+{
+     border: 1px solid black;
+     width:18px;  
+     height:20px;  
+     background:url(../images/default/combo/arrow.gif); /* arrow image, 15x15px */
+     background-repeat:no-repeat;
+     background-position:center; /* centers image in div, creating 1px white border effect */
+}
+.roo-ie .x-form-field-wrap .x-form-trigger,
+.roo-ie .x-toolbar .x-form-arrow-trigger 
+{
+    margin: 0px;
+}
+.roo-ie .x-form-arrow-trigger,
+.roo-ie .x-form-date-trigger
+{
+    height:18px;  
+}
+.roo-safari .x-form-arrow-trigger,
+.roo-safari .x-form-date-trigger
+{
+    position: relative; 
+    left: 0px; 
+    top: 6px;
+    height: 18px;
+}
+
+
+
+
+
+
+
diff --git a/css/copyright_status.txt b/css/copyright_status.txt
new file mode 100644 (file)
index 0000000..d0e0364
--- /dev/null
@@ -0,0 +1,10 @@
+This CSS and images where taken from http://demo.xteconline.com/system/js/builds/yui-ext.0.40.alpha1/
+- which was released under a BSD like licence.
+
+CSS files have been modifed - replacing .y*** with .x-***
+
+
+
+
+
+
diff --git a/css/core.css b/css/core.css
new file mode 100644 (file)
index 0000000..3e55022
--- /dev/null
@@ -0,0 +1,91 @@
+.roo-el-mask {\r
+       z-index:20000;   \r
+   position:absolute;\r
+   top:0;\r
+   left:0;\r
+   -moz-opacity: 0.5;\r
+   opacity:.50;\r
+   filter: alpha(opacity=50);\r
+   background-color:#CCC;\r
+       width:100%;\r
+       height:100%;\r
+       zoom:1;\r
+}\r
+.x-body-masked {\r
+       overflow:hidden !important;\r
+}\r
+.x-body-masked select,.ext-masked object,.ext-masked embed{\r
+        visibility:hidden;\r
+}
+\r
+.x-shadow
+{\r
+       background:#cccccc;\r
+   opacity:.3;\r
+   -moz-opacity:.3;\r
+   filter: alpha(opacity=30);
+   position: absolute;
+   overflow: hidden;
+   left: 0px;
+   top: 0px;
+   display: none;\r
+}
+/** --- top/bottom left / right shadow */
+.x-shadow .xstl,
+.x-shadow .xstr,
+.x-shadow .xsbl
+.x-shadow .xsbr
+{
+    height: 7px;
+    width: 7px;
+    float: left;
+}
+
+
+/** --- middle left / right shadow */
+.x-shadow .xsml,
+.x-shadow .xsmr
+{
+    height: 100%;
+    width: 7px;
+    float: left;
+}
+
+/** --- top center / bottom center ? shadow */
+.x-shadow .xstc,
+.x-shadow .xsbc
+{
+    height: 7px;
+    float: left;
+}
+
+.x-shadow * 
+{
+    overflow: hidden;
+    clear: none;
+    background:#cccccc;
+   opacity:.3;
+   -moz-opacity:.3;
+    filter: alpha(opacity=30);
+}
+/** silly kludge for IE with select's under divs */
+.roo-ie .roo-shim {
+    filter: alpha(opacity=0);
+}
+.roo-shim {    
+    position: absolute;
+    left: 0px; 
+    top: 0px
+    visibility: hidden;        
+    overflow: hidden;  
+    
+}
+
+.x-hidden 
+{
+   position:absolute;
+   top:0;
+   left:0;
+   visibility: hidden;
+   display: none;
+}
\ No newline at end of file
diff --git a/css/date.css b/css/date.css
new file mode 100644 (file)
index 0000000..2b3b7cb
--- /dev/null
@@ -0,0 +1,250 @@
+/*** DATE AND COLOR PICKER **/
+
+
+
+/* ------------------- DATE --------------------- */
+x-date
+{
+       background: white;
+       padding:2px;
+       border: 1px solid gray;
+       z-index:12001;
+       -moz-outline:none;
+       position:absolute;
+       display:none;
+       top:0;
+       left:0;
+}
+.x-date-shadow {
+       background: #dddddd;
+       filter: progid:DXImageTransform.Microsoft.Blur(MakeShadow=true,pixelradius=1) Alpha(opacity=35,style=1,startX=0,finishX=200,FinishOpacity=35);
+       padding: 0;
+       position:absolute;
+       z-index:12000;
+       display:none; 
+       top:0; 
+       left:0;
+}
+.x-date-head{
+       width:150px;
+       background: #93b5e4;
+}
+.x-date-head td{
+       padding:1px;
+}
+.x-date-month{
+       color: white;
+       font: bold 7pt verdana;
+       text-decoration: none;
+       text-align:center;
+}
+.x-date-head .x-date-arrow{
+       width:16px;
+       text-align:center;
+       cursor:pointer;
+       -moz-user-select: none;
+}
+
+
+.x-date-picker {
+       background: #ccc;
+    width: 190px;
+       /* border-bottom: 1px solid #cccccc; */
+}
+.x-date-picker tr{
+       
+}
+.x-date-picker td{
+       /*
+    box-sizing: border-box;
+       -moz-box-sizing: border-box;
+       border: 1px solid white;
+       */
+       color:#aaaaaa;
+       cursor:pointer;
+       font:normal 8pt arial;
+       /*
+       padding:1px 2px; */
+       /* width:12px;
+       height:12px;
+    */
+    
+}
+
+td.x-date-middle
+{
+    background: url(../images/default/basic-dialog/hd-sprite.gif); 
+}
+td.x-date-middle td
+{
+    background: none; 
+    color: #000;
+    font-weight: bold;
+}
+td.x-date-right ,
+td.x-date-left
+{
+    background: url(../images/default/basic-dialog/hd-sprite.gif) repeat-x 0 0;  
+    text-align: center;
+    width: 18px;
+}
+
+td.x-date-right a {
+       /* width:16px; */
+       background: url(../images/default/grid/arrow-right-white.gif) no-repeat right center;
+       cursor:pointer;
+    text-decoration: none;
+}
+td.x-date-left a {
+       /* width:16px; */
+       background: url(../images/default/grid/arrow-left-white.gif)  no-repeat 0 center;
+       cursor:pointer;
+    text-decoration: none;
+}
+.x-date-inner {
+    background-color: white; 
+    /* width: 100%; */
+    position: relative;
+    text-align: center;
+    display: block;
+    overflow:hidden;
+    border-collapse:separate;
+
+}
+table.x-date-inner {
+    table-layout:fixed;
+    width: 100%;
+}
+
+
+.x-date-inner td {
+    width:26px;
+    height:26px;
+    border-collapse:separate;
+}
+.x-date-mp a,
+.x-date-inner a 
+{
+    text-decoration: none;
+    font-weight: bold;
+    color: #000;
+}
+
+.x-date-picker td.x-date-today {
+       border: 1px solid darkred;
+}
+.x-date-picker .x-date-inner th{
+       text-align:center !important;
+       border:0;
+       border-bottom: 1px solid #cccccc;
+       font-size: 8pt;
+       font-weight: normal;
+       text-align:right;
+       color:black;
+       cursor:default;
+}
+.x-date-picker td.active{
+       cursor:pointer;
+       color:black;
+}
+.x-date-picker td.x-date-disabled{
+       cursor:default;
+       background:#eeeeee;
+       border: 1px solid #eeeeee;
+       color:#bbbbbb;
+}
+
+.x-date-mp td.x-date-mp-sel,
+
+.x-date-picker td.x-date-selected{
+       background: #ddecfe;
+       border: 1px solid #c3daf9;
+}
+.x-date-today{
+       color: black;
+       cursor: hand;
+       /* display: inline-block; */
+       font: normal 8pt arial;
+       /* margin-left: 2px;  */
+       text-decoration: none;
+    
+       /* margin-top:2px; */
+}
+
+.x-date-prevday,
+.x-date-nextday {
+    background-color: #aac;
+}
+/* the month/year pulldown */
+.x-date-mp {
+    background-color: #ccc;
+    
+    display: none;
+    position: absolute;
+    top: 0;
+    left 0;
+     
+}
+.x-date-mp table {
+   text-align: center;
+    background-color: #fff;
+    
+}
+.x-date-picker td.x-date-middle td.x-btn-center button {
+    color: white;
+}
+
+
+
+/* ------------------- COLOR PICKER --------------------- */
+
+
+.x-menu-plain .x-color-palette,
+.x-menu-plain .x-date-picker
+{
+    border: none;
+    margin : 0px;
+}
+
+
+.x-menu .x-color-palette,
+.x-menu .x-date-picker
+{
+    margin-left: 32px;
+    margin-right: 4px;
+    
+}
+.x-color-palette
+{
+    pointer: pointer;
+    width: 150px;
+    height: 92px;
+}
+
+.x-color-palette a
+{
+    border: 1px solid white;
+    pointer: pointer;
+    float: left;
+    padding: 2px;
+    text-decoration: none;
+    outline: white none 0;
+}
+
+.x-color-palette em span
+{
+    pointer: pointer;
+    display: block;
+    width: 10px;
+    height: 10px;
+    line-height: 10px;
+
+}
+.x-color-palette em
+{
+    
+    display: block;
+    border: 1pt solid black;
+}
+
diff --git a/css/dd.css b/css/dd.css
new file mode 100644 (file)
index 0000000..b21a4e4
--- /dev/null
@@ -0,0 +1,53 @@
+.x-dd-drag-proxy{\r
+       position:absolute;\r
+       left:0;top:0;\r
+       visibility:hidden;\r
+       z-index:15000;\r
+}\r
+.x-dd-drag-ghost{\r
+       color: black;\r
+       font: normal 11px arial, helvetica, sans-serif;\r
+       -moz-opacity: 0.85;\r
+   opacity:.85;\r
+   filter: alpha(opacity=85);\r
+       border-top:1px solid #dddddd;\r
+       border-left:1px solid #dddddd;\r
+       border-right:1px solid #bbbbbb;\r
+       border-bottom:1px solid #bbbbbb;\r
+       padding:3px;\r
+       padding-left:20px;\r
+       background-color:white;\r
+       white-space:nowrap;\r
+}\r
+.x-dd-drag-repair .x-dd-drag-ghost{\r
+       -moz-opacity: 0.4;\r
+   opacity:.4;\r
+   filter: alpha(opacity=40);\r
+       border:0 none;\r
+       padding:0;\r
+       background-color:transparent;\r
+}\r
+.x-dd-drag-repair .x-dd-drop-icon{\r
+       visibility:hidden;\r
+}\r
+.x-dd-drop-icon{\r
+  position:absolute;\r
+       top:3px;\r
+       left:3px;\r
+       display:block;\r
+       width:16px;\r
+       height:16px;\r
+       background-color:transparent;\r
+       background-position: center;\r
+       background-repeat: no-repeat;\r
+       z-index:1;\r
+}\r
+.x-dd-drop-nodrop .x-dd-drop-icon{\r
+  background-image: url(../images/default/dd/drop-no.gif);\r
+}\r
+.x-dd-drop-ok .x-dd-drop-icon{\r
+  background-image: url(../images/default/dd/drop-yes.gif);\r
+}\r
+.x-dd-drop-ok-add .x-dd-drop-icon{\r
+  background-image: url(../images/default/dd/drop-add.gif);\r
+}
\ No newline at end of file
diff --git a/css/form.css b/css/form.css
new file mode 100644 (file)
index 0000000..b9e6dfa
--- /dev/null
@@ -0,0 +1,264 @@
+/* Form CSS - based on details in form_design.svg  */
+
+
+/* ---------------------- LABELS --------------------- */
+.x-form-item label
+{
+    clear:left;
+    display : block;
+    float : left;
+    padding-left: 0px;
+    padding-right: 3px;
+    padding-bottom: 3px;
+    padding-top: 3px;
+    position: relative;
+    z-index: 2;
+}
+
+.x-form-label-right
+{
+    align: right;
+}
+
+.x-form-label-top .x-form-item label
+{
+    clear: none;
+    float: none;
+    display: inline;
+    position: static;
+    margin-bottom: 2px;
+    width: auto;
+}
+
+/* ---------------------- FONTS --------------------- */
+/* --- move to a more generic place... ---*/
+.x-form-item,
+.x-form-text,
+.x-combo-list
+{
+    font: normal 11px tahoma, verdana, helvetica;
+}
+
+/* ---------------------- FORM ITEM/ELEMENT/TEXT WRAPPING --------------------- */
+.x-form-item {
+    display : block;
+    margin-bottom: 4px;
+}
+
+.x-form-element {
+    padding-left : 100px;
+    position: relative;
+}
+.x-form-field
+{
+    margin: 0px;
+    
+}
+.x-form-text 
+{
+    height: 20px;
+    line-height: 18px;
+    vertical-align: middle;
+    background: url(../images/default/form/bg.gif) repeat-x 0 0;  
+   
+    padding-left: 2px;
+    padding-right: 2px;
+    padding-top: 2px;
+    padding-bottom: 2px;
+}
+/* -- border around text elements */
+.x-form-text,
+.x-form-textarea,
+.x-html-editor-wrap
+{    
+ border: solid 1px black;
+}
+.x-form-field-wrap
+{
+    position: relative;
+    whitespace: nowrap;
+}
+
+asdffff
+/* gecko specific fix */
+
+}
+.roo-ie .roo-strict .x-form-text,
+.roo-ie .x-form-text
+{
+    padding-top: 0px;
+    padding-bottom: 0px;
+    margin-top: -1px;
+    height: 22px;
+}
+
+.roo-ie .x-toolbar .x-form-text
+{
+    
+    padding-top: 0px;
+    padding-left: 2px;
+    height: 18px !important;
+}
+
+
+.roo-ie .x-form-date-trigger,
+.roo-ie .x-form-arrow-trigger 
+{
+    margin: 0px;
+    margin-top: 1px;
+    height: 20px !important;
+}
+
+/** some kind of kludge for the combo demo */
+.roo-gecko .roo-strict .x-form-text {
+    height:18px;
+}
+
+.roo-gecko .x-form-item .x-form-text {
+    height:18px;
+}
+.roo-gecko .x-form-text {
+    height:18px;
+    padding-top: 2px;
+    padding-bottom: 0px;
+}
+
+/* ---------------------- FORM INVALID --------------------- */
+
+.x-form-invalid-icon 
+{
+    display: block;
+    position: absolute;
+    top: 0px;
+    left: 0px;
+    height: 16px;
+    width: 16px;
+    visibility: hidden;
+    /* need a nice icon for this */
+    background: url(../images/default/tree/drop-no.gif) no-repeat 0 0;
+    
+}
+.x-form-invalid
+{
+    
+    background: url(../images/default/grid/invalid_line.gif) repeat-x 0 16px;
+    border: 1px solid red;
+}
+textarea.x-form-invalid
+{
+    background: none;
+    
+}
+
+
+/* ---------------------- FORM LINE CLEARER  --------------------- */
+
+.x-form-clear-left ,
+.x-form-clear,
+{
+    font-size: 0px;
+    height: 0px;
+    line-height: 0px;
+    overflow: hidden;
+}
+.x-form-clear-left
+{
+    clear: left;
+}
+.x-form-clear
+{
+    clear: both;
+}
+
+/* ---------------------- FORM COLUMNS --------------------- */
+
+.x-form-column
+{
+    float: left;
+    margin: 0px;
+    padding: 0px;
+    overflow: hidden;
+    width: 47%;
+    
+}
+
+/* ---------------------- FORM FIELDSETS --------------------- */
+
+
+.x-form fieldset
+{
+    border: 1px solid #ccc;
+    padding-top: 12px;
+    padding-left: 12px;
+    padding-bottom: 16px;
+    
+    
+}
+
+
+/* ---------------------- FORM CHECKBOXES --------------------- */
+
+.x-form-cb-label
+{
+    clear :none !important;
+    float: none !important;;
+    display: inline !important;;
+    margin-left: 4px;
+}
+
+/* ---------------------- FORM COMBOS --------------------- */
+
+/** -- see also the combo.css */
+
+.x-form-field-wrap .x-form-trigger {
+     
+     cursor: pointer;
+     border-left: 0px solid;
+     
+     position: absolute;
+     
+     top:0px;
+     background:url(../images/default/combo/arrow.gif); /* arrow image, 15x15px */
+     background-repeat:no-repeat;
+     background-position:center; /* centers image in div, creating 1px white border effect */
+}
+
+
+
+/* ---------------------- FORM BUTTON BAR --------------------- */
+
+.x-form .x-form-btns-ct .x-form-btns-center {
+    text-align: center;
+}
+.x-form .x-form-btns-ct .x-form-btns-center table {
+    margin: 0px auto;
+}
+
+.x-form .x-form-btns-ct   .x-form-btns td.x-form-btn-td {
+    padding: 3px;
+}
+
+.x-form .x-form-btns-ct .x-form-btns td  {
+    border: 0px;
+    padding: 0px;
+}
+
+.x-form .x-form-btns-ct .x-btn {
+    clear: none;
+    float: right;
+}
+
+/* ---------------------- FORM RESIZE CALC TRICK --------------------- */
+.x-form-grow-sizer
+{
+    position: absolute;
+    top: -10000px;
+    left: -10000px;
+    visibility: hidden;
+}
+
+
+
+
+
+
diff --git a/css/form_design.svg b/css/form_design.svg
new file mode 100644 (file)
index 0000000..c4e5eae
--- /dev/null
@@ -0,0 +1,764 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="744.09448819"
+   height="1052.3622047"
+   id="svg2"
+   sodipodi:version="0.32"
+   inkscape:version="0.46"
+   sodipodi:docname="form_design.svg"
+   inkscape:output_extension="org.inkscape.output.svg.inkscape">
+  <defs
+     id="defs4">
+    <inkscape:perspective
+       sodipodi:type="inkscape:persp3d"
+       inkscape:vp_x="0 : 526.18109 : 1"
+       inkscape:vp_y="0 : 1000 : 0"
+       inkscape:vp_z="744.09448 : 526.18109 : 1"
+       inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
+       id="perspective10" />
+  </defs>
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     gridtolerance="10000"
+     guidetolerance="10"
+     objecttolerance="10"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="0.98994949"
+     inkscape:cx="526.83634"
+     inkscape:cy="224.48126"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer1"
+     showgrid="false"
+     inkscape:window-width="1280"
+     inkscape:window-height="971"
+     inkscape:window-x="0"
+     inkscape:window-y="27" />
+  <metadata
+     id="metadata7">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     inkscape:label="Layer 1"
+     inkscape:groupmode="layer"
+     id="layer1">
+    <rect
+       style="fill:#ffffff;stroke:#e6e6e6;stroke-width:1;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+       id="rect2383"
+       width="341.43155"
+       height="263.64981"
+       x="186.87822"
+       y="157.36703" />
+    <text
+       xml:space="preserve"
+       style="font-size:12px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+       x="211.12189"
+       y="180.60052"
+       id="text3155"><tspan
+         sodipodi:role="line"
+         id="tspan3157"
+         x="211.12189"
+         y="180.60052">Form</tspan></text>
+    <text
+       xml:space="preserve"
+       style="font-size:12px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+       x="208.09143"
+       y="216.96602"
+       id="text3159"><tspan
+         sodipodi:role="line"
+         id="tspan3161"
+         x="208.09143"
+         y="216.96602">Label :</tspan></text>
+    <rect
+       style="fill:#f2f2f2;stroke:#e6e6e6;stroke-width:1;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+       id="rect3163"
+       width="195.66949"
+       height="19.902964"
+       x="284.50797"
+       y="203.98409" />
+    <text
+       xml:space="preserve"
+       style="font-size:12px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+       x="291.93411"
+       y="89.686798"
+       id="text3165"><tspan
+         sodipodi:role="line"
+         id="tspan3167"
+         x="291.93411"
+         y="89.686798">&lt;form  class=&quot;x-form&quot;&gt;</tspan><tspan
+         sodipodi:role="line"
+         x="291.93411"
+         y="104.6868"
+         id="tspan3169">     &lt;div class=&quot;x-form-ct&quot;&gt;</tspan><tspan
+         sodipodi:role="line"
+         x="291.93411"
+         y="119.6868"
+         id="tspan3223">No styling?</tspan></text>
+    <rect
+       style="fill:none;stroke:#000000;stroke-width:1;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:1.00000001, 1.00000001;stroke-dashoffset:0;stroke-opacity:1"
+       id="rect3171"
+       width="324.25897"
+       height="61.619305"
+       x="196.97975"
+       y="196.76297" />
+    <path
+       style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       d="M 522.24887,198.78328 L 591.94939,131.10306"
+       id="path3175" />
+    <text
+       xml:space="preserve"
+       style="font-size:12px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+       x="595.98999"
+       y="129.08275"
+       id="text3177"><tspan
+         sodipodi:role="line"
+         id="tspan3179"
+         x="595.98999"
+         y="129.08275">&lt;div class=&quot;x-form-item&quot;&gt;</tspan><tspan
+         sodipodi:role="line"
+         x="595.98999"
+         y="144.08275"
+         id="tspan3181" /><tspan
+         sodipodi:role="line"
+         x="595.98999"
+         y="159.08275"
+         id="tspan3183">*** block</tspan><tspan
+         sodipodi:role="line"
+         x="595.98999"
+         y="174.08275"
+         id="tspan3185">margins (4px bottom)</tspan><tspan
+         sodipodi:role="line"
+         x="595.98999"
+         y="189.08275"
+         id="tspan3187">Various font settings:</tspan></text>
+    <path
+       style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       d="M 214.15234,209.89496 L 186.87822,147.2655"
+       id="path3189"
+       sodipodi:nodetypes="cc" />
+    <text
+       xml:space="preserve"
+       style="font-size:12px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+       x="56.56855"
+       y="60.392387"
+       id="text3191"><tspan
+         sodipodi:role="line"
+         id="tspan3193"
+         x="56.56855"
+         y="60.392387">&lt;label&gt;</tspan><tspan
+         sodipodi:role="line"
+         x="56.56855"
+         y="75.392387"
+         id="tspan3195">styled by : .x-form-item label</tspan><tspan
+         sodipodi:role="line"
+         x="56.56855"
+         y="90.392387"
+         id="tspan3197">clear: left</tspan><tspan
+         sodipodi:role="line"
+         x="56.56855"
+         y="105.39239"
+         id="tspan3199">block</tspan><tspan
+         sodipodi:role="line"
+         x="56.56855"
+         y="120.39239"
+         id="tspan3201">float: left</tspan><tspan
+         sodipodi:role="line"
+         x="56.56855"
+         y="135.3924"
+         id="tspan3203">paddings (3px  except left(0))</tspan><tspan
+         sodipodi:role="line"
+         x="56.56855"
+         y="150.3924"
+         id="tspan3205">position: relative</tspan><tspan
+         sodipodi:role="line"
+         x="56.56855"
+         y="165.3924"
+         id="tspan3207">z-index'd 2</tspan><tspan
+         sodipodi:role="line"
+         x="56.56855"
+         y="180.3924"
+         id="tspan3413" /><tspan
+         sodipodi:role="line"
+         x="56.56855"
+         y="195.3924"
+         id="tspan3415">.x-form-label-right</tspan><tspan
+         sodipodi:role="line"
+         x="56.56855"
+         y="210.3924"
+         id="tspan3417">aligns right only</tspan></text>
+    <rect
+       style="fill:none;stroke:#000000;stroke-width:1;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:1.00000005, 1.00000005;stroke-dashoffset:0;stroke-opacity:1"
+       id="rect3209"
+       width="256.57877"
+       height="28.284271"
+       x="255.06352"
+       y="201.30867" />
+    <path
+       style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       d="M 405.07117,231.10816 L 495.9849,455.36203"
+       id="path3211" />
+    <text
+       xml:space="preserve"
+       style="font-size:12px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+       x="512.14734"
+       y="466.47372"
+       id="text3213"><tspan
+         sodipodi:role="line"
+         id="tspan3215"
+         x="512.14734"
+         y="466.47372">&lt;div class=&quot;x-form-element&quot;&gt;</tspan><tspan
+         sodipodi:role="line"
+         x="512.14734"
+         y="481.47372"
+         id="tspan3217">x-form-element:</tspan><tspan
+         sodipodi:role="line"
+         x="512.14734"
+         y="496.47372"
+         id="tspan3219"> - padding on left ~ 100</tspan><tspan
+         sodipodi:role="line"
+         x="512.14734"
+         y="511.47372"
+         id="tspan3221">relative positioning</tspan></text>
+    <path
+       style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       d="M 318.19805,214.94572 L 192.93914,456.37218"
+       id="path3225" />
+    <text
+       xml:space="preserve"
+       style="font-size:12px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+       x="26.263969"
+       y="463.44327"
+       id="text3227"><tspan
+         sodipodi:role="line"
+         id="tspan3229"
+         x="26.263969"
+         y="463.44327">&lt;input class=&quot;x-form-text x-form-field x-form-invalid&quot;&gt;</tspan><tspan
+         sodipodi:role="line"
+         x="26.263969"
+         y="478.44327"
+         id="tspan3235" /><tspan
+         sodipodi:role="line"
+         x="26.263969"
+         y="493.44324"
+         id="tspan3237">gecko specific: x-form-text</tspan><tspan
+         sodipodi:role="line"
+         x="26.263969"
+         y="508.44324"
+         id="tspan3239">pads top: 2px  , bottom 0</tspan><tspan
+         sodipodi:role="line"
+         x="26.263969"
+         y="523.44324"
+         id="tspan3241" /><tspan
+         sodipodi:role="line"
+         x="26.263969"
+         y="538.44324"
+         id="tspan3243">invalid : </tspan><tspan
+         sodipodi:role="line"
+         x="26.263969"
+         y="553.44324"
+         id="tspan3245">// background uses grid/invalid_line</tspan><tspan
+         sodipodi:role="line"
+         x="26.263969"
+         y="568.44324"
+         id="tspan3247">and border is red.</tspan><tspan
+         sodipodi:role="line"
+         x="26.263969"
+         y="583.44324"
+         id="tspan3249" /><tspan
+         sodipodi:role="line"
+         x="26.263969"
+         y="598.44324"
+         id="tspan3251">text</tspan><tspan
+         sodipodi:role="line"
+         x="26.263969"
+         y="613.44324"
+         id="tspan3253">22px high</tspan><tspan
+         sodipodi:role="line"
+         x="26.263969"
+         y="628.44324"
+         id="tspan3255">lineheight set to 4px less.</tspan><tspan
+         sodipodi:role="line"
+         x="26.263969"
+         y="643.44324"
+         id="tspan3257">vertical middle alignment </tspan><tspan
+         sodipodi:role="line"
+         x="26.263969"
+         y="658.44324"
+         id="tspan3259" /><tspan
+         sodipodi:role="line"
+         x="26.263969"
+         y="673.44324"
+         id="tspan3261">background uses a image, </tspan><tspan
+         sodipodi:role="line"
+         x="26.263969"
+         y="688.44324"
+         id="tspan3263">border is solid 1px</tspan><tspan
+         sodipodi:role="line"
+         x="26.263969"
+         y="703.44324"
+         id="tspan3265">small padding</tspan><tspan
+         sodipodi:role="line"
+         x="26.263969"
+         y="718.44324"
+         id="tspan3231" /><tspan
+         sodipodi:role="line"
+         x="26.263969"
+         y="733.44324"
+         id="tspan3233">field: </tspan><tspan
+         sodipodi:role="line"
+         x="26.263969"
+         y="748.44324"
+         id="tspan3267">0 margin, some fonts...</tspan><tspan
+         sodipodi:role="line"
+         x="26.263969"
+         y="763.44324"
+         id="tspan3269" /></text>
+    <rect
+       style="fill:none;stroke:#000000;stroke-width:1.00000012;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:1.00000011, 1.00000011;stroke-dashoffset:0;stroke-opacity:1"
+       id="rect3271"
+       width="22.223379"
+       height="24.243662"
+       x="486.89352"
+       y="202.82388" />
+    <path
+       style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       d="M 504.06612,225.04725 L 559.62451,300.80869"
+       id="path3273" />
+    <text
+       xml:space="preserve"
+       style="font-size:12px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+       x="568.71588"
+       y="297.77823"
+       id="text3275"><tspan
+         sodipodi:role="line"
+         id="tspan3277"
+         x="568.71588"
+         y="297.77823">&lt;div class=&quot;x-form-invalid-icon&quot;&gt;</tspan><tspan
+         sodipodi:role="line"
+         x="568.71588"
+         y="312.77823"
+         id="tspan3279">background uses &quot;exclamation.gif&quot;</tspan><tspan
+         sodipodi:role="line"
+         x="568.71588"
+         y="327.77823"
+         id="tspan3281">block</tspan><tspan
+         sodipodi:role="line"
+         x="568.71588"
+         y="342.77823"
+         id="tspan3285">absolute located @0,0</tspan><tspan
+         sodipodi:role="line"
+         x="568.71588"
+         y="357.77823"
+         id="tspan3283">height/width fixed</tspan><tspan
+         sodipodi:role="line"
+         x="568.71588"
+         y="372.77823"
+         id="tspan3287">hidden by default</tspan><tspan
+         sodipodi:role="line"
+         x="568.71588"
+         y="387.77823"
+         id="tspan3289" /></text>
+    <rect
+       style="fill:#ffffff;stroke:#e6e6e6;stroke-width:0.99999994;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+       id="rect3311"
+       width="267.69043"
+       height="237.38583"
+       x="376.78693"
+       y="661.77576" />
+    <rect
+       style="fill:#ffffff;stroke:#e6e6e6;stroke-width:0.99999994;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+       id="rect3313"
+       width="110.10664"
+       height="135.36041"
+       x="392.44427"
+       y="700.16156" />
+    <rect
+       style="fill:#ffffff;stroke:#e6e6e6;stroke-width:0.99999994;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-opacity:1"
+       id="rect3317"
+       width="110.10664"
+       height="135.36041"
+       x="521.74377"
+       y="697.63623" />
+    <text
+       xml:space="preserve"
+       style="font-size:12px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+       x="398.00009"
+       y="681.47375"
+       id="text3319"><tspan
+         sodipodi:role="line"
+         id="tspan3321"
+         x="398.00009"
+         y="681.47375">Form with columns</tspan></text>
+    <path
+       style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       d="M 464.67017,573.54988 L 394.96965,697.79864"
+       id="path3323"
+       sodipodi:nodetypes="cc" />
+    <text
+       xml:space="preserve"
+       style="font-size:12px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+       x="475.78186"
+       y="570.51941"
+       id="text3325"><tspan
+         sodipodi:role="line"
+         id="tspan3327"
+         x="475.78186"
+         y="570.51941">&lt;div class=&quot;x-form-ct x-form-column&quot;&gt;</tspan><tspan
+         sodipodi:role="line"
+         x="475.78186"
+         y="585.51941"
+         id="tspan3329">column:</tspan><tspan
+         sodipodi:role="line"
+         x="475.78186"
+         y="600.51941"
+         id="tspan3331">- floats left, </tspan><tspan
+         sodipodi:role="line"
+         x="475.78186"
+         y="615.51941"
+         id="tspan3333">margin/padding 0px</tspan><tspan
+         sodipodi:role="line"
+         x="475.78186"
+         y="630.51941"
+         id="tspan3335">overflow: hidden</tspan><tspan
+         sodipodi:role="line"
+         x="475.78186"
+         y="645.51941"
+         id="tspan3337">width?? might need setting?? &lt; 50%</tspan></text>
+    <text
+       xml:space="preserve"
+       style="font-size:12px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+       x="405.27032"
+       y="715.40424"
+       id="text3339"><tspan
+         sodipodi:role="line"
+         id="tspan3341"
+         x="405.27032"
+         y="715.40424">Label :</tspan></text>
+    <rect
+       style="fill:none;stroke:#000000;stroke-width:0.99999988;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:1.00000004, 1.00000004;stroke-dashoffset:0;stroke-opacity:1"
+       id="rect3343"
+       width="86.873138"
+       height="18.182745"
+       x="403.37576"
+       y="721.55499" />
+    <path
+       style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:0.99999988px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       d="M 406.08131,713.96104 L 341.43155,747.29607"
+       id="path3345" />
+    <text
+       xml:space="preserve"
+       style="font-size:12px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+       x="234.35539"
+       y="751.33673"
+       id="text3347"><tspan
+         sodipodi:role="line"
+         id="tspan3349"
+         x="234.35539"
+         y="751.33673">top based labels:</tspan><tspan
+         sodipodi:role="line"
+         x="234.35539"
+         y="766.33673"
+         id="tspan3351">class : x-form-label-top is applied to outer div.</tspan><tspan
+         sodipodi:role="line"
+         x="234.35539"
+         y="781.33673"
+         id="tspan3353" /><tspan
+         sodipodi:role="line"
+         x="234.35539"
+         y="796.33673"
+         id="tspan3355">.x-form-label-top .x-form-item label :</tspan><tspan
+         sodipodi:role="line"
+         x="234.35539"
+         y="811.33673"
+         id="tspan3357">- clear/float none</tspan><tspan
+         sodipodi:role="line"
+         x="234.35539"
+         y="826.33673"
+         id="tspan3359">- display inline/static</tspan><tspan
+         sodipodi:role="line"
+         x="234.35539"
+         y="841.33673"
+         id="tspan3361">- small bottom margin</tspan><tspan
+         sodipodi:role="line"
+         x="234.35539"
+         y="856.33673"
+         id="tspan3363">- auto'd widht??? </tspan></text>
+    <rect
+       style="fill:none;stroke:#000000;stroke-width:1;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:1.00000011, 1.00000011;stroke-dashoffset:0;stroke-opacity:1"
+       id="rect3365"
+       width="316.1778"
+       height="9.0913734"
+       x="192.93915"
+       y="268.4838" />
+    <text
+       xml:space="preserve"
+       style="font-size:12px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+       x="54.548237"
+       y="291.71732"
+       id="text3367"><tspan
+         sodipodi:role="line"
+         id="tspan3369"
+         x="54.548237"
+         y="291.71732">line clearer:</tspan><tspan
+         sodipodi:role="line"
+         x="54.548237"
+         y="306.71732"
+         id="tspan3381">x-form-clear-left</tspan><tspan
+         sodipodi:role="line"
+         x="54.548237"
+         y="321.71732"
+         id="tspan3383" /><tspan
+         sodipodi:role="line"
+         x="54.548237"
+         y="336.71732"
+         id="tspan3385">clears left:</tspan><tspan
+         sodipodi:role="line"
+         x="54.548237"
+         y="351.71732"
+         id="tspan3387">font/height/line-height 0</tspan><tspan
+         sodipodi:role="line"
+         x="54.548237"
+         y="366.71732"
+         id="tspan3389">hidden overflow</tspan><tspan
+         sodipodi:role="line"
+         x="54.548237"
+         y="381.71732"
+         id="tspan3371" /><tspan
+         sodipodi:role="line"
+         x="54.548237"
+         y="396.71732"
+         id="tspan3409">x-form-clear</tspan><tspan
+         sodipodi:role="line"
+         x="54.548237"
+         y="411.71732"
+         id="tspan3411">- same but clears both..</tspan></text>
+    <flowRoot
+       xml:space="preserve"
+       id="flowRoot3373"
+       style="fill:black;stroke:none;stroke-opacity:1;stroke-width:1px;stroke-linejoin:miter;stroke-linecap:butt;fill-opacity:1;font-family:Bitstream Vera Sans;font-style:normal;font-weight:normal;font-size:12px"><flowRegion
+         id="flowRegion3375"><rect
+           id="rect3377"
+           width="0"
+           height="18.182745"
+           x="102.02541"
+           y="297.77823" /></flowRegion><flowPara
+         id="flowPara3379"></flowPara></flowRoot>    <path
+       style="fill:none;fill-rule:evenodd;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
+       d="M 146.47212,279.59549 L 209.10158,275.55488"
+       id="path3391" />
+    <text
+       xml:space="preserve"
+       style="font-size:12px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+       x="530.33008"
+       y="698.80878"
+       id="text3393"><tspan
+         sodipodi:role="line"
+         id="tspan3395"
+         x="530.33008"
+         y="698.80878">Fieldsets</tspan></text>
+    <text
+       xml:space="preserve"
+       style="font-size:12px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+       x="465.68033"
+       y="813.96619"
+       id="text3397"><tspan
+         sodipodi:role="line"
+         id="tspan3399"
+         x="465.68033"
+         y="813.96619">fieldset</tspan><tspan
+         sodipodi:role="line"
+         x="465.68033"
+         y="828.96619"
+         id="tspan3401">styled on .x-form fieldset</tspan><tspan
+         sodipodi:role="line"
+         x="465.68033"
+         y="843.96619"
+         id="tspan3403">: border solid line</tspan><tspan
+         sodipodi:role="line"
+         x="465.68033"
+         y="858.96619"
+         id="tspan3405">paddings bottom and right  ~ 10px</tspan><tspan
+         sodipodi:role="line"
+         x="465.68033"
+         y="873.96619"
+         id="tspan3407">paddings at bottom a bit bigger</tspan></text>
+    <text
+       xml:space="preserve"
+       style="font-size:12px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+       x="615.00012"
+       y="930.13373"
+       id="text3419"><tspan
+         sodipodi:role="line"
+         id="tspan3421"
+         x="615.00012"
+         y="930.13373">checkbox labels</tspan><tspan
+         sodipodi:role="line"
+         x="615.00012"
+         y="945.13373"
+         id="tspan3423">.x-form-cb-label</tspan><tspan
+         sodipodi:role="line"
+         x="615.00012"
+         y="960.13373"
+         id="tspan3425"> (all not important)</tspan><tspan
+         sodipodi:role="line"
+         x="615.00012"
+         y="975.13373"
+         id="tspan3427">clear/float none</tspan><tspan
+         sodipodi:role="line"
+         x="615.00012"
+         y="990.13373"
+         id="tspan3429">display line</tspan><tspan
+         sodipodi:role="line"
+         x="615.00012"
+         y="1005.1337"
+         id="tspan3431">small left margin</tspan></text>
+    <text
+       xml:space="preserve"
+       style="font-size:12px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+       x="20.203051"
+       y="851.3418"
+       id="text3453"><tspan
+         sodipodi:role="line"
+         id="tspan3455"
+         x="20.203051"
+         y="851.3418">Combo box:</tspan></text>
+    <text
+       xml:space="preserve"
+       style="font-size:12px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+       x="251.64981"
+       y="914.27588"
+       id="text3457"><tspan
+         sodipodi:role="line"
+         id="tspan3459"
+         x="251.64981"
+         y="914.27588">Button bar</tspan></text>
+    <text
+       xml:space="preserve"
+       style="font-size:12px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+       x="9.0913715"
+       y="872.55511"
+       id="text3461"><tspan
+         sodipodi:role="line"
+         id="tspan3463"
+         x="9.0913715"
+         y="872.55511">&lt;div class=&quot;x-form-field-wrap&quot;&gt;</tspan><tspan
+         sodipodi:role="line"
+         x="9.0913715"
+         y="887.55511"
+         id="tspan3467">   relative with nowrap on white space</tspan><tspan
+         sodipodi:role="line"
+         x="9.0913715"
+         y="902.55511"
+         id="tspan3465">&lt;img for popup:</tspan><tspan
+         sodipodi:role="line"
+         x="9.0913715"
+         y="917.55511"
+         id="tspan3477">   .x-form-field-wrap .x-form-trigger</tspan><tspan
+         sodipodi:role="line"
+         x="9.0913715"
+         y="932.55511"
+         id="tspan3479">  background image for trigger</tspan><tspan
+         sodipodi:role="line"
+         x="9.0913715"
+         y="947.55511"
+         id="tspan3481">change cursor</tspan><tspan
+         sodipodi:role="line"
+         x="9.0913715"
+         y="962.55511"
+         id="tspan3483">no border</tspan><tspan
+         sodipodi:role="line"
+         x="9.0913715"
+         y="977.55511"
+         id="tspan3485">absolute pos. fixed hwight/ width </tspan><tspan
+         sodipodi:role="line"
+         x="9.0913715"
+         y="992.55511"
+         id="tspan3487" /></text>
+    <text
+       xml:space="preserve"
+       style="font-size:12px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+       x="37.375648"
+       y="1011.9561"
+       id="text3469"><tspan
+         sodipodi:role="line"
+         id="tspan3471"
+         x="37.375648"
+         y="1011.9561">Empty boxes </tspan><tspan
+         sodipodi:role="line"
+         x="37.375648"
+         y="1026.9561"
+         id="tspan3473">.x-form-empty-text </tspan><tspan
+         sodipodi:role="line"
+         x="37.375648"
+         y="1041.9561"
+         id="tspan3475">   grey the text</tspan></text>
+    <text
+       xml:space="preserve"
+       style="font-size:12px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+       x="253.6701"
+       y="931.44849"
+       id="text3489"><tspan
+         sodipodi:role="line"
+         id="tspan3491"
+         x="253.6701"
+         y="931.44849">.x-form .x-form-buts-ct .xform-btns-center</tspan><tspan
+         sodipodi:role="line"
+         x="253.6701"
+         y="946.44849"
+         id="tspan3493">  align text center</tspan><tspan
+         sodipodi:role="line"
+         x="253.6701"
+         y="961.44849"
+         id="tspan3497">&gt;&gt; all that + table = margin 0px/ auto</tspan><tspan
+         sodipodi:role="line"
+         x="253.6701"
+         y="976.44849"
+         id="tspan3501" /><tspan
+         sodipodi:role="line"
+         x="253.6701"
+         y="991.44849"
+         id="tspan3503">&gt;&gt; prev (except center) + .x-form-btns td.x-form-btn-td</tspan><tspan
+         sodipodi:role="line"
+         x="253.6701"
+         y="1006.4485"
+         id="tspan3505">  padd 3px;</tspan><tspan
+         sodipodi:role="line"
+         x="253.6701"
+         y="1021.4485"
+         id="tspan3499">&gt;&gt; .x-form .x-form-btns-ct .xforms-butns td</tspan><tspan
+         sodipodi:role="line"
+         x="253.6701"
+         y="1036.4485"
+         id="tspan3507">border/padding 0;</tspan><tspan
+         sodipodi:role="line"
+         x="253.6701"
+         y="1051.4485"
+         id="tspan3509" /><tspan
+         sodipodi:role="line"
+         x="253.6701"
+         y="1066.4485"
+         id="tspan3511">x-form .x-form-butns-ct .x-btn</tspan><tspan
+         sodipodi:role="line"
+         x="253.6701"
+         y="1081.4485"
+         id="tspan3513"> - clear nothing / float right.</tspan></text>
+  </g>
+</svg>
diff --git a/css/grid.css b/css/grid.css
new file mode 100644 (file)
index 0000000..b671113
--- /dev/null
@@ -0,0 +1,504 @@
+
+/** unknown styles from new grid **/
+
+/*
+.x-layout-grid-wrapper
+
+
+.x-grid-container
+
+
+.x-grid
+*/
+.x-grid {
+    background-color:#FFFFFF;
+    position:relative;
+    overflow:hidden;
+    
+}
+
+.x-grid-locked,
+.x-grid-viewport
+{
+    
+    position: absolute;
+    display: block;
+    z-index: 2;
+    top: 0px;
+    left: 0px;
+    overflow: hidden;
+}
+ .x-grid-scroller {
+    overflow: auto;
+}
+     
+
+.x-grid-hd-text {
+       font-size: 8pt;
+    padding-left: 6px;
+}
+.x-grid-hd-text,
+.x-grid-cell-text {\r
+       display: block;\r
+       overflow: hidden;\r
+       padding: 3px 5px;
+    /* stops jumping? */
+    -moz-user-select: none;\r
+/*     white-space: nowrap; */\r
+}\r
+.x-grid-col{\r
+       cursor: default;\r
+       height:21px !important;\r
+       box-sizing: border-box;\r
+       -moz-box-sizing: border-box;\r
+/*     position:absolute; \r
+       display:block;
+    */\r
+       -moz-outline: none;\r
+       -moz-user-focus: normal;\r
+       overflow: hidden;\r
+       border-left: 1px solid #f1efe2;\r
+}\r
+.x-edit-grid .x-grid-col{\r
+       -moz-outline: normal;\r
+}\r
+.x-grid-col, .x-grid-header {\r
+       -o-text-overflow: ellipsis;\r
+       text-overflow: ellipsis;\r
+}\r
+.x-grid-col-0{\r
+       border-left: 0;\r
+}\r
+.x-grid-col-last{\r
+       border-right: 1px solid #f1efe2;\r
+}\r
+.x-grid-editor {\r
+       box-sizing: border-box;\r
+       -moz-box-sizing: border-box;\r
+       /* position:absolute; */\r
+       /* visibility:hidden; */\r
+       font: normal 8pt arial;\r
+       border: 1px solid #afbdc9;\r
+       z-index:10;\r
+}\r
+.x-grid-editor input{\r
+       font: normal 8pt arial;\r
+       border: 0;\r
+       padding-top:2px;\r
+       padding-left:3px;
+    height: 18px;\r
+}\r
+.x-grid-editor-container{\r
+       overflow:hidden;\r
+       display:block;\r
+       background-color:white;\r
+}\r
+.x-grid-editor .pick-button{\r
+       width:15px;\r
+       height:20px;\r
+       position:absolute;\r
+       display:block;\r
+       right:0;\r
+       top:0;\r
+       z-index:2;\r
+       background-image: url(../images/default/grid/pick-button.gif);\r
+       background-repeat: no-repeat;\r
+}\r
+.x-grid-editor-invalid{\r
+       background-image: url(../images/default/grid/invalid_line.gif);\r
+       background-repeat: repeat-x;\r
+       background-position: bottom;\r
+       border: 1px solid #afbdc9;\r
+}\r
+.x-grid-checkbox-editor{\r
+       text-align: center;\r
+       overflow:hidden;\r
+       display:block;\r
+       background-color:white;\r
+}\r
+.x-grid-checkbox-editor input{\r
+       margin-top:3px;\r
+       height:13px;\r
+       width:13px;\r
+}\r
+select.x-grid-editor{\r
+       padding: 0;\r
+       -moz-outline: none;\r
+       border: 1px solid #afbdc9;\r
+}\r
+.x-grid-num-editor{\r
+       text-align:right;\r
+       padding-top:2px;\r
+       padding-left:3px;\r
+}\r
+.x-grid-text-editor{\r
+       padding-top:2px;\r
+       padding-left:3px;\r
+}\r
+.x-grid-header {\r
+       font: normal 8pt arial;\r
+       background-color: #ebeadb;\r
+       box-sizing: border-box;\r
+       -moz-box-sizing: border-box;\r
+       display: block;\r
+       position: absolute;\r
+       overflow:hidden;
+    width: 100%;
+    height: 22px;
+    border-bottom: 1px solid #333;
+    cursor: pointer;\r
+}\r
+.x-grid-column-sizer {\r
+       width:1px;\r
+       border-right:1px dashed #6593cf;\r
+       background:none;\r
+       cursor: col-resize;\r
+}\r
+.x-grid-drag-proxy{\r
+       width:150px;\r
+       height:24px;\r
+       background-color:#3366cc;\r
+       border: 1px solid #002266;\r
+       position:absolute;\r
+       visibility:hidden;\r
+       z-index:10000;\r
+}\r
+.x-grid-drag-text{\r
+   font: normal 8pt arial;\r
+       color:white;\r
+       position:absolute;\r
+       top:0;\r
+       left:26px;\r
+       padding:3px;\r
+       display:block;\r
+}\r
+.x-grid-drop-icon{\r
+   position:absolute;\r
+       top:0;\r
+       left:0;\r
+       display:block;\r
+       width:24px;\r
+       height:100%;\r
+       background-position: center;\r
+       background-repeat: no-repeat;\r
+}\r
+.x-grid-drop-nodrop{\r
+   background-image: url(../images/default/grid/drop-no.gif);\r
+}\r
+.x-grid-drop-ok{\r
+   background-image: url(../images/default/grid/drop-yes.gif);\r
+}
+
+.x-grid-hd-row img.x-grid-sort-icon {
+    height: 4px;
+       width: 13px;
+    border: 0;
+    margin-left: 4px;
+    vertical-align: middle;
+    
+}\r
+.x-grid-hd-row .sort-asc img.x-grid-sort-icon {\r
+       background-image: url(../images/default/grid/sort_asc.gif);\r
+       background-position: right;\r
+       background-repeat: no-repeat;\r
+       /* display: none; */\r
\r
+}\r
+.x-grid-hd-row .sort-desc img.x-grid-sort-icon {\r
+       background-image: url(../images/default/grid/sort_desc.gif);\r
+       background-position: right;\r
+       background-repeat: no-repeat;\r
+       /* display: none; */\r
\r
+}\r
+.x-grid-hd-body {\r
+       cursor: default;\r
+       display: block;\r
+       font: normal 8pt arial;\r
+       left: 0;\r
+       overflow: hidden;\r
+       padding: 3px 5px;\r
+       position: relative;\r
+       top: 0;\r
+       white-space: nowrap;\r
+}\r
+.x-grid-hd-body span {\r
+       font: normal 8pt arial;\r
+       white-space: nowrap; \r
+}\r
+.x-grid-hd-over{\r
+       border-bottom: 2px solid #fcc247;\r
+}\r
+.x-grid-hd-over .x-grid-hd-body{\r
+       background-color: #faf9f4;\r
+       border-bottom: 1px solid #f9a900;\r
+}\r
+.x-grid-split {\r
+       background-image: url(../images/default/grid/grid-split.gif);\r
+       background-position: center;\r
+       background-repeat: no-repeat;\r
+       cursor: e-resize;\r
+       display: block;\r
+       font-size: 1px;\r
+       height: 16px;\r
+       overflow: hidden;\r
+       position: absolute;\r
+       top: 2px;\r
+       width: 6px;\r
+       z-index: 3;\r
+}\r
+.x-grid-hrow{\r
+       background: #ebeadb url(../images/default/grid/grid-hrow.gif) repeat-x;\r
+       display: block;\r
+       height: 22px;\r
+       left: 0;\r
+       position: relative;\r
+       top: 0;\r
+       width: 10000px;\r
+       overflow:hidden;\r
+       z-index:2;\r
+}\r
+.x-grid-hrow-frame{\r
+       height: 22px;\r
+       left: 0;\r
+       display:block;\r
+       position: absolute;\r
+       top: 0;\r
+       width: 10000px;\r
+       z-index:1;\r
+}\r
+.x-grid-footer .x-toolbar{\r
+       border:0;\r
+}\r
+.x-grid-page-number{\r
+       width:24px;\r
+       height:14px;    \r
+}
+
\r
+.x-grid-page-first button {\r
+       background: url(../images/default/grid/page-first.gif) no-repeat;
+    width:16px;\r
+}\r
+.x-grid-loading button {\r
+       background: url(../images/default/grid/done.gif) no-repeat;
+    width:16px;\r
+}\r
+.x-grid-page-last button {\r
+       background: url(../images/default/grid/page-last.gif) no-repeat;
+    width:16px;\r
+}
+.x-date-mp-next,\r
+.x-grid-page-next button 
+{\r
+       background: url(../images/default/grid/page-next.gif) no-repeat;
+    width:16px;\r
+}
+.x-date-mp-prev,\r
+.x-grid-page-prev button 
+{\r
+       background: url(../images/default/grid/page-prev.gif) no-repeat;
+    width:16px;\r
+}
+.x-date-mp-prev, 
+.x-date-mp-next
+{
+    display: block;
+    width: 16px;
+    height: 16px;
+}
+    
+
+\r
+.x-item-disabled .x-grid-loading button {\r
+       background: url(../images/default/grid/loading.gif) no-repeat;\r
+}\r
+.x-item-disabled .x-grid-page-first button {\r
+       background: url(../images/default/grid/page-first-disabled.gif) no-repeat;\r
+}\r
+.x-item-disabled .x-grid-page-last button {\r
+       background: url(../images/default/grid/page-last-disabled.gif) no-repeat;\r
+}\r
+.x-item-disabled .x-grid-page-next button {\r
+       background: url(../images/default/grid/page-next-disabled.gif) no-repeat;\r
+}\r
+.x-item-disabled .x-grid-page-prev button {\r
+       background: url(../images/default/grid/page-prev-disabled.gif) no-repeat;\r
+}\r
+.x-grid-mso{\r
+}\r
+.x-grid-mso .x-grid-header{\r
+       background:none;\r
+       border-bottom:0;\r
+}\r
+.x-grid-mso .x-grid-footer {\r
+       border-top: 1px solid #6593cf;\r
+}\r
+\r
+.x-grid-mso .x-grid-footer .x-grid-fbutton{\r
+       border:0;\r
+}\r
+.x-grid-mso .x-grid-hd-body {\r
+       border-bottom:0;\r
+}\r
+.x-grid-mso .x-grid-hd-over{\r
+       border-bottom:0;\r
+}\r
+.x-grid-mso .x-grid-hd-over .x-grid-hd-body{\r
+       background-color: transparent;\r
+}\r
+.x-grid-mso .x-grid-split {\r
+       background-image: url(../images/default/grid/grid-blue-split.gif);\r
+}\r
+.x-grid-mso .x-toolbar .x-tb-sep {\r
+       background-image: url(../images/default/grid/grid-blue-split.gif);\r
+}\r
+.x-grid-mso .x-grid-hrow{\r
+       background: url(../images/default/grid/mso-hd.gif);\r
+       border-bottom: 1px solid #6593cf;\r
+       height: 21px;\r
+}\r
+.x-grid-mso .x-grid-row{\r
+       color: black;\r
+       border-bottom: 1px solid #ddecfe;\r
+}\r
+.x-grid-mso .x-grid-row-alt{\r
+       background-color: #f5f5f5;\r
+}\r
+.x-grid-mso .x-grid-row-selected{\r
+       background-color: #b3c8e8  !important;\r
+       color: black;\r
+}\r
+.x-grid-mso .x-grid-row-selected span{\r
+       color: black !important;\r
+}\r
+.x-props-grid .x-grid-col-1{\r
+        background-color: #f1efe2;\r
+}\r
+.x-props-grid .x-grid-col-1 .x-grid-cell-text{\r
+        background-color: white;\r
+}\r
+.x-props-grid .x-grid-col-0{\r
+        background-color: #f1efe2;\r
+}\r
+.x-props-grid .x-grid-col-0 .x-grid-cell-text{\r
+        background-color: white;\r
+        margin-left:10px;\r
+}\r
+.x-props-grid .x-grid-prop-edting .x-grid-col-0 .x-grid-cell-text{\r
+        background-color: #316ac5;\r
+        color: white;\r
+}\r
+.x-props-grid .x-grid-prop-edting .x-grid-col-0{\r
+        color: white;\r
+}\r
+.x-props-grid .x-grid-num-editor{\r
+       text-align:left;\r
+}\r
+.x-grid-row td,
+.x-grid-hd-row td
+{\r
+       font: normal 8pt arial;\r
+       border-bottom: 1px solid #f1efe2;\r
+       overflow: visible;\r
+       white-space: nowrap;\r
+       /* height:21px; */\r
+       /* width:10000px; */\r
+       /* box-sizing: border-box;\r
+       -moz-box-sizing: border-box;\r
+       display:block;
+    */\r
+       /* position:absolute; */\r
+}\r
+.x-grid-row-alt{\r
+       background-color: #fcfaf6;\r
+}\r
+.x-grid-row-over{\r
+       background-color: #f1f1f1;\r
+       color: black;\r
+}\r
+.x-grid-row-selected{\r
+       background-color: #316ac5 !important;\r
+       color: white;\r
+}\r
+.x-grid-row-selected span{\r
+       color: white !important;\r
+} \r
+/* \r
+  To have the scrollbars overlap the header, change .x-grid-wrap top style to 0 and \r
+  and ygrid-wrap-body top to 22px\r
+  Then grid.getView().scrollbarMode = YAHOO.ext.grid.GridView.SCROLLBARS_OVERLAP;\r
+ */\r
+.x-grid-body {\r
+       height: 100%;\r
+       left: 0;\r
+       overflow: hidden;\r
+       position: relative;\r
+       top: 22px;\r
+       /* width: 100%; */\r
+}\r
+.x-grid-footer{\r
+       display: block;\r
+       padding:0;\r
+       border-top: 1px solid #cbc7b8;\r
+}\r
+.x-grid-wrap-footer {\r
+       display: block;\r
+       overflow: hidden;\r
+       width:100%;\r
+       height:25px;\r
+       box-sizing: border-box;\r
+       -moz-box-sizing: border-box;\r
+       background-color: #ebeadb;\r
+       position:absolute;\r
+       bottom:0;\r
+}\r
+.x-grid-wrap-body {\r
+       left: 0;\r
+       overflow: hidden;\r
+       position: absolute;\r
+       top: 0;\r
+       display: block;\r
+}\r
+.x-grid-wrap-headers {\r
+       left: 0;\r
+       overflow: hidden;\r
+       position: absolute;\r
+       top: 0;\r
+       z-index: 12;\r
+}
+
+
+
+.x-grid-simple-view .x-grid-col{
+        height:100% !important;
+        position:static;
+        display:table-cell;
+        display:inline-block;
+}
+.x-grid-simple-view .x-grid-row{
+        position:static; 
+        display: table-row;
+}
+
+ /* -----------------------   PAGING ---------------------- */
+ .x-paging-info
+ {
+     position: absolute;
+     right: 7px;
+     top: 7px;
+}
+
+.x-grid-topbar, .x-grid-bottombar
+{
+    line-height: 0px; 
+    display: none;
+    
+}
+/* --- checkbox wrapping hides background -- */
+.x-grid-editor .x-form-check-wrap {
+    background-color:#FFFFFF;
+    padding: 2px 0px;
+    
+} 
\ No newline at end of file
diff --git a/css/highlight-js.css b/css/highlight-js.css
new file mode 100644 (file)
index 0000000..be9b984
--- /dev/null
@@ -0,0 +1,59 @@
+/**
+* This is not part of the lib - it's just for the docs..
+*
+*/
+
+.jsdoc-keyword,
+.jsdoc-syntax ,
+.jsdoc-comment ,
+.jsdoc-keyword ,
+.jsdoc-string ,
+.with-ident,
+.with-ident2,
+.jsdoc-var {
+    white-space: pre;
+    display:inline;
+    font-family:monospace;
+
+}
+
+.with-ident {
+    text-decoration: underline;
+   }
+.with-ident2 {
+    text-decoration: strikethrough;
+   }
+   
+.jsdoc-keyword {
+    color : black;
+    font-weight: bold;
+}
+
+.jsdoc-syntax {
+    color : green;
+}
+.jsdoc-comment {
+    color : brown;
+}
+
+
+.jsdoc-string {
+    color : red;
+}    
+
+.jsdoc-var {
+    color : blue;
+}
+
+
+body.highlightpage
+{
+    background:#F8F8F8 none repeat scroll 0% 0%;
+    border-color:#ccc;
+    border-style:solid;
+    border-width:1px 1px 1px 5px;
+    font-size:12px !important;
+    line-height:14px !important;
+    margin:10px 10px 10px 10px;
+    padding:10px;
+}
diff --git a/css/inline-editor.css b/css/inline-editor.css
new file mode 100644 (file)
index 0000000..0b35dae
--- /dev/null
@@ -0,0 +1,72 @@
+/*
+.yinline-editor {\r
+       border: 1px solid #a3bac9;\r
+       font: normal 11px arial,helvetica,sans-serif;\r
+       left: 0;\r
+       overflow: hidden;\r
+       padding: 1px 0 0 1px;\r
+       position: absolute;\r
+       top: 0;\r
+}\r
+.yinline-editor-multiline {\r
+       overflow: hidden;\r
+       padding: 0;\r
+       white-space: nowrap;\r
+}\r
+.yinline-editor-sizer {\r
+       font: normal 11px arial,helvetica,sans-serif;\r
+       left: -1000px;\r
+       padding: 3px;\r
+       padding-right: 6px;\r
+       position: absolute;\r
+       top: -1000px;\r
+       visibility: hidden;\r
+       white-space: nowrap;\r
+}\r
+.yinline-editor-wrap {\r
+       color: white;\r
+       overflow: auto;\r
+       position: absolute;\r
+       top: 0;\r
+       visibility: hidden;\r
+       z-index: 15002;\r
+}\r
+
+*/
+.x-html-editor-wrap
+{
+    background-color:#000;
+    border:1px solid #a3bac9;
+}
+
+/*-------- all the buttons -------*/
+
+.x-html-editor-tb .x-btn-text {
+    background:transparent url(../images/default/form/htmleditor.gif) no-repeat scroll 0% 0%;
+}
+.x-html-editor-tb  .x-btn-text { width: 18px; }
+/* all the rest are done with background offsets ( -16 height each one ) */
+
+
+.x-html-editor-tb .x-edit-bold .x-btn-text              { background-position: 0 0px; }
+.x-html-editor-tb .x-edit-italic .x-btn-text            { background-position: 0 -16px; } 
+.x-html-editor-tb .x-edit-underline .x-btn-text         { background-position: 0 -32px; } 
+.x-html-editor-tb .x-edit-increasefontsize .x-btn-text  { background-position: 0 -48px; } 
+.x-html-editor-tb .x-edit-decreasefontsize .x-btn-text  { background-position: 0 -64px; } 
+.x-html-editor-tb .x-edit-insertorderedlist .x-btn-text { background-position: 0 -80px; } 
+.x-html-editor-tb .x-edit-insertunorderedlist .x-btn-text { background-position: 0 -96px; } 
+.x-html-editor-tb .x-edit-justifyleft .x-btn-text       { background-position: 0 -112px; } 
+.x-html-editor-tb .x-edit-justifycenter .x-btn-text     { background-position: 0 -128px; } 
+.x-html-editor-tb .x-edit-justifyright .x-btn-text      { background-position: 0 -144px; } 
+
+.x-html-editor-tb .x-edit-forecolor .x-btn-text         { background-position: 0 -160px; } 
+.x-html-editor-tb .x-edit-backcolor .x-btn-text         { background-position: 0 -176px; } 
+.x-html-editor-tb .x-edit-sourceedit .x-btn-text        { background-position: 0 -192px; } 
+.x-html-editor-tb .x-edit-createlink .x-btn-text        { background-position: 0 -208px; } 
+
+
+.x-html-editor-tb .x-toolbar .x-btn {
+    margin-left:0px;
+    margin-right:0px;
+}
+  
\ No newline at end of file
diff --git a/css/layout.css b/css/layout.css
new file mode 100644 (file)
index 0000000..ba8867b
--- /dev/null
@@ -0,0 +1,201 @@
+.x-layout-container{\r
+    width:100%;\r
+    height:100%;\r
+    overflow:hidden;\r
+        background-color:#c3daf9;\r
+}\r
+.x-layout-collapsed{\r
+    position:absolute;\r
+    left:-10000px;\r
+    top:-10000px;\r
+    visibility:hidden;\r
+    background-color:#c3daf9;\r
+    width:20px;\r
+    height:20px;\r
+    overflow:hidden;\r
+        border:1px solid #98c0f4;\r
+        z-index:20;\r
+}\r
+.x-layout-collapsed-over{\r
+    cursor:pointer;\r
+        background-color:#d9e8fb;\r
+}\r
+.x-layout-collapsed-west  .x-layout-tools-button{\r
+       float:right;\r
+}\r
+.x-layout-collapsed-east  .x-layout-tools-button{\r
+       float:left;\r
+}\r
+.x-layout-collapsed-north, .x-layout-collapsed-south{\r
+       text-align:right;\r
+}\r
+.x-layout-collapsed .x-layout-tools-button{\r
+   margin:2px;\r
+        width:12px;\r
+        text-align:center;\r
+}\r
+.x-layout-inactive-content{\r
+    position:absolute;\r
+    left:-10000px;\r
+    top:-10000px;\r
+    visibility:hidden;\r
+}\r
+.x-layout-active-content{\r
+    visibility:visible;\r
+}\r
+.x-layout-panel{\r
+    position:absolute;border:1px solid #98c0f4;overflow:hidden;background-color:white;\r
+}\r
+.x-layout-panel-east, .x-layout-panel-west {\r
+    z-index:10;\r
+}\r
+.x-layout-panel-north, .x-layout-panel-south {\r
+    z-index:11;\r
+}\r
+.x-layout-collapsed-north, .x-layout-collapsed-south, .x-layout-collapsed-east, .x-layout-collapsed-west {\r
+    z-index:12;\r
+}\r
+.x-layout-panel-body{\r
+    overflow:hidden;\r
+}\r
+.x-layout-grid-wrapper{\r
+\r
+}\r
+.x-layout-split{\r
+    position:absolute;\r
+    height:5px;\r
+    width:5px;\r
+    line-height:1px;\r
+    font-size:1px;\r
+    z-index:3;\r
+    background-color:#c3daf9;\r
+}\r
+.x-layout-panel-hd{\r
+    background-image: url(../images/default/layout/panel-title-light-bg.gif);\r
+    color: black;\r
+    border-bottom:1px solid #98c0f4;\r
+    position:relative;\r
+}\r
+.x-layout-panel-hd-text{\r
+    font:normal 11px tahoma, verdana, helvetica;\r
+    padding: 4px;\r
+    padding-left: 4px;\r
+    display:block;\r
+        white-space:nowrap;\r
+}\r
+.x-layout-panel-hd-tools{\r
+    position:absolute;\r
+    right:0;\r
+    top:0;\r
+    text-align:right;\r
+    padding-top:2px;\r
+    padding-right:2px;width:40px;\r
+}\r
+.x-layout-tools-button{\r
+    z-index:6;\r
+    padding:2px;
+    float:right;\r
+    cursor:pointer;\r
+}\r
+.x-layout-tools-button-over{\r
+    padding:1px;\r
+    border:1px solid #98c0f4;\r
+    background-color:white;\r
+}\r
+.x-layout-tools-button-inner{\r
+    height:12px;\r
+    width:12px;\r
+    line-height:1px;\r
+    font-size:1px;\r
+    background-repeat:no-repeat;\r
+    background-position:center;\r
+}\r
+.x-layout-close{\r
+    background-image:url(../images/default/layout/layout-sprite.gif);\r
+    background-repeat: no-repeat;\r
+    background-position: 50% -48px;\r
+}\r
+.x-layout-collapse-west,.x-layout-expand-east{\r
+    background-image:url(../images/default/layout/layout-sprite.gif);\r
+    background-repeat: no-repeat;\r
+    background-position: 50% 0;\r
+}\r
+.x-layout-expand-west,.x-layout-collapse-east{\r
+    background-image:url(../images/default/layout/layout-sprite.gif);\r
+    background-repeat: no-repeat;\r
+    background-position: 50% -12px;\r
+}\r
+.x-layout-collapse-north,.x-layout-expand-south{\r
+    background-image:url(../images/default/layout/layout-sprite.gif);\r
+    background-repeat: no-repeat;\r
+    background-position: 50% -24px;\r
+}\r
+.x-layout-expand-north,.x-layout-collapse-south{\r
+    background-image:url(../images/default/layout/layout-sprite.gif);\r
+    background-repeat: no-repeat;\r
+    background-position: 50% -36px;\r
+}\r
+.x-layout-split-h{\r
+    background-image:url(../images/default/sizer/e-handle.gif);\r
+    background-position: left;\r
+}\r
+.x-layout-split-v{\r
+    background-image:url(../images/default/sizer/s-handle.gif);\r
+    background-position: top;\r
+}\r
+.x-layout-panel .x-tabs-wrap{\r
+    background:url(../images/default/layout/gradient-bg.gif);\r
+}\r
+.x-layout-panel .roo-tabbody {\r
+    background-color:white;\r
+    overflow:auto;height:100%;\r
+}\r
+.x-layout-component-panel, .x-layout-nested-layout {\r
+       position:relative;\r
+   padding:0;\r
+       overflow:hidden;\r
+       width:200px;\r
+       height:200px;\r
+}\r
+.x-layout-nested-layout .x-layout-panel {\r
+         border:0 none;\r
+}\r
+.x-layout-nested-layout .x-layout-panel-north {\r
+         border-bottom:1px solid #98c0f4;\r
+}\r
+.x-layout-nested-layout .x-layout-panel-south {\r
+         border-top:1px solid #98c0f4;\r
+}\r
+.x-layout-nested-layout .x-layout-panel-east {\r
+         border-left:1px solid #98c0f4;\r
+}\r
+.x-layout-nested-layout .x-layout-panel-west {\r
+         border-right:1px solid #98c0f4;\r
+}\r
+.roo-repaint{\r
+    zoom:1;\r
+        background-color: transparent;\r
+}\r
+.x-layout-panel-dragover {\r
+       border: 2px solid #6593cf;\r
+}\r
+.x-layout-panel-proxy {\r
+       background-image: url(../images/default/layout/gradient-bg.gif);\r
+       background-color:#c3daf9;\r
+       border:1px dashed #6593cf;\r
+       z-index:10001;\r
+       overflow:hidden;\r
+       position:absolute;\r
+       left:0;top:0;\r
+}\r
+.x-layout-slider {\r
+       z-index:15;\r
+       overflow:hidden;\r
+       position:absolute;\r
+}\r
+\r
+.x-unselectable{\r
+       -moz-user-select: none;\r
+       -khtml-user-select: none;\r
+       cursor:default;\r
+}
\ No newline at end of file
diff --git a/css/license.txt b/css/license.txt
new file mode 100644 (file)
index 0000000..b195f53
--- /dev/null
@@ -0,0 +1,26 @@
+yui-ext\r
+Copyright (c) 2006, Jack Slocum\r
+All rights reserved.\r
+\r
+Redistribution and use in source and binary forms, with or without modification, \r
+are permitted provided that the following conditions are met:\r
+\r
+    * Redistributions of source code must retain the above copyright notice, \r
+    this list of conditions and the following disclaimer.\r
+    * Redistributions in binary form must reproduce the above copyright notice, \r
+    this list of conditions and the following disclaimer in the documentation \r
+    and/or other materials provided with the distribution.\r
+    * Neither the name yui-ext nor the names of its contributors \r
+    may be used to endorse or promote products derived from this software \r
+    without specific prior written permission.\r
+\r
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND \r
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \r
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \r
+IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \r
+INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, \r
+BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, \r
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY \r
+OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING \r
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, \r
+EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
\ No newline at end of file
diff --git a/css/menu_design.svg b/css/menu_design.svg
new file mode 100644 (file)
index 0000000..dccd55b
--- /dev/null
@@ -0,0 +1,1180 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+<svg
+   xmlns:dc="http://purl.org/dc/elements/1.1/"
+   xmlns:cc="http://creativecommons.org/ns#"
+   xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+   xmlns:svg="http://www.w3.org/2000/svg"
+   xmlns="http://www.w3.org/2000/svg"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="1488.189"
+   height="1052.3622"
+   id="svg4070"
+   sodipodi:version="0.32"
+   inkscape:version="0.46"
+   sodipodi:docname="menu_design.svg"
+   inkscape:output_extension="org.inkscape.output.svg.inkscape"
+   version="1.0">
+  <defs
+     id="defs4072">
+    <inkscape:perspective
+       sodipodi:type="inkscape:persp3d"
+       inkscape:vp_x="0 : 526.18109 : 1"
+       inkscape:vp_y="0 : 1000 : 0"
+       inkscape:vp_z="744.09448 : 526.18109 : 1"
+       inkscape:persp3d-origin="372.04724 : 350.78739 : 1"
+       id="perspective4078" />
+  </defs>
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     gridtolerance="10000"
+     guidetolerance="10"
+     objecttolerance="10"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="0.98994949"
+     inkscape:cx="929.66339"
+     inkscape:cy="612.6748"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer1"
+     showgrid="false"
+     inkscape:window-width="1280"
+     inkscape:window-height="971"
+     inkscape:window-x="1280"
+     inkscape:window-y="27" />
+  <metadata
+     id="metadata4075">
+    <rdf:RDF>
+      <cc:Work
+         rdf:about="">
+        <dc:format>image/svg+xml</dc:format>
+        <dc:type
+           rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     inkscape:label="Layer 1"
+     inkscape:groupmode="layer"
+     id="layer1">
+    <rect
+       style="fill:#cccccc;stroke:#949494;stroke-width:2.79999995;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+       id="rect4080"
+       width="636.42859"
+       height="41.42857"
+       x="48.57143"
+       y="60.933609" />
+    <text
+       xml:space="preserve"
+       style="font-size:12px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+       x="44.285713"
+       y="120.21933"
+       id="text4082"><tspan
+         sodipodi:role="line"
+         id="tspan4084"
+         x="44.285713"
+         y="120.21933">&lt;div class=&quot;x-toolbar x-small-editor&quot;&gt;</tspan><tspan
+         sodipodi:role="line"
+         x="44.285713"
+         y="135.21933"
+         id="tspan4106">&lt;table&gt;</tspan><tspan
+         sodipodi:role="line"
+         x="44.285713"
+         y="150.21933"
+         id="tspan4108">  &lt;tr&gt;</tspan><tspan
+         sodipodi:role="line"
+         x="44.285713"
+         y="165.21933"
+         id="tspan4110">     &lt;td&gt;</tspan><tspan
+         sodipodi:role="line"
+         x="44.285713"
+         y="180.21933"
+         id="tspan4086" /><tspan
+         sodipodi:role="line"
+         x="44.285713"
+         y="195.21933"
+         id="tspan4088">.x-toolbar :</tspan><tspan
+         sodipodi:role="line"
+         x="44.285713"
+         y="210.21933"
+         id="tspan4090">- background image</tspan><tspan
+         sodipodi:role="line"
+         x="44.285713"
+         y="225.21933"
+         id="tspan4092">- tiny top&amp;bottom border</tspan><tspan
+         sodipodi:role="line"
+         x="44.285713"
+         y="240.21933"
+         id="tspan4094">- relative/block</tspan><tspan
+         sodipodi:role="line"
+         x="44.285713"
+         y="255.21933"
+         id="tspan4098">padded by 2px;</tspan><tspan
+         sodipodi:role="line"
+         x="44.285713"
+         y="270.21933"
+         id="tspan4100" /><tspan
+         sodipodi:role="line"
+         x="44.285713"
+         y="285.21933"
+         id="tspan4096" /></text>
+    <text
+       xml:space="preserve"
+       style="font-size:12px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+       x="159.28571"
+       y="275.93362"
+       id="text4102"><tspan
+         sodipodi:role="line"
+         id="tspan4104"
+         x="159.28571"
+         y="275.93362" /></text>
+    <text
+       xml:space="preserve"
+       style="font-size:12px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+       x="370.71429"
+       y="115.93361"
+       id="text4112"><tspan
+         sodipodi:role="line"
+         id="tspan4114"
+         x="370.71429"
+         y="115.93361">.x-toolbar td</tspan><tspan
+         sodipodi:role="line"
+         x="370.71429"
+         y="130.93361"
+         id="tspan4116"> (also span, input, div, select, label)</tspan><tspan
+         sodipodi:role="line"
+         x="370.71429"
+         y="145.93361"
+         id="tspan4118">--- Have font's specified.</tspan><tspan
+         sodipodi:role="line"
+         x="370.71429"
+         y="160.93361"
+         id="tspan4120" /><tspan
+         sodipodi:role="line"
+         x="370.71429"
+         y="175.93361"
+         id="tspan4122">x.toolbar td</tspan><tspan
+         sodipodi:role="line"
+         x="370.71429"
+         y="190.93361"
+         id="tspan4124">vertical  - middle</tspan><tspan
+         sodipodi:role="line"
+         x="370.71429"
+         y="205.93361"
+         id="tspan4126" /></text>
+    <rect
+       style="fill:#cccccc;stroke:#949494;stroke-width:2.79999995;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+       id="rect4128"
+       width="636.42859"
+       height="41.42857"
+       x="45.35714"
+       y="344.50504" />
+    <rect
+       style="fill:#cccccc;stroke:#949494;stroke-width:2.80000019;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+       id="rect4130"
+       width="110.71432"
+       height="29.285711"
+       x="63.92857"
+       y="350.93359" />
+    <text
+       xml:space="preserve"
+       style="font-size:12px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+       x="83.571426"
+       y="369.50504"
+       id="text4132"><tspan
+         sodipodi:role="line"
+         id="tspan4134"
+         x="83.571426"
+         y="369.50504">button</tspan></text>
+    <text
+       xml:space="preserve"
+       style="font-size:12px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+       x="73.571426"
+       y="423.07648"
+       id="text4136"><tspan
+         sodipodi:role="line"
+         id="tspan4138"
+         x="73.571426"
+         y="423.07648">&lt;table </tspan><tspan
+         sodipodi:role="line"
+         x="73.571426"
+         y="438.07648"
+         id="tspan4164">   x-btn-wrap</tspan><tspan
+         sodipodi:role="line"
+         x="73.571426"
+         y="453.07648"
+         id="tspan4166">  x-btn-text-icon</tspan><tspan
+         sodipodi:role="line"
+         x="73.571426"
+         y="468.07648"
+         id="tspan4168">   x-btn</tspan><tspan
+         sodipodi:role="line"
+         x="73.571426"
+         y="483.07648"
+         id="tspan4170">    &lt;tr c=x-btn-with-menu</tspan><tspan
+         sodipodi:role="line"
+         x="73.571426"
+         y="498.07648"
+         id="tspan4174">       &lt;td c=x.btn-left</tspan><tspan
+         sodipodi:role="line"
+         x="73.571426"
+         y="513.07648"
+         id="tspan4176">           &lt;i&gt;</tspan><tspan
+         sodipodi:role="line"
+         x="73.571426"
+         y="528.07648"
+         id="tspan4178">       &lt;td c=x-btn-center</tspan><tspan
+         sodipodi:role="line"
+         x="73.571426"
+         y="543.07648"
+         id="tspan4246">           &lt;em</tspan><tspan
+         sodipodi:role="line"
+         x="73.571426"
+         y="558.07648"
+         id="tspan4248">               &lt;button x-btn-text</tspan><tspan
+         sodipodi:role="line"
+         x="73.571426"
+         y="573.07648"
+         id="tspan4180">         </tspan><tspan
+         sodipodi:role="line"
+         x="73.571426"
+         y="588.07648"
+         id="tspan4172" /><tspan
+         sodipodi:role="line"
+         x="73.571426"
+         y="603.07648"
+         id="tspan4158"></tspan><tspan
+         sodipodi:role="line"
+         x="73.571426"
+         y="618.07648"
+         id="tspan4160"></tspan><tspan
+         sodipodi:role="line"
+         x="73.571426"
+         y="633.07648"
+         id="tspan4162">.x-btn</tspan><tspan
+         sodipodi:role="line"
+         x="73.571426"
+         y="648.07648"
+         id="tspan4146">  has fonts etc.</tspan><tspan
+         sodipodi:role="line"
+         x="73.571426"
+         y="663.07648"
+         id="tspan4144">.x-btn</tspan><tspan
+         sodipodi:role="line"
+         x="73.571426"
+         y="678.07648"
+         id="tspan4140"> cursor as pointer</tspan><tspan
+         sodipodi:role="line"
+         x="73.571426"
+         y="693.07648"
+         id="tspan4148">nowrap on whitespace..</tspan><tspan
+         sodipodi:role="line"
+         x="73.571426"
+         y="708.07648"
+         id="tspan4142" /></text>
+    <text
+       xml:space="preserve"
+       style="font-size:12px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+       x="320"
+       y="420.93362"
+       id="text4150"><tspan
+         sodipodi:role="line"
+         id="tspan4152"
+         x="320"
+         y="420.93362">.x-toolbar x-btn-left /right and center..</tspan><tspan
+         sodipodi:role="line"
+         x="320"
+         y="435.93362"
+         id="tspan4154">  - background disabled.</tspan><tspan
+         sodipodi:role="line"
+         x="320"
+         y="450.93362"
+         id="tspan4208" /><tspan
+         sodipodi:role="line"
+         x="320"
+         y="465.93362"
+         id="tspan4210">-x-toolbar center</tspan><tspan
+         sodipodi:role="line"
+         x="320"
+         y="480.93362"
+         id="tspan4212">  zero padding</tspan><tspan
+         sodipodi:role="line"
+         x="320"
+         y="495.93362"
+         id="tspan4156" /></text>
+    <text
+       xml:space="preserve"
+       style="font-size:12px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+       x="340.71429"
+       y="522.36218"
+       id="text4182"><tspan
+         sodipodi:role="line"
+         id="tspan4184"
+         x="340.71429"
+         y="522.36218">.x-btn-left i  (and right i)</tspan><tspan
+         sodipodi:role="line"
+         x="340.71429"
+         y="537.36218"
+         id="tspan4186">   block, </tspan><tspan
+         sodipodi:role="line"
+         x="340.71429"
+         y="552.36218"
+         id="tspan4190">   hidden overflow</tspan><tspan
+         sodipodi:role="line"
+         x="340.71429"
+         y="567.36218"
+         id="tspan4196">  3px wide</tspan><tspan
+         sodipodi:role="line"
+         x="340.71429"
+         y="582.36218"
+         id="tspan4206">  line-height/fontsize 1px ?? needed for override?</tspan><tspan
+         sodipodi:role="line"
+         x="340.71429"
+         y="597.36218"
+         id="tspan4198" /><tspan
+         sodipodi:role="line"
+         x="340.71429"
+         y="612.36218"
+         id="tspan4188" /></text>
+    <text
+       xml:space="preserve"
+       style="font-size:12px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+       x="550.71429"
+       y="462.36218"
+       id="text4200"><tspan
+         sodipodi:role="line"
+         id="tspan4202"
+         x="550.71429"
+         y="462.36218">.x-btn-left (and right)</tspan><tspan
+         sodipodi:role="line"
+         x="550.71429"
+         y="477.36218"
+         id="tspan4204">  line-height/fontsize 1px</tspan></text>
+    <text
+       xml:space="preserve"
+       style="font-size:12px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+       x="340"
+       y="619.50507"
+       id="text4214"><tspan
+         sodipodi:role="line"
+         id="tspan4216"
+         x="340"
+         y="619.50507">toolbar btn-with-menu btn center EM</tspan><tspan
+         sodipodi:role="line"
+         x="340"
+         y="634.50507"
+         id="tspan4218">  - right padding 8pxs</tspan><tspan
+         sodipodi:role="line"
+         x="340"
+         y="649.50507"
+         id="tspan4220" /><tspan
+         sodipodi:role="line"
+         x="340"
+         y="664.50507"
+         id="tspan4222">x-btn-text-icon btn with menu btn center EM</tspan><tspan
+         sodipodi:role="line"
+         x="340"
+         y="679.50507"
+         id="tspan4224">   block</tspan><tspan
+         sodipodi:role="line"
+         x="340"
+         y="694.50507"
+         id="tspan4226">   has background image. (for right hand V)</tspan><tspan
+         sodipodi:role="line"
+         x="340"
+         y="709.50507"
+         id="tspan4228" /><tspan
+         sodipodi:role="line"
+         x="340"
+         y="724.50507"
+         id="tspan4232">btn with menu btn center EM</tspan><tspan
+         sodipodi:role="line"
+         x="340"
+         y="739.50507"
+         id="tspan4234">   block</tspan><tspan
+         sodipodi:role="line"
+         x="340"
+         y="754.50507"
+         id="tspan4236">   has background image.</tspan><tspan
+         sodipodi:role="line"
+         x="340"
+         y="769.50507"
+         id="tspan4238">padded right  by 10px</tspan><tspan
+         sodipodi:role="line"
+         x="340"
+         y="784.50507"
+         id="tspan4240" /><tspan
+         sodipodi:role="line"
+         x="340"
+         y="799.50507"
+         id="tspan4242">btn em</tspan><tspan
+         sodipodi:role="line"
+         x="340"
+         y="814.50507"
+         id="tspan4244">   normal style and weight</tspan><tspan
+         sodipodi:role="line"
+         x="340"
+         y="829.50507"
+         id="tspan4230" /></text>
+    <text
+       xml:space="preserve"
+       style="font-size:12px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+       x="34.285706"
+       y="771.64789"
+       id="text4250"><tspan
+         sodipodi:role="line"
+         id="tspan4252"
+         x="34.285706"
+         y="771.64789">x-btn-text-icon .x-btn-center .x-btn-text</tspan><tspan
+         sodipodi:role="line"
+         x="34.285706"
+         y="786.64789"
+         id="tspan4254">  move background by 0,2</tspan><tspan
+         sodipodi:role="line"
+         x="34.285706"
+         y="801.64789"
+         id="tspan4256">  pad 3,0,2,18</tspan><tspan
+         sodipodi:role="line"
+         x="34.285706"
+         y="816.64789"
+         id="tspan4258" /></text>
+    <text
+       xml:space="preserve"
+       style="font-size:12px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+       x="39.285713"
+       y="833.79077"
+       id="text4260"><tspan
+         sodipodi:role="line"
+         id="tspan4262"
+         x="39.285713"
+         y="833.79077">gecko + .x-btn button</tspan><tspan
+         sodipodi:role="line"
+         x="39.285713"
+         y="848.79077"
+         id="tspan4264">    padd l/r 0</tspan><tspan
+         sodipodi:role="line"
+         x="39.285713"
+         y="863.79077"
+         id="tspan4266" /></text>
+    <text
+       xml:space="preserve"
+       style="font-size:12px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+       x="51.42857"
+       y="888.07648"
+       id="text4268"><tspan
+         sodipodi:role="line"
+         id="tspan4270"
+         x="51.42857"
+         y="888.07648">x-button button</tspan><tspan
+         sodipodi:role="line"
+         x="51.42857"
+         y="903.07648"
+         id="tspan4272">    background none</tspan><tspan
+         sodipodi:role="line"
+         x="51.42857"
+         y="918.07648"
+         id="tspan4274">  pointer cursor.</tspan><tspan
+         sodipodi:role="line"
+         x="51.42857"
+         y="933.07648"
+         id="tspan4276"> 0 margin</tspan><tspan
+         sodipodi:role="line"
+         x="51.42857"
+         y="948.07648"
+         id="tspan4278">outline none, color: -moz-use-text-color</tspan><tspan
+         sodipodi:role="line"
+         x="51.42857"
+         y="963.07648"
+         id="tspan4280">overflow - shown</tspan><tspan
+         sodipodi:role="line"
+         x="51.42857"
+         y="978.07648"
+         id="tspan4282">width auto..</tspan><tspan
+         sodipodi:role="line"
+         x="51.42857"
+         y="993.07648"
+         id="tspan4284">padd l/r 3px </tspan></text>
+    <text
+       xml:space="preserve"
+       style="font-size:12px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+       x="430.71429"
+       y="870.93359"
+       id="text4286"><tspan
+         sodipodi:role="line"
+         id="tspan4288"
+         x="430.71429"
+         y="870.93359">.x-toolbar xbtnclick xbtncenter</tspan><tspan
+         sodipodi:role="line"
+         x="430.71429"
+         y="885.93359"
+         id="tspan4290">.x-toolbar xbtnpressed xbtncenter</tspan><tspan
+         sodipodi:role="line"
+         x="430.71429"
+         y="900.93359"
+         id="tspan4294">.x-toolbar xbtnactive xbtncenter</tspan><tspan
+         sodipodi:role="line"
+         x="430.71429"
+         y="915.93359"
+         id="tspan4296">   background image with multiple versions</tspan><tspan
+         sodipodi:role="line"
+         x="430.71429"
+         y="930.93359"
+         id="tspan4298">   (x-repeat , with different offsets (last param)</tspan><tspan
+         sodipodi:role="line"
+         x="430.71429"
+         y="945.93359"
+         id="tspan4300" /><tspan
+         sodipodi:role="line"
+         x="430.71429"
+         y="960.93359"
+         id="tspan4292" /></text>
+    <text
+       xml:space="preserve"
+       style="font-size:12px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+       x="435.71429"
+       y="959.505"
+       id="text4302"><tspan
+         sodipodi:role="line"
+         id="tspan4304"
+         x="435.71429"
+         y="959.505">x.toolbar xbuttonover xbuttoncenter</tspan><tspan
+         sodipodi:role="line"
+         x="435.71429"
+         y="974.505"
+         id="tspan4308">background image with multiple versions</tspan><tspan
+         sodipodi:role="line"
+         x="435.71429"
+         y="989.505"
+         id="tspan4310">   (x-repeat , with different offsets (last param)</tspan><tspan
+         sodipodi:role="line"
+         x="435.71429"
+         y="1004.505"
+         id="tspan4306" /></text>
+    <text
+       xml:space="preserve"
+       style="font-size:12px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+       x="382.85715"
+       y="837.36218"
+       id="text4312"><tspan
+         sodipodi:role="line"
+         id="tspan4314"
+         x="382.85715"
+         y="837.36218">mouse over etc. technique...</tspan><tspan
+         sodipodi:role="line"
+         x="382.85715"
+         y="852.36218"
+         id="tspan4316">  - add xbtnover etc.</tspan></text>
+    <rect
+       style="fill:#cccccc;stroke:#949494;stroke-width:2.79999995;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+       id="rect4338"
+       width="35"
+       height="34.285713"
+       x="222.85715"
+       y="348.07648" />
+    <text
+       xml:space="preserve"
+       style="font-size:12px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+       x="235.71429"
+       y="368.79074"
+       id="text4340"><tspan
+         sodipodi:role="line"
+         id="tspan4342"
+         x="235.71429"
+         y="368.79074">icon</tspan></text>
+    <text
+       xml:space="preserve"
+       style="font-size:12px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+       x="277.14285"
+       y="283.07648"
+       id="text4344"><tspan
+         sodipodi:role="line"
+         id="tspan4346"
+         x="277.14285"
+         y="283.07648">&lt;table x-btn-wrap x-btn-icon x-btn</tspan><tspan
+         sodipodi:role="line"
+         x="277.14285"
+         y="298.07648"
+         id="tspan4348">  .xbtnicon xbtncenter xbtntext</tspan><tspan
+         sodipodi:role="line"
+         x="277.14285"
+         y="313.07648"
+         id="tspan4350"> - cursor pointer, height/width 16px</tspan><tspan
+         sodipodi:role="line"
+         x="277.14285"
+         y="328.07648"
+         id="tspan4352">no padding and white-space nowrap</tspan></text>
+    <rect
+       style="fill:#cccccc;stroke:#949494;stroke-width:2.79999995;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+       id="rect4374"
+       width="636.42859"
+       height="41.42857"
+       x="744.46619"
+       y="59.881145" />
+    <rect
+       style="fill:#cccccc;stroke:#949494;stroke-width:2.79999995;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+       id="rect4376"
+       width="165.69749"
+       height="237.39816"
+       x="750.5271"
+       y="114.42938" />
+    <rect
+       style="fill:#cccccc;stroke:#949494;stroke-width:2.79999995;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+       id="rect4378"
+       width="123.27108"
+       height="237.39816"
+       x="791.94336"
+       y="113.41924" />
+    <text
+       xml:space="preserve"
+       style="font-size:12px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+       x="828.32507"
+       y="150.29596"
+       id="text4380"><tspan
+         sodipodi:role="line"
+         id="tspan4382"
+         x="828.32507"
+         y="150.29596">menu pulldown.</tspan></text>
+    <text
+       xml:space="preserve"
+       style="font-size:12px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+       x="796.00024"
+       y="395.76303"
+       id="text4384"><tspan
+         sodipodi:role="line"
+         id="tspan4386"
+         x="796.00024"
+         y="395.76303">&lt;div c=x-layer x-menu</tspan><tspan
+         sodipodi:role="line"
+         x="796.00024"
+         y="410.76303"
+         id="tspan4390">    &lt;a c=x-menu-focus</tspan><tspan
+         sodipodi:role="line"
+         x="796.00024"
+         y="425.76303"
+         id="tspan4392">    &lt;ul  c=x-menu-list</tspan><tspan
+         sodipodi:role="line"
+         x="796.00024"
+         y="440.76303"
+         id="tspan4428" /><tspan
+         sodipodi:role="line"
+         x="796.00024"
+         y="455.76303"
+         id="tspan4426">(for items checkbox</tspan><tspan
+         sodipodi:role="line"
+         x="796.00024"
+         y="470.76303"
+         id="tspan4394">        &lt;li  c=x-menu-list-item x-menu-list-checked</tspan><tspan
+         sodipodi:role="line"
+         x="796.00024"
+         y="485.76303"
+         id="tspan4396">            &lt; a c=x-menu-item x-menu-check-item</tspan><tspan
+         sodipodi:role="line"
+         x="796.00024"
+         y="500.76303"
+         id="tspan4398"></tspan><tspan
+         sodipodi:role="line"
+         x="796.00024"
+         y="515.763"
+         id="tspan4422">(for items seperator</tspan><tspan
+         sodipodi:role="line"
+         x="796.00024"
+         y="530.763"
+         id="tspan4424">        &lt;li c=x-menu-list-item  x-menu-sep-li</tspan><tspan
+         sodipodi:role="line"
+         x="796.00024"
+         y="545.763"
+         id="tspan4404">               &lt;span c=x-menu-sep</tspan><tspan
+         sodipodi:role="line"
+         x="796.00024"
+         y="560.763"
+         id="tspan4416"></tspan><tspan
+         sodipodi:role="line"
+         x="796.00024"
+         y="575.763"
+         id="tspan4418"> (for items active</tspan><tspan
+         sodipodi:role="line"
+         x="796.00024"
+         y="590.763"
+         id="tspan4406">        &lt;li c=x-menu-list-item  x-menu-item-active</tspan><tspan
+         sodipodi:role="line"
+         x="796.00024"
+         y="605.763"
+         id="tspan4412"></tspan><tspan
+         sodipodi:role="line"
+         x="796.00024"
+         y="620.763"
+         id="tspan4420"> (for items with submenus..</tspan><tspan
+         sodipodi:role="line"
+         x="796.00024"
+         y="635.763"
+         id="tspan4414">        &lt;li c=x-menu-list-item  x-menu-item-arrow</tspan><tspan
+         sodipodi:role="line"
+         x="796.00024"
+         y="650.763"
+         id="tspan4408">.....</tspan><tspan
+         sodipodi:role="line"
+         x="796.00024"
+         y="665.763"
+         id="tspan4430"> (for items with disabled</tspan><tspan
+         sodipodi:role="line"
+         x="796.00024"
+         y="680.763"
+         id="tspan4432">        &lt;li c=x-menu-list-item  x-menu-item-disabled</tspan><tspan
+         sodipodi:role="line"
+         x="796.00024"
+         y="695.763"
+         id="tspan4434" /><tspan
+         sodipodi:role="line"
+         x="796.00024"
+         y="710.763"
+         id="tspan4410" /><tspan
+         sodipodi:role="line"
+         x="796.00024"
+         y="725.763"
+         id="tspan4400" /><tspan
+         sodipodi:role="line"
+         x="796.00024"
+         y="740.763"
+         id="tspan4402" /><tspan
+         sodipodi:role="line"
+         x="796.00024"
+         y="755.763"
+         id="tspan4388" /></text>
+    <text
+       xml:space="preserve"
+       style="font-size:12px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+       x="1105.1069"
+       y="317.98129"
+       id="text4436"><tspan
+         sodipodi:role="line"
+         id="tspan4438"
+         x="1105.1069"
+         y="317.98129">x-menu</tspan><tspan
+         sodipodi:role="line"
+         x="1105.1069"
+         y="332.98129"
+         id="tspan4440">   ** background y repeated shade's left</tspan><tspan
+         sodipodi:role="line"
+         x="1105.1069"
+         y="347.98129"
+         id="tspan4444">bordered 1ps solid.</tspan><tspan
+         sodipodi:role="line"
+         x="1105.1069"
+         y="347.98129"
+         id="tspan4446" /><tspan
+         sodipodi:role="line"
+         x="1105.1069"
+         y="362.98129"
+         id="tspan4442">   </tspan></text>
+    <text
+       xml:space="preserve"
+       style="font-size:12px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+       x="1107.1272"
+       y="379.60059"
+       id="text4448"><tspan
+         sodipodi:role="line"
+         id="tspan4450"
+         x="1107.1272"
+         y="379.60059">x-menu-focus</tspan><tspan
+         sodipodi:role="line"
+         x="1107.1272"
+         y="394.60059"
+         id="tspan4452">   absolute pos: 0,-5  size 0,0</tspan><tspan
+         sodipodi:role="line"
+         x="1107.1272"
+         y="409.60059"
+         id="tspan4454">  line height set to zero</tspan></text>
+    <text
+       xml:space="preserve"
+       style="font-size:12px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+       x="1150.5637"
+       y="442.23004"
+       id="text4456"><tspan
+         sodipodi:role="line"
+         id="tspan4458"
+         x="1150.5637"
+         y="442.23004">.x-menu-list</tspan><tspan
+         sodipodi:role="line"
+         x="1150.5637"
+         y="457.23004"
+         id="tspan4460">   1px border (white)</tspan><tspan
+         sodipodi:role="line"
+         x="1150.5637"
+         y="472.23004"
+         id="tspan4462" /></text>
+    <text
+       xml:space="preserve"
+       style="font-size:12px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+       x="1191.98"
+       y="516.98132"
+       id="text4464"><tspan
+         sodipodi:role="line"
+         id="tspan4466"
+         x="1191.98"
+         y="516.98132">x-menu-list-item</tspan><tspan
+         sodipodi:role="line"
+         x="1191.98"
+         y="531.98132"
+         id="tspan4468"> -moz-user-select none</tspan><tspan
+         sodipodi:role="line"
+         x="1191.98"
+         y="546.98132"
+         id="tspan4470">block, padded 1px nowrap</tspan><tspan
+         sodipodi:role="line"
+         x="1191.98"
+         y="561.98132"
+         id="tspan4472" /></text>
+    <text
+       xml:space="preserve"
+       style="font-size:12px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+       x="1183.3196"
+       y="475.99747"
+       id="text4474"><tspan
+         sodipodi:role="line"
+         id="tspan4476"
+         x="1183.3196"
+         y="475.99747">x-menu li</tspan><tspan
+         sodipodi:role="line"
+         x="1183.3196"
+         y="490.99747"
+         id="tspan4478">100% line height</tspan><tspan
+         sodipodi:role="line"
+         x="1183.3196"
+         y="505.99747"
+         id="tspan4480" /><tspan
+         sodipodi:role="line"
+         x="1183.3196"
+         y="520.99744"
+         id="tspan4482" /></text>
+    <text
+       xml:space="preserve"
+       style="font-size:12px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+       x="1226.3252"
+       y="580.62091"
+       id="text4484"><tspan
+         sodipodi:role="line"
+         id="tspan4486"
+         x="1226.3252"
+         y="580.62091">.x-menu-item</tspan><tspan
+         sodipodi:role="line"
+         x="1226.3252"
+         y="595.62091"
+         id="tspan4488">pointer cursor</tspan><tspan
+         sodipodi:role="line"
+         x="1226.3252"
+         y="610.62091"
+         id="tspan4490">coloured</tspan><tspan
+         sodipodi:role="line"
+         x="1226.3252"
+         y="625.62091"
+         id="tspan4492">block</tspan><tspan
+         sodipodi:role="line"
+         x="1226.3252"
+         y="640.62091"
+         id="tspan4494">line-height (14)</tspan><tspan
+         sodipodi:role="line"
+         x="1226.3252"
+         y="655.62091"
+         id="tspan4496">outline? none</tspan><tspan
+         sodipodi:role="line"
+         x="1226.3252"
+         y="670.62091"
+         id="tspan4498">padded 3,21,3,3</tspan><tspan
+         sodipodi:role="line"
+         x="1226.3252"
+         y="685.62091"
+         id="tspan4500">no decoration</tspan><tspan
+         sodipodi:role="line"
+         x="1226.3252"
+         y="700.62091"
+         id="tspan4502">nowrap</tspan><tspan
+         sodipodi:role="line"
+         x="1226.3252"
+         y="700.62091"
+         id="tspan4504" /></text>
+    <text
+       xml:space="preserve"
+       style="font-size:12px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+       x="1185.9191"
+       y="739.2149"
+       id="text4506"><tspan
+         sodipodi:role="line"
+         id="tspan4508"
+         x="1185.9191"
+         y="739.2149">.x-menu-check-item x-menu-item-icon</tspan><tspan
+         sodipodi:role="line"
+         x="1185.9191"
+         y="754.2149"
+         id="tspan4516"> background image with non tick in it..</tspan><tspan
+         sodipodi:role="line"
+         x="1185.9191"
+         y="769.2149"
+         id="tspan4518" /><tspan
+         sodipodi:role="line"
+         x="1185.9191"
+         y="784.2149"
+         id="tspan4514">.x-menu-item-checked x-menu-item-icon</tspan><tspan
+         sodipodi:role="line"
+         x="1185.9191"
+         y="799.2149"
+         id="tspan4510"> background image with tick in it..</tspan><tspan
+         sodipodi:role="line"
+         x="1185.9191"
+         y="814.2149"
+         id="tspan4512" /></text>
+    <text
+       xml:space="preserve"
+       style="font-size:12px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+       x="1201.0714"
+       y="824.06769"
+       id="text4520"><tspan
+         sodipodi:role="line"
+         id="tspan4522"
+         x="1201.0714"
+         y="824.06769">.x-men-item-icon</tspan><tspan
+         sodipodi:role="line"
+         x="1201.0714"
+         y="839.06769"
+         id="tspan4524">  background positioned in center..</tspan><tspan
+         sodipodi:role="line"
+         x="1201.0714"
+         y="854.06769"
+         id="tspan4526">  no border,</tspan><tspan
+         sodipodi:role="line"
+         x="1201.0714"
+         y="869.06769"
+         id="tspan4528"> size 16,16</tspan><tspan
+         sodipodi:role="line"
+         x="1201.0714"
+         y="884.06769"
+         id="tspan4530"> no padding</tspan><tspan
+         sodipodi:role="line"
+         x="1201.0714"
+         y="899.06769"
+         id="tspan4532"> marings 0,11,0,0</tspan><tspan
+         sodipodi:role="line"
+         x="1201.0714"
+         y="914.06769"
+         id="tspan4534">vertically aligned middle</tspan></text>
+    <text
+       xml:space="preserve"
+       style="font-size:12px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+       x="884.89362"
+       y="760.4281"
+       id="text4536"><tspan
+         sodipodi:role="line"
+         id="tspan4538"
+         x="884.89362"
+         y="760.4281">SEPERATOR</tspan><tspan
+         sodipodi:role="line"
+         x="884.89362"
+         y="775.4281"
+         id="tspan4540">.x-menu li.x-menu-sep-li</tspan><tspan
+         sodipodi:role="line"
+         x="884.89362"
+         y="790.4281"
+         id="tspan4542">  font/line  1px</tspan><tspan
+         sodipodi:role="line"
+         x="884.89362"
+         y="805.4281"
+         id="tspan4546">.x-menu-sep</tspan><tspan
+         sodipodi:role="line"
+         x="884.89362"
+         y="820.4281"
+         id="tspan4548"> background colored</tspan><tspan
+         sodipodi:role="line"
+         x="884.89362"
+         y="835.4281"
+         id="tspan4550"> block</tspan><tspan
+         sodipodi:role="line"
+         x="884.89362"
+         y="850.4281"
+         id="tspan4552"> fontsize/height/line/1px</tspan><tspan
+         sodipodi:role="line"
+         x="884.89362"
+         y="865.4281"
+         id="tspan4554">margins :3,3,3,32</tspan><tspan
+         sodipodi:role="line"
+         x="884.89362"
+         y="865.4281"
+         id="tspan4556" /><tspan
+         sodipodi:role="line"
+         x="884.89362"
+         y="880.4281"
+         id="tspan4544" /></text>
+    <text
+       xml:space="preserve"
+       style="font-size:12px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+       x="866.71088"
+       y="907.9104"
+       id="text4558"><tspan
+         sodipodi:role="line"
+         id="tspan4560"
+         x="866.71088"
+         y="907.9104">SUB MENUS</tspan><tspan
+         sodipodi:role="line"
+         x="866.71088"
+         y="922.9104"
+         id="tspan4562">   .x-menu-item-arrrow</tspan><tspan
+         sodipodi:role="line"
+         x="866.71088"
+         y="937.9104"
+         id="tspan4564">   background arrow..</tspan><tspan
+         sodipodi:role="line"
+         x="866.71088"
+         y="937.9104"
+         id="tspan4566" /></text>
+    <text
+       xml:space="preserve"
+       style="font-size:12px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+       x="921.25909"
+       y="976.60077"
+       id="text4568"><tspan
+         sodipodi:role="line"
+         id="tspan4570"
+         x="921.25909"
+         y="976.60077">DISABLED:</tspan><tspan
+         sodipodi:role="line"
+         x="921.25909"
+         y="991.60077"
+         id="tspan4572">.x-item-disabled *</tspan><tspan
+         sodipodi:role="line"
+         x="921.25909"
+         y="1006.6008"
+         id="tspan4574">   coloured</tspan><tspan
+         sodipodi:role="line"
+         x="921.25909"
+         y="1021.6008"
+         id="tspan4576">cursor default (with not important)</tspan></text>
+    <rect
+       style="fill:#cccccc;stroke:#949494;stroke-width:2.80000019;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+       id="rect4578"
+       width="165.69749"
+       height="93.558403"
+       x="923.26318"
+       y="157.75897" />
+    <rect
+       style="fill:#cccccc;stroke:#949494;stroke-width:2.80000019;stroke-linecap:round;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1"
+       id="rect4580"
+       width="123.27108"
+       height="93.558403"
+       x="964.67944"
+       y="157.36087" />
+    <text
+       xml:space="preserve"
+       style="font-size:12px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+       x="1153.5942"
+       y="119.99138"
+       id="text4586"><tspan
+         sodipodi:role="line"
+         id="tspan4588"
+         x="1153.5942"
+         y="119.99138">color palete</tspan><tspan
+         sodipodi:role="line"
+         x="1153.5942"
+         y="134.99138"
+         id="tspan4590"> .-xmenu-plain .x-colorpalete</tspan><tspan
+         sodipodi:role="line"
+         x="1153.5942"
+         y="149.99138"
+         id="tspan4592">and date-picker</tspan><tspan
+         sodipodi:role="line"
+         x="1153.5942"
+         y="164.99138"
+         id="tspan4594">- border none </tspan><tspan
+         sodipodi:role="line"
+         x="1153.5942"
+         y="179.99138"
+         id="tspan4596">- margins's 0</tspan><tspan
+         sodipodi:role="line"
+         x="1153.5942"
+         y="194.99138"
+         id="tspan4600" /><tspan
+         sodipodi:role="line"
+         x="1153.5942"
+         y="209.99138"
+         id="tspan4602">.x-menu palete/picker</tspan><tspan
+         sodipodi:role="line"
+         x="1153.5942"
+         y="224.99138"
+         id="tspan4604">margin - l:32, r:4</tspan><tspan
+         sodipodi:role="line"
+         x="1153.5942"
+         y="239.99138"
+         id="tspan4606" /><tspan
+         sodipodi:role="line"
+         x="1153.5942"
+         y="254.99138"
+         id="tspan4608">.x-color-palate</tspan><tspan
+         sodipodi:role="line"
+         x="1153.5942"
+         y="269.99136"
+         id="tspan4610">pointer, w:150, h:92</tspan><tspan
+         sodipodi:role="line"
+         x="1153.5942"
+         y="284.99136"
+         id="tspan4598" /></text>
+    <text
+       xml:space="preserve"
+       style="font-size:12px;font-style:normal;font-weight:normal;fill:#000000;fill-opacity:1;stroke:none;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;font-family:Bitstream Vera Sans"
+       x="1344.5131"
+       y="126.05229"
+       id="text4612"><tspan
+         sodipodi:role="line"
+         id="tspan4614"
+         x="1344.5131"
+         y="126.05229">colpal a</tspan><tspan
+         sodipodi:role="line"
+         x="1344.5131"
+         y="141.05229"
+         id="tspan4634">bordered white</tspan><tspan
+         sodipodi:role="line"
+         x="1344.5131"
+         y="156.05229"
+         id="tspan4636">pointer/ left float, </tspan><tspan
+         sodipodi:role="line"
+         x="1344.5131"
+         y="171.05229"
+         id="tspan4638">padding 2px</tspan><tspan
+         sodipodi:role="line"
+         x="1344.5131"
+         y="186.05229"
+         id="tspan4640">no decoration</tspan><tspan
+         sodipodi:role="line"
+         x="1344.5131"
+         y="201.05231"
+         id="tspan4642" /><tspan
+         sodipodi:role="line"
+         x="1344.5131"
+         y="216.05231"
+         id="tspan4632">x-col.palete em span</tspan><tspan
+         sodipodi:role="line"
+         x="1344.5131"
+         y="231.05231"
+         id="tspan4620">pointer/block</tspan><tspan
+         sodipodi:role="line"
+         x="1344.5131"
+         y="246.05231"
+         id="tspan4618">size:10,10 (in line)</tspan><tspan
+         sodipodi:role="line"
+         x="1344.5131"
+         y="261.05231"
+         id="tspan4626" /><tspan
+         sodipodi:role="line"
+         x="1344.5131"
+         y="276.05231"
+         id="tspan4628">colpalete em</tspan><tspan
+         sodipodi:role="line"
+         x="1344.5131"
+         y="291.05231"
+         id="tspan4630"> - block / 1pt border</tspan><tspan
+         sodipodi:role="line"
+         x="1344.5131"
+         y="306.05231"
+         id="tspan4624" /></text>
+  </g>
+</svg>
diff --git a/css/qtips.css b/css/qtips.css
new file mode 100644 (file)
index 0000000..05cb359
--- /dev/null
@@ -0,0 +1,43 @@
+.x-tip{\r
+       position: absolute;\r
+       top: 0;\r
+       visibility: hidden;\r
+       z-index: 11000;\r
+}\r
+.x-tip .x-tip-bd{\r
+       background: #e0e8f3 url(../images/default/qtip/bg.gif) repeat-x;\r
+       border: 1px solid #a3bad9;\r
+       font: normal 11px arial,helvetica,sans-serif;\r
+       padding: 5px;\r
+}\r
+.x-tip .x-tip-close{\r
+       background-image: url(../images/default/basic-dialog/close.gif);\r
+       height: 15px;\r
+       position: absolute;\r
+       right: 3px;\r
+       top: 3px;\r
+       width: 15px;\r
+}\r
+.x-tip .x-tip-hd {\r
+       background: url(../images/default/basic-dialog/hd-sprite.gif) repeat-x 0px -82px;\r
+       background-color: navy;\r
+       color: #FFF;\r
+       display: block;\r
+       font: bold 11px tahoma, arial, verdana, helvetica;\r
+       padding: 4px;\r
+}\r
+.x-tip .x-tip-hd-left {\r
+       background: url(../images/default/basic-dialog/hd-sprite.gif) no-repeat 0px -41px;\r
+       display: block;\r
+       margin: 0px;\r
+       padding-left: 3px;\r
+}\r
+.x-tip .x-tip-hd-right {\r
+       background: url(../images/default/basic-dialog/hd-sprite.gif) no-repeat right 0px;\r
+       display: block;\r
+       padding-right: 3px;\r
+}\r
+/* was y\:qtip ??? */
+x\:qtip, qtip{\r
+       display: none;\r
+}
\ No newline at end of file
diff --git a/css/reset-min.css b/css/reset-min.css
new file mode 100644 (file)
index 0000000..7f7c276
--- /dev/null
@@ -0,0 +1,23 @@
+body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,p,blockquote,th,td{
+        margin:0;
+        padding:0;
+}
+fieldset,img{
+        border:0;
+}
+address,caption,cite,code,dfn,em,strong,th,var{
+    font-style:normal;
+    font-weight:normal;
+}
+ol,ul {
+        list-style:none;
+    }
+caption,th {
+        text-align:left;
+}
+h1,h2,h3,h4,h5,h6{
+        font-size:100%;
+}
+q:before,q:after{
+    content:'';
+}
\ No newline at end of file
diff --git a/css/resizable.css b/css/resizable.css
new file mode 100644 (file)
index 0000000..3295a3f
--- /dev/null
@@ -0,0 +1,132 @@
+.x-resizable-handle {\r
+    position:absolute;\r
+    z-index:100;\r
+    /* ie needs these */\r
+    font-size:1px;\r
+    line-height:6px;\r
+    overflow:hidden;\r
+        background:white;\r
+        filter:alpha(opacity=0);\r
+        opacity:0;\r
+        zoom:1;\r
+}\r
+.x-resizable-handle-east{\r
+    width:6px;\r
+    cursor:e-resize;\r
+    right:0px;\r
+    top:0px;\r
+    height:100%;\r
+        margin-right:-1px; /*IE rounding error*/\r
+}\r
+.x-resizable-handle-south{\r
+    width:100%;\r
+    cursor:s-resize;\r
+    left:0px;\r
+    bottom:0px;\r
+    height:6px;\r
+        margin-bottom:-1px; /*IE rounding error*/\r
+}\r
+.x-resizable-handle-west{\r
+    width:6px;\r
+    cursor:w-resize;\r
+    left:0px;\r
+    top:0px;\r
+    height:100%;\r
+}\r
+.x-resizable-handle-north{\r
+    width:100%;\r
+    cursor:n-resize;\r
+    left:0px;\r
+    top:0px;\r
+    height:6px;\r
+}\r
+.x-resizable-handle-southeast{\r
+    width:6px;\r
+    cursor:se-resize;\r
+    right:0px;\r
+    bottom:0px;\r
+    height:6px;\r
+    z-index:101;\r
+}\r
+.x-resizable-handle-northwest{\r
+    width:6px;\r
+    cursor:nw-resize;\r
+    left:0px;\r
+    top:0px;\r
+    height:6px;\r
+    z-index:101;\r
+}\r
+.x-resizable-handle-northeast{\r
+    width:6px;\r
+    cursor:ne-resize;\r
+    right:0px;\r
+    top:0px;\r
+    height:6px;\r
+    z-index:101;\r
+}\r
+.x-resizable-handle-southwest{\r
+    width:6px;\r
+    cursor:sw-resize;\r
+    left:0px;\r
+    bottom:0px;\r
+    height:6px;\r
+    z-index:101;\r
+}\r
+.x-resizable-over .x-resizable-handle, .x-resizable-pinned .x-resizable-handle{\r
+    filter:alpha(opacity=100);\r
+        opacity:1;\r
+}\r
+.x-resizable-over .x-resizable-handle-east, .x-resizable-pinned .x-resizable-handle-east{\r
+    background:url(../images/default/sizer/e-handle.gif);\r
+        background-position: left;\r
+}\r
+.x-resizable-over .x-resizable-handle-west, .x-resizable-pinned .x-resizable-handle-west{\r
+    background:url(../images/default/sizer/e-handle.gif);\r
+        background-position: left;\r
+}\r
+.x-resizable-over .x-resizable-handle-south, .x-resizable-pinned .x-resizable-handle-south{\r
+    background:url(../images/default/sizer/s-handle.gif);\r
+    background-position: top;\r
+}\r
+.x-resizable-over .x-resizable-handle-north, .x-resizable-pinned .x-resizable-handle-north{\r
+    background:url(../images/default/sizer/s-handle.gif);\r
+    background-position: top;\r
+}\r
+.x-resizable-over .x-resizable-handle-southeast, .x-resizable-pinned .x-resizable-handle-southeast{\r
+    background:url(../images/default/sizer/corners-sprite.gif);\r
+    background-position: top left;\r
+}\r
+.x-resizable-over .x-resizable-handle-northwest, .x-resizable-pinned .x-resizable-handle-northwest{\r
+    background:url(../images/default/sizer/corners-sprite.gif);\r
+    background-position:bottom right;\r
+}\r
+.x-resizable-over .x-resizable-handle-northeast, .x-resizable-pinned .x-resizable-handle-northeast{\r
+    background:url(../images/default/sizer/corners-sprite.gif);\r
+    background-position: bottom left;\r
+}\r
+.x-resizable-over .x-resizable-handle-southwest, .x-resizable-pinned .x-resizable-handle-southwest{\r
+    background:url(../images/default/sizer/corners-sprite.gif);\r
+    background-position: top right;\r
+}\r
+.x-resizable-proxy{\r
+    border: 1px dashed #6593cf;\r
+    position:absolute;\r
+    overflow:hidden;\r
+    visibility:hidden;\r
+        left:0;top:0;\r
+    z-index:1001;\r
+}\r
+.x-resizable-overlay{\r
+    width:100%;\r
+        height:100%;\r
+        display:none;\r
+        position:absolute;\r
+        left:0;\r
+        top:0;\r
+        background:white;\r
+        z-index:20000;\r
+        -moz-opacity: 0;\r
+    opacity:0;\r
+    filter: alpha(opacity=0);\r
+        border:1px solid red;\r
+}\r
diff --git a/css/roojs-debug.css b/css/roojs-debug.css
new file mode 100644 (file)
index 0000000..1f6c331
--- /dev/null
@@ -0,0 +1,29 @@
+/**
+ *  Debug version of CSS - should make editing and testing easier!
+ *
+ */
+
+@import url("reset-min.css");
+@import url("core.css");
+@import url("tabs.css");
+@import url("form.css");
+@import url("button.css");
+@import url("toolbar.css");
+@import url("resizable.css");
+@import url("grid.css");
+@import url("layout.css");
+@import url("basic-dialog.css");
+@import url("dd.css");
+@import url("tree.css");
+@import url("qtips.css");
+/* needs improving! */
+@import url("date.css");
+@import url("menu.css");
+/* missing! 
+/* @import url("box.css"); */
+/* not important! */
+/* @import url("debug.css"); */
+/* very loose hack */
+@import url("combo.css");
+@import url("inline-editor.css");
+
diff --git a/css/tabs.css b/css/tabs.css
new file mode 100644 (file)
index 0000000..16fdf8d
--- /dev/null
@@ -0,0 +1,127 @@
+.x-tabs-body {
+    background: #fff;
+}
+.x-tabs-wrap {\r
+       border-bottom:1px solid #6593cf;\r
+       padding-top:2px;\r
+}\r
+.x-tabs-strip-wrap{\r
+       width:100%;     \r
+}\r
+.x-tabs-wrap table{\r
+       position:relative;\r
+       top:0; left:0;\r
+}\r
+.x-tabs-strip td{\r
+       padding:0;\r
+       padding-left:2px;\r
+}\r
+.x-tabs-strip a, .x-tabs-strip span, .x-tabs-strip em {\r
+       display:block;\r
+}\r
+.x-tabs-strip a {\r
+       text-decoration:none !important;\r
+       -moz-outline: none;\r
+       outline: none;\r
+       cursor:pointer;\r
+}\r
+.x-tabs-strip .x-tabs-text {\r
+       font:bold 11px tahoma,arial,helvetica;\r
+       color:#666;\r
+       overflow:hidden;\r
+       white-space: nowrap;\r
+       cursor:pointer;\r
+       text-overflow: ellipsis;\r
+}\r
+.x-tabs-strip .on .x-tabs-text {\r
+       cursor:default;\r
+       color:#083772;\r
+}\r
+.x-tabs-strip .disabled .x-tabs-text {\r
+       cursor:default;\r
+       color:#aaaaaa;\r
+}\r
+.x-tabs-strip .x-tabs-inner {\r
+        padding:4px 10px;      \r
+}\r
+\r
+.x-tabs-strip .on .x-tabs-right {\r
+        background: url(../images/default/tabs/tab-sprite.gif) no-repeat right 0;\r
+}\r
+.x-tabs-strip .on .x-tabs-left {\r
+        background: url(../images/default/tabs/tab-sprite.gif) no-repeat 0 -100px;\r
+}\r
+.x-tabs-strip .x-tabs-right {\r
+        background: url(../images/default/tabs/tab-sprite.gif) no-repeat right -50px;\r
+}\r
+.x-tabs-strip .x-tabs-left {\r
+        background: url(../images/default/tabs/tab-sprite.gif) no-repeat 0 -150px;\r
+}\r
+\r
+.x-tabs-strip  a {\r
+       position:relative;\r
+       top:1px; left:0;\r
+}\r
+.x-tabs-strip .on a {\r
+       position:relative;\r
+}\r
+.x-tabs-strip .on .x-tabs-inner {\r
+       padding-bottom:5px;\r
+}\r
+/** closable tabs */\r
+.x-tabs-strip .x-tabs-closable .x-tabs-inner{\r
+       padding-right:22px;\r
+       position:relative;\r
+}\r
+.x-tabs-strip .x-tabs-closable .close-icon{\r
+       line-height: 1px;\r
+       font-size:1px;\r
+  background-image:url(../images/default/layout/layout-sprite.gif);\r
+  background-repeat: no-repeat;\r
+  background-position: 50% -60px;\r
+       display:block;\r
+       position:absolute;\r
+       right:5px;top:4px;\r
+       width:12px;height:11px;\r
+       cursor:pointer;\r
+}\r
+.x-tabs-strip .on .close-icon{\r
+    background-image:url(../images/default/layout/layout-sprite.gif);\r
+    background-repeat: no-repeat;\r
+    background-position: 50% -60px;\r
+}\r
+.x-tabs-strip .x-tabs-closable .close-over{\r
+    background-image:url(../images/default/layout/layout-sprite.gif);\r
+    background-repeat: no-repeat;\r
+    background-position: 50% -72px;\r
+}\r
+\r
+.x-tabs-bottom .x-tabs-wrap {\r
+       border-top:1px solid #6593cf;\r
+       border-bottom:0 none;\r
+       padding-top:0;\r
+       padding-bottom:2px;\r
+}\r
+.x-tabs-bottom .x-tabs-strip .x-tabs-right {\r
+        background: url(../images/default/tabs/tab-btm-inactive-right-bg.gif) no-repeat bottom left;\r
+}\r
+.x-tabs-bottom .x-tabs-strip .x-tabs-left {\r
+        background: url(../images/default/tabs/tab-btm-inactive-left-bg.gif) no-repeat bottom right;\r
+}\r
+.x-tabs-bottom .x-tabs-strip .on .x-tabs-right {\r
+        background: url(../images/default/tabs/tab-btm-right-bg.gif) no-repeat bottom left;\r
+}\r
+.x-tabs-bottom .x-tabs-strip .on .x-tabs-left {\r
+        background: url(../images/default/tabs/tab-btm-left-bg.gif) no-repeat bottom right;\r
+}\r
+.x-tabs-bottom .x-tabs-strip  a {\r
+       position:relative;\r
+       top:0; left:0;\r
+}\r
+.x-tabs-bottom .x-tabs-strip .on a {\r
+       margin-top:-1px;\r
+}\r
+.x-tabs-bottom .x-tabs-strip .on .x-tab-inner {\r
+       padding-top:5px;\r
+}\r
+\r
diff --git a/css/toolbar.css b/css/toolbar.css
new file mode 100644 (file)
index 0000000..48a0d0a
--- /dev/null
@@ -0,0 +1,377 @@
+/* ------- MAIN TOOLBAR ---------------- */
+
+.x-toolbar {\r
+       background: url(../images/default/toolbar/gray-bg.gif) repeat-x 0 0;\r
+       border-top: 1px solid #cbc7b8;
+    border-bottom: 1px solid #cbc7b8;\r
+       display: block;
+    position: relative;\r
+       padding: 2px;\r
+}
+.x-toolbar .x-btn 
+{
+    margin-left: 2px;
+    margin-right: 2px;
+}
+
+/* ------------ FONTS / colors.-----------------------*/
+.x-toolbar td,
+.x-toolbar span,
+.x-toolbar input,
+.x-toolbar div,
+.x-toolbar select,
+.x-toolbar label
+{
+       
+    font: normal 11px tahoma, verdana, helvetica;
+    white-space: nowrap;
+    line-height: normal;
+    
+}
+
+
+/* ------------ VERTICAL ALIGNMENT -----------------------*/
+.x-toolbar td
+{
+    vertical-align: middle;
+}
+
+/* ------------ TOOLBAR BUTTONS -----------------------*/
+
+.x-toolbar .x-btn-left,
+.x-toolbar .x-btn-right,
+.x-toolbar .x-btn-center
+{
+    /* not sure if blanking background looks that good - it confuses end users   */
+    background: none;
+   
+}
+.x-toolbar .x-btn-center
+{
+    padding: 0px;
+}
+
+/*  ------------ TOOLBAR BUTTONS  (WITH MENU) --------- */
+.x-toolbar .x-btn-with-menu .x-btn-center em
+{
+    padding-right: 14px;
+}
+
+
+
+/* ------------ TOOLBAR ITEMS -----------------------*/
+
+.x-toolbar .ytb-text
+{
+    padding: 2px;
+   }
+
+/* ------------ TOOLBAR OVER / CLICK / CENTER-----------------------*/
+
+.x-toolbar .x-btn-click .x-btn-center,
+.x-toolbar .x-btn-pressed .x-btn-center,
+.x-toolbar .x-btn-active .x-btn-center,
+.x-toolbar .x-btn-over .x-btn-center,
+
+.x-toolbar .x-btn-click .x-btn-left,
+.x-toolbar .x-btn-pressed .x-btn-left,
+.x-toolbar .x-btn-active .x-btn-left,
+.x-toolbar .x-btn-over .x-btn-left,
+
+.x-toolbar .x-btn-click .x-btn-right,
+.x-toolbar .x-btn-pressed .x-btn-right,
+.x-toolbar .x-btn-active .x-btn-right,
+.x-toolbar .x-btn-over .x-btn-right
+{
+    background-repeat: no-repeat;
+    background-image: url(../images/default/basic-dialog/btn-sprite.gif);
+    
+}
+
+.x-toolbar .x-btn-click .x-btn-center,
+.x-toolbar .x-btn-pressed .x-btn-center,
+.x-toolbar .x-btn-active .x-btn-center
+{
+    background-position:0  -42px;
+    background-repeat: repeat-x;
+}
+
+.x-toolbar .x-btn-over .x-btn-center
+{
+    background-position:  0 -105px;
+    background-repeat: repeat-x;
+} 
+
+.x-toolbar .x-btn-click .x-btn-left,
+.x-toolbar .x-btn-pressed .x-btn-left,
+.x-toolbar .x-btn-active .x-btn-left
+{
+    background-position:0  0;
+    
+}
+
+.x-toolbar .x-btn-over .x-btn-left
+{
+    background-position:  0 -63px;
+   
+} 
+
+.x-toolbar .x-btn-click .x-btn-right,
+.x-toolbar .x-btn-pressed .x-btn-right,
+.x-toolbar .x-btn-active .x-btn-right
+{
+    background-position:0  -21px;
+    
+}
+
+.x-toolbar .x-btn-over .x-btn-right
+{
+    background-position:  0 -84px;
+} 
+/* ------------ MENUS -----------------------*/
+
+.x-menu 
+{
+    background: white url(../images/default/menu/menu-bg.gif) repeat-y 0 0;
+    font:normal 11px arial, tahoma, verdana, helvetica;
+    border: 1px solid black;
+    margin-top: 2px;
+    margin-left: 2px;
+}
+
+.x-menu-plain
+{
+    background: none;
+}
+.x-menu-plain .x-menu-list-item .x-color-palette, 
+.x-menu-plain .x-menu-list-item .x-date-picker 
+{ 
+    margin-left: 4px;
+    margin-right: 0;
+}
+.x-menu-focus
+{
+    position: absolute;
+    left: 0;
+    top: -5px;
+    width: 0;
+    height: 0;
+}
+.x-menu-list
+{
+    border: 1px solid white;
+}
+.x-menu li
+{
+    line-height; 100%;
+}
+
+.x-menu-list-item
+{
+    -moz-user-select: none;
+    display: block;
+    /* padding: 1px; */
+    white-space: nowrap;
+}
+
+
+.x-menu-item
+{
+    pointer: cursor;
+    color: #333;
+    display: block;
+    line-height: 15px;
+    outline: none;
+    padding: 3px 21px 3px 3px;
+    text-decoration:none ;
+    white-space: nowrap;
+}
+.x-menu-item-active
+{
+    background-color: #ABC9C2;
+}
+
+
+.x-menu li.x-menu-sep-li
+{
+    
+    font-size: 1px;
+    line-height: 1px;
+    background: #ccc;
+    display: block
+    height: 1px;
+    margin: 3px 3px 3px 32px;
+}
+.x-menu-item-icon
+{
+    background-position; center center;
+    border: 0px;
+    width: 16px;
+    height: 16px;
+    padding: 0px;
+    margin: 0 11px 0 0;
+    vertical-align: middle;
+    
+}
+
+
+.x-menu-list-item .x-menu-item-arrow 
+{
+    background: url(../images/default/grid/page-next.gif) no-repeat right 2px;
+}
+
+
+
+/* ------------ CHECKBOX ITEM-----------------------*/
+
+
+/* ------------ DISABLED ITEMS -----------------------*/
+.x-item-disabled .x-menu-item ,
+.x-item-disabled
+{
+    color : #ccc;
+    cursor: default !important;
+    
+}
+
+
+
+/* ------------ OLD STUFF!!! -----------------------*/
+.x-menu-check-item .x-menu-item-icon
+{
+    background: url(../images/default/menu/chk-sprite.gif) no-repeat 0 0;
+    width: 16px;
+    height: 16px;
+}
+.x-menu-item-checked .x-menu-check-item  .x-menu-item-icon
+{
+    background-position: 0 -16px;
+    width: 16px;
+    height: 16px;
+}
+
+
+
+
+/* NOT SURE WHAT THIS DOES ? - MS HACK? */
+\r
+\r
+.mso .x-toolbar, .x-grid-mso .x-toolbar
+{\r
+       border: 0px none;\r
+       background: url(../images/default/grid/mso-hd.gif);\r
+}\r
+*/
+
+
+/* disabled?? */\r
+.x-toolbar .x-tb-button-disabled .x-tb-button-inner
+{\r
+       color:gray;\r
+       cursor:default;\r
+}\r
+
+
+/* a seperator */
+
+
+
+
+
+
+
+.x-toolbar .ytb-sep {
+    background-image:url(../images/default/grid/grid-split.gif);
+    background-position:center center;
+    background-repeat:no-repeat;
+    border:0pt none;
+    cursor:default;
+    display:block;
+    font-size:1px;
+    height:16px;
+    margin:0pt 2px;
+    overflow:hidden;
+    width:4px;
+}
+
+
+
+
+\r
+/*\r
+ Default button class is icon only. Add a class with a background-image property\r
+ to your toolbar button\r
+*/
+/*\r
+.x-toolbar .x-tb-button-inner
+{\r
+       background-position: center;\r
+       background-repeat: no-repeat;\r
+       display: block;\r
+       height: 16px;\r
+       width: 16px;\r
+       cursor:pointer;\r
+       white-space: nowrap;\r
+}
+*/\r
+\r
+/* \r
+ Button class for icon and text. Add this class and a class with a background-image \r
+ to your toolbar button for both text and icon \r
+*/
+/*
+/*\r
+.x-toolbar .x-tb-text-icon
+{\r
+       background-position: 0px 0px;\r
+       background-repeat: no-repeat;\r
+       padding-left:18px;\r
+       padding-top:1px;\r
+       width:auto;\r
+       display:block;\r
+}
+*/\r
+*/\r
+/* \r
+ Button class for a button with only text. Add this class  \r
+ to your toolbar button for a just text button\r
+*/
+/*\r
+.x-toolbar .x-tb-text-only{\r
+       background:none;\r
+       padding-left:0px;\r
+       padding-top:1px;\r
+       width:auto;\r
+       display:block;\r
+}\r
+.x-toolbar .x-tb-text{\r
+   padding:2px;\r
+}\r
+.x-toolbar .x-tb-button{\r
+   padding:2px 3px;\r
+       display:block;\r
+}\r
+.x-toolbar .x-tb-button-over{\r
+   background:#c3d3ed url(../images/default/toolbar/btn-over-bg.gif) repeat-x;\r
+       border:1px solid #6593cf;\r
+       padding:1px 2px;\r
+}\r
+.x-toolbar .x-tb-sep {\r
+       background-image: url(../images/default/grid/grid-split.gif);\r
+       background-position: center;\r
+       background-repeat: no-repeat;\r
+       display: block;\r
+       font-size: 1px;\r
+       height: 16px;\r
+       width:4px;\r
+       overflow: hidden;\r
+       cursor:default;\r
+       margin: 0px 2px 0px;\r
+       border:0px;\r
+}\r
+.mso .x-toolbar .x-tb-sep, .x-grid-mso .x-toolbar .x-tb-sep{\r
+       background-image: url(../images/default/grid/grid-blue-split.gif);\r
+}\r
+\r
+*/
\ No newline at end of file
diff --git a/css/tree.css b/css/tree.css
new file mode 100644 (file)
index 0000000..78f7324
--- /dev/null
@@ -0,0 +1,165 @@
+.x-tree-icon, .x-tree-ec-icon, .x-tree-elbow-line, .x-tree-elbow, .x-tree-elbow-end, .x-tree-elbow-plus, .x-tree-elbow-minus, .x-tree-elbow-end-plus, .x-tree-elbow-end-minus{\r
+       border: 0 none;\r
+       height: 18px;\r
+       margin: 0px;\r
+       padding: 0px;\r
+       vertical-align: middle;\r
+       width: 16px;\r
+}\r
+.x-tree-node-collapsed .x-tree-node-icon, .x-tree-node-expanded .x-tree-node-icon, .x-tree-node-leaf .x-tree-node-icon{\r
+       border: 0 none;\r
+       height: 16px;\r
+       margin: 0px;\r
+       padding: 0px;\r
+       vertical-align: middle;\r
+       width: 16px;\r
+       background-position:center;\r
+}\r
+\r
+/* some default icons for leaf/folder */\r
+.x-tree-node-collapsed .x-tree-node-icon{\r
+       background:transparent url(../images/default/tree/folder.gif);\r
+}\r
+.x-tree-node-expanded .x-tree-node-icon{\r
+       background:transparent url(../images/default/tree/folder-open.gif);\r
+}\r
+.x-tree-node-leaf .x-tree-node-icon{\r
+       background:transparent url(../images/default/tree/leaf.gif);\r
+}\r
+\r
+/* loading icon */\r
+.x-tree-node-loading .x-tree-node-icon{\r
+       background:transparent url(../images/default/tree/loading.gif) !important;\r
+}\r
+.x-tree-node-loading a span{\r
+        font-style: italic;\r
+        color:#444444;\r
+}\r
+\r
+/* Line styles */\r
+.x-tree-lines .x-tree-elbow{\r
+       background:transparent url(../images/default/tree/elbow.gif);\r
+}\r
+.x-tree-lines .x-tree-elbow-plus{\r
+       background:transparent url(../images/default/tree/elbow-plus.gif);\r
+}\r
+.x-tree-lines .x-tree-elbow-minus{\r
+       background:transparent url(../images/default/tree/elbow-minus.gif);\r
+}\r
+.x-tree-lines .x-tree-elbow-end{\r
+       background:transparent url(../images/default/tree/elbow-end.gif);\r
+}\r
+.x-tree-lines .x-tree-elbow-end-plus{\r
+       background:transparent url(../images/default/tree/elbow-end-plus.gif);\r
+}\r
+.x-tree-lines .x-tree-elbow-end-minus{\r
+       background:transparent url(../images/default/tree/elbow-end-minus.gif);\r
+}\r
+.x-tree-lines .x-tree-elbow-line{\r
+       background:transparent url(../images/default/tree/elbow-line.gif);\r
+}\r
+\r
+/* No line styles */\r
+.x-tree-no-lines .x-tree-elbow{\r
+       background:transparent;\r
+}\r
+.x-tree-no-lines .x-tree-elbow-plus{\r
+       background:transparent url(../images/default/tree/elbow-plus-nl.gif);\r
+}\r
+.x-tree-no-lines .x-tree-elbow-minus{\r
+       background:transparent url(../images/default/tree/elbow-minus-nl.gif);\r
+}\r
+.x-tree-no-lines .x-tree-elbow-end{\r
+       background:transparent;\r
+}\r
+.x-tree-no-lines .x-tree-elbow-end-plus{\r
+       background:transparent url(../images/default/tree/elbow-end-plus-nl.gif);\r
+}\r
+.x-tree-no-lines .x-tree-elbow-end-minus{\r
+       background:transparent url(../images/default/tree/elbow-end-minus-nl.gif);\r
+}\r
+.x-tree-no-lines .x-tree-elbow-line{\r
+       background:transparent;\r
+}\r
+\r
+.x-tree-elbow-plus, .x-tree-elbow-minus, .x-tree-elbow-end-plus, .x-tree-elbow-end-minus{\r
+       cursor:pointer;\r
+}\r
+\r
+.x-tree-node{\r
+       color: black;\r
+       font: normal 11px arial, helvetica, sans-serif;\r
+       white-space: nowrap;\r
+}\r
+.x-tree-node a, .x-dd-drag-ghost a{\r
+       text-decoration:none;\r
+       color:black;\r
+       -khtml-user-select:normal;\r
+       -moz-user-select:normal;\r
+}\r
+.x-tree-node a span, .x-dd-drag-ghost a span{\r
+       text-decoration:none;\r
+       color:black;\r
+       padding:1px 3px 1px 2px;\r
+}\r
+.x-tree-node .x-tree-node-disabled a span{\r
+       color:gray !important;\r
+}\r
+.x-tree-node .x-tree-node-disabled .x-tree-node-icon{\r
+       -moz-opacity: 0.5;\r
+   opacity:.5;\r
+   filter: alpha(opacity=50);\r
+}\r
+.x-tree-node .x-tree-node-inline-icon{\r
+       background:transparent;\r
+}\r
+.x-tree-node a:hover, .x-dd-drag-ghost a:hover{\r
+       text-decoration:none;\r
+}\r
+.x-tree-node div.x-tree-drag-insert-below{\r
+        border-bottom:1px dotted #3366cc;\r
+}\r
+.x-tree-node div.x-tree-drag-insert-above{\r
+        border-top:1px dotted #3366cc;\r
+}\r
+.x-tree-dd-underline .x-tree-node div.x-tree-drag-insert-below{\r
+        border-bottom:0px none;\r
+}\r
+.x-tree-dd-underline .x-tree-node div.x-tree-drag-insert-above{\r
+        border-top:0px none;\r
+}\r
+.x-tree-dd-underline .x-tree-node div.x-tree-drag-insert-below a{\r
+        border-bottom:2px solid #3366cc;\r
+}\r
+.x-tree-dd-underline .x-tree-node div.x-tree-drag-insert-above a{\r
+        border-top:2px solid #3366cc;\r
+}\r
+.x-tree-node .x-tree-drag-append a span{\r
+        background:#dddddd;\r
+        border:1px dotted gray;\r
+}\r
+.x-tree-node .x-tree-selected a span{\r
+       background:#3366cc;\r
+       color:white;\r
+}\r
+.x-dd-drag-ghost .x-tree-node-indent, .x-dd-drag-ghost .x-tree-ec-icon{\r
+       display:none !important;\r
+}\r
+.x-tree-drop-ok-append .x-dd-drop-icon{\r
+  background-image: url(../images/default/tree/drop-add.gif);\r
+}\r
+.x-tree-drop-ok-above .x-dd-drop-icon{\r
+  background-image: url(../images/default/tree/drop-over.gif);\r
+}\r
+.x-tree-drop-ok-below .x-dd-drop-icon{\r
+  background-image: url(../images/default/tree/drop-under.gif);\r
+}\r
+.x-tree-drop-ok-between .x-dd-drop-icon{\r
+  background-image: url(../images/default/tree/drop-between.gif);\r
+}\r
+.x-layer-shadow{\r
+       background:#cccccc;\r
+   opacity:.3;\r
+   -moz-opacity:.3;\r
+   filter: alpha(opacity=30);\r
+}
\ No newline at end of file
diff --git a/css/ytheme-aero.css b/css/ytheme-aero.css
new file mode 100644 (file)
index 0000000..2a8a890
--- /dev/null
@@ -0,0 +1,333 @@
+/** \r
+* Tabs\r
+*/\r
+.x-tabs-wrap, .x-layout-panel .x-tabs-top .x-tabs-wrap {\r
+   background:#deecfd;\r
+       border:1px solid #8db2e3;\r
+       padding-bottom:2px;\r
+       padding-top:0px;\r
+}\r
+.x-tabs-strip-wrap{\r
+       padding-top:1px;\r
+       background:#cedff5 url(../images/aero/tabs/tab-strip-bg.gif) repeat-x bottom;\r
+       border-bottom:1px solid #8db2e3;\r
+}\r
+.x-tabs-strip .x-tabs-text {\r
+       color:#15428b;\r
+       font-weight:normal;\r
+}\r
+.x-tabs-strip .on .x-tabs-text {\r
+       cursor:default;\r
+       color:#15428b;\r
+}\r
+.x-tabs-top .x-tabs-strip .on .x-tabs-right {\r
+        background: url(../images/aero/tabs/tab-sprite.gif) no-repeat right 0px;\r
+}\r
+.x-tabs-top .x-tabs-strip .on .x-tabs-left,.x-tabs-top .x-tabs-strip .on a:hover .x-tabs-left{\r
+        background: url(../images/aero/tabs/tab-sprite.gif) no-repeat 0px -100px;\r
+}\r
+.x-tabs-top .x-tabs-strip .x-tabs-right {\r
+        background:transparent url(../images/aero/tabs/tab-sprite.gif) no-repeat right -50px;\r
+}\r
+.x-tabs-top .x-tabs-strip .x-tabs-left {\r
+       background:transparent url(../images/aero/tabs/tab-sprite.gif) no-repeat 0px -150px;\r
+}\r
+.x-tabs-top .roo-tabbody {\r
+       border:1px solid #8db2e3;\r
+       border-top:0px none;\r
+}\r
+.x-tabs-bottom .x-tabs-wrap, .x-layout-panel .x-tabs-bottom .x-tabs-wrap {\r
+   background:#deecfd;\r
+       border:1px solid #8db2e3;\r
+       padding-top:2px;\r
+       padding-bottom:0px;\r
+}\r
+.x-tabs-bottom .x-tabs-strip-wrap{\r
+       padding-top:0px;\r
+       padding-bottom:1px;\r
+       background:#cedff5 url(../images/aero/tabs/tab-strip-btm-bg.gif) repeat-x top;\r
+       border-top:1px solid #8db2e3;\r
+       border-bottom:0px none;\r
+}\r
+.x-tabs-bottom .x-tabs-strip .x-tabs-right {\r
+       background:transparent url(../images/aero/tabs/tab-btm-inactive-right-bg.gif) no-repeat bottom right;\r
+}\r
+.x-tabs-bottom .x-tabs-strip .x-tabs-left {\r
+       background:transparent url(../images/aero/tabs/tab-btm-inactive-left-bg.gif) no-repeat bottom left;\r
+}\r
+.x-tabs-bottom .x-tabs-strip .on .x-tabs-right,.x-tabs-bottom .x-tabs-strip .on a:hover {\r
+        background: url(../images/aero/tabs/tab-btm-right-bg.gif) no-repeat bottom left;\r
+}\r
+.x-tabs-bottom .x-tabs-strip .on .x-tabs-left,.x-tabs-bottom .x-tabs-strip .on a:hover .x-tabs-left {\r
+        background: url(../images/aero/tabs/tab-btm-left-bg.gif) no-repeat bottom right;\r
+}\r
+.x-tabs-bottom .roo-tabbody {\r
+       border:1px solid #8db2e3;\r
+       border-bottom:0px none;\r
+}\r
+/** \r
+* Basic-Dialog \r
+*/\r
+.x-dlg-proxy {\r
+       background:#C7DFFC;\r
+       border:1px solid #A5CCF9;\r
+}\r
+.x-dlg-shadow{\r
+       background:#cccccc;\r
+   opacity:.3;\r
+   -moz-opacity:.3;\r
+   filter: alpha(opacity=30);\r
+}\r
+.x-dlg {\r
+       background:transparent;\r
+}\r
+.x-dlg .x-dlg-hd {\r
+       background: url(../images/aero/basic-dialog/hd-sprite.gif) repeat-x 0px -82px;\r
+       background-color:#aabaca;\r
+       color:#15428b;\r
+       zoom:1;\r
+       padding-top:7px;\r
+}\r
+.x-dlg .x-dlg-hd-left {\r
+       opacity:.85;-moz-opacity:.85;filter:alpha(opacity=80);\r
+       background: url(../images/aero/basic-dialog/hd-sprite.gif) no-repeat 0px -41px;\r
+       zoom:1;\r
+}\r
+.x-dlg-modal .x-dlg-hd-left {\r
+       opacity:.75;-moz-opacity:.75;filter:alpha(opacity=70);\r
+}\r
+\r
+.x-dlg .x-dlg-hd-right {\r
+       background: url(../images/aero/basic-dialog/hd-sprite.gif) no-repeat right 0px;\r
+       zoom:1;\r
+}\r
+.x-dlg .x-dlg-dlg-body{\r
+       padding:0px 0px 0px;\r
+       position:absolute;\r
+       top:24px;left:0px;\r
+       z-index:1;\r
+       border:0px none;\r
+       background:transparent;\r
+}\r
+.x-dlg .x-dlg-bd{\r
+       background:#fff;\r
+       border:1px solid #96b9e6;\r
+}\r
+.x-dlg .x-dlg-ft{\r
+       border:0px none;\r
+       background:transparent;\r
+       padding-bottom:8px;\r
+}\r
+.x-dlg .x-dlg-bg{\r
+       filter:alpha(opacity=80);\r
+       opacity:.85; \r
+       -moz-opacity:.85; \r
+       zoom:1;\r
+}\r
+.x-dlg-modal .x-dlg-bg {\r
+       opacity:.75;-moz-opacity:.75;filter:alpha(opacity=70);\r
+}\r
+.x-dlg .x-dlg-bg-center {\r
+       padding: 2px 7px 7px 7px;\r
+       background:transparent url(../images/aero/basic-dialog/bg-center.gif) repeat-x bottom;\r
+       zoom:1;\r
+}\r
+.x-dlg .x-dlg-bg-left{\r
+       padding-left:7px;\r
+       background:transparent url(../images/aero/basic-dialog/bg-left.gif) no-repeat bottom left;\r
+       zoom:1;\r
+}\r
+.x-dlg .x-dlg-bg-right{\r
+       padding-right:7px;\r
+       background:transparent url(../images/aero/basic-dialog/bg-right.gif) no-repeat bottom right;\r
+       zoom:1;\r
+}\r
+.x-dlg-auto-tabs .x-dlg-dlg-body, .x-dlg-auto-layout .x-dlg-dlg-body{\r
+       background:transparent;\r
+       border:0px none;\r
+}\r
+.x-dlg-auto-tabs .x-dlg-bd, .x-dlg-auto-layout .x-dlg-bd{\r
+       background:#fff;\r
+       border:1px solid #e9f3f5;\r
+}\r
+.x-dlg-auto-tabs .x-tabs-top .roo-tabbody,.x-dlg-auto-tabs .x-tabs-bottom .roo-tabbody{\r
+    border-color:#8db2e3;\r
+}\r
+.x-dlg-auto-tabs .x-tabs-top .x-tabs-wrap,.x-dlg-auto-tabs .x-tabs-bottom .x-tabs-wrap{\r
+    border-color:#8db2e3;\r
+}\r
+.x-dlg .x-dlg-close {\r
+       width:21px;\r
+       height:20px;\r
+       top:5px;\r
+       right:5px;\r
+       opacity:.85;-moz-opacity:.85;filter:alpha(opacity=80);\r
+       background-image:url(../images/aero/basic-dialog/aero-close.gif);\r
+       zoom:1;\r
+}\r
+.x-dlg .x-dlg-close-over {\r
+       background-image:url(../images/aero/basic-dialog/aero-close-over.gif);\r
+}\r
+.x-dlg div.x-resizable-handle-east{\r
+       background-image:url(../images/aero/s.gif);\r
+       border:0px none;\r
+}\r
+.x-dlg div.x-resizable-handle-south{\r
+       background-image:url(../images/aero/s.gif);\r
+       border:0px none;\r
+}\r
+.x-dlg div.x-resizable-handle-west{\r
+       background-image:url(../images/aero/s.gif);\r
+       border:0px none;\r
+}\r
+.x-dlg div.x-resizable-handle-southeast{\r
+       background-image:url(../images/aero/basic-dialog/se-handle.gif);\r
+       background-position: bottom right;\r
+       width:9px;\r
+       height:9px;\r
+       border:0px;\r
+       right:2px;\r
+       bottom:2px;\r
+}\r
+.x-dlg div.x-resizable-handle-southwest{\r
+       background-image:url(../images/aero/s.gif);\r
+       background-position: top right;\r
+       margin-left:1px;\r
+       margin-bottom:1px;\r
+       border:0px;\r
+}\r
+.x-dlg div.x-resizable-handle-north{\r
+       background-image:url(../images/aero/s.gif);\r
+       border:0px none;\r
+}\r
+\r
+#mb-dlg .x-dlg-bd{\r
+       background:#CFE0F5;\r
+       border:0px none;\r
+}\r
+\r
+/* BorderLayout */\r
+.x-layout-container{\r
+    background:#deecfd;\r
+}\r
+.x-layout-collapsed{\r
+    background-color:#deecfd;\r
+        border:1px solid #99bbe8;\r
+}\r
+.x-layout-collapsed-over{\r
+        background-color:#F5F9FE;\r
+}\r
+.x-layout-panel{\r
+    border:1px solid #99bbe8;\r
+}\r
+.x-layout-nested-layout .x-layout-panel {\r
+         border:0px none;\r
+}\r
+.x-layout-split{\r
+    background-color:#deecfd;\r
+}\r
+.x-layout-panel-hd{\r
+    background-image: url(../images/aero/layout/panel-title-light-bg.gif);\r
+    border-bottom:1px solid #c0d7f4;\r
+}\r
+.x-layout-panel-hd-text {\r
+       color:#15428b;\r
+}\r
+\r
+.x-layout-split-h{\r
+    background:#deecfd;\r
+}\r
+.x-layout-split-v{\r
+    background:#deecfd;\r
+}\r
+.x-layout-panel .x-tabs-top .x-tabs-wrap{\r
+    border:0px none;\r
+        border-bottom:1px solid #8db2e3;\r
+}\r
+.x-layout-panel .x-tabs-bottom .x-tabs-wrap{\r
+    border:0px none;\r
+        border-top:1px solid #8db2e3;\r
+}\r
+.x-layout-container .roo-tabbody{\r
+       border:0px none;\r
+}\r
+\r
+.x-layout-nested-layout .x-layout-panel-north {\r
+         border-bottom:1px solid #99bbe8;\r
+}\r
+.x-layout-nested-layout .x-layout-panel-south {\r
+         border-top:1px solid #99bbe8;\r
+}\r
+.x-layout-nested-layout .x-layout-panel-east {\r
+         border-left:1px solid #99bbe8;\r
+}\r
+.x-layout-nested-layout .x-layout-panel-west {\r
+         border-right:1px solid #99bbe8;\r
+}\r
+.x-layout-panel-dragover {\r
+       border: 2px solid #99bbe8;\r
+}\r
+.x-layout-panel-proxy {\r
+       background-image: url(../images/aero/layout/gradient-bg.gif);\r
+       background-color:#f3f2e7;\r
+       border:1px dashed #99bbe8;\r
+}\r
+/** Resizable */\r
+\r
+.x-resizable-proxy{\r
+    border: 1px dashed #3b5a82;\r
+}\r
+\r
+/* grid */\r
+.x-grid-hd{\r
+       border-bottom:0px;\r
+       background:none;\r
+}\r
+.x-grid-hd-body {\r
+       border-bottom:0px none;\r
+}\r
+.x-grid-hd-over {\r
+       border-bottom:0px none;\r
+}\r
+.x-grid-hd-over .x-grid-hd-body{\r
+       background:none;\r
+       border-bottom:0px none;\r
+}\r
+.x-grid-hd-over .x-grid-hd-body{\r
+       background-color: transparent;\r
+       border-bottom:0px;\r
+}\r
+.x-grid-hd-split {\r
+       background-image: url(../images/aero/grid/grid-split.gif);\r
+}\r
+.x-grid-hrow{\r
+       background: url(../images/aero/grid/grid-hrow.gif);\r
+       height: 22px;\r
+       border:0px none;\r
+}\r
+.x-grid-row-alt{\r
+       background-color: #f5f5f5;\r
+}\r
+.x-grid-row{\r
+       border-bottom: 1px solid #eeeeee;\r
+}\r
+.x-grid-col{\r
+       border-right:1px solid #eeeeee;\r
+}\r
+.x-grid-sort-col .x-grid-hd-body {\r
+       padding-bottom:4px;\r
+}\r
+\r
+/** Toolbar */\r
+.x-toolbar{\r
+       border:0px none;\r
+       background: #E2ECF8;\r
+       padding:1px 3px;\r
+       border-bottom:1px solid #c0d7f4;\r
+}\r
+.ytoolbar .ytb-button-over{\r
+       border:1px solid #8db2e3;\r
+}\r
+.ytoolbar .ytb-sep{\r
+       background-image: url(../images/aero/grid/grid-blue-split.gif);\r
+}
\ No newline at end of file
diff --git a/css/ytheme-gray.css b/css/ytheme-gray.css
new file mode 100644 (file)
index 0000000..5aaa2af
--- /dev/null
@@ -0,0 +1,272 @@
+/** \r
+* Basic-Dialog \r
+*/\r
+.x-dlg-proxy {\r
+       background-image: url(../images/gray/layout/gradient-bg.gif);\r
+       background-color:#EAE8D5;\r
+       border:1px solid #b3b6b0;\r
+}\r
+.x-dlg-shadow{\r
+       background:#aaaaaa;\r
+}\r
+.x-dlg-proxy .tabset{\r
+    background:url(../images/gray/layout/gradient-bg.gif);\r
+}\r
+.x-dlg .x-dlg-header {\r
+       background: url(../images/gray/basic-dialog/hd-sprite.gif) repeat-x 0px -82px;\r
+       background-color:#333333;\r
+}\r
+.x-dlg .x-dlg-header-left {\r
+       background: url(../images/gray/basic-dialog/hd-sprite.gif) no-repeat 0px -41px;\r
+}\r
+.x-dlg .x-dlg-header-right {\r
+       background: url(../images/gray/basic-dialog/hd-sprite.gif) no-repeat right 0px;\r
+}\r
+.x-dlg .x-dlg-dlg-body{\r
+       background:#efefec;\r
+       border:1px solid #b3b6b0;\r
+       border-top:0px none;\r
+}\r
+.x-dlg .x-tabs-top .roo-tabbody{\r
+       border:1px solid #b3b6b0;\r
+       border-top:0px none;\r
+}\r
+.x-dlg .x-tabs-bottom .roo-tabbody{\r
+       border:1px solid #b3b6b0;\r
+       border-bottom:0px none;\r
+}\r
+.x-dlg .x-layout-container  .roo-tabbody{\r
+       border:0px none;\r
+}\r
+.x-dlg .x-dlg-close {\r
+       background-image:url(../images/gray/basic-dialog/close.gif);\r
+}\r
+.x-dlg div.x-resizable-handle-east{\r
+       background-image:url(../images/gray/basic-dialog/e-handle.gif);\r
+       border:0px none;\r
+}\r
+.x-dlg div.x-resizable-handle-south{\r
+       background-image:url(../images/gray/basic-dialog/s-handle.gif);\r
+       border:0px none;\r
+}\r
+.x-dlg div.x-resizable-handle-west{\r
+       background-image:url(../images/gray/basic-dialog/e-handle.gif);\r
+       border:0px none;\r
+}\r
+.x-dlg div.x-resizable-handle-southeast{\r
+       background-image:url(../images/gray/basic-dialog/se-handle.gif);\r
+       background-position: bottom right;\r
+       width:8px;\r
+       height:8px;\r
+       border:0px;\r
+}\r
+.x-dlg div.x-resizable-handle-southwest{\r
+       background-image:url(../images/gray/sizer/sw-handle-dark.gif);\r
+       background-position: top right;\r
+       margin-left:1px;\r
+       margin-bottom:1px;\r
+       border:0px;\r
+}\r
+.x-dlg div.x-resizable-handle-north{\r
+       background-image:url(../images/gray/s.gif);\r
+       border:0px none;\r
+}\r
+\r
+/** \r
+* Tabs\r
+*/\r
+.x-tabs-wrap {\r
+       border-bottom:1px solid #aca899;\r
+}\r
+.x-tabs-strip .on .x-tabs-text {\r
+       cursor:default;\r
+       color:#333333;\r
+}\r
+.x-tabs-top .x-tabs-strip .on .x-tabs-right {\r
+        background: url(../images/gray/tabs/tab-sprite.gif) no-repeat right 0px;\r
+}\r
+.x-tabs-top .x-tabs-strip .on .x-tabs-left {\r
+        background: url(../images/gray/tabs/tab-sprite.gif) no-repeat 0px -100px;\r
+}\r
+.x-tabs-top .x-tabs-strip .x-tabs-right {\r
+        background: url(../images/gray/tabs/tab-sprite.gif) no-repeat right -50px;\r
+}\r
+.x-tabs-top .x-tabs-strip .x-tabs-left {\r
+        background: url(../images/gray/tabs/tab-sprite.gif) no-repeat 0px -150px;\r
+}\r
+.x-tabs-strip .x-tabs-closable .close-icon{\r
+       background-image:url(../images/gray/layout/layout-sprite.gif);\r
+  background-position: 50% -60px;\r
+}\r
+.x-tabs-strip .on .close-icon{\r
+       background-image:url(../images/gray/layout/layout-sprite.gif);\r
+  background-position: 50% -60px;\r
+}\r
+.x-tabs-strip .x-tabs-closable .close-over{\r
+       background-image:url(../images/gray/layout/layout-sprite.gif);\r
+  background-position: 50% -72px;\r
+}\r
+\r
+.x-tabs-bottom .x-tabs-wrap {\r
+       border-bottom:0px none;\r
+       padding-top:0px;\r
+       border-top:1px solid #aca899;\r
+}\r
+.x-tabs-bottom .x-tabs-strip .x-tabs-right {\r
+        background: url(../images/gray/tabs/tab-btm-inactive-right-bg.gif) no-repeat bottom left;\r
+}\r
+.x-tabs-bottom .x-tabs-strip .x-tabs-left {\r
+        background: url(../images/gray/tabs/tab-btm-inactive-left-bg.gif) no-repeat bottom right;\r
+}\r
+.x-tabs-bottom .x-tabs-strip .on .x-tabs-right {\r
+        background: url(../images/gray/tabs/tab-btm-right-bg.gif) no-repeat bottom left;\r
+}\r
+.x-tabs-bottom .x-tabs-strip .on .x-tabs-left {\r
+        background: url(../images/gray/tabs/tab-btm-left-bg.gif) no-repeat bottom right;\r
+}\r
+\r
+/* QuickTips */\r
+\r
+.x-tip .x-tip-header-right{\r
+       background: url(../images/gray/basic-dialog/hd-sprite.gif) no-repeat right 0px;\r
+}\r
+.x-tip .x-tip-header-left{\r
+       background: url(../images/gray/basic-dialog/hd-sprite.gif) no-repeat 0px -41px;\r
+}\r
+.x-tip .x-tip-header{\r
+       background: url(../images/gray/basic-dialog/hd-sprite.gif) repeat-x 0px -82px;\r
+}\r
+.x-tip .x-tip-close{\r
+       background-image: url(../images/gray/basic-dialog/close.gif);\r
+}\r
+.x-tip .x-tip-bd{\r
+       background: #e7e7e7 url(../images/gray/qtip/bg.gif);\r
+       border: 1px solid #ababab;\r
+}\r
+\r
+/* BorderLayout */\r
+\r
+.x-layout-container{\r
+    background-color:#f3f2e7;\r
+}\r
+.x-layout-collapsed{\r
+    background-color:#f3f2e7;\r
+        border:1px solid #aca899;\r
+}\r
+.x-layout-collapsed-over{\r
+        background-color:#fbfbef;\r
+}\r
+.x-layout-panel{\r
+    border:1px solid #aca899;\r
+}\r
+.x-layout-nested-layout .x-layout-panel {\r
+         border:0px none;\r
+}\r
+.x-layout-split{\r
+    background-color:#f3f2e7;\r
+}\r
+.x-layout-panel-header{\r
+    background-image: url(../images/gray/layout/panel-title-light-bg.gif);\r
+    border-bottom:1px solid #aca899;\r
+}\r
+.x-layout-tools-button-over{\r
+    border:1px solid #aca899;\r
+}\r
+.x-layout-close{\r
+    background-image:url(../images/gray/layout/layout-sprite.gif);\r
+    background-repeat: no-repeat;\r
+    background-position: 50% -48px;\r
+}\r
+.x-layout-collapse-west,.x-layout-expand-east{\r
+    background-image:url(../images/gray/layout/layout-sprite.gif);\r
+    background-repeat: no-repeat;\r
+    background-position: 50% 0;\r
+}\r
+.x-layout-expand-west,.x-layout-collapse-east{\r
+    background-image:url(../images/gray/layout/layout-sprite.gif);\r
+    background-repeat: no-repeat;\r
+    background-position: 50% -12px;\r
+}\r
+.x-layout-collapse-north,.x-layout-expand-south{\r
+    background-image:url(../images/gray/layout/layout-sprite.gif);\r
+    background-repeat: no-repeat;\r
+    background-position: 50% -24px;\r
+}\r
+.x-layout-expand-north,.x-layout-collapse-south{\r
+    background-image:url(../images/gray/layout/layout-sprite.gif);\r
+    background-repeat: no-repeat;\r
+    background-position: 50% -36px;\r
+}\r
+.x-layout-split-h{\r
+    background-image:url(../images/gray/sizer/e-handle-dark.gif);\r
+}\r
+.x-layout-split-v{\r
+    background-image:url(../images/gray/sizer/s-handle-dark.gif);\r
+}\r
+.x-layout-panel .x-tabs-wrap{\r
+    background:url(../images/gray/layout/gradient-bg.gif);\r
+}\r
+.x-layout-nested-layout .x-layout-panel-north {\r
+         border-bottom:1px solid #aca899;\r
+}\r
+.x-layout-nested-layout .x-layout-panel-south {\r
+         border-top:1px solid #aca899;\r
+}\r
+.x-layout-nested-layout .x-layout-panel-east {\r
+         border-left:1px solid #aca899;\r
+}\r
+.x-layout-nested-layout .x-layout-panel-west {\r
+         border-right:1px solid #aca899;\r
+}\r
+.x-layout-panel-dragover {\r
+       border: 2px solid #aca899;\r
+}\r
+.x-layout-panel-proxy {\r
+       background-image: url(../images/gray/layout/gradient-bg.gif);\r
+       background-color:#f3f2e7;\r
+       border:1px dashed #aca899;\r
+}\r
+/** Resizable */\r
+\r
+.x-resizable-over .x-resizable-handle-east, .x-resizable-pinned .x-resizable-handle-east{\r
+    background:url(../images/gray/sizer/e-handle.gif);\r
+        background-position: left;\r
+}\r
+.x-resizable-over .x-resizable-handle-east, .x-resizable-pinned .x-resizable-handle-west{\r
+    background:url(../images/gray/sizer/e-handle.gif);\r
+        background-position: left;\r
+}\r
+.x-resizable-over .x-resizable-handle-south, .x-resizable-pinned .x-resizable-handle-south{\r
+    background:url(../images/gray/sizer/s-handle.gif);\r
+    background-position: top;\r
+}\r
+.x-resizable-over .x-resizable-handle-south, .x-resizable-pinned .x-resizable-handle-north{\r
+    background:url(../images/gray/sizer/s-handle.gif);\r
+    background-position: top;\r
+}\r
+.x-resizable-over .x-resizable-handle-southeast, .x-resizable-pinned .x-resizable-handle-southeast{\r
+    background:url(../images/gray/sizer/se-handle.gif);\r
+    background-position: top left;\r
+}\r
+.x-resizable-over .x-resizable-handle-northwest,.x-resizable-pinned .x-resizable-handle-northwest{\r
+    background:url(../images/gray/sizer/nw-handle.gif);\r
+    background-position:bottom right;\r
+}\r
+.x-resizable-over .x-resizable-handle-northeast,.x-resizable-pinned .x-resizable-handle-northeast{\r
+    background:url(../images/gray/sizer/ne-handle.gif);\r
+    background-position: bottom left;\r
+}\r
+.x-resizable-over .x-resizable-handle-southwest,.x-resizable-pinned .x-resizable-handle-southwest{\r
+    background:url(../images/gray/sizer/sw-handle.gif);\r
+    background-position: top right;\r
+}\r
+.x-resizable-proxy{\r
+    border: 1px dashed #615e55;\r
+}\r
+\r
+/** Toolbar */\r
+.x-toolbar{\r
+       border:0px none;\r
+       background: #efefe3 url(../images/gray/toolbar/gray-bg.gif) repeat-x;\r
+       padding:3px;\r
+}
\ No newline at end of file
diff --git a/css/ytheme-vista.css b/css/ytheme-vista.css
new file mode 100644 (file)
index 0000000..e911493
--- /dev/null
@@ -0,0 +1,375 @@
+/** \r
+* Tabs\r
+*/\r
+.x-tabs-wrap {\r
+       background:#4f4f4f;\r
+       border-bottom:1px solid #b3b6b0;\r
+}\r
+.x-tabs-strip .x-tabs-text {\r
+       color:white;\r
+       font-weight:normal;\r
+}\r
+.x-tabs-strip .on .x-tabs-text {\r
+       cursor:default;\r
+       color:#333333;\r
+}\r
+.x-tabs-top .x-tabs-strip a:hover {\r
+       background:transparent url(../images/vista/tabs/tab-sprite.gif) no-repeat right -50px;\r
+}\r
+.x-tabs-top .x-tabs-strip a:hover .x-tabs-left {\r
+       background:transparent url(../images/vista/tabs/tab-sprite.gif) no-repeat 0 -150px;\r
+}\r
+.x-tabs-top .x-tabs-strip .on .x-tabs-right, .x-tabs-top .x-tabs-strip .on a:hover {\r
+        background: url(../images/vista/tabs/tab-sprite.gif) no-repeat right 0;\r
+}\r
+.x-tabs-top .x-tabs-strip .on .x-tabs-left, .x-tabs-top .x-tabs-strip .on a:hover .x-tabs-left {\r
+        background: url(../images/vista/tabs/tab-sprite.gif) no-repeat 0 -100px;\r
+}\r
+.x-tabs-top .x-tabs-strip .x-tabs-right {\r
+        background:transparent;\r
+}\r
+.x-tabs-top .x-tabs-strip .x-tabs-left {\r
+        background:transparent;\r
+}\r
+.x-tabs-strip .x-tabs-closable .close-icon{\r
+       background-image:url(../images/vista/layout/layout-sprite.gif);\r
+  background-position: 50% -60px;\r
+}\r
+.x-tabs-strip .on .close-icon{\r
+       background-image:url(../images/vista/layout/layout-sprite.gif);\r
+  background-position: 50% -72px;\r
+}\r
+.x-tabs-strip .x-tabs-closable .close-over{\r
+       background-image:url(../images/vista/layout/layout-sprite.gif);\r
+  background-position: 50% -72px;\r
+}\r
+\r
+.x-tabs-bottom .x-tabs-strip {\r
+       background:#4f4f4f;\r
+}\r
+.x-tabs-bottom .x-tabs-strip a:hover {\r
+       background:transparent url(../images/vista/tabs/tab-btm-inactive-right-bg.gif) no-repeat bottom right;\r
+}\r
+.x-tabs-bottom .x-tabs-strip a:hover .x-tabs-left{\r
+       background:transparent url(../images/vista/tabs/tab-btm-inactive-left-bg.gif) no-repeat bottom left;\r
+}\r
+.x-tabs-bottom .x-tabs-wrap {\r
+       border-bottom:0px none;\r
+       padding-top:0px;\r
+       border-top:1px solid #b3b6b0;\r
+}\r
+.x-tabs-bottom .x-tabs-strip .x-tabs-right {\r
+        background:transparent;\r
+}\r
+.x-tabs-bottom .x-tabs-strip .x-tabs-left {\r
+        background:transparent;\r
+}\r
+.x-tabs-bottom .x-tabs-strip .on .x-tabs-right,.x-tabs-bottom .x-tabs-strip .on a:hover {\r
+        background: url(../images/vista/tabs/tab-btm-right-bg.gif) no-repeat bottom left;\r
+}\r
+.x-tabs-bottom .x-tabs-strip .on .x-tabs-left,.x-tabs-bottom .x-tabs-strip .on a:hover .x-tabs-left {\r
+        background: url(../images/vista/tabs/tab-btm-left-bg.gif) no-repeat bottom right;\r
+}\r
+/** \r
+* Basic-Dialog \r
+*/\r
+.x-dlg-proxy {\r
+       background:#d3d6d0;\r
+       border:2px solid #b3b6b0;\r
+}\r
+.x-dlg-shadow{\r
+       background:#cccccc;\r
+   opacity:.3;\r
+   -moz-opacity:.3;\r
+   filter: alpha(opacity=30);\r
+}\r
+.x-dlg .x-dlg-hd {\r
+       background: url(../images/vista/basic-dialog/hd-sprite.gif) repeat-x 0px -82px;\r
+       background-color:#333333;\r
+       zoom:1;\r
+}\r
+.x-dlg .x-dlg-hd-left {\r
+       opacity:.95;-moz-opacity:.95;filter:alpha(opacity=90);\r
+       background: url(../images/vista/basic-dialog/hd-sprite.gif) no-repeat 0px -41px;\r
+       zoom:1;\r
+}\r
+.x-dlg .x-dlg-hd-right {\r
+       background: url(../images/vista/basic-dialog/hd-sprite.gif) no-repeat right 0px;\r
+       zoom:1;\r
+}\r
+.x-dlg .x-dlg-dlg-body{\r
+       background:#fff;\r
+       border:0 none;\r
+       border-top:0px none;\r
+       padding:0px 0px 0px;\r
+       position:absolute;\r
+       top:24px;left:0px;\r
+       z-index:1;\r
+}\r
+.x-dlg-auto-tabs .x-dlg-dlg-body{\r
+       background:transparent;\r
+}\r
+.x-dlg-auto-tabs .x-tabs-top .x-tabs-wrap{\r
+       background:transparent;\r
+}\r
+.x-dlg .x-dlg-ft{\r
+       border-top:1px solid #b3b6b0;\r
+       background:#F0F0F0;\r
+       padding-bottom:8px;\r
+}\r
+.x-dlg .x-dlg-bg{\r
+       opacity:.90;-moz-opacity:.90;filter:alpha(opacity=85);\r
+       zoom:1;\r
+}\r
+.x-dlg .x-dlg-bg-left,.x-dlg .x-dlg-bg-center,.x-dlg .x-dlg-bg-right{\r
+}\r
+.x-dlg .x-dlg-bg-center {\r
+       padding: 0px 4px 4px 4px;\r
+       background:transparent url(../images/vista/basic-dialog/bg-center.gif) repeat-x bottom;\r
+       zoom:1;\r
+}\r
+.x-dlg .x-dlg-bg-left{\r
+       padding-left:4px;\r
+       background:transparent url(../images/vista/basic-dialog/bg-left.gif) no-repeat bottom left;\r
+       zoom:1;\r
+}\r
+.x-dlg .x-dlg-bg-right{\r
+       padding-right:4px;\r
+       background:transparent url(../images/vista/basic-dialog/bg-right.gif) no-repeat bottom right;\r
+       zoom:1;\r
+}\r
+.x-dlg .x-tabs-top .roo-tabbody{\r
+       border:0px none;\r
+}\r
+.x-dlg .x-tabs-bottom .roo-tabbody{\r
+       border:1px solid #b3b6b0;\r
+       border-bottom:0px none;\r
+}\r
+.x-dlg .x-layout-container  .roo-tabbody{\r
+       border:0px none;\r
+}\r
+.x-dlg .x-dlg-close {\r
+       background-image:url(../images/vista/basic-dialog/close.gif);\r
+}\r
+.x-dlg div.x-resizable-handle-east{\r
+       background-image:url(../images/vista/s.gif);\r
+       border:0px none;\r
+}\r
+.x-dlg div.x-resizable-handle-south{\r
+       background-image:url(../images/vista/s.gif);\r
+       border:0px none;\r
+}\r
+.x-dlg div.x-resizable-handle-west{\r
+       background-image:url(../images/vista/s.gif);\r
+       border:0px none;\r
+}\r
+.x-dlg div.x-resizable-handle-southeast{\r
+       background-image:url(../images/vista/s.gif);\r
+       background-position: bottom right;\r
+       width:8px;\r
+       height:8px;\r
+       border:0px;\r
+}\r
+.x-dlg div.x-resizable-handle-southwest{\r
+       background-image:url(../images/vista/s.gif);\r
+       background-position: top right;\r
+       margin-left:1px;\r
+       margin-bottom:1px;\r
+       border:0px;\r
+}\r
+.x-dlg div.x-resizable-handle-north{\r
+       background-image:url(../images/vista/s.gif);\r
+       border:0px none;\r
+}\r
+\r
+/* QuickTips */\r
+\r
+.x-tip .x-tip-hd-right{\r
+       background: url(../images/vista/basic-dialog/hd-sprite.gif) no-repeat right 0px;\r
+}\r
+.x-tip .x-tip-hd-left{\r
+       background: url(../images/vista/basic-dialog/hd-sprite.gif) no-repeat 0px -41px;\r
+}\r
+.x-tip .x-tip-hd{\r
+       background: url(../images/vista/basic-dialog/hd-sprite.gif) repeat-x 0px -82px;\r
+}\r
+.x-tip .x-tip-close{\r
+       background-image: url(../images/vista/basic-dialog/close.gif);\r
+}\r
+.x-tip .x-tip-bd{\r
+       background: #e7e7e7 url(../images/vista/qtip/bg.gif);\r
+       border: 1px solid #ababab;\r
+}\r
+\r
+/* BorderLayout */\r
+.x-layout-container{\r
+    background:#4f4f4f;\r
+}\r
+.x-layout-collapsed{\r
+    background-color:#9f9f9f;\r
+        border:1px solid #4c535c;\r
+}\r
+.x-layout-collapsed-over{\r
+        background-color:#bfbfbf;\r
+}\r
+.x-layout-panel{\r
+    border:1px solid #4c535c;\r
+}\r
+.x-layout-nested-layout .x-layout-panel {\r
+         border:0px none;\r
+}\r
+.x-layout-split{\r
+    background-color:#f3f2e7;\r
+}\r
+.x-layout-panel-hd{\r
+    background-image: url(../images/vista/layout/panel-title-bg.gif);\r
+    border-bottom:1px solid #b5bac1;\r
+}\r
+.x-layout-panel-hd-text{\r
+       color:white;\r
+}\r
+.x-layout-tools-button-over{\r
+    border:1px solid #4c535c;\r
+        background:#9f9f9f url(../images/vista/layout/panel-title-bg.gif) repeat-x;\r
+}\r
+.x-layout-close{\r
+    background-image:url(../images/vista/layout/layout-sprite.gif);\r
+    background-repeat: no-repeat;\r
+    background-position: 50% -60px;\r
+}\r
+.x-layout-collapse-west,.x-layout-expand-east{\r
+    background-image:url(../images/vista/layout/layout-sprite.gif);\r
+    background-repeat: no-repeat;\r
+    background-position: 50% 0;\r
+}\r
+.x-layout-expand-west,.x-layout-collapse-east{\r
+    background-image:url(../images/vista/layout/layout-sprite.gif);\r
+    background-repeat: no-repeat;\r
+    background-position: 50% -12px;\r
+}\r
+.x-layout-collapse-north,.x-layout-expand-south{\r
+    background-image:url(../images/vista/layout/layout-sprite.gif);\r
+    background-repeat: no-repeat;\r
+    background-position: 50% -24px;\r
+}\r
+.x-layout-expand-north,.x-layout-collapse-south{\r
+    background-image:url(../images/vista/layout/layout-sprite.gif);\r
+    background-repeat: no-repeat;\r
+    background-position: 50% -36px;\r
+}\r
+.x-layout-split-h{\r
+    background:#9f9f9f;\r
+}\r
+.x-layout-split-v{\r
+    background:#9f9f9f;\r
+}\r
+.x-layout-panel .x-tabs-wrap{\r
+    background:#4f4f4f;\r
+}\r
+.x-layout-nested-layout .x-layout-panel-north {\r
+         border-bottom:1px solid #4c535c;\r
+}\r
+.x-layout-nested-layout .x-layout-panel-south {\r
+         border-top:1px solid #4c535c;\r
+}\r
+.x-layout-nested-layout .x-layout-panel-east {\r
+         border-left:1px solid #4c535c;\r
+}\r
+.x-layout-nested-layout .x-layout-panel-west {\r
+         border-right:1px solid #4c535c;\r
+}\r
+.x-layout-panel-dragover {\r
+       border: 2px solid #4c535c;\r
+}\r
+.x-layout-panel-proxy {\r
+       background-image: url(../images/vista/layout/gradient-bg.gif);\r
+       background-color:#f3f2e7;\r
+       border:1px dashed #4c535c;\r
+}\r
+/** Resizable */\r
+\r
+.x-resizable-over .x-resizable-handle-east, .x-resizable-pinned .x-resizable-handle-east{\r
+    background:url(../images/vista/sizer/e-handle.gif);\r
+        background-position: left;\r
+}\r
+.x-resizable-over .x-resizable-handle-east, .x-resizable-pinned .x-resizable-handle-west{\r
+    background:url(../images/vista/sizer/e-handle.gif);\r
+        background-position: left;\r
+}\r
+.x-resizable-over .x-resizable-handle-south, .x-resizable-pinned .x-resizable-handle-south{\r
+    background:url(../images/vista/sizer/s-handle.gif);\r
+    background-position: top;\r
+}\r
+.x-resizable-over .x-resizable-handle-south, .x-resizable-pinned .x-resizable-handle-north{\r
+    background:url(../images/vista/sizer/s-handle.gif);\r
+    background-position: top;\r
+}\r
+.x-resizable-over .x-resizable-handle-southeast, .x-resizable-pinned .x-resizable-handle-southeast{\r
+    background:url(../images/vista/sizer/se-handle.gif);\r
+    background-position: top left;\r
+}\r
+.x-resizable-over .x-resizable-handle-northwest,.x-resizable-pinned .x-resizable-handle-northwest{\r
+    background:url(../images/vista/sizer/nw-handle.gif);\r
+    background-position:bottom right;\r
+}\r
+.x-resizable-over .x-resizable-handle-northeast,.x-resizable-pinned .x-resizable-handle-northeast{\r
+    background:url(../images/vista/sizer/ne-handle.gif);\r
+    background-position: bottom left;\r
+}\r
+.x-resizable-over .x-resizable-handle-southwest,.x-resizable-pinned .x-resizable-handle-southwest{\r
+    background:url(../images/vista/sizer/sw-handle.gif);\r
+    background-position: top right;\r
+}\r
+.x-resizable-proxy{\r
+    border: 1px dashed #615e55;\r
+}\r
+\r
+/** Toolbar */\r
+.x-toolbar{\r
+       border:0px none;\r
+       background: #efefe3 url(../images/vista/toolbar/gray-bg.gif) repeat-x;\r
+       padding:3px;\r
+}\r
+.x-toolbar .x-tb-button-over{\r
+       border:1px solid transparent;\r
+       border-bottom:1px solid #bbbbbb;\r
+       border-top:1px solid #eeeeee;\r
+       background:#9f9f9f url(../images/vista/grid/grid-vista-hd.gif) repeat-x;\r
+}\r
+/* grid */\r
+.x-grid-hd{\r
+       border-bottom:0px;\r
+       background:none;\r
+}\r
+.x-grid-hd-body {\r
+       border-bottom: 1px solid #b3bcc0;\r
+}\r
+.x-grid-hd-over{\r
+       border-bottom:0px;\r
+}\r
+.x-grid-hd-over .x-grid-hd-body{\r
+       background-color: transparent;\r
+       border-bottom:0px;\r
+}\r
+.x-grid-hd-split {\r
+       background-image: url(../images/vista/grid/grid-split.gif);\r
+}\r
+.x-grid-hrow{\r
+       background: url(../images/vista/grid/grid-vista-hd.gif);\r
+       height: 21px;\r
+}\r
+.x-grid-row-alt{\r
+       background-color: #f5f5f5;\r
+}\r
+.x-grid-row-selected{\r
+       background-color: #535353  !important;\r
+       color: white;\r
+}\r
+.ygrid-row-selected span{\r
+       color: white !important;\r
+}\r
+.ygrid-wrap-body {\r
+}\r
+.ytoolbar .ytb-sep{\r
+       background-image: url(../images/vista/grid/grid-split.gif);\r
+}
\ No newline at end of file
diff --git a/cssX/roojs-all.css b/cssX/roojs-all.css
new file mode 100644 (file)
index 0000000..a426ac5
--- /dev/null
@@ -0,0 +1,858 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ * licensing@extjs.com
+ * 
+ * http://www.extjs.com/license
+ */
+
+html,body,div,dl,dt,dd,ul,ol,li,h1,h2,h3,h4,h5,h6,pre,form,fieldset,input,p,blockquote,th,td{margin:0;padding:0;}
+img,body,html{border:0;}
+address,caption,cite,code,dfn,em,strong,th,var{font-style:normal;font-weight:normal;}
+ol,ul{list-style:none;}
+caption,th{text-align:left;}
+h1,h2,h3,h4,h5,h6{font-size:100%;}
+q:before,q:after{content:'';}
+
+.roo-el-mask{z-index:20000;position:absolute;top:0;left:0;-moz-opacity:0.5;opacity:.50;filter:alpha(opacity=50);background-color:#CCC;width:100%;height:100%;zoom:1;}
+.roo-el-mask-msg{z-index:20001;position:absolute;top:0;left:0;border:1px solid #6593cf;background:#c3daf9 url(../images/default/box/tb-blue.gif) repeat-x 0 -16px;padding:2px;}
+.roo-el-mask-msg div{padding:5px 10px 5px 10px;background:#eee;border:1px solid #a3bad9;color:#333;font:normal 12px tahoma,arial,helvetica,sans-serif;cursor:wait;}
+.roo-shim{position:absolute;visibility:hidden;left:0;top:0;overflow:hidden;}
+.roo-ie .roo-shim{filter:alpha(opacity=0);}
+.x-mask-loading div{padding:5px 10px 5px 25px;background:#eee url( '../images/default/grid/loading.gif' ) no-repeat 5px 5px;line-height:16px;}
+.x-hidden{position:absolute;left:-10000px;top:-10000px;}
+.x-masked{overflow:hidden!important;}
+.x-masked select,.x-masked object,.x-masked embed{visibility:hidden;}
+.x-layer{visibility:hidden;}
+.x-unselectable,.x-unselectable *{-moz-user-select:none;-khtml-user-select:none;}
+.x-repaint{zoom:1;background-color:transparent;-moz-outline:none;}
+.x-item-disabled{color:gray;cursor:default;opacity:.6;-moz-opacity:.6;filter:alpha(opacity=60);}
+.x-item-disabled *{color:gray;cursor:default!important;}
+.x-splitbar-proxy{position:absolute;visibility:hidden;z-index:20001;background:#aaa;zoom:1;line-height:1px;font-size:1px;overflow:hidden;}
+.x-splitbar-h,.x-splitbar-proxy-h{cursor:e-resize;cursor:col-resize;}
+.x-splitbar-v,.x-splitbar-proxy-v{cursor:s-resize;cursor:row-resize;}
+.x-color-palette{width:150px;height:92px;cursor:pointer;}
+.x-color-palette a{border:1px solid #fff;float:left;padding:2px;text-decoration:none;-moz-outline:0 none;outline:0 none;cursor:pointer;}
+.x-color-palette a:hover,.x-color-palette a.x-color-palette-sel{border:1px solid #8BB8F3;background:#deecfd;}
+.x-color-palette em{display:block;border:1px solid #ACA899;}
+.x-color-palette em span{cursor:pointer;display:block;height:10px;line-height:10px;width:10px;}
+.x-ie-shadow{display:none;position:absolute;overflow:hidden;left:0;top:0;background:#777;zoom:1;}
+.x-shadow{display:none;position:absolute;overflow:hidden;left:0;top:0;}
+.x-shadow *{overflow:hidden;}
+.x-shadow *{padding:0;border:0;margin:0;clear:none;zoom:1;}
+.x-shadow .xstc,.x-shadow .xsbc{height:6px;float:left;}
+.x-shadow .xstl,.x-shadow .xstr,.x-shadow .xsbl,.x-shadow .xsbr{width:6px;height:6px;float:left;}
+.x-shadow .xsc{width:100%;}
+.x-shadow .xsml,.x-shadow .xsmr{width:6px;float:left;height:100%;}
+.x-shadow .xsmc{float:left;height:100%;}
+.x-shadow .xst,.x-shadow .xsb{height:6px;overflow:hidden;width:100%;}
+.loading-indicator{font-size:11px;background-image:url( '../images/default/grid/loading.gif' );background-repeat:no-repeat;background-position:left;padding-left:20px;line-height:16px;margin:3px;}
+.x-text-resize{position:absolute;left:-1000px;top:-1000px;visibility:hidden;zoom:1;}
+.x-drag-overlay{width:100%;height:100%;display:none;position:absolute;left:0;top:0;background:white;z-index:20000;-moz-opacity:0;opacity:0;filter:alpha(opacity=0);}
+.x-clear{clear:both;height:0;overflow:hidden;line-height:0;font-size:0;}
+
+.x-ws-normal {
+    white-space: normal !important;
+}
+
+.x-tabs-wrap{border-bottom:1px solid #eee;padding-top:2px;}
+.x-tabs-strip-wrap{width:100%;}
+.x-tabs-wrap table{position:relative;top:0;left:0;}
+.x-tabs-strip td{padding:0;padding-left:2px;}
+
+
+.x-tabs-strip a,.x-tabs-strip span,.x-tabs-strip em{display:block;}
+.x-tabs-strip a{text-decoration:none!important;-moz-outline:none;outline:none;cursor:pointer;}
+.x-tabs-strip .x-tabs-text{font:bold 11px tahoma,arial,helvetica;color:#666;overflow:hidden;white-space:nowrap;cursor:pointer;text-overflow:ellipsis;}
+.x-tabs-strip .on .x-tabs-text{cursor:default;color:#000;}
+.x-tabs-strip .disabled .x-tabs-text{cursor:default;color:#aaa;}
+.x-tabs-strip .x-tabs-inner{padding:4px 10px;}
+.x-tabs-strip .on .x-tabs-right{background:url(../images/default/tabs/tab-sprite.gif) no-repeat right 0;}
+.x-tabs-strip .on .x-tabs-left{background:url(../images/default/tabs/tab-sprite.gif) no-repeat 0 -100px;}
+.x-tabs-strip .x-tabs-right{background:url(../images/default/tabs/tab-sprite.gif) no-repeat right -50px;}
+.x-tabs-strip .x-tabs-left{background:url(../images/default/tabs/tab-sprite.gif) no-repeat 0 -150px;}
+.x-tabs-strip a{position:relative;top:1px;left:0;}
+.x-tabs-strip a:hover .x-tabs-text { text-decoration:underline;}
+
+.x-tabs-strip .on a{position:relative;}
+.x-tabs-strip .on .x-tabs-inner{padding-bottom:5px;}
+.x-tabs-strip .x-tabs-closable .x-tabs-inner{padding-right:22px;position:relative;}
+.x-tabs-strip .x-tabs-closable .close-icon{line-height:1px;font-size:1px;background-image:url(../images/default/layout/tab-close.gif);display:block;position:absolute;right:5px;top:4px;width:11px;height:11px;cursor:pointer;}
+.x-tabs-strip .on .close-icon{background-image:url(../images/default/layout/tab-close-on.gif);}
+.x-tabs-strip .x-tabs-closable .close-over{background-image:url(../images/default/layout/tab-close-on.gif);}
+.x-tabs-body{border:1px solid #6593cf;border-top:0 none;}
+.x-tabs-bottom .x-tabs-wrap{border-top:1px solid #eee;border-bottom:0 none;padding-top:0;padding-bottom:2px;}
+.x-tabs-bottom .x-tabs-strip .x-tabs-right{background:url(../images/default/tabs/tab-btm-inactive-right-bg.gif) no-repeat bottom left;}
+.x-tabs-bottom .x-tabs-strip .x-tabs-left{background:url(../images/default/tabs/tab-btm-inactive-left-bg.gif) no-repeat bottom right;}
+.x-tabs-bottom .x-tabs-strip .on .x-tabs-right{background:url(../images/default/tabs/tab-btm-right-bg.gif) no-repeat bottom left;}
+.x-tabs-bottom .x-tabs-strip .on .x-tabs-left{background:url(../images/default/tabs/tab-btm-left-bg.gif) no-repeat bottom right;}
+.x-tabs-bottom .x-tabs-strip a{position:relative;top:0;left:0;}
+.x-tabs-bottom .x-tabs-strip .on a{margin-top:-1px;}
+.x-tabs-bottom .x-tabs-strip .on .x-tabs-inner{padding-top:5px;}
+.x-tabs-bottom .x-tabs-body{border:1px solid #6593cf;border-bottom:0 none;}
+
+.x-form-field{margin:0;font:normal 12px tahoma,arial,helvetica,sans-serif;}
+.x-form-text,textarea.x-form-field{padding:1px 2px;background:#fff url(../images/default/form/text-bg.gif) repeat-x 0 0;border:1px solid #B5B8C8;}
+.x-form-text{height:22px;line-height:18px;vertical-align:middle;}
+.roo-ie .x-form-text{margin-top:-1px;margin-bottom:-1px;height:22px;line-height:18px;}
+.roo-strict .x-form-text{height:18px;}
+.roo-safari .x-form-text{height:20px;}
+.roo-gecko .x-form-text{padding-top:2px;padding-bottom:0;}
+.x-form-select-one{height:20px;line-height:18px;vertical-align:middle;background-color:#fff;border:1px solid #B5B8C8;}
+.x-form-field-wrap{position:relative;zoom:1;white-space:nowrap;}
+.x-editor .x-form-check-wrap{background:#fff;}
+.x-form-field-wrap .x-form-trigger{width:17px;height:21px;border:0;background:transparent url(../images/default/form/trigger.gif) no-repeat 0 0;cursor:pointer;border-bottom:1px solid #B5B8C8;position:absolute;top:0;}
+.roo-safari .x-form-field-wrap .x-form-trigger{height:19px;}
+.x-form-field-wrap .x-form-date-trigger{background-image:url(../images/default/form/date-trigger.gif);cursor:pointer;}
+.x-form-field-wrap .x-form-clear-trigger{background-image:url(../images/default/form/clear-trigger.gif);cursor:pointer;}
+.x-form-field-wrap .x-form-search-trigger{background-image:url(../images/default/form/search-trigger.gif);cursor:pointer;}
+.roo-safari .x-form-field-wrap .x-form-trigger{right:0;}
+.x-form-field-wrap .x-form-twin-triggers .x-form-trigger{position:static;top:auto;vertical-align:top;}
+.x-form-field-wrap .x-form-trigger-over{background-position:-17px 0;}
+.x-form-field-wrap .x-form-trigger-click{background-position:-34px 0;}
+.x-trigger-wrap-focus .x-form-trigger{background-position:-51px 0;}
+.x-trigger-wrap-focus .x-form-trigger-over{background-position:-68px 0;}
+.x-trigger-wrap-focus .x-form-trigger-click{background-position:-85px 0;}
+.x-trigger-wrap-focus .x-form-trigger{border-bottom:1px solid #7eadd9;}
+.x-item-disabled .x-form-trigger-over{background-position:0 0!important;border-bottom:1px solid #B5B8C8;}
+.x-item-disabled .x-form-trigger-click{background-position:0 0!important;border-bottom:1px solid #B5B8C8;}
+
+/* .x-form-focus,textarea.x-form-focus{border:1px solid #7eadd9;} */
+.x-form-focus,textarea.x-form-focus{border: 2px inset #000;}
+
+.x-form-invalid,textarea.x-form-invalid{background:#fff url(../images/default/grid/invalid_line.gif) repeat-x bottom;border:1px solid #dd7870;}
+.roo-safari .x-form-invalid{background-color:#fee;border:1px solid #ff7870;}
+.x-editor{visibility:hidden;padding:0;margin:0;}
+.x-form-check-wrap{line-height:18px;}
+.roo-ie .x-form-check-wrap input{width:15px;height:15px;}
+.x-editor .x-form-check-wrap{padding:3px;}
+.x-editor .x-form-checkbox{height:13px;border:0 none;}
+.x-form-grow-sizer{font:normal 12px tahoma,arial,helvetica,sans-serif;left:-10000px;padding:8px 3px;position:absolute;visibility:hidden;top:-10000px;white-space:pre-wrap;white-space:-moz-pre-wrap;white-space:-pre-wrap;white-space:-o-pre-wrap;word-wrap:break-word;zoom:1;}
+.x-form-grow-sizer p{margin:0!important;border:0 none!important;padding:0!important;}
+.x-form-item{font:normal 12px tahoma,arial,helvetica,sans-serif;display:block;margin-bottom:4px;}
+.x-form-item label{display:block;float:left;width:100px;padding:3px;padding-left:0;clear:left;z-index:2;position:relative;}
+.x-form-element{padding-left:105px;position:relative;}
+.x-form-invalid-msg{color:#e00;padding:2px;padding-left:18px;font:normal 11px tahoma,arial,helvetica,sans-serif;background:transparent url(../images/default/shared/warning.gif) no-repeat 0 2px;line-height:16px;width:200px;}
+.x-form-label-right label{text-align:right;}
+.x-form-label-top .x-form-item label{width:auto;float:none;clear:none;display:inline;margin-bottom:4px;position:static;}
+.x-form-label-top .x-form-element{padding-left:0;padding-top:4px;}
+.x-form-label-top .x-form-item{padding-bottom:4px;}
+.x-form fieldset{border:1px solid #B5B8C8;padding:10px 10px 5px 10px;margin-bottom:10px;}
+.x-form fieldset legend{font:bold 11px tahoma,arial,helvetica,sans-serif;color:#15428b;}
+.roo-ie .x-form fieldset legend{margin-bottom:10px;}
+.roo-ie .x-form fieldset{padding-top:0;}
+.x-form-empty-field{color:gray;}
+.x-small-editor .x-form-field{font:normal 11px arial,tahoma,helvetica,sans-serif;}
+.x-small-editor .x-form-text{height:20px;line-height:16px;vertical-align:middle;}
+.roo-ie .x-small-editor .x-form-text{margin-top:-1px!important;margin-bottom:-1px!important;height:20px!important;line-height:16px!important;}
+.roo-strict .x-small-editor .x-form-text{height:16px!important;}
+.roo-safari .x-small-editor .x-form-field{font:normal 12px arial,tahoma,helvetica,sans-serif;}
+.roo-ie .x-small-editor .x-form-text{height:20px;line-height:16px;}
+.roo-border-box .x-small-editor .x-form-text{height:20px;}
+.x-small-editor .x-form-select-one{height:20px;line-height:16px;vertical-align:middle;}
+.x-small-editor .x-form-num-field{text-align:right;}
+.x-small-editor .x-form-field-wrap .x-form-trigger{height:19px;}
+.x-form-clear{clear:both;height:0;overflow:hidden;line-height:0;font-size:0;}
+/* added 10px width here for chrome */
+.x-form-clear-left{clear:left;height:0;overflow:hidden;line-height:0;font-size:0;width:10px}
+.x-form-cb-label{width:'auto'!important;float:none!important;clear:none!important;display:inline!important;margin-left:4px;}
+.x-form-column{float:left;padding:0;margin:0;width:48%;overflow:hidden;zoom:1;}
+.x-form .x-form-btns-ct .x-btn{float:right;clear:none;}
+.x-form .x-form-btns-ct .x-form-btns td{border:0;padding:0;}
+.x-form .x-form-btns-ct .x-form-btns-right table{float:right;clear:none;}
+.x-form .x-form-btns-ct .x-form-btns-left table{float:left;clear:none;}
+.x-form .x-form-btns-ct .x-form-btns-center{text-align:center;}
+.x-form .x-form-btns-ct .x-form-btns-center table{margin:0 auto;}
+.x-form .x-form-btns-ct table td.x-form-btn-td{padding:3px;}
+.x-form .x-form-btns-ct .x-btn-focus .x-btn-left{background-position:0 -147px;}
+.x-form .x-form-btns-ct .x-btn-focus .x-btn-right{background-position:0 -168px;}
+.x-form .x-form-btns-ct .x-btn-focus .x-btn-center{background-position:0 -189px;}
+.x-form .x-form-btns-ct .x-btn-click .x-btn-center{background-position:0 -126px;}
+.x-form .x-form-btns-ct .x-btn-click .x-btn-right{background-position:0 -84px;}
+.x-form .x-form-btns-ct .x-btn-click .x-btn-left{background-position:0 -63px;}
+.x-form-invalid-icon{width:16px;height:18px;visibility:hidden;position:absolute;left:0;top:0;display:block;background:transparent url(../images/default/form/exclamation.gif) no-repeat 0 2px;}
+.roo-ie td .x-form-text{position:relative;top:-1px;}
+
+.x-btn{font:normal 11px tahoma,verdana,helvetica;cursor:pointer;white-space:nowrap;}
+.x-btn button{border:0 none;background:transparent;font:normal 11px tahoma,verdana,helvetica;padding-left:3px;padding-right:3px;cursor:pointer;margin:0;overflow:visible;width:auto;-moz-outline:0 none;outline:0 none;}
+* html .roo-ie .x-btn button{width:1px;}
+.roo-gecko .x-btn button{padding-left:0;padding-right:0;}
+.roo-ie .x-btn button{padding-top:2px;}
+.x-btn-icon .x-btn-center .x-btn-text{background-position:center;background-repeat:no-repeat;height:16px;width:16px;cursor:pointer;white-space:nowrap;padding:0;}
+.x-btn-icon .x-btn-center{padding:1px;}
+.x-btn em{font-style:normal;font-weight:normal;}
+.x-btn-text-icon .x-btn-center .x-btn-text{background-position:0 2px;background-repeat:no-repeat;padding-left:18px;padding-top:1px;padding-bottom:1px;padding-right:0;}
+.x-btn-left,.x-btn-right{font-size:1px;line-height:1px;}
+.x-btn-left{width:3px;height:21px;background:url(../images/default/basic-dialog/btn-sprite.gif) no-repeat 0 0;}
+.x-btn-right{width:3px;height:21px;background:url(../images/default/basic-dialog/btn-sprite.gif) no-repeat 0 -21px;}
+.x-btn-left i,.x-btn-right i{display:block;width:3px;overflow:hidden;font-size:1px;line-height:1px;}
+.x-btn-center{background:url(../images/default/basic-dialog/btn-sprite.gif) repeat-x 0 -42px;vertical-align:middle;text-align:center;padding:0 5px;cursor:pointer;white-space:nowrap;}
+.x-btn-over .x-btn-left{background-position:0 -63px;}
+.x-btn-over .x-btn-right{background-position:0 -84px;}
+.x-btn-over .x-btn-center{background-position:0 -105px;}
+.x-btn-click .x-btn-center,.x-btn-menu-active .x-btn-center{background-position:0 -126px;}
+.x-btn-disabled *{color:gray!important;cursor:default!important;}
+.x-btn-menu-text-wrap .x-btn-center{padding:0 3px;}
+.roo-gecko .x-btn-menu-text-wrap .x-btn-center{padding:0 1px;}
+.x-btn-menu-arrow-wrap .x-btn-center{padding:0;}
+.x-btn-menu-arrow-wrap .x-btn-center button{width:12px!important;height:21px;padding:0!important;display:block;background:transparent url(../images/default/basic-dialog/btn-arrow.gif) no-repeat left 3px;}
+.x-btn-with-menu .x-btn-center{padding-right:2px!important;}
+.x-btn-with-menu .x-btn-center em{display:block;background:transparent url(../images/default/toolbar/btn-arrow.gif) no-repeat right 0;padding-right:10px;}
+.x-btn-text-icon .x-btn-with-menu .x-btn-center em{display:block;background:transparent url(../images/default/toolbar/btn-arrow.gif) no-repeat right 3px;padding-right:10px;}
+
+.x-btn-clear .x-btn-center .x-btn-text  {
+        width:16px;
+        height:16px;
+        background:url(../images/default/basic-dialog/btn-clear.gif) no-repeat 0 0;
+}
+
+
+
+.x-toolbar{border-top:1px solid #eaf0f7;border-bottom:1px solid #a9bfd3;display:block;padding:2px;background:#d0def0 url(../images/default/layout/panel-title-light-bg.gif) repeat-x;position:relative;zoom:1;}
+.x-toolbar .x-item-disabled .x-btn-icon{opacity:.35;-moz-opacity:.35;filter:alpha(opacity=35);}
+.x-toolbar td{vertical-align:middle; padding: 0;}
+.mso .x-toolbar,.x-grid-mso .x-toolbar{border:0 none;background:url(../images/default/grid/mso-hd.gif);}
+.x-toolbar td,.x-toolbar span,.x-toolbar input,.x-toolbar div,.x-toolbar select,.x-toolbar label{white-space:nowrap;font:normal 11px tahoma,arial,helvetica,sans-serif;}
+.x-toolbar .x-item-disabled{color:gray;cursor:default;opacity:.6;-moz-opacity:.6;filter:alpha(opacity=60);}
+.x-toolbar .x-item-disabled *{color:gray;cursor:default;}
+
+/*
+.x-toolbar .x-btn-left{background:none;}
+.x-toolbar .x-btn-right{background:none;}
+.x-toolbar .x-btn-center{background:none;padding:0;}
+*/
+.x-toolbar .x-btn-menu-text-wrap .x-btn-center button{padding-right:2px;}
+.roo-gecko .x-toolbar .x-btn-menu-text-wrap .x-btn-center button{padding-right:0;}
+.x-toolbar .x-btn-menu-arrow-wrap .x-btn-center button{padding:0 2px;}
+
+.x-toolbar .x-btn-menu-arrow-wrap .x-btn-center button{width:12px;background:transparent url(../images/default/toolbar/btn-arrow.gif) no-repeat 0 3px;}
+.x-toolbar .x-btn-text-icon .x-btn-menu-arrow-wrap .x-btn-center button{width:12px;background:transparent url(../images/default/toolbar/btn-arrow.gif) no-repeat 0 3px;}
+.x-toolbar .x-btn-over .x-btn-menu-arrow-wrap .x-btn-center button{background-position:0 -47px;}
+.x-toolbar .x-btn-over .x-btn-left{background:url(../images/default/toolbar/tb-btn-sprite.gif) no-repeat 0 0;}
+.x-toolbar .x-btn-over .x-btn-right{background:url(../images/default/toolbar/tb-btn-sprite.gif) no-repeat 0 -21px;}
+.x-toolbar .x-btn-over .x-btn-center{background:url(../images/default/toolbar/tb-btn-sprite.gif) repeat-x 0 -42px;}
+.x-toolbar .x-btn-click .x-btn-left,.x-toolbar .x-btn-pressed .x-btn-left,.x-toolbar .x-btn-menu-active .x-btn-left{background:url(../images/default/toolbar/tb-btn-sprite.gif) no-repeat 0 -63px;}
+.x-toolbar .x-btn-click .x-btn-right,.x-toolbar .x-btn-pressed .x-btn-right,.x-toolbar .x-btn-menu-active .x-btn-right{background:url(../images/default/toolbar/tb-btn-sprite.gif) no-repeat 0 -84px;}
+.x-toolbar .x-btn-click .x-btn-center,.x-toolbar .x-btn-pressed .x-btn-center,.x-toolbar .x-btn-menu-active .x-btn-center{background:url(../images/default/toolbar/tb-btn-sprite.gif) repeat-x 0 -105px;}
+.x-toolbar .x-btn-with-menu .x-btn-center em{padding-right:8px;}
+.x-toolbar .ytb-text{padding:2px;}
+.x-toolbar .ytb-sep{background-image:url(../images/default/grid/grid-split.gif);background-position:center;background-repeat:no-repeat;display:block;font-size:1px;height:16px;width:4px;overflow:hidden;cursor:default;margin:0 2px 0;border:0;}
+.x-toolbar .ytb-spacer{width:2px;}
+.mso .x-toolbar .ytb-sep,.x-grid-mso .x-toolbar .ytb-sep{background-image:url(../images/default/grid/grid-blue-split.gif);}
+
+.x-toolbar .x-toolbar-td { padding: 0 2; }
+.x-grid-bottombar .x-toolbar .x-toolbar-td { padding: 0 0; }
+
+.x-grid-page-number{width:24px;height:14px;}
+.x-grid-page-first .x-btn-text{background-image:url(../images/default/grid/page-first.gif);}
+.x-grid-loading .x-btn-text{background-image:url(../images/default/grid/done.gif);}
+.x-grid-page-last .x-btn-text{background-image:url(../images/default/grid/page-last.gif);}
+.x-grid-page-next .x-btn-text{background-image:url(../images/default/grid/page-next.gif);}
+.x-grid-page-prev .x-btn-text{background-image:url(../images/default/grid/page-prev.gif);}
+.x-item-disabled .x-grid-loading .x-btn-text{background-image:url(../images/default/grid/loading.gif);}
+.x-item-disabled .x-grid-page-first .x-btn-text{background-image:url(../images/default/grid/page-first-disabled.gif);}
+.x-item-disabled .x-grid-page-last .x-btn-text{background-image:url(../images/default/grid/page-last-disabled.gif);}
+.x-item-disabled .x-grid-page-next .x-btn-text{background-image:url(../images/default/grid/page-next-disabled.gif);}
+.x-item-disabled .x-grid-page-prev .x-btn-text{background-image:url(../images/default/grid/page-prev-disabled.gif);}
+.x-paging-info{position:absolute;top:8px;right:8px;color:#15428b;}
+
+.x-resizable-handle{position:absolute;z-index:100;font-size:1px;line-height:6px;overflow:hidden;background:white;filter:alpha(opacity=0);opacity:0;zoom:1;}
+.x-resizable-handle-east{width:6px;cursor:e-resize;right:0;top:0;height:100%;}
+.roo-ie .x-resizable-handle-east{margin-right:-1px;}
+.x-resizable-handle-south{width:100%;cursor:s-resize;left:0;bottom:0;height:6px;}
+.roo-ie .x-resizable-handle-south{margin-bottom:-1px;}
+.x-resizable-handle-west{width:6px;cursor:w-resize;left:0;top:0;height:100%;}
+.x-resizable-handle-north{width:100%;cursor:n-resize;left:0;top:0;height:6px;}
+.x-resizable-handle-southeast{width:6px;cursor:se-resize;right:0;bottom:0;height:6px;z-index:101;}
+.x-resizable-handle-northwest{width:6px;cursor:nw-resize;left:0;top:0;height:6px;z-index:101;}
+.x-resizable-handle-northeast{width:6px;cursor:ne-resize;right:0;top:0;height:6px;z-index:101;}
+.x-resizable-handle-southwest{width:6px;cursor:sw-resize;left:0;bottom:0;height:6px;z-index:101;}
+.x-resizable-over .x-resizable-handle,.x-resizable-pinned .x-resizable-handle{filter:alpha(opacity=100);opacity:1;}
+.x-resizable-over .x-resizable-handle-east,.x-resizable-pinned .x-resizable-handle-east{background:url(../images/default/sizer/e-handle.gif);background-position:left;}
+.x-resizable-over .x-resizable-handle-west,.x-resizable-pinned .x-resizable-handle-west{background:url(../images/default/sizer/e-handle.gif);background-position:left;}
+.x-resizable-over .x-resizable-handle-south,.x-resizable-pinned .x-resizable-handle-south{background:url(../images/default/sizer/s-handle.gif);background-position:top;}
+.x-resizable-over .x-resizable-handle-north,.x-resizable-pinned .x-resizable-handle-north{background:url(../images/default/sizer/s-handle.gif);background-position:top;}
+.x-resizable-over .x-resizable-handle-southeast,.x-resizable-pinned .x-resizable-handle-southeast{background:url(../images/default/sizer/se-handle.gif);background-position:top left;}
+.x-resizable-over .x-resizable-handle-northwest,.x-resizable-pinned .x-resizable-handle-northwest{background:url(../images/default/sizer/nw-handle.gif);background-position:bottom right;}
+.x-resizable-over .x-resizable-handle-northeast,.x-resizable-pinned .x-resizable-handle-northeast{background:url(../images/default/sizer/ne-handle.gif);background-position:bottom left;}
+.x-resizable-over .x-resizable-handle-southwest,.x-resizable-pinned .x-resizable-handle-southwest{background:url(../images/default/sizer/sw-handle.gif);background-position:top right;}
+.x-resizable-proxy{border:1px dashed #6593cf;position:absolute;overflow:hidden;display:none;left:0;top:0;z-index:50000;}
+.x-resizable-overlay{width:100%;height:100%;display:none;position:absolute;left:0;top:0;background:white;z-index:200000;-moz-opacity:0;opacity:0;filter:alpha(opacity=0);}
+
+/* .x-grid{position:relative;overflow:hidden;background-color:#fff;} */
+.x-grid{position:absolute;overflow:hidden;background-color:#fff;top:0;left:0;}
+.x-grid-scroller{overflow:auto;display: block; left:0; top:0; }
+.x-grid-viewport,.x-grid-locked{position:absolute;left:0;top:0;z-index:2;overflow:hidden;visibility:hidden;}
+.x-grid-cell-inner,.x-grid-hd-inner{overflow:hidden;-o-text-overflow:ellipsis;text-overflow:ellipsis;}
+.x-grid-hd-row td,.x-grid-row td{font:normal 11px arial,tahoma,helvetica,sans-serif;line-height:13px;white-space:nowrap;vertical-align:top;-moz-outline:none;-moz-user-focus:normal;}
+.x-grid-hd-row td{line-height:14px;}
+.x-grid-col{border-right:1px solid #ebebeb;border-bottom:1px solid #ebebeb;}
+.x-grid-locked .x-grid-body td{background-color:#FBFDFF;border-right:1px solid #deecfd;border-bottom:1px solid #deecfd!important;}
+.x-grid-locked .x-grid-body td .x-grid-cell-inner{border-top:0 none;}
+.x-grid-locked .x-grid-row-alt td{background-color:#F5FAFE;}
+.x-grid-locked .x-grid-header table{border-right:1px solid transparent;}
+.x-grid-locked .x-grid-body table{border-right:1px solid #c3daf9;}
+.x-grid-row{cursor:default;}
+.x-grid-row-alt{background-color:#f1f1f1;}
+.x-grid-row-over td{background-color:#d9e8fb;}
+.x-grid-resize-proxy{width:3px;background-color:#ccc;cursor:e-resize;cursor:col-resize;position:absolute;top:0;height:100px;overflow:hidden;visibility:hidden;border:0 none;z-index:7;}
+.x-grid-focus{position:absolute;top:0;-moz-outline:0 none;outline:0 none;-moz-user-select:normal;-khtml-user-select:normal;}
+.x-grid-header{background:#ebeadb url(../images/default/grid/grid-hrow.gif) repeat-x;overflow:hidden;position:relative;cursor:default;width:100%;}
+.x-grid-hd-row{height:22px;}
+.x-grid-hd{padding-right:1px;}
+.x-grid-hd-over .x-grid-hd-inner{border-bottom:1px solid #c3daf9;}
+.x-grid-hd-over .x-grid-hd-text{background:#fafafa url(../images/default/grid/grid-hrow.gif) repeat-x 0 1px;padding-bottom:1px;border-bottom:1px solid #b3cae9;}
+.x-grid-sort-icon{background-repeat:no-repeat;display:none;height:4px;width:13px;margin-left:3px;vertical-align:middle;}
+.x-grid-header .sort-asc .x-grid-sort-icon{background-image:url(../images/default/grid/sort_asc.gif);display:inline;}
+.x-grid-header .sort-desc .x-grid-sort-icon{background-image:url(../images/default/grid/sort_desc.gif);display:inline;}
+.x-grid-body{overflow:hidden;position:relative;width:100%;zoom:1;}
+.x-grid-cell-text,.x-grid-hd-text{display:block;padding:3px 5px 3px 5px;-moz-user-select:none;-khtml-user-select:none;color:black;}
+.x-grid-hd-text{padding-top:4px;}
+.x-grid-split{background-image:url(../images/default/grid/grid-split.gif);background-position:center;background-repeat:no-repeat;cursor:e-resize;cursor:col-resize;display:block;font-size:1px;height:16px;overflow:hidden;position:absolute;top:2px;width:6px;z-index:3;}
+.x-grid-hd-text{color:#15428b;}
+.x-dd-drag-proxy .x-grid-hd-inner{background:#ebeadb url(../images/default/grid/grid-hrow.gif) repeat-x;height:22px;width:120px;}
+.col-move-top,.col-move-bottom{width:9px;height:9px;position:absolute;top:0;line-height:1px;font-size:1px;overflow:hidden;visibility:hidden;z-index:20000;}
+/*
+.col-move-top{background:transparent url(../images/default/grid/col-move-top.gif) no-repeat left top;}
+.col-move-bottom{background:transparent url(../images/default/grid/col-move-bottom.gif) no-repeat left top;}
+*/
+.x-grid-row-selected td,.x-grid-locked .x-grid-row-selected td{background-color:#316ac5!important;color:white;}
+.x-grid-row-selected span,.x-grid-row-selected b,.x-grid-row-selected div,.x-grid-row-selected strong,.x-grid-row-selected i{color:white!important;}
+.x-grid-row-selected .x-grid-cell-text{color:white;}
+.x-grid-cell-selected{background-color:#316ac5!important;color:white;}
+.x-grid-cell-selected span{color:white!important;}
+.x-grid-cell-selected .x-grid-cell-text{color:white;}
+.x-grid-locked td.x-grid-row-marker,.x-grid-locked .x-grid-row-selected td.x-grid-row-marker{background:#ebeadb url(../images/default/grid/grid-hrow.gif) repeat-x 0 bottom!important;vertical-align:middle!important;color:black;padding:0;border-top:1px solid white;border-bottom:none!important;border-right:1px solid #6fa0df!important;text-align:center;}
+.x-grid-locked td.x-grid-row-marker div,.x-grid-locked .x-grid-row-selected td.x-grid-row-marker div{padding:0 4px;color:#15428b!important;text-align:center;}
+.x-grid-dirty-cell{background:transparent url(../images/default/grid/dirty.gif) no-repeat 0 0;}
+.x-grid-row-alt .x-grid-dirty-cell{background-color:#f1f1f1;}
+.x-grid-topbar,.x-grid-bottombar{font:normal 11px arial,tahoma,helvetica,sans-serif;overflow:hidden;display:none;zoom:1;position:relative;}
+.x-grid-topbar .x-toolbar{border-right:0 none;}
+.x-grid-bottombar .x-toolbar{border-right:0 none;border-bottom:0 none;border-top:1px solid #a9bfd3;}
+.x-props-grid .x-grid-cell-selected .x-grid-cell-text{background-color:#316ac5!important;}
+.x-props-grid .x-grid-col-value .x-grid-cell-text{background-color:white;}
+.x-props-grid .x-grid-col-name{background-color:#c3daf9;}
+.x-props-grid .x-grid-col-name .x-grid-cell-text{background-color:white;margin-left:10px;}
+.x-props-grid .x-grid-split-value{visibility:hidden;}
+.xg-hmenu-sort-asc .x-menu-item-icon{background-image:url(../images/default/grid/hmenu-asc.gif);}
+.xg-hmenu-sort-desc .x-menu-item-icon{background-image:url(../images/default/grid/hmenu-desc.gif);}
+.xg-hmenu-lock .x-menu-item-icon{background-image:url(../images/default/grid/hmenu-lock.gif);}
+.xg-hmenu-unlock .x-menu-item-icon{background-image:url(../images/default/grid/hmenu-unlock.gif);}
+.x-dd-drag-ghost .x-grid-dd-wrap{padding:1px 3px 3px 1px;}
+
+.x-layout-container{width:100%;height:100%;overflow:hidden;background-color:#c3daf9;}
+.x-layout-container .x-layout-tabs-body{border:0 none;}
+.x-layout-collapsed{position:absolute;left:-10000px;top:-10000px;visibility:hidden;background-color:#eee;width:20px;height:20px;overflow:hidden;border:1px solid #98c0f4;z-index:20;}
+.roo-border-box .x-layout-collapsed{width:22px;height:22px;}
+.x-layout-collapsed-over{cursor:pointer;background-color:#d9e8fb;}
+.x-layout-collapsed-west .x-layout-collapsed-tools,
+.x-layout-collapsed-east .x-layout-collapsed-tools{
+        position:absolute;
+        float:left;
+        overflow:hidden;
+        top:0;left:0;
+        width:15px;height:15px;
+}
+.x-layout-collapsed-north .x-layout-collapsed-tools,
+.x-layout-collapsed-south .x-layout-collapsed-tools{
+        position:absolute;
+        float:left;
+        overflow:hidden;
+        top:0;right:0;
+        width:15px;height:15px;
+}
+.x-layout-collapsed .x-layout-tools-button{margin:0;}
+.x-layout-collapsed .x-layout-tools-button-inner{
+        width:15px;height:15px;
+}
+.x-layout-inactive-content{position:absolute;left:-10000px;top:-10000px;visibility:hidden;}
+.x-layout-active-content{visibility:visible;}
+.x-layout-panel{position:absolute;border:1px solid #eee;overflow:hidden;background-color:white;}
+.x-layout-panel-east,.x-layout-panel-west{z-index:10;}
+.x-layout-panel-north,.x-layout-panel-south{z-index:11;}
+.x-layout-collapsed-north,.x-layout-collapsed-south,.x-layout-collapsed-east,.x-layout-collapsed-west{z-index:12;}
+.x-layout-panel-body{overflow:hidden;}
+.x-layout-split{position:absolute;height:5px;width:5px;line-height:1px;font-size:1px;z-index:3;background-color:#c3daf9;}
+
+.x-layout-panel-hd {background-image:url(../images/default/layout/panel-title-light-bg.gif);color:black;border-bottom:1px solid #98c0f4;position:relative;}
+.x-layout-panel-hd-text {font:normal 11px tahoma,verdana,helvetica;padding:4px;padding-left:4px;display:block;white-space:nowrap;}
+.x-layout-panel-hd-tools {
+    position:absolute;right:0;top:0;text-align:right;padding-top:2px;padding-right:2px;width:60px;
+}
+
+.x-layout-tools-button {
+    z-index:6;
+    padding:2px;
+    cursor:pointer;
+    float:right;
+    background-image:url("../images/default/layout/tool-sprites.gif");
+}
+
+.x-layout-tools-button-over { padding:1px;border:1px solid #98c0f4;background-color:white; }
+.x-layout-tools-button-inner{height:12px;width:12px;line-height:1px;font-size:1px;background-repeat:no-repeat;background-position:center;}
+.x-layout-close{background-image:url(../images/default/layout/panel-close.gif);}
+.x-layout-stick{background-image:url(../images/default/layout/stick.gif);}
+
+/** we changed to use the sprite */
+
+.x-layout-collapse-west,.x-layout-expand-east { background-position: 0 -180px; }
+.x-layout-tools-button-over .x-tool-collapse-west,
+.x-layout-tools-button-over .x-layout-expand-east { background-position: -15px -180px;}
+
+.x-layout-collapse-east,.x-layout-expand-west { background-position: 0 -165px; }
+.x-layout-tools-button-over .x-tool-collapse-east,
+.x-layout-tools-button-over .x-tool-expand-west { background-position: -15px -165px;}
+
+.x-layout-collapse-north,.x-layout-expand-south{  background-position: 0 -195px; }
+.x-layout-tools-button-over .x-tool-collapse-north,
+.x-layout-tools-button-over .x-tool-expand-south { background-position: -15px -195px;}
+
+.x-layout-expand-north,.x-layout-collapse-south{  background-position: 0 -195px; }
+.x-layout-tools-button-over .x-tool-collapse-south,
+.x-layout-tools-button-over .x-tool-expand-north { background-position: -15px -195px;}
+
+.x-layout-split-h{background-image:url(../images/default/sizer/e-handle.gif);background-position:left;}
+.x-layout-split-v{background-image:url(../images/default/sizer/s-handle.gif);background-po5sition:top;}
+.x-layout-panel .x-tabs-wrap{background:url(../images/default/layout/panel-title-light-bg.gif);}
+.x-layout-panel .x-tabs-body{background-color:white;overflow:auto;height:100%;}
+.x-layout-component-panel,.x-layout-nested-layout{position:relative;padding:0;overflow:hidden;width:200px;height:200px;}
+.x-layout-nested-layout .x-layout-panel{border:0 none;}
+.x-layout-nested-layout .x-layout-panel-north{border-bottom:1px solid #98c0f4;}
+.x-layout-nested-layout .x-layout-panel-south{border-top:1px solid #98c0f4;}
+.x-layout-nested-layout .x-layout-panel-east{border-left:1px solid #98c0f4;}
+.x-layout-nested-layout .x-layout-panel-west{border-right:1px solid #98c0f4;}
+.x-layout-panel-dragover{border:2px solid #6593cf;}
+.x-layout-panel-proxy{background-image:url(../images/default/layout/gradient-bg.gif);background-color:#c3daf9;border:1px dashed #6593cf;z-index:10001;overflow:hidden;position:absolute;left:0;top:0;}
+.x-layout-slider{z-index:15;overflow:hidden;position:absolute;}
+.x-scroller-up,.x-scroller-down{background-color:#c3daf9;border:1px solid #6593cf;border-top-color:#fff;border-left-color:#fff;border-right:0 none;cursor:pointer;overflow:hidden;line-height:16px;}
+.x-scroller-down{border-bottom:0 none;border-top:1px solid #6593cf;}
+.x-scroller-btn-over{background-color:#d9e8f8;}
+.x-scroller-btn-click{background-color:#AECEF7;}
+.x-scroller-btn-disabled{cursor:default;background-color:#c3daf9;-moz-opacity:0.3;opacity:.30;filter:alpha(opacity=30);}
+.x-reader .x-layout-panel-north{border:0 none;}
+.x-reader .x-layout-panel-center{border:0 none;}
+.x-reader .x-layout-nested-layout .x-layout-panel-center{border:1px solid #99bbe8;border-top:0 none;}
+.x-reader .x-layout-nested-layout .x-layout-panel-south{border:1px solid #99bbe8;}
+
+.x-dlg-proxy{background-image:url(../images/default/gradient-bg.gif);background-color:#c3daf9;border:1px solid #6593cf;z-index:10001;overflow:hidden;position:absolute;left:0;top:0;}
+.x-dlg-shadow{background:#aaa;position:absolute;left:0;top:0;}
+.x-dlg-focus{-moz-outline:0 none;outline:0 none;width:0;height:0;overflow:hidden;position:absolute;top:0;left:0;}
+.x-dlg-mask{z-index:10000;display:none;position:absolute;top:0;left:0;-moz-opacity:0.5;opacity:.50;filter:alpha(opacity=50);background-color:#CCC;}
+body.x-body-masked select{visibility:hidden;}
+body.x-body-masked .x-dlg select{visibility:visible;}
+.x-dlg{z-index:10001;overflow:hidden;position:absolute;left:300;top:0;}
+.x-dlg .x-dlg-hd{
+        background:url(../images/default/basic-dialog/hd-sprite.gif) repeat-x 0 -82px;
+        background-color:navy;
+        color:#FFF;
+        font:bold 11px "sans serif",tahoma,verdana,helvetica;
+        overflow:hidden;
+        padding:5px;
+        white-space:nowrap;
+    }
+.x-dlg .x-dlg-hd-left{background:url(../images/default/basic-dialog/hd-sprite.gif) no-repeat 0 -41px;padding-left:3px;margin:0;}
+.x-dlg .x-dlg-hd-right{background:url(../images/default/basic-dialog/hd-sprite.gif) no-repeat right 0;padding-right:3px;}
+.x-dlg .x-dlg-dlg-body{background:url(../images/default/layout/gradient-bg.gif);border:1px solid #6593cf;border-top:0 none;padding:10px;position:absolute;top:24px;left:0;z-index:1;overflow:hidden;}
+.x-dlg-collapsed .x-resizable-handle{display:none;}
+.x-dlg .x-dlg-bd{overflow:hidden;}
+.x-dlg .x-dlg-ft{overflow:hidden;padding:5px;padding-bottom:0;}
+.x-dlg .x-tabs-body{background:white;overflow:auto;}
+.x-dlg .x-tabs-top .x-tabs-body{border:1px solid #6593cf;border-top:0 none;}
+.x-dlg .x-tabs-bottom .x-tabs-body{border:1px solid #6593cf;border-bottom:0 none;}
+.x-dlg .x-layout-container .x-tabs-body{border:0 none;}
+.x-dlg .inner-tab{margin:5px;}
+.x-dlg .x-dlg-ft .x-btn{margin-right:5px;float:right;clear:none;}
+.x-dlg .x-dlg-ft .x-dlg-btns td{border:0;padding:0;}
+.x-dlg .x-dlg-ft .x-dlg-btns-right table{float:right;clear:none;}
+.x-dlg .x-dlg-ft .x-dlg-btns-left table{float:left;clear:none;}
+.x-dlg .x-dlg-ft .x-dlg-btns-center{text-align:center;}
+.x-dlg .x-dlg-ft .x-dlg-btns-center table{margin:0 auto;}
+.x-dlg .x-dlg-ft .x-dlg-btns .x-btn-focus .x-btn-left{background-position:0 -147px;}
+.x-dlg .x-dlg-ft .x-dlg-btns .x-btn-focus .x-btn-right{background-position:0 -168px;}
+.x-dlg .x-dlg-ft .x-dlg-btns .x-btn-focus .x-btn-center{background-position:0 -189px;}
+.x-dlg .x-dlg-ft .x-dlg-btns .x-btn-click .x-btn-center{background-position:0 -126px;}
+.x-dlg .x-dlg-ft .x-dlg-btns .x-btn-click .x-btn-right{background-position:0 -84px;}
+.x-dlg .x-dlg-ft .x-dlg-btns .x-btn-click .x-btn-left{background-position:0 -63px;}
+.x-dlg-draggable .x-dlg-hd{cursor:move;}
+.x-dlg-closable .x-dlg-hd{padding-right:22px;}
+.x-dlg-toolbox{position:absolute;top:4px;right:4px;z-index:6;width:40px;cursor:default;height:15px;background:transparent;}
+.x-dlg .x-dlg-close,.x-dlg .x-dlg-collapse{float:right;height:15px;width:15px;margin:0;margin-left:2px;padding:0;line-height:1px;font-size:1px;background-repeat:no-repeat;cursor:pointer;visibility:inherit;}
+
+.x-dlg .x-dlg-close{
+    background-image:url("../images/default/layout/tool-sprites.gif");
+    background-position:0 0;
+}
+.x-dlg .x-dlg-close-over {
+    background-position:-15px 0;
+}
+
+.x-dlg .x-dlg-collapse{
+    background-image:url("../images/default/layout/tool-sprites.gif");
+    background-position:0 -15px;
+}
+.x-dlg .x-dlg-collapse-over {
+    background-position:-15px -15px;
+}
+
+/*    background-image:url(../images/default/basic-dialog/collapse.gif);} */
+.x-dlg-collapsed .x-dlg-collapse{
+    background-image:url("../images/default/layout/tool-sprites.gif");
+    background-position:0 -30px;
+}
+
+.x-dlg div.x-resizable-handle-east{background-image:url(../images/default/basic-dialog/e-handle.gif);border:0;background-position:right;margin-right:0;}
+.x-dlg div.x-resizable-handle-south{background-image:url(../images/default/sizer/s-handle-dark.gif);border:0;height:6px;}
+.x-dlg div.x-resizable-handle-west{background-image:url(../images/default/basic-dialog/e-handle.gif);border:0;background-position:1px;}
+.x-dlg div.x-resizable-handle-north{background-image:url(../images/default/s.gif);border:0;}
+.x-dlg div.x-resizable-handle-northeast,.xtheme-gray .x-dlg div.x-resizable-handle-northeast{background-image:url(../images/default/s.gif);border:0;}
+.x-dlg div.x-resizable-handle-northwest,.xtheme-gray .x-dlg div.x-resizable-handle-northwest{background-image:url(../images/default/s.gif);border:0;}
+.x-dlg div.x-resizable-handle-southeast{background-image:url(../images/default/basic-dialog/se-handle.gif);background-position:bottom right;width:8px;height:8px;border:0;}
+.x-dlg div.x-resizable-handle-southwest{background-image:url(../images/default/sizer/sw-handle-dark.gif);background-position:top right;margin-left:1px;margin-bottom:1px;border:0;}
+#x-msg-box .x-dlg-ft .x-btn{float:none;clear:none;margin:0 3px;}
+#x-msg-box .x-dlg-bd{padding:5px;overflow:hidden!important;font:normal 13px verdana,tahoma,sans-serif;}
+#x-msg-box .roo-mb-input{margin-top:4px;width:95%;}
+#x-msg-box .roo-mb-textarea{margin-top:4px;font:normal 13px verdana,tahoma,sans-serif;}
+#x-msg-box .roo-mb-progress-wrap{margin-top:4px;border:1px solid #6593cf;}
+#x-msg-box .roo-mb-progress{height:18px;background:#e0e8f3 url(../images/default/qtip/bg.gif) repeat-x;}
+#x-msg-box .roo-mb-progress-bar{height:18px;overflow:hidden;width:0;background:#8BB8F3;border-top:1px solid #B2D0F7;border-bottom:1px solid #65A1EF;border-right:1px solid #65A1EF;}
+#x-msg-box .x-msg-box-wait{background:transparent url(../images/default/grid/loading.gif) no-repeat left;display:block;width:300px;padding-left:18px;line-height:18px;}
+
+.x-dd-drag-proxy{position:absolute;left:0;top:0;visibility:hidden;z-index:15000;}
+.x-dd-drag-ghost{color:black;font:normal 11px arial,helvetica,sans-serif;-moz-opacity:0.85;opacity:.85;filter:alpha(opacity=85);border-top:1px solid #ddd;border-left:1px solid #ddd;border-right:1px solid #bbb;border-bottom:1px solid #bbb;padding:3px;padding-left:20px;background-color:white;white-space:nowrap;}
+.x-dd-drag-repair .x-dd-drag-ghost{-moz-opacity:0.4;opacity:.4;filter:alpha(opacity=40);border:0 none;padding:0;background-color:transparent;}
+.x-dd-drag-repair .x-dd-drop-icon{visibility:hidden;}
+.x-dd-drop-icon{position:absolute;top:3px;left:3px;display:block;width:16px;height:16px;background-color:transparent;background-position:center;background-repeat:no-repeat;z-index:1;}
+.x-dd-drop-nodrop .x-dd-drop-icon{background-image:url(../images/default/dd/drop-no.gif);}
+.x-dd-drop-ok .x-dd-drop-icon{background-image:url(../images/default/dd/drop-yes.gif);}
+.x-dd-drop-ok-add .x-dd-drop-icon{background-image:url(../images/default/dd/drop-add.gif);}
+.x-dd-drop-ok-sub .x-dd-drop-icon{background-image:url(../images/default/dd/drop-sub.gif);}
+
+.x-tree-icon,.x-tree-ec-icon,.x-tree-elbow-line,.x-tree-elbow,.x-tree-elbow-end,.x-tree-elbow-plus,.x-tree-elbow-minus,.x-tree-elbow-end-plus,.x-tree-elbow-end-minus{border:0 none;height:18px;margin:0;padding:0;vertical-align:middle;width:16px;background-repeat:no-repeat;}
+.x-tree-node-collapsed .x-tree-node-icon,.x-tree-node-expanded .x-tree-node-icon,.x-tree-node-leaf .x-tree-node-icon{border:0 none;height:18px;margin:0;padding:0;vertical-align:middle;width:16px;background-position:center;background-repeat:no-repeat;}
+.x-tree-node-collapsed .x-tree-node-icon{background-image:url(../images/default/tree/folder.gif);}
+.x-tree-node-expanded .x-tree-node-icon{background-image:url(../images/default/tree/folder-open.gif);}
+.x-tree-node-leaf .x-tree-node-icon{background-image:url(../images/default/tree/leaf.gif);}
+.roo-ie input.x-tree-node-cb{width:15px;height:15px;}
+input.x-tree-node-cb{margin-left:1px;}
+.roo-ie input.x-tree-node-cb{margin-left:0;}
+.x-tree-noicon .x-tree-node-icon{width:0;height:0;}
+.x-tree-node-loading .x-tree-node-icon{background-image:url(../images/default/tree/loading.gif)!important;}
+.x-tree-node-loading a span{font-style:italic;color:#444;}
+.x-tree-lines .x-tree-elbow{background-image:url(../images/default/tree/elbow.gif);}
+.x-tree-lines .x-tree-elbow-plus{background-image:url(../images/default/tree/elbow-plus.gif);}
+.x-tree-lines .x-tree-elbow-minus{background-image:url(../images/default/tree/elbow-minus.gif);}
+.x-tree-lines .x-tree-elbow-end{background-image:url(../images/default/tree/elbow-end.gif);}
+.x-tree-lines .x-tree-elbow-end-plus{background-image:url(../images/default/tree/elbow-end-plus.gif);}
+.x-tree-lines .x-tree-elbow-end-minus{background-image:url(../images/default/tree/elbow-end-minus.gif);}
+.x-tree-lines .x-tree-elbow-line{background-image:url(../images/default/tree/elbow-line.gif);}
+.x-tree-no-lines .x-tree-elbow{background:transparent;}
+.x-tree-no-lines .x-tree-elbow-plus{background-image:url(../images/default/tree/elbow-plus-nl.gif);}
+.x-tree-no-lines .x-tree-elbow-minus{background-image:url(../images/default/tree/elbow-minus-nl.gif);}
+.x-tree-no-lines .x-tree-elbow-end{background:transparent;}
+.x-tree-no-lines .x-tree-elbow-end-plus{background-image:url(../images/default/tree/elbow-end-plus-nl.gif);}
+.x-tree-no-lines .x-tree-elbow-end-minus{background-image:url(../images/default/tree/elbow-end-minus-nl.gif);}
+.x-tree-no-lines .x-tree-elbow-line{background:transparent;}
+.x-tree-elbow-plus,.x-tree-elbow-minus,.x-tree-elbow-end-plus,.x-tree-elbow-end-minus{cursor:pointer;}
+.roo-ie ul.x-tree-node-ct{font-size:0;line-height:0;}
+.x-tree-node{color:black;font:normal 11px arial,tahoma,helvetica,sans-serif;white-space:nowrap;}
+.x-tree-node a,.x-dd-drag-ghost a{text-decoration:none;color:black;-khtml-user-select:none;-moz-user-select:none;-kthml-user-focus:normal;-moz-user-focus:normal;-moz-outline:0 none;outline:0 none;}
+.x-tree-node a span,.x-dd-drag-ghost a span{text-decoration:none;color:black;padding:1px 3px 1px 2px;}
+.x-tree-node .x-tree-node-disabled a span{color:gray!important;}
+.x-tree-node .x-tree-node-disabled .x-tree-node-icon{-moz-opacity:0.5;opacity:.5;filter:alpha(opacity=50);}
+.x-tree-node .x-tree-node-inline-icon{background:transparent;}
+.x-tree-node a:hover,.x-dd-drag-ghost a:hover{text-decoration:none;}
+.x-tree-node div.x-tree-drag-insert-below{border-bottom:1px dotted #36c;}
+.x-tree-node div.x-tree-drag-insert-above{border-top:1px dotted #36c;}
+.x-tree-dd-underline .x-tree-node div.x-tree-drag-insert-below{border-bottom:0 none;}
+.x-tree-dd-underline .x-tree-node div.x-tree-drag-insert-above{border-top:0 none;}
+.x-tree-dd-underline .x-tree-node div.x-tree-drag-insert-below a{border-bottom:2px solid #36c;}
+.x-tree-dd-underline .x-tree-node div.x-tree-drag-insert-above a{border-top:2px solid #36c;}
+.x-tree-node .x-tree-drag-append a span{background:#ddd;border:1px dotted gray;}
+.x-tree-node .x-tree-selected a span{background:#36c;color:white;}
+.x-dd-drag-ghost .x-tree-node-indent,.x-dd-drag-ghost .x-tree-ec-icon{display:none!important;}
+.x-tree-drop-ok-append .x-dd-drop-icon{background-image:url(../images/default/tree/drop-add.gif);}
+.x-tree-drop-ok-above .x-dd-drop-icon{background-image:url(../images/default/tree/drop-over.gif);}
+.x-tree-drop-ok-below .x-dd-drop-icon{background-image:url(../images/default/tree/drop-under.gif);}
+.x-tree-drop-ok-between .x-dd-drop-icon{background-image:url(../images/default/tree/drop-between.gif);}
+
+.x-tip{position:absolute;top:0;left:0;visibility:hidden;z-index:20000;border:0 none;}
+.x-tip .x-tip-close{background-image:url(../images/default/qtip/close.gif);height:15px;float:right;width:15px;margin:0 0 2px 2px;cursor:pointer;display:none;}
+/*
+.x-tip .x-tip-top{height:6px;overflow:hidden;}
+.x-tip .x-tip-top-left{padding-left:6px;zoom:1;}
+.x-tip .x-tip-top-right{padding-right:6px;zoom:1;}
+.x-tip .x-tip-ft{height:6px;overflow:hidden;}
+.x-tip .x-tip-ft-left{padding-left:6px;zoom:1;}
+.x-tip .x-tip-ft-right{padding-right:6px;zoom:1;}
+.x-tip .x-tip-bd{border:0 none;font:normal 11px tahoma,arial,helvetica,sans-serif;}
+.x-tip .x-tip-bd-left{padding-left:6px;zoom:1;}
+.x-tip .x-tip-bd-right{padding-right:6px;zoom:1;}
+*/
+.x-tip h3{font:bold 11px tahoma,arial,helvetica,sans-serif;margin:0;padding:2px 0;color:#444;background:#eee;}
+
+.x-tip .x-tip-bd-inner{
+        font:normal 11px tahoma,arial,helvetica,sans-serif;
+        margin:0!important;
+        line-height:14px;
+        color:#444;
+        float:left;
+        background:#ff9;
+        padding:3px;
+        border: 1px solid #ca0;
+}
+
+/*
+.x-form-invalid-tip .x-tip-top{background-image:url(../images/default/form/error-tip-corners.gif);}
+.x-form-invalid-tip .x-tip-top-left{background-image:url(../images/default/form/error-tip-corners.gif);}
+.x-form-invalid-tip .x-tip-top-right{background-image:url(../images/default/form/error-tip-corners.gif);}
+.x-form-invalid-tip .x-tip-ft{background-image:url(../images/default/form/error-tip-corners.gif);}
+.x-form-invalid-tip .x-tip-ft-left{background-image:url(../images/default/form/error-tip-corners.gif);}
+.x-form-invalid-tip .x-tip-ft-right{background-image:url(../images/default/form/error-tip-corners.gif);}
+.x-form-invalid-tip .x-tip-bd-left{background-image:url(../images/default/form/error-tip-corners.gif);}
+.x-form-invalid-tip .x-tip-bd-right{background-image:url(../images/default/form/error-tip-corners.gif);}
+.x-form-invalid-tip .x-tip-bd .x-tip-bd-inner{padding-left:24px;background:transparent url(../images/default/form/exclamation.gif) no-repeat 2px 2px;}
+.x-form-invalid-tip .x-tip-bd-inner{padding:2px;}
+
+*/
+.x-form-invalid-tip .x-tip-bd .x-tip-bd-inner{
+        padding:3px;
+        padding-left:24px;
+        background:#F99 url(../images/default/form/exclamation.gif) no-repeat 2px 2px;
+        border: 1px solid #f00;
+}
+
+
+
+
+
+.x-date-picker{border:1px solid #1b376c;border-top:0 none;background:#fff;position:relative;}
+.x-date-picker a{-moz-outline:0 none;outline:0 none;}
+.x-date-inner,.x-date-inner td,.x-date-inner th{border-collapse:separate;}
+.x-date-middle,.x-date-left,.x-date-right{background:url(../images/default/basic-dialog/hd-sprite.gif) repeat-x 0 -83px;color:#FFF;font:bold 11px "sans serif",tahoma,verdana,helvetica;overflow:hidden;}
+.x-date-middle .x-btn-left,.x-date-middle .x-btn-center,.x-date-middle .x-btn-right{background:transparent!important;vertical-align:middle;}
+.x-date-middle .x-btn .x-btn-text{color:#fff;}
+.x-date-middle .x-btn-with-menu .x-btn-center em{background:transparent url(../images/default/toolbar/btn-arrow-light.gif) no-repeat right 0;}
+.x-date-right,.x-date-left{width:18px;}
+.x-date-right{text-align:right;}
+.x-date-middle{padding-top:2px;padding-bottom:2px;}
+.x-date-right a,.x-date-left a{display:block;width:16px;height:16px;background-position:center;background-repeat:no-repeat;cursor:pointer;-moz-opacity:0.6;opacity:.6;filter:alpha(opacity=60);}
+.x-date-right a:hover,.x-date-left a:hover{-moz-opacity:1;opacity:1;filter:alpha(opacity=100);}
+.x-date-right a{background-image:url(../images/default/grid/arrow-right-white.gif);margin-right:2px;text-decoration:none!important;}
+.x-date-left a{background-image:url(../images/default/grid/arrow-left-white.gif);margin-left:2px;text-decoration:none!important;}
+table.x-date-inner{width:100%;table-layout:fixed;}
+.x-date-inner th{width:25px;}
+.x-date-inner th{background:#dfecfb url(../images/default/shared/glass-bg.gif) repeat-x left top;text-align:right!important;border-bottom:1px solid #a3bad9;font:normal 10px arial,helvetica,tahoma,sans-serif;color:#233d6d;cursor:default;padding:0;border-collapse:separate;}
+.x-date-inner th span{display:block;padding:2px;padding-right:7px;}
+.x-date-inner td{border:1px solid #fff;text-align:right;padding:0;}
+.x-date-inner a{padding:2px 5px;display:block;font:normal 11px arial,helvetica,tahoma,sans-serif;text-decoration:none;color:black;text-align:right;zoom:1;}
+.x-date-inner .x-date-active{cursor:pointer;color:black;}
+.x-date-inner .x-date-selected a{background:#dfecfb url(../images/default/shared/glass-bg.gif) repeat-x left top;border:1px solid #8db2e3;padding:1px 4px;}
+.x-date-inner .x-date-today a{border:1px solid darkred;padding:1px 4px;}
+.x-date-inner .x-date-selected span{font-weight:bold;}
+.x-date-inner .x-date-prevday a,.x-date-inner .x-date-nextday a{color:#aaa;text-decoration:none!important;}
+.x-date-bottom{padding:4px;border-top:1px solid #a3bad9;background:#dfecfb url(../images/default/shared/glass-bg.gif) repeat-x left top;}
+.x-date-inner a:hover,.x-date-inner .x-date-disabled a:hover{text-decoration:none!important;color:black;background:#ddecfe;}
+.x-date-inner .x-date-disabled a{cursor:default;background:#eee;color:#bbb;}
+.x-date-mmenu{background:#eee!important;}
+.x-date-mmenu .x-menu-item{font-size:10px;padding:1px 24px 1px 4px;white-space:nowrap;color:#000;}
+.x-date-mmenu .x-menu-item .x-menu-item-icon{width:10px;height:10px;margin-right:5px;background-position:center -4px!important;}
+.x-date-mp{position:absolute;left:0;top:0;background:white;display:none;}
+.x-date-mp td{padding:2px;font:normal 11px arial,helvetica,tahoma,sans-serif;}
+td.x-date-mp-month,td.x-date-mp-year,td.x-date-mp-ybtn{border:0 none;text-align:center;vertical-align:middle;width:25%;}
+.x-date-mp-ok{margin-right:3px;}
+.x-date-mp-btns button{text-decoration:none;text-align:center;text-decoration:none!important;background:#083772;color:white;border:1px solid;border-color:#36c #005 #005 #36c;padding:1px 3px 1px;font:normal 11px arial,helvetica,tahoma,sans-serif;cursor:pointer;}
+.x-date-mp-btns{background:#dfecfb url(../images/default/shared/glass-bg.gif) repeat-x left top;}
+.x-date-mp-btns td{border-top:1px solid #c5d2df;text-align:center;}
+td.x-date-mp-month a,td.x-date-mp-year a{display:block;padding:2px 4px;text-decoration:none;text-align:center;color:#15428b;}
+td.x-date-mp-month a:hover,td.x-date-mp-year a:hover{color:#15428b;text-decoration:none;cursor:pointer;background:#ddecfe;}
+td.x-date-mp-sel a{padding:1px 3px;background:#dfecfb url(../images/default/shared/glass-bg.gif) repeat-x left top;border:1px solid #8db2e3;}
+.x-date-mp-ybtn a{overflow:hidden;width:15px;height:15px;cursor:pointer;background:transparent url(../images/default/panel/tool-sprites.gif) no-repeat;display:block;margin:0 auto;}
+.x-date-mp-ybtn a.x-date-mp-next{background-position:0 -120px;}
+.x-date-mp-ybtn a.x-date-mp-next:hover{background-position:-15px -120px;}
+.x-date-mp-ybtn a.x-date-mp-prev{background-position:0 -105px;}
+.x-date-mp-ybtn a.x-date-mp-prev:hover{background-position:-15px -105px;}
+.x-date-mp-ybtn{text-align:center;}
+td.x-date-mp-sep{border-right:1px solid #c5d2df;}
+
+.x-menu{border:1px solid #718bb7;z-index:15000;background:#fff url(../images/default/menu/menu-bg.gif) repeat-y scroll 0 0;}
+.roo-ie .x-menu{zoom:1;overflow:hidden;}
+.x-menu-list{border:1px solid #fff;}
+.x-menu li{line-height:100%;}
+.x-menu li.x-menu-sep-li{font-size:1px;line-height:1px;}
+.x-menu-list-item{font:normal 11px tahoma,arial,sans-serif;white-space:nowrap;-moz-user-select:none;-khtml-user-select:none;display:block;padding:1px;}
+.x-menu-item-arrow{background:transparent url(../images/default/menu/menu-parent.gif) no-repeat right;}
+.x-menu-sep{display:block;font-size:1px;line-height:1px;height:1px;background:#c3daf9;margin:3px 3px 3px 32px;}
+.x-menu-focus{position:absolute;left:0;top:-5px;width:0;height:0;line-height:1px;}
+.x-menu-item{display:block;line-height:14px;padding:3px 21px 3px 3px;white-space:nowrap;text-decoration:none;color:#233d6d;-moz-outline:0 none;outline:0 none;cursor:pointer;}
+.x-menu-item-active{color:#233d6d;background:#c3daf9;border:1px solid #8BB8F3;padding:0;}
+.x-menu-item-icon{border:0 none;height:16px;padding:0;vertical-align:middle;width:16px;margin:0 11px 0 0;background-position:center;}
+.x-menu-check-item .x-menu-item-icon{
+        background:transparent url(../images/default/menu/chk-sprite.gif) no-repeat scroll 0 0;
+}
+.x-menu-item-checked .x-menu-item-icon{background-position: 0 -16px;}
+.x-menu-group-item .x-menu-item-icon{background:transparent;}
+.x-menu-item-checked .x-menu-group-item .x-menu-item-icon{background:transparent url(../images/default/menu/group-checked.gif) no-repeat center;}
+.x-menu-plain{background:#fff;}
+.x-menu-date-item{padding:0;}
+.x-menu .x-color-palette,.x-menu .x-date-picker{margin-left:32px;margin-right:4px;}
+.x-menu .x-date-picker{border:1px solid #a3bad9;margin-top:2px;margin-bottom:2px;}
+.x-menu-plain .x-color-palette,.x-menu-plain .x-date-picker{margin:0;border:0 none;}
+.x-date-menu{padding:0!important;}
+
+ .x-box-tl{background:transparent url(../images/default/box/corners.gif) no-repeat 0 0;zoom:1;}
+.x-box-tc{height:8px;background:transparent url(../images/default/box/tb.gif) repeat-x 0 0;overflow:hidden;}
+.x-box-tr{background:transparent url(../images/default/box/corners.gif) no-repeat right -8px;}
+.x-box-ml{background:transparent url(../images/default/box/l.gif) repeat-y 0;padding-left:4px;overflow:hidden;zoom:1;}
+.x-box-mc{background:#eee url(../images/default/box/tb.gif) repeat-x 0 -16px;padding:4px 10px;font-family:"Myriad Pro","Myriad Web","Tahoma","Helvetica","Arial",sans-serif;color:#393939;font-size:12px;}
+.x-box-mc h3{font-size:14px;font-weight:bold;margin:0 0 4 0;zoom:1;}
+.x-box-mr{background:transparent url(../images/default/box/r.gif) repeat-y right;padding-right:4px;overflow:hidden;}
+.x-box-bl{background:transparent url(../images/default/box/corners.gif) no-repeat 0 -16px;zoom:1;}
+.x-box-bc{background:transparent url(../images/default/box/tb.gif) repeat-x 0 -8px;height:8px;overflow:hidden;}
+.x-box-br{background:transparent url(../images/default/box/corners.gif) no-repeat right -24px;}
+.x-box-tl,.x-box-bl{padding-left:8px;overflow:hidden;}
+.x-box-tr,.x-box-br{padding-right:8px;overflow:hidden;}
+.x-box-blue .x-box-bl,.x-box-blue .x-box-br,.x-box-blue .x-box-tl,.x-box-blue .x-box-tr{background-image:url(../images/default/box/corners-blue.gif);}
+.x-box-blue .x-box-bc,.x-box-blue .x-box-mc,.x-box-blue .x-box-tc{background-image:url(../images/default/box/tb-blue.gif);}
+.x-box-blue .x-box-mc{background-color:#c3daf9;}
+.x-box-blue .x-box-mc h3{color:#17385b;}
+.x-box-blue .x-box-ml{background-image:url(../images/default/box/l-blue.gif);}
+.x-box-blue .x-box-mr{background-image:url(../images/default/box/r-blue.gif);}
+
+#x-debug-browser .x-tree .x-tree-node a span{color:#222297;font-size:12px;padding-top:2px;font-family:"courier","courier new";line-height:18px;}
+#x-debug-browser .x-tree a i{color:#FF4545;font-style:normal;}
+#x-debug-browser .x-tree a em{color:#999;}
+#x-debug-browser .x-tree .x-tree-node .x-tree-selected a span{background:#c3daf9;}
+#x-debug-browser pre,.x-debug-browser pre xmp{font:normal 11px tahoma,arial,helvetica,sans-serif!important;white-space:-moz-pre-wrap;white-space:-pre-wrap;white-space:-o-pre-wrap;word-wrap:break-word;}
+#x-debug-browser pre{display:block;padding:5px!important;border-bottom:1px solid #eee!important;}
+#x-debug-browser pre xmp{padding:0!important;margin:0!important;}
+#x-debug-console .x-layout-panel-center,#x-debug-inspector .x-layout-panel-center{border-right:1px solid #98c0f4;}
+#x-debug-console textarea{border:0 none;font-size:12px;font-family:"courier","courier new";padding-top:4px;padding-left:4px;}
+.x-debug-frame{background:#eee;border:1px dashed #aaa;}
+
+.x-combo-list{border:1px solid #98c0f4;background:#ddecfe;zoom:1;overflow:hidden;}
+.x-combo-list-inner{overflow:auto;background:white;position:relative;zoom:1;overflow-x:hidden;}
+.x-combo-list-hd{font:bold 11px tahoma,arial,helvetica,sans-serif;color:#15428b;background-image:url(../images/default/layout/panel-title-light-bg.gif);border-bottom:1px solid #98c0f4;padding:3px;}
+.x-resizable-pinned .x-combo-list-inner{border-bottom:1px solid #98c0f4;}
+.x-combo-list-item{font:normal 12px tahoma,arial,helvetica,sans-serif;padding:2px;border:1px solid #fff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;}
+.x-combo-list .x-combo-selected{background-color:#c3daf9!important;cursor:pointer;border:1px solid #369;}
+.x-combo-noedit{cursor:pointer;}
+.x-combo-list-small .x-combo-list-item{font:normal 11px tahoma,arial,helvetica,sans-serif;}
+
+
+
+.x-html-editor-wrap
+{
+    background-color:#fff;
+    border:1px solid #a3bac9;
+}
+
+.x-html-editor-wrap .x-form-textarea
+{
+    font-family : monospace;
+}
+.x-html-editor-tb .x-btn-text {
+    background:transparent url(../images/default/form/htmleditor.gif) no-repeat scroll 0% 0%;
+}
+.x-html-editor-tb  .x-btn-text { width: 18px; }
+/* all the rest are done with background offsets ( -16 height each one ) */
+
+
+.x-html-editor-tb .x-edit-bold .x-btn-text              { background-position: 0 0px; }
+.x-html-editor-tb .x-edit-italic .x-btn-text            { background-position: 0 -16px; } 
+.x-html-editor-tb .x-edit-underline .x-btn-text         { background-position: 0 -32px; } 
+.x-html-editor-tb .x-edit-increasefontsize .x-btn-text  { background-position: 0 -48px; } 
+.x-html-editor-tb .x-edit-decreasefontsize .x-btn-text  { background-position: 0 -64px; } 
+.x-html-editor-tb .x-edit-insertorderedlist .x-btn-text { background-position: 0 -80px; } 
+.x-html-editor-tb .x-edit-insertunorderedlist .x-btn-text { background-position: 0 -96px; } 
+.x-html-editor-tb .x-edit-justifyleft .x-btn-text       { background-position: 0 -112px; } 
+.x-html-editor-tb .x-edit-justifycenter .x-btn-text     { background-position: 0 -128px; } 
+.x-html-editor-tb .x-edit-justifyright .x-btn-text      { background-position: 0 -144px; } 
+
+.x-html-editor-tb .x-edit-forecolor .x-btn-text         { background-position: 0 -160px; } 
+.x-html-editor-tb .x-edit-backcolor .x-btn-text         { background-position: 0 -176px; } 
+.x-html-editor-tb .x-edit-sourceedit .x-btn-text        { background-position: 0 -192px; } 
+.x-html-editor-tb .x-edit-createlink .x-btn-text        { background-position: 0 -208px; } 
+.x-html-editor-tb .x-edit-none .x-btn-text             { background-position: 0 -400px; } 
+
+.x-html-editor-tb .x-toolbar .x-btn {
+    margin-left:0px;
+    margin-right:0px;
+}
+  
+
+/*
+.x-html-editor-wrap{border:1px solid #a9bfd3;background:white;}
+.x-html-editor-tb .x-btn-text{background:transparent url(../images/default/editor/tb-sprite.gif) no-repeat;}
+.x-html-editor-tb .x-edit-bold .x-btn-text{background-position:0 0;}
+.x-html-editor-tb .x-edit-italic .x-btn-text{background-position:-16px 0;}
+.x-html-editor-tb .x-edit-underline .x-btn-text{background-position:-32px 0;}
+.x-html-editor-tb .x-edit-forecolor .x-btn-text{background-position:-160px 0;}
+.x-html-editor-tb .x-edit-backcolor .x-btn-text{background-position:-176px 0;}
+.x-html-editor-tb .x-edit-justifyleft .x-btn-text{background-position:-112px 0;}
+.x-html-editor-tb .x-edit-justifycenter .x-btn-text{background-position:-128px 0;}
+.x-html-editor-tb .x-edit-justifyright .x-btn-text{background-position:-144px 0;}
+.x-html-editor-tb .x-edit-insertorderedlist .x-btn-text{background-position:-80px 0;}
+.x-html-editor-tb .x-edit-insertunorderedlist .x-btn-text{background-position:-96px 0;}
+.x-html-editor-tb .x-edit-increasefontsize .x-btn-text{background-position:-48px 0;}
+.x-html-editor-tb .x-edit-decreasefontsize .x-btn-text{background-position:-64px 0;}
+.x-html-editor-tb .x-edit-sourceedit .x-btn-text{background-position:-192px 0;}
+.x-html-editor-tb .x-edit-createlink .x-btn-text{background-position:-208px 0;}
+.x-html-editor-tip .x-tip-bd .x-tip-bd-inner{padding:5px;padding-bottom:1px;}
+.x-html-editor-tb .x-toolbar{position:static!important;}
+*/
+
+
+
+
+/** ---- for column tree --- */
+
+.x-column-tree .x-tree-node { zoom:1;  }
+.x-column-tree .x-tree-node-el { 
+    border-bottom:1px solid #eee; 
+    border-right: 1px solid #ccc;
+    zoom:1;
+}
+.x-column-tree .x-tree-selected {
+    background: #d9e8fb;
+}
+.x-column-tree  .x-tree-node a {
+    line-height:18px;
+    vertical-align:middle;
+}
+
+.x-column-tree  .x-tree-node .x-tree-selected a span{
+       background:transparent;
+       color:#000;
+}
+.x-column-tree .x-tree-col {
+    float:left;
+    overflow:hidden;
+    padding:0;    
+    border-left: 1px solid #ccc;
+    height: 18px;
+    zoom:1;
+}
+
+.x-column-tree .x-tree-col-text,.x-column-tree  .x-tree-hd-text {
+    overflow:hidden;
+    -o-text-overflow: ellipsis;
+       text-overflow: ellipsis;
+    padding:3px 3px 3px 5px;
+    white-space: nowrap;
+    font:normal 11px arial, tahoma, helvetica, sans-serif;
+}
+
+.x-column-tree .x-tree-headers {
+    background: #EBEADB url(../images/gray/grid/grid-hrow.gif) repeat-x scroll 0 0;
+       cursor:default;
+    zoom:1;
+}
+
+.x-column-tree .x-tree-hd {
+    float:left;
+    overflow:hidden;
+    border-left:1px solid #eee;
+    border-right:1px solid #d0d0d0;
+}
+
diff --git a/cssX/xtheme-slate.css b/cssX/xtheme-slate.css
new file mode 100644 (file)
index 0000000..fc9b2a8
--- /dev/null
@@ -0,0 +1,700 @@
+
+/** tools buttons on new extjs are merged.. using x-tool.. 
+* we should move towards that!
+* */
+
+
+.x-dlg .x-dlg-collapse,
+.x-dlg .x-dlg-close,
+.x-dlg-collapsed .x-dlg-collapse,
+.x-layout-tools-button,
+.x-layout-collapse-west, .x-layout-expand-east 
+{
+    background-image:url("../images/slate/panel/tool-sprites.gif");
+}
+
+
+.x-layout-collapse-west, .x-layout-expand-east {
+    background-position: 0 -180px;
+}
+.x-layout-tools-button-over .x-tool-collapse-west {
+    background-position: -15px -180px;
+}
+
+
+
+.x-panel {\r
+    border-style: solid;\r
+    border-color: #abc;\r
+}
+/* .x-panel-header */\r
+.x-layout-panel-hd {\r
+    color:#fafafa;\r
+       border:1px solid #abc;\r
+    background-image:url(../images/slate/panel/white-top-bottom.gif);\r
+}
+
+
+
+
+\r
+\r
+.x-panel-body {\r
+    border-color:#abc;\r
+}\r
+\r
+.x-panel-bbar .x-toolbar {\r
+    border-color:#abc;\r
+}\r
+\r
+.x-panel-tbar .x-toolbar {\r
+    border-color:#abc;\r
+}\r
+\r
+.x-panel-tbar-noheader .x-toolbar, .x-panel-mc .x-panel-tbar .x-toolbar {\r
+    border-color:#abc;\r
+}\r
+.x-panel-body-noheader, .x-panel-mc .x-panel-body {\r
+    border-color:#abc;\r
+}\r
+.x-panel-tl .x-panel-header {\r
+    color:#f4f4f4;\r
+}\r
+.x-panel-tc { background-image:url(../images/slate/panel/top-bottom.gif); }\r
+.x-panel-tl { background-image:url(../images/slate/panel/corners-sprite.gif); border-color:#abc;}\r
+.x-panel-tr { background-image:url(../images/slate/panel/corners-sprite.gif); }\r
+.x-panel-bc { background-image:url(../images/slate/panel/top-bottom.gif); }\r
+.x-panel-bl { background-image:url(../images/slate/panel/corners-sprite.gif); }\r
+.x-panel-br { background-image:url(../images/slate/panel/corners-sprite.gif); }\r
+.x-panel-mc { background:#eef4f8; }\r
+
+.x-panel-mc .x-panel-body {\r
+    background:transparent;\r
+    border: 0 none;\r
+}\r
+.x-panel-ml { background-image:url(../images/slate/panel/left-right.gif); }\r
+.x-panel-mr { background-image:url(../images/slate/panel/left-right.gif); }\r
+\r
+.x-panel-dd-spacer{\r
+       border:2px dashed #89a;\r
+}\r
+\r
+\r
+/* Tools */\r
+.x-tool {\r
+    background-image:url(../images/slate/panel/tool-sprites.gif);\r
+}\r
+\r
+/* Ghosting */\r
+.x-panel-ghost {\r
+    background:#e0e0e0;\r
+}\r
+\r
+.x-panel-ghost ul {\r
+    border-color:#b0b0b0;\r
+}\r
+\r
+.x-grid-panel .x-panel-mc .x-panel-body {\r
+    border:1px solid #abc;\r
+}\r
+\r
+/* Buttons */\r
+\r
+.x-btn-left{\r
+       background-image:url(../images/slate/button/btn-sprite.gif);\r
+}\r
+.x-btn-right{\r
+       background-image:url(../images/slate/button/btn-sprite.gif);\r
+}\r
+.x-btn-center{\r
+       background-image:url(../images/slate/button/btn-sprite.gif);\r
+}\r
+.x-btn-over button{\r
+       color:#fff;\r
+}\r
+.x-btn-focus button{\r
+       color:#fff;\r
+}\r
+.x-btn-text-icon .x-btn-with-menu .x-btn-center em {\r
+       background:transparent url(../images/slate/toolbar/btn-arrow.gif) no-repeat scroll right 3px;\r
+}\r
+.x-btn-with-menu .x-btn-center em {\r
+       background:transparent url(../images/slate/toolbar/btn-arrow.gif) no-repeat scroll right 0pt;\r
+}\r
+.x-btn-menu-arrow-wrap .x-btn-center button{\r
+       background:transparent url(../images/slate/button/btn-arrow.gif) no-repeat left 3px;\r
+}\r
+\r
+\r
+/* Layout classes */\r
+\r
+.x-border-layout-ct {\r
+    background:#f0f0f0;\r
+}\r
+\r
+.x-accordion-hd {\r
+       background-image:url(../images/slate/panel/light-hd.gif);\r
+}\r
+\r
+.x-layout-collapsed{\r
+    background-color:#567;\r
+    border-color:#e0e0e0;\r
+}\r
+.x-layout-collapsed-over{\r
+        background-color:#789;\r
+}\r
+\r
+\r
+\r
+/* Toolbars */\r
+\r
+.x-toolbar{\r
+       border-color:#abc;\r
+    background:#f0f4f5 url(../images/slate/toolbar/bg.gif) repeat-x top left;\r
+}\r
+.x-toolbar button {\r
+    color:#f4f4f4;\r
+}\r
+.x-toolbar .ytb-text {\r
+       color:white;\r
+}\r
+.x-toolbar .x-btn-menu-arrow-wrap .x-btn-center button {\r
+    background-image:url(../images/slate/toolbar/btn-arrow.gif);\r
+}\r
+.x-toolbar .x-btn-text-icon .x-btn-menu-arrow-wrap .x-btn-center button {\r
+    background-image:url(../images/slate/toolbar/btn-arrow.gif);\r
+}\r
+.x-toolbar .x-btn-over .x-btn-left{\r
+       background-image:url(../images/slate/toolbar/tb-btn-sprite.gif);\r
+}\r
+.x-toolbar .x-btn-over .x-btn-right{\r
+       background-image:url(../images/slate/toolbar/tb-btn-sprite.gif);\r
+}\r
+.x-toolbar .x-btn-over .x-btn-center{\r
+       background-image:url(../images/slate/toolbar/tb-btn-sprite.gif);\r
+}\r
+.x-toolbar .x-btn-over button {\r
+    color:#fff;\r
+}\r
+.x-toolbar .x-btn-click .x-btn-left, .x-toolbar .x-btn-pressed .x-btn-left, .x-toolbar .x-btn-menu-active .x-btn-left{\r
+       background-image:url(../images/slate/toolbar/tb-btn-sprite.gif);\r
+}\r
+.x-toolbar .x-btn-click .x-btn-right, .x-toolbar .x-btn-pressed .x-btn-right, .x-toolbar .x-btn-menu-active .x-btn-right{\r
+       background-image:url(../images/slate/toolbar/tb-btn-sprite.gif);\r
+}\r
+\r
+.x-toolbar .x-btn-click .x-btn-center, .x-toolbar .x-btn-pressed .x-btn-center, .x-toolbar .x-btn-menu-active .x-btn-center{\r
+       background-image:url(../images/slate/toolbar/tb-btn-sprite.gif);\r
+}\r
+.x-toolbar .ytb-sep {\r
+       background-image: url(../images/slate/grid/grid-split.gif);\r
+}\r
+\r
+/* Menus */\r
+\r
+.x-menu{\r
+       border:1px solid #aaa;\r
+       background:#f0f0f0 url(../images/slate/menu/menu.gif) repeat-y;\r
+}\r
+.x-menu-item-active{\r
+       background:#ebf3fd url(../images/slate/menu/item-over.gif) repeat-x left bottom;\r
+       border:1px solid #c2cbd2;\r
+}\r
+.x-menu-item-arrow{\r
+       background:transparent url(../images/slate/menu/menu-parent.gif) no-repeat right;\r
+}\r
+\r
+\r
+/* Tabs */\r
+\r
+.x-tab-panel-header, .x-tab-panel-footer {\r
+       \r
+       background: #6b869f;\r
+       border-color:#4f657b;\r
+}\r
+\r
+\r
+.x-tab-panel-header {\r
+       border-color:#abc;\r
+}\r
+\r
+.x-tab-panel-footer {\r
+       border-color:#abc;\r
+}\r
+\r
+ul.x-tab-strip-top{\r
+       background:#dbdbdb url(../images/slate/tabs/tab-strip-bg.gif) repeat-x left top;\r
+       border-color:#4c647e;\r
+    padding-top: 2px;\r
+}\r
+\r
+ul.x-tab-strip-bottom{\r
+       background-image:url(../images/slate/tabs/tab-strip-btm-bg.gif);\r
+       border-color:#566c82;\r
+}\r
+\r
+.x-tab-strip span.x-tab-strip-text {\r
+       color:#333;\r
+}\r
+.x-tab-strip-over span.x-tab-strip-text {\r
+       color:#111;\r
+}\r
+\r
+.x-tab-strip-active span.x-tab-strip-text {\r
+       color:#fff;\r
+}\r
+\r
+.x-tab-strip-disabled .x-tabs-text {\r
+       color:#aaaaaa;\r
+}\r
+\r
+.x-tab-strip-top .x-tab-right {\r
+       background-image:url(../images/slate/tabs/tabs-sprite.gif);\r
+}\r
+\r
+.x-tab-strip-top .x-tab-left {\r
+       background-image:url(../images/slate/tabs/tabs-sprite.gif);\r
+}\r
+.x-tab-strip-top .x-tab-strip-inner {\r
+       background-image:url(../images/slate/tabs/tabs-sprite.gif);\r
+}\r
+\r
+.x-tab-strip-bottom .x-tab-right {\r
+       background-image:url(../images/slate/tabs/tab-btm-inactive-right-bg.gif);\r
+}\r
+\r
+.x-tab-strip-bottom .x-tab-left {\r
+       background-image:url(../images/slate/tabs/tab-btm-inactive-left-bg.gif);\r
+}\r
+\r
+.x-tab-strip-bottom .x-tab-strip-active .x-tab-right {\r
+       background-image:url(../images/slate/tabs/tab-btm-right-bg.gif);\r
+}\r
+\r
+.x-tab-strip-bottom .x-tab-strip-active .x-tab-left {\r
+       background-image:url(../images/slate/tabs/tab-btm-left-bg.gif);\r
+}\r
+\r
+.x-tab-strip .x-tab-strip-closable a.x-tab-strip-close {\r
+       background-image:url(../images/slate/tabs/tab-close.gif);\r
+}\r
+.x-tab-strip .x-tab-strip-closable a.x-tab-strip-close:hover{\r
+       background-image:url(../images/slate/tabs/tab-close.gif);\r
+}\r
+\r
+.x-tab-panel-body {\r
+    border-color:#abc;\r
+    background:#fff;\r
+}\r
+.x-tab-panel-bbar .x-toolbar {\r
+    border-color: #abc;\r
+}\r
+\r
+.x-tab-panel-tbar .x-toolbar {\r
+    border-color: #abc;\r
+}\r
+\r
+.x-tab-panel-header-plain .x-tab-strip-spacer {\r
+    border-color:#abc;\r
+       background: #6b869f;\r
+}\r
+\r
+.x-tab-scroller-left {\r
+    background-image: url(../images/slate/tabs/scroll-left.gif);\r
+    border-color:#aeaeae;\r
+}\r
+.x-tab-scroller-right {\r
+    background-image: url(../images/slate/tabs/scroll-right.gif);\r
+    border-color:#aeaeae;\r
+}\r
+\r
+/* Window */\r
+
+
+\r
+.x-window-proxy {\r
+    background:#e4e8ec;\r
+    border-color:#abc;\r
+}\r
+\r
+.x-window-tl .x-window-header {\r
+    color:#fafafa;\r
+}\r
+.x-window-tc {\r
+       background-image:url(../images/slate/window/top-bottom.png);\r
+}
+.x-dlg .x-dlg-hd-left {
+    background-image:url(../images/slate/window/left-corners.png);
+}   \r
+.x-window-tl {\r
+       background-image:url(../images/slate/window/left-corners.png);\r
+}\r
+.x-window-tr {\r
+       background-image:url(../images/slate/window/right-corners.png);\r
+}\r
+.x-window-bc {\r
+       background-image:url(../images/slate/window/top-bottom.png);\r
+}
+
+.x-dlg .x-dlg-hd {
+    background: url("../images/slate/window/top-bottom.png") repeat-x scroll 0 0 #e4e8ec;
+    color:#fafafa;
+    border-color:#abc;
+}
+
+\r
+.x-window-bl {\r
+       background-image:url(../images/slate/window/left-corners.png);\r
+}\r
+.x-window-br {\r
+       background-image:url(../images/slate/window/right-corners.png);\r
+}\r
+.x-window-mc {\r
+    border:1px solid #abc;\r
+    background:#e8e8e8;\r
+}\r
+\r
+.x-window-ml {\r
+       background-image:url(../images/slate/window/left-right.png);\r
+}\r
+.x-window-mr {\r
+       background-image:url(../images/slate/window/left-right.png);\r
+}\r
+.x-panel-ghost .x-window-tl {\r
+    border-color:#abc;\r
+}\r
+.x-panel-collapsed .x-window-tl {\r
+    border-color:#abc;\r
+}\r
+\r
+.x-window-plain .x-window-mc {\r
+    background: #e8e8e8;\r
+    border-right:1px solid #eee;\r
+    border-bottom:1px solid #eee;\r
+    border-top:1px solid #abc;\r
+    border-left:1px solid #abc;\r
+}\r
+\r
+.x-window-plain .x-window-body {\r
+    border-left:1px solid #ddd;\r
+    border-top:1px solid #ddd;\r
+    border-bottom:1px solid #abc;\r
+    border-right:1px solid #abc;\r
+    background:transparent !important;\r
+}\r
+\r
+body.x-body-masked .x-window-mc, body.x-body-masked .x-window-plain .x-window-mc {\r
+    background-color: #eceef0;\r
+}\r
+\r
+\r
+/* HTML Editor */\r
+.x-html-editor-wrap {\r
+    border-color:#abc;\r
+}
+/* FIXME\r
+.x-html-editor-tb .x-btn-text {\r
+       background:transparent url(../images/slate/editor/tb-sprite.gif) no-repeat scroll 0%;\r
+}
+*/\r
+\r
+\r
+/* Borders go last for specificity */\r
+.x-panel-noborder .x-panel-body-noborder {\r
+    border-width:0;\r
+}\r
+\r
+.x-panel-noborder .x-panel-header-noborder {\r
+    border-width:0;\r
+    border-bottom:1px solid #abc;\r
+}\r
+\r
+.x-panel-noborder .x-panel-tbar-noborder .x-toolbar {\r
+    border-width:0;\r
+    border-bottom:1px solid #abc;\r
+}\r
+\r
+.x-panel-noborder .x-panel-bbar-noborder .x-toolbar {\r
+    border-width:0;\r
+    border-top:1px solid #abc;\r
+}\r
+\r
+.x-window-noborder .x-window-mc {\r
+    border-width:0;\r
+}\r
+.x-window-plain .x-window-body-noborder {\r
+    border-width:0;\r
+}\r
+\r
+.x-tab-panel-noborder .x-tab-panel-body-noborder {\r
+       border-width:0;\r
+}\r
+\r
+.x-tab-panel-noborder .x-tab-panel-header-noborder {\r
+       border-top-width:0;\r
+       border-left-width:0;\r
+       border-right-width:0;\r
+}\r
+\r
+.x-tab-panel-noborder .x-tab-panel-footer-noborder {\r
+       border-bottom-width:0;\r
+       border-left-width:0;\r
+       border-right-width:0;\r
+}\r
+\r
+\r
+.x-tab-panel-bbar-noborder .x-toolbar {\r
+    border-width:0;\r
+    border-top:1px solid #abc;\r
+}\r
+\r
+.x-tab-panel-tbar-noborder .x-toolbar {\r
+    border-width:0;\r
+    border-bottom:1px solid #abc;\r
+}\r
+\r
+/* Forms */\r
+.x-form-text, textarea.x-form-field {\r
+       border:1px solid #9ab; \r
+}\r
+.x-trigger-wrap-focus .x-form-trigger {\r
+       border-bottom:1px solid #4a7192;\r
+}\r
+.x-form-focus,textarea.x-form-focus {\r
+       border:1px solid #4a7192;\r
+}\r
+\r
+.x-form-field-wrap .x-form-trigger {\r
+       background:transparent url(../images/slate/form/trigger.gif) no-repeat 0 0;\r
+}\r
+.x-form-field-wrap .x-form-date-trigger {\r
+       background-image:url(../images/slate/form/date-trigger.gif);\r
+}\r
+.x-form-field-wrap .x-form-clear-trigger {\r
+       background-image:url(../images/slate/form/clear-trigger.gif);\r
+}\r
+.x-form-field-wrap .x-form-search-trigger {\r
+       background-image:url(../images/slate/form/search-trigger.gif);\r
+}\r
+\r
+.x-form-field-wrap .x-form-trigger {\r
+       border-bottom:1px solid #778899;\r
+}\r
+\r
+.x-form fieldset legend {\r
+       color:#333;\r
+}\r
+\r
+/*     the following need to be duplicated from ext-all.js,\r
+       otherwise hover effects are broken */\r
+.x-form-field-wrap .x-form-trigger-over{background-position:-17px 0;}\r
+.x-form-field-wrap .x-form-trigger-click{background-position:-34px 0;}\r
+.x-trigger-wrap-focus .x-form-trigger{background-position:-51px 0;}\r
+.x-trigger-wrap-focus .x-form-trigger-over{background-position:-68px 0;}\r
+.x-trigger-wrap-focus .x-form-trigger-click{background-position:-85px 0;}\r
+\r
+\r
+/* Grid */\r
+\r
+.x-grid3-row-selected {\r
+       background:#fbf0d2;\r
+       border:1px dotted #ccc;\r
+}\r
+.x-grid3-hd-btn{\r
+       background:#f2daa9 url(../images/slate/grid/grid3-hd-btn.gif) no-repeat left center;\r
+}\r
+.x-grid3-header{\r
+       background:#f9f9f9 url(../images/slate/grid/grid3-hrow.gif) repeat-x 0 bottom;\r
+}\r
+td.x-grid3-hd-over .x-grid3-hd-inner,td.sort-desc .x-grid3-hd-inner,td.sort-asc .x-grid3-hd-inner,td.x-grid3-hd-menu-open .x-grid3-hd-inner{\r
+       background:#ebf3fd url(../images/slate/grid/grid3-hrow-over.gif) repeat-x left bottom;\r
+}\r
+.sort-asc .x-grid3-sort-icon{\r
+       background-image:url(../images/slate/grid/sort_asc.gif);\r
+}\r
+.sort-desc .x-grid3-sort-icon{\r
+       background-image:url(../images/slate/grid/sort_desc.gif);\r
+}\r
+td.x-grid3-hd-over, td.sort-desc, td.sort-asc, td.x-grid3-hd-menu-open {\r
+       border-left:1px solid #fff;\r
+       border-right:1px solid #ccc;\r
+}\r
+.x-grid3-cell-selected{\r
+       background-color:#e0eaee!important;\r
+}\r
+.x-grid3-body .x-grid3-td-expander{\r
+       background:transparent url(../images/slate/grid/grid3-special-col-bg.gif) repeat-y right;\r
+}\r
+.x-grid3-body .x-grid3-td-checker{\r
+       background:transparent url(../images/slate/grid/grid3-special-col-bg.gif) repeat-y right;\r
+}\r
+.x-grid3-body .x-grid3-td-numberer{\r
+       background:transparent url(../images/slate/grid/grid3-special-col-bg.gif) repeat-y right;\r
+}\r
+.x-grid3-body .x-grid3-row-selected .x-grid3-td-numberer,.x-grid3-body .x-grid3-row-selected .x-grid3-td-checker,.x-grid3-body .x-grid3-row-selected .x-grid3-td-expander{\r
+       background:transparent url(../images/slate/grid/grid3-special-col-sel-bg.gif) repeat-y right;\r
+}\r
+.x-grid-group-hd {\r
+       border-bottom:2px solid #abb;\r
+}\r
+.x-grid-group-hd div {\r
+       color: #456;\r
+}\r
+.x-dd-drag-proxy .x-grid3-hd-inner{\r
+       background:#ebf3fd url(../images/slate/grid/grid3-hrow-over.gif) repeat-x left bottom;\r
+       border:1px solid #abc;\r
+}\r
+.x-tbar-page-first{\r
+       background-image:url(../images/slate/grid/page-first.gif)!important;\r
+}\r
+.x-tbar-page-last{\r
+       background-image:url(../images/slate/grid/page-last.gif)!important;\r
+}\r
+.x-tbar-page-next{\r
+       background-image:url(../images/slate/grid/page-next.gif)!important;\r
+}\r
+.x-tbar-page-prev{\r
+       background-image:url(../images/slate/grid/page-prev.gif)!important;\r
+}\r
+.x-paging-info {\r
+       color:#FFFFFF;\r
+}\r
+\r
+\r
+/* Progress Bar */\r
+\r
+.x-progress-bar{\r
+       background:#9CBFEE url( ../../resources/images/slate/progress/progress-bg.gif ) repeat-x left center;\r
+       border-top:1px solid #ddd;\r
+       border-bottom:1px solid #ddd;\r
+}\r
+\r
+\r
+/* Combos */\r
+.x-combo-list{\r
+       border:1px solid #89a;\r
+}\r
+.x-combo-list .x-combo-selected{\r
+       border:1px dotted #ccc!important;\r
+       background:#fbf0d2;\r
+}\r
+\r
+\r
+/* Calendars */\r
+\r
+.x-date-middle,.x-date-left,.x-date-right{\r
+       background:url(../images/slate/shared/hd-sprite.gif) repeat-x 0 -83px;\r
+}\r
+.x-date-bottom {\r
+       background:#DFECFB url(../images/slate/shared/glass-bg.gif) repeat-x scroll left top;\r
+       border-top:1px solid #abc;\r
+}\r
+.x-date-right a{\r
+       background-image:url(../images/slate/shared/right-btn.gif);\r
+}\r
+.x-date-left a{\r
+       background-image:url(../images/slate/shared/left-btn.gif);\r
+}\r
+.x-date-inner th{\r
+       background:#dfecfb url(../images/slate/shared/glass-bg.gif) repeat-x left top;\r
+       border-bottom:1px solid #abc;\r
+       color:#345;\r
+}\r
+.x-date-inner .x-date-selected a {\r
+       background:#dfecfb url(../images/slate/shared/glass-bg.gif) repeat-x scroll left top;\r
+       border:1px solid #89a;\r
+}\r
+.x-date-inner a:hover,.x-date-inner .x-date-disabled a:hover{\r
+       background:#cfdce1;\r
+}\r
+td.x-date-mp-month a:hover,td.x-date-mp-year a:hover{\r
+       color:#123;\r
+       background:#cfdce1;\r
+}\r
+.x-date-mp-ybtn a{\r
+       background:transparent url(../images/slate/panel/tool-sprites.gif) no-repeat;\r
+}\r
+.x-date-mp-btns {\r
+       background:#dfecfb url(../images/slate/shared/glass-bg.gif) repeat-x scroll left top;\r
+}\r
+td.x-date-mp-sel a{\r
+       background:#dfecfb url(../images/slate/shared/glass-bg.gif) repeat-x left top;\r
+       border:1px solid #abc;\r
+}\r
+.x-date-mp-btns button{\r
+       background:#405574;\r
+       border:1px solid;\r
+       border-color:#abc #055 #055 #abc;\r
+}\r
+\r
+/* Resizable Handle */\r
+.x-resizable-over .x-resizable-handle-east,.x-resizable-pinned .x-resizable-handle-east{\r
+       background:url(../images/slate/sizer/e-handle.gif);background-position:left;\r
+}\r
+.x-resizable-over .x-resizable-handle-west,.x-resizable-pinned .x-resizable-handle-west{\r
+       background:url(../images/slate/sizer/e-handle.gif);background-position:left;\r
+}\r
+.x-resizable-over .x-resizable-handle-south,.x-resizable-pinned .x-resizable-handle-south{\r
+       background:url(../images/slate/sizer/s-handle.gif);background-position:top;\r
+}\r
+.x-resizable-over .x-resizable-handle-north,.x-resizable-pinned .x-resizable-handle-north{\r
+       background:url(../images/slate/sizer/s-handle.gif);background-position:top;\r
+}\r
+.x-resizable-over .x-resizable-handle-southeast,.x-resizable-pinned .x-resizable-handle-southeast{\r
+       background:url(../images/slate/sizer/se-handle.gif);background-position:top left;\r
+}\r
+.x-resizable-over .x-resizable-handle-northwest,.x-resizable-pinned .x-resizable-handle-northwest{\r
+       background:url(../images/slate/sizer/nw-handle.gif);background-position:bottom right;\r
+}\r
+.x-resizable-over .x-resizable-handle-northeast,.x-resizable-pinned .x-resizable-handle-northeast{\r
+       background:url(../images/slate/sizer/ne-handle.gif);background-position:bottom left;\r
+}\r
+.x-resizable-over .x-resizable-handle-southwest,.x-resizable-pinned .x-resizable-handle-southwest{\r
+       background:url(../images/slate/sizer/sw-handle.gif);background-position:top right;\r
+}\r
+\r
+/* Tips */\r
+.x-tip .x-tip-close{\r
+       background-image:url(../images/slate/qtip/close.gif);\r
+}\r
+.x-tip .x-tip-tc{\r
+       background:transparent url(../images/slate/qtip/tip-sprite.gif) no-repeat 0 -62px;\r
+}\r
+.x-tip .x-tip-tl{\r
+       background:transparent url(../images/slate/qtip/tip-sprite.gif) no-repeat 0 0;\r
+}\r
+.x-tip .x-tip-tr{\r
+       background:transparent url(../images/slate/qtip/tip-sprite.gif) no-repeat right 0;\r
+}\r
+.x-tip .x-tip-bc{\r
+       background:transparent url(../images/slate/qtip/tip-sprite.gif) no-repeat 0 -121px;\r
+}\r
+.x-tip .x-tip-bl{\r
+       background:transparent url(../images/slate/qtip/tip-sprite.gif) no-repeat 0 -59px;\r
+}\r
+.x-tip .x-tip-br{\r
+       background:transparent url(../images/slate/qtip/tip-sprite.gif) no-repeat right -59px;\r
+}\r
+.x-tip .x-tip-ml{\r
+       background:#fff url(../images/slate/qtip/tip-sprite.gif) no-repeat 0 -124px;\r
+}\r
+.x-tip .x-tip-mr{\r
+       background:transparent url(../images/slate/qtip/tip-sprite.gif) no-repeat right -124px;\r
+}\r
+.x-form-invalid-tip .x-tip-tc{background:url(../images/default/form/error-tip-corners.gif) repeat-x 0 -12px;padding-top:6px;}\r
+.x-form-invalid-tip .x-tip-tl{background-image:url(../images/default/form/error-tip-corners.gif);}\r
+.x-form-invalid-tip .x-tip-tr{background-image:url(../images/default/form/error-tip-corners.gif);}\r
+.x-form-invalid-tip .x-tip-bc{background:url(../images/default/form/error-tip-corners.gif) repeat-x 0 -18px;height:6px;}\r
+.x-form-invalid-tip .x-tip-bl{background:url(../images/default/form/error-tip-corners.gif) no-repeat 0 -6px;}\r
+.x-form-invalid-tip .x-tip-br{background:url(../images/default/form/error-tip-corners.gif) no-repeat right -6px;}\r
+.x-form-invalid-tip .x-tip-ml{background-image:url(../images/default/form/error-tip-corners.gif);}\r
+.x-form-invalid-tip .x-tip-mr{background-image:url(../images/default/form/error-tip-corners.gif);}\r
+\r
+\r
+\r
+\r
+/* Miscellaneous */\r
+\r
+.x-item-disabled * {\r
+       color:#333 !important;\r
+}\r
diff --git a/examples/dialog/blog.html b/examples/dialog/blog.html
new file mode 100644 (file)
index 0000000..046b17b
--- /dev/null
@@ -0,0 +1,83 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">\r
+<html>\r
+<head>\r
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">\r
+<title>Comment Dialog Example</title>\r
+    <link rel="stylesheet" type="text/css" href="../../cssX/roojs-all.css"/>
+    <link rel="stylesheet" type="text/css" href="../../cssX/xtheme-slate.css"/>
+
+     <script type="text/javascript" src="../../roojs-all.js"></script>   
+  \r
+<script type="text/javascript" src="post.js"></script>\r
+<link rel="stylesheet" type="text/css" href="post.css" />\r
+\r
+</head>\r
+<body>\r
+<script type="text/javascript" src="../examples.js"></script><!-- EXAMPLES -->\r
+   <div class="post">\r
+        <h2>Comment Dialog Example</h2>\r
+        <div id="comment-box">\r
+        <ul>\r
+            <li><a id="post-comment" href="#">Post Comment</a></li>\r
+            <li><a id="view-comments" href="#">View Comments</a></li>\r
+        </ul>\r
+        </div>\r
+        <p>This is a more complex example that shows how to implement a comment dialog similar to the one on Jacks blog<a/>.\r
+          The dialog retrieves the comments in JSON format and renders them to the "View Comments" tab. The "Post Comment" tab posts the comment\r
+          to a file on the server that just returns a dummy response (not what you type in) in JSON format. The reason for the dummy response\r
+          is so the example can easily be dropped in whatever your environment is and work.</p>\r
+        <p>Note that the js is not minified so it is readable. See
+        <button type="button" onclick="RooDocs.viewSource.show('/post.js')">post.js</button>
+        and <button type="button" onclick="RooDocs.viewSource.show('/blog.html')">blog.html</button>
+        for the full source code.</p>\r
+        <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Sed metus nibh, sodales a, porta at, vulputate eget, dui. Pellentesque ut nisl. Maecenas tortor turpis, interdum non, sodales non, iaculis ac, lacus. Vestibulum auctor, tortor quis iaculis malesuada, libero lectus bibendum purus, sit amet tincidunt quam turpis vel lacus. In pellentesque nisl non sem. Suspendisse nunc sem, pretium eget, cursus a, fringilla vel, urna. Aliquam commodo ullamcorper erat. Nullam vel justo in neque porttitor laoreet. Aenean lacus dui, consequat eu, adipiscing eget, nonummy non, nisi. Morbi nunc est, dignissim non, ornare sed, luctus eu, massa. Vivamus eget quam. Vivamus tincidunt diam nec urna. Curabitur velit. Quisque dolor magna, ornare sed, elementum porta, luctus in, leo.</p>\r
+        <p>Donec quis dui. Sed imperdiet. Nunc consequat, est eu sollicitudin gravida, mauris ligula lacinia mauris, eu porta dui nisl in velit. Nam congue, odio id auctor nonummy, augue lectus euismod nunc, in tristique turpis dolor sed urna. Donec sit amet quam eget diam fermentum pharetra. Integer tincidunt arcu ut purus. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nulla blandit malesuada odio. Nam augue. Aenean molestie sapien in mi. Suspendisse tincidunt. Pellentesque tempus dui vitae sapien. Donec aliquam ipsum sit amet pede. Sed scelerisque mi a erat. Curabitur rutrum ullamcorper risus. Maecenas et lorem ut felis dictum viverra. Fusce sem. Donec pharetra nibh sit amet sapien.</p>\r
+        <p>Aenean ut orci sed ligula consectetuer pretium. Aliquam odio. Nam pellentesque enim. Nam tincidunt condimentum nisi. Maecenas convallis luctus ligula. Donec accumsan ornare risus. Vestibulum id magna a nunc posuere laoreet. Integer iaculis leo vitae nibh. Nam vulputate, mauris vitae luctus pharetra, pede neque bibendum tellus, facilisis commodo diam nisi eget lacus. Duis consectetuer pulvinar nisi. Cras interdum ultricies sem. Nullam tristique. Suspendisse elementum purus eu nisl. Nulla facilisi. Phasellus ultricies ullamcorper lorem. Sed euismod ante vitae lacus. Nam nunc leo, congue vehicula, luctus ac, tempus non, ante. Morbi suscipit purus a nulla. Sed eu diam.</p>\r
+        <p>Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Cras imperdiet felis id velit. Ut non quam at sem dictum ullamcorper. Vestibulum pharetra purus sed pede. Aliquam ultrices, nunc in varius mattis, felis justo pretium magna, eget laoreet justo eros id eros. Aliquam elementum diam fringilla nulla. Praesent laoreet sapien vel metus. Cras tempus, sapien condimentum dictum dapibus, lorem augue fringilla orci, ut tincidunt eros nisi eget turpis. Nullam nunc nunc, eleifend et, dictum et, pharetra a, neque. Ut feugiat. Aliquam erat volutpat. Donec pretium odio nec felis. Phasellus sagittis lacus eget sapien. Donec est. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae;</p>\r
+        <p>Vestibulum semper. Nullam non odio. Aliquam quam. Mauris eu lectus non nunc auctor ullamcorper. Sed tincidunt molestie enim. Phasellus lobortis justo sit amet quam. Duis nulla erat, varius a, cursus in, tempor sollicitudin, mauris. Aliquam mi velit, consectetuer mattis, consequat tristique, pulvinar ac, nisl. Aliquam mattis vehicula elit. Proin quis leo sed tellus scelerisque molestie. Quisque luctus. Integer mattis. Donec id augue sed leo aliquam egestas. Quisque in sem. Donec dictum enim in dolor. Praesent non erat. Nulla ultrices vestibulum quam.</p>\r
+        <p>Duis hendrerit, est vel lobortis sagittis, tortor erat scelerisque tortor, sed pellentesque sem enim id metus. Maecenas at pede. Nulla velit libero, dictum at, mattis quis, sagittis vel, ante. Phasellus faucibus rutrum dui. Cras mauris elit, bibendum at, feugiat non, porta id, neque. Nulla et felis nec odio mollis vehicula. Donec elementum tincidunt mauris. Duis vel dui. Fusce iaculis enim ac nulla. In risus.</p>\r
+        <p>Donec gravida. Donec et enim. Morbi sollicitudin, lacus a facilisis pulvinar, odio turpis dapibus elit, in tincidunt turpis felis nec libero. Nam vestibulum tempus ipsum. In hac habitasse platea dictumst. Nulla facilisi. Donec semper ligula. Donec commodo tortor in quam. Etiam massa. Ut tempus ligula eget tellus. Curabitur id velit ut velit varius commodo. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Nulla facilisi. Fusce ornare pellentesque libero. Nunc rhoncus. Suspendisse potenti. Ut consequat, leo eu accumsan vehicula, justo sem lobortis elit, ac sollicitudin ipsum neque nec ante.</p>\r
+        <p>Aliquam elementum mauris id sem. Vivamus varius, est ut nonummy consectetuer, nulla quam bibendum velit, ac gravida nisi felis sit amet urna. Aliquam nec risus. Maecenas lacinia purus ut velit. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Suspendisse sit amet dui vitae lacus fermentum sodales. Donec varius dapibus nisl. Praesent at velit id risus convallis bibendum. Aliquam felis nibh, rutrum nec, blandit non, mattis sit amet, magna. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Etiam varius dignissim nibh. Quisque id orci ac ante hendrerit molestie. Aliquam malesuada enim non neque.</p>\r
+    </div>\r
+    \r
+    <!-- comments dialog -->\r
+    <div id="comments-dlg" style="visibility:hidden;">\r
+        <div class="x-dlg-hd">Comments</div>\r
+        <div class="x-dlg-bd">\r
+            <div id="post-tab" class="x-dlg-tab" title="Post Comment">\r
+                <div class="inner-tab">\r
+                    <form action="" method="post" id="comment-form" onsubmit="return false;">\r
+                    <input id="postId" type="hidden" name="postId" value="1" />\r
+                    <p>\r
+                    <label for="author"><small>Name</small></label>\r
+                    <input class="textinput" type="text" name="author" id="author" value="" size="22" tabindex="1" />\r
+                    </p>\r
+\r
+                    <p><label for="email"><small>E-mail (will not be published)</small></label>\r
+                    <input class="textinput" type="text" name="email" id="email" value="" size="22" tabindex="2" />\r
+                    </p>\r
+\r
+                    <p><label for="url"><small>Website</small></label>\r
+                    <input class="textinput" type="text" name="url" id="url" value="" size="22" tabindex="3" />\r
+                    </p>\r
+                    <p>\r
+                    <label for="comment"><small>Comment</small></label>\r
+                    <textarea name="comment" id="comment" tabindex="4" cols="40" rows="10"></textarea>\r
+                    </p>\r
+                    </form>\r
+                </div>\r
+            </div>\r
+            <div id="view-tab" class="x-dlg-tab" title="View Comments">\r
+                <ul id="comments-list" class="inner-tab">\r
+                </ul>\r
+            </div>\r
+        </div>\r
+        <div class="x-dlg-ft">\r
+            <div id="dlg-msg">\r
+                <span id="post-error" class="posting-msg"><img src="images/warning.gif" width="16" height="16" align="absmiddle" />&nbsp;<span id="post-error-msg"></span></span>\r
+                <span id="post-wait" class="posting-msg"><img src="../../images/grid/loading.gif" width="16" height="16" align="absmiddle" />&nbsp;Posting Comment...</span>\r
+            </div>\r
+        </div>\r
+    </div>\r
+</body>\r
+</html>\r
diff --git a/examples/dialog/hello.html b/examples/dialog/hello.html
new file mode 100644 (file)
index 0000000..ff48f86
--- /dev/null
@@ -0,0 +1,61 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">\r
+<html>\r
+<head>\r
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">\r
+<title>Hello World Dialog Example</title>\r
+ <link rel="stylesheet" type="text/css" href="../../cssX/roojs-all.css"/>
+    <link rel="stylesheet" type="text/css" href="../../cssX/xtheme-slate.css"/>
+
+     <script type="text/javascript" src="../../roojs-all.js"></script>   
+  \r
+    <script language="javascript" src="hello.js"></script>\r
+\r
+<!-- Common Styles for the examples -->\r
+<link rel="stylesheet" type="text/css" href="../examples.css" />\r
+</head>\r
+<body>\r
+<script type="text/javascript" src="../examples.js"></script><!-- EXAMPLES -->\r
+\r
+<h1>Hello World Dialog</h1>\r
+<p>This example shows how to create a very simple modal BasicDialog with "autoTabs".</p>\r
+<input type="button" id="show-dialog-btn" value="Hello World" /><br /><br />\r
+<p>Note that the js is not minified so it is readable. See 
+<button type="button" onclick="RooDocs.viewSource.show('/hello.js')">hello.js</button>for the full source code.</p>\r
+Here's snapshot of the code that creates the dialog:\r
+<pre class="code"><code>dialog = new Roo.BasicDialog("hello-dlg", {\r
+        modal:true,\r
+        autoTabs:true,\r
+        width:500,\r
+        height:300,\r
+        shadow:true,\r
+        minWidth:300,\r
+        minHeight:300\r
+});\r
+dialog.addKeyListener(27, dialog.hide, dialog);\r
+dialog.addButton('Close', dialog.hide, dialog);\r
+dialog.addButton('Submit', dialog.hide, dialog).disable();\r
+</code></pre>\r
+\r
+    <!-- The dialog is created from existing markup.\r
+         The inline styles just hide it until it created and should be in a stylesheet -->\r
+    <div id="hello-dlg" style="visibility:hidden;position:absolute;top:0px;">\r
+    <div class="x-dlg-hd">Hello Dialog</div>\r
+    <div class="x-dlg-bd">\r
+        <!-- Auto create tab 1 -->\r
+        <div class="x-dlg-tab" title="Hello World 1">\r
+            <!-- Nested "inner-tab" to safely add padding -->\r
+            <div class="inner-tab">\r
+                 Hello...<br><br><br>\r
+            </div>\r
+        </div>\r
+        <!-- Auto create tab 2 -->\r
+        <div class="x-dlg-tab" title="Hello World 2">\r
+            <div class="inner-tab">\r
+            ... World!\r
+            </div>\r
+        </div>\r
+        </div>\r
+    </div>\r
+</div>\r
+</body>\r
+</html>\r
diff --git a/examples/dialog/hello.js b/examples/dialog/hello.js
new file mode 100644 (file)
index 0000000..8ff312a
--- /dev/null
@@ -0,0 +1,51 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+
+Roo.BLANK_IMAGE_URL  = "../../images/default/s.gif";
\r
+// create the HelloWorld application (single instance)\r
+var HelloWorld = function(){\r
+    // everything in this space is private and only accessible in the HelloWorld block\r
+    \r
+    // define some private variables\r
+    var dialog, showBtn;\r
+    \r
+    // return a public interface\r
+    return {\r
+        init : function(){\r
+             showBtn = Roo.get('show-dialog-btn');\r
+             // attach to click event\r
+             showBtn.on('click', this.showDialog, this);\r
+        },\r
+       \r
+        showDialog : function(){\r
+            if(!dialog){ // lazy initialize the dialog and only create it once\r
+                dialog = new Roo.BasicDialog("hello-dlg", { \r
+                        autoTabs:true,\r
+                        width:500,\r
+                        height:300,\r
+                        shadow:true,\r
+                        minWidth:300,\r
+                        minHeight:250,\r
+                        proxyDrag: true\r
+                });\r
+                dialog.addKeyListener(27, dialog.hide, dialog);\r
+                dialog.addButton('Submit', dialog.hide, dialog).disable();\r
+                dialog.addButton('Close', dialog.hide, dialog);\r
+            }\r
+            dialog.show(showBtn.dom);\r
+        }\r
+    };\r
+}();\r
+\r
+// using onDocumentReady instead of window.onload initializes the application\r
+// when the DOM is ready, without waiting for images and other resources to load\r
+Roo.onReady(HelloWorld.init, HelloWorld, true);
\ No newline at end of file
diff --git a/examples/dialog/images/comment-bg.gif b/examples/dialog/images/comment-bg.gif
new file mode 100644 (file)
index 0000000..b1b0416
Binary files /dev/null and b/examples/dialog/images/comment-bg.gif differ
diff --git a/examples/dialog/images/comment.gif b/examples/dialog/images/comment.gif
new file mode 100644 (file)
index 0000000..0c83f6a
Binary files /dev/null and b/examples/dialog/images/comment.gif differ
diff --git a/examples/dialog/images/warning.gif b/examples/dialog/images/warning.gif
new file mode 100644 (file)
index 0000000..806d4bc
Binary files /dev/null and b/examples/dialog/images/warning.gif differ
diff --git a/examples/dialog/layout.html b/examples/dialog/layout.html
new file mode 100644 (file)
index 0000000..229f433
--- /dev/null
@@ -0,0 +1,41 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">\r
+<html>\r
+<head>\r
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">\r
+<title>Layout Dialog Example</title>\r
+<link rel="stylesheet" type="text/css" href="../../cssX/roojs-all.css"/>
+    <link rel="stylesheet" type="text/css" href="../../cssX/xtheme-slate.css"/>
+
+     <script type="text/javascript" src="../../roojs-all.js"></script>   
+  \r
+<script language="javascript" src="layout.js"></script>\r
+\r
+<!-- Common Styles for the examples -->\r
+<link rel="stylesheet" type="text/css" href="../examples.css" />\r
+</head>\r
+<body>\r
+<script type="text/javascript" src="../examples.js"></script><!-- EXAMPLES -->\r
+<h1>Layout Dialog Example</h1>\r
+<p>This example shows how to create a modal dialog with an embedded BorderLayout using LayoutDialog.</p>\r
+<input type="button" id="show-dialog-btn" value="Show Dialog" /><br /><br />\r
+<p>Note that the js is not minified so it is readable. See 
+<button type="button" onclick="RooDocs.viewSource.show('/layout.js')">layout.js</button>
+ for the full source code.</p>\r
+\r
+    <!-- dialog is created from existing markup -->\r
+    <div id="hello-dlg" style="visibility:hidden;">\r
+           <div class="x-dlg-hd">Layout Dialog</div>\r
+           <div class="x-dlg-bd">\r
+               <div id="west" class="x-layout-inactive-content">\r
+                       West\r
+                   </div>\r
+                   <div id="center" class="x-layout-inactive-content" style="padding:10px;">\r
+                <p>This dialog has the Vista theme applied.</p>\r
+                <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Sed metus nibh, sodales a, porta at, vulputate eget, dui. Pellentesque ut nisl. Maecenas tortor turpis, interdum non, sodales non, iaculis ac, lacus. Vestibulum auctor, tortor quis iaculis malesuada, libero lectus bibendum purus, sit amet tincidunt quam turpis vel lacus. In pellentesque nisl non sem. Suspendisse nunc sem, pretium eget, cursus a, fringilla vel, urna. Aliquam commodo ullamcorper erat. Nullam vel justo in neque porttitor laoreet. Aenean lacus dui, consequat eu, adipiscing eget, nonummy non, nisi. Morbi nunc est, dignissim non, ornare sed, luctus eu, massa. Vivamus eget quam. Vivamus tincidunt diam nec urna. Curabitur velit. Quisque dolor magna, ornare sed, elementum porta, luctus in, leo.</p>\r
+               <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Sed metus nibh, sodales a, porta at, vulputate eget, dui. Pellentesque ut nisl. Maecenas tortor turpis, interdum non, sodales non, iaculis ac, lacus. Vestibulum auctor, tortor quis iaculis malesuada, libero lectus bibendum purus, sit amet tincidunt quam turpis vel lacus. In pellentesque nisl non sem. Suspendisse nunc sem, pretium eget, cursus a, fringilla vel, urna. Aliquam commodo ullamcorper erat. Nullam vel justo in neque porttitor laoreet. Aenean lacus dui, consequat eu, adipiscing eget, nonummy non, nisi. Morbi nunc est, dignissim non, ornare sed, luctus eu, massa. Vivamus eget quam. Vivamus tincidunt diam nec urna. Curabitur velit. Quisque dolor magna, ornare sed, elementum porta, luctus in, leo.</p>\r
+\r
+                   </div>\r
+           </div>\r
+       </div>\r
+</body>\r
+</html>\r
diff --git a/examples/dialog/layout.js b/examples/dialog/layout.js
new file mode 100644 (file)
index 0000000..0d79212
--- /dev/null
@@ -0,0 +1,80 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+Roo.BLANK_IMAGE_URL  = "../../images/default/s.gif";
\r
+// create the LayoutExample application (single instance)\r
+var LayoutExample = function(){\r
+    // everything in this space is private and only accessible in the HelloWorld block\r
+    \r
+    // define some private variables\r
+    var dialog, showBtn;\r
+    \r
+    var toggleTheme = function(){\r
+        Roo.get(document.body, true).toggleClass('xtheme-gray');\r
+    };\r
+    // return a public interface\r
+    return {\r
+        init : function(){\r
+             showBtn = Roo.get('show-dialog-btn');\r
+             // attach to click event\r
+             showBtn.on('click', this.showDialog, this);\r
+             \r
+        },\r
+        \r
+        showDialog : function(){\r
+            if(!dialog){ // lazy initialize the dialog and only create it once\r
+                dialog = new Roo.LayoutDialog("hello-dlg", { \r
+                        modal:true,\r
+                        width:600,\r
+                        height:400,\r
+                        shadow:true,\r
+                        minWidth:300,\r
+                        minHeight:300,\r
+                        proxyDrag: true,\r
+                        west: {\r
+                               split:true,\r
+                               initialSize: 150,\r
+                               minSize: 100,\r
+                               maxSize: 250,\r
+                               titlebar: true,\r
+                               collapsible: true,\r
+                               animate: true\r
+                           },\r
+                           center: {\r
+                               autoScroll:true,\r
+                               tabPosition: 'top',\r
+                               closeOnTab: true,\r
+                               alwaysShowTabs: true\r
+                           }\r
+                });\r
+                dialog.addKeyListener(27, dialog.hide, dialog);\r
+                dialog.addButton('Submit', dialog.hide, dialog);\r
+                dialog.addButton('Close', dialog.hide, dialog);\r
+                \r
+                var layout = dialog.getLayout();\r
+                layout.beginUpdate();\r
+                layout.add('west', new Roo.ContentPanel('west', {title: 'West'}));\r
+                   layout.add('center', new Roo.ContentPanel('center', {title: 'The First Tab'}));\r
+                // generate some other tabs\r
+                layout.add('center', new Roo.ContentPanel(Roo.id(), {\r
+                                        autoCreate:true, title: 'Another Tab', background:true}));\r
+                   layout.add('center', new Roo.ContentPanel(Roo.id(), {\r
+                                        autoCreate:true, title: 'Third Tab', closable:true, background:true}));\r
+                   layout.endUpdate();\r
+            }\r
+            dialog.show(showBtn.dom);\r
+        }\r
+    };\r
+}();\r
+\r
+// using onDocumentReady instead of window.onload initializes the application\r
+// when the DOM is ready, without waiting for images and other resources to load\r
+Roo.EventManager.onDocumentReady(LayoutExample.init, LayoutExample, true);
\ No newline at end of file
diff --git a/examples/dialog/msg-box.html b/examples/dialog/msg-box.html
new file mode 100644 (file)
index 0000000..dbfe345
--- /dev/null
@@ -0,0 +1,60 @@
+<html>\r
+<head>\r
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">\r
+<title>MessageBox</title>\r
+<link rel="stylesheet" type="text/css" href="../../cssX/roojs-all.css"/>
+    <link rel="stylesheet" type="text/css" href="../../cssX/xtheme-slate.css"/>
+
+     <script type="text/javascript" src="../../roojs-all.js"></script>   
+  \r
+    <script type="text/javascript" src="msg-box.js"></script>\r
+\r
+<!-- Common Styles for the examples -->\r
+<link rel="stylesheet" type="text/css" href="../examples.css" />\r
+</head>\r
+<body>\r
+<script type="text/javascript" src="../examples.js"></script><!-- EXAMPLES -->\r
+<h1>MessageBox Dialogs</h1>\r
+<p>The example shows how to use the MessageBox class. Some of the buttons have animations, some are normal.</p>\r
+<p>The js is not minified so it is readable. See 
+<button type="button" onclick="RooDocs.viewSource.show('/msg-box.js')">msg-box.js</button> and 
+<button type="button" onclick="RooDocs.viewSource.show('/msg-box.html')">msg-box.html</button>
+.</p>\r
+\r
+<p>\r
+    <b>Confirm</b><br />\r
+    Standard Yes/No dialog.\r
+    <button id="mb1">Show Me</button>\r
+</p>\r
+\r
+<p>\r
+    <b>Prompt</b><br />\r
+    Standard prompt dialog.\r
+    <button id="mb2">Show Me</button>\r
+</p>\r
+\r
+<p>\r
+    <b>Multi-line Prompt</b><br />\r
+    A multi-line prompt dialog.\r
+    <button id="mb3">Show Me</button>\r
+</p>\r
+\r
+<p>\r
+    <b>Yes/No/Cancel</b><br />\r
+    Standard Yes/No/Cancel dialog.\r
+    <button id="mb4">Show Me</button>\r
+</p>\r
+\r
+<p>\r
+    <b>Progress Dialog</b><br />\r
+    You can set a progress on a progress MessageBox.\r
+    <button id="mb6">Show Me</button>\r
+</p>\r
+\r
+<p>\r
+    <b>Alert</b><br />\r
+    Standard alert message dialog.\r
+    <button id="mb7">Show Me</button>\r
+</p>\r
+</body>\r
+</html>\r
diff --git a/examples/dialog/msg-box.js b/examples/dialog/msg-box.js
new file mode 100644 (file)
index 0000000..14843a5
--- /dev/null
@@ -0,0 +1,81 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+Roo.BLANK_IMAGE_URL  = "../../images/default/s.gif";
\r
+Roo.onReady(function(){\r
+    Roo.get('mb1').on('click', function(e){\r
+        Roo.MessageBox.confirm('Confirm', 'Are you sure you want to do that?', showResult);\r
+    });\r
+\r
+    Roo.get('mb2').on('click', function(e){\r
+        Roo.MessageBox.prompt('Name', 'Please enter your name:', showResultText);\r
+    });\r
+\r
+    Roo.get('mb3').on('click', function(e){\r
+        Roo.MessageBox.show({\r
+           title: 'Address',\r
+           msg: 'Please enter your address:',\r
+           width:300,\r
+           buttons: Roo.MessageBox.OKCANCEL,\r
+           multiline: true,\r
+           fn: showResultText,\r
+           animEl: 'mb3'\r
+       });\r
+    });\r
+\r
+    Roo.get('mb4').on('click', function(e){\r
+        Roo.MessageBox.show({\r
+           title:'Save Changes?',\r
+           msg: 'Your are closing a tab that has unsaved changes. Would you like to save your changes?',\r
+           buttons: Roo.MessageBox.YESNOCANCEL,\r
+           fn: showResult,\r
+           animEl: 'mb4'\r
+       });\r
+    });\r
+\r
+    Roo.get('mb6').on('click', function(){\r
+        Roo.MessageBox.show({\r
+           title: 'Please wait...',\r
+           msg: 'Initializing...',\r
+           width:240,\r
+           progress:true,\r
+           closable:false,\r
+           animEl: 'mb6'\r
+       });\r
+\r
+       // this hideous block creates the bogus progress\r
+       var f = function(v){\r
+            return function(){\r
+                if(v == 11){\r
+                    Roo.MessageBox.hide();\r
+                }else{\r
+                    Roo.MessageBox.updateProgress(v/10, 'Loading item ' + v + ' of 10...');\r
+                }\r
+           };\r
+       };\r
+       for(var i = 1; i < 12; i++){\r
+           setTimeout(f(i), i*1000);\r
+       }\r
+    });\r
+\r
+    Roo.get('mb7').on('click', function(){\r
+        Roo.MessageBox.alert('Status', 'Changes saved successfully.', showResult);\r
+    });\r
+\r
+\r
+    function showResult(btn){\r
+        Roo.example.msg('Button Click', 'You clicked the {0} button', btn);\r
+    };\r
+\r
+    function showResultText(btn, text){\r
+        Roo.example.msg('Button Click', 'You clicked the {0} button and entered the text "{1}".', btn, text);\r
+    };\r
+});
\ No newline at end of file
diff --git a/examples/dialog/post.css b/examples/dialog/post.css
new file mode 100644 (file)
index 0000000..e087755
--- /dev/null
@@ -0,0 +1,129 @@
+/*\r
+ * yui-ext\r
+ * Copyright(c) 2006, Jack Slocum.\r
+ */\r
+\r
+body{\r
+       font: normal 9pt verdana,tahoma,arial,helvetica;\r
+}\r
+.post{\r
+       padding:15px;\r
+}\r
+.post h2{\r
+       font:normal 22px times;\r
+       margin-bottom:10px;\r
+}\r
+.post p{\r
+       margin-bottom:10px;\r
+       line-height:18px;\r
+}\r
+\r
+.loading-indicator {\r
+       font-size:8pt;\r
+       background-image: url('../../images/grid/loading.gif');\r
+       background-repeat: no-repeat;\r
+       background-position: left;\r
+       padding-left:20px;\r
+       margin:5px;\r
+}\r
+\r
+/** Posting messages */\r
+.ydlg-ft{\r
+       position:relative;\r
+}\r
+\r
+#dlg-msg {\r
+       position:absolute;\r
+       left:0px;\r
+       top:0px;\r
+       width:40%;\r
+}\r
+.posting-msg{\r
+       display:none;\r
+       font:normal 8pt tahoma, arial;\r
+       color:black;\r
+}\r
+#post-error-msg{\r
+       color:red;\r
+}\r
+.active-msg{\r
+       display:block;\r
+}\r
+\r
+/** Comment Box (with links) */\r
+#comment-box{\r
+       float:right;\r
+       clear:none;\r
+       border:2px solid #aca899;\r
+       background-color:#f3f2e7;\r
+       padding:10px;\r
+       margin:15px;\r
+}\r
+#comment-box li{\r
+       margin:4px;\r
+}\r
+#comment-box a{\r
+       text-decoration:none;\r
+}\r
+#comments-list{\r
+       margin:0px;\r
+       padding:0px;\r
+}\r
+/** Comment Post Form */\r
+#post-tab .inner-tab{\r
+       margin:10px;\r
+       margin-top:5px;\r
+}\r
+#comment-form label {\r
+       margin:4px;\r
+       margin-left:0px;\r
+       display:block;\r
+       color:#333333;\r
+       font:normal 10px arial,helvetica;\r
+       line-height:14px;\r
+}\r
+#comment-form .textinput{\r
+       border:1px solid #6593cf;\r
+       width:98%;\r
+       padding:1px;\r
+       margin-bottom:2px;\r
+       font:normal 11px tahoma, arial;\r
+}\r
+#comment {\r
+       width:480px;\r
+       height:205px;\r
+       font:normal 11px tahoma, arial;\r
+}\r
+\r
+/** Comment List */\r
+.commentmetadata {\r
+       margin: 0;\r
+       display: block;\r
+       font-size: 9px;\r
+       font-weight:normal;\r
+       color:gray;\r
+       margin-bottom:10px;\r
+       float:right;\r
+       clear:none;\r
+}\r
+.cuser{\r
+       float:left;\r
+       clear:none;\r
+       font:bold 12px tahoma, arial;\r
+       padding-left:21px;\r
+       background: url(images/comment.gif) no-repeat;\r
+}\r
+.cuser a{\r
+       font:bold 12px tahoma, arial;\r
+}\r
+.cheader{\r
+       height:20px;\r
+}\r
+#comments-list li {\r
+       display:block;\r
+       background: url(images/comment-bg.gif) repeat-x;\r
+       background-position:0px -5px;\r
+       padding:15px;\r
+       padding-bottom:18px;\r
+       font-size:12px;\r
+}
\ No newline at end of file
diff --git a/examples/dialog/post.js b/examples/dialog/post.js
new file mode 100644 (file)
index 0000000..97420a0
--- /dev/null
@@ -0,0 +1,165 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */\r
+\r
+var Comments = function(){\r
+    var dialog, postLink, viewLink, txtComment;\r
+    var tabs, commentsList, postBtn, renderer;\r
+    var wait, error, errorMsg;\r
+    var posting = false;\r
+    \r
+    return {\r
+        init : function(){\r
+             // cache some elements for quick access\r
+             txtComment = Roo.get('comment');\r
+             commentsList = Roo.get('comments-list');\r
+             postLink = Roo.get('post-comment');\r
+             viewLink = Roo.get('view-comments');\r
+             wait = Roo.get('post-wait');\r
+             error = Roo.get('post-error');\r
+             errorMsg = Roo.get('post-error-msg');\r
+             \r
+             this.createDialog();\r
+             \r
+             postLink.on('click', function(e){\r
+                 e.stopEvent();\r
+                 tabs.activate('post-tab');\r
+                 dialog.show(postLink);\r
+             });\r
+             \r
+             viewLink.on('click', function(e){\r
+                 e.stopEvent();\r
+                 tabs.activate('view-tab');\r
+                 dialog.show(viewLink);\r
+             });             \r
+        },\r
+        \r
+        // submit the comment to the server\r
+        submitComment : function(){\r
+            postBtn.disable();\r
+            wait.radioClass('active-msg');\r
+            \r
+            var commentSuccess = function(o){\r
+                postBtn.enable();\r
+                var data = renderer.parse(o.responseText);\r
+                // if we got a comment back\r
+                if(data){\r
+                    wait.removeClass('active-msg');\r
+                    renderer.append(data.comments[0]);\r
+                    dialog.hide();\r
+                }else{\r
+                    error.radioClass('active-msg');\r
+                    errorMsg.update(o.responseText);\r
+                }\r
+            };\r
+            \r
+            var commentFailure = function(o){\r
+                postBtn.enable();\r
+                error.radioClass('active-msg');\r
+                errorMsg.update('Unable to connect.');\r
+            };\r
+    \r
+            Roo.lib.Ajax.formRequest('comment-form', 'post.php',\r
+                    {success: commentSuccess, failure: commentFailure});          \r
+        },\r
+        \r
+        createDialog : function(){\r
+            dialog = new Roo.BasicDialog("comments-dlg", { \r
+                    autoTabs:true,\r
+                    width:500,\r
+                    height:300,\r
+                    shadow:true,\r
+                    minWidth:300,\r
+                    minHeight:300\r
+            });\r
+            dialog.addKeyListener(27, dialog.hide, dialog);\r
+            postBtn = dialog.addButton('Post', this.submitComment, this);\r
+            dialog.addButton('Close', dialog.hide, dialog);\r
+\r
+            \r
+            // clear any messages and indicators when the dialog is closed\r
+            dialog.on('hide', function(){\r
+                wait.removeClass('active-msg');\r
+                error.removeClass('active-msg');\r
+                txtComment.dom.value = '';\r
+            });\r
+            \r
+            // stoe a refeence to the tabs\r
+            tabs = dialog.getTabs();\r
+            \r
+            // auto fit the comment box to the dialog size\r
+            var sizeTextBox = function(){\r
+                txtComment.setSize(dialog.size.width-44, dialog.size.height-264);\r
+            };\r
+            sizeTextBox();\r
+            dialog.on('resize', sizeTextBox);\r
+            \r
+            // hide the post button if not on Post tab\r
+            tabs.on('tabchange', function(panel, tab){\r
+                postBtn.setVisible(tab.id == 'post-tab');\r
+            });\r
+            \r
+            // set up the comment renderer, all ajax requests for commentsList\r
+            // go through this render\r
+            renderer = new CommentRenderer(commentsList);\r
+            var um = commentsList.getUpdateManager();\r
+            um.setRenderer(renderer);\r
+            \r
+            // lazy load the comments when the view tab is activated\r
+            var commentsLoaded = false;\r
+            tabs.getTab('view-tab').on('activate', function(){\r
+                if(!commentsLoaded){\r
+                    um.update('comments.txt');\r
+                    commentsLoaded = true;\r
+                }\r
+            });\r
+        }\r
+    };\r
+}();\r
+\r
+// This class handles rendering JSON into comments\r
+var CommentRenderer = function(list){\r
+    // create a template for each JSON object\r
+    var tpl = new Roo.DomHelper.Template(\r
+          '<li id="comment-{id}">' +\r
+          '<div class="cheader">' +\r
+          '<div class="cuser">{author}:</div>' +\r
+          '<div class="commentmetadata">{date}</div>' +\r
+          '</div>{text}</li>'\r
+    );\r
+    \r
+    this.parse = function(json){\r
+        try{\r
+            return eval('(' + json + ')');\r
+        }catch(e){}\r
+        return null;\r
+    };\r
+    \r
+    // public render function for use with UpdateManager\r
+    this.render = function(el, response){\r
+        var data = this.parse(response.responseText);\r
+        if(!data || !data.comments || data.comments.length < 1){\r
+            el.update('There are no comments for this post.');\r
+            return;\r
+        }\r
+        // clear loading\r
+        el.update('');\r
+        for(var i = 0, len = data.comments.length; i < len; i++){\r
+            this.append(data.comments[i]);\r
+        }\r
+    };\r
+    \r
+    // appends a comment \r
+    this.append = function(data){\r
+        tpl.append(list.dom, data);\r
+    };\r
+};\r
+\r
+Roo.EventManager.onDocumentReady(Comments.init, Comments, true);
\ No newline at end of file
diff --git a/examples/dialog/post.php b/examples/dialog/post.php
new file mode 100644 (file)
index 0000000..7d8a5e2
--- /dev/null
@@ -0,0 +1,10 @@
+<?\r
+//This file does nothing. All it does is kick out a bogus new comment in JSON format.\r
+?>{"comments": [{\r
+               id: "10", \r
+               author: "Jack Slocum", \r
+               link: "http://www.jackslocum.com/", \r
+               date: "October 29th, 2006 9:21pm", \r
+               text: "New posted comment. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Sed metus nibh, sodales a, porta at, vulputate eget, dui. Pellentesque ut nisl. Maecenas tortor turpis, interdum non, sodales non, iaculis ac, lacus. Vestibulum auctor, tortor quis iaculis malesuada, libero lectus bibendum purus, sit amet tincidunt quam turpis vel lacus. In pellentesque nisl non sem. Suspendisse nunc sem, pretium eget, cursus a, fringilla vel, urna. Aliquam commodo ullamcorper erat. Nullam vel justo in neque porttitor laoreet. Aenean lacus dui, consequat eu, adipiscing eget, nonummy non, nisi. Morbi nunc est, dignissim non, ornare sed, luctus eu, massa."\r
+       }\r
+]}
\ No newline at end of file
diff --git a/examples/examples.css b/examples/examples.css
new file mode 100644 (file)
index 0000000..8b20f9e
--- /dev/null
@@ -0,0 +1,95 @@
+/*\r
+ * yui-ext\r
+ * Copyright(c) 2006, Jack Slocum.\r
+ */\r
+\r
+body {\r
+       font-family:verdana,tahoma,helvetica;\r
+       padding:20px;\r
+       font-size:13px;\r
+       background-color:#fff !important;\r
+}\r
+p {\r
+       margin-bottom:15px;\r
+}\r
+h1 {\r
+       font-size:large; \r
+       margin-bottom:20px;\r
+}\r
+.example-info{\r
+       float:right;\r
+       width:150px;\r
+       border:1px solid #c3daf9;\r
+       border-top:1px solid #DCEAFB;\r
+       border-left:1px solid #DCEAFB;\r
+       background:#ecf5fe url('info-bg.gif') repeat-x;\r
+       font-size:10px;\r
+       padding:8px;\r
+}\r
+pre.code{\r
+       background: #F8F8F8;\r
+       border: 1px solid #e8e8e8;\r
+       padding:10px;\r
+       margin:10px;\r
+       margin-left:0px;\r
+       border-left:5px solid #e8e8e8;\r
+       font-size: 12px !important;\r
+       line-height:14px !important;\r
+}
+
+/** ---- for column tree --- */
+
+.x-column-tree .x-tree-node {
+    zoom:1;
+    
+}
+.x-column-tree .x-tree-node-el {
+    border-bottom:1px solid #eee; 
+     border-right: 1px solid #ccc;
+    zoom:1;
+}
+.x-column-tree .x-tree-selected {
+    background: #d9e8fb;
+}
+.x-column-tree  .x-tree-node a {
+    line-height:18px;
+    vertical-align:middle;
+}
+.x-column-tree  .x-tree-node a span{
+       
+}
+.x-column-tree  .x-tree-node .x-tree-selected a span{
+       background:transparent;
+       color:#000;
+}
+.x-column-tree .x-tree-col {
+    float:left;
+    overflow:hidden;
+    padding:0;
+    
+    border-left: 1px solid #ccc;
+    height: 18px;
+    zoom:1;
+}
+
+.x-column-tree .x-tree-col-text,.x-column-tree  .x-tree-hd-text {
+    overflow:hidden;
+    -o-text-overflow: ellipsis;
+       text-overflow: ellipsis;
+    padding:3px 3px 3px 5px;
+    white-space: nowrap;
+    font:normal 11px arial, tahoma, helvetica, sans-serif;
+}
+
+.x-column-tree .x-tree-headers {
+    background: #EBEADB url(../../images/gray/grid/grid-hrow.gif) repeat-x scroll 0 0;
+       cursor:default;
+    zoom:1;
+}
+
+.x-column-tree .x-tree-hd {
+    float:left;
+    overflow:hidden;
+    border-left:1px solid #eee;
+    border-right:1px solid #d0d0d0;
+}
diff --git a/examples/examples.js b/examples/examples.js
new file mode 100644 (file)
index 0000000..7eaa146
--- /dev/null
@@ -0,0 +1,195 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */\r
+Roo.BLANK_IMAGE_URL = '../../images/default/s.gif';
+
+Roo.example = function(){
+    var msgCt;
+
+    function createBox(t, s){
+        return ['<div class="msg">',
+                '<div class="x-box-tl"><div class="x-box-tr"><div class="x-box-tc"></div></div></div>',
+                '<div class="x-box-ml"><div class="x-box-mr"><div class="x-box-mc"><h3>', t, '</h3>', s, '</div></div></div>',
+                '<div class="x-box-bl"><div class="x-box-br"><div class="x-box-bc"></div></div></div>',
+                '</div>'].join('');
+    }
+    return {
+        msg : function(title, format){
+            if(!msgCt){
+                msgCt = Roo.DomHelper.insertFirst(document.body, {id:'msg-div'}, true);
+            }
+            msgCt.alignTo(document, 't-t');
+            var s = String.format.apply(String, Array.prototype.slice.call(arguments, 1));
+            var m = Roo.DomHelper.append(msgCt, {html:createBox(title, s)}, true);
+            m.slideIn('t').pause(1).ghost("t", {remove:true});
+        },
+
+        init : function(){
+            var s = Roo.get('extlib'), t = Roo.get('exttheme');
+            if(!s || !t){ // run locally?
+                return;
+            }
+            var lib = Cookies.get('extlib') || 'ext', 
+                theme = Cookies.get('exttheme') || 'aero';
+            if(lib){
+                s.dom.value = lib;
+            }
+            if(theme){
+                t.dom.value = theme;
+                Roo.get(document.body).addClass('x-'+theme);
+            }
+            s.on('change', function(){
+                Cookies.set('extlib', s.getValue());
+                setTimeout(function(){
+                    window.location.reload();
+                }, 250);
+            });
+
+            t.on('change', function(){
+                Cookies.set('exttheme', t.getValue());
+                setTimeout(function(){
+                    window.location.reload();
+                }, 250);
+            });
+        }
+    };
+}();
+
+Roo.onReady(Roo.example.init, Roo.example);
+
+
+// old school cookie functions grabbed off the web
+var Cookies = {};
+Cookies.set = function(name, value){
+     var argv = arguments;
+     var argc = arguments.length;
+     var expires = (argc > 2) ? argv[2] : null;
+     var path = (argc > 3) ? argv[3] : '/';
+     var domain = (argc > 4) ? argv[4] : null;
+     var secure = (argc > 5) ? argv[5] : false;
+     document.cookie = name + "=" + escape (value) +
+       ((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
+       ((path == null) ? "" : ("; path=" + path)) +
+       ((domain == null) ? "" : ("; domain=" + domain)) +
+       ((secure == true) ? "; secure" : "");
+};
+
+Cookies.get = function(name){
+       var arg = name + "=";
+       var alen = arg.length;
+       var clen = document.cookie.length;
+       var i = 0;
+       var j = 0;
+       while(i < clen){
+               j = i + alen;
+               if (document.cookie.substring(i, j) == arg)
+                       return Cookies.getCookieVal(j);
+               i = document.cookie.indexOf(" ", i) + 1;
+               if(i == 0)
+                       break;
+       }
+       return null;
+};
+
+Cookies.clear = function(name) {
+  if(Cookies.get(name)){
+    document.cookie = name + "=" +
+    "; expires=Thu, 01-Jan-70 00:00:01 GMT";
+  }
+};
+
+Cookies.getCookieVal = function(offset){
+   var endstr = document.cookie.indexOf(";", offset);
+   if(endstr == -1){
+       endstr = document.cookie.length;
+   }
+   return unescape(document.cookie.substring(offset, endstr));
+};
+
+RooDocs= {};
+RooDocs.viewSource = {
+     show : function(page)
+    {
+        this.create();
+        
+        //this.contentPanel.getEl().dom.src = 'about:blank';
+        //this.printContentPanel.refresh();
+        this.dialog.getLayout().beginUpdate();
+        try {
+            this.dialog.resizeTo(window.innerWidth - 70,window.innerHeight - 70);
+        } catch(e) {
+            this.dialog.resizeTo(document.body.offsetWidth - 70,document.body.offsetHeight - 70);
+        }
+        
+        this.dialog.getLayout().endUpdate();
+        this.contentPanel.getEl().dom.style.width = this.dialog.getLayout().getRegion("center").box.width -7;
+        this.contentPanel.getEl().dom.style.height = this.dialog.getLayout().getRegion("center").box.height -7;
+        this.dialog.show();
+        var dl =document.location.pathname.split('/');
+        dl.pop();
+        this.contentPanel.getEl().load( dl.join('/') + page);
+        
+    },
+    
+    dialog : false,
+    
+    create : function()
+    {
+        if (this.dialog) {
+            return;
+           }
+        var jd = Roo.get(document.body).createChild({tag:'div'});
+        this.dialog =  new Roo.LayoutDialog(jd, { 
+                autoTabs:true,
+                width:500,
+                height:300,
+                shadow:true,
+                title: "Help",
+                minWidth:300,
+                minHeight:250,
+                modal: true,
+                fixedcenter: true,
+                  draggable: false,
+            collapsible: false,
+            resizable: false,
+                center: {
+                    autoScroll:true,
+                    titlebar: false,
+                    // tabPosition: 'top',
+                    fitContainer: true,
+                    hideTabs: true,
+                    closeOnTab: true,
+                    alwaysShowTabs: false
+                }
+                
+        });
+        this.dialog.addButton('Close', this.dialog.hide, this.dialog);
+        var layout = this.dialog.getLayout();
+        layout.beginUpdate();
+        //this.view = new Roo.ContentPanel(Roo.id(), { autoCreate:true, title: '', background:true});
+        var frm = layout.getEl().createChild({ tag:'div' });
+        this.contentPanel = new Roo.ContentPanel(frm, {title: 'View Source',   fitContainer: true, autoScroll: true});
+        this.contentPanel.getEl().getUpdateManager().setRenderer(new Roo.UpdateManager.RawRenderer());
+        layout.add('center', this.contentPanel);
+        layout.endUpdate();
+    }
+     
+    
+    
+};
+Roo.UpdateManager.RawRenderer = function(){};
+
+Roo.UpdateManager.RawRenderer.prototype = {
+
+    render : function(el, response, updateManager, callback){
+        el.update('<PRE style="margin:10px;">' + Roo.util.Format.htmlEncode(response.responseText) +'</PRE>', updateManager.loadScripts, callback);
+    }
+};
+
diff --git a/examples/form/combos.html b/examples/form/combos.html
new file mode 100644 (file)
index 0000000..125a1b0
--- /dev/null
@@ -0,0 +1,186 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+    <title>Combo Boxes</title>
+     <link rel="stylesheet" type="text/css" href="../../cssX/roojs-all.css"/>
+    <link rel="stylesheet" type="text/css" href="../../cssX/xtheme-slate.css"/>
+
+     <script type="text/javascript" src="../../roojs-all.js"></script>   
+  
+    <script type="text/javascript" src="states.js"></script>
+    <script type="text/javascript" src="combos.js"></script>
+    <link rel="stylesheet" type="text/css" href="combos.css" />
+
+    <!-- Common Styles for the examples -->
+    <link rel="stylesheet" type="text/css" href="../examples.css" />
+    <style type="text/css">
+        p { width:650px; }
+    </style>
+</head>
+<body>
+<script type="text/javascript" src="../examples.js"></script><!-- EXAMPLES -->
+<h1>Combo Boxes</h1>
+<p>The js is not minified so it is readable. See
+<button type="button" onclick="RooDocs.viewSource.show('/combos.js')">combos.js</button> and 
+<button type="button" onclick="RooDocs.viewSource.show('/combos.html')">combos.html</button> .</p>
+
+<p>
+<b>Data Sources</b><br />
+The combo box can use any type of Roo.data.Store as it's data source.
+    This means your data can be XML, JSON, arrays or any other supported format. It can be loaded using Ajax, script tags or be local.
+    This combo uses local data from a JS array.
+</p>
+<div>
+    <input type="text" id="local-states" size="20"/>
+</div>
+<pre class="code"><code>// simple array store
+var store = new Roo.data.SimpleStore({
+    fields: ['abbr', 'state'],
+    data : exampleData
+});
+var combo = new Roo.form.ComboBox({
+    store: store,
+    displayField:'state',
+    typeAhead: true,
+    mode: 'local',
+    triggerAction: 'all',
+    emptyText:'Select a state...',
+    selectOnFocus:true
+});
+combo.applyTo('local-states');
+</code></pre>
+<br />
+<p>
+<b>Unobtrusive</b><br />
+The combo box can very easily be used to convert existing select elements into auto-completing, filtering combos.
+</p>
+<div>
+Transformed select:<br/> <select name="state" id="state">
+<option value="AL">Alabama</option>
+<option value="AK">Alaska</option>
+<option value="AZ">Arizona</option>
+<option value="AR">Arkansas</option>
+<option value="CA">California</option>
+<option value="CO">Colorado</option>
+<option value="CT">Connecticut</option>
+<option value="DE">Delaware</option>
+<option value="FL">Florida</option>
+<option value="GA">Georgia</option>
+<option value="HI">Hawaii</option>
+<option value="ID">Idaho</option>
+<option value="IL">Illinois</option>
+<option value="IN">Indiana</option>
+<option value="IA">Iowa</option>
+<option value="KS">Kansas</option>
+<option value="KY">Kentucky</option>
+<option value="LA">Louisiana</option>
+<option value="ME">Maine</option>
+<option value="MD">Maryland</option>
+<option value="MA">Massachusetts</option>
+<option value="MI">Michigan</option>
+<option value="MN">Minnesota</option>
+<option value="MS">Mississippi</option>
+<option value="MO">Missouri</option>
+<option value="MT">Montana</option>
+<option value="NE">Nebraska</option>
+<option value="NV">Nevada</option>
+<option value="NH">New Hampshire</option>
+<option value="NJ">New Jersey</option>
+<option value="NM">New Mexico</option>
+<option value="NY">New York</option>
+<option value="NC">North Carolina</option>
+<option value="ND">North Dakota</option>
+<option value="OH" selected>Ohio</option>
+<option value="OK">Oklahoma</option>
+<option value="OR">Oregon</option>
+<option value="PA">Pennsylvania</option>
+<option value="RI">Rhode Island</option>
+<option value="SC">South Carolina</option>
+<option value="SD">South Dakota</option>
+<option value="TN">Tennessee</option>
+<option value="TX">Texas</option>
+<option value="UT">Utah</option>
+<option value="VT">Vermont</option>
+<option value="VA">Virginia</option>
+<option value="WA">Washington</option>
+<option value="WV">West Virginia</option>
+<option value="WI">Wisconsin</option>
+<option value="WY">Wyoming</option>
+</select>
+</div><br />
+<p>
+Originally looked like:<br/> <select name="state-orig">
+<option value="AL">Alabama</option>
+<option value="AK">Alaska</option>
+<option value="AZ">Arizona</option>
+<option value="AR">Arkansas</option>
+<option value="CA">California</option>
+<option value="CO">Colorado</option>
+<option value="CT">Connecticut</option>
+<option value="DE">Delaware</option>
+<option value="FL">Florida</option>
+<option value="GA">Georgia</option>
+<option value="HI">Hawaii</option>
+<option value="ID">Idaho</option>
+<option value="IL">Illinois</option>
+<option value="IN">Indiana</option>
+<option value="IA">Iowa</option>
+<option value="KS">Kansas</option>
+<option value="KY">Kentucky</option>
+<option value="LA">Louisiana</option>
+<option value="ME">Maine</option>
+<option value="MD">Maryland</option>
+<option value="MA">Massachusetts</option>
+<option value="MI">Michigan</option>
+<option value="MN">Minnesota</option>
+<option value="MS">Mississippi</option>
+<option value="MO">Missouri</option>
+<option value="MT">Montana</option>
+<option value="NE">Nebraska</option>
+<option value="NV">Nevada</option>
+<option value="NH">New Hampshire</option>
+<option value="NJ">New Jersey</option>
+<option value="NM">New Mexico</option>
+<option value="NY">New York</option>
+<option value="NC">North Carolina</option>
+<option value="ND">North Dakota</option>
+<option value="OH" selected>Ohio</option>
+<option value="OK">Oklahoma</option>
+<option value="OR">Oregon</option>
+<option value="PA">Pennsylvania</option>
+<option value="RI">Rhode Island</option>
+<option value="SC">South Carolina</option>
+<option value="SD">South Dakota</option>
+<option value="TN">Tennessee</option>
+<option value="TX">Texas</option>
+<option value="UT">Utah</option>
+<option value="VT">Vermont</option>
+<option value="VA">Virginia</option>
+<option value="WA">Washington</option>
+<option value="WV">West Virginia</option>
+<option value="WI">Wisconsin</option>
+<option value="WY">Wyoming</option>
+</select>
+</p>
+<pre class="code"><code>var converted = new Roo.form.ComboBox({
+    typeAhead: true,
+    triggerAction: 'all',
+    transform:'state',
+    width:135,
+    forceSelection:true
+});
+</code></pre>
+<br />
+<p>
+    <b>Grid Editor</b><br />
+    <a href="../grid/edit-grid.html">Click here</a> to see the combo as a grid editor.
+</p>
+<br />
+<p>
+    <b>Templates and Ajax</b><br />
+    <a href="forum-search.html">Click here</a> for a more advanced example.
+</p>
+<br /><br /><br /><br />
+</body>
+</html>
diff --git a/examples/form/combos.js b/examples/form/combos.js
new file mode 100644 (file)
index 0000000..ac4258b
--- /dev/null
@@ -0,0 +1,39 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+\r
+Roo.onReady(function(){
+    // simple array store
+    var store = new Roo.data.SimpleStore({
+        fields: ['abbr', 'state'],
+        data : Roo.exampledata.states // from states.js
+    });
+    var combo = new Roo.form.ComboBox({
+        store: store,
+        displayField:'state',
+        typeAhead: true,
+        mode: 'local',
+        triggerAction: 'all',
+        emptyText:'Select a state...',
+        selectOnFocus:true,
+        resizable:true
+    });
+    combo.applyTo('local-states');
+
+
+
+    var converted = new Roo.form.ComboBox({
+        typeAhead: true,
+        triggerAction: 'all',
+        transform:'state',
+        width:135,
+        forceSelection:true
+    });
+});
\ No newline at end of file
diff --git a/examples/form/custom.html b/examples/form/custom.html
new file mode 100644 (file)
index 0000000..66df966
--- /dev/null
@@ -0,0 +1,67 @@
+<html>\r
+<head>\r
+    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">\r
+    <title>Custom Fields</title>\r
+     <link rel="stylesheet" type="text/css" href="../../cssX/roojs-all.css"/>
+    <link rel="stylesheet" type="text/css" href="../../cssX/xtheme-slate.css"/>
+
+     <script type="text/javascript" src="../../roojs-all.js"></script>   
+  \r
+\r
+    <script type="text/javascript" src="custom.js"></script>\r
+    <link rel="stylesheet" type="text/css" href="combos.css" />\r
+\r
+    <style type="text/css">\r
+        #search-results a {\r
+            color: #385F95;\r
+            font:bold 11px tahoma, arial, helvetica, sans-serif;\r
+            text-decoration:none;\r
+        }\r
+        #search-results a:hover {\r
+            text-decoration:underline;\r
+        }\r
+        #search-results .search-item {\r
+            padding:5px;\r
+        }\r
+        #search-results p {\r
+            margin:3px !important;\r
+        }\r
+        #search-results {\r
+            border-bottom:1px solid #ddd;\r
+            margin: 0 1px;\r
+            height:300px;\r
+            overflow:auto;\r
+        }\r
+        #search-results .x-toolbar {\r
+            border:0 none;\r
+        }\r
+    </style>\r
+\r
+    <!-- Common Styles for the examples -->\r
+    <link rel="stylesheet" type="text/css" href="../examples.css" />\r
+</head>\r
+<body>\r
+<script type="text/javascript" src="../examples.js"></script><!-- EXAMPLES -->\r
+<p>\r
+    <b>Custom Form Fields</b><br />\r
+    Ext provides many types of form fields to build interactive and rich forms. However, it also\r
+    provides a complete framework for building new types of fields quickly. The search field below\r
+    is an example demonstrating \r
+</p>\r
+<p>The js is not minified so it is readable. See 
+<button type="button" onclick="RooDocs.viewSource.show('/custom.js')">custom.js</button>  and 
+<button type="button" onclick="RooDocs.viewSource.show('/custom.html')">custom.html</button> .</p>\r
+
+<H1>This will not work until we sort out a backend for RooJS</H1>
+\r
+<div style="width:600px;position:static;" class="x-layout-panel">\r
+    <div class="x-layout-panel-hd">\r
+        <div class="x-layout-panel-hd-text">RooJS Updates</div>\r
+    </div>\r
+    <div id="search-tb"></div>\r
+    <div id="search-results"></div>\r
+    <div id="page-tb"></div>\r
+</div>\r
+\r
+</body>\r
+</html>\r
diff --git a/examples/form/custom.js b/examples/form/custom.js
new file mode 100644 (file)
index 0000000..2157bbf
--- /dev/null
@@ -0,0 +1,108 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+\r
+Roo.onReady(function(){\r
+    var ds = new Roo.data.Store({\r
+        proxy: new Roo.data.ScriptTagProxy({\r
+            url: 'http://www.roojs.com/trac/timeline?ticket=on&changeset=on&milestone=on&wiki=on&max=50&daysback=90&format=rss'\r
+        }),\r
+        reader: new Roo.data.JsonReader({\r
+            root: 'topics',\r
+            totalProperty: 'totalCount',\r
+            id: 'post_id'\r
+        }, [\r
+            {name: 'postId', mapping: 'post_id'},\r
+            {name: 'title', mapping: 'topic_title'},\r
+            {name: 'topicId', mapping: 'topic_id'},\r
+            {name: 'author', mapping: 'author'},\r
+            {name: 'lastPost', mapping: 'post_time', type: 'date', dateFormat: 'timestamp'},\r
+            {name: 'excerpt', mapping: 'post_text'}\r
+        ]),\r
+\r
+        baseParams: {limit:20, forumId: 4}\r
+    });\r
+\r
+    // Custom rendering Template for the View\r
+    var resultTpl = new Roo.Template(\r
+        '<div class="search-item">',\r
+            '<h3><span>{lastPost:date("M j, Y")}<br />by {author}</span>',\r
+            '<a href="http://extjs.com/forum/showthread.php?t={topicId}&p={postId}" target="_blank">{title}</a></h3>',\r
+            '<p>{excerpt}</p>',\r
+        '</div>'\r
+    );\r
+\r
+    var view = new Roo.View('search-results', resultTpl, {store: ds});\r
+\r
+    var tb = new Roo.Toolbar('search-tb', [\r
+        'Search: ', ' ',\r
+        new Roo.app.SearchField({\r
+            store: ds,\r
+            width:320\r
+        })\r
+    ]);\r
+\r
+    new Roo.PagingToolbar('page-tb', ds, {\r
+        pageSize: 20,\r
+        displayInfo: true,\r
+        displayMsg: 'Topics {0} - {1} of {2}',\r
+        emptyMsg: "No topics to display"\r
+    });\r
+    \r
+    ds.load({params:{start:0, limit:20, forumId: 4}});\r
+});\r
+\r
+/**\r
+ * The custom search field\r
+ */\r
+\r
+Roo.app.SearchField = Roo.extend(Roo.form.TwinTriggerField, {\r
+    initComponent : function(){\r
+        Roo.app.SearchField.superclass.initComponent.call(this);\r
+        this.on('specialkey', function(f, e){\r
+            if(e.getKey() == e.ENTER){\r
+                this.onTrigger2Click();\r
+            }\r
+        }, this);\r
+    },\r
+\r
+    validationEvent:false,\r
+    validateOnBlur:false,\r
+    trigger1Class:'x-form-clear-trigger',\r
+    trigger2Class:'x-form-search-trigger',\r
+    hideTrigger1:true,\r
+    width:180,\r
+    hasSearch : false,\r
+    paramName : 'query',\r
+\r
+    onTrigger1Click : function(){\r
+        if(this.hasSearch){\r
+            var o = {start: 0};\r
+            o[this.paramName] = '';\r
+            this.store.reload({params:o});\r
+            this.el.dom.value = '';\r
+            this.triggers[0].hide();\r
+            this.hasSearch = false;\r
+        }\r
+    },\r
+\r
+    onTrigger2Click : function(){\r
+        var v = this.getRawValue();\r
+        if(v.length < 1){\r
+            this.onTrigger1Click();\r
+            return;\r
+        }\r
+        var o = {start: 0};\r
+        o[this.paramName] = v;\r
+        this.store.reload({params:o});\r
+        this.hasSearch = true;\r
+        this.triggers[0].show();\r
+    }\r
+});
\ No newline at end of file
diff --git a/examples/form/dynamic.html b/examples/form/dynamic.html
new file mode 100644 (file)
index 0000000..c0cdd4f
--- /dev/null
@@ -0,0 +1,74 @@
+<!--<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">-->
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+<title>Forms</title>
+   <link rel="stylesheet" type="text/css" href="../../cssX/roojs-all.css"/>
+    <link rel="stylesheet" type="text/css" href="../../cssX/xtheme-slate.css"/>
+
+     <script type="text/javascript" src="../../roojs-debug.js"></script>   
+     
+  
+<script type="text/javascript" src="states.js"></script>
+<script type="text/javascript" src="dynamic.js"></script>
+<link rel="stylesheet" type="text/css" href="forms.css" />
+
+<!-- Common Styles for the examples -->
+<link rel="stylesheet" type="text/css" href="../examples.css" />
+
+
+
+<style>
+.roodocs-formblock
+{
+    border:4px solid #CCCCCC;
+    padding:5px 0pt 5px 10px;
+} 
+</style>
+</head>
+<body>
+<script type="text/javascript" src="../examples.js"></script><!-- EXAMPLES -->
+<h1>Dynamic Forms built with JavaScript</h1>
+<p>
+    These forms do not do anything and have very little validation. They solely demonstrate
+    how you can use Ext Forms to build and layout forms on the fly.
+</p>
+
+<p>The js is not minified so it is readable. See 
+<button type="button" onclick="RooDocs.viewSource.show('/dynamic.js')">dynamic.js</button> and 
+<button type="button" onclick="RooDocs.viewSource.show('/dynamic.html')">dynamic.html</button>
+.</p>
+
+<div class="roodocs-formblock" style="width:280px;height:170px">
+    <h3 style="margin-bottom:5px;">Simple Form</h3>
+    <div id="form-ct"></div>
+</div>
+<br/>
+
+<div style="width:565px;" class="roodocs-formblock">
+    
+        <h3 style="margin-bottom:5px;">Multi-column and labels top</h3>
+        <div id="form-ct2"></div>
+    
+</div>
+
+
+
+<br/>
+<div style="width:345px;"  class="roodocs-formblock">
+    <h3>Fieldsets, labels right and complex fields</h3>
+    <div id="form-ct3"></div>
+</div>
+
+<br/>
+<div style="width:600px;" class="roodocs-formblock">
+        <h3 style="margin-bottom:5px;">Multi-column, nesting and fieldsets</h3>
+        <div id="form-ct4"> </div>
+</div>
+
+<div class="x-form-clear"></div>
+
+</body>
+</html>
diff --git a/examples/form/dynamic.js b/examples/form/dynamic.js
new file mode 100644 (file)
index 0000000..88b2262
--- /dev/null
@@ -0,0 +1,301 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+var mform;\r
+Roo.onReady(function(){
+
+    Roo.QuickTips.init();
+
+    // turn on validation errors beside the field globally
+    Roo.form.Field.prototype.msgTarget = 'side';
+
+    /*
+     * ================  Simple form  =======================
+     */
+    var simple = new Roo.form.Form({
+        labelWidth: 75, // label settings here cascade unless overridden
+        url:'save-form.php'
+    });
+    simple.add(
+        new Roo.form.TextField({
+            fieldLabel: 'First Name',
+            name: 'first',
+            width:175,
+            allowBlank:false
+        }),
+
+        new Roo.form.TextField({
+            fieldLabel: 'Last Name',
+            name: 'last',
+            width:175
+        }),
+
+        new Roo.form.TextField({
+            fieldLabel: 'Company',
+            name: 'company',
+            width:175
+        }),
+
+        new Roo.form.TextField({
+            fieldLabel: 'Email',
+            name: 'email',
+            vtype:'email',
+            width:175
+        })
+    );
+
+    simple.addButton('Save');
+    simple.addButton('Cancel');
+
+    simple.render('form-ct');
+
+
+    /*
+     * ================  Form 2  =======================
+     */
+    mform = new Roo.form.Form({
+        labelAlign: 'top'
+    });
+
+    mform.column(
+        {width:282}, // precise column sizes or percentages or straight CSS
+        new Roo.form.TextField({
+            fieldLabel: 'First Name',
+            name: 'first',
+            width:225
+        }),
+
+        new Roo.form.TextField({
+            fieldLabel: 'Company',
+            name: 'company',
+            width:225
+        })
+    );
+
+    mform.column(
+        {width:272, style:'margin-left:10px', clear:true}, // apply custom css, clear:true means it is the last column
+        new Roo.form.TextField({
+            fieldLabel: 'Last Name',
+            name: 'last',
+            width:225
+        }),
+
+        new Roo.form.TextField({
+            fieldLabel: 'Email',
+            name: 'email',
+            vtype:'email',
+            width:225
+        })
+    );
+
+    mform.container({},
+        new Roo.form.HtmlEditor({
+            toolbars : [    
+                new Roo.form.HtmlEditor.ToolbarStandard(), 
+                new Roo.form.HtmlEditor.ToolbarContext() 
+            ],
+            id:'bio',
+            name : 'bio',
+            fieldLabel:'Biography',
+            width:550,
+            height:200
+        })
+    );
+
+    mform.addButton('Save');
+    mform.addButton('Cancel');
+
+    mform.render('form-ct2');
+
+    /*
+     * ================  Form 3  =======================
+     */
+    var fs = new Roo.form.Form({
+        labelAlign: 'right',
+        labelWidth: 80
+    });
+
+    fs.fieldset(
+        {legend:'Contact Information', style: 'width:320px;' },
+        new Roo.form.TextField({
+            fieldLabel: 'First Name',
+            name: 'first',
+            width:190
+        }),
+
+        new Roo.form.TextField({
+            fieldLabel: 'Last Name',
+            name: 'last',
+            width:190
+        }),
+
+        new Roo.form.TextField({
+            fieldLabel: 'Company',
+            name: 'company',
+            width:190
+        }),
+
+        new Roo.form.TextField({
+            fieldLabel: 'Email',
+            name: 'email',
+            vtype:'email',
+            width:190
+        }),
+
+        new Roo.form.ComboBox({
+            fieldLabel: 'State',
+            hiddenName:'state',
+            store: new Roo.data.SimpleStore({
+                fields: ['abbr', 'state'],
+                data : Roo.exampledata.states // from states.js
+            }),
+            displayField:'state',
+            typeAhead: true,
+            mode: 'local',
+            triggerAction: 'all',
+            emptyText:'Select a state...',
+            selectOnFocus:true,
+            width:190
+        }),
+
+        new Roo.form.DateField({
+            fieldLabel: 'Date of Birth',
+            name: 'dob',
+            width:190,
+            allowBlank:false
+        })
+    );
+
+    fs.addButton('Save');
+    fs.addButton('Cancel');
+
+    fs.render('form-ct3');
+
+    /*
+     * ================  Form 4  =======================
+     */
+    var form = new Roo.form.Form({
+        labelAlign: 'right',
+        labelWidth: 75
+    });
+
+    form.column({width:342, labelWidth:75}); // open column, without auto close
+    form.fieldset(
+        {legend:'Contact Information'},
+        new Roo.form.TextField({
+            fieldLabel: 'Full Name',
+            name: 'fullName',
+            allowBlank:false,
+            value: 'Fred Blogs'
+        }),
+
+        new Roo.form.TextField({
+            fieldLabel: 'Job Title',
+            name: 'title',
+            value: 'RooJS user'
+        }),
+
+        new Roo.form.TextField({
+            fieldLabel: 'Company',
+            name: 'company',
+            value: 'RooJS'
+        }),
+
+        new Roo.form.TextArea({
+            fieldLabel: 'Address',
+            name: 'address',
+            grow: true,
+            preventScrollbars:true,
+            value: '123 example drive'
+        })
+    );
+    form.fieldset(
+        {legend:'Phone Numbers'},
+        new Roo.form.TextField({
+            fieldLabel: 'Home',
+            name: 'home',
+            value: '(123) 456 789'
+        }),
+
+        new Roo.form.TextField({
+            fieldLabel: 'Business',
+            name: 'business'
+        }),
+
+        new Roo.form.TextField({
+            fieldLabel: 'Mobile',
+            name: 'mobile'
+        }),
+
+        new Roo.form.TextField({
+            fieldLabel: 'Fax',
+            name: 'fax'
+        })
+    );
+    form.end(); // closes the last container element (column, layout, fieldset, etc) and moves up 1 level in the stack
+
+    
+    form.column(
+        {width:202, style:'margin-left:10px', clear:true}
+    );
+
+    form.fieldset(
+        {id:'photo', legend:'Photo'}
+    );
+    form.end();
+
+    form.fieldset(
+        {legend:'Options', hideLabels:true},
+        new Roo.form.Checkbox({
+            boxLabel:'RooJS v1.1.1',
+            name:'extuser',
+            width:'auto'
+        }),
+        new Roo.form.Checkbox({
+            boxLabel:'RooJS v2.0.0',
+            name:'extcomm',
+            width:'auto'
+        }),
+        new Roo.form.Checkbox({
+            boxLabel:'RooScript',
+            name:'extprem',
+            width:'auto'
+        })
+        
+    );
+
+    form.end(); // close the column
+
+    
+    form.applyIfToFields({
+        width:230
+    });
+
+    form.addButton('Save');
+    form.addButton('Cancel');
+
+    form.render('form-ct4');
+
+    // The form elements are standard HTML elements. By assigning an id (as we did above)
+    // we can manipulate them like any other element
+    var photo = Roo.get('photo');
+    var c = photo.createChild({
+        tag:'center', 
+        cn: {
+            tag:'img',
+            src: 'roojs_icon.jpg',
+            style:'margin-bottom:5px;'
+        }
+    });
+    new Roo.Button(c, {
+        text: 'Change Photo'
+    });
+});
\ No newline at end of file
diff --git a/examples/form/fck.html b/examples/form/fck.html
new file mode 100644 (file)
index 0000000..5d0fadc
--- /dev/null
@@ -0,0 +1,53 @@
+<!--<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">-->
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+<title>Forms - FCK</title>
+    <link rel="stylesheet" type="text/css" href="../../cssX/roojs-all.css"/>
+    <link rel="stylesheet" type="text/css" href="../../cssX/xtheme-slate.css"/>
+
+    <script type="text/javascript" src="../../roojs-debug.js"></script>   
+     
+    
+    <script type="text/javascript" src="../../Roo/form/FCKeditor.js"></script>
+    <script type="text/javascript" src="states.js"></script>
+    <script type="text/javascript" src="fck.js"></script>
+     
+
+    <!-- Common Styles for the examples -->
+    <link rel="stylesheet" type="text/css" href="../examples.css" />
+
+
+
+<style>
+.roodocs-formblock
+{
+    border:4px solid #CCCCCC;
+    padding:5px 0pt 5px 10px;
+} 
+</style>
+</head>
+<body>
+<script type="text/javascript" src="../examples.js"></script><!-- EXAMPLES -->
+<h1>Fck editor </h1>
+<p>The js is not minified so it is readable. See 
+<button type="button" onclick="RooDocs.viewSource.show('/fck.js')">fck.js</button> and 
+<button type="button" onclick="RooDocs.viewSource.show('/fck.html')">fck.html</button>
+.</p>
+
+
+<div style="width:765px;" class="roodocs-formblock">
+    
+        <h3 style="margin-bottom:5px;">Form</h3>
+        <div id="form-ct2"></div>
+    
+</div>
+
+
+<div class="x-form-clear"></div>
+
+</body>
+</html>
diff --git a/examples/form/fck.js b/examples/form/fck.js
new file mode 100644 (file)
index 0000000..996c6b6
--- /dev/null
@@ -0,0 +1,87 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+var fck = false;
+Roo.onReady(function(){
+
+    Roo.QuickTips.init();
+
+    // turn on validation errors beside the field globally
+    Roo.form.Field.prototype.msgTarget = 'side';
+    /*
+     * ================  Form 2  =======================
+     */
+    var top = new Roo.form.Form({
+        labelAlign: 'top'
+    });
+
+    fck = new Roo.form.FCKeditor({
+            id:'bio',
+            fieldLabel:'Biography',
+            
+            fckconfig : {
+                CustomConfigurationsPath : '/roojs1/examples/form/fckconfig.js'
+            },
+            
+            toolbarSet : 'Roo',
+            width:750,
+            value : '<blockquote>aaa<br/></blockquote>',
+            
+            height:300,
+            listeners : {
+                editorinit : function(ed, f) {
+                    var de = f.EnterKeyHandler.DoEnter;
+                    f.EnterKeyHandler.constructor.prototype.DoEnter =
+                    f.EnterKeyHandler.DoEnter = function(m,h) {
+                        //console.log(this); 
+                        try { de(m,h); } catch(e) {  }
+                        //..console.log(this); 
+                        
+                        window.setTimeout( function() {
+                            try { 
+                                f.EditorDocument.execCommand('outdent', false, null);
+                                f.EditorDocument.execCommand('outdent', false, null);
+                                f.EditorDocument.execCommand('outdent', false, null);
+                                f.EditorDocument.execCommand('outdent', false, null);
+                            } catch(e) {  console.log(e)}
+                        }, 100);
+                            
+                        
+                       // this._OutdentWithSelection( currentBlock, range )
+                        
+                    };
+                    //f.EnterKeyHandler.DoEnter = function(m, hs) {
+                    //    eh(m,hs);
+                     //   console.log(this);
+                    //}
+                    
+
+                }
+            }
+        });
+
+    top.container({},
+        fck
+    );
+
+    top.addButton('Save', function(){
+        top.doAction('submit', {
+            url: './fck.js',
+            method: 'POST'
+            
+        });
+       });
+    top.addButton('Cancel');
+
+    top.render('form-ct2');
+});
\ No newline at end of file
diff --git a/examples/form/fckconfig.js b/examples/form/fckconfig.js
new file mode 100644 (file)
index 0000000..adb118a
--- /dev/null
@@ -0,0 +1,15 @@
+//<script type="text/javascript">
+
+FCKConfig.ToolbarSets["Roo"] = [
+       ['Source', 'Cut','Copy','Paste','PasteText','PasteWord','-','SpellCheck' ,
+        'Undo','Redo','-','Find','Replace','-','SelectAll', 'TextColor','BGColor'],
+    ['Link','Unlink'],
+       '/',
+       ['Bold','Italic','Underline','StrikeThrough'],
+       ['OrderedList','UnorderedList','-','Outdent','Indent'],
+       ['JustifyLeft','JustifyCenter','JustifyRight','JustifyFull'],
+       
+        
+       ['FontFormat','FontName','FontSize']
+       
+] ;
diff --git a/examples/form/forms.html b/examples/form/forms.html
new file mode 100644 (file)
index 0000000..aee8542
--- /dev/null
@@ -0,0 +1,147 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+<title>Forms</title>
+   <link rel="stylesheet" type="text/css" href="../../cssX/roojs-all.css"/>
+    <link rel="stylesheet" type="text/css" href="../../cssX/xtheme-slate.css"/>
+
+     <script type="text/javascript" src="../../roojs-all.js"></script>   
+  
+<script type="text/javascript" src="forms.js"></script>
+<link rel="stylesheet" type="text/css" href="forms.css" />
+
+<!-- Common Styles for the examples -->
+<link rel="stylesheet" type="text/css" href="../examples.css" />
+</head>
+<body>
+<script type="text/javascript" src="../examples.js"></script><!-- EXAMPLES -->
+<h1>Forms</h1>
+<p>The js is not minified so it is readable. See <a href="forms.js">forms.js</a>.</p>
+
+<form id="form1" class="x-form">
+    <div style="width:400px;">
+        <div class="x-box-tl"><div class="x-box-tr"><div class="x-box-tc"></div></div></div>
+        <div class="x-box-ml"><div class="x-box-mr"><div class="x-box-mc">
+            <h3 style="margin-bottom:5px;">Ext Live Forms</h3>
+            <!-- begin form layout -->
+            <div class="x-form-bd" id="container">
+                <fieldset>
+                    <legend>ComboBox Fields</legend>
+
+                    <div class="x-form-item">
+                        <label for="combo-local">Local Data:</label>
+                        <div class="x-form-element">
+                            <input type="text" size="20" name="combo-local" id="combo-local" />
+                        </div>
+                    </div>
+                    
+                    <div class="x-form-item">
+                        <label for="combo-ajax">Ajax Data:</label>
+                        <div class="x-form-element">
+                            <input type="text" size="20" name="combo-ajax" id="combo-ajax" />
+                        </div>
+                    </div>
+
+                    <div class="x-form-item">
+                        <label for="combo-selection">Only Selection:</label>
+                        <div class="x-form-element">
+                            <input type="text" size="20" value="OH" name="combo-selection" id="combo-selection" />
+                        </div>
+                    </div>
+
+                    <div class="x-form-item">
+                        <label for="combo-tpl">Item Templates:</label>
+                        <div class="x-form-element">
+                            <input type="text" size="20" name="combo-tpl" id="combo-tpl" />
+                        </div>
+                    </div>
+
+                    <div class="x-form-item">
+                        <label for="combo-tpl">Unobtrusive:</label>
+                        <div class="x-form-element">
+                            <select name="light" id="light">
+                                <option value="Shade">Shade</option>
+                                <option value="Mostly Shady">Mostly Shady</option>
+                                <option value="Sun or Shade">Sun or Shade</option>
+
+                                <option value="Mostly Sunny">Mostly Sunny</option>
+
+                                <option value="Sunny">Sunny</option>
+                            </select>
+                        </div>
+                    </div>
+
+                </fieldset>
+
+                <fieldset>
+                    <legend>Component Fields</legend>
+
+                    <div class="x-form-item">
+                        <label for="markup-date">Date:</label>
+                        <div class="x-form-element">
+                            <input type="text" size="10" value="03/08/03" name="markup-date" id="markup-date" />
+                        </div>
+                    </div>
+                </fieldset>
+
+                <fieldset>
+                    <legend>Live Validation and key filtering</legend>
+
+                    <div class="x-form-item">
+                        <label for="required">Required:</label>
+                        <div class="x-form-element">
+                            <input type="text" size="24" name="required" id="required" />
+                        </div>
+                    </div>
+
+                    <div class="x-form-item">
+                        <label for="alpha">Alpha:</label>
+                        <div class="x-form-element">
+                            <input type="text" size="24" name="alpha" id="alpha" />
+                        </div>
+                    </div>
+
+                    <div class="x-form-item">
+                        <label for="alpha2">(No Filter):</label>
+                        <div class="x-form-element">
+                            <input type="text" size="24" name="alpha2" id="alpha2" />
+                        </div>
+                    </div>
+
+                    <div class="x-form-item">
+                        <label for="alphanum">Alphanum:</label>
+                        <div class="x-form-element">
+                            <input type="text" size="24" name="alphanum" id="alphanum" />
+                        </div>
+                    </div>
+
+                    <div class="x-form-item">
+                        <label for="email">Email:</label>
+                        <div class="x-form-element">
+                            <input type="text" size="32" name="email" id="email" />
+                        </div>
+                    </div>
+
+                    <div class="x-form-item">
+                        <label for="url">URL:</label>
+                        <div class="x-form-element">
+                            <input type="text" size="32" name="url" id="url" />
+                        </div>
+                    </div>
+
+                    <div class="x-form-item">
+                        <label for="url">Auto grow textareas:</label>
+                        <div class="x-form-element">
+                            <textarea name="grow" id="grow" cols="25" rows="3"></textarea>
+                        </div>
+                    </div>
+                </fieldset>
+            </div>
+            <!-- end form layout -->
+        </div></div></div>
+        <div class="x-box-bl"><div class="x-box-br"><div class="x-box-bc"></div></div></div>
+    </div>
+</form>
+</body>
+</html>
diff --git a/examples/form/forms.js b/examples/form/forms.js
new file mode 100644 (file)
index 0000000..4cf57ba
--- /dev/null
@@ -0,0 +1,72 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */\r
+\r
+Roo.onReady(function(){
+    Roo.QuickTips.init();
+
+    Roo.MessageBox.alert("Warning", "This example is not done and results may vary.");
+
+    // Change field to default to validation message "under" instead of tooltips
+    Roo.form.Field.prototype.msgTarget = 'under';
+
+
+    var date = new Roo.form.DateField({
+        allowBlank:false
+    });
+
+    date.applyTo('markup-date');
+
+    var tranny = new Roo.form.ComboBox({
+        typeAhead: true,
+        triggerAction: 'all',
+        transform:'light',
+        width:120,
+        forceSelection:true
+    });
+
+    var required = new Roo.form.TextField({
+        allowBlank:false
+    });
+    required.applyTo('required');
+
+    var alpha = new Roo.form.TextField({
+        vtype:'alpha'
+    });
+    alpha.applyTo('alpha');
+
+    var alpha2 = new Roo.form.TextField({
+        vtype:'alpha',
+        disableKeyFilter:true
+    });
+    alpha2.applyTo('alpha2');
+
+    var alphanum = new Roo.form.TextField({
+        vtype:'alphanum'
+    });
+    alphanum.applyTo('alphanum');
+
+    var email = new Roo.form.TextField({
+        allowBlank:false,
+        vtype:'email'
+    });
+    email.applyTo('email');
+
+    var url = new Roo.form.TextField({
+        vtype:'url'
+    });
+    url.applyTo('url');
+
+    var grow = new Roo.form.TextArea({
+        width:200, grow:true
+    });
+    grow.applyTo('grow');
+
+});
\ No newline at end of file
diff --git a/examples/form/forum-search.html b/examples/form/forum-search.html
new file mode 100644 (file)
index 0000000..fca04ad
--- /dev/null
@@ -0,0 +1,45 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+    <title>ComboBox - Live Search</title>
+      <link rel="stylesheet" type="text/css" href="../../cssX/roojs-all.css"/>
+    <link rel="stylesheet" type="text/css" href="../../cssX/xtheme-slate.css"/>
+
+     <script type="text/javascript" src="../../roojs-all.js"></script>   
+  
+    <script type="text/javascript" src="forum-search.js"></script>
+    
+
+    <!-- Common Styles for the examples -->
+    <link rel="stylesheet" type="text/css" href="../examples.css" />
+    <style type="text/css">
+        p { width:650px; }
+    </style>
+</head>
+<body>
+<script type="text/javascript" src="../examples.js"></script><!-- EXAMPLES -->
+<p>
+    <b>Combo with Templates and Ajax</b><br />
+    This is a more advanced example that shows how you can combine paging, Roo.Template and a remote data store
+    to create a "live search" feature.
+</p>
+<p>The js is not minified so it is readable. See 
+<button type="button" onclick="RooDocs.viewSource.show('/forum-search.js')">forum-search.js</button> and 
+<button type="button" onclick="RooDocs.viewSource.show('/forum-search.html')">forum-search.html</button>.</p>
+
+<H1> This does not work yet, as we do not have a remote search on roojs.com</H1>
+
+<!-- The box wrap markup embedded instead of using Element.boxWrap() -->
+<div style="width:600px;">
+     
+        <h3 style="margin-bottom:5px;">Search the RooJS Wiki</h3>
+        <input type="text" size="40" name="search" id="search" />
+        <div style="padding-top:4px;">
+            Live search requires a minimum of 4 characters.
+        </div>
+    
+</div>
+        
+</body>
+</html>
diff --git a/examples/form/forum-search.js b/examples/form/forum-search.js
new file mode 100644 (file)
index 0000000..3c6c9dd
--- /dev/null
@@ -0,0 +1,60 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+\r
+\r
+Roo.onReady(function(){
+
+    var ds = new Roo.data.Store({
+        
+      
+         
+        proxy: new Roo.data.ScriptTagProxy({
+            url: 'http://www.roojs.com/forum/topics-remote.php'
+        }),
+        reader: new Roo.data.JsonReader({
+            root: 'topics',
+            totalProperty: 'totalCount',
+            id: 'post_id'
+        }, [
+            {name: 'title', mapping: 'topic_title'},
+            {name: 'topicId', mapping: 'topic_id'},
+            {name: 'author', mapping: 'author'},
+            {name: 'lastPost', mapping: 'post_time', type: 'date', dateFormat: 'timestamp'},
+            {name: 'excerpt', mapping: 'post_text'}
+        ])
+        */
+    });
+
+    // Custom rendering Template
+    var resultTpl = new Roo.Template(
+        '<div class="search-item">',
+            '<h3><span>{lastPost:date("M j, Y")}<br />by {author}</span>{title}</h3>',
+            '{excerpt}',
+        '</div>'
+    );
+    
+    var search = new Roo.form.ComboBox({
+        store: ds,
+        displayField:'title',
+        typeAhead: false,
+        loadingText: 'Searching...',
+        width: 570,
+        pageSize:10,
+        hideTrigger:true,
+        tpl: resultTpl,
+        onSelect: function(record){ // override default onSelect to do redirect
+            window.location =
+               String.format('http://www.roojs.com/forum/showthread.php?t={0}&p={1}', record.data.topicId, record.id);
+        }
+    });
+    // apply it to the exsting input element
+    search.applyTo('search');
+});
\ No newline at end of file
diff --git a/examples/form/roojs_icon.jpg b/examples/form/roojs_icon.jpg
new file mode 100644 (file)
index 0000000..81da6a2
Binary files /dev/null and b/examples/form/roojs_icon.jpg differ
diff --git a/examples/form/states.js b/examples/form/states.js
new file mode 100644 (file)
index 0000000..8088452
--- /dev/null
@@ -0,0 +1,68 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+\r
+\r
+// some data used in the examples
+Roo.namespace('Roo.exampledata');
+
+Roo.exampledata.states = [
+        ['AL', 'Alabama'],
+        ['AK', 'Alaska'],
+        ['AZ', 'Arizona'],
+        ['AR', 'Arkansas'],
+        ['CA', 'California'],
+        ['CO', 'Colorado'],
+        ['CT', 'Connecticut'],
+        ['DE', 'Delaware'],
+        ['DC', 'District of Columbia'],
+        ['FL', 'Florida'],
+        ['GA', 'Georgia'],
+        ['HI', 'Hawaii'],
+        ['ID', 'Idaho'],
+        ['IL', 'Illinois'],
+        ['IN', 'Indiana'],
+        ['IA', 'Iowa'],
+        ['KS', 'Kansas'],
+        ['KY', 'Kentucky'],
+        ['LA', 'Louisiana'],
+        ['ME', 'Maine'],
+        ['MD', 'Maryland'],
+        ['MA', 'Massachusetts'],
+        ['MI', 'Michigan'],
+        ['MN', 'Minnesota'],
+        ['MS', 'Mississippi'],
+        ['MO', 'Missouri'],
+        ['MT', 'Montana'],
+        ['NE', 'Nebraska'],
+        ['NV', 'Nevada'],
+        ['NH', 'New Hampshire'],
+        ['NJ', 'New Jersey'],
+        ['NM', 'New Mexico'],
+        ['NY', 'New York'],
+        ['NC', 'North Carolina'],
+        ['ND', 'North Dakota'],
+        ['OH', 'Ohio'],
+        ['OK', 'Oklahoma'],
+        ['OR', 'Oregon'],
+        ['PA', 'Pennsylvania'],
+        ['RI', 'Rhode Island'],
+        ['SC', 'South Carolina'],
+        ['SD', 'South Dakota'],
+        ['TN', 'Tennessee'],
+        ['TX', 'Texas'],
+        ['UT', 'Utah'],
+        ['VT', 'Vermont'],
+        ['VA', 'Virginia'],
+        ['WA', 'Washington'],
+        ['WV', 'West Virginia'],
+        ['WI', 'Wisconsin'],
+        ['WY', 'Wyoming']
+    ];
\ No newline at end of file
diff --git a/examples/form/xml-errors.xml b/examples/form/xml-errors.xml
new file mode 100644 (file)
index 0000000..70538c5
--- /dev/null
@@ -0,0 +1,15 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<response success="false">
+    <errors>
+      <field>
+        <id>last</id>
+        <msg><![CDATA[ something wrong with the last name]]></msg>
+      </field>
+          <field>
+        <id>company</id>
+        <msg><![CDATA[ you can put some <B>HTML</B> in the error ]]></msg>
+      </field>
+    
+   </errors>
+</response>
\ No newline at end of file
diff --git a/examples/form/xml-form.html b/examples/form/xml-form.html
new file mode 100644 (file)
index 0000000..4769a95
--- /dev/null
@@ -0,0 +1,54 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+<title>XML Form</title>
+  <link rel="stylesheet" type="text/css" href="../../cssX/roojs-all.css"/>
+    <link rel="stylesheet" type="text/css" href="../../cssX/xtheme-slate.css"/>
+
+    <script type="text/javascript" src="../../roojs-debug.js"></script>   
+   
+        
+    <script type="text/javascript" src="states.js"></script>
+    <script type="text/javascript" src="xml-form.js"></script>
+    <link rel="stylesheet" type="text/css" href="forms.css" />
+
+<!-- Common Styles for the examples -->
+    <link rel="stylesheet" type="text/css" href="../examples.css" />
+</head>
+<body>
+    <script type="text/javascript" src="../examples.js"></script><!-- EXAMPLES -->
+<h1>Loading/Saving a Dynamic Form using XML</h1>
+<p>
+    This is a very simple example of using XML for load and submit of data with an Ext dynamic form. (It's probably better to use the JSON tools)
+</p>
+<p>
+    Click "Load" to load the <button type="button" onclick="RooDocs.viewSource.show('/xml-form.xml')">xml-form.xml</button> 
+    om the server using an XmlReader.
+</p>
+<p>
+    After loading the form, you will be able to hit submit. The submit action will make a post to the server,
+    
+    
+    and the<button type="button" onclick="RooDocs.viewSource.show('/xml-errors.xml')">dummy XML file</button> 
+    on the server with test server-side validation failure messages will be sent back.
+    Those messages will be applied to the appropriate fields in the form.
+</p>
+<p>
+    Note: The built-in JSON support does not require any special readers for mapping. However, If you don't like the Form's built-in JSON format, you could also use a JsonReader for reading data into a form.
+</p>
+<p>The js is not minified so it is readable. See
+<button type="button" onclick="RooDocs.viewSource.show('/xml-form.js')">xml-form.js</button> .</p>
+
+<div style="width:340px;">
+    <div class="x-box-tl"><div class="x-box-tr"><div class="x-box-tc"></div></div></div>
+    <div class="x-box-ml"><div class="x-box-mr"><div class="x-box-mc" id="box-bd">
+        <h3>XML Form</h3>
+        <div id="form-ct">
+
+        </div>
+    </div></div></div>
+    <div class="x-box-bl"><div class="x-box-br"><div class="x-box-bc"></div></div></div>
+</div>
+<div class="x-form-clear"></div>
+</body>
+</html>
diff --git a/examples/form/xml-form.js b/examples/form/xml-form.js
new file mode 100644 (file)
index 0000000..3192323
--- /dev/null
@@ -0,0 +1,126 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */\r
+Roo.onReady(function(){
+
+    Roo.QuickTips.init();
+
+    // turn on validation errors beside the field globally
+    Roo.form.Field.prototype.msgTarget = 'side';
+
+    var fs = new Roo.form.Form({
+        //labelAlign: 'right',
+        labelWidth: 120,
+        waitMsgTarget: 'box-bd',
+
+        // configure how to read the XML Data
+        reader : new Roo.data.XmlReader({
+            record : 'contact',
+            success: '@success'
+        }, [
+            {name: 'first', mapping:'name/first'}, // custom mapping
+            {name: 'last', mapping:'name/last'},
+            'company', 'email', 'state',
+            {name: 'dob', type:'date', dateFormat:'m/d/Y'} // custom data types
+        ]),
+
+        // reusable eror reader class defined at the end of this file
+        errorReader: new Roo.form.XmlErrorReader()
+    });
+
+    fs.fieldset(
+        {legend:'Contact Information'},
+        new Roo.form.TextField({
+            fieldLabel: 'First Name',
+            name: 'first',
+            width:190
+        }),
+
+        new Roo.form.TextField({
+            fieldLabel: 'Last Name',
+            name: 'last',
+            width:190
+        }),
+
+        new Roo.form.TextField({
+            fieldLabel: 'Company',
+            name: 'company',
+            width:190
+        }),
+
+        new Roo.form.TextField({
+            fieldLabel: 'Email',
+            name: 'email',
+            vtype:'email',
+            width:190
+        }),
+
+        new Roo.form.ComboBox({
+            fieldLabel: 'State',
+            hiddenName:'state',
+            store: new Roo.data.SimpleStore({
+                fields: ['abbr', 'state'],
+                data : Roo.exampledata.states // from states.js
+            }),
+            valueField:'abbr',
+            displayField:'state',
+            typeAhead: true,
+            mode: 'local',
+            triggerAction: 'all',
+            emptyText:'Select a state...',
+            selectOnFocus:true,
+            width:190
+        }),
+
+        new Roo.form.DateField({
+            fieldLabel: 'Date of Birth',
+            name: 'dob',
+            width:190,
+            allowBlank:false
+        })
+    );
+
+    // simple button add
+    fs.addButton('Load', function(){
+        fs.load({url:'xml-form.xml', waitMsg:'Loading'});
+    });
+
+    // explicit add
+    var submit = fs.addButton({
+        text: 'Submit',
+        disabled:true,
+        handler: function(){
+            fs.submit({url:'xml-errors.xml', waitMsg:'Saving Data...'});
+        }
+    });
+
+    fs.render('form-ct');
+
+    fs.on({
+        actioncomplete: function(form, action){
+            if(action.type == 'load'){
+                submit.enable();
+            }
+        }
+    });
+
+});
+
+// A reusable error reader class for XML forms
+Roo.form.XmlErrorReader = function(){
+    Roo.form.XmlErrorReader.superclass.constructor.call(this, {
+            record : 'field',
+            success: '@success'
+        }, [
+            'id', 'msg'
+        ]
+    );
+};
+Roo.extend(Roo.form.XmlErrorReader, Roo.data.XmlReader);
\ No newline at end of file
diff --git a/examples/form/xml-form.xml b/examples/form/xml-form.xml
new file mode 100644 (file)
index 0000000..f99057d
--- /dev/null
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<response success="true">
+    <contact>
+      <name>
+         <first>Fred</first>
+         <last>Blogs</last>
+      </name>
+      <company>RooJS</company>
+      <email>test@example.com</email>
+      <state>NZ</state>
+      <dob>01/01/2001</dob>
+   </contact>
+</response>
\ No newline at end of file
diff --git a/examples/grid/array-grid.html b/examples/grid/array-grid.html
new file mode 100644 (file)
index 0000000..0d03965
--- /dev/null
@@ -0,0 +1,29 @@
+<html>\r
+<head>\r
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">\r
+<title>Array Grid Example</title>\r
+\r
+     <link rel="stylesheet" type="text/css" href="../../cssX/roojs-all.css"/>
+    <link rel="stylesheet" type="text/css" href="../../cssX/xtheme-slate.css"/>
+
+     <script type="text/javascript" src="../../roojs-all.js"></script>   
+  \r
+    <script type="text/javascript" src="array-grid.js"></script>\r
+    <link rel="stylesheet" type="text/css" href="grid-examples.css" />\r
+\r
+    <!-- Common Styles for the examples -->\r
+    <link rel="stylesheet" type="text/css" href="../examples.css" />\r
+</head>\r
+<body>\r
+<script type="text/javascript" src="../examples.js"></script><!-- EXAMPLES -->\r
+<h1>Array Grid Example</h1>\r
+<p>This example shows how to create a grid from Array data.</p>\r
+<p>Note that the js is not minified so it is readable. See 
+<button type="button" onclick="RooDocs.viewSource.show('/array-grid.js')">array-grid.js</button>  and 
+<button type="button" onclick="RooDocs.viewSource.show('/array-grid.html')">array-grid.html</button> .</p>\r
+\r
+<div id="grid-panel" style="width:600px;height:300px;">\r
+<div id="grid-example"></div>\r
+</div>\r
+</body>\r
+</html>\r
diff --git a/examples/grid/array-grid.js b/examples/grid/array-grid.js
new file mode 100644 (file)
index 0000000..fdfc59e
--- /dev/null
@@ -0,0 +1,118 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */\r
+
+Roo.BLANK_IMAGE_URL  = "../../images/default/s.gif";
\r
+var Example = {\r
+    init : function(){\r
+        // some data yanked off the web\r
+        var myData = [\r
+                       ['3m Co',71.72,0.02,0.03,'9/1 12:00am'],\r
+            ['Alcoa Inc',29.01,0.42,1.47,'9/1 12:00am'],\r
+            ['Altria Group Inc',83.81,0.28,0.34,'9/1 12:00am'],\r
+            ['American Express Company',52.55,0.01,0.02,'9/1 12:00am'],\r
+            ['American International Group, Inc.',64.13,0.31,0.49,'9/1 12:00am'],\r
+            ['AT&T Inc.',31.61,-0.48,-1.54,'9/1 12:00am'],\r
+            ['Boeing Co.',75.43,0.53,0.71,'9/1 12:00am'],\r
+            ['Caterpillar Inc.',67.27,0.92,1.39,'9/1 12:00am'],\r
+            ['Citigroup, Inc.',49.37,0.02,0.04,'9/1 12:00am'],\r
+            ['E.I. du Pont de Nemours and Company',40.48,0.51,1.28,'9/1 12:00am'],\r
+            ['Exxon Mobil Corp',68.1,-0.43,-0.64,'9/1 12:00am'],\r
+            ['General Electric Company',34.14,-0.08,-0.23,'9/1 12:00am'],\r
+            ['General Motors Corporation',30.27,1.09,3.74,'9/1 12:00am'],\r
+            ['Hewlett-Packard Co.',36.53,-0.03,-0.08,'9/1 12:00am'],\r
+            ['Honeywell Intl Inc',38.77,0.05,0.13,'9/1 12:00am'],\r
+            ['Intel Corporation',19.88,0.31,1.58,'9/1 12:00am'],\r
+            ['International Business Machines',81.41,0.44,0.54,'9/1 12:00am'],\r
+            ['Johnson & Johnson',64.72,0.06,0.09,'9/1 12:00am'],\r
+            ['JP Morgan & Chase & Co',45.73,0.07,0.15,'9/1 12:00am'],\r
+            ['McDonald\'s Corporation',36.76,0.86,2.40,'9/1 12:00am'],\r
+            ['Merck & Co., Inc.',40.96,0.41,1.01,'9/1 12:00am'],\r
+            ['Microsoft Corporation',25.84,0.14,0.54,'9/1 12:00am'],\r
+            ['Pfizer Inc',27.96,0.4,1.45,'9/1 12:00am'],\r
+            ['The Coca-Cola Company',45.07,0.26,0.58,'9/1 12:00am'],\r
+            ['The Home Depot, Inc.',34.64,0.35,1.02,'9/1 12:00am'],\r
+            ['The Procter & Gamble Company',61.91,0.01,0.02,'9/1 12:00am'],\r
+            ['United Technologies Corporation',63.26,0.55,0.88,'9/1 12:00am'],\r
+            ['Verizon Communications',35.57,0.39,1.11,'9/1 12:00am'],\r
+            ['Wal-Mart Stores, Inc.',45.45,0.73,1.63,'9/1 12:00am'],\r
+            ['Walt Disney Company (The) (Holding Company)',29.89,0.24,0.81,'9/1 12:00am']\r
+               ];\r
+\r
+        var ds = new Roo.data.Store({\r
+                       proxy: new Roo.data.MemoryProxy(myData),\r
+                       reader: new Roo.data.ArrayReader({}, [\r
+                       {name: 'company'},\r
+                       {name: 'price', type: 'float'},\r
+                       {name: 'change', type: 'float'},\r
+                       {name: 'pctChange', type: 'float'},\r
+                       {name: 'lastChange', type: 'date', dateFormat: 'n/j h:ia'}\r
+                  ])\r
+        });\r
+        ds.load();\r
+\r
+               // example of custom renderer function\r
+        function italic(value){\r
+            return '<i>' + value + '</i>';\r
+        }\r
+\r
+               // example of custom renderer function\r
+        function change(val){\r
+            if(val > 0){\r
+                return '<span style="color:green;">' + val + '</span>';\r
+            }else if(val < 0){\r
+                return '<span style="color:red;">' + val + '</span>';\r
+            }\r
+            return val;\r
+        }\r
+               // example of custom renderer function\r
+        function pctChange(val){\r
+                   if(val > 0){\r
+                       return '<span style="color:green;">' + val + '%</span>';\r
+                   }else if(val < 0){\r
+                       return '<span style="color:red;">' + val + '%</span>';\r
+                   }\r
+                   return val;\r
+               }\r
+\r
+               // the DefaultColumnModel expects this blob to define columns. It can be extended to provide\r
+        // custom or reusable ColumnModels\r
+        var colModel = new Roo.grid.ColumnModel([\r
+                       {id:'company',header: "Company", width: 160, sortable: true, locked:false, dataIndex: 'company'},\r
+                       {header: "Price", width: 75, sortable: true, renderer: Roo.util.Format.usMoney, dataIndex: 'price'},\r
+                       {header: "Change", width: 75, sortable: true, renderer: change, dataIndex: 'change'},\r
+                       {header: "% Change", width: 75, sortable: true, renderer: pctChange, dataIndex: 'pctChange'},\r
+                       {header: "Last Updated", width: 85, sortable: true, renderer: Roo.util.Format.dateRenderer('m/d/Y'), dataIndex: 'lastChange'}\r
+               ]);\r
+\r
+\r
+        // create the Grid\r
+        var grid = new Roo.grid.Grid('grid-example', {\r
+            ds: ds,\r
+            cm: colModel,\r
+            autoExpandColumn: 'company'\r
+        });\r
+        \r
+        var layout = Roo.BorderLayout.create({\r
+            center: {\r
+                margins:{left:3,top:3,right:3,bottom:3},\r
+                panels: [new Roo.GridPanel(grid)]\r
+            }\r
+        }, 'grid-panel');\r
+\r
+        grid.render();\r
+        \r
+\r
+        grid.getSelectionModel().selectFirstRow();\r
+    }\r
+};\r
+Roo.onReady(Example.init, Example);
\ No newline at end of file
diff --git a/examples/grid/custom-grid.html b/examples/grid/custom-grid.html
new file mode 100644 (file)
index 0000000..49b463f
--- /dev/null
@@ -0,0 +1,65 @@
+<html>\r
+<head>\r
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">\r
+<title>Customizing the Grid</title>\r
+\r
+<link rel="stylesheet" type="text/css" href="../../cssX/roojs-all.css"/>
+    <link rel="stylesheet" type="text/css" href="../../cssX/xtheme-slate.css"/>
+\r
+     <link rel="stylesheet" type="text/css" href="../../css/roojs-debug.css"/>
+     <script type="text/javascript" src="../../roojs-all.js"></script>   
+   \r
+<!--\r
+    <script type="text/javascript" src="custom-grid.js"></script>\r
+-->\r
+    <script type="text/javascript" >\r
+    // create the property grid application (single instance)
+    Roo.BLANK_IMAGE_URL  = "../../images/default/s.gif";
\r
+    var CustGrid = function() {\r
+        return {\r
+            init : function() {\r
+                var propsGrid = new Roo.grid.PropertyGrid('props-grid', {\r
+                    nameText: 'Properties Grid',\r
+                    enableHdMenu: false,\r
+                    viewConfig : {\r
+                        forceFit:true,\r
+                        scrollOffset:2 // the grid will never have scrollbars\r
+                    }\r
+                });\r
+\r
+                propsGrid.setSource({\r
+                    "(name)": "Properties Grid",\r
+                    "grouping": false,\r
+                    "autoFitColumns": true,\r
+                    "productionQuality": false,\r
+                    "created": new Date(Date.parse('10/15/2006')),\r
+                    "tested": false,\r
+                    "version": .01,\r
+                    "borderWidth": 1\r
+                });\r
+                \r
+                propsGrid.render();\r
+            }\r
+        };\r
+    }();\r
+\r
+    Roo.onReady(CustGrid.init, CustGrid, true);\r
+\r
+    </script>\r
+\r
+<!-- Common Styles for the examples -->\r
+<link rel="stylesheet" type="text/css" href="../examples.css" />\r
+</head>\r
+<body>\r
+<script type="text/javascript" src="../examples.js"></script><!-- EXAMPLES -->
+
+See source: <button type="button" onclick="RooDocs.viewSource.show('/custom-grid.html')">custom-grid.html</button>
+\r
+<h1>Property Grid</h1>\r
+\r
+<!-- a place holder for the grid. requires the unique id to be passed in the javascript function, and width and height ! -->\r
+<div id="props-grid" style="overflow: hidden; width: 275px;border:1px solid #c3daf9;"></div>\r
+\r
+</body>\r
+</html>\r
diff --git a/examples/grid/custom-grid.js b/examples/grid/custom-grid.js
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/examples/grid/edit-grid.html b/examples/grid/edit-grid.html
new file mode 100644 (file)
index 0000000..022052a
--- /dev/null
@@ -0,0 +1,41 @@
+<html>\r
+<head>\r
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">\r
+<title>Editor Grid Example</title>\r
+\r
\r
+     <link rel="stylesheet" type="text/css" href="../../cssX/roojs-all.css"/>
+    <link rel="stylesheet" type="text/css" href="../../cssX/xtheme-slate.css"/>
+
+     <script type="text/javascript" src="../../roojs-all.js"></script>   
+     \r
+    <script type="text/javascript" src="edit-grid.js"></script>\r
+    <link rel="stylesheet" type="text/css" href="grid-examples.css" />\r
+\r
+<!-- Common Styles for the examples -->\r
+<link rel="stylesheet" type="text/css" href="../examples.css" />\r
+</head>\r
+<body>\r
+<script type="text/javascript" src="../examples.js"></script><!-- EXAMPLES -->\r
+<h1>Editor Grid Example</h1>\r
+<p>This example shows how to create a grid with inline editing. For more details on this example, see <a href="http://www.jackslocum.com/yui/2006/09/10/adding-built-in-editing-support-to-the-yahoo-ui-extensions-grid/">the blog post</a>.</p>\r
+<p>Note that the js is not minified so it is readable. See <a href="edit-grid.js">edit-grid.js</a>.</p>\r
+\r
+<p>The data in the grid is loaded from <a href="plants.xml">plants.xml</a>.</p>\r
+\r
+<!-- you must define the select box here, as the custom editor for the 'Light' column will require it -->\r
+<select name="light" id="light" style="display: none;">\r
+       <option value="Shade">Shade</option>\r
+       <option value="Mostly Shady">Mostly Shady</option>\r
+       <option value="Sun or Shade">Sun or Shade</option>\r
+\r
+       <option value="Mostly Sunny">Mostly Sunny</option>\r
+\r
+       <option value="Sunny">Sunny</option>\r
+</select>\r
+\r
+<div id="grid-panel" style="width:600px;height:300px;">\r
+<div id="editor-grid"></div>\r
+</div>\r
+</body>\r
+</html>\r
diff --git a/examples/grid/edit-grid.js b/examples/grid/edit-grid.js
new file mode 100644 (file)
index 0000000..46a4a75
--- /dev/null
@@ -0,0 +1,142 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+
+Roo.BLANK_IMAGE_URL  = "../../images/default/s.gif";
\r
+Roo.onReady(function(){\r
+    Roo.QuickTips.init();\r
+    function formatBoolean(value){\r
+        return value ? 'Yes' : 'No';  \r
+    };\r
+    \r
+    function formatDate(value){\r
+        return value ? value.dateFormat('M d, Y') : '';\r
+    };\r
+    // shorthand alias\r
+    var fm = Roo.form, Ed = Roo.grid.GridEditor;\r
+\r
+    // the column model has information about grid columns\r
+    // dataIndex maps the column to the specific data field in\r
+    // the data store (created below)\r
+    var cm = new Roo.grid.ColumnModel([{\r
+           header: "Common Name",\r
+           dataIndex: 'common',\r
+           width: 220,\r
+           editor: new Ed(new fm.TextField({\r
+               allowBlank: false\r
+           }))\r
+        },{\r
+           header: "Light",\r
+           dataIndex: 'light',\r
+           width: 130,\r
+           editor: new Ed(new Roo.form.ComboBox({\r
+               typeAhead: true,\r
+               triggerAction: 'all',\r
+               transform:'light',\r
+               lazyRender:true\r
+            }))\r
+        },{\r
+           header: "Price",\r
+           dataIndex: 'price',\r
+           width: 70,\r
+           align: 'right',\r
+           renderer: 'usMoney',\r
+           editor: new Ed(new fm.NumberField({\r
+               allowBlank: false,\r
+               allowNegative: false,\r
+               maxValue: 10\r
+           }))\r
+        },{\r
+           header: "Available",\r
+           dataIndex: 'availDate',\r
+           width: 95,\r
+           renderer: formatDate,\r
+           editor: new Ed(new fm.DateField({\r
+                format: 'm/d/y',\r
+                minValue: '01/01/06',\r
+                disabledDays: [0, 6],\r
+                disabledDaysText: 'Plants are not available on the weekends'\r
+            }))\r
+        },{\r
+           header: "Indoor?",\r
+           dataIndex: 'indoor',\r
+           width: 55,\r
+           renderer: formatBoolean,\r
+           editor: new Ed(new fm.Checkbox())\r
+        }]);\r
+\r
+    // by default columns are sortable\r
+    cm.defaultSortable = true;\r
+\r
+    // this could be inline, but we want to define the Plant record\r
+    // type so we can add records dynamically\r
+    var Plant = Roo.data.Record.create([\r
+           // the "name" below matches the tag name to read, except "availDate"\r
+           // which is mapped to the tag "availability"\r
+           {name: 'common', type: 'string'},\r
+           {name: 'botanical', type: 'string'},\r
+           {name: 'light'},\r
+           {name: 'price', type: 'float'},             // automatic date conversions\r
+           {name: 'availDate', mapping: 'availability', type: 'date', dateFormat: 'm/d/Y'},\r
+           {name: 'indoor', type: 'bool'}\r
+      ]);\r
+\r
+    // create the Data Store\r
+    var ds = new Roo.data.Store({\r
+        // load using HTTP\r
+        proxy: new Roo.data.HttpProxy({url: 'plants.xml'}),\r
+\r
+        // the return will be XML, so lets set up a reader\r
+        reader: new Roo.data.XmlReader({\r
+               // records will have a "plant" tag\r
+               record: 'plant'\r
+           }, Plant)\r
+    });\r
+\r
+    // create the editor grid\r
+    var grid = new Roo.grid.EditorGrid('editor-grid', {\r
+        ds: ds,\r
+        cm: cm,\r
+        enableColLock:false\r
+    });\r
+\r
+    var layout = Roo.BorderLayout.create({\r
+        center: {\r
+            margins:{left:3,top:3,right:3,bottom:3},\r
+            panels: [new Roo.GridPanel(grid)]\r
+        }\r
+    }, 'grid-panel');\r
+\r
+\r
+    // render it\r
+    grid.render();\r
+\r
+    \r
+    var gridHead = grid.getView().getHeaderPanel(true);\r
+    var tb = new Roo.Toolbar(gridHead, [{\r
+        text: 'Add Plant',\r
+        handler : function(){\r
+            var p = new Plant({\r
+                common: 'New Plant 1',\r
+                light: 'Mostly Shade',\r
+                price: 0,\r
+                availDate: new Date(),\r
+                indoor: false\r
+            });\r
+            grid.stopEditing();\r
+            ds.insert(0, p);\r
+            grid.startEditing(0, 0);\r
+        }\r
+    }]);\r
+\r
+    // trigger the data store load\r
+    ds.load();\r
+});
\ No newline at end of file
diff --git a/examples/grid/from-markup.html b/examples/grid/from-markup.html
new file mode 100644 (file)
index 0000000..03e3707
--- /dev/null
@@ -0,0 +1,68 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">\r
+<html>\r
+<head>\r
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">\r
+<title>From Markup Grid Example</title>\r
+
+     <link rel="stylesheet" type="text/css" href="../../cssX/roojs-all.css"/>
+    <link rel="stylesheet" type="text/css" href="../../cssX/xtheme-slate.css"/>
+
+     <script type="text/javascript" src="../../roojs-debug.js"></script>   
+    \r
+\r
+    <script type="text/javascript" src="from-markup.js"></script>\r
+    <link rel="stylesheet" type="text/css" href="grid-examples.css" />\r
+    <!-- Common Styles for the examples -->\r
+    <link rel="stylesheet" type="text/css" href="../examples.css" />\r
+<style type="text/css">\r
+#the-table { border:1px solid #bbb;border-collapse:collapse; }\r
+#the-table td,#the-table th { border:1px solid #ccc;border-collapse:collapse;padding:5px; }\r
+</style>\r
+</head>\r
+<body>\r
+<script type="text/javascript" src="../examples.js"></script><!-- EXAMPLES -->\r
+<h1>From Markup Grid Example</h1>\r
+<p>This example shows how to create a grid with from an existing, unformatted HTML table.</p>\r
+<p>Note that the js is not minified so it is readable. See <a href="from-markup.js">from-markup.js</a>.</p>\r
+<button id="create-grid" type="button">Create grid</button>\r
+<br />\r
+<br />\r
+<table cellspacing="0" id="the-table">\r
+        <thead>\r
+            <tr style="background:#eeeeee;">\r
+                <th>Name</th>\r
+                <th>Age</th>\r
+                <th>Sex</th>\r
+            </tr>\r
+        </thead>\r
+        <tbody>\r
+            <tr>\r
+                <td>Barney Rubble</td>\r
+                <td>32</td>\r
+                <td>Male</td>\r
+            </tr>\r
+            <tr>\r
+                <td>Fred Flintstone</td>\r
+                <td>33</td>\r
+                <td>Male</td>\r
+            </tr>\r
+            <tr>\r
+                <td>Betty Rubble</td>\r
+                <td>32</td>\r
+                <td>Female</td>\r
+            </tr>\r
+            <tr>\r
+                <td>Pebbles</td>\r
+                <td>1</td>\r
+                <td>Female</td>\r
+            </tr>\r
+            <tr>\r
+                <td>Bamm Bamm</td>\r
+                <td>2</td>\r
+                <td>Male</td>\r
+            </tr>\r
+        </tbody>\r
+    </table>\r
+\r
+</body>\r
+</html>
\ No newline at end of file
diff --git a/examples/grid/from-markup.js b/examples/grid/from-markup.js
new file mode 100644 (file)
index 0000000..6f59ffd
--- /dev/null
@@ -0,0 +1,95 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+
+Roo.BLANK_IMAGE_URL  = "../../images/default/s.gif";
\r
+Roo.onReady(function() {\r
+    var btn = Roo.get("create-grid");\r
+    btn.on("click", function(){\r
+        btn.dom.disabled = true;\r
+\r
+        // create the grid\r
+        var grid = new Roo.grid.TableGrid("the-table");\r
+        grid.render();\r
+\r
+    }, false, {single:true}); // run once\r
+});\r
+\r
+/**\r
+ * @class Roo.grid.TableGrid\r
+ * @extends Roo.grid.Grid\r
+ * A Grid which creates itself from an existing HTML table element.\r
+ * @constructor\r
+ * @param {String/HTMLElement/Roo.Element} table The table element from which this grid will be created - \r
+ * The table MUST have some type of size defined for the grid to fill. The container will be \r
+ * automatically set to position relative if it isn't already.\r
+ * @param {Object} config A config object that sets properties on this grid and has two additional (optional)\r
+ * properties: fields and columns which allow for customizing data fields and columns for this grid.\r
+ * @history\r
+ * 2007-03-01 Original version by Nige "Animal" White\r
+ * 2007-03-10 jvs Slightly refactored to reuse existing classes\r
+ */\r
+Roo.grid.TableGrid = function(table, config) {\r
+    config = config || {};\r
+    var cf = config.fields || [], ch = config.columns || [];\r
+    table = Roo.get(table);\r
+\r
+    var ct = table.insertSibling();\r
+\r
+    var fields = [], cols = [];\r
+    var headers = table.query("thead th");\r
+       for (var i = 0, h; h = headers[i]; i++) {\r
+               var text = h.innerHTML;\r
+               var name = 'tcol-'+i;\r
+\r
+        fields.push(Roo.applyIf(cf[i] || {}, {\r
+            name: name,\r
+            mapping: 'td:nth('+(i+1)+')/@innerHTML'\r
+        }));\r
+\r
+               cols.push(Roo.applyIf(ch[i] || {}, {\r
+                       'header': text,\r
+                       'dataIndex': name,\r
+                       'width': h.offsetWidth,\r
+                       'tooltip': h.title,\r
+            'sortable': true\r
+        }));\r
+       }\r
+\r
+    var ds  = new Roo.data.Store({\r
+        reader: new Roo.data.XmlReader({\r
+            record:'tbody tr'\r
+        }, fields)\r
+    });\r
+\r
+       ds.loadData(table.dom);\r
+\r
+    var cm = new Roo.grid.ColumnModel(cols);\r
+\r
+    if(config.width || config.height){\r
+        ct.setSize(config.width || 'auto', config.height || 'auto');\r
+    }\r
+    if(config.remove !== false){\r
+        table.remove();\r
+    }\r
+\r
+    Roo.grid.TableGrid.superclass.constructor.call(this, ct,\r
+        Roo.applyIf(config, {\r
+            'ds': ds,\r
+            'cm': cm,\r
+            'sm': new Roo.grid.RowSelectionModel(),\r
+            autoHeight:true,\r
+            autoWidth:true\r
+        }\r
+    ));\r
+};\r
+\r
+Roo.extend(Roo.grid.TableGrid, Roo.grid.Grid);
\ No newline at end of file
diff --git a/examples/grid/paging.html b/examples/grid/paging.html
new file mode 100644 (file)
index 0000000..9d0bce1
--- /dev/null
@@ -0,0 +1,39 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+<title>Paging Grid Example</title>
+   <link rel="stylesheet" type="text/css" href="../../cssX/roojs-all.css"/>
+    <link rel="stylesheet" type="text/css" href="../../cssX/xtheme-slate.css"/>
+
+    <script type="text/javascript" src="../../roojs-all.js"></script>   
+    
+<script type="text/javascript" src="paging.js"></script>
+<link rel="stylesheet" type="text/css" href="grid-examples.css" />
+
+<!-- Common Styles for the examples -->
+<link rel="stylesheet" type="text/css" href="../examples.css" />
+
+
+
+</head>
+<body>
+<script type="text/javascript" src="../examples.js"></script><!-- EXAMPLES -->
+<h1>Paging Grid Example</h1>
+<p>This example shows how to create a grid with paging. This grid uses a ScriptTagProxy to fetch cross-domain
+    remote data (from the Ext forums).</p>
+<p>Note that the js is not minified so it is readable. See <a href="paging.js">paging.js</a>.</p>
+
+    <div style="width:694px;" class="x-box-blue">
+        <div class="x-box-tl"><div class="x-box-tr"><div class="x-box-tc"></div></div></div>
+        <div class="x-box-ml"><div class="x-box-mr"><div class="x-box-mc">
+            <h3 style="margin-bottom:5px;">Ext - Help Forum</h3>
+            <div id="topic-grid" style="border:1px solid #99bbe8;overflow: hidden; width: 665px; height: 300px;position:relative;left:0;top:0;"></div>
+        </div></div></div>
+        <div class="x-box-bl"><div class="x-box-br"><div class="x-box-bc"></div></div></div>
+    </div>
+
+
+</body>
+</html>
diff --git a/examples/grid/paging.js b/examples/grid/paging.js
new file mode 100644 (file)
index 0000000..4eda9fb
--- /dev/null
@@ -0,0 +1,129 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+
+Roo.BLANK_IMAGE_URL  = "../../images/default/s.gif";
+
+
+Roo.onReady(function(){
+
+    // create the Data Store
+    var ds = new Roo.data.Store({
+        // load using script tags for cross domain, if the data in on the same domain as
+        // this page, an HttpProxy would be better
+        proxy: new Roo.data.ScriptTagProxy({
+            url: 'http://extjs.com/forum/topics-remote.php'
+        }),
+
+        // create reader that reads the Topic records
+        reader: new Roo.data.JsonReader({
+            root: 'topics',
+            totalProperty: 'totalCount',
+            id: 'post_id'
+        }, [
+            {name: 'title', mapping: 'topic_title'},
+            {name: 'author', mapping: 'author'},
+            {name: 'totalPosts', mapping: 'topic_replies', type: 'int'},
+            {name: 'lastPost', mapping: 'post_time', type: 'date', dateFormat: 'timestamp'},
+            {name: 'excerpt', mapping: 'post_text'}
+        ]),
+
+        // turn on remote sorting
+        remoteSort: true
+    });
+
+
+    // pluggable renders
+    function renderTopic(value, p, record){
+        return String.format('<b>{0}</b>{1}', value, record.data['excerpt']);
+    }
+    function renderTopicPlain(value){
+        return String.format('<b><i>{0}</i></b>', value);
+    }
+    function renderLast(value, p, r){
+        return String.format('{0}<br/>by {1}', value.dateFormat('M j, Y, g:i a'), r.data['author']);
+    }
+    function renderLastPlain(value){
+        return value.dateFormat('M j, Y, g:i a');
+    }
+
+    // the column model has information about grid columns
+    // dataIndex maps the column to the specific data field in
+    // the data store
+    var cm = new Roo.grid.ColumnModel([{
+           id: 'topic', // id assigned so we can apply custom css (e.g. .x-grid-col-topic b { color:#333 })
+           header: "Topic",
+           dataIndex: 'title',
+           width: 490,
+           renderer: renderTopic,
+           css: 'white-space:normal;'
+        },{
+           header: "Author",
+           dataIndex: 'author',
+           width: 100,
+           hidden: true
+        },{
+           id: 'last',
+           header: "Last Post",
+           dataIndex: 'lastPost',
+           width: 150,
+           renderer: renderLast
+        }]);
+
+    
+
+    // create the editor grid
+    var grid = new Roo.grid.Grid('topic-grid', {
+        ds: ds,
+        cm: cm,
+        selModel: new Roo.grid.RowSelectionModel({singleSelect:true}),
+        enableColLock:false,
+        loadMask: true
+    });
+
+    // make the grid resizable, do before render for better performance
+    var rz = new Roo.Resizable('topic-grid', {
+        wrap:true,
+        minHeight:100,
+        pinned:true,
+        handles: 's'
+    });
+    rz.on('resize', grid.autoSize, grid);
+
+    // render it
+    grid.render();
+
+    var gridFoot = grid.getView().getFooterPanel(true);
+
+    // add a paging toolbar to the grid's footer
+    var paging = new Roo.PagingToolbar(gridFoot, ds, {
+        pageSize: 25,
+        displayInfo: true,
+        displayMsg: 'Displaying topics {0} - {1} of {2}',
+        emptyMsg: "No topics to display"
+    });
+    // add the detailed view button
+    paging.add('-', {
+        pressed: true,
+        enableToggle:true,
+        text: 'Detailed View',
+        cls: 'x-btn-text-icon details',
+        toggleHandler: toggleDetails
+    });
+
+    // trigger the data store load
+    ds.load({params:{start:0, limit:25}});
+
+    function toggleDetails(btn, pressed){
+        cm.getColumnById('topic').renderer = pressed ? renderTopic : renderTopicPlain;
+        cm.getColumnById('last').renderer = pressed ? renderLast : renderLastPlain;
+        grid.getView().refresh();
+    }
+});
diff --git a/examples/grid/plants.xml b/examples/grid/plants.xml
new file mode 100644 (file)
index 0000000..dfb0ea5
--- /dev/null
@@ -0,0 +1,327 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+<catalog>
+  <plant>
+    <common>Bloodroot</common>
+    <botanical>Sanguinaria canadensis</botanical>
+    <zone>4</zone>
+    <light>Mostly Shady</light>
+    <price>2.44</price>
+    <availability>03/15/2006</availability>
+    <indoor>true</indoor>
+  </plant>
+  <plant>
+    <common>Columbine</common>
+    <botanical>Aquilegia canadensis</botanical>
+    <zone>3</zone>
+    <light>Mostly Shady</light>
+    <price>9.37</price>
+    <availability>03/06/2006</availability>
+    <indoor>true</indoor>
+  </plant>
+  <plant>
+    <common>Marsh Marigold</common>
+    <botanical>Caltha palustris</botanical>
+    <zone>4</zone>
+    <light>Mostly Sunny</light>
+    <price>6.81</price>
+    <availability>05/17/2006</availability>
+    <indoor>false</indoor>
+  </plant>
+  <plant>
+    <common>Cowslip</common>
+    <botanical>Caltha palustris</botanical>
+    <zone>4</zone>
+    <light>Mostly Shady</light>
+    <price>9.90</price>
+    <availability>03/06/2006</availability>
+    <indoor>true</indoor>
+  </plant>
+  <plant>
+    <common>Dutchman's-Breeches</common>
+    <botanical>Dicentra cucullaria</botanical>
+    <zone>3</zone>
+    <light>Mostly Shady</light>
+    <price>6.44</price>
+    <availability>01/20/2006</availability>
+    <indoor>true</indoor>
+  </plant>
+  <plant>
+    <common>Ginger, Wild</common>
+    <botanical>Asarum canadense</botanical>
+    <zone>3</zone>
+    <light>Mostly Shady</light>
+    <price>9.03</price>
+    <availability>04/18/2006</availability>
+    <indoor>true</indoor>
+  </plant>
+  <plant>
+    <common>Hepatica</common>
+    <botanical>Hepatica americana</botanical>
+    <zone>4</zone>
+    <light>Mostly Shady</light>
+    <price>4.45</price>
+    <availability>01/26/2006</availability>
+    <indoor>true</indoor>
+  </plant>
+  <plant>
+    <common>Liverleaf</common>
+    <botanical>Hepatica americana</botanical>
+    <zone>4</zone>
+    <light>Mostly Shady</light>
+    <price>3.99</price>
+    <availability>01/02/2006</availability>
+    <indoor>true</indoor>
+  </plant>
+  <plant>
+    <common>Jack-In-The-Pulpit</common>
+    <botanical>Arisaema triphyllum</botanical>
+    <zone>4</zone>
+    <light>Mostly Shady</light>
+    <price>3.23</price>
+    <availability>02/01/2006</availability>
+    <indoor>true</indoor>
+  </plant>
+  <plant>
+    <common>Mayapple</common>
+    <botanical>Podophyllum peltatum</botanical>
+    <zone>3</zone>
+    <light>Mostly Shady</light>
+    <price>2.98</price>
+    <availability>06/05/2006</availability>
+    <indoor>true</indoor>
+  </plant>
+  <plant>
+    <common>Phlox, Woodland</common>
+    <botanical>Phlox divaricata</botanical>
+    <zone>3</zone>
+    <light>Sun or Shade</light>
+    <price>2.80</price>
+    <availability>01/22/2006</availability>
+    <indoor>false</indoor>
+  </plant>
+  <plant>
+    <common>Phlox, Blue</common>
+    <botanical>Phlox divaricata</botanical>
+    <zone>3</zone>
+    <light>Sun or Shade</light>
+    <price>5.59</price>
+    <availability>02/16/2006</availability>
+    <indoor>false</indoor>
+  </plant>
+  <plant>
+    <common>Spring-Beauty</common>
+    <botanical>Claytonia Virginica</botanical>
+    <zone>7</zone>
+    <light>Mostly Shady</light>
+    <price>6.59</price>
+    <availability>02/01/2006</availability>
+    <indoor>true</indoor>
+  </plant>
+  <plant>
+    <common>Trillium</common>
+    <botanical>Trillium grandiflorum</botanical>
+    <zone>5</zone>
+    <light>Sun or Shade</light>
+    <price>3.90</price>
+    <availability>04/29/2006</availability>
+    <indoor>false</indoor>
+  </plant>
+  <plant>
+    <common>Wake Robin</common>
+    <botanical>Trillium grandiflorum</botanical>
+    <zone>5</zone>
+    <light>Sun or Shade</light>
+    <price>3.20</price>
+    <availability>02/21/2006</availability>
+    <indoor>false</indoor>
+  </plant>
+  <plant>
+    <common>Violet, Dog-Tooth</common>
+    <botanical>Erythronium americanum</botanical>
+    <zone>4</zone>
+    <light>Shade</light>
+    <price>9.04</price>
+    <availability>02/01/2006</availability>
+    <indoor>true</indoor>
+  </plant>
+  <plant>
+    <common>Trout Lily</common>
+    <botanical>Erythronium americanum</botanical>
+    <zone>4</zone>
+    <light>Shade</light>
+    <price>6.94</price>
+    <availability>03/24/2006</availability>
+    <indoor>true</indoor>
+  </plant>
+  <plant>
+    <common>Adder's-Tongue</common>
+    <botanical>Erythronium americanum</botanical>
+    <zone>4</zone>
+    <light>Shade</light>
+    <price>9.58</price>
+    <availability>04/13/2006</availability>
+    <indoor>true</indoor>
+  </plant>
+  <plant>
+    <common>Anemone</common>
+    <botanical>Anemone blanda</botanical>
+    <zone>6</zone>
+    <light>Mostly Shady</light>
+    <price>8.86</price>
+    <availability>12/26/2006</availability>
+    <indoor>true</indoor>
+  </plant>
+  <plant>
+    <common>Grecian Windflower</common>
+    <botanical>Anemone blanda</botanical>
+    <zone>6</zone>
+    <light>Mostly Shady</light>
+    <price>9.16</price>
+    <availability>07/10/2006</availability>
+    <indoor>true</indoor>
+  </plant>
+  <plant>
+    <common>Bee Balm</common>
+    <botanical>Monarda didyma</botanical>
+    <zone>4</zone>
+    <light>Shade</light>
+    <price>4.59</price>
+    <availability>05/03/2006</availability>
+    <indoor>true</indoor>
+  </plant>
+  <plant>
+    <common>Bergamot</common>
+    <botanical>Monarda didyma</botanical>
+    <zone>4</zone>
+    <light>Shade</light>
+    <price>7.16</price>
+    <availability>04/27/2006</availability>
+    <indoor>true</indoor>
+  </plant>
+  <plant>
+    <common>Black-Eyed Susan</common>
+    <botanical>Rudbeckia hirta</botanical>
+    <zone>Annual</zone>
+    <light>Sunny</light>
+    <price>9.80</price>
+    <availability>06/18/2006</availability>
+    <indoor>false</indoor>
+  </plant>
+  <plant>
+    <common>Buttercup</common>
+    <botanical>Ranunculus</botanical>
+    <zone>4</zone>
+    <light>Shade</light>
+    <price>2.57</price>
+    <availability>06/10/2006</availability>
+    <indoor>true</indoor>
+  </plant>
+  <plant>
+    <common>Crowfoot</common>
+    <botanical>Ranunculus</botanical>
+    <zone>4</zone>
+    <light>Shade</light>
+    <price>9.34</price>
+    <availability>04/03/2006</availability>
+    <indoor>true</indoor>
+  </plant>
+  <plant>
+    <common>Butterfly Weed</common>
+    <botanical>Asclepias tuberosa</botanical>
+    <zone>Annual</zone>
+    <light>Sunny</light>
+    <price>2.78</price>
+    <availability>06/30/2006</availability>
+    <indoor>false</indoor>
+  </plant>
+  <plant>
+    <common>Cinquefoil</common>
+    <botanical>Potentilla</botanical>
+    <zone>Annual</zone>
+    <light>Shade</light>
+    <price>7.06</price>
+    <availability>05/25/2006</availability>
+    <indoor>true</indoor>
+  </plant>
+  <plant>
+    <common>Primrose</common>
+    <botanical>Oenothera</botanical>
+    <zone>3 - 5</zone>
+    <light>Sunny</light>
+    <price>6.56</price>
+    <availability>01/30/2006</availability>
+    <indoor>false</indoor>
+  </plant>
+  <plant>
+    <common>Gentian</common>
+    <botanical>Gentiana</botanical>
+    <zone>4</zone>
+    <light>Sun or Shade</light>
+    <price>7.81</price>
+    <availability>05/18/2006</availability>
+    <indoor>false</indoor>
+  </plant>
+  <plant>
+    <common>Blue Gentian</common>
+    <botanical>Gentiana</botanical>
+    <zone>4</zone>
+    <light>Sun or Shade</light>
+    <price>8.56</price>
+    <availability>05/02/2006</availability>
+    <indoor>false</indoor>
+  </plant>
+  <plant>
+    <common>Jacob's Ladder</common>
+    <botanical>Polemonium caeruleum</botanical>
+    <zone>Annual</zone>
+    <light>Shade</light>
+    <price>9.26</price>
+    <availability>02/21/2006</availability>
+    <indoor>true</indoor>
+  </plant>
+  <plant>
+    <common>Greek Valerian</common>
+    <botanical>Polemonium caeruleum</botanical>
+    <zone>Annual</zone>
+    <light>Shade</light>
+    <price>4.36</price>
+    <availability>07/14/2006</availability>
+    <indoor>true</indoor>
+  </plant>
+  <plant>
+    <common>California Poppy</common>
+    <botanical>Eschscholzia californica</botanical>
+    <zone>Annual</zone>
+    <light>Sunny</light>
+    <price>7.89</price>
+    <availability>03/27/2006</availability>
+    <indoor>false</indoor>
+  </plant>
+  <plant>
+    <common>Shooting Star</common>
+    <botanical>Dodecatheon</botanical>
+    <zone>Annual</zone>
+    <light>Mostly Shady</light>
+    <price>8.60</price>
+    <availability>05/13/2006</availability>
+    <indoor>true</indoor>
+  </plant>
+  <plant>
+    <common>Snakeroot</common>
+    <botanical>Cimicifuga</botanical>
+    <zone>Annual</zone>
+    <light>Shade</light>
+    <price>5.63</price>
+    <availability>07/11/2006</availability>
+    <indoor>true</indoor>
+  </plant>
+  <plant>
+    <common>Cardinal Flower</common>
+    <botanical>Lobelia cardinalis</botanical>
+    <zone>2</zone>
+    <light>Shade</light>
+    <price>3.02</price>
+    <availability>02/22/2006</availability>
+    <indoor>true</indoor>
+  </plant>
+</catalog>
\ No newline at end of file
diff --git a/examples/grid/sheldon.xml b/examples/grid/sheldon.xml
new file mode 100644 (file)
index 0000000..2ab61f0
--- /dev/null
@@ -0,0 +1,151 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ItemSearchResponse xmlns="http://webservices.amazon.com/AWSECommerceService/2006-06-28">
+    <OperationRequest>
+        <HTTPHeaders>
+            <Header Name="UserAgent"
+                    Value="Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 5.1; Avant Browser; Avant Browser; .NET CLR 1.0.3705; .NET CLR 2.0.50727; .NET CLR 1.1.4322; Media Center PC 4.0; InfoPath.2)"></Header>
+        </HTTPHeaders>
+        <RequestId>18CZWZFXKSV8F601AGMF</RequestId>
+        <Arguments>
+            <Argument Name="Service" Value="AWSECommerceService"></Argument>
+            <Argument Name="AssociateTag" Value="ws"></Argument>
+            <Argument Name="SearchIndex" Value="Books"></Argument>
+            <Argument Name="Author" Value="Sidney Sheldon"></Argument>
+            <Argument Name="SubscriptionId" Value="1A7XKHR5BYD0WPJVQEG2"></Argument>
+            <Argument Name="Version" Value="2006-06-28"></Argument>
+            <Argument Name="Operation" Value="ItemSearch"></Argument>
+        </Arguments>
+        <RequestProcessingTime>1.05041599273682</RequestProcessingTime>
+    </OperationRequest>
+    <Items>
+        <Request>
+            <IsValid>True</IsValid>
+            <ItemSearchRequest>
+                <Author>Sidney Sheldon</Author>
+                <SearchIndex>Books</SearchIndex>
+            </ItemSearchRequest>
+        </Request>
+        <TotalResults>203</TotalResults>
+        <TotalPages>21</TotalPages>
+        <Item>
+            <ASIN>0446355453</ASIN>
+            <DetailPageURL>
+                http://www.amazon.com/gp/redirect.html%3FASIN=0446355453%26tag=ws%26lcode=xm2%26cID=2025%26ccmID=165953%26location=/o/ASIN/0446355453%253FSubscriptionId=1A7XKHR5BYD0WPJVQEG2
+            </DetailPageURL>
+            <ItemAttributes>
+                <Author>Sidney Sheldon</Author>
+                <Manufacturer>Warner Books</Manufacturer>
+                <ProductGroup>Book</ProductGroup>
+                <Title>Master of the Game</Title>
+            </ItemAttributes>
+        </Item>
+        <Item>
+            <ASIN>0446613657</ASIN>
+            <DetailPageURL>
+                http://www.amazon.com/gp/redirect.html%3FASIN=0446613657%26tag=ws%26lcode=xm2%26cID=2025%26ccmID=165953%26location=/o/ASIN/0446613657%253FSubscriptionId=1A7XKHR5BYD0WPJVQEG2
+            </DetailPageURL>
+            <ItemAttributes>
+                <Author>Sidney Sheldon</Author>
+                <Manufacturer>Warner Books</Manufacturer>
+                <ProductGroup>Book</ProductGroup>
+                <Title>Are You Afraid of the Dark?</Title>
+            </ItemAttributes>
+        </Item>
+        <Item>
+            <ASIN>0446357421</ASIN>
+            <DetailPageURL>
+                http://www.amazon.com/gp/redirect.html%3FASIN=0446357421%26tag=ws%26lcode=xm2%26cID=2025%26ccmID=165953%26location=/o/ASIN/0446357421%253FSubscriptionId=1A7XKHR5BYD0WPJVQEG2
+            </DetailPageURL>
+            <ItemAttributes>
+                <Author>Sidney Sheldon</Author>
+                <Manufacturer>Warner Books</Manufacturer>
+                <ProductGroup>Book</ProductGroup>
+                <Title>If Tomorrow Comes</Title>
+            </ItemAttributes>
+        </Item>
+        <Item>
+            <ASIN>0446607207</ASIN>
+            <DetailPageURL>
+                http://www.amazon.com/gp/redirect.html%3FASIN=0446607207%26tag=ws%26lcode=xm2%26cID=2025%26ccmID=165953%26location=/o/ASIN/0446607207%253FSubscriptionId=1A7XKHR5BYD0WPJVQEG2
+            </DetailPageURL>
+            <ItemAttributes>
+                <Author>Sidney Sheldon</Author>
+                <Manufacturer>Warner Vision</Manufacturer>
+                <ProductGroup>Book</ProductGroup>
+                <Title>Tell Me Your Dreams</Title>
+            </ItemAttributes>
+        </Item>
+        <Item>
+            <ASIN>0446357448</ASIN>
+            <DetailPageURL>
+                http://www.amazon.com/gp/redirect.html%3FASIN=0446357448%26tag=ws%26lcode=xm2%26cID=2025%26ccmID=165953%26location=/o/ASIN/0446357448%253FSubscriptionId=1A7XKHR5BYD0WPJVQEG2
+            </DetailPageURL>
+            <ItemAttributes>
+                <Author>Sidney Sheldon</Author>
+                <Manufacturer>Warner Books</Manufacturer>
+                <ProductGroup>Book</ProductGroup>
+                <Title>Bloodline</Title>
+            </ItemAttributes>
+        </Item>
+        <Item>
+            <ASIN>0446532673</ASIN>
+            <DetailPageURL>
+                http://www.amazon.com/gp/redirect.html%3FASIN=0446532673%26tag=ws%26lcode=xm2%26cID=2025%26ccmID=165953%26location=/o/ASIN/0446532673%253FSubscriptionId=1A7XKHR5BYD0WPJVQEG2
+            </DetailPageURL>
+            <ItemAttributes>
+                <Author>Sidney Sheldon</Author>
+                <Manufacturer>Warner Books</Manufacturer>
+                <ProductGroup>Book</ProductGroup>
+                <Title>The Other Side of Me</Title>
+            </ItemAttributes>
+        </Item>
+        <Item>
+            <ASIN>0446356573</ASIN>
+            <DetailPageURL>
+                http://www.amazon.com/gp/redirect.html%3FASIN=0446356573%26tag=ws%26lcode=xm2%26cID=2025%26ccmID=165953%26location=/o/ASIN/0446356573%253FSubscriptionId=1A7XKHR5BYD0WPJVQEG2
+            </DetailPageURL>
+            <ItemAttributes>
+                <Author>Sidney Sheldon</Author>
+                <Manufacturer>Warner Books</Manufacturer>
+                <ProductGroup>Book</ProductGroup>
+                <Title>A Stranger in the Mirror</Title>
+            </ItemAttributes>
+        </Item>
+        <Item>
+            <ASIN>0060198346</ASIN>
+            <DetailPageURL>
+                http://www.amazon.com/gp/redirect.html%3FASIN=0060198346%26tag=ws%26lcode=xm2%26cID=2025%26ccmID=165953%26location=/o/ASIN/0060198346%253FSubscriptionId=1A7XKHR5BYD0WPJVQEG2
+            </DetailPageURL>
+            <ItemAttributes>
+                <Author>Sidney Sheldon</Author>
+                <Manufacturer>William Morrow &amp; Company</Manufacturer>
+                <ProductGroup>Book</ProductGroup>
+                <Title>The Sky Is Falling</Title>
+            </ItemAttributes>
+        </Item>
+        <Item>
+            <ASIN>0446354732</ASIN>
+            <DetailPageURL>
+                http://www.amazon.com/gp/redirect.html%3FASIN=0446354732%26tag=ws%26lcode=xm2%26cID=2025%26ccmID=165953%26location=/o/ASIN/0446354732%253FSubscriptionId=1A7XKHR5BYD0WPJVQEG2
+            </DetailPageURL>
+            <ItemAttributes>
+                <Author>Sidney Sheldon</Author>
+                <Manufacturer>Warner Books</Manufacturer>
+                <ProductGroup>Book</ProductGroup>
+                <Title>Nothing Lasts Forever</Title>
+            </ItemAttributes>
+        </Item>
+        <Item>
+            <ASIN>0446341916</ASIN>
+            <DetailPageURL>
+                http://www.amazon.com/gp/redirect.html%3FASIN=0446341916%26tag=ws%26lcode=xm2%26cID=2025%26ccmID=165953%26location=/o/ASIN/0446341916%253FSubscriptionId=1A7XKHR5BYD0WPJVQEG2
+            </DetailPageURL>
+            <ItemAttributes>
+                <Author>Sidney Sheldon</Author>
+                <Manufacturer>Warner Books</Manufacturer>
+                <ProductGroup>Book</ProductGroup>
+                <Title>The Naked Face</Title>
+            </ItemAttributes>
+        </Item>
+    </Items>
+</ItemSearchResponse>
\ No newline at end of file
diff --git a/examples/grid/xml-grid.html b/examples/grid/xml-grid.html
new file mode 100644 (file)
index 0000000..c00bc61
--- /dev/null
@@ -0,0 +1,34 @@
+<html>\r
+<head>\r
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">\r
+<title>XML Grid Example</title>\r
+\r
+\r
+    <link rel="stylesheet" type="text/css" href="../../cssX/roojs-all.css"/>
+    <link rel="stylesheet" type="text/css" href="../../cssX/xtheme-slate.css"/>
+
+    <script type="text/javascript" src="../../roojs-all.js"></script>   
+   \r
+    <script type="text/javascript" src="xml-grid.js"></script>\r
+    <link rel="stylesheet" type="text/css" href="grid-examples.css" />\r
+\r
+    <!-- Common Styles for the examples -->\r
+    <link rel="stylesheet" type="text/css" href="../examples.css" />\r
+</head>
+\r
+<body>\r
+<script type="text/javascript" src="../examples.js"></script><!-- EXAMPLES -->\r
+<h1>XML Grid Example</h1>\r
+<p>This example shows how to load a grid with XML data. For more details on this example, see <a href="http://www.jackslocum.com/yui/2006/08/31/a-grid-component-for-yahoo-ui-part-2/">the blog post</a>.</p>\r
+\r
+<p>This grid also uses autoHeight and autoWidth to dynamically size to fit it's data and columns.</p>\r
+\r
+<p>Note that the js is not minified so it is readable. See <a href="xml-grid.js">xml-grid.js</a>.</p>\r
+\r
+<p>The data in the grid is loaded from <a href="sheldon.xml">sheldon.xml</a>, which is directly from an Amazon.com search.</p>\r
+\r
+<!-- a place holder for the grid. requires the unique id to be passed in the javascript function, and width and height ! -->\r
+<div id="example-grid" class="x-grid-mso" style="border: 1px solid #c3daf9; overflow: hidden; width:520px;"></div>\r
+\r
+</body>\r
+</html>\r
diff --git a/examples/grid/xml-grid.js b/examples/grid/xml-grid.js
new file mode 100644 (file)
index 0000000..5c87132
--- /dev/null
@@ -0,0 +1,52 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+
+Roo.BLANK_IMAGE_URL  = "../../images/default/s.gif";
+
+\r
+Roo.onReady(function(){\r
+\r
+    // create the Data Store\r
+    var ds = new Roo.data.Store({\r
+        // load using HTTP\r
+        proxy: new Roo.data.HttpProxy({url: 'sheldon.xml'}),\r
+\r
+        // the return will be XML, so lets set up a reader\r
+        reader: new Roo.data.XmlReader({\r
+               // records will have an "Item" tag\r
+               record: 'Item',\r
+               id: 'ASIN',\r
+               totalRecords: '@total'\r
+           }, [\r
+               // set up the fields mapping into the xml doc\r
+               // The first needs mapping, the others are very basic\r
+               {name: 'Author', mapping: 'ItemAttributes > Author'},\r
+               'Title', 'Manufacturer', 'ProductGroup'\r
+           ])\r
+    });\r
+\r
+    var cm = new Roo.grid.ColumnModel([\r
+           {header: "Author", width: 120, dataIndex: 'Author'},\r
+               {header: "Title", width: 180, dataIndex: 'Title'},\r
+               {header: "Manufacturer", width: 115, dataIndex: 'Manufacturer'},\r
+               {header: "Product Group", width: 100, dataIndex: 'ProductGroup'}\r
+       ]);\r
+    cm.defaultSortable = true;\r
+\r
+    // create the grid\r
+    var grid = new Roo.grid.Grid('example-grid', {\r
+        ds: ds,\r
+        cm: cm\r
+    });\r
+    grid.render();\r
+\r
+    ds.load();\r
+});\r
diff --git a/examples/layout/complex.html b/examples/layout/complex.html
new file mode 100644 (file)
index 0000000..f8a2ce1
--- /dev/null
@@ -0,0 +1,153 @@
+<html>\r
+<head>\r
+  <title>Complex Layout</title>\r
+        <link rel="stylesheet" type="text/css" href="../../cssX/roojs-all.css"/>
+    <link rel="stylesheet" type="text/css" href="../../cssX/xtheme-slate.css"/>
+
+     <script type="text/javascript" src="../../roojs-all.js"></script>   \r
+  \r
+    <!--<script language="javascript" src="../grid/PropsGrid.js"></script>-->\r
+       <style type="text/css">\r
+       html, body {\r
+        font:normal 12px verdana;\r
+        margin:0;\r
+        padding:0;\r
+        border:0 none;\r
+        overflow:hidden;\r
+        height:100%;\r
+    }\r
+       .x-layout-panel-north {\r
+           border:0px none;\r
+       }\r
+       #nav {\r
+       }\r
+       #autoTabs, #center1, #center2, #west {\r
+           padding:10px;\r
+       }\r
+       #north, #south{\r
+           font:normal 8pt arial, helvetica;\r
+           padding:4px;\r
+       }\r
+       .x-layout-panel-center p {\r
+           margin:5px;\r
+       }\r
+       #props-panel .x-grid-col-0{\r
+       }\r
+       #props-panel .x-grid-col-1{\r
+       }\r
+       </style>\r
+       <script type="text/javascript">\r
+       Example = function(){\r
+               var layout;\r
+               return {\r
+                   init : function(){\r
+                      layout = new Roo.BorderLayout(document.body, {\r
+                           north: {\r
+                               split:false,\r
+                               initialSize: 32,\r
+                               titlebar: false\r
+                           },\r
+                           west: {\r
+                               split:true,\r
+                               initialSize: 200,\r
+                               minSize: 175,\r
+                               maxSize: 400,\r
+                               titlebar: true,\r
+                               collapsible: true,\r
+                            animate: true\r
+                           },\r
+                           east: {\r
+                               split:true,\r
+                               initialSize: 202,\r
+                               minSize: 175,\r
+                               maxSize: 400,\r
+                               titlebar: true,\r
+                               collapsible: true,\r
+                            animate: true\r
+                           },\r
+                           south: {\r
+                               split:true,\r
+                               initialSize: 100,\r
+                               minSize: 100,\r
+                               maxSize: 200,\r
+                               titlebar: true,\r
+                               collapsible: true,\r
+                            animate: true\r
+                           },\r
+                           center: {\r
+                               titlebar: true,\r
+                               autoScroll:true,\r
+                            closeOnTab: true\r
+                        }\r
+                       });\r
+\r
+                    layout.beginUpdate();\r
+                       layout.add('north', new Roo.ContentPanel('north', 'North'));\r
+                       layout.add('south', new Roo.ContentPanel('south', {title: 'South', closable: true}));\r
+                       layout.add('west', new Roo.ContentPanel('west', {title: 'West'}));\r
+                       layout.add('east', new Roo.ContentPanel(Roo.id(), {autoCreate:true, title: 'Dynamic Tab', closable: true}));\r
+                       layout.add('east', new Roo.ContentPanel('autoTabs', {title: 'Auto Tabs', closable: true}));\r
+                       layout.add('center', new Roo.ContentPanel('center1', {title: 'Close Me', closable: true}));\r
+                       layout.add('center', new Roo.ContentPanel('center2', {title: 'Center Panel', closable: false}));\r
+                       layout.getRegion('center').showPanel('center1');\r
+                       layout.getRegion('west').hide();\r
+                       layout.endUpdate();\r
+                  },\r
+\r
+                  toggleWest : function(link){\r
+                       var west = layout.getRegion('west');\r
+                       if(west.isVisible()){\r
+                           west.hide();\r
+                           link.innerHTML = 'Show West Region';\r
+                       }else{\r
+                           west.show();\r
+                           link.innerHTML = 'Hide West Region';\r
+                       }\r
+                  }\r
+            };\r
+              \r
+       }();\r
+       Roo.EventManager.onDocumentReady(Example.init, Example, true);\r
+       </script>\r
+</head>\r
+<body>\r
+<script type="text/javascript" src="../examples.js"></script><!-- EXAMPLES -->\r
+<div id ="container">\r
+  <div id="west" class="x-layout-inactive-content">\r
+    Hi. I'm the west panel.\r
+  </div>\r
+  <div id="north" class="x-layout-inactive-content">\r
+    north - generally for menus, toolbars and/or advertisements \r
+  </div>\r
+  <div id="autoTabs" class="x-layout-inactive-content">\r
+      The layout manager will automatically create and/or remove the TabPanel component when a region has more than one panel. Close one of my panels and you can see what I mean.\r
+  </div>\r
+  <div id="center2" class="x-layout-inactive-content">\r
+        <p><a href="#" onclick="Example.toggleWest(this);return false;">Show West Region</a></p>\r
+        <p>My closable attribute is set to false so you can't close me. The other center panels can be closed.</p>\r
+        <p>The center panel automatically grows to fit the remaining space in the container that isn't taken up by the border regions.</p>\r
+        <hr>\r
+        <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Sed metus nibh, sodales a, porta at, vulputate eget, dui. Pellentesque ut nisl. Maecenas tortor turpis, interdum non, sodales non, iaculis ac, lacus. Vestibulum auctor, tortor quis iaculis malesuada, libero lectus bibendum purus, sit amet tincidunt quam turpis vel lacus. In pellentesque nisl non sem. Suspendisse nunc sem, pretium eget, cursus a, fringilla vel, urna. Aliquam commodo ullamcorper erat. Nullam vel justo in neque porttitor laoreet. Aenean lacus dui, consequat eu, adipiscing eget, nonummy non, nisi. Morbi nunc est, dignissim non, ornare sed, luctus eu, massa. Vivamus eget quam. Vivamus tincidunt diam nec urna. Curabitur velit. Quisque dolor magna, ornare sed, elementum porta, luctus in, leo.</p>\r
+        <p>Donec quis dui. Sed imperdiet. Nunc consequat, est eu sollicitudin gravida, mauris ligula lacinia mauris, eu porta dui nisl in velit. Nam congue, odio id auctor nonummy, augue lectus euismod nunc, in tristique turpis dolor sed urna. Donec sit amet quam eget diam fermentum pharetra. Integer tincidunt arcu ut purus. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nulla blandit malesuada odio. Nam augue. Aenean molestie sapien in mi. Suspendisse tincidunt. Pellentesque tempus dui vitae sapien. Donec aliquam ipsum sit amet pede. Sed scelerisque mi a erat. Curabitur rutrum ullamcorper risus. Maecenas et lorem ut felis dictum viverra. Fusce sem. Donec pharetra nibh sit amet sapien.</p>\r
+        <p>Aenean ut orci sed ligula consectetuer pretium. Aliquam odio. Nam pellentesque enim. Nam tincidunt condimentum nisi. Maecenas convallis luctus ligula. Donec accumsan ornare risus. Vestibulum id magna a nunc posuere laoreet. Integer iaculis leo vitae nibh. Nam vulputate, mauris vitae luctus pharetra, pede neque bibendum tellus, facilisis commodo diam nisi eget lacus. Duis consectetuer pulvinar nisi. Cras interdum ultricies sem. Nullam tristique. Suspendisse elementum purus eu nisl. Nulla facilisi. Phasellus ultricies ullamcorper lorem. Sed euismod ante vitae lacus. Nam nunc leo, congue vehicula, luctus ac, tempus non, ante. Morbi suscipit purus a nulla. Sed eu diam.</p>\r
+        <p>Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Cras imperdiet felis id velit. Ut non quam at sem dictum ullamcorper. Vestibulum pharetra purus sed pede. Aliquam ultrices, nunc in varius mattis, felis justo pretium magna, eget laoreet justo eros id eros. Aliquam elementum diam fringilla nulla. Praesent laoreet sapien vel metus. Cras tempus, sapien condimentum dictum dapibus, lorem augue fringilla orci, ut tincidunt eros nisi eget turpis. Nullam nunc nunc, eleifend et, dictum et, pharetra a, neque. Ut feugiat. Aliquam erat volutpat. Donec pretium odio nec felis. Phasellus sagittis lacus eget sapien. Donec est. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae;</p>\r
+        <p>Vestibulum semper. Nullam non odio. Aliquam quam. Mauris eu lectus non nunc auctor ullamcorper. Sed tincidunt molestie enim. Phasellus lobortis justo sit amet quam. Duis nulla erat, varius a, cursus in, tempor sollicitudin, mauris. Aliquam mi velit, consectetuer mattis, consequat tristique, pulvinar ac, nisl. Aliquam mattis vehicula elit. Proin quis leo sed tellus scelerisque molestie. Quisque luctus. Integer mattis. Donec id augue sed leo aliquam egestas. Quisque in sem. Donec dictum enim in dolor. Praesent non erat. Nulla ultrices vestibulum quam.</p>\r
+        <p>Duis hendrerit, est vel lobortis sagittis, tortor erat scelerisque tortor, sed pellentesque sem enim id metus. Maecenas at pede. Nulla velit libero, dictum at, mattis quis, sagittis vel, ante. Phasellus faucibus rutrum dui. Cras mauris elit, bibendum at, feugiat non, porta id, neque. Nulla et felis nec odio mollis vehicula. Donec elementum tincidunt mauris. Duis vel dui. Fusce iaculis enim ac nulla. In risus.</p>\r
+        <p>Donec gravida. Donec et enim. Morbi sollicitudin, lacus a facilisis pulvinar, odio turpis dapibus elit, in tincidunt turpis felis nec libero. Nam vestibulum tempus ipsum. In hac habitasse platea dictumst. Nulla facilisi. Donec semper ligula. Donec commodo tortor in quam. Etiam massa. Ut tempus ligula eget tellus. Curabitur id velit ut velit varius commodo. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Nulla facilisi. Fusce ornare pellentesque libero. Nunc rhoncus. Suspendisse potenti. Ut consequat, leo eu accumsan vehicula, justo sem lobortis elit, ac sollicitudin ipsum neque nec ante.</p>\r
+        <p>Aliquam elementum mauris id sem. Vivamus varius, est ut nonummy consectetuer, nulla quam bibendum velit, ac gravida nisi felis sit amet urna. Aliquam nec risus. Maecenas lacinia purus ut velit. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Suspendisse sit amet dui vitae lacus fermentum sodales. Donec varius dapibus nisl. Praesent at velit id risus convallis bibendum. Aliquam felis nibh, rutrum nec, blandit non, mattis sit amet, magna. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Etiam varius dignissim nibh. Quisque id orci ac ante hendrerit molestie. Aliquam malesuada enim non neque.</p>\r
+  </div>\r
+  <div id="center1" class="x-layout-inactive-content">\r
+        <p><b>Done reading me? Close me by clicking the X in the top right corner.</b></p>\r
+        <p>Vestibulum semper. Nullam non odio. Aliquam quam. Mauris eu lectus non nunc auctor ullamcorper. Sed tincidunt molestie enim. Phasellus lobortis justo sit amet quam. Duis nulla erat, varius a, cursus in, tempor sollicitudin, mauris. Aliquam mi velit, consectetuer mattis, consequat tristique, pulvinar ac, nisl. Aliquam mattis vehicula elit. Proin quis leo sed tellus scelerisque molestie. Quisque luctus. Integer mattis. Donec id augue sed leo aliquam egestas. Quisque in sem. Donec dictum enim in dolor. Praesent non erat. Nulla ultrices vestibulum quam.</p>\r
+        <p>Duis hendrerit, est vel lobortis sagittis, tortor erat scelerisque tortor, sed pellentesque sem enim id metus. Maecenas at pede. Nulla velit libero, dictum at, mattis quis, sagittis vel, ante. Phasellus faucibus rutrum dui. Cras mauris elit, bibendum at, feugiat non, porta id, neque. Nulla et felis nec odio mollis vehicula. Donec elementum tincidunt mauris. Duis vel dui. Fusce iaculis enim ac nulla. In risus.</p>\r
+        <p>Donec gravida. Donec et enim. Morbi sollicitudin, lacus a facilisis pulvinar, odio turpis dapibus elit, in tincidunt turpis felis nec libero. Nam vestibulum tempus ipsum. In hac habitasse platea dictumst. Nulla facilisi. Donec semper ligula. Donec commodo tortor in quam. Etiam massa. Ut tempus ligula eget tellus. Curabitur id velit ut velit varius commodo. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Nulla facilisi. Fusce ornare pellentesque libero. Nunc rhoncus. Suspendisse potenti. Ut consequat, leo eu accumsan vehicula, justo sem lobortis elit, ac sollicitudin ipsum neque nec ante.</p>\r
+        <p>Aliquam elementum mauris id sem. Vivamus varius, est ut nonummy consectetuer, nulla quam bibendum velit, ac gravida nisi felis sit amet urna. Aliquam nec risus. Maecenas lacinia purus ut velit. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Suspendisse sit amet dui vitae lacus fermentum sodales. Donec varius dapibus nisl. Praesent at velit id risus convallis bibendum. Aliquam felis nibh, rutrum nec, blandit non, mattis sit amet, magna. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Etiam varius dignissim nibh. Quisque id orci ac ante hendrerit molestie. Aliquam malesuada enim non neque.</p>\r
+  </div>\r
+  <div id="props-panel" class="x-layout-inactive-content" style="width:200px;height:200px;overflow:hidden;">\r
+  </div>\r
+  <div id="south" class="x-layout-inactive-content">\r
+    south - generally for informational stuff, also could be for status bar\r
+  </div>\r
+</div>\r
+ </body>\r
+</html>\r
diff --git a/examples/layout/feed-viewer.html b/examples/layout/feed-viewer.html
new file mode 100644 (file)
index 0000000..14c6af3
--- /dev/null
@@ -0,0 +1,41 @@
+<html>\r
+<head>\r
+  <title>RSS Feed Viewer 2.0</title>\r
+  <link rel="stylesheet" type="text/css" href="../../cssX/roojs-all.css"/>
+    <link rel="stylesheet" type="text/css" href="../../cssX/xtheme-slate.css"/>
+\r
+\r
+    <!-- GC --> <!-- LIBS -->     <script type="text/javascript" src="../../adapter/ext/ext-base.js"></script>     <!-- ENDLIBS -->\r
+    <script type="text/javascript" src="../../ext-all.js"></script>\r
+\r
+    <link rel="stylesheet" type="text/css" href="feed-viewer.css"/>\r
+    <script type="text/javascript" language="javascript" src="feed-viewer.js"></script>\r
+</head>\r
+<body id="feedViewer">\r
+<script type="text/javascript" src="../examples.js"></script><!-- EXAMPLES -->\r
+    <div id="header" class="x-layout-inactive-content">\r
+   Simple RSS Feed Viewer - 2.0\r
+    </div>\r
+    <div id="feeds" class="x-layout-inactive-content">\r
+        <div id="myfeeds-tb"></div>\r
+        <div id="myfeeds-body" class="feed-list"></div>\r
+    </div>\r
+    <div id="suggested" class="x-layout-inactive-content feed-list"></div>\r
+    <div id="main" class="x-layout-inactive-content">\r
+        <div id="feed-grid" class="x-layout-inactive-content"></div>\r
+        <div id="preview" class="x-layout-inactive-content">\r
+            <div id="preview-tb"></div>\r
+            <div id="preview-body"></div>\r
+        </div>\r
+    </div>\r
+    <div id="status" class="x-layout-inactive-content"></div>\r
+    <div id="add-feed" style="visibility:hidden;">\r
+        <img alt="tab-close" id="add-feed-close" src="images/tab-close-on.gif" />\r
+               <p id="add-title" class="active-msg">Please enter the URL for the feed:</p>\r
+               <p id="invalid-feed"><img src="images/warning.gif" width="16" height="16" align="absmiddle" alt="" />&nbsp;The feed URL specified is not a valid RSS feed.</p>\r
+               <p id="loading-feed"><img src="images/wait.gif" width="18" height="18" align="absmiddle" />&nbsp;Loading feed...</p>\r
+               <input type="text" id="feed-url" name="feed-url" class="input-text"/><input id="add-btn" type="button" value="Add"/><br>\r
+               <span class="eg">e.g. http://www.jackslocum.com/yui/feed/</span>\r
+    </div>\r
+</body>\r
+</html>\r
diff --git a/examples/layout/nested.html b/examples/layout/nested.html
new file mode 100644 (file)
index 0000000..4eb8f8e
--- /dev/null
@@ -0,0 +1,129 @@
+<html>\r
+<head>\r
+  <title>Complex Layout</title>\r
+       <link rel="stylesheet" type="text/css" href="../../cssX/roojs-all.css"/>
+    <link rel="stylesheet" type="text/css" href="../../cssX/xtheme-slate.css"/>
+\r
+\r
+
+     <script type="text/javascript" src="../../roojs-all.js"></script>   
+     
+     \r
+    <style type="text/css">\r
+       html, body {\r
+        font:normal 12px verdana;\r
+        margin:0;\r
+        padding:0;\r
+        border:0 none;\r
+        overflow:hidden;\r
+        height:100%;\r
+    }\r
+       #header{\r
+           background: url(images/header-bar.gif) repeat-x bottom;\r
+           border-bottom: 1px solid #083772;\r
+           padding:5px 4px;\r
+       }\r
+       #footer{\r
+           background: url(images/header-bar.gif) repeat-x bottom;\r
+           border-top: 1px solid #083772;\r
+           padding:2px 4px;\r
+           color:white;\r
+           font:normal 8pt arial,helvetica;\r
+    }\r
+       #nav {\r
+       }\r
+       #nav, #inner1, #inner2 {\r
+           padding:10px;\r
+       }\r
+       #content p {\r
+           margin:5px;\r
+       }\r
+       #nav li {\r
+           padding:2px;\r
+           padding-left:10px;\r
+           background-image:url(images/bullet.gif);\r
+           background-position: -3px 6px;\r
+           background-repeat: no-repeat;\r
+           font-size:8pt;\r
+           display: block;\r
+    }\r
+    .x-layout-panel-north, .x-layout-panel-south, #content .x-layout-panel-center{\r
+        border:0px none;\r
+    }\r
+    #content .x-layout-panel-south{\r
+        border-top:1px solid #aca899;\r
+    }\r
+    #content .x-layout-panel-center{\r
+        border-bottom:1px solid #aca899;\r
+    }\r
+    </style>\r
+       <script type="text/javascript">\r
+       Example = function(){\r
+               return {\r
+                   init : function(){\r
+                      var layout = new Roo.BorderLayout(document.body, {\r
+                           west: {\r
+                               split:true,\r
+                               initialSize: 200,\r
+                               titlebar: true,\r
+                               collapsible: true,\r
+                               minSize: 100,\r
+                               maxSize: 400\r
+                           },\r
+                           center: {\r
+                               autoScroll: false\r
+                           }\r
+                       });\r
+                       layout.beginUpdate();\r
+                       \r
+                       layout.add('west', new Roo.ContentPanel('nav', {title: 'Navigation', fitToFrame:true, closable:false}));\r
+                       var innerLayout = new Roo.BorderLayout('content', {\r
+                           south: {\r
+                               split:true,\r
+                               initialSize: 200,\r
+                               minSize: 100,\r
+                               maxSize: 400,\r
+                               autoScroll:true,\r
+                               collapsible:true,\r
+                               titlebar: true\r
+                           },\r
+                           center: {\r
+                               autoScroll:true\r
+                           }\r
+                       });\r
+                       innerLayout.add('south', new Roo.ContentPanel('inner1', "More Information"));\r
+                       innerLayout.add('center', new Roo.ContentPanel('inner2'));\r
+                       layout.add('center', new Roo.NestedLayoutPanel(innerLayout));\r
+                       layout.endUpdate();\r
+                  }\r
+            };\r
+              \r
+       }();\r
+       Roo.EventManager.onDocumentReady(Example.init, Example, true);\r
+       </script>\r
+</head>\r
+<body class="xtheme-gray">\r
+<script type="text/javascript" src="../examples.js"></script><!-- EXAMPLES -->\r
+<div id ="container">\r
+  <div id="nav" class="x-layout-inactive-content">\r
+      <ul>\r
+        <li><a href="http://developer.yahoo.com/yui/" target="_blank"><img src="/blog/images/icons/yahoo.gif" width="16" height="16" border="0" align="absmiddle">&nbsp;Yahoo! UI Library</a></li>\r
+           <li><a href="http://www.ajaxian.com/" target="_blank"><img src="/blog/images/icons/ajaxian.gif" width="16" height="16" border="0" align="absmiddle">&nbsp;Ajaxian.com</a></li>\r
+      </ul> \r
+  </div>\r
+  <div id="content" class="x-layout-inactive-content"></div>\r
+  <div id="inner1" class="x-layout-inactive-content">\r
+        <p>This layout uses the gray theme. To make a layout use the gray theme, add the class .xtheme-gray to the body or a container element.</p>\r
+        <p>Vestibulum semper. Nullam non odio. Aliquam quam. Mauris eu lectus non nunc auctor ullamcorper. Sed tincidunt molestie enim. Phasellus lobortis justo sit amet quam. Duis nulla erat, varius a, cursus in, tempor sollicitudin, mauris. Aliquam mi velit, consectetuer mattis, consequat tristique, pulvinar ac, nisl. Aliquam mattis vehicula elit. Proin quis leo sed tellus scelerisque molestie. Quisque luctus. Integer mattis. Donec id augue sed leo aliquam egestas. Quisque in sem. Donec dictum enim in dolor. Praesent non erat. Nulla ultrices vestibulum quam.</p>\r
+        <p>Duis hendrerit, est vel lobortis sagittis, tortor erat scelerisque tortor, sed pellentesque sem enim id metus. Maecenas at pede. Nulla velit libero, dictum at, mattis quis, sagittis vel, ante. Phasellus faucibus rutrum dui. Cras mauris elit, bibendum at, feugiat non, porta id, neque. Nulla et felis nec odio mollis vehicula. Donec elementum tincidunt mauris. Duis vel dui. Fusce iaculis enim ac nulla. In risus.</p>\r
+        <p>Donec gravida. Donec et enim. Morbi sollicitudin, lacus a facilisis pulvinar, odio turpis dapibus elit, in tincidunt turpis felis nec libero. Nam vestibulum tempus ipsum. In hac habitasse platea dictumst. Nulla facilisi. Donec semper ligula. Donec commodo tortor in quam. Etiam massa. Ut tempus ligula eget tellus. Curabitur id velit ut velit varius commodo. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Nulla facilisi. Fusce ornare pellentesque libero. Nunc rhoncus. Suspendisse potenti. Ut consequat, leo eu accumsan vehicula, justo sem lobortis elit, ac sollicitudin ipsum neque nec ante.</p>\r
+        <p>Aliquam elementum mauris id sem. Vivamus varius, est ut nonummy consectetuer, nulla quam bibendum velit, ac gravida nisi felis sit amet urna. Aliquam nec risus. Maecenas lacinia purus ut velit. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Suspendisse sit amet dui vitae lacus fermentum sodales. Donec varius dapibus nisl. Praesent at velit id risus convallis bibendum. Aliquam felis nibh, rutrum nec, blandit non, mattis sit amet, magna. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Etiam varius dignissim nibh. Quisque id orci ac ante hendrerit molestie. Aliquam malesuada enim non neque.</p>\r
+  </div>\r
+  <div id="inner2" class="x-layout-inactive-content">\r
+        <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Sed metus nibh, sodales a, porta at, vulputate eget, dui. Pellentesque ut nisl. Maecenas tortor turpis, interdum non, sodales non, iaculis ac, lacus. Vestibulum auctor, tortor quis iaculis malesuada, libero lectus bibendum purus, sit amet tincidunt quam turpis vel lacus. In pellentesque nisl non sem. Suspendisse nunc sem, pretium eget, cursus a, fringilla vel, urna. Aliquam commodo ullamcorper erat. Nullam vel justo in neque porttitor laoreet. Aenean lacus dui, consequat eu, adipiscing eget, nonummy non, nisi. Morbi nunc est, dignissim non, ornare sed, luctus eu, massa. Vivamus eget quam. Vivamus tincidunt diam nec urna. Curabitur velit. Quisque dolor magna, ornare sed, elementum porta, luctus in, leo.</p>\r
+        <p>Donec quis dui. Sed imperdiet. Nunc consequat, est eu sollicitudin gravida, mauris ligula lacinia mauris, eu porta dui nisl in velit. Nam congue, odio id auctor nonummy, augue lectus euismod nunc, in tristique turpis dolor sed urna. Donec sit amet quam eget diam fermentum pharetra. Integer tincidunt arcu ut purus. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nulla blandit malesuada odio. Nam augue. Aenean molestie sapien in mi. Suspendisse tincidunt. Pellentesque tempus dui vitae sapien. Donec aliquam ipsum sit amet pede. Sed scelerisque mi a erat. Curabitur rutrum ullamcorper risus. Maecenas et lorem ut felis dictum viverra. Fusce sem. Donec pharetra nibh sit amet sapien.</p>\r
+        <p>Aenean ut orci sed ligula consectetuer pretium. Aliquam odio. Nam pellentesque enim. Nam tincidunt condimentum nisi. Maecenas convallis luctus ligula. Donec accumsan ornare risus. Vestibulum id magna a nunc posuere laoreet. Integer iaculis leo vitae nibh. Nam vulputate, mauris vitae luctus pharetra, pede neque bibendum tellus, facilisis commodo diam nisi eget lacus. Duis consectetuer pulvinar nisi. Cras interdum ultricies sem. Nullam tristique. Suspendisse elementum purus eu nisl. Nulla facilisi. Phasellus ultricies ullamcorper lorem. Sed euismod ante vitae lacus. Nam nunc leo, congue vehicula, luctus ac, tempus non, ante. Morbi suscipit purus a nulla. Sed eu diam.</p>\r
+  </div>\r
+</div>\r
+ </body>\r
+</html>\r
diff --git a/examples/layout/simple.html b/examples/layout/simple.html
new file mode 100644 (file)
index 0000000..9dea5fa
--- /dev/null
@@ -0,0 +1,137 @@
+<html>\r
+<head>\r
+  <title>Simple Layout</title>\r
+       
+     
+     
+    <link rel="stylesheet" type="text/css" href="../../cssX/roojs-all.css"/>
+    <link rel="stylesheet" type="text/css" href="../../cssX/xtheme-slate.css"/>
+
+      <script type="text/javascript" src="../../roojs-all.js"></script>  \r
+    <style type="text/css">\r
+       html, body {\r
+        font:normal 12px verdana;\r
+        margin:0;\r
+        padding:0;\r
+        border:0 none;\r
+        overflow:hidden;\r
+        height:100%;\r
+    }\r
+       #header{\r
+           background: url(images/header-bar.gif) repeat-x bottom;\r
+           border-bottom: 1px solid #083772;\r
+           padding:5px 4px;\r
+       }\r
+       #footer{\r
+           background: url(images/header-bar.gif) repeat-x bottom;\r
+           border-top: 1px solid #083772;\r
+           padding:2px 4px;\r
+           color:white;\r
+           font:normal 8pt arial,helvetica;\r
+    }\r
+       #nav {\r
+           background-color:#c3daf9;\r
+       }\r
+       #nav, #content {\r
+           padding:10px;\r
+       }\r
+       #content p {\r
+           margin:5px;\r
+       }\r
+       #nav li {\r
+           padding:2px;\r
+           padding-left:10px;\r
+           background-image:url(images/bullet.gif);\r
+           background-position: -3px 6px;\r
+           background-repeat: no-repeat;\r
+           font-size:8pt;\r
+           display: block;\r
+    }\r
+    .x-layout-panel{\r
+        border:0px none;\r
+    }\r
+       </style>\r
+       <script type="text/javascript">
+       Example = function(){
+               return {
+                   init : function(){
+                      var layout = new Roo.BorderLayout(document.body, {
+                           north: {
+                               split:false,
+                               initialSize: 35
+                           },
+                           south: {
+                               split:false,
+                               initialSize: 20
+                           },
+                           west: {
+                               split:false,
+                               initialSize: 200,
+                               collapsible: false
+                           },
+                           center: {
+                               autoScroll: true
+                           }
+                       });
+                       layout.beginUpdate();
+                       layout.add('north', new Roo.ContentPanel('header', {fitToFrame:true}));
+                       layout.add('south', new Roo.ContentPanel('footer', {fitToFrame:true}));
+                       layout.add('west', new Roo.ContentPanel('nav', {fitToFrame:true}));
+                       layout.add('center', new Roo.ContentPanel('content'));
+                       layout.endUpdate();
+                  }
+            };
+              
+       }();
+    
+    Roo.onReady(Example.init, Example, true);
+    
+    
+       
+       </script>\r
+</head>\r
+<body>
+\r
+<script type="text/javascript" src="../examples.js"></script><!-- EXAMPLES -->\r
+<div id ="container">\r
+  <div id="header" class="x-layout-inactive-content">\r
+      Header Goes here...\r
+  </div>\r
+  <div id="nav" class="x-layout-inactive-content">\r
+      <ul>\r
+        <li><a href="http://developer.yahoo.com/yui/" target="_blank"><img src="/blog/images/icons/yahoo.gif" width="16" height="16" border="0" align="absmiddle">&nbsp;Yahoo! UI Library</a></li>\r
+           <li><a href="http://www.ajaxian.com/" target="_blank"><img src="/blog/images/icons/ajaxian.gif" width="16" height="16" border="0" align="absmiddle">&nbsp;Ajaxian.com</a></li>\r
+      </ul> \r
+  </div>\r
+  <div id="content" class="x-layout-inactive-content">\r
+        <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Sed metus nibh, sodales a, porta at, vulputate eget, dui. Pellentesque ut nisl. Maecenas tortor turpis, interdum non, sodales non, iaculis ac, lacus. Vestibulum auctor, tortor quis iaculis malesuada, libero lectus bibendum purus, sit amet tincidunt quam turpis vel lacus. In pellentesque nisl non sem. Suspendisse nunc sem, pretium eget, cursus a, fringilla vel, urna. Aliquam commodo ullamcorper erat. Nullam vel justo in neque porttitor laoreet. Aenean lacus dui, consequat eu, adipiscing eget, nonummy non, nisi. Morbi nunc est, dignissim non, ornare sed, luctus eu, massa. Vivamus eget quam. Vivamus tincidunt diam nec urna. Curabitur velit. Quisque dolor magna, ornare sed, elementum porta, luctus in, leo.</p>\r
+        <p>Donec quis dui. Sed imperdiet. Nunc consequat, est eu sollicitudin gravida, mauris ligula lacinia mauris, eu porta dui nisl in velit. Nam congue, odio id auctor nonummy, augue lectus euismod nunc, in tristique turpis dolor sed urna. Donec sit amet quam eget diam fermentum pharetra. Integer tincidunt arcu ut purus. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nulla blandit malesuada odio. Nam augue. Aenean molestie sapien in mi. Suspendisse tincidunt. Pellentesque tempus dui vitae sapien. Donec aliquam ipsum sit amet pede. Sed scelerisque mi a erat. Curabitur rutrum ullamcorper risus. Maecenas et lorem ut felis dictum viverra. Fusce sem. Donec pharetra nibh sit amet sapien.</p>\r
+        <p>Aenean ut orci sed ligula consectetuer pretium. Aliquam odio. Nam pellentesque enim. Nam tincidunt condimentum nisi. Maecenas convallis luctus ligula. Donec accumsan ornare risus. Vestibulum id magna a nunc posuere laoreet. Integer iaculis leo vitae nibh. Nam vulputate, mauris vitae luctus pharetra, pede neque bibendum tellus, facilisis commodo diam nisi eget lacus. Duis consectetuer pulvinar nisi. Cras interdum ultricies sem. Nullam tristique. Suspendisse elementum purus eu nisl. Nulla facilisi. Phasellus ultricies ullamcorper lorem. Sed euismod ante vitae lacus. Nam nunc leo, congue vehicula, luctus ac, tempus non, ante. Morbi suscipit purus a nulla. Sed eu diam.</p>\r
+        <p>Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Cras imperdiet felis id velit. Ut non quam at sem dictum ullamcorper. Vestibulum pharetra purus sed pede. Aliquam ultrices, nunc in varius mattis, felis justo pretium magna, eget laoreet justo eros id eros. Aliquam elementum diam fringilla nulla. Praesent laoreet sapien vel metus. Cras tempus, sapien condimentum dictum dapibus, lorem augue fringilla orci, ut tincidunt eros nisi eget turpis. Nullam nunc nunc, eleifend et, dictum et, pharetra a, neque. Ut feugiat. Aliquam erat volutpat. Donec pretium odio nec felis. Phasellus sagittis lacus eget sapien. Donec est. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae;</p>\r
+        <p>Vestibulum semper. Nullam non odio. Aliquam quam. Mauris eu lectus non nunc auctor ullamcorper. Sed tincidunt molestie enim. Phasellus lobortis justo sit amet quam. Duis nulla erat, varius a, cursus in, tempor sollicitudin, mauris. Aliquam mi velit, consectetuer mattis, consequat tristique, pulvinar ac, nisl. Aliquam mattis vehicula elit. Proin quis leo sed tellus scelerisque molestie. Quisque luctus. Integer mattis. Donec id augue sed leo aliquam egestas. Quisque in sem. Donec dictum enim in dolor. Praesent non erat. Nulla ultrices vestibulum quam.</p>\r
+        <p>Duis hendrerit, est vel lobortis sagittis, tortor erat scelerisque tortor, sed pellentesque sem enim id metus. Maecenas at pede. Nulla velit libero, dictum at, mattis quis, sagittis vel, ante. Phasellus faucibus rutrum dui. Cras mauris elit, bibendum at, feugiat non, porta id, neque. Nulla et felis nec odio mollis vehicula. Donec elementum tincidunt mauris. Duis vel dui. Fusce iaculis enim ac nulla. In risus.</p>\r
+        <p>Donec gravida. Donec et enim. Morbi sollicitudin, lacus a facilisis pulvinar, odio turpis dapibus elit, in tincidunt turpis felis nec libero. Nam vestibulum tempus ipsum. In hac habitasse platea dictumst. Nulla facilisi. Donec semper ligula. Donec commodo tortor in quam. Etiam massa. Ut tempus ligula eget tellus. Curabitur id velit ut velit varius commodo. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Nulla facilisi. Fusce ornare pellentesque libero. Nunc rhoncus. Suspendisse potenti. Ut consequat, leo eu accumsan vehicula, justo sem lobortis elit, ac sollicitudin ipsum neque nec ante.</p>\r
+        <p>Aliquam elementum mauris id sem. Vivamus varius, est ut nonummy consectetuer, nulla quam bibendum velit, ac gravida nisi felis sit amet urna. Aliquam nec risus. Maecenas lacinia purus ut velit. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Suspendisse sit amet dui vitae lacus fermentum sodales. Donec varius dapibus nisl. Praesent at velit id risus convallis bibendum. Aliquam felis nibh, rutrum nec, blandit non, mattis sit amet, magna. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Etiam varius dignissim nibh. Quisque id orci ac ante hendrerit molestie. Aliquam malesuada enim non neque.</p>\r
+          <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Sed metus nibh, sodales a, porta at, vulputate eget, dui. Pellentesque ut nisl. Maecenas tortor turpis, interdum non, sodales non, iaculis ac, lacus. Vestibulum auctor, tortor quis iaculis malesuada, libero lectus bibendum purus, sit amet tincidunt quam turpis vel lacus. In pellentesque nisl non sem. Suspendisse nunc sem, pretium eget, cursus a, fringilla vel, urna. Aliquam commodo ullamcorper erat. Nullam vel justo in neque porttitor laoreet. Aenean lacus dui, consequat eu, adipiscing eget, nonummy non, nisi. Morbi nunc est, dignissim non, ornare sed, luctus eu, massa. Vivamus eget quam. Vivamus tincidunt diam nec urna. Curabitur velit. Quisque dolor magna, ornare sed, elementum porta, luctus in, leo.</p>\r
+        <p>Donec quis dui. Sed imperdiet. Nunc consequat, est eu sollicitudin gravida, mauris ligula lacinia mauris, eu porta dui nisl in velit. Nam congue, odio id auctor nonummy, augue lectus euismod nunc, in tristique turpis dolor sed urna. Donec sit amet quam eget diam fermentum pharetra. Integer tincidunt arcu ut purus. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nulla blandit malesuada odio. Nam augue. Aenean molestie sapien in mi. Suspendisse tincidunt. Pellentesque tempus dui vitae sapien. Donec aliquam ipsum sit amet pede. Sed scelerisque mi a erat. Curabitur rutrum ullamcorper risus. Maecenas et lorem ut felis dictum viverra. Fusce sem. Donec pharetra nibh sit amet sapien.</p>\r
+        <p>Aenean ut orci sed ligula consectetuer pretium. Aliquam odio. Nam pellentesque enim. Nam tincidunt condimentum nisi. Maecenas convallis luctus ligula. Donec accumsan ornare risus. Vestibulum id magna a nunc posuere laoreet. Integer iaculis leo vitae nibh. Nam vulputate, mauris vitae luctus pharetra, pede neque bibendum tellus, facilisis commodo diam nisi eget lacus. Duis consectetuer pulvinar nisi. Cras interdum ultricies sem. Nullam tristique. Suspendisse elementum purus eu nisl. Nulla facilisi. Phasellus ultricies ullamcorper lorem. Sed euismod ante vitae lacus. Nam nunc leo, congue vehicula, luctus ac, tempus non, ante. Morbi suscipit purus a nulla. Sed eu diam.</p>\r
+        <p>Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Cras imperdiet felis id velit. Ut non quam at sem dictum ullamcorper. Vestibulum pharetra purus sed pede. Aliquam ultrices, nunc in varius mattis, felis justo pretium magna, eget laoreet justo eros id eros. Aliquam elementum diam fringilla nulla. Praesent laoreet sapien vel metus. Cras tempus, sapien condimentum dictum dapibus, lorem augue fringilla orci, ut tincidunt eros nisi eget turpis. Nullam nunc nunc, eleifend et, dictum et, pharetra a, neque. Ut feugiat. Aliquam erat volutpat. Donec pretium odio nec felis. Phasellus sagittis lacus eget sapien. Donec est. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae;</p>\r
+        <p>Vestibulum semper. Nullam non odio. Aliquam quam. Mauris eu lectus non nunc auctor ullamcorper. Sed tincidunt molestie enim. Phasellus lobortis justo sit amet quam. Duis nulla erat, varius a, cursus in, tempor sollicitudin, mauris. Aliquam mi velit, consectetuer mattis, consequat tristique, pulvinar ac, nisl. Aliquam mattis vehicula elit. Proin quis leo sed tellus scelerisque molestie. Quisque luctus. Integer mattis. Donec id augue sed leo aliquam egestas. Quisque in sem. Donec dictum enim in dolor. Praesent non erat. Nulla ultrices vestibulum quam.</p>\r
+        <p>Duis hendrerit, est vel lobortis sagittis, tortor erat scelerisque tortor, sed pellentesque sem enim id metus. Maecenas at pede. Nulla velit libero, dictum at, mattis quis, sagittis vel, ante. Phasellus faucibus rutrum dui. Cras mauris elit, bibendum at, feugiat non, porta id, neque. Nulla et felis nec odio mollis vehicula. Donec elementum tincidunt mauris. Duis vel dui. Fusce iaculis enim ac nulla. In risus.</p>\r
+        <p>Donec gravida. Donec et enim. Morbi sollicitudin, lacus a facilisis pulvinar, odio turpis dapibus elit, in tincidunt turpis felis nec libero. Nam vestibulum tempus ipsum. In hac habitasse platea dictumst. Nulla facilisi. Donec semper ligula. Donec commodo tortor in quam. Etiam massa. Ut tempus ligula eget tellus. Curabitur id velit ut velit varius commodo. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Nulla facilisi. Fusce ornare pellentesque libero. Nunc rhoncus. Suspendisse potenti. Ut consequat, leo eu accumsan vehicula, justo sem lobortis elit, ac sollicitudin ipsum neque nec ante.</p>\r
+        <p>Aliquam elementum mauris id sem. Vivamus varius, est ut nonummy consectetuer, nulla quam bibendum velit, ac gravida nisi felis sit amet urna. Aliquam nec risus. Maecenas lacinia purus ut velit. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Suspendisse sit amet dui vitae lacus fermentum sodales. Donec varius dapibus nisl. Praesent at velit id risus convallis bibendum. Aliquam felis nibh, rutrum nec, blandit non, mattis sit amet, magna. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Etiam varius dignissim nibh. Quisque id orci ac ante hendrerit molestie. Aliquam malesuada enim non neque.</p>\r
+        <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Sed metus nibh, sodales a, porta at, vulputate eget, dui. Pellentesque ut nisl. Maecenas tortor turpis, interdum non, sodales non, iaculis ac, lacus. Vestibulum auctor, tortor quis iaculis malesuada, libero lectus bibendum purus, sit amet tincidunt quam turpis vel lacus. In pellentesque nisl non sem. Suspendisse nunc sem, pretium eget, cursus a, fringilla vel, urna. Aliquam commodo ullamcorper erat. Nullam vel justo in neque porttitor laoreet. Aenean lacus dui, consequat eu, adipiscing eget, nonummy non, nisi. Morbi nunc est, dignissim non, ornare sed, luctus eu, massa. Vivamus eget quam. Vivamus tincidunt diam nec urna. Curabitur velit. Quisque dolor magna, ornare sed, elementum porta, luctus in, leo.</p>\r
+        <p>Donec quis dui. Sed imperdiet. Nunc consequat, est eu sollicitudin gravida, mauris ligula lacinia mauris, eu porta dui nisl in velit. Nam congue, odio id auctor nonummy, augue lectus euismod nunc, in tristique turpis dolor sed urna. Donec sit amet quam eget diam fermentum pharetra. Integer tincidunt arcu ut purus. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nulla blandit malesuada odio. Nam augue. Aenean molestie sapien in mi. Suspendisse tincidunt. Pellentesque tempus dui vitae sapien. Donec aliquam ipsum sit amet pede. Sed scelerisque mi a erat. Curabitur rutrum ullamcorper risus. Maecenas et lorem ut felis dictum viverra. Fusce sem. Donec pharetra nibh sit amet sapien.</p>\r
+        <p>Aenean ut orci sed ligula consectetuer pretium. Aliquam odio. Nam pellentesque enim. Nam tincidunt condimentum nisi. Maecenas convallis luctus ligula. Donec accumsan ornare risus. Vestibulum id magna a nunc posuere laoreet. Integer iaculis leo vitae nibh. Nam vulputate, mauris vitae luctus pharetra, pede neque bibendum tellus, facilisis commodo diam nisi eget lacus. Duis consectetuer pulvinar nisi. Cras interdum ultricies sem. Nullam tristique. Suspendisse elementum purus eu nisl. Nulla facilisi. Phasellus ultricies ullamcorper lorem. Sed euismod ante vitae lacus. Nam nunc leo, congue vehicula, luctus ac, tempus non, ante. Morbi suscipit purus a nulla. Sed eu diam.</p>\r
+        <p>Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Cras imperdiet felis id velit. Ut non quam at sem dictum ullamcorper. Vestibulum pharetra purus sed pede. Aliquam ultrices, nunc in varius mattis, felis justo pretium magna, eget laoreet justo eros id eros. Aliquam elementum diam fringilla nulla. Praesent laoreet sapien vel metus. Cras tempus, sapien condimentum dictum dapibus, lorem augue fringilla orci, ut tincidunt eros nisi eget turpis. Nullam nunc nunc, eleifend et, dictum et, pharetra a, neque. Ut feugiat. Aliquam erat volutpat. Donec pretium odio nec felis. Phasellus sagittis lacus eget sapien. Donec est. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae;</p>\r
+        <p>Vestibulum semper. Nullam non odio. Aliquam quam. Mauris eu lectus non nunc auctor ullamcorper. Sed tincidunt molestie enim. Phasellus lobortis justo sit amet quam. Duis nulla erat, varius a, cursus in, tempor sollicitudin, mauris. Aliquam mi velit, consectetuer mattis, consequat tristique, pulvinar ac, nisl. Aliquam mattis vehicula elit. Proin quis leo sed tellus scelerisque molestie. Quisque luctus. Integer mattis. Donec id augue sed leo aliquam egestas. Quisque in sem. Donec dictum enim in dolor. Praesent non erat. Nulla ultrices vestibulum quam.</p>\r
+        <p>Duis hendrerit, est vel lobortis sagittis, tortor erat scelerisque tortor, sed pellentesque sem enim id metus. Maecenas at pede. Nulla velit libero, dictum at, mattis quis, sagittis vel, ante. Phasellus faucibus rutrum dui. Cras mauris elit, bibendum at, feugiat non, porta id, neque. Nulla et felis nec odio mollis vehicula. Donec elementum tincidunt mauris. Duis vel dui. Fusce iaculis enim ac nulla. In risus.</p>\r
+        <p>Donec gravida. Donec et enim. Morbi sollicitudin, lacus a facilisis pulvinar, odio turpis dapibus elit, in tincidunt turpis felis nec libero. Nam vestibulum tempus ipsum. In hac habitasse platea dictumst. Nulla facilisi. Donec semper ligula. Donec commodo tortor in quam. Etiam massa. Ut tempus ligula eget tellus. Curabitur id velit ut velit varius commodo. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Nulla facilisi. Fusce ornare pellentesque libero. Nunc rhoncus. Suspendisse potenti. Ut consequat, leo eu accumsan vehicula, justo sem lobortis elit, ac sollicitudin ipsum neque nec ante.</p>\r
+        <p>Aliquam elementum mauris id sem. Vivamus varius, est ut nonummy consectetuer, nulla quam bibendum velit, ac gravida nisi felis sit amet urna. Aliquam nec risus. Maecenas lacinia purus ut velit. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Suspendisse sit amet dui vitae lacus fermentum sodales. Donec varius dapibus nisl. Praesent at velit id risus convallis bibendum. Aliquam felis nibh, rutrum nec, blandit non, mattis sit amet, magna. Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Etiam varius dignissim nibh. Quisque id orci ac ante hendrerit molestie. Aliquam malesuada enim non neque.</p>\r
+  </div>\r
+  <div id="footer" class="x-layout-inactive-content">\r
+      Original :Copyright 2006 Jack Slocum (released under LGPL)\r
+  </div>\r
+</div>\r
+ </body>\r
+</html>\r
diff --git a/examples/layout/simple.js b/examples/layout/simple.js
new file mode 100644 (file)
index 0000000..07a6158
--- /dev/null
@@ -0,0 +1 @@
+// not used!
\ No newline at end of file
diff --git a/examples/menu/menus.html b/examples/menu/menus.html
new file mode 100644 (file)
index 0000000..b7006fe
--- /dev/null
@@ -0,0 +1,58 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+<title>Toolbar with Menus</title>
+    <link rel="stylesheet" type="text/css" href="../../cssX/roojs-all.css"/>
+    <link rel="stylesheet" type="text/css" href="../../cssX/xtheme-slate.css"/>
+
+     <script type="text/javascript" src="../../roojs-all.js"></script>   
+  
+<script type="text/javascript" src="../form/states.js"></script>
+<script type="text/javascript" src="menus.js"></script>
+<link rel="stylesheet" type="text/css" href="menus.css" />
+
+<!-- Common Styles for the examples -->
+<link rel="stylesheet" type="text/css" href="../examples.css" />
+<style type="text/css">
+    .blist .x-btn-text {
+        background-image: url(list-items.gif)
+    }
+    .bmenu .x-btn-text {
+        background-image: url(menu-show.gif)
+    }
+    .menu-title{
+        background: #ebeadb url(../../resources/images/aero/grid/grid-hrow.gif) repeat-x;
+        border-bottom:1px solid #99bbe8;
+        color:#15428b;
+        font:bold 10px tahoma,arial,verdana,sans-serif;
+        display:block;
+        padding:3px;
+    }
+    #msg-div {
+        display: block;
+        position: absolute;
+       }
+       #container
+       {
+           border: 4px solid #ccc;
+           width: 700px;
+           height: 300px;
+          }
+</style>
+</head>
+<body>
+<script type="text/javascript" src="../examples.js"></script><!-- EXAMPLES -->
+<h1>Toolbar with Menus</h1>
+
+<p>The js is not minified so it is readable. See 
+<button type="button" onclick="RooDocs.viewSource.show('/menus.js')">menus.js</button> and 
+<button type="button" onclick="RooDocs.viewSource.show('/menus.html')">menus.html</button> .</p>
+
+<div id="container">
+    <div id="toolbar"></div>
+</div>
+
+<br /><br /><br /><br /><br />
+</body>
+</html>
diff --git a/examples/menu/menus.js b/examples/menu/menus.js
new file mode 100644 (file)
index 0000000..269c381
--- /dev/null
@@ -0,0 +1,176 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+Roo.onReady(function(){
+    Roo.QuickTips.init();
+
+    // Menus can be prebuilt and passed by reference
+    var dateMenu = new Roo.menu.DateMenu({
+        handler : function(dp, date){
+            Roo.example.msg('Date Selected', 'You chose {0}.', date.format('M j, Y'));
+        }
+    });
+
+    // Menus can be prebuilt and passed by reference
+    var colorMenu = new Roo.menu.ColorMenu({
+        handler : function(cm, color){
+            Roo.example.msg('Color Selected', 'You chose {0}.', color);
+        }
+    });
+
+    var menu = new Roo.menu.Menu({
+        id: 'mainMenu',
+        items: [
+            new Roo.menu.CheckItem({
+                text: 'I like Ext',
+                checked: true,
+                checkHandler: onItemCheck
+            }),
+            new Roo.menu.CheckItem({
+                text: 'Ext for jQuery',
+                checked: true,
+                checkHandler: onItemCheck
+            }),
+            new Roo.menu.CheckItem({
+                text: 'I donated!',
+                checked:false,
+                checkHandler: onItemCheck
+            }), '-', {
+                text: 'Radio Options',
+                menu: {        // <-- submenu by nested config object
+                    items: [
+                        // stick any markup in a menu
+                        '<b class="menu-title">Choose a Theme</b>',
+                        new Roo.menu.CheckItem({
+                            text: 'Aero Glass',
+                            checked: true,
+                            group: 'theme',
+                            checkHandler: onItemCheck
+                        }),
+                        new Roo.menu.CheckItem({
+                            text: 'Vista Black',
+                            group: 'theme',
+                            checkHandler: onItemCheck
+                        }),
+                        new Roo.menu.CheckItem({
+                            text: 'Gray Theme',
+                            group: 'theme',
+                            checkHandler: onItemCheck
+                        }),
+                        new Roo.menu.CheckItem({
+                            text: 'Default Theme',
+                            group: 'theme',
+                            checkHandler: onItemCheck
+                        })
+                    ]
+                }
+            },{
+                text: 'Choose a Date',
+                cls: 'calendar',
+                menu: dateMenu // <-- submenu by reference
+            },{
+                text: 'Choose a Color',
+                menu: colorMenu // <-- submenu by reference
+            }
+        ]
+    });
+
+    var tb = new Roo.Toolbar('toolbar');
+    tb.add({
+            cls: 'x-btn-text-icon bmenu', // icon and text class
+            text:'Button w/ Menu',
+            menu: menu  // assign menu by instance
+        }, 
+        new Roo.Toolbar.MenuButton({
+            text: 'Split Button',
+            handler: onButtonClick,
+            tooltip: {text:'This is a QuickTip with autoHide set to false and a title', title:'Tip Title', autoHide:false},
+            cls: 'x-btn-text-icon blist',
+            // Menus can be built/referenced by using nested menu config objects
+            menu : {items: [
+                        {text: '<b>Bold</b>', handler: onItemClick},
+                        {text: '<i>Italic</i>', handler: onItemClick},
+                        {text: '<u>Underline</u>', handler: onItemClick}, '-',{
+                        text: 'Pick a Color', handler: onItemClick, menu: {
+                        items: [
+                                new Roo.menu.ColorItem({selectHandler:function(cp, color){
+                                    Roo.example.msg('Color Selected', 'You chose {0}.', color);
+                                }}), '-',
+                                {text:'More Colors...', handler:onItemClick}
+                        ]
+                    }},
+                    {text: 'Extellent!', handler: onItemClick}
+                ]}
+        }), '-', {
+        text: 'Toggle Me',
+        enableToggle: true,
+        toggleHandler: onItemToggle,
+        pressed: true
+    });
+
+    menu.addSeparator();
+    // Menus have a rich api for
+    // adding and removing elements dynamically
+    var item = menu.add({
+        text: 'Dynamically added Item'
+    });
+    // items support full Observable API
+    item.on('click', onItemClick);
+
+    // items can easily be looked up
+    menu.add({
+        text: 'Disabled Item',
+        id: 'disableMe'  // <-- Items can also have an id for easy lookup
+        // disabled: true   <-- allowed but for sake of example we use long way below
+    });
+    // access items by id or index
+    menu.items.get('disableMe').disable();
+
+    // They can also be referenced by id in or components
+    tb.add('-', {
+        icon: 'list-items.gif', // icons can also be specified inline
+        cls: 'x-btn-icon',
+        tooltip: '<b>Quick Tips</b><br/>Icon only button with tooltip'
+    }, '-');
+
+    // add a combobox to the toolbar
+    var store = new Roo.data.SimpleStore({
+        fields: ['abbr', 'state'],
+        data : Roo.exampledata.states // from states.js
+    });
+    var combo = new Roo.form.ComboBox({
+        store: store,
+        displayField:'state',
+        typeAhead: true,
+        mode: 'local',
+        triggerAction: 'all',
+        emptyText:'Select a state...',
+        selectOnFocus:true,
+        width:135
+    });
+    tb.addField(combo);
+
+    // functions to display feedback
+    function onButtonClick(btn){
+        Roo.example.msg('Button Click','You clicked the "{0}" button.', btn.text);
+    }
+
+    function onItemClick(item){
+        Roo.example.msg('Menu Click', 'You clicked the "{0}" menu item.', item.text);
+    }
+
+    function onItemCheck(item, checked){
+        Roo.example.msg('Item Check', 'You {1} the "{0}" menu item.', item.text, checked ? 'checked' : 'unchecked');
+    }
+
+    function onItemToggle(item, pressed){
+        Roo.example.msg('Button Toggled', 'Button "{0}" was toggled to {1}.', item.text, pressed);
+    }
+});
\ No newline at end of file
diff --git a/examples/resizable/basic.html b/examples/resizable/basic.html
new file mode 100644 (file)
index 0000000..43ba94f
--- /dev/null
@@ -0,0 +1,187 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+<title>Resizable Examples</title>
+  <link rel="stylesheet" type="text/css" href="../../cssX/roojs-all.css"/>
+    <link rel="stylesheet" type="text/css" href="../../cssX/xtheme-slate.css"/>
+
+     <script type="text/javascript" src="../../roojs-all.js"></script>   
+  
+<script language="javascript" src="basic.js"></script>
+
+<!-- Common Styles for the examples -->
+<link rel="stylesheet" type="text/css" href="../examples.css" />
+<style type="text/css">
+#basic, #animated {
+    border:1px solid #c3daf9;
+    color:#1e4e8f;
+    font:bold 14px tahoma,verdana,helvetica;
+    text-align:center;
+    padding-top:20px;
+}
+#snap {
+    border:1px solid #c3daf9;
+    overflow:hidden;
+}
+#custom {
+    cursor:move;
+}
+#custom-rzwrap{
+    z-index: 100;
+}
+#custom-rzwrap .x-resizable-handle{
+    width:11px;
+    height:11px;
+    background:transparent url(../../resources/images/default/sizer/square.gif) no-repeat;
+    margin:0px;
+}
+#custom-rzwrap .x-resizable-handle-east, #custom-rzwrap .x-resizable-handle-west{
+    top:45%;
+}
+#custom-rzwrap .x-resizable-handle-north, #custom-rzwrap .x-resizable-handle-south{
+    left:45%;
+}
+</style>
+</head>
+
+<body>
+<script type="text/javascript" src="../examples.js"></script><!-- EXAMPLES -->
+<h1>Resizable Examples</h1>
+<p>These examples show how to apply a floating (default) and pinned Resizable component to a standard element.</p>
+<p>Note that the js is not minified so it is readable. See <a href="basic.js">basic.js</a> for the full source code.</p>
+
+<p>
+    <b>Basic Example</b><br />
+    This is a basic as you get. To resize the box, position your mouse anywhere near the bottom,
+    right or border right edge of the box. This example uses the default "floating" handles.
+</p>
+<div id="basic">Resize Me!</div>
+<pre class="code"><code>var basic = new Ext.Resizable('basic', {
+        width: 200,
+        height: 100,
+        minWidth:100,
+        minHeight:50
+});</code></pre>
+<hr>
+<p>
+    <b>Wrapped Elements</b><br />
+
+    Some elements such as images and textareas don't allow child elements. In the past, you had
+    to wrap these elements and set up a Resizable with resize child. As of yui-ext .33 RC2, Resizable will
+    wrap the element, calculate adjustments for borders/padding and offset the handles for you. All you have to
+    do is set "wrap:true". The manual way of specifying a "resizeChild" is still supported as well.
+</p><p>
+    <b>Pinned Handles</b><br />
+    Notice this example has the resize handles "pinned". This is done by setting "pinned:true".
+</p><p>
+    <b>Dynamic Sizing</b><br />
+    If you don't like the proxy resizing, you can also turn on dynamic sizing. Just set "dynamic:true".
+</p>
+<p>
+    Here's a textarea that is wrapped, has pinned handles and has dynamic sizing turned on.
+
+</p>
+<textarea id="dwrapped">
+Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Sed metus nibh, sodales a, porta at, vulputate eget, dui. Pellentesque ut nisl. Maecenas tortor turpis, interdum non, sodales non, iaculis ac, lacus. Vestibulum auctor, tortor quis iaculis malesuada, libero lectus bibendum purus, sit amet tincidunt quam turpis vel lacus. In pellentesque nisl non sem. Suspendisse nunc sem, pretium eget, cursus a, fringilla vel, urna. Aliquam commodo ullamcorper erat. Nullam vel justo in neque porttitor laoreet. Aenean lacus dui, consequat eu, adipiscing eget, nonummy non, nisi. Morbi nunc est, dignissim non, ornare sed, luctus eu, massa.
+Vivamus eget quam. Vivamus tincidunt diam nec urna. Curabitur velit. Quisque dolor magna, ornare sed, elementum porta, luctus in, leo.
+</textarea><br /><br />
+And look how simple the code is, even my grandma could write it.
+<pre class="code"><code>var dwrapped = new Ext.Resizable('dwrapped', {
+    wrap:true,
+    pinned:true,
+    width:450,
+    height:150,
+    minWidth:200,
+    minHeight: 50,
+    dynamic: true
+});</code></pre>
+<hr>
+<p>
+<b>Preserve Ratio</b><br />
+    For some things like images, you will probably want to preserve the ratio of width to height. Just set preserveRatio:true.
+</p>
+<img id="wrapped" src="sara.jpg" width="200" height="250"/>
+<pre class="code"><code>var wrapped = new Ext.Resizable('wrapped', {
+    wrap:true,
+    pinned:true,
+    minWidth:50,
+    minHeight: 50,
+    preserveRatio: true
+});</code></pre>
+<hr>
+
+<p>
+<b>Transparent Handles</b><br />
+    If you just want the element to be resizable without any fancy handles, set transparent to true.
+</p>
+<img id="transparent" src="zack.jpg" width="100" height="176"/>
+<pre class="code"><code>var transparent = new Ext.Resizable('transparent', {
+    wrap:true,
+    minWidth:50,
+    minHeight: 50,
+    preserveRatio: true,
+    transparent:true
+});</code></pre>
+<hr>
+<p>
+    <b>Customizable Handles</b><br />
+    Resizable elements are resizable 8 ways. 8 way resizing for a static positioned element will cause the element to be positioned relative and taken out of the document flow. For resizing which adjusts the
+    x and y of the element, the element should be positioned absolute. You can also control which handles are displayed by setting the "handles" attribute.
+    The handles are styled using CSS so they can be customized to look however you would like them to. 
+</p>
+
+<p>
+    This image has 8 way resizing, custom handles, is draggable and 8 way preserved ratio (that wasn't easy!).<br />
+    <b>Double click anywhere on the image to hide it when you are done.</b>
+</p>
+<img id="custom" src="sara_and_zack.jpg" width="200" height="152" style="position:absolute;left:0;top:0;"/>
+<div style="padding:8px;border:1px solid #c3daf9;background:#d9e8fb;width:150px;text-align:center;"><button id="showMe">Show Me</button></div>
+<pre class="code"><code>var custom = new Ext.Resizable('custom', {
+    wrap:true,
+    pinned:true,
+    minWidth:50,
+    minHeight: 50,
+    preserveRatio: true,
+    dynamic:true,
+    handles: 'all', // shorthand for 'n s e w ne nw se sw'
+    draggable:true
+});</code></pre>
+<hr>
+<p>
+    <b>Snapping</b><br />
+
+    Resizable also supports basic snapping in increments. 
+</p>
+<div id="snap"></div>
+<pre class="code"><code>var snap = new Ext.Resizable('snap', {
+    pinned:true,
+    width:250,
+    height:100,
+    handles: 'e',
+    widthIncrement:50,
+    minWidth: 50,
+    dynamic: true
+});
+</code></pre>
+Warning: Snapping and preserveRatio conflict and can not be used together.
+<hr>
+<p>
+    <b>Animated Transitions</b><br />
+    Resize operations can also be animated. Animations support configurable easing and duration.
+    Here's a very basic clone of the first element, but with animation turned on. I used a "backIn"
+    easing and made it a little slower than default.
+</p>
+<div id="animated">Animate Me!</div>
+
+<pre class="code"><code>var animated = new Ext.Resizable('animated', {
+    width: 200,
+    height: 100,
+    minWidth:100,
+    minHeight:50,
+    animate:true,
+    easing: 'backIn',
+    duration:.6
+});</code></pre>
+Warning: for obvious reasons animate and dynamic resizing can not be used together.
+</body>
+</html>
diff --git a/examples/resizable/basic.js b/examples/resizable/basic.js
new file mode 100644 (file)
index 0000000..8336676
--- /dev/null
@@ -0,0 +1,94 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+var ResizableExample = {
+    init : function(){
+        
+        var basic = new Roo.Resizable('basic', {
+                width: 200,
+                height: 100,
+                minWidth:100,
+                minHeight:50
+        });
+        
+        var animated = new Roo.Resizable('animated', {
+                width: 200,
+                pinned: true,
+                height: 100,
+                minWidth:100,
+                minHeight:50,
+                animate:true,
+                easing: 'backIn',
+                duration:.6
+        });
+        
+        var wrapped = new Roo.Resizable('wrapped', {
+            wrap:true,
+            pinned:true,
+            minWidth:50,
+            minHeight: 50,
+            preserveRatio: true
+        });
+        
+        var transparent = new Roo.Resizable('transparent', {
+            wrap:true,
+            minWidth:50,
+            minHeight: 50,
+            preserveRatio: true,
+            transparent:true
+        });
+        
+        var custom = new Roo.Resizable('custom', {
+            wrap:true,
+            pinned:true,
+            minWidth:50,
+            minHeight: 50,
+            preserveRatio: true,
+            handles: 'all',
+            draggable:true,
+            dynamic:true
+        });
+        var customEl = custom.getEl();
+        // move to the body to prevent overlap on my blog
+        document.body.insertBefore(customEl.dom, document.body.firstChild);
+        
+        customEl.on('dblclick', function(){
+            customEl.hide(true);
+        });
+        customEl.hide();
+        
+        Roo.get('showMe').on('click', function(){
+            customEl.center();
+            customEl.show(true);
+        });
+        
+        var dwrapped = new Roo.Resizable('dwrapped', {
+            wrap:true,
+            pinned:true,
+            width:450,
+            height:150,
+            minWidth:200,
+            minHeight: 50,
+            dynamic: true
+        });
+        
+        var snap = new Roo.Resizable('snap', {
+            pinned:true,
+            width:250,
+            height:100,
+            handles: 'e',
+            widthIncrement:50,
+            minWidth: 50,
+            dynamic: true
+        });
+    }
+};
+
+Roo.EventManager.onDocumentReady(ResizableExample.init, ResizableExample, true);
\ No newline at end of file
diff --git a/examples/tabs/ajax1.htm b/examples/tabs/ajax1.htm
new file mode 100644 (file)
index 0000000..ff723e8
--- /dev/null
@@ -0,0 +1,3 @@
+<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.</p><p>Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure.</p>\r
+<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.</p><p>Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure.</p>\r
+<p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat.</p><p>Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure.</p>\r
diff --git a/examples/tabs/ajax2.htm b/examples/tabs/ajax2.htm
new file mode 100644 (file)
index 0000000..8bb27c2
--- /dev/null
@@ -0,0 +1,7 @@
+I'm am content loaded via AJAX. I was set up using the setUrl() method on my Ext.TabPanelItem object:\r
+<div style="padding:10px;background:#f1f1f1;"><pre><code>var tab3 = jtabs.addTab('jtabs-3', "Ajax Tab 2");\r
+tab3.setUrl('ajax2.htm', null, true);\r
+</code></pre></div>\r
+Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure.\r
+Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure.\r
+Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure dolor in hendrerit in vulputate velit esse molestie consequat, vel illum dolore eu feugiat nulla facilisis at vero eros et accumsan et iusto odio dignissim qui blandit praesent luptatum zzril delenit Lorem ipsum dolor sit amet, consectetuer adipiscing elit, sed diam nonummy nibh euismod tincidunt ut laoreet dolore magna aliquam erat volutpat. Ut wisi enim ad minim veniam, quis nostrud exerci tation ullamcorper suscipit lobortis nisl ut aliquip ex ea commodo consequat. Duis autem vel eum iriure.\r
diff --git a/examples/tabs/tabs-adv.html b/examples/tabs/tabs-adv.html
new file mode 100644 (file)
index 0000000..67cd56c
--- /dev/null
@@ -0,0 +1,35 @@
+<html>
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+<title>Tabs Example</title>
+    <link rel="stylesheet" type="text/css" href="../../cssX/roojs-all.css"/>
+    <link rel="stylesheet" type="text/css" href="../../cssX/xtheme-slate.css"/>
+
+     <script type="text/javascript" src="../../roojs-all.js"></script>   
+  
+<link rel="stylesheet" type="text/css" href="tabs-example.css" />
+<script type="text/javascript" src="tabs-adv.js"></script>
+
+<!-- Common Styles for the examples -->
+<link rel="stylesheet" type="text/css" href="../examples.css" />
+       </head>
+<body>
+<script type="text/javascript" src="../examples.js"></script><!-- EXAMPLES -->
+<h1>Tab Panel Example 2</h1>
+<p>Note that the js and css is not minified so it is readable. See <a href="tabs-adv.js">tabs-adv.js</a> for the tab creation code
+and <a href="tabs-example.css">tabs-example.css</a> for the css.</p>
+
+     <h3>Closable tabs with auto tab resize turned on.</h3><br /><br />
+    <div id="tab-panel1" style="width:800px;height:300px;">
+        <div id="root-tab">
+            <a href="#" id="add-link">Add a new Tab</a>
+            <div id="content">
+            <hr />
+            <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. Sed metus nibh, sodales a, porta at, vulputate eget, dui. Pellentesque ut nisl. Maecenas tortor turpis, interdum non, sodales non, iaculis ac, lacus. Vestibulum auctor, tortor quis iaculis malesuada, libero lectus bibendum purus, sit amet tincidunt quam turpis vel lacus. In pellentesque nisl non sem. Suspendisse nunc sem, pretium eget, cursus a, fringilla vel, urna. Aliquam commodo ullamcorper erat. Nullam vel justo in neque porttitor laoreet. Aenean lacus dui, consequat eu, adipiscing eget, nonummy non, nisi. Morbi nunc est, dignissim non, ornare sed, luctus eu, massa. Vivamus eget quam. Vivamus tincidunt diam nec urna. Curabitur velit. Quisque dolor magna, ornare sed, elementum porta, luctus in, leo.</p>
+            <p>Donec quis dui. Sed imperdiet. Nunc consequat, est eu sollicitudin gravida, mauris ligula lacinia mauris, eu porta dui nisl in velit. Nam congue, odio id auctor nonummy, augue lectus euismod nunc, in tristique turpis dolor sed urna. Donec sit amet quam eget diam fermentum pharetra. Integer tincidunt arcu ut purus. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Nulla blandit malesuada odio. Nam augue. Aenean molestie sapien in mi. Suspendisse tincidunt. Pellentesque tempus dui vitae sapien. Donec aliquam ipsum sit amet pede. Sed scelerisque mi a erat. Curabitur rutrum ullamcorper risus. Maecenas et lorem ut felis dictum viverra. Fusce sem. Donec pharetra nibh sit amet sapien.</p>
+            <p>Aenean ut orci sed ligula consectetuer pretium. Aliquam odio. Nam pellentesque enim. Nam tincidunt condimentum nisi. Maecenas convallis luctus ligula. Donec accumsan ornare risus. Vestibulum id magna a nunc posuere laoreet. Integer iaculis leo vitae nibh. Nam vulputate, mauris vitae luctus pharetra, pede neque bibendum tellus, facilisis commodo diam nisi eget lacus. Duis consectetuer pulvinar nisi. Cras interdum ultricies sem. Nullam tristique. Suspendisse elementum purus eu nisl. Nulla facilisi. Phasellus ultricies ullamcorper lorem. Sed euismod ante vitae lacus. Nam nunc leo, congue vehicula, luctus ac, tempus non, ante. Morbi suscipit purus a nulla. Sed eu diam.</p>
+            </div>
+        </div>
+    </div>
+</body>
+</html>
\ No newline at end of file
diff --git a/examples/tabs/tabs-adv.js b/examples/tabs/tabs-adv.js
new file mode 100644 (file)
index 0000000..17e5da9
--- /dev/null
@@ -0,0 +1,31 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */\r
+Roo.onReady(function(){
+    var tabs = new Roo.TabPanel('tab-panel1', {
+        resizeTabs:true, // turn on tab resizing
+        minTabWidth: 20,
+        preferredTabWidth:150
+    });
+
+    tabs.addTab('root-tab', 'Home Tab');
+    tabs.activate(0);
+
+    var content = Roo.getDom('content').innerHTML; // bogus markup for tabs
+    var index = 0;
+    Roo.get('add-link').on('click', function(){
+        tabs.addTab(
+             Roo.id(),
+             'New Tab ' + (++index),
+             'Tab Body ' + index + content,
+             true
+        );
+    });
+});
\ No newline at end of file
diff --git a/examples/tabs/tabs-example.css b/examples/tabs/tabs-example.css
new file mode 100644 (file)
index 0000000..d2967af
--- /dev/null
@@ -0,0 +1,31 @@
+/*\r
+ * yui-ext\r
+ * Copyright(c) 2006, Jack Slocum.\r
+ */\r
+\r
+.list {list-style:square;width:500px;padding-left:16px;}\r
+.list li{padding:2px;font-size:8pt;}\r
+\r
+/* hide the tab content while loading */\r
+.tab-content{display:none;}\r
+\r
+pre {\r
+   font-size:11px; \r
+}\r
+\r
+#tabs1 {width:400px;}\r
+#tabs1 .yui-ext-tabbody {border:1px solid #999;border-top:none;}\r
+#tabs1 .yui-ext-tabitembody {display:none;padding:10px;}\r
+\r
+#jtabs {width:600px;}\r
+#jtabs .yui-ext-tabbody {border:1px solid #999;border-top:none; height:200px;overflow:auto;}\r
+#jtabs .yui-ext-tabitembody {display:none;padding:10px;font-size:11px;}\r
+\r
+/* default loading indicator for ajax calls */\r
+.loading-indicator {\r
+       font-size:8pt;\r
+       background-image:url('../../resources/images/grid/loading.gif');\r
+       background-repeat: no-repeat;\r
+       background-position: left;\r
+       padding-left:20px;\r
+}
\ No newline at end of file
diff --git a/examples/tabs/tabs-example.js b/examples/tabs/tabs-example.js
new file mode 100644 (file)
index 0000000..3cd2549
--- /dev/null
@@ -0,0 +1,43 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */\r
+var TabsExample = {\r
+    init : function(){\r
+        // basic tabs 1, built from existing content\r
+        var tabs = new Roo.TabPanel('tabs1');\r
+        tabs.addTab('script', "View Script");\r
+        tabs.addTab('markup', "View Markup");\r
+        tabs.activate('script');\r
+    \r
+        // second tabs built from JS\r
+        var jtabs = new Roo.TabPanel('jtabs');\r
+        jtabs.addTab('jtabs-1', "Normal Tab", "My content was added during construction.");\r
+    \r
+        var tab2 = jtabs.addTab('jtabs-2', "Ajax Tab 1");\r
+        var updater = tab2.getUpdateManager();\r
+        updater.setDefaultUrl('ajax1.htm');\r
+        tab2.on('activate', updater.refresh, updater, true);\r
+    \r
+        var tab3 = jtabs.addTab('jtabs-3', "Ajax Tab 2");\r
+        tab3.setUrl('ajax2.htm', null, true);\r
+    \r
+        var tab4 = jtabs.addTab('jtabs-4', "Event Tab");\r
+        tab4.setContent("I am tab 4's content. My content was set with setContent() after I was created. I also have an event listener attached.");\r
+        tab4.on('activate', function(){\r
+            alert('Tab 4 was activated.');\r
+        });\r
+    \r
+        jtabs.addTab('tabs1-5', "Disabled Tab", "Can't see me cause I'm disabled");\r
+        jtabs.disableTab('tabs1-5');\r
+    \r
+        jtabs.activate('jtabs-1');\r
+    }\r
+}\r
+Roo.EventManager.onDocumentReady(TabsExample.init, TabsExample, true);
\ No newline at end of file
diff --git a/examples/tabs/tabs.html b/examples/tabs/tabs.html
new file mode 100644 (file)
index 0000000..d68c69b
--- /dev/null
@@ -0,0 +1,74 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">\r
+<html>\r
+<head>\r
+    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">\r
+    <title>Tabs Example</title>\r
+    <link rel="stylesheet" type="text/css" href="../../cssX/roojs-all.css"/>
+    <link rel="stylesheet" type="text/css" href="../../cssX/xtheme-slate.css"/>
+
+     <script type="text/javascript" src="../../roojs-all.js"></script>   
+     \r
\r
+\r
+    <!-- Tabs Example Files -->\r
+    <link rel="stylesheet" type="text/css" href="tabs-example.css" />\r
+    <script type="text/javascript" src="tabs-example.js"></script>\r
+\r
+    <!-- Common Styles for the examples -->\r
+    <link rel="stylesheet" type="text/css" href="../examples.css" />\r
+</head>\r
+<body>\r
+<script type="text/javascript" src="../examples.js"></script><!-- EXAMPLES -->\r
+\r
+<h1>Tab Panel Examples</h1>\r
+<p>Note that the js and css is not minified so it is readable. See <a href="tabs-example.js">tabs-example.js</a> for the tab creation code\r
+and <a href="tabs-example.css">tabs-example.css</a> for the css.</p>\r
+\r
+    <h3>Tabs without fixed height that resize to the content. Built from existing markup.</h3><br>\r
+    <!-- container for the existing markup tabs -->\r
+    <div id="tabs1">\r
+        <div id="script" class="tab-content">\r
+        <b>Here's my script:</b>\r
+\r
+<!-- pre sections lookup hideous -->\r
+<pre>\r
+var tabs = new Roo.TabPanel('tabs1');\r
+tabs.addTab('script', "View Script");\r
+tabs.addTab('markup', "View Markup");\r
+tabs.activate('script');</pre>\r
+ <!-- end pre -->\r
+\r
+       </div>\r
+        <div id="markup" class="tab-content">\r
+\r
+<!-- pre sections lookup hideous -->\r
+<pre>\r
+&lt;div id="tabs1"&gt;\r
+    &lt;div id="script" class="tab-content"&gt;\r
+        (Content goes here)\r
+    &lt;/div&gt;\r
+    &lt;div id="markup" class="tab-content"&gt;\r
+        (Content goes here)\r
+    &lt;/div&gt;\r
+&lt;/div></pre>\r
+<!-- end pre -->\r
+\r
+        </div>\r
+    </div>\r
+\r
+    <br>\r
+     <h3>Tabs with fixed height that scroll the content. Built entirely with javascript.</h3>\r
+    <ul class="list">\r
+    <li>Tab 1 is a normal tab with content passed when adding it.</li>\r
+    <li>Tab 2 is loaded via Ajax. It was set up using the standard UpdateManager functionality. It reloads it's content every time it's activated.</li>\r
+    <li>Tab 3 is loaded via Ajax too. It was set up using setUrl() a convenience method that will do everything done on tab 2 and also has the ability to set it to load only once.</li>\r
+    <li>Tab 4 has an event listener attached.</li>\r
+    <li>Tab 5 is disabled.</li>\r
+    </ul><br>\r
+\r
+    <!-- container for the pure JS tabs -->\r
+    <div id="jtabs" class="xp">\r
+    </div>\r
+\r
+</body>\r
+</html>
\ No newline at end of file
diff --git a/examples/tree/ColumnTree.js b/examples/tree/ColumnTree.js
new file mode 100644 (file)
index 0000000..b44cd7c
--- /dev/null
@@ -0,0 +1,122 @@
+//<Script type="text/javascript">
+
+Roo.tree.ColumnTree = Roo.extend(Roo.tree.TreePanel, {
+    lines:false,
+    borderWidth: Roo.isBorderBox ? 0 : 2, // the combined left/right border for each cell
+    
+    
+    render : function(){
+        // add the header.....
+       
+        Roo.tree.ColumnTree.superclass.render.apply(this);
+        
+        this.el.addClass('x-column-tree');
+        
+        this.headers = this.el.createChild(
+            {cls:'x-tree-headers'},this.innerCt.dom);
+   
+        var cols = this.columns, c;
+        var totalWidth = 0;
+
+        for(var i = 0, len = cols.length; i < len; i++){
+             c = cols[i];
+             totalWidth += c.width;
+             this.headers.createChild({
+                 cls:'x-tree-hd ' + (c.cls?c.cls+'-hd':''),
+                 cn: {
+                     cls:'x-tree-hd-text',
+                     html: c.header
+                 },
+                 style:'width:'+(c.width-this.borderWidth)+'px;'
+             });
+        }
+        this.headers.createChild({cls:'x-clear'});
+        // prevent floats from wrapping when clipped
+        this.headers.setWidth(totalWidth);
+        //this.innerCt.setWidth(totalWidth);
+        this.innerCt.setWidth(this.width);
+        this.innerCt.setHeight(this.height-20);
+        this.innerCt.setStyle({ overflow: 'auto' });
+             
+        
+    }
+});
+
+Roo.tree.ColumnNodeUI = Roo.extend(Roo.tree.TreeNodeUI, {
+    //focus: Roo.emptyFn, // prevent odd scrolling behavior
+    
+    renderElements : function(n, a, targetNode, bulkRender){
+        //consel.log("renderElements?");
+        this.indentMarkup = n.parentNode ? n.parentNode.ui.getChildIndent() : '';
+
+        var t = n.getOwnerTree();
+        var cols = t.columns;
+        var bw = t.borderWidth;
+        var c = cols[0];
+        var href = a.href ? a.href : Roo.isGecko ? "" : "#";
+         var cb = typeof a.checked == "boolean";
+     
+        var buf = [
+            '<li class="x-tree-node">',
+            
+                
+                '<div class="x-tree-node-el ', a.cls,'">',
+                    // extran...
+                    '<div class="x-tree-col" style="width:', c.width-bw, 'px;">',
+                
+                
+                        '<span class="x-tree-node-indent">',this.indentMarkup,'</span>',
+                        '<img src="', this.emptyIcon, '" class="x-tree-ec-icon  " />',
+                        '<img src="', a.icon || this.emptyIcon, '" class="x-tree-node-icon',
+                           (a.icon ? ' x-tree-node-inline-icon' : ''),
+                           (a.iconCls ? ' '+a.iconCls : ''),
+                           '" unselectable="on" />',
+                        (cb ? ('<input class="x-tree-node-cb" type="checkbox" ' + 
+                             (a.checked ? 'checked="checked" />' : ' />')) : ''),
+                             
+                        '<a class="x-tree-node-anchor" hidefocus="on" href="',href,'" tabIndex="1" ',
+                            (a.hrefTarget ? ' target="' +a.hrefTarget + '"' : ''),
+                            '><span unselectable="on">',
+                              n.text || (c.renderer ? c.renderer(a[c.dataIndex], n, a) : a[c.dataIndex]),
+                             '</span></a>' ,
+                  '</div>'
+                 ];
+       
+         for(var i = 1, len = cols.length; i < len; i++){
+             c = cols[i];
+
+             buf.push('<div class="x-tree-col ',(c.cls?c.cls:''),'" style="width:',c.width-bw,'px;">',
+                        '<div class="x-tree-col-text">',(c.renderer ? c.renderer(a[c.dataIndex], n, a) : a[c.dataIndex]),"</div>",
+                      "</div>");
+         }
+         
+         buf.push(
+            '<div class="x-clear"></div></div>',
+            '<ul class="x-tree-node-ct" style="display:none;"></ul>',
+            "</li>");
+        
+        if(bulkRender !== true && n.nextSibling && n.nextSibling.ui.getEl()){
+            this.wrap = Roo.DomHelper.insertHtml("beforeBegin",
+                                n.nextSibling.ui.getEl(), buf.join(""));
+        }else{
+            this.wrap = Roo.DomHelper.insertHtml("beforeEnd", targetNode, buf.join(""));
+        }
+        var el = this.wrap.childNodes[0];
+        this.elNode = el.firstChild;
+        this.ctNode = this.wrap.childNodes[1];
+        var cs = el.firstChild.childNodes;
+        this.indentNode = cs[0];
+        this.ecNode = cs[1];
+        this.iconNode = cs[2];
+        var index = 3;
+        if(cb){
+            this.checkbox = cs[3];
+            index++;
+        }
+        this.anchor = cs[index];
+        this.textNode = cs[index].firstChild;
+        
+       // console.log(this);
+    }
+    
+});
\ No newline at end of file
diff --git a/examples/tree/coltree.html b/examples/tree/coltree.html
new file mode 100644 (file)
index 0000000..646dd4e
--- /dev/null
@@ -0,0 +1,24 @@
+<html>
+<head>
+    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
+    <title>Reorder Column Tree</title>
+    <link rel="stylesheet" type="text/css" href="../../cssX/roojs-all.css"/>
+    <link rel="stylesheet" type="text/css" href="../../cssX/xtheme-slate.css"/>
+
+    <script type="text/javascript" src="../../roojs-all.js"></script>   
+  
+    <script type="text/javascript" src="ColumnTree.js"></script>
+    <script type="text/javascript" src="coltree.js"></script>
+
+    <!-- Common Styles for the examples -->
+    <link rel="stylesheet" type="text/css" href="../examples.css" />
+</head>
+<body>
+    <script type="text/javascript" src="../examples.js"></script><!-- EXAMPLES -->
+<h1>Drag and Drop ordering in a Colltree TreePanel</h1>
+<p>The js is not minified so it is readable. See <a href="coltree.js">coltree.js</a>.</p>
+
+<div id="tree-div" style="height:300px;width:550px;border:1px solid #c3daf9;"></div> 
+
+</body>
+</html>
diff --git a/examples/tree/coltree.js b/examples/tree/coltree.js
new file mode 100644 (file)
index 0000000..526d91a
--- /dev/null
@@ -0,0 +1,67 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+
+ var tree = false; 
+Roo.onReady(function(){
+    // shorthand
+    var Tree = Roo.tree;
+    
+    tree = new Tree.ColumnTree('tree-div', {
+   // tree = new Tree.TreePanel('tree-div', {
+        animate:true, 
+        loader: new Tree.TreeLoader({
+           dataUrl:'get-nodes.php?uiProvider=col',
+           //dataUrl:'get-nodes.php',
+            uiProviders: {
+                col: Roo.tree.ColumnNodeUI
+            }
+        }),
+        enableDD:true,
+        containerScroll: true,
+        
+       width: 550,
+      height: 300,
+      rootVisible:false,
+      autoScroll:true,
+      title: 'Example ',
+        
+        columns:[{
+            header:'Task',
+            width:330,
+            dataIndex:'task'
+        },{
+            header:'Type',
+            width:100,
+            dataIndex:'cls'
+        },{
+            header:'Size',
+            width:100,
+            dataIndex:'size'
+        }],
+  
+        
+        
+        
+    });
+
+    // set the root node
+    var root = new Tree.AsyncTreeNode({
+        text: 'Ext JS',
+        draggable:true,
+        id:'source'
+    });
+    tree.setRootNode(root);
+
+    // render the tree
+    tree.render();
+    root.expand();
+});
diff --git a/examples/tree/dep-tree.json b/examples/tree/dep-tree.json
new file mode 100644 (file)
index 0000000..cb83ddc
--- /dev/null
@@ -0,0 +1 @@
+[{"text":"Ext Core (Required)","id":"c-1176543742240","options":[],"files":[{"allowDelete":true,"text":"DomHelper.js","id":"source/core/DomHelper.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 4:51 am<br />Size: 14 KB","qtipTitle":"DomHelper.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"Template.js","id":"source/core/Template.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 4:51 am<br />Size: 13 KB","qtipTitle":"Template.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"DomQuery.js","id":"source/core/DomQuery.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 4:51 am<br />Size: 24 KB","qtipTitle":"DomQuery.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"Observable.js","id":"source/util/Observable.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 4:51 am<br />Size: 9.4 KB","qtipTitle":"Observable.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"EventManager.js","id":"source/core/EventManager.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 4:51 am<br />Size: 24 KB","qtipTitle":"EventManager.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"Element.js","id":"source/core/Element.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 4:51 am<br />Size: 101 KB","qtipTitle":"Element.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"Fx.js","id":"source/core/Fx.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 4:51 am<br />Size: 33 KB","qtipTitle":"Fx.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"CompositeElement.js","id":"source/core/CompositeElement.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 4:51 am<br />Size: 7.1 KB","qtipTitle":"CompositeElement.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"UpdateManager.js","id":"source/core/UpdateManager.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 4:51 am<br />Size: 19 KB","qtipTitle":"UpdateManager.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"DelayedTask.js","id":"source/util/DelayedTask.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 4:51 am<br />Size: 2 KB","qtipTitle":"DelayedTask.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}}],"dep":[]},{"text":"Core - Utilities","id":"c-1176547092092","options":[],"files":[{"allowDelete":true,"text":"ClickRepeater.js","id":"source/util/ClickRepeater.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:31 am<br />Size: 4.9 KB","qtipTitle":"ClickRepeater.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"CSS.js","id":"source/util/CSS.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:31 am<br />Size: 5 KB","qtipTitle":"CSS.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"Format.js","id":"source/util/Format.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:31 am<br />Size: 5.4 KB","qtipTitle":"Format.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"JSON.js","id":"source/util/JSON.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:31 am<br />Size: 4.3 KB","qtipTitle":"JSON.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"KeyMap.js","id":"source/util/KeyMap.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:31 am<br />Size: 5.9 KB","qtipTitle":"KeyMap.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"KeyNav.js","id":"source/util/KeyNav.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:31 am<br />Size: 3 KB","qtipTitle":"KeyNav.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"MixedCollection.js","id":"source/util/MixedCollection.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:31 am<br />Size: 17 KB","qtipTitle":"MixedCollection.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"TaskMgr.js","id":"source/util/TaskMgr.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:31 am<br />Size: 2.3 KB","qtipTitle":"TaskMgr.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"TextMetrics.js","id":"source/util/TextMetrics.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:31 am<br />Size: 1.8 KB","qtipTitle":"TextMetrics.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}}],"dep":[]},{"text":"Core - Date Parsing and Formatting","id":"c-1176614560128","options":[],"files":[{"allowDelete":true,"expanded":true,"text":"Date.js","id":"source/util/Date.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 11:01 pm<br />Size: 23 KB","qtipTitle":"Date.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","dataUrl":"dependency.php","events":{"beforeload":true,"load":true,"loadexception":true},"transId":false}}],"dep":[]},{"text":"Core - Layers","id":"c-1176548288067","options":[],"files":[{"allowDelete":true,"text":"Component.js","id":"source/widgets/Component.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 6:56 am<br />Size: 9 KB","qtipTitle":"Component.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"Layer.js","id":"source/widgets/Layer.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 6:56 am<br />Size: 9.9 KB","qtipTitle":"Layer.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"Shadow.js","id":"source/widgets/Shadow.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 6:56 am<br />Size: 3.4 KB","qtipTitle":"Shadow.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}}],"dep":[]},{"text":"Core - Drag and Drop","id":"c-1176548288338","options":[{"text":"Overflow Scrolling Support","cmpId":"c-1176548288338","iconCls":"folder","type":"fileCt","allowDelete":true,"allowEdit":true,"id":"o-1176599383444","children":[{"allowDelete":true,"text":"ScrollManager.js","id":"source/dd/ScrollManager.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 9:02 pm<br />Size: 5.5 KB","qtipTitle":"ScrollManager.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","dataUrl":"dependency.php","events":{"beforeload":true,"load":true,"loadexception":true},"transId":false}}],"loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}}],"files":[{"allowDelete":true,"text":"DDCore.js","id":"source/dd/DDCore.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 6:56 am<br />Size: 95 KB","qtipTitle":"DDCore.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"StatusProxy.js","id":"source/dd/StatusProxy.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 6:56 am<br />Size: 3.1 KB","qtipTitle":"StatusProxy.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"Registry.js","id":"source/dd/Registry.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 6:56 am<br />Size: 2.3 KB","qtipTitle":"Registry.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"DragSource.js","id":"source/dd/DragSource.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 6:56 am<br />Size: 6.3 KB","qtipTitle":"DragSource.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"DropTarget.js","id":"source/dd/DropTarget.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 6:56 am<br />Size: 1.2 KB","qtipTitle":"DropTarget.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"DragZone.js","id":"source/dd/DragZone.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 6:56 am<br />Size: 2.6 KB","qtipTitle":"DragZone.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"DropZone.js","id":"source/dd/DropZone.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 6:56 am<br />Size: 2.3 KB","qtipTitle":"DropZone.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}}],"dep":[{"allowDelete":true,"text":"Layer.js","id":"source/widgets/Layer.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 6:56 am<br />Size: 9.9 KB","qtipTitle":"Layer.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"Shadow.js","id":"source/widgets/Shadow.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 6:56 am<br />Size: 3.4 KB","qtipTitle":"Shadow.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}}]},{"text":"Core - State Management","id":"c-1176681140293","options":[],"files":[{"allowDelete":true,"expanded":true,"text":"State.js","id":"source/state/State.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 15, 2007, 5:18 pm<br />Size: 9.8 KB","qtipTitle":"State.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","dataUrl":"dependency.php","events":{"beforeload":true,"load":true,"loadexception":true},"transId":false}}],"dep":[]},{"text":"Resizable","id":"c-1176548288611","options":[],"files":[{"allowDelete":true,"text":"Resizable.js","id":"source/widgets/Resizable.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 6:56 am<br />Size: 21 KB","qtipTitle":"Resizable.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}}],"dep":[]},{"text":"QuickTips - Tooltip Widget","id":"c-1176548289178","options":[],"files":[{"allowDelete":true,"text":"QuickTips.js","id":"source/widgets/QuickTips.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 6:56 am<br />Size: 9.1 KB","qtipTitle":"QuickTips.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}}],"dep":[{"allowDelete":true,"text":"Shadow.js","id":"source/widgets/Shadow.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 6:56 am<br />Size: 3.4 KB","qtipTitle":"Shadow.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"Layer.js","id":"source/widgets/Layer.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 6:56 am<br />Size: 9.9 KB","qtipTitle":"Layer.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}}]},{"text":"Button Widget","id":"c-1176548288907","options":[{"text":"Button QuickTips","cmpId":"c-1176548288907","iconCls":"folder","type":"fileCt","allowDelete":true,"allowEdit":true,"id":"o-1176590302846","children":[{"allowDelete":true,"text":"QuickTips.js","id":"source/widgets/QuickTips.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 9:02 pm<br />Size: 9.1 KB","qtipTitle":"QuickTips.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","dataUrl":"dependency.php","events":{"beforeload":true,"load":true,"loadexception":true},"transId":false}}],"loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}}],"files":[{"allowDelete":true,"text":"Button.js","id":"source/widgets/Button.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 6:56 am<br />Size: 13 KB","qtipTitle":"Button.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"MenuButton.js","id":"source/widgets/MenuButton.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 6:04 pm<br />Size: 6.3 KB","qtipTitle":"MenuButton.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}}],"dep":[{"allowDelete":true,"text":"TextMetrics.js","id":"source/util/TextMetrics.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 6:56 am<br />Size: 1.8 KB","qtipTitle":"TextMetrics.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}}]},{"text":"Tabs Widget","id":"c-1176590622815","options":[],"files":[{"allowDelete":true,"text":"TabPanel.js","id":"source/widgets/TabPanel.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 6:04 pm<br />Size: 25 KB","qtipTitle":"TabPanel.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}}],"dep":[]},{"text":"SplitBar Widget","id":"c-1176548289426","options":[],"files":[{"allowDelete":true,"text":"SplitBar.js","id":"source/widgets/SplitBar.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 6:04 pm<br />Size: 14 KB","qtipTitle":"SplitBar.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}}],"dep":[{"allowDelete":true,"text":"DDCore.js","id":"source/dd/DDCore.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 6:04 pm<br />Size: 95 KB","qtipTitle":"DDCore.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}}]},{"text":"Menu Widget","id":"c-1176548289698","options":[{"text":"Color Palette Item","cmpId":"c-1176548289698","iconCls":"folder","type":"fileCt","allowDelete":true,"allowEdit":true,"id":"o-1176600135917","children":[{"allowDelete":true,"text":"ColorPalette.js","id":"source/widgets/ColorPalette.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 9:02 pm<br />Size: 4.5 KB","qtipTitle":"ColorPalette.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}}],"loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"text":"Date Picker Item","cmpId":"c-1176548289698","iconCls":"folder","type":"fileCt","allowDelete":true,"allowEdit":true,"id":"o-1176600141997","children":[{"allowDelete":true,"text":"DatePicker.js","id":"source/widgets/DatePicker.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 9:02 pm<br />Size: 16 KB","qtipTitle":"DatePicker.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}}],"loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}}],"files":[{"allowDelete":true,"text":"Adapter.js","id":"source/widgets/menu/Adapter.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 6:04 pm<br />Size: 1.5 KB","qtipTitle":"Adapter.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"BaseItem.js","id":"source/widgets/menu/BaseItem.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 6:04 pm<br />Size: 3.7 KB","qtipTitle":"BaseItem.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"CheckItem.js","id":"source/widgets/menu/CheckItem.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 6:04 pm<br />Size: 3.7 KB","qtipTitle":"CheckItem.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"Item.js","id":"source/widgets/menu/Item.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 6:04 pm<br />Size: 3.8 KB","qtipTitle":"Item.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"Menu.js","id":"source/widgets/menu/Menu.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 6:04 pm<br />Size: 16 KB","qtipTitle":"Menu.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"MenuMgr.js","id":"source/widgets/menu/MenuMgr.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 6:04 pm<br />Size: 4.7 KB","qtipTitle":"MenuMgr.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"Separator.js","id":"source/widgets/menu/Separator.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 6:04 pm<br />Size: 1.2 KB","qtipTitle":"Separator.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"TextItem.js","id":"source/widgets/menu/TextItem.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 6:04 pm<br />Size: 1.1 KB","qtipTitle":"TextItem.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}}],"dep":[{"allowDelete":true,"text":"MixedCollection.js","id":"source/util/MixedCollection.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 6:04 pm<br />Size: 17 KB","qtipTitle":"MixedCollection.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"Shadow.js","id":"source/widgets/Shadow.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 6:04 pm<br />Size: 3.4 KB","qtipTitle":"Shadow.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"Layer.js","id":"source/widgets/Layer.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 6:04 pm<br />Size: 9.9 KB","qtipTitle":"Layer.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"Component.js","id":"source/widgets/Component.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 6:04 pm<br />Size: 9 KB","qtipTitle":"Component.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"KeyNav.js","id":"source/util/KeyNav.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:44 pm<br />Size: 3 KB","qtipTitle":"KeyNav.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}}]},{"text":"Loading Mask Widget","id":"c-1176682522794","options":[],"files":[{"allowDelete":true,"expanded":true,"text":"LoadMask.js","id":"source/widgets/LoadMask.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 15, 2007, 5:18 pm<br />Size: 3.1 KB","qtipTitle":"LoadMask.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","dataUrl":"dependency.php","events":{"beforeload":true,"load":true,"loadexception":true},"transId":false}}],"dep":[]},{"text":"Date Picker Popup (DateMenu)","id":"c-1176548289970","options":[],"files":[{"allowDelete":true,"text":"DateMenu.js","id":"source/widgets/menu/DateMenu.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 6:04 pm<br />Size: 888 B","qtipTitle":"DateMenu.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"DatePicker.js","id":"source/widgets/DatePicker.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 6:04 pm<br />Size: 16 KB","qtipTitle":"DatePicker.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"DateItem.js","id":"source/widgets/menu/DateItem.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 6:04 pm<br />Size: 1.1 KB","qtipTitle":"DateItem.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}}],"dep":[{"allowDelete":true,"text":"Date.js","id":"source/util/Date.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 6:04 pm<br />Size: 23 KB","qtipTitle":"Date.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"Layer.js","id":"source/widgets/Layer.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 6:04 pm<br />Size: 9.9 KB","qtipTitle":"Layer.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"Shadow.js","id":"source/widgets/Shadow.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 6:04 pm<br />Size: 3.4 KB","qtipTitle":"Shadow.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"MenuMgr.js","id":"source/widgets/menu/MenuMgr.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 6:04 pm<br />Size: 4.7 KB","qtipTitle":"MenuMgr.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"Menu.js","id":"source/widgets/menu/Menu.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 6:04 pm<br />Size: 16 KB","qtipTitle":"Menu.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"BaseItem.js","id":"source/widgets/menu/BaseItem.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 6:04 pm<br />Size: 3.7 KB","qtipTitle":"BaseItem.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"Adapter.js","id":"source/widgets/menu/Adapter.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 6:04 pm<br />Size: 1.5 KB","qtipTitle":"Adapter.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"Component.js","id":"source/widgets/Component.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 6:04 pm<br />Size: 9 KB","qtipTitle":"Component.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"KeyNav.js","id":"source/util/KeyNav.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:44 pm<br />Size: 3 KB","qtipTitle":"KeyNav.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"ClickRepeater.js","id":"source/util/ClickRepeater.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:44 pm<br />Size: 4.9 KB","qtipTitle":"ClickRepeater.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}}]},{"text":"Color Picker Popup (ColorMenu)","id":"c-1176548290251","options":[],"files":[{"allowDelete":true,"text":"ColorMenu.js","id":"source/widgets/menu/ColorMenu.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 6:04 pm<br />Size: 915 B","qtipTitle":"ColorMenu.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"ColorItem.js","id":"source/widgets/menu/ColorItem.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 6:04 pm<br />Size: 792 B","qtipTitle":"ColorItem.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"ColorPalette.js","id":"source/widgets/ColorPalette.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 6:04 pm<br />Size: 4.5 KB","qtipTitle":"ColorPalette.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}}],"dep":[{"allowDelete":true,"text":"Layer.js","id":"source/widgets/Layer.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 6:04 pm<br />Size: 9.9 KB","qtipTitle":"Layer.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"Shadow.js","id":"source/widgets/Shadow.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 6:04 pm<br />Size: 3.4 KB","qtipTitle":"Shadow.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"MenuMgr.js","id":"source/widgets/menu/MenuMgr.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 6:04 pm<br />Size: 4.7 KB","qtipTitle":"MenuMgr.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"Menu.js","id":"source/widgets/menu/Menu.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 6:04 pm<br />Size: 16 KB","qtipTitle":"Menu.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"BaseItem.js","id":"source/widgets/menu/BaseItem.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 6:04 pm<br />Size: 3.7 KB","qtipTitle":"BaseItem.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"Adapter.js","id":"source/widgets/menu/Adapter.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 6:04 pm<br />Size: 1.5 KB","qtipTitle":"Adapter.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"Component.js","id":"source/widgets/Component.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 6:04 pm<br />Size: 9 KB","qtipTitle":"Component.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}}]},{"text":"Border Layout Widget","id":"c-1176590622527","options":[{"text":"Preconfigured Outlook Style Layout","cmpId":"c-1176590622527","iconCls":"folder","type":"fileCt","allowDelete":true,"allowEdit":true,"id":"o-1176600285242","children":[{"allowDelete":true,"text":"ReaderLayout.js","id":"source/widgets/layout/ReaderLayout.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 9:02 pm<br />Size: 2.4 KB","qtipTitle":"ReaderLayout.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}}],"loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}}],"files":[{"allowDelete":true,"text":"BasicLayoutRegion.js","id":"source/widgets/layout/BasicLayoutRegion.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 6:04 pm<br />Size: 9.5 KB","qtipTitle":"BasicLayoutRegion.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"BorderLayout.js","id":"source/widgets/layout/BorderLayout.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 6:04 pm<br />Size: 11 KB","qtipTitle":"BorderLayout.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"BorderLayoutRegions.js","id":"source/widgets/layout/BorderLayoutRegions.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 6:04 pm<br />Size: 6.2 KB","qtipTitle":"BorderLayoutRegions.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"ContentPanels.js","id":"source/widgets/layout/ContentPanels.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 6:04 pm<br />Size: 17 KB","qtipTitle":"ContentPanels.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"LayoutManager.js","id":"source/widgets/layout/LayoutManager.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 6:04 pm<br />Size: 4.2 KB","qtipTitle":"LayoutManager.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"LayoutRegion.js","id":"source/widgets/layout/LayoutRegion.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 6:04 pm<br />Size: 21 KB","qtipTitle":"LayoutRegion.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"LayoutStateManager.js","id":"source/widgets/layout/LayoutStateManager.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 6:04 pm<br />Size: 2.3 KB","qtipTitle":"LayoutStateManager.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"SplitLayoutRegion.js","id":"source/widgets/layout/SplitLayoutRegion.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 6:04 pm<br />Size: 10 KB","qtipTitle":"SplitLayoutRegion.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}}],"dep":[{"allowDelete":true,"text":"MixedCollection.js","id":"source/util/MixedCollection.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 6:04 pm<br />Size: 17 KB","qtipTitle":"MixedCollection.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"SplitBar.js","id":"source/widgets/SplitBar.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 6:04 pm<br />Size: 14 KB","qtipTitle":"SplitBar.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"DDCore.js","id":"source/dd/DDCore.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 6:04 pm<br />Size: 95 KB","qtipTitle":"DDCore.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"TabPanel.js","id":"source/widgets/TabPanel.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 6:04 pm<br />Size: 25 KB","qtipTitle":"TabPanel.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}}]},{"text":"Toolbar Widget","id":"c-1176590623103","options":[{"text":"Menu Buttons","cmpId":"c-1176590623103","iconCls":"folder","type":"fileCt","allowDelete":true,"allowEdit":true,"id":"o-1176600354384","children":[{"allowDelete":true,"text":"MenuButton.js","id":"source/widgets/MenuButton.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 9:02 pm<br />Size: 6.3 KB","qtipTitle":"MenuButton.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}}],"loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"text":"Paging Toolbar","cmpId":"c-1176590623103","iconCls":"folder","type":"fileCt","allowDelete":true,"allowEdit":true,"id":"o-1176683220697","children":[{"allowDelete":true,"expanded":true,"text":"PagingToolbar.js","id":"source/widgets/PagingToolbar.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 15, 2007, 5:18 pm<br />Size: 9.2 KB","qtipTitle":"PagingToolbar.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","dataUrl":"dependency.php","events":{"beforeload":true,"load":true,"loadexception":true},"transId":false}}]}],"files":[{"allowDelete":true,"text":"Toolbar.js","id":"source/widgets/Toolbar.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 6:04 pm<br />Size: 12 KB","qtipTitle":"Toolbar.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}}],"dep":[{"allowDelete":true,"text":"MixedCollection.js","id":"source/util/MixedCollection.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 6:04 pm<br />Size: 17 KB","qtipTitle":"MixedCollection.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"Button.js","id":"source/widgets/Button.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 6:56 am<br />Size: 13 KB","qtipTitle":"Button.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"TextMetrics.js","id":"source/util/TextMetrics.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 6:56 am<br />Size: 1.8 KB","qtipTitle":"TextMetrics.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}}]},{"text":"Dialog - Basic Widget","id":"c-1176590621920","options":[{"text":"Dialog Resize Support","cmpId":"c-1176590621920","iconCls":"folder","type":"fileCt","allowDelete":true,"allowEdit":true,"id":"o-1176591083447","children":[{"allowDelete":true,"text":"Resizable.js","id":"source/widgets/Resizable.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 9:02 pm<br />Size: 21 KB","qtipTitle":"Resizable.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}}],"loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"text":"Dialog Drag and Drop Support","cmpId":"c-1176590621920","iconCls":"folder","type":"fileCt","allowDelete":true,"allowEdit":true,"id":"o-1176591106528","children":[{"allowDelete":true,"text":"DDCore.js","id":"source/dd/DDCore.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 9:02 pm<br />Size: 95 KB","qtipTitle":"DDCore.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}}],"loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"text":"Tabs Support","cmpId":"c-1176590621920","iconCls":"folder","type":"fileCt","allowDelete":true,"allowEdit":true,"id":"o-1176593460681","children":[{"allowDelete":true,"text":"TabPanel.js","id":"source/widgets/TabPanel.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 9:02 pm<br />Size: 25 KB","qtipTitle":"TabPanel.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}}],"loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}}],"files":[{"allowDelete":true,"text":"BasicDialog.js","id":"source/widgets/BasicDialog.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 6:04 pm<br />Size: 41 KB","qtipTitle":"BasicDialog.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}}],"dep":[{"allowDelete":true,"text":"Shadow.js","id":"source/widgets/Shadow.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 6:04 pm<br />Size: 3.4 KB","qtipTitle":"Shadow.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}}]},{"text":"Dialog - MessageBox","id":"c-1176590623375","options":[],"files":[{"allowDelete":true,"text":"MessageBox.js","id":"source/widgets/MessageBox.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 6:04 pm<br />Size: 20 KB","qtipTitle":"MessageBox.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}}],"dep":[{"allowDelete":true,"text":"BasicDialog.js","id":"source/widgets/BasicDialog.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 6:04 pm<br />Size: 41 KB","qtipTitle":"BasicDialog.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"Shadow.js","id":"source/widgets/Shadow.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 6:04 pm<br />Size: 3.4 KB","qtipTitle":"Shadow.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}}]},{"text":"Data - Core","id":"c-1176590623903","options":[],"files":[{"allowDelete":true,"text":"Connection.js","id":"source/data/Connection.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:44 pm<br />Size: 2.6 KB","qtipTitle":"Connection.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"DataField.js","id":"source/data/DataField.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:44 pm<br />Size: 3 KB","qtipTitle":"DataField.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"DataProxy.js","id":"source/data/DataProxy.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:44 pm<br />Size: 1.7 KB","qtipTitle":"DataProxy.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"DataReader.js","id":"source/data/DataReader.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:44 pm<br />Size: 379 B","qtipTitle":"DataReader.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"Record.js","id":"source/data/Record.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:44 pm<br />Size: 7.5 KB","qtipTitle":"Record.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"SortTypes.js","id":"source/data/SortTypes.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:44 pm<br />Size: 2.4 KB","qtipTitle":"SortTypes.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"Store.js","id":"source/data/Store.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:44 pm<br />Size: 20 KB","qtipTitle":"Store.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"HttpProxy.js","id":"source/data/HttpProxy.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:44 pm<br />Size: 3.7 KB","qtipTitle":"HttpProxy.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"ScriptTagProxy.js","id":"source/data/ScriptTagProxy.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:44 pm<br />Size: 6.2 KB","qtipTitle":"ScriptTagProxy.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"MemoryProxy.js","id":"source/data/MemoryProxy.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:44 pm<br />Size: 2.1 KB","qtipTitle":"MemoryProxy.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}}],"dep":[{"allowDelete":true,"text":"MixedCollection.js","id":"source/util/MixedCollection.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:44 pm<br />Size: 17 KB","qtipTitle":"MixedCollection.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}}]},{"text":"Data - JSON Support","id":"c-1176590624144","options":[],"files":[{"allowDelete":true,"text":"JsonReader.js","id":"source/data/JsonReader.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:44 pm<br />Size: 6 KB","qtipTitle":"JsonReader.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"ArrayReader.js","id":"source/data/ArrayReader.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:44 pm<br />Size: 3.4 KB","qtipTitle":"ArrayReader.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}}],"dep":[{"allowDelete":true,"text":"JSON.js","id":"source/util/JSON.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:44 pm<br />Size: 4.3 KB","qtipTitle":"JSON.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"Connection.js","id":"source/data/Connection.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:44 pm<br />Size: 2.6 KB","qtipTitle":"Connection.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"DataField.js","id":"source/data/DataField.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:44 pm<br />Size: 3 KB","qtipTitle":"DataField.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"DataProxy.js","id":"source/data/DataProxy.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:44 pm<br />Size: 1.7 KB","qtipTitle":"DataProxy.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"DataReader.js","id":"source/data/DataReader.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:44 pm<br />Size: 379 B","qtipTitle":"DataReader.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"Record.js","id":"source/data/Record.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:44 pm<br />Size: 7.5 KB","qtipTitle":"Record.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"SortTypes.js","id":"source/data/SortTypes.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:44 pm<br />Size: 2.4 KB","qtipTitle":"SortTypes.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"Store.js","id":"source/data/Store.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:44 pm<br />Size: 20 KB","qtipTitle":"Store.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"HttpProxy.js","id":"source/data/HttpProxy.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:44 pm<br />Size: 3.7 KB","qtipTitle":"HttpProxy.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"ScriptTagProxy.js","id":"source/data/ScriptTagProxy.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:44 pm<br />Size: 6.2 KB","qtipTitle":"ScriptTagProxy.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"MemoryProxy.js","id":"source/data/MemoryProxy.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:44 pm<br />Size: 2.1 KB","qtipTitle":"MemoryProxy.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"MixedCollection.js","id":"source/util/MixedCollection.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:44 pm<br />Size: 17 KB","qtipTitle":"MixedCollection.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}}]},{"text":"Data - XML Support","id":"c-1176594563024","options":[],"files":[{"allowDelete":true,"text":"XmlReader.js","id":"source/data/XmlReader.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:44 pm<br />Size: 4.7 KB","qtipTitle":"XmlReader.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}}],"dep":[{"allowDelete":true,"text":"Connection.js","id":"source/data/Connection.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:44 pm<br />Size: 2.6 KB","qtipTitle":"Connection.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"DataField.js","id":"source/data/DataField.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:44 pm<br />Size: 3 KB","qtipTitle":"DataField.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"DataProxy.js","id":"source/data/DataProxy.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:44 pm<br />Size: 1.7 KB","qtipTitle":"DataProxy.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"DataReader.js","id":"source/data/DataReader.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:44 pm<br />Size: 379 B","qtipTitle":"DataReader.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"Record.js","id":"source/data/Record.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:44 pm<br />Size: 7.5 KB","qtipTitle":"Record.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"SortTypes.js","id":"source/data/SortTypes.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:44 pm<br />Size: 2.4 KB","qtipTitle":"SortTypes.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"Store.js","id":"source/data/Store.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:44 pm<br />Size: 20 KB","qtipTitle":"Store.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"HttpProxy.js","id":"source/data/HttpProxy.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:44 pm<br />Size: 3.7 KB","qtipTitle":"HttpProxy.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"ScriptTagProxy.js","id":"source/data/ScriptTagProxy.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:44 pm<br />Size: 6.2 KB","qtipTitle":"ScriptTagProxy.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"MemoryProxy.js","id":"source/data/MemoryProxy.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:44 pm<br />Size: 2.1 KB","qtipTitle":"MemoryProxy.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"MixedCollection.js","id":"source/util/MixedCollection.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:44 pm<br />Size: 17 KB","qtipTitle":"MixedCollection.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}}]},{"text":"Data - Simple Store","id":"c-1176594562552","options":[],"files":[{"allowDelete":true,"text":"SimpleStore.js","id":"source/data/SimpleStore.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:44 pm<br />Size: 976 B","qtipTitle":"SimpleStore.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}}],"dep":[{"allowDelete":true,"text":"JsonReader.js","id":"source/data/JsonReader.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:44 pm<br />Size: 6 KB","qtipTitle":"JsonReader.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"ArrayReader.js","id":"source/data/ArrayReader.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:44 pm<br />Size: 3.4 KB","qtipTitle":"ArrayReader.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"Connection.js","id":"source/data/Connection.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:44 pm<br />Size: 2.6 KB","qtipTitle":"Connection.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"DataField.js","id":"source/data/DataField.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:44 pm<br />Size: 3 KB","qtipTitle":"DataField.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"DataReader.js","id":"source/data/DataReader.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:44 pm<br />Size: 379 B","qtipTitle":"DataReader.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"Record.js","id":"source/data/Record.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:44 pm<br />Size: 7.5 KB","qtipTitle":"Record.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"SortTypes.js","id":"source/data/SortTypes.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:44 pm<br />Size: 2.4 KB","qtipTitle":"SortTypes.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"Store.js","id":"source/data/Store.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:44 pm<br />Size: 20 KB","qtipTitle":"Store.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"MixedCollection.js","id":"source/util/MixedCollection.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:44 pm<br />Size: 17 KB","qtipTitle":"MixedCollection.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}}]},{"text":"Views - Data Bound Views","id":"c-1176590623664","options":[{"text":"JSON Support","cmpId":"c-1176590623664","iconCls":"folder","type":"fileCt","allowDelete":true,"allowEdit":true,"id":"o-1176594452492","children":[{"allowDelete":true,"expanded":true,"text":"JSON.js","id":"source/util/JSON.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 11:01 pm<br />Size: 4.3 KB","qtipTitle":"JSON.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","dataUrl":"dependency.php","events":{"beforeload":true,"load":true,"loadexception":true},"transId":false}}],"loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}}],"files":[{"allowDelete":true,"text":"View.js","id":"source/widgets/View.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 6:04 pm<br />Size: 24 KB","qtipTitle":"View.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"JsonView.js","id":"source/widgets/JsonView.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:44 pm<br />Size: 9.9 KB","qtipTitle":"JsonView.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}}],"dep":[]},{"text":"Form - Basic Fields","id":"c-1176596007536","options":[{"text":"Custom Validations","cmpId":"c-1176596007536","iconCls":"folder","type":"fileCt","allowDelete":true,"allowEdit":true,"id":"o-1176596661900","children":[{"allowDelete":true,"text":"VTypes.js","id":"source/widgets/form/VTypes.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 9:02 pm<br />Size: 2.9 KB","qtipTitle":"VTypes.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}}],"loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}}],"files":[{"allowDelete":true,"text":"Field.js","id":"source/widgets/form/Field.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:44 pm<br />Size: 15 KB","qtipTitle":"Field.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"Checkbox.js","id":"source/widgets/form/Checkbox.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:44 pm<br />Size: 3.6 KB","qtipTitle":"Checkbox.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"NumberField.js","id":"source/widgets/form/NumberField.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:44 pm<br />Size: 4.8 KB","qtipTitle":"NumberField.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"Radio.js","id":"source/widgets/form/Radio.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:44 pm<br />Size: 489 B","qtipTitle":"Radio.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"TextArea.js","id":"source/widgets/form/TextArea.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:44 pm<br />Size: 3.2 KB","qtipTitle":"TextArea.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"TextField.js","id":"source/widgets/form/TextField.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:44 pm<br />Size: 11 KB","qtipTitle":"TextField.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}}],"dep":[{"allowDelete":true,"text":"Component.js","id":"source/widgets/Component.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:44 pm<br />Size: 9 KB","qtipTitle":"Component.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}}]},{"text":"Form - ComboBox Widget","id":"c-1176594563568","options":[{"text":"Custom Validations","cmpId":"c-1176594563568","iconCls":"folder","type":"fileCt","allowDelete":true,"allowEdit":true,"id":"o-1176596097474","children":[{"allowDelete":true,"text":"VTypes.js","id":"source/widgets/form/VTypes.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 9:02 pm<br />Size: 2.9 KB","qtipTitle":"VTypes.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}}],"loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}}],"files":[{"allowDelete":true,"text":"Combo.js","id":"source/widgets/form/Combo.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:44 pm<br />Size: 28 KB","qtipTitle":"Combo.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}}],"dep":[{"allowDelete":true,"text":"Component.js","id":"source/widgets/Component.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:44 pm<br />Size: 9 KB","qtipTitle":"Component.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"Field.js","id":"source/widgets/form/Field.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:44 pm<br />Size: 15 KB","qtipTitle":"Field.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"TextField.js","id":"source/widgets/form/TextField.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:44 pm<br />Size: 11 KB","qtipTitle":"TextField.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"TriggerField.js","id":"source/widgets/form/TriggerField.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:44 pm<br />Size: 6 KB","qtipTitle":"TriggerField.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"View.js","id":"source/widgets/View.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 6:04 pm<br />Size: 24 KB","qtipTitle":"View.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"KeyNav.js","id":"source/util/KeyNav.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:44 pm<br />Size: 3 KB","qtipTitle":"KeyNav.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}}]},{"text":"Form - Date Field","id":"c-1176596008487","options":[],"files":[{"allowDelete":true,"text":"DateField.js","id":"source/widgets/form/DateField.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:44 pm<br />Size: 9 KB","qtipTitle":"DateField.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}}],"dep":[{"allowDelete":true,"text":"TriggerField.js","id":"source/widgets/form/TriggerField.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:44 pm<br />Size: 6 KB","qtipTitle":"TriggerField.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"Field.js","id":"source/widgets/form/Field.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:44 pm<br />Size: 15 KB","qtipTitle":"Field.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"TextField.js","id":"source/widgets/form/TextField.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:44 pm<br />Size: 11 KB","qtipTitle":"TextField.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"Component.js","id":"source/widgets/Component.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:44 pm<br />Size: 9 KB","qtipTitle":"Component.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"DateMenu.js","id":"source/widgets/menu/DateMenu.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 6:04 pm<br />Size: 888 B","qtipTitle":"DateMenu.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"DatePicker.js","id":"source/widgets/DatePicker.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 6:04 pm<br />Size: 16 KB","qtipTitle":"DatePicker.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"DateItem.js","id":"source/widgets/menu/DateItem.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 6:04 pm<br />Size: 1.1 KB","qtipTitle":"DateItem.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"Date.js","id":"source/util/Date.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 6:04 pm<br />Size: 23 KB","qtipTitle":"Date.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"Layer.js","id":"source/widgets/Layer.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 6:04 pm<br />Size: 9.9 KB","qtipTitle":"Layer.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"Shadow.js","id":"source/widgets/Shadow.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 6:04 pm<br />Size: 3.4 KB","qtipTitle":"Shadow.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"MenuMgr.js","id":"source/widgets/menu/MenuMgr.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 6:04 pm<br />Size: 4.7 KB","qtipTitle":"MenuMgr.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"Menu.js","id":"source/widgets/menu/Menu.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 6:04 pm<br />Size: 16 KB","qtipTitle":"Menu.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"BaseItem.js","id":"source/widgets/menu/BaseItem.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 6:04 pm<br />Size: 3.7 KB","qtipTitle":"BaseItem.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"Adapter.js","id":"source/widgets/menu/Adapter.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 6:04 pm<br />Size: 1.5 KB","qtipTitle":"Adapter.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"KeyNav.js","id":"source/util/KeyNav.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:44 pm<br />Size: 3 KB","qtipTitle":"KeyNav.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"ClickRepeater.js","id":"source/util/ClickRepeater.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:44 pm<br />Size: 4.9 KB","qtipTitle":"ClickRepeater.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}}]},{"text":"Form - Ajax and Loading Support","id":"c-1176596009103","options":[{"text":"XML Loading Support","cmpId":"c-1176596009103","iconCls":"folder","type":"fileCt","allowDelete":true,"allowEdit":true,"id":"o-1176596755855","children":[{"allowDelete":true,"text":"XmlReader.js","id":"source/data/XmlReader.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 9:02 pm<br />Size: 4.7 KB","qtipTitle":"XmlReader.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}}],"loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}}],"files":[{"allowDelete":true,"text":"BasicForm.js","id":"source/widgets/form/BasicForm.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:44 pm<br />Size: 9.9 KB","qtipTitle":"BasicForm.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"Action.js","id":"source/widgets/form/Action.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:44 pm<br />Size: 5.6 KB","qtipTitle":"Action.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}}],"dep":[]},{"text":"Form - Dynamic Rendering","id":"c-1176596009599","options":[],"files":[{"allowDelete":true,"text":"Form.js","id":"source/widgets/form/Form.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:44 pm<br />Size: 7.7 KB","qtipTitle":"Form.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"Layout.js","id":"source/widgets/form/Layout.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:44 pm<br />Size: 4.3 KB","qtipTitle":"Layout.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}}],"dep":[{"allowDelete":true,"text":"BasicForm.js","id":"source/widgets/form/BasicForm.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:44 pm<br />Size: 9.9 KB","qtipTitle":"BasicForm.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"Action.js","id":"source/widgets/form/Action.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:44 pm<br />Size: 5.6 KB","qtipTitle":"Action.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}}]},{"text":"Form - Floating Editor","id":"c-1176596675069","options":[],"files":[{"allowDelete":true,"text":"Editor.js","id":"source/widgets/Editor.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:44 pm<br />Size: 4.5 KB","qtipTitle":"Editor.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}}],"dep":[{"allowDelete":true,"text":"Layer.js","id":"source/widgets/Layer.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:44 pm<br />Size: 9.9 KB","qtipTitle":"Layer.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"Shadow.js","id":"source/widgets/Shadow.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:44 pm<br />Size: 3.4 KB","qtipTitle":"Shadow.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"Component.js","id":"source/widgets/Component.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:44 pm<br />Size: 9 KB","qtipTitle":"Component.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}}]},{"text":"Grid - Core","id":"c-1176596674270","options":[{"text":"CellSelectionModel.js","cmpId":"c-1176596674270","iconCls":"folder","type":"fileCt","allowDelete":true,"allowEdit":true,"id":"o-1176598193101","children":[{"allowDelete":true,"text":"CellSelectionModel.js","id":"source/widgets/grid/CellSelectionModel.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 9:02 pm<br />Size: 6.7 KB","qtipTitle":"CellSelectionModel.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","dataUrl":"dependency.php","events":{"beforeload":true,"load":true,"loadexception":true},"transId":false}}],"loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"text":"Drag and Drop Column Reorder","cmpId":"c-1176596674270","iconCls":"folder","type":"fileCt","allowDelete":true,"allowEdit":true,"id":"o-1176598971151","children":[{"allowDelete":true,"text":"ColumnDD.js","id":"source/widgets/grid/ColumnDD.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 9:02 pm<br />Size: 5.7 KB","qtipTitle":"ColumnDD.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}}],"loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"text":"Column Resizing","cmpId":"c-1176596674270","iconCls":"folder","type":"fileCt","allowDelete":true,"allowEdit":true,"id":"o-1176598974743","children":[{"allowDelete":true,"text":"ColumnSplitDD.js","id":"source/widgets/grid/ColumnSplitDD.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 9:02 pm<br />Size: 2 KB","qtipTitle":"ColumnSplitDD.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}}],"loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"text":"Drag Grid Rows","cmpId":"c-1176596674270","iconCls":"folder","type":"fileCt","allowDelete":true,"allowEdit":true,"id":"o-1176598980335","children":[{"allowDelete":true,"text":"GridDD.js","id":"source/widgets/grid/GridDD.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 9:02 pm<br />Size: 1.7 KB","qtipTitle":"GridDD.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}}],"loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"text":"Loading Mask","cmpId":"c-1176596674270","iconCls":"folder","type":"fileCt","allowDelete":true,"allowEdit":true,"id":"o-1176682774459","children":[{"allowDelete":true,"expanded":true,"text":"LoadMask.js","id":"source/widgets/LoadMask.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 15, 2007, 5:18 pm<br />Size: 3.1 KB","qtipTitle":"LoadMask.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","dataUrl":"dependency.php","events":{"beforeload":true,"load":true,"loadexception":true},"transId":false}}]},{"text":"Paging Toolbar","cmpId":"c-1176596674270","iconCls":"folder","type":"fileCt","allowDelete":true,"allowEdit":true,"id":"o-1176683284876","children":[{"allowDelete":true,"expanded":true,"text":"PagingToolbar.js","id":"source/widgets/PagingToolbar.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 15, 2007, 5:18 pm<br />Size: 9.2 KB","qtipTitle":"PagingToolbar.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","dataUrl":"dependency.php","events":{"beforeload":true,"load":true,"loadexception":true},"transId":false}},{"allowDelete":true,"expanded":true,"text":"Toolbar.js","id":"source/widgets/Toolbar.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 15, 2007, 5:18 pm<br />Size: 12 KB","qtipTitle":"Toolbar.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","dataUrl":"dependency.php","events":{"beforeload":true,"load":true,"loadexception":true},"transId":false}},{"allowDelete":true,"expanded":true,"text":"Button.js","id":"source/widgets/Button.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 15, 2007, 5:18 pm<br />Size: 14 KB","qtipTitle":"Button.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","dataUrl":"dependency.php","events":{"beforeload":true,"load":true,"loadexception":true},"transId":false}},{"allowDelete":true,"expanded":true,"text":"TextMetrics.js","id":"source/util/TextMetrics.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 15, 2007, 5:18 pm<br />Size: 1.8 KB","qtipTitle":"TextMetrics.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","dataUrl":"dependency.php","events":{"beforeload":true,"load":true,"loadexception":true},"transId":false}},{"allowDelete":true,"expanded":true,"text":"MixedCollection.js","id":"source/util/MixedCollection.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 15, 2007, 5:18 pm<br />Size: 17 KB","qtipTitle":"MixedCollection.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","dataUrl":"dependency.php","events":{"beforeload":true,"load":true,"loadexception":true},"transId":false}}]}],"files":[{"allowDelete":true,"text":"AbstractGridView.js","id":"source/widgets/grid/AbstractGridView.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:44 pm<br />Size: 3.1 KB","qtipTitle":"AbstractGridView.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"AbstractSelectionModel.js","id":"source/widgets/grid/AbstractSelectionModel.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:44 pm<br />Size: 1 KB","qtipTitle":"AbstractSelectionModel.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"RowSelectionModel.js","id":"source/widgets/grid/RowSelectionModel.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:44 pm<br />Size: 13 KB","qtipTitle":"RowSelectionModel.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"Grid.js","id":"source/widgets/grid/Grid.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:44 pm<br />Size: 18 KB","qtipTitle":"Grid.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"ColumnModel.js","id":"source/widgets/grid/ColumnModel.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:44 pm<br />Size: 12 KB","qtipTitle":"ColumnModel.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"GridView.js","id":"source/widgets/grid/GridView.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:44 pm<br />Size: 58 KB","qtipTitle":"GridView.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}}],"dep":[{"allowDelete":true,"expanded":true,"text":"CSS.js","id":"source/util/CSS.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 11:01 pm<br />Size: 5 KB","qtipTitle":"CSS.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}}]},{"text":"Grid - Editing Support","id":"c-1176596839124","options":[],"files":[{"allowDelete":true,"text":"GridEditor.js","id":"source/widgets/grid/GridEditor.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:44 pm<br />Size: 461 B","qtipTitle":"GridEditor.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"EditorGrid.js","id":"source/widgets/grid/EditorGrid.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:44 pm<br />Size: 6.2 KB","qtipTitle":"EditorGrid.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}}],"dep":[{"allowDelete":true,"text":"Editor.js","id":"source/widgets/Editor.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:44 pm<br />Size: 4.5 KB","qtipTitle":"Editor.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"Layer.js","id":"source/widgets/Layer.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:44 pm<br />Size: 9.9 KB","qtipTitle":"Layer.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"Shadow.js","id":"source/widgets/Shadow.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:44 pm<br />Size: 3.4 KB","qtipTitle":"Shadow.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"Component.js","id":"source/widgets/Component.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:44 pm<br />Size: 9 KB","qtipTitle":"Component.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}}]},{"text":"Grid - Property Grid","id":"c-1176596839827","options":[],"files":[{"allowDelete":true,"text":"PropertyGrid.js","id":"source/widgets/grid/PropertyGrid.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:44 pm<br />Size: 6.3 KB","qtipTitle":"PropertyGrid.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}}],"dep":[{"allowDelete":true,"text":"GridEditor.js","id":"source/widgets/grid/GridEditor.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:44 pm<br />Size: 461 B","qtipTitle":"GridEditor.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"EditorGrid.js","id":"source/widgets/grid/EditorGrid.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:44 pm<br />Size: 6.2 KB","qtipTitle":"EditorGrid.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"Editor.js","id":"source/widgets/Editor.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:44 pm<br />Size: 4.5 KB","qtipTitle":"Editor.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"Layer.js","id":"source/widgets/Layer.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:44 pm<br />Size: 9.9 KB","qtipTitle":"Layer.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"Shadow.js","id":"source/widgets/Shadow.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:44 pm<br />Size: 3.4 KB","qtipTitle":"Shadow.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"Component.js","id":"source/widgets/Component.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:44 pm<br />Size: 9 KB","qtipTitle":"Component.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}}]},{"text":"Tree - Core","id":"c-1176596840547","options":[{"text":"Sorting Support","cmpId":"c-1176596840547","iconCls":"folder","type":"fileCt","allowDelete":true,"allowEdit":true,"id":"o-1176599045969","children":[{"allowDelete":true,"text":"TreeSorter.js","id":"source/widgets/tree/TreeSorter.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 9:02 pm<br />Size: 2.3 KB","qtipTitle":"TreeSorter.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","dataUrl":"dependency.php","events":{"beforeload":true,"load":true,"loadexception":true},"transId":false}}],"loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"text":"Filtering Support","cmpId":"c-1176596840547","iconCls":"folder","type":"fileCt","allowDelete":true,"allowEdit":true,"id":"o-1176599073554","children":[{"allowDelete":true,"text":"TreeFilter.js","id":"source/widgets/tree/TreeFilter.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 9:02 pm<br />Size: 3.6 KB","qtipTitle":"TreeFilter.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","dataUrl":"dependency.php","events":{"beforeload":true,"load":true,"loadexception":true},"transId":false}}],"loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"text":"Drag and Drop Support","cmpId":"c-1176596840547","iconCls":"folder","type":"fileCt","allowDelete":true,"allowEdit":true,"id":"o-1176599245706","children":[{"allowDelete":true,"text":"TreeDragZone.js","id":"source/widgets/tree/TreeDragZone.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 9:02 pm<br />Size: 1.5 KB","qtipTitle":"TreeDragZone.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","dataUrl":"dependency.php","events":{"beforeload":true,"load":true,"loadexception":true},"transId":false}},{"allowDelete":true,"text":"TreeDropZone.js","id":"source/widgets/tree/TreeDropZone.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 9:02 pm<br />Size: 7.9 KB","qtipTitle":"TreeDropZone.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","dataUrl":"dependency.php","events":{"beforeload":true,"load":true,"loadexception":true},"transId":false}}],"loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}}],"files":[{"allowDelete":true,"text":"Tree.js","id":"source/data/Tree.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 7:44 pm<br />Size: 25 KB","qtipTitle":"Tree.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"TreePanel.js","id":"source/widgets/tree/TreePanel.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 9:02 pm<br />Size: 14 KB","qtipTitle":"TreePanel.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"TreeSelectionModel.js","id":"source/widgets/tree/TreeSelectionModel.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 9:02 pm<br />Size: 9.1 KB","qtipTitle":"TreeSelectionModel.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"TreeNode.js","id":"source/widgets/tree/TreeNode.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 9:02 pm<br />Size: 15 KB","qtipTitle":"TreeNode.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"TreeNodeUI.js","id":"source/widgets/tree/TreeNodeUI.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 9:02 pm<br />Size: 14 KB","qtipTitle":"TreeNodeUI.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}}],"dep":[]},{"text":"Tree - Ajax Loading Support","id":"c-1176598286138","options":[],"files":[{"allowDelete":true,"text":"AsyncTreeNode.js","id":"source/widgets/tree/AsyncTreeNode.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 9:02 pm<br />Size: 3.5 KB","qtipTitle":"AsyncTreeNode.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}},{"allowDelete":true,"text":"TreeLoader.js","id":"source/widgets/tree/TreeLoader.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 9:02 pm<br />Size: 4.1 KB","qtipTitle":"TreeLoader.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}}],"dep":[{"allowDelete":true,"text":"JSON.js","id":"source/util/JSON.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 14, 2007, 9:02 pm<br />Size: 4.3 KB","qtipTitle":"JSON.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","events":{"beforeload":true,"load":true,"loadexception":true}}}]},{"text":"Tree - Editing Support","id":"c-1176682872198","options":[],"files":[{"allowDelete":true,"expanded":true,"text":"TreeEditor.js","id":"source/widgets/tree/TreeEditor.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 15, 2007, 5:18 pm<br />Size: 2.2 KB","qtipTitle":"TreeEditor.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","dataUrl":"dependency.php","events":{"beforeload":true,"load":true,"loadexception":true},"transId":false}}],"dep":[{"allowDelete":true,"expanded":true,"text":"Editor.js","id":"source/widgets/Editor.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 15, 2007, 5:18 pm<br />Size: 8.7 KB","qtipTitle":"Editor.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","dataUrl":"dependency.php","events":{"beforeload":true,"load":true,"loadexception":true},"transId":false}},{"allowDelete":true,"expanded":true,"text":"Shadow.js","id":"source/widgets/Shadow.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 15, 2007, 5:18 pm<br />Size: 5 KB","qtipTitle":"Shadow.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","dataUrl":"dependency.php","events":{"beforeload":true,"load":true,"loadexception":true},"transId":false}},{"allowDelete":true,"expanded":true,"text":"Layer.js","id":"source/widgets/Layer.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 15, 2007, 5:18 pm<br />Size: 11 KB","qtipTitle":"Layer.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","dataUrl":"dependency.php","events":{"beforeload":true,"load":true,"loadexception":true},"transId":false}},{"allowDelete":true,"expanded":true,"text":"Component.js","id":"source/widgets/Component.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 15, 2007, 5:18 pm<br />Size: 9 KB","qtipTitle":"Component.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","dataUrl":"dependency.php","events":{"beforeload":true,"load":true,"loadexception":true},"transId":false}},{"allowDelete":true,"expanded":true,"text":"Field.js","id":"source/widgets/form/Field.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 15, 2007, 5:18 pm<br />Size: 15 KB","qtipTitle":"Field.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","dataUrl":"dependency.php","events":{"beforeload":true,"load":true,"loadexception":true},"transId":false}},{"allowDelete":true,"expanded":true,"text":"TextField.js","id":"source/widgets/form/TextField.js","leaf":true,"qtip":"Type: JavaScript File<br />Last Modified: Apr 15, 2007, 5:18 pm<br />Size: 11 KB","qtipTitle":"TextField.js","cls":"file","loader":{"baseParams":{},"requestMethod":"POST","dataUrl":"dependency.php","events":{"beforeload":true,"load":true,"loadexception":true},"transId":false}}]}]
\ No newline at end of file
diff --git a/examples/tree/dependency.html b/examples/tree/dependency.html
new file mode 100644 (file)
index 0000000..462381a
--- /dev/null
@@ -0,0 +1,34 @@
+<html>\r
+<head>\r
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">\r
+<title>Ext Dependency Builder</title>\r
+  <link rel="stylesheet" type="text/css" href="../../cssX/roojs-all.css"/>
+    <link rel="stylesheet" type="text/css" href="../../cssX/xtheme-slate.css"/>
+
+     <script type="text/javascript" src="../../roojs-all.js"></script>   
+  
+  
+  <link rel="stylesheet" type="text/css" href="dependency.css" />\r
+    <script type="text/javascript" src="dependency.js"></script>\r
+\r
+    <!-- Common Styles for the examples -->\r
+    <link rel="stylesheet" type="text/css" href="../examples.css" />\r
+</head>\r
+<body>\r
+<script type="text/javascript" src="../examples.js"></script><!-- EXAMPLES -->\r
+<h1>Ext Dependency Builder</h1>\r
+<p>This is a piece of the application we use to build the Ext dependency tree.<br />\r
+    Key features it demonstrates:<br/>\r
+    * Restrictive drag and drop of nodes from tree to tree<br/>\r
+    * Restrictive reordering of nodes<br/>\r
+    * Loading and saving to/from different structures<br/>\r
+    * Dynamic tree context menu<br/>\r
+    * Inline editing of tree nodes<br/>\r
+    * Custom tree styles with CSS\r
+</p>\r
+<p>The js is not minified so it is readable. See <a href="dependency.js">dependency.js</a>.</p>\r
+\r
+<div id="main-ct" style="width:700px;height:500px;"></div>\r
+\r
+</body>\r
+</html>\r
diff --git a/examples/tree/dependency.js b/examples/tree/dependency.js
new file mode 100644 (file)
index 0000000..fe92fad
--- /dev/null
@@ -0,0 +1,438 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */\r
+Roo.onReady(function(){\r
+    var xt = Roo.tree;\r
+    // seeds for the new node suffix\r
+    var cseed = 0, oseed = 0;\r
+\r
+    // turn on quick tips\r
+    Roo.QuickTips.init();\r
+\r
+    var cview = Roo.DomHelper.append('main-ct',\r
+        {cn:[{id:'main-tb'},{id:'cbody'}]}\r
+    );\r
+\r
+\r
+    // create the primary toolbar\r
+    var tb = new Roo.Toolbar('main-tb');\r
+    tb.add({\r
+        id:'save',\r
+        text:'Save',\r
+        disabled:true,\r
+        handler:save,\r
+        cls:'x-btn-text-icon save',\r
+        tooltip:'Saves all components to the server'\r
+    },'-', {\r
+        id:'add',\r
+        text:'Component',\r
+        handler:addComponent,\r
+        cls:'x-btn-text-icon add-cmp',\r
+        tooltip:'Add a new Component to the dependency builder'\r
+    }, {\r
+        id:'option',\r
+        text:'Option',\r
+        disabled:true,\r
+        handler:addOption,\r
+        cls:'x-btn-text-icon add-opt',\r
+        tooltip:'Add a new optional dependency to the selected component'\r
+    },'-',{\r
+        id:'remove',\r
+        text:'Remove',\r
+        disabled:true,\r
+        handler:removeNode,\r
+        cls:'x-btn-text-icon remove',\r
+        tooltip:'Remove the selected item'\r
+    });\r
+    // for enabling and disabling\r
+    var btns = tb.items.map;\r
+\r
+\r
+\r
+    // create our layout\r
+    var layout = new Roo.BorderLayout('main-ct', {\r
+        west: {\r
+            split:true,\r
+            initialSize: 200,\r
+            minSize: 175,\r
+            maxSize: 400,\r
+            titlebar: true,\r
+            margins:{left:5,right:0,bottom:5,top:5}\r
+        },\r
+        center: {\r
+            title:'Components',\r
+            margins:{left:0,right:5,bottom:5,top:5}\r
+        }\r
+    }, 'main-ct');\r
+\r
+    layout.batchAdd({\r
+       west: {\r
+           id: 'source-files',\r
+           autoCreate:true,\r
+           title:'Ext Source Files',\r
+           autoScroll:true,\r
+           fitToFrame:true\r
+       },\r
+       center : {\r
+           el: cview,\r
+           autoScroll:true,\r
+           fitToFrame:true,\r
+           toolbar: tb,\r
+           resizeEl:'cbody'\r
+       }\r
+    });\r
+\r
+\r
+\r
+    // this is the source code tree\r
+    var stree = new xt.TreePanel('source-files', {\r
+        animate:true,\r
+        loader: new xt.TreeLoader({dataUrl:'dependency.php'}),\r
+        enableDrag:true,\r
+        containerScroll: true\r
+    });\r
+\r
+    new xt.TreeSorter(stree, {folderSort:true});\r
+\r
+    var sroot = new xt.AsyncTreeNode({\r
+        text: 'Ext JS',\r
+        draggable:false,\r
+        id:'source'\r
+    });\r
+    stree.setRootNode(sroot);\r
+    stree.render();\r
+    sroot.expand(false, false);\r
+\r
+\r
+    // the component tree\r
+    var ctree = new xt.TreePanel('cbody', {\r
+        animate:true,\r
+        enableDD:true,\r
+        containerScroll: true,\r
+        lines:false,\r
+        rootVisible:false,\r
+        loader: new Roo.tree.TreeLoader()\r
+    });\r
+\r
+    ctree.el.addKeyListener(Roo.EventObject.DELETE, removeNode);\r
+\r
+    var croot = new xt.AsyncTreeNode({\r
+        allowDrag:false,\r
+        allowDrop:true,\r
+        id:'croot',\r
+        text:'Packages and Components',\r
+        cls:'croot',\r
+        loader:new Roo.tree.TreeLoader({\r
+            dataUrl:'dep-tree.json',\r
+            createNode: readNode\r
+        })\r
+    });\r
+    ctree.setRootNode(croot);\r
+    ctree.render();\r
+    croot.expand();\r
+\r
+    // some functions to determine whether is not the drop is allowed\r
+    function hasNode(t, n){\r
+        return (t.attributes.type == 'fileCt' && t.findChild('id', n.id)) ||\r
+            (t.leaf === true && t.parentNode.findChild('id', n.id));\r
+    };\r
+\r
+    function isSourceCopy(e, n){\r
+        var a = e.target.attributes;\r
+        return n.getOwnerTree() == stree && !hasNode(e.target, n) &&\r
+           ((e.point == 'append' && a.type == 'fileCt') || a.leaf === true);\r
+    };\r
+\r
+    function isReorder(e, n){\r
+        return n.parentNode == e.target.parentNode && e.point != 'append';\r
+    };\r
+\r
+    // handle drag over and drag drop\r
+    ctree.on('nodedragover', function(e){\r
+        var n = e.dropNode;\r
+        return isSourceCopy(e, n) || isReorder(e, n);\r
+    });\r
+\r
+    ctree.on('beforenodedrop', function(e){\r
+        var n = e.dropNode;\r
+\r
+        // copy node from source tree\r
+        if(isSourceCopy(e, n)){\r
+            var copy = new xt.TreeNode(\r
+                Roo.apply({allowDelete:true,expanded:true}, n.attributes)\r
+            );\r
+            copy.loader = undefined;\r
+            if(e.target.attributes.options){\r
+                e.target = createOption(e.target, copy.text);\r
+                //return false;\r
+            }\r
+            e.dropNode = copy;\r
+            return true;\r
+        }\r
+\r
+        return isReorder(e, n);\r
+    });\r
+\r
+    ctree.on('contextmenu', prepareCtx);\r
+\r
+    // track whether save is allowed\r
+    ctree.on('append', trackSave);\r
+    ctree.on('remove', trackSave);\r
+    ctree.el.swallowEvent('contextmenu', true);\r
+    ctree.el.on('keypress', function(e){\r
+        if(e.isNavKeyPress()){\r
+            e.stopEvent();\r
+        }\r
+    });\r
+    // when the tree selection changes, enable/disable the toolbar buttons\r
+    var sm = ctree.getSelectionModel();\r
+    sm.on('selectionchange', function(){\r
+        var n = sm.getSelectedNode();\r
+        if(!n){\r
+            btns.remove.disable();\r
+            btns.option.disable();\r
+            return;\r
+        }\r
+        var a = n.attributes;\r
+        btns.remove.setDisabled(!a.allowDelete);\r
+        btns.option.setDisabled(!a.cmpId);\r
+    });\r
+\r
+\r
+\r
+    // create the editor for the component tree\r
+    var ge = new xt.TreeEditor(ctree, {\r
+        allowBlank:false,\r
+        blankText:'A name is required',\r
+        selectOnFocus:true\r
+    });\r
+    \r
+    ge.on('beforestartedit', function(){\r
+        if(!ge.editNode.attributes.allowEdit){\r
+            return false;\r
+        }\r
+    });\r
+\r
+\r
+    // add component handler\r
+    function addComponent(){\r
+        var id = guid('c-');\r
+        var text = 'Component '+(++cseed);\r
+        var node = createComponent(id, text);\r
+        node.expand(false, false);\r
+        node.select();\r
+        node.lastChild.ensureVisible();\r
+        ge.triggerEdit(node);\r
+    }\r
+\r
+    function createComponent(id, text, cfiles, cdep, coptions){\r
+        var node = new xt.TreeNode({\r
+            text: text,\r
+            iconCls:'cmp',\r
+            cls:'cmp',\r
+            type:'cmp',\r
+            id: id,\r
+            cmpId:id,\r
+            allowDelete:true,\r
+            allowEdit:true\r
+        });\r
+        croot.appendChild(node);\r
+\r
+        var files = new xt.AsyncTreeNode({\r
+            text: 'Files',\r
+            allowDrag:false,\r
+            allowDrop:true,\r
+            iconCls:'folder',\r
+            type:'fileCt',\r
+            cmpId:id,\r
+            allowDelete:false,\r
+            children:cfiles||[],\r
+            expanded:true\r
+        });\r
+\r
+        var dep = new xt.AsyncTreeNode({\r
+            text: 'Dependencies',\r
+            allowDrag:false,\r
+            allowDrop:true,\r
+            iconCls:'folder',\r
+            type:'fileCt',\r
+            cmpId:id,\r
+            allowDelete:false,\r
+            children:cdep||[],\r
+            expanded:true,\r
+            allowCopy:true\r
+        });\r
+\r
+        var options = new xt.AsyncTreeNode({\r
+            text: 'Optional Dependencies',\r
+            allowDrag:false,\r
+            allowDrop:true,\r
+            iconCls:'folder',\r
+            type:'fileCt',\r
+            options:true,\r
+            cmpId:id,\r
+            allowDelete:false,\r
+            children:coptions||[],\r
+            expanded:true,\r
+            allowCopy:true\r
+        });\r
+\r
+        node.appendChild(files);\r
+        node.appendChild(dep);\r
+        node.appendChild(options);\r
+\r
+        return node;\r
+    }\r
+\r
+    // remove handler\r
+    function removeNode(){\r
+        var n = sm.getSelectedNode();\r
+        if(n && n.attributes.allowDelete){\r
+            ctree.getSelectionModel().selectPrevious();\r
+            n.parentNode.removeChild(n);\r
+        }\r
+    }\r
+\r
+\r
+    // add option handler\r
+    function addOption(){\r
+        var n = sm.getSelectedNode();\r
+        if(n){\r
+            var node = createOption(n, 'Option'+(++oseed));\r
+            node.select();\r
+            ge.triggerEdit(node);\r
+        }\r
+    }\r
+\r
+    function createOption(n, text){\r
+        var cnode = ctree.getNodeById(n.attributes.cmpId);\r
+\r
+        var node = new xt.TreeNode({\r
+            text: text,\r
+            cmpId:cnode.id,\r
+            iconCls:'folder',\r
+            type:'fileCt',\r
+            allowDelete:true,\r
+            allowEdit:true,\r
+            id:guid('o-')\r
+        });\r
+        cnode.childNodes[2].appendChild(node);\r
+        cnode.childNodes[2].expand(false, false);\r
+\r
+        return node;\r
+    }\r
+\r
+    // semi unique ids across edits\r
+    function guid(prefix){\r
+        return prefix+(new Date().getTime());\r
+    }\r
+\r
+\r
+    function trackSave(){\r
+        btns.save.setDisabled(!croot.hasChildNodes());\r
+    }\r
+\r
+    function storeChildren(cmp, n, name){\r
+        if(n.childrenRendered){\r
+            cmp[name] = [];\r
+            n.eachChild(function(f){\r
+                cmp[name].push(f.attributes);\r
+            });\r
+        }else{\r
+            cmp[name] = n.attributes.children || [];\r
+        }\r
+    }\r
+\r
+    // save to the server in a format usable in PHP\r
+    function save(){\r
+        var ch = [];\r
+        croot.eachChild(function(c){\r
+            var cmp = {\r
+                text:c.text,\r
+                id: c.id,\r
+                options:[]\r
+            };\r
+\r
+            storeChildren(cmp, c.childNodes[0], 'files');\r
+            storeChildren(cmp, c.childNodes[1], 'dep');\r
+\r
+            var onode = c.childNodes[2];\r
+            if(!onode.childrenRendered){\r
+                cmp.options = onode.attributes.children || [];\r
+            }else{\r
+                onode.eachChild(function(o){\r
+                    var opt = Roo.apply({}, o.attributes);\r
+                    storeChildren(opt, o, 'children');\r
+                    cmp.options.push(opt);\r
+                });\r
+            }\r
+            ch.push(cmp);\r
+        });\r
+\r
+        layout.el.mask('Sending data to server...', 'x-mask-loading');\r
+        var hide = layout.el.unmask.createDelegate(layout.el);\r
+        Roo.lib.Ajax.request(\r
+            'POST',\r
+            'save-dep.php',\r
+            {success:hide,failure:hide},\r
+            'data='+encodeURIComponent(Roo.encode(ch))\r
+        );\r
+    }\r
+\r
+    function readNode(o){\r
+        createComponent(o.id, o.text, o.files, o.dep, o.options);\r
+    }\r
+\r
+    // context menus\r
+\r
+    var ctxMenu = new Roo.menu.Menu({\r
+        id:'copyCtx',\r
+        items: [{\r
+                id:'expand',\r
+                handler:expandAll,\r
+                cls:'expand-all',\r
+                text:'Expand All'\r
+            },{\r
+                id:'collapse',\r
+                handler:collapseAll,\r
+                cls:'collapse-all',\r
+                text:'Collapse All'\r
+            },'-',{\r
+                id:'remove',\r
+                handler:removeNode,\r
+                cls:'remove-mi',\r
+                text: 'Remove Item'\r
+        }]\r
+    });\r
+\r
+    function prepareCtx(node, e){\r
+        node.select();\r
+        ctxMenu.items.get('remove')[node.attributes.allowDelete ? 'enable' : 'disable']();\r
+        ctxMenu.showAt(e.getXY());\r
+    }\r
+\r
+    function collapseAll(){\r
+        ctxMenu.hide();\r
+        setTimeout(function(){\r
+            croot.eachChild(function(n){\r
+               n.collapse(false, false);\r
+            });\r
+        }, 10);\r
+    }\r
+\r
+    function expandAll(){\r
+        ctxMenu.hide();\r
+        setTimeout(function(){\r
+            croot.eachChild(function(n){\r
+               n.expand(false, false);\r
+            });\r
+        }, 10);\r
+    }\r
+});
\ No newline at end of file
diff --git a/examples/tree/get-nodes.php b/examples/tree/get-nodes.php
new file mode 100644 (file)
index 0000000..538ad12
--- /dev/null
@@ -0,0 +1,50 @@
+<?php
+
+$lib  = empty($_REQUEST['lib']) ? dirname(__FILE__)."/../../" : dirname(__FILE__)."/../" ;
+$rnode = empty($_REQUEST['node']) ? '' : $_REQUEST['node'];
+$node = preg_replace('/^(source|yui)/i', '',$rnode);
+if (strpos($node, '..') > 0) {
+    die("no traversing the tree!");
+}
+$dh = opendir($lib.$node);
+
+$ret = array();
+while (false !== ($f = readdir($dh))) {
+    if (empty($f) || $f[0] == '.') {
+        continue;
+    }
+    if (is_file($lib.$node.'/'.$f)) {
+        $r = array(
+            'text' => $f, 
+            'id' => $node.'/'.$f,
+            'cls' => 'file',
+            'leaf' => true,
+            'size' => filesize($lib.$node.'/'.$f),
+            
+        );
+        if (isset($_REQUEST['uiProvider'])) {
+            $r['uiProvider'] = 'col';
+        }
+        $ret[] =  $r;
+        continue;
+    }
+    $r = array(
+            'text' => $f, 
+            'id' => $node.'/'.$f,
+            'cls' => 'folder',
+            'leaf' => false,
+       
+    );
+    if (isset($_REQUEST['uiProvider'])) {
+            $r['uiProvider'] = 'col';
+        }
+    $ret[] = $r;
+    
+}
+closedir($dh);
+header('Content-type: text/javascript');
+echo json_encode($ret);
+
diff --git a/examples/tree/organizer.html b/examples/tree/organizer.html
new file mode 100644 (file)
index 0000000..85eb199
--- /dev/null
@@ -0,0 +1,32 @@
+<html>\r
+<head>\r
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">\r
+<title>Organizing Images into Albums</title>\r
+<link rel="stylesheet" type="text/css" href="../../cssX/roojs-all.css"/>
+    <link rel="stylesheet" type="text/css" href="../../cssX/xtheme-slate.css"/>
+
+     <script type="text/javascript" src="../../roojs-all.js"></script>   
+  
+  \r
+<script type="text/javascript" src="organizer.js"></script>\r
+\r
+<!-- Common Styles for the examples -->\r
+<link rel="stylesheet" type="text/css" href="../examples.css" />\r
+\r
+<link rel="stylesheet" type="text/css" href="organizer.css" />\r
+</head>\r
+<body>\r
+<script type="text/javascript" src="../examples.js"></script><!-- EXAMPLES -->\r
+<h1>Organizing Images into Albums</h1>\r
+<p>This example shows demonstrates how you can drop anything into the tree.</p>\r
+<p>This example also shows how a customized DragZone can be \r
+applied to a JsonView to get automatic lightweight drag and drop of asynchronously loaded data.</p>\r
+<p>The js is not minified so it is readable. See <a href="organizer.js">organizer.js</a>. The multi image drag drop added a little complexity to the code, but hopefully it is still easy to follow.\r
+<p>For simplicity, there is no validation on the names you enter in the tree node editor and you can drag the same picture \r
+into an album as many times as you want.</p>   \r
+<p>Hold shift/control to select multiple images in the main images view. You can drag those images into the tree.</b>\r
+\r
+<div id="layout"></div>\r
+<br /><br /><br /><br /><br />\r
+</body>\r
+</html>\r
diff --git a/examples/tree/organizer.js b/examples/tree/organizer.js
new file mode 100644 (file)
index 0000000..a761bd8
--- /dev/null
@@ -0,0 +1,253 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
\r
+Roo.tree.TreeNodeUI.prototype.initEvents =\r
+Roo.tree.TreeNodeUI.prototype.initEvents.createSequence(function(){\r
+      if(this.node.attributes.tipCfg){\r
+          var o = this.node.attributes.tipCfg;\r
+          o.target = Roo.id(this.textNode);\r
+          Roo.QuickTips.register(o);\r
+      }\r
+});\r
+\r
+var TreeTest = function(){\r
+    // shorthand\r
+    var Tree = Roo.tree;\r
+    var newIndex = 3;\r
+    \r
+    return {\r
+        init : function(){\r
+            Roo.QuickTips.init();\r
+            var layout = new Roo.BorderLayout('layout', {\r
+                west: {\r
+                    initialSize:200,\r
+                    split:true,\r
+                    titlebar:true\r
+                },\r
+                center: {\r
+                    alwaysShowTabs:true,\r
+                    tabPosition:'top'\r
+                }\r
+            });\r
+            \r
+            var albums = layout.getEl().createChild({tag:'div', id:'albums'});\r
+            var tb = new Roo.Toolbar(albums.createChild({tag:'div'}));\r
+            tb.addButton({\r
+                text: 'New Album',\r
+                cls: 'x-btn-text-icon album-btn',\r
+                handler: function(){\r
+                    var node = root.appendChild(new Tree.TreeNode({\r
+                        text:'Album ' + (++newIndex), \r
+                        cls:'album-node', \r
+                        allowDrag:false\r
+                    }));\r
+                    tree.getSelectionModel().select(node);\r
+                    setTimeout(function(){\r
+                        ge.editNode = node;\r
+                        ge.startEdit(node.ui.textNode);\r
+                    }, 10);\r
+                }\r
+            });\r
+            var viewEl = albums.createChild({tag:'div', id:'folders'});\r
+            \r
+            var folders = layout.add('west', new Roo.ContentPanel(albums, {\r
+                title:'My Albums', \r
+                fitToFrame:true,\r
+                autoScroll:true,\r
+                autoCreate:true,\r
+                toolbar: tb,\r
+                resizeEl:viewEl\r
+            }));\r
+            \r
+            var images = layout.add('center', new Roo.ContentPanel('images', {\r
+                title:'My Images', \r
+                fitToFrame:true,\r
+                autoScroll:true,\r
+                autoCreate:true\r
+            }));\r
+            var imgBody = images.getEl();\r
+            \r
+            var tree = new Tree.TreePanel(viewEl, {\r
+                animate:true, \r
+                enableDD:true,\r
+                containerScroll: true,\r
+                ddGroup: 'organizerDD',\r
+                rootVisible:false\r
+            });\r
+            var root = new Tree.TreeNode({\r
+                text: 'Albums', \r
+                allowDrag:false,\r
+                allowDrop:false\r
+            });\r
+            tree.setRootNode(root);\r
+            \r
+            root.appendChild(\r
+                new Tree.TreeNode({text:'Album 1', cls:'album-node', allowDrag:false}),\r
+                new Tree.TreeNode({text:'Album 2', cls:'album-node', allowDrag:false}),\r
+                new Tree.TreeNode({text:'Album 3', cls:'album-node', allowDrag:false})\r
+            );\r
+            \r
+            tree.render();\r
+            root.expand();\r
+            \r
+            // add an inline editor for the nodes\r
+            var ge = new Roo.tree.TreeEditor(tree, {\r
+                allowBlank:false,\r
+                blankText:'A name is required',\r
+                selectOnFocus:true\r
+            });\r
+            \r
+            // create the required templates\r
+               var tpl = new Roo.Template(\r
+                       '<div class="thumb-wrap" id="{name}">' +\r
+                       '<div class="thumb"><img src="../view/{url}" class="thumb-img"></div>' +\r
+                       '<span>{shortName}</span></div>'\r
+               );\r
+               \r
+               var qtipTpl = new Roo.Template(\r
+                   '<div class="image-tip"><img src="../view/{url}" align="left">'+\r
+                       '<b>Image Name:</b>' +\r
+                       '<span>{name}</span>' +\r
+                       '<b>Size:</b>' +\r
+                       '<span>{sizeString}</span></div>'\r
+               );\r
+               qtipTpl.compile();      \r
+               \r
+               // initialize the View          \r
+               var view = new Roo.JsonView(imgBody, tpl, {\r
+                       multiSelect: true,\r
+                       jsonRoot: 'images'\r
+               });\r
+               \r
+               var lookup = {};\r
+               \r
+               view.prepareData = function(data){\r
+               data.shortName = data.name.ellipse(15);\r
+               data.sizeString = (Math.round(((data.size*10) / 1024))/10) + " KB";\r
+               //data.dateString = new Date(data.lastmod).format("m/d/Y g:i a");\r
+               data.qtip = new String(qtipTpl.applyTemplate(data));\r
+               lookup[data.name] = data;\r
+               return data;\r
+            };\r
+            \r
+            var dragZone = new ImageDragZone(view, {containerScroll:true,\r
+                ddGroup: 'organizerDD'});\r
+            \r
+            view.load({\r
+                url: '../view/get-images.php'\r
+            });\r
+            \r
+            var rz = new Roo.Resizable('layout', {\r
+                wrap:true, \r
+                pinned:true, \r
+                adjustments:[-6,-6],\r
+                minWidth:300\r
+            });\r
+            rz.on('resize', function(){\r
+                layout.layout();\r
+            });\r
+            rz.resizeTo(650, 350);\r
+        }\r
+    };\r
+}();\r
+\r
+Roo.EventManager.onDocumentReady(TreeTest.init, TreeTest, true);\r
+\r
+/**\r
+ * Create a DragZone instance for our JsonView\r
+ */\r
+ImageDragZone = function(view, config){\r
+    this.view = view;\r
+    ImageDragZone.superclass.constructor.call(this, view.getEl(), config);\r
+};\r
+Roo.extend(ImageDragZone, Roo.dd.DragZone, {\r
+    // We don't want to register our image elements, so let's \r
+    // override the default registry lookup to fetch the image \r
+    // from the event instead\r
+    getDragData : function(e){\r
+        e = Roo.EventObject.setEvent(e);\r
+        var target = e.getTarget('.thumb-wrap');\r
+        if(target){\r
+            var view = this.view;\r
+            if(!view.isSelected(target)){\r
+                view.select(target, e.ctrlKey);\r
+            }\r
+            var selNodes = view.getSelectedNodes();\r
+            var dragData = {\r
+                nodes: selNodes\r
+            };\r
+            if(selNodes.length == 1){\r
+                dragData.ddel = target.firstChild.firstChild; // the img element\r
+                dragData.single = true;\r
+            }else{\r
+                var div = document.createElement('div'); // create the multi element drag "ghost"\r
+                div.className = 'multi-proxy';\r
+                for(var i = 0, len = selNodes.length; i < len; i++){\r
+                    div.appendChild(selNodes[i].firstChild.firstChild.cloneNode(true));\r
+                    if((i+1) % 3 == 0){\r
+                        div.appendChild(document.createElement('br'));\r
+                    }\r
+                }\r
+                dragData.ddel = div;\r
+                dragData.multi = true;\r
+            }\r
+            return dragData;\r
+        }\r
+        return false;\r
+    },\r
+    \r
+    // this method is called by the TreeDropZone after a node drop \r
+    // to get the new tree node (there are also other way, but this is easiest)\r
+    getTreeNode : function(){\r
+        var treeNodes = [];\r
+        var nodeData = this.view.getNodeData(this.dragData.nodes);\r
+        for(var i = 0, len = nodeData.length; i < len; i++){\r
+            var data = nodeData[i];\r
+            treeNodes.push(new Roo.tree.TreeNode({\r
+                text: data.name,\r
+                icon: data.url,\r
+                data: data,\r
+                leaf:true,\r
+                cls: 'image-node',\r
+                qtip: data.qtip\r
+            }));\r
+        }\r
+        return treeNodes;\r
+    },\r
+    \r
+    // the default action is to "highlight" after a bad drop\r
+    // but since an image can't be highlighted, let's frame it \r
+    afterRepair:function(){\r
+        for(var i = 0, len = this.dragData.nodes.length; i < len; i++){\r
+            Roo.fly(this.dragData.nodes[i]).frame('#8db2e3', 1);\r
+        }\r
+        this.dragging = false;    \r
+    },\r
+    \r
+    // override the default repairXY with one offset for the margins and padding\r
+    getRepairXY : function(e){\r
+        if(!this.dragData.multi){\r
+            var xy = Roo.Element.fly(this.dragData.ddel).getXY();\r
+            xy[0]+=3;xy[1]+=3;\r
+            return xy;\r
+        }\r
+        return false;\r
+    }\r
+});\r
+\r
+// Utility functions\r
+\r
+String.prototype.ellipse = function(maxLength){\r
+    if(this.length > maxLength){\r
+        return this.substr(0, maxLength-3) + '...';\r
+    }\r
+    return this;\r
+};
\ No newline at end of file
diff --git a/examples/tree/reorder.html b/examples/tree/reorder.html
new file mode 100644 (file)
index 0000000..277a385
--- /dev/null
@@ -0,0 +1,29 @@
+<html>\r
+<head>\r
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">\r
+<title>Reorder TreePanel</title>\r
+ <link rel="stylesheet" type="text/css" href="../../cssX/roojs-all.css"/>
+    <link rel="stylesheet" type="text/css" href="../../cssX/xtheme-slate.css"/>
+
+     <script type="text/javascript" src="../../roojs-all.js"></script>   
+  
\r
+<script type="text/javascript" src="reorder.js"></script>\r
+\r
+<!-- Common Styles for the examples -->\r
+<link rel="stylesheet" type="text/css" href="../examples.css" />\r
+</head>\r
+<body>\r
+<script type="text/javascript" src="../examples.js"></script><!-- EXAMPLES -->\r
+<h1>Drag and Drop ordering in a TreePanel</h1>\r
+<p>This example shows basic drag and drop node moving in a tree. In this implementation there are no restrictions and \r
+anything can be dropped anywhere except appending to nodes marked "leaf" (the files).</p>\r
+<p>Drag along the edge of the tree to trigger auto scrolling while performing a drag and drop.</p>\r
+<p>In order to demonstrate drag and drop insertion points, sorting was <b>not</b> enabled.</p>\r
+<p>The data for this tree is asynchronously loaded with a JSON TreeLoader.</p>\r
+<p>The js is not minified so it is readable. See <a href="reorder.js">reorder.js</a>.</p>\r
+\r
+<div id="tree-div" style="overflow:auto; height:300px;width:250px;border:1px solid #c3daf9;"></div>\r
+\r
+</body>\r
+</html>\r
diff --git a/examples/tree/reorder.js b/examples/tree/reorder.js
new file mode 100644 (file)
index 0000000..178dbe1
--- /dev/null
@@ -0,0 +1,36 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
\r
+Roo.onReady(function(){\r
+    // shorthand\r
+    var Tree = Roo.tree;\r
+    \r
+    var tree = new Tree.TreePanel('tree-div', {\r
+        animate:true, \r
+        loader: new Tree.TreeLoader({\r
+            dataUrl:'get-nodes.php'\r
+        }),\r
+        enableDD:true,\r
+        containerScroll: true\r
+    });\r
+\r
+    // set the root node\r
+    var root = new Tree.AsyncTreeNode({\r
+        text: 'Ext JS',\r
+        draggable:false,\r
+        id:'source'\r
+    });\r
+    tree.setRootNode(root);\r
+\r
+    // render the tree\r
+    tree.render();\r
+    root.expand();\r
+});
\ No newline at end of file
diff --git a/examples/tree/two-trees.html b/examples/tree/two-trees.html
new file mode 100644 (file)
index 0000000..6f3a039
--- /dev/null
@@ -0,0 +1,44 @@
+<html>\r
+<head>\r
+<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">\r
+<title>Drag and Drop between 2 TreePanels</title>\r
+ <link rel="stylesheet" type="text/css" href="../../cssX/roojs-all.css"/>
+    <link rel="stylesheet" type="text/css" href="../../cssX/xtheme-slate.css"/>
+
+     <script type="text/javascript" src="../../roojs-all.js"></script>   
+  \r
+<script type="text/javascript" src="two-trees.js"></script>\r
+\r
+<!-- Common Styles for the examples -->\r
+<link rel="stylesheet" type="text/css" href="../examples.css" />\r
+<style type="text/css">\r
+    #tree, #tree2 {\r
+       float:left;\r
+       margin:20px;\r
+       border:1px solid #c3daf9;\r
+       width:250px;\r
+       height:300px;\r
+       overflow:auto;\r
+    }\r
+    .folder .x-tree-node-icon{\r
+               background:transparent url(../../images/default/tree/folder.gif);\r
+       }\r
+       .x-tree-node-expanded .x-tree-node-icon{\r
+               background:transparent url(../../images/default/tree/folder-open.gif);\r
+       }\r
+    </style>\r
+</head>\r
+<body>\r
+<script type="text/javascript" src="../examples.js"></script><!-- EXAMPLES -->\r
+<h1>Drag and Drop betweens two TreePanels</h1>\r
+<p>The TreePanels have a TreeSorter applied in "folderSort" mode.</p>\r
+<p>Both TreePanels are in "appendOnly" drop mode since they are sorted.</p>\r
+<p>Drag along the edge of the tree to trigger auto scrolling while performing a drag and drop.</p>\r
+<p>The data for this tree is asynchronously loaded with a JSON TreeLoader.</p>\r
+<p>The js is not minified so it is readable. See <a href="two-trees.js">two-trees.js</a>.</p>\r
+\r
+<div id="tree"></div>\r
+<div id="tree2"></div>\r
+\r
+</body>\r
+</html>\r
diff --git a/examples/tree/two-trees.js b/examples/tree/two-trees.js
new file mode 100644 (file)
index 0000000..4192ae9
--- /dev/null
@@ -0,0 +1,75 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
\r
+var TreeTest = function(){\r
+    // shorthand\r
+    var Tree = Roo.tree;\r
+    \r
+    return {\r
+        init : function(){\r
+            // yui-ext tree\r
+            var tree = new Tree.TreePanel('tree', {\r
+                animate:true, \r
+                loader: new Tree.TreeLoader({dataUrl:'get-nodes.php'}),\r
+                enableDD:true,\r
+                containerScroll: true,\r
+                dropConfig: {appendOnly:true}\r
+            });\r
+            \r
+            // add a tree sorter in folder mode\r
+            new Tree.TreeSorter(tree, {folderSort:true});\r
+            \r
+            // set the root node\r
+            var root = new Tree.AsyncTreeNode({\r
+                text: 'Ext JS', \r
+                draggable:false, // disable root node dragging\r
+                id:'source'\r
+            });\r
+            tree.setRootNode(root);\r
+            \r
+            // render the tree\r
+            tree.render();\r
+            \r
+            root.expand(false, /*no anim*/ false);\r
+            \r
+            //-------------------------------------------------------------\r
+            \r
+            // YUI tree            \r
+            var tree2 = new Tree.TreePanel('tree2', {\r
+                animate:true, \r
+                //rootVisible: false,\r
+                loader: new Roo.tree.TreeLoader({\r
+                    dataUrl:'get-nodes.php',\r
+                    baseParams: {lib:'yui'} // custom http params\r
+                }),\r
+                containerScroll: true,\r
+                enableDD:true,\r
+                dropConfig: {appendOnly:true}\r
+            });\r
+            \r
+            // add a tree sorter in folder mode\r
+            new Tree.TreeSorter(tree2, {folderSort:true});\r
+            \r
+            // add the root node\r
+            var root2 = new Tree.AsyncTreeNode({\r
+                text: 'My Files', \r
+                draggable:false, \r
+                id:'yui'\r
+            });\r
+            tree2.setRootNode(root2);\r
+            tree2.render();\r
+            \r
+            root2.expand(false, /*no anim*/ false);\r
+        }\r
+    };\r
+}();\r
+\r
+Roo.EventManager.onDocumentReady(TreeTest.init, TreeTest, true);
\ No newline at end of file
diff --git a/examples/view/chooser-example.js b/examples/view/chooser-example.js
new file mode 100644 (file)
index 0000000..f5e3e50
--- /dev/null
@@ -0,0 +1,37 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */\r
+\r
+Roo.onReady(function(){\r
+    var chooser, btn;\r
+    \r
+    function insertImage(data){\r
+       Roo.DomHelper.append('images', {\r
+               tag: 'img', src: data.url, style:'margin:10px;visibility:hidden;'\r
+       }, true).show(true);\r
+       btn.getEl().focus();\r
+    };\r
+    \r
+    function choose(btn){\r
+       if(!chooser){\r
+               chooser = new ImageChooser({\r
+                       url:'get-images.php',\r
+                       width:515, \r
+                       height:400\r
+               });\r
+       }\r
+       chooser.show(btn.getEl(), insertImage);\r
+    };\r
+    \r
+    btn = new Roo.Button('buttons', {\r
+           text: "Insert Image",\r
+               handler: choose\r
+       });\r
+});\r
diff --git a/examples/view/chooser.css b/examples/view/chooser.css
new file mode 100644 (file)
index 0000000..ac34539
--- /dev/null
@@ -0,0 +1,68 @@
+/*\r
+ * yui-ext\r
+ * Copyright(c) 2006, Jack Slocum.\r
+ */\r
+\r
+.details{\r
+       padding: 10px;\r
+       text-align: center;\r
+}\r
+.details-info{\r
+       border-top: 1px solid #cccccc;\r
+       font: 11px Arial, Helvetica, sans-serif;\r
+       margin-top: 5px;\r
+       padding-top: 5px;\r
+       text-align: left;\r
+}\r
+.details-info b{\r
+       color: #555555;\r
+       display: block;\r
+       margin-bottom: 4px;\r
+}\r
+.details-info span{\r
+       display: block;\r
+       margin-bottom: 5px;\r
+       margin-left: 5px;\r
+}\r
+.ychooser-dlg select{\r
+       font-size: 12px;\r
+}\r
+.ychooser-view{\r
+       background: white;\r
+       font: 11px Arial, Helvetica, sans-serif;\r
+       overflow: auto;\r
+}\r
+.ychooser-view .thumb{\r
+       background: #dddddd;\r
+       padding: 3px;\r
+}\r
+.ychooser-view .thumb img{\r
+       height: 60px;\r
+       width: 80px;\r
+}\r
+.ychooser-view .thumb-wrap{\r
+       float: left;\r
+       margin: 4px;\r
+       margin-right: 0;\r
+       padding: 5px;\r
+}\r
+.ychooser-view .thumb-wrap span{\r
+       display: block;\r
+       overflow: hidden;\r
+       text-align: center;\r
+}\r
+.ychooser-view .ydataview-selected{\r
+       background: #c3daf9;\r
+       border: 2px solid #6593cf;\r
+       padding: 3px;\r
+}\r
+.ychooser-view .ydataview-selected .thumb{\r
+       background:transparent;\r
+}\r
+.ychooser-view .loading-indicator {\r
+       font-size:8pt;\r
+       background-image:url('../../resources/images/grid/loading.gif');\r
+       background-repeat: no-repeat;\r
+       background-position: left;\r
+       padding-left:20px;\r
+}\r
diff --git a/examples/view/chooser.html b/examples/view/chooser.html
new file mode 100644 (file)
index 0000000..e6bd2c2
--- /dev/null
@@ -0,0 +1,26 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">\r
+<html>\r
+<head>\r
+       <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">\r
+       <title>JsonView Example</title>\r
+        <link rel="stylesheet" type="text/css" href="../../cssX/roojs-all.css"/>
+    <link rel="stylesheet" type="text/css" href="../../cssX/xtheme-slate.css"/>
+
+     <script type="text/javascript" src="../../roojs-all.js"></script>   
+  \r
+       <link rel="stylesheet" type="text/css" href="chooser.css" />\r
+       <script type="text/javascript" src="chooser.js"></script>\r
+       <script type="text/javascript" src="chooser-example.js"></script>\r
+       \r
+       <!-- Common Styles for the examples -->\r
+       <link rel="stylesheet" type="text/css" href="../examples.css" />\r
+</head>\r
+<body class="xtheme-gray">\r
+       <script type="text/javascript" src="../examples.js"></script><!-- EXAMPLES -->\r
+       <h1>JsonView Example</h1>\r
+       <p>This example demonstrates how to use some of the advanced features of a JsonView. It also shows how \r
+       to use the LayoutDialog and DomHelper.Template classes.</p>\r
+       <div id="buttons" style="margin:20px;"></div>\r
+       <div id="images" style="margin:20px;width:400px;"></div>\r
+</body>\r
+</html>
\ No newline at end of file
diff --git a/examples/view/chooser.js b/examples/view/chooser.js
new file mode 100644 (file)
index 0000000..9abd450
--- /dev/null
@@ -0,0 +1,207 @@
+/*
+ * Based on:
+ * Ext JS Library 1.1.1
+ * Copyright(c) 2006-2007, Ext JS, LLC.
+ *
+ * Originally Released Under LGPL - original licence link has changed is not relivant.
+ *
+ * Fork - LGPL
+ * <script type="text/javascript">
+ */
+\r
+var ImageChooser = function(config){\r
+    // create the dialog from scratch\r
+    var dlg = new Roo.LayoutDialog(config.id || Roo.id(), {\r
+               autoCreate : true,\r
+               minWidth:400,\r
+               minHeight:300,\r
+               syncHeightBeforeShow: true,\r
+               shadow:true,\r
+        fixedcenter:true,\r
+        center:{autoScroll:false},\r
+               east:{split:true,initialSize:150,minSize:150,maxSize:250}\r
+       });\r
+       dlg.setTitle('Choose an Image');\r
+       dlg.getEl().addClass('ychooser-dlg');\r
+       dlg.addKeyListener(27, dlg.hide, dlg);\r
+    \r
+    // add some buttons\r
+    this.ok = dlg.addButton('OK', this.doCallback, this);\r
+    this.ok.disable();\r
+    dlg.setDefaultButton(dlg.addButton('Cancel', dlg.hide, dlg));\r
+    dlg.on('show', this.load, this);\r
+       this.dlg = dlg;\r
+       var layout = dlg.getLayout();\r
+       \r
+       // filter/sorting toolbar\r
+       this.tb = new Roo.Toolbar(this.dlg.body.createChild({tag:'div'}));\r
+       this.sortSelect = Roo.DomHelper.append(this.dlg.body.dom, {\r
+               tag:'select', children: [\r
+                       {tag: 'option', value:'name', selected: 'true', html:'Name'},\r
+                       {tag: 'option', value:'size', html:'File Size'},\r
+                       {tag: 'option', value:'lastmod', html:'Last Modified'}\r
+               ]\r
+       }, true);\r
+       this.sortSelect.on('change', this.sortImages, this, true);\r
+       \r
+       this.txtFilter = Roo.DomHelper.append(this.dlg.body.dom, {\r
+               tag:'input', type:'text', size:'12'}, true);\r
+               \r
+       this.txtFilter.on('focus', function(){this.dom.select();});\r
+       this.txtFilter.on('keyup', this.filter, this, {buffer:500});\r
+       \r
+       this.tb.add('Filter:', this.txtFilter.dom, 'separator', 'Sort By:', this.sortSelect.dom);\r
+       \r
+       // add the panels to the layout\r
+       layout.beginUpdate();\r
+       var vp = layout.add('center', new Roo.ContentPanel(Roo.id(), {\r
+               autoCreate : true,\r
+               toolbar: this.tb,\r
+               fitToFrame:true\r
+       }));\r
+       var dp = layout.add('east', new Roo.ContentPanel(Roo.id(), {\r
+               autoCreate : true,\r
+               fitToFrame:true\r
+       }));\r
+    layout.endUpdate();\r
+       \r
+       var bodyEl = vp.getEl();\r
+       bodyEl.appendChild(this.tb.getEl());\r
+       var viewBody = bodyEl.createChild({tag:'div', cls:'ychooser-view'});\r
+       vp.resizeEl = viewBody;\r
+       \r
+       this.detailEl = dp.getEl();\r
+       \r
+       // create the required templates\r
+       this.thumbTemplate = new Roo.Template(\r
+               '<div class="thumb-wrap" id="{name}">' +\r
+               '<div class="thumb"><img src="{url}" title="{name}"></div>' +\r
+               '<span>{shortName}</span></div>'\r
+       );\r
+       this.thumbTemplate.compile();   \r
+       \r
+       this.detailsTemplate = new Roo.Template(\r
+               '<div class="details"><img src="{url}"><div class="details-info">' +\r
+               '<b>Image Name:</b>' +\r
+               '<span>{name}</span>' +\r
+               '<b>Size:</b>' +\r
+               '<span>{sizeString}</span>' +\r
+               '<b>Last Modified:</b>' +\r
+               '<span>{dateString}</span></div></div>'\r
+       );\r
+       this.detailsTemplate.compile(); \r
+    \r
+    // initialize the View             \r
+       this.view = new Roo.JsonView(viewBody, this.thumbTemplate, {\r
+               singleSelect: true,\r
+               jsonRoot: 'images',\r
+               emptyText : '<div style="padding:10px;">No images match the specified filter</div>'\r
+       });\r
+    this.view.on('selectionchange', this.showDetails, this, {buffer:100});\r
+    this.view.on('dblclick', this.doCallback, this);\r
+    this.view.on('loadexception', this.onLoadException, this);\r
+    this.view.on('beforeselect', function(view){\r
+        return view.getCount() > 0;\r
+    });\r
+    Roo.apply(this, config, {\r
+        width: 540, height: 400\r
+    });\r
+    \r
+    var formatSize = function(size){\r
+        if(size < 1024) {\r
+            return size + " bytes";\r
+        } else {\r
+            return (Math.round(((size*10) / 1024))/10) + " KB";\r
+        }\r
+    };\r
+    \r
+    // cache data by image name for easy lookup\r
+    var lookup = {};\r
+    // make some values pretty for display\r
+    this.view.prepareData = function(data){\r
+       data.shortName = data.name.ellipse(15);\r
+       data.sizeString = formatSize(data.size);\r
+       data.dateString = new Date(data.lastmod).format("m/d/Y g:i a");\r
+       lookup[data.name] = data;\r
+       return data;\r
+    };\r
+    this.lookup = lookup;\r
+    \r
+       dlg.resizeTo(this.width, this.height);\r
+       this.loaded = false;\r
+};\r
+ImageChooser.prototype = {\r
+       show : function(el, callback){\r
+           this.reset();\r
+           this.dlg.show(el);\r
+               this.callback = callback;\r
+       },\r
+       \r
+       reset : function(){\r
+           this.view.getEl().dom.scrollTop = 0;\r
+           this.view.clearFilter();\r
+               this.txtFilter.dom.value = '';\r
+               this.view.select(0);\r
+       },\r
+       \r
+       load : function(){\r
+               if(!this.loaded){\r
+                       this.view.load({url: this.url, params:this.params, callback:this.onLoad.createDelegate(this)});\r
+               }\r
+       },\r
+       \r
+       onLoadException : function(v,o){\r
+           this.view.getEl().update('<div style="padding:10px;">Error loading images.</div>'); \r
+       },\r
+       \r
+       filter : function(){\r
+               var filter = this.txtFilter.dom.value;\r
+               this.view.filter('name', filter);\r
+               this.view.select(0);\r
+       },\r
+       \r
+       onLoad : function(){\r
+               this.loaded = true;\r
+               this.view.select(0);\r
+       },\r
+       \r
+       sortImages : function(){\r
+               var p = this.sortSelect.dom.value;\r
+       this.view.sort(p, p != 'name' ? 'desc' : 'asc');\r
+       this.view.select(0);\r
+    },\r
+       \r
+       showDetails : function(view, nodes){\r
+           var selNode = nodes[0];\r
+               if(selNode && this.view.getCount() > 0){\r
+                       this.ok.enable();\r
+                   var data = this.lookup[selNode.id];\r
+            this.detailEl.hide();\r
+            this.detailsTemplate.overwrite(this.detailEl, data);\r
+            this.detailEl.slideIn('l', {stopFx:true,duration:.2});\r
+                       \r
+               }else{\r
+                   this.ok.disable();\r
+                   this.detailEl.update('');\r
+               }\r
+       },\r
+       \r
+       doCallback : function(){\r
+        var selNode = this.view.getSelectedNodes()[0];\r
+               var callback = this.callback;\r
+               var lookup = this.lookup;\r
+               this.dlg.hide(function(){\r
+            if(selNode && callback){\r
+                               var data = lookup[selNode.id];\r
+                               callback(data);\r
+                       }\r
+               });\r
+       }\r
+};\r
+\r
+String.prototype.ellipse = function(maxLength){\r
+    if(this.length > maxLength){\r
+        return this.substr(0, maxLength-3) + '...';\r
+    }\r
+    return this;\r
+};
\ No newline at end of file
diff --git a/examples/view/ddview.html b/examples/view/ddview.html
new file mode 100644 (file)
index 0000000..70bb364
--- /dev/null
@@ -0,0 +1,536 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
+<html>
+<head>
+<style>
+* {
+       font-family:tahoma,arial,helvetica,sans-serif;
+       background-color:#EDF3FA;
+}
+
+.x-form-view {
+       cursor:default;
+}
+
+.Component {
+       background-color:lightblue;
+       border-bottom:1px groove;
+       cursor:pointer;
+}
+
+.asp-selected {
+       background-color:#000070 !important;
+       color:white;
+}
+
+.x-view-drag-insert-above {
+       border-top:1px dotted #3366cc;
+}
+.x-view-drag-insert-below {
+       border-bottom:1px dotted #3366cc;
+}
+
+</style>
+ <link rel="stylesheet" type="text/css" href="../../cssX/roojs-all.css"/>
+    <link rel="stylesheet" type="text/css" href="../../cssX/xtheme-slate.css"/>
+
+     <script type="text/javascript" src="../../roojs-all.js"></script>   
+  
+<script type="text/javascript">
+Array.prototype.contains = function(element) {
+    for (var i = 0; i < this.length; i++) {
+            if (this[i] == element) {
+                return true;
+            }
+    }        
+       return false;
+};
+Roo.namespace("Roo.ux");
+
+/**
+ * @class Roo.ux.DDView
+ * A DnD enabled version of Roo.View.
+ * @param {Element/String} container The Element in which to create the View.
+ * @param {String} tpl The template string used to create the markup for each element of the View
+ * @param {Object} config The configuration properties. These include all the config options of
+ * {@link Roo.View} plus some specific to this class.<br>
+ * <p>
+ * Drag/drop is implemented by adding {@link Roo.data.Record}s to the target DDView. If copying is
+ * not being performed, the original {@link Roo.data.Record} is removed from the source DDView.<br>
+ * <p>
+ * The following extra CSS rules are needed to provide insertion point highlighting:<pre><code>
+.x-view-drag-insert-above {
+       border-top:1px dotted #3366cc;
+}
+.x-view-drag-insert-below {
+       border-bottom:1px dotted #3366cc;
+}
+</code></pre>
+ * 
+ */
+Roo.ux.DDView = function(container, tpl, config) {
+    Roo.ux.DDView.superclass.constructor.apply(this, arguments);
+    this.getEl().setStyle("outline", "0px none");
+    this.getEl().unselectable();
+    if (this.dragGroup) {
+               this.setDraggable(this.dragGroup.split(","));
+    }
+    if (this.dropGroup) {
+               this.setDroppable(this.dropGroup.split(","));
+    }
+    if (this.deletable) {
+       this.setDeletable();
+    }
+    this.isDirtyFlag = false;
+       this.addEvents({
+               "drop" : true
+       });
+};
+
+Roo.extend(Roo.ux.DDView, Roo.View, {
+/**    @cfg {String/Array} dragGroup The ddgroup name(s) for the View's DragZone. */
+/**    @cfg {String/Array} dropGroup The ddgroup name(s) for the View's DropZone. */
+/**    @cfg {Boolean} copy Causes drag operations to copy nodes rather than move. */
+/**    @cfg {Boolean} allowCopy Causes ctrl/drag operations to copy nodes rather than move. */
+
+       isFormField: true,
+
+       reset: Roo.emptyFn,
+       
+       clearInvalid: Roo.form.Field.prototype.clearInvalid,
+
+       validate: function() {
+               return true;
+       },
+       
+       destroy: function() {
+               this.purgeListeners();
+               this.getEl.removeAllListeners();
+               this.getEl().remove();
+               if (this.dragZone) {
+                       if (this.dragZone.destroy) {
+                               this.dragZone.destroy();
+                       }
+               }
+               if (this.dropZone) {
+                       if (this.dropZone.destroy) {
+                               this.dropZone.destroy();
+                       }
+               }
+       },
+
+/**    Allows this class to be an Roo.form.Field so it can be found using {@link Roo.form.BasicForm#findField}. */
+       getName: function() {
+               return this.name;
+       },
+
+/**    Loads the View from a JSON string representing the Records to put into the Store. */
+       setValue: function(v) {
+               if (!this.store) {
+                       throw "DDView.setValue(). DDView must be constructed with a valid Store";
+               }
+               var data = {};
+               data[this.store.reader.meta.root] = v ? [].concat(v) : [];
+               this.store.proxy = new Roo.data.MemoryProxy(data);
+               this.store.load();
+       },
+
+/**    @return {String} a parenthesised list of the ids of the Records in the View. */
+       getValue: function() {
+               var result = '(';
+               this.store.each(function(rec) {
+                       result += rec.id + ',';
+               });
+               return result.substr(0, result.length - 1) + ')';
+       },
+       
+       getIds: function() {
+               var i = 0, result = new Array(this.store.getCount());
+               this.store.each(function(rec) {
+                       result[i++] = rec.id;
+               });
+               return result;
+       },
+       
+       isDirty: function() {
+               return this.isDirtyFlag;
+       },
+
+/**
+ *     Part of the Roo.dd.DropZone interface. If no target node is found, the
+ *     whole Element becomes the target, and this causes the drop gesture to append.
+ */
+    getTargetFromEvent : function(e) {
+               var target = e.getTarget();
+               while ((target !== null) && (target.parentNode != this.el.dom)) {
+               target = target.parentNode;
+               }
+               if (!target) {
+                       target = this.el.dom.lastChild || this.el.dom;
+               }
+               return target;
+    },
+
+/**
+ *     Create the drag data which consists of an object which has the property "ddel" as
+ *     the drag proxy element. 
+ */
+    getDragData : function(e) {
+        var target = this.findItemFromChild(e.getTarget());
+               if(target) {
+                       this.handleSelection(e);
+                       var selNodes = this.getSelectedNodes();
+            var dragData = {
+                source: this,
+                copy: this.copy || (this.allowCopy && e.ctrlKey),
+                nodes: selNodes,
+                records: []
+                       };
+                       var selectedIndices = this.getSelectedIndexes();
+                       for (var i = 0; i < selectedIndices.length; i++) {
+                               dragData.records.push(this.store.getAt(selectedIndices[i]));
+                       }
+                       if (selNodes.length == 1) {
+                               dragData.ddel = target.cloneNode(true); // the div element
+                       } else {
+                               var div = document.createElement('div'); // create the multi element drag "ghost"
+                               div.className = 'multi-proxy';
+                               for (var i = 0, len = selNodes.length; i < len; i++) {
+                                       div.appendChild(selNodes[i].cloneNode(true));
+                               }
+                               dragData.ddel = div;
+                       }
+                       return dragData;
+               }
+               return false;
+    },
+    
+/**    Specify to which ddGroup items in this DDView may be dragged. */
+    setDraggable: function(ddGroup) {
+       if (ddGroup instanceof Array) {
+               Roo.each(ddGroup, this.setDraggable, this);
+               return;
+       }
+       if (this.dragZone) {
+               this.dragZone.addToGroup(ddGroup);
+       } else {
+                       this.dragZone = new Roo.dd.DragZone(this.getEl(), {
+                               containerScroll: true,
+                               ddGroup: ddGroup
+                       });
+//                     Draggability implies selection. DragZone's mousedown selects the element.
+                       if (!this.multiSelect) { this.singleSelect = true; }
+
+//                     Wire the DragZone's handlers up to methods in *this*
+                       this.dragZone.getDragData = this.getDragData.createDelegate(this);
+               }
+    },
+
+/**    Specify from which ddGroup this DDView accepts drops. */
+    setDroppable: function(ddGroup) {
+       if (ddGroup instanceof Array) {
+               Roo.each(ddGroup, this.setDroppable, this);
+               return;
+       }
+       if (this.dropZone) {
+               this.dropZone.addToGroup(ddGroup);
+       } else {
+                       this.dropZone = new Roo.dd.DropZone(this.getEl(), {
+                               containerScroll: true,
+                               ddGroup: ddGroup
+                       });
+
+//                     Wire the DropZone's handlers up to methods in *this*
+                       this.dropZone.getTargetFromEvent = this.getTargetFromEvent.createDelegate(this);
+                       this.dropZone.onNodeEnter = this.onNodeEnter.createDelegate(this);
+                       this.dropZone.onNodeOver = this.onNodeOver.createDelegate(this);
+                       this.dropZone.onNodeOut = this.onNodeOut.createDelegate(this);
+                       this.dropZone.onNodeDrop = this.onNodeDrop.createDelegate(this);
+               }
+    },
+
+/**    Decide whether to drop above or below a View node. */
+    getDropPoint : function(e, n, dd){
+       if (n == this.el.dom) { return "above"; }
+               var t = Roo.lib.Dom.getY(n), b = t + n.offsetHeight;
+               var c = t + (b - t) / 2;
+               var y = Roo.lib.Event.getPageY(e);
+               if(y <= c) {
+                       return "above";
+               }else{
+                       return "below";
+               }
+    },
+
+    onNodeEnter : function(n, dd, e, data){
+               return false;
+    },
+    
+    onNodeOver : function(n, dd, e, data){
+               var pt = this.getDropPoint(e, n, dd);
+               // set the insert point style on the target node
+               var dragElClass = this.dropNotAllowed;
+               if (pt) {
+                       var targetElClass;
+                       if (pt == "above"){
+                               dragElClass = n.previousSibling ? "x-tree-drop-ok-between" : "x-tree-drop-ok-above";
+                               targetElClass = "x-view-drag-insert-above";
+                       } else {
+                               dragElClass = n.nextSibling ? "x-tree-drop-ok-between" : "x-tree-drop-ok-below";
+                               targetElClass = "x-view-drag-insert-below";
+                       }
+                       if (this.lastInsertClass != targetElClass){
+                               Roo.fly(n).replaceClass(this.lastInsertClass, targetElClass);
+                               this.lastInsertClass = targetElClass;
+                       }
+               }
+               return dragElClass;
+       },
+
+    onNodeOut : function(n, dd, e, data){
+               this.removeDropIndicators(n);
+    },
+
+    onNodeDrop : function(n, dd, e, data){
+       if (this.fireEvent("drop", this, n, dd, e, data) === false) {
+               return false;
+       }
+       var pt = this.getDropPoint(e, n, dd);
+               var insertAt = (n == this.el.dom) ? this.nodes.length : n.nodeIndex;
+               if (pt == "below") { insertAt++; }
+               for (var i = 0; i < data.records.length; i++) {
+                       var r = data.records[i];
+                       var dup = this.store.getById(r.id);
+                       if (dup && (dd != this.dragZone)) {
+                               Roo.fly(this.getNode(this.store.indexOf(dup))).frame("red", 1);
+                       } else {
+                               if (data.copy) {
+                                       this.store.insert(insertAt++, r.copy());
+                               } else {
+                                       data.source.isDirtyFlag = true;
+                                       r.store.remove(r);
+                                       this.store.insert(insertAt++, r);
+                               }
+                               this.isDirtyFlag = true;
+                       }
+               }
+               this.dragZone.cachedTarget = null;
+               return true;
+    },
+
+    removeDropIndicators : function(n){
+               if(n){
+                       Roo.fly(n).removeClass([
+                               "x-view-drag-insert-above",
+                               "x-view-drag-insert-below"]);
+                       this.lastInsertClass = "_noclass";
+               }
+    },
+
+/**
+ *     Utility method. Add a delete option to the DDView's context menu.
+ *     @param {String} imageUrl The URL of the "delete" icon image.
+ */
+       setDeletable: function(imageUrl) {
+               if (!this.singleSelect && !this.multiSelect) {
+                       this.singleSelect = true;
+               }
+               var c = this.getContextMenu();
+               this.contextMenu.on("itemclick", function(item) {
+                       switch (item.id) {
+                               case "delete":
+                                       this.remove(this.getSelectedIndexes());
+                                       break;
+                       }
+               }, this);
+               this.contextMenu.add({
+                       icon: imageUrl || AU.resolveUrl("/images/delete.gif"),
+                       id: "delete",
+                       text: AU.getMessage("deleteItem")
+               });
+       },
+       
+/**    Return the context menu for this DDView. */
+       getContextMenu: function() {
+               if (!this.contextMenu) {
+//                     Create the View's context menu
+                       this.contextMenu = new Roo.menu.Menu({
+                               id: this.id + "-contextmenu"
+                       });
+                       this.el.on("contextmenu", this.showContextMenu, this);
+               }
+               return this.contextMenu;
+       },
+       
+       disableContextMenu: function() {
+               if (this.contextMenu) {
+                       this.el.un("contextmenu", this.showContextMenu, this);
+               }
+       },
+
+       showContextMenu: function(e, item) {
+        item = this.findItemFromChild(e.getTarget());
+               if (item) {
+                       e.stopEvent();
+                       this.select(this.getNode(item), this.multiSelect && e.ctrlKey, true);
+                       this.contextMenu.showAt(e.getXY());
+           }
+    },
+
+/**
+ *     Remove {@link Roo.data.Record}s at the specified indices.
+ *     @param {Array/Number} selectedIndices The index (or Array of indices) of Records to remove.
+ */
+    remove: function(selectedIndices) {
+               selectedIndices = [].concat(selectedIndices);
+               for (var i = 0; i < selectedIndices.length; i++) {
+                       var rec = this.store.getAt(selectedIndices[i]);
+                       this.store.remove(rec);
+               }
+    },
+
+/**
+ *     Double click fires the event, but also, if this is draggable, and there is only one other
+ *     related DropZone, it transfers the selected node.
+ */
+    onDblClick : function(e){
+        var item = this.findItemFromChild(e.getTarget());
+        if(item){
+            if (this.fireEvent("dblclick", this, this.indexOf(item), item, e) === false) {
+               return false;
+            }
+            if (this.dragGroup) {
+                   var targets = Roo.dd.DragDropMgr.getRelated(this.dragZone, true);
+                   while (targets.contains(this.dropZone)) {
+                           targets.remove(this.dropZone);
+                               }
+                   if (targets.length == 1) {
+                                       this.dragZone.cachedTarget = null;
+                       var el = Roo.get(targets[0].getEl());
+                       var box = el.getBox(true);
+                       targets[0].onNodeDrop(el.dom, {
+                               target: el.dom,
+                               xy: [box.x, box.y + box.height - 1]
+                       }, null, this.getDragData(e));
+                   }
+               }
+        }
+    },
+    
+    handleSelection: function(e) {
+               this.dragZone.cachedTarget = null;
+        var item = this.findItemFromChild(e.getTarget());
+        if (!item) {
+               this.clearSelections(true);
+               return;
+        }
+               if (item && (this.multiSelect || this.singleSelect)){
+                       if(this.multiSelect && e.shiftKey && (!e.ctrlKey) && this.lastSelection){
+                               this.select(this.getNodes(this.indexOf(this.lastSelection), item.nodeIndex), false);
+                       }else if (this.isSelected(this.getNode(item)) && e.ctrlKey){
+                               this.unselect(item);
+                       } else {
+                               this.select(item, this.multiSelect && e.ctrlKey);
+                               this.lastSelection = item;
+                       }
+               }
+    },
+
+    onItemClick : function(item, index, e){
+               if(this.fireEvent("beforeclick", this, index, item, e) === false){
+                       return false;
+               }
+               return true;
+    },
+
+    unselect : function(nodeInfo, suppressEvent){
+               var node = this.getNode(nodeInfo);
+               if(node && this.isSelected(node)){
+                       if(this.fireEvent("beforeselect", this, node, this.selections) !== false){
+                               Roo.fly(node).removeClass(this.selectedClass);
+                               this.selections.remove(node);
+                               if(!suppressEvent){
+                                       this.fireEvent("selectionchange", this, this.selections);
+                               }
+                       }
+               }
+    }
+});
+
+function initializePage() {
+       var collection=[
+               {'id':'40','entityImageUrl':'../shared/icons/fam/user_add.png','componentDescription':'Add User'},
+               {'id':'27','entityImageUrl':'../shared/icons/fam/user_delete.png','componentDescription':'Delete User'},
+               {'id':'28','entityImageUrl':'../shared/icons/fam/user_comment.png','componentDescription':'Comment on User'}
+       ];
+       var rec=Roo.data.Record.create([
+               {name:'id'},
+               {name:'entityImageUrl'},
+               {name:'componentDescription'}
+       ]);
+       var reader=new Roo.data.JsonReader({
+               root:'collection',
+               id:'id'
+       },rec);
+       var ds=new Roo.data.Store({
+               proxy:new Roo.data.MemoryProxy({collection:collection}),
+               reader:reader
+       });
+       var view=new Roo.ux.DDView('left-view-container','<div id=\u0027subcomponent_{id}\u0027 class=\u0027Subcomponent\u0027><img align=\u0027top\u0027 height=\u002716px\u0027 width=\u002716px\u0027 src=\u0027{entityImageUrl}\u0027>{componentDescription}</div>',{
+               isFormField:true,
+               name:'subComponents',
+               dragGroup:'availComponentDDGroup,subComponentDDGroup',
+               dropGroup:'availComponentDDGroup,subComponentDDGroup',
+               selectedClass: 'asp-selected',
+               jsonRoot: 'collection',
+               store: ds
+       });
+       ds.load();
+
+       collection=[];
+       rec=Roo.data.Record.create([
+               {name:'id'},
+               {name:'entityImageUrl'},
+               {name:'componentDescription'}
+       ]);
+       reader=new Roo.data.JsonReader({
+               root:'collection',
+               id:'id'
+       },rec);
+       ds=new Roo.data.Store({
+               proxy:new Roo.data.MemoryProxy({collection:collection}),
+               reader:reader
+       });
+       view=new Roo.ux.DDView('right-view-container','<div id=\u0027component_{id}\u0027 class=\u0027Component\u0027><img align=\u0027top\u0027 height=\u002716px\u0027 width=\u002716px\u0027 src=\u0027{entityImageUrl}\u0027>{componentDescription}</div>',{
+               isFormField:true,
+               name:'availableSubComponents',
+               multiSelect: true,
+               dragGroup:'subComponentDDGroup',
+               dropGroup:'availComponentDDGroup',
+               selectedClass: 'asp-selected',
+               jsonRoot: 'collection',
+               store: ds
+       });
+       ds.load();
+}
+Roo.onReady(initializePage);
+</script>
+</head>
+<body>
+<form  class="x-form" id="the-form">
+       <div class="x-form-ct x-form-column x-form-label-left">
+               <fieldset class="x-form-fieldset x-form-label-left" style="margin-left:10px" >
+                       <legend>Subcomponents</legend>
+                       <div id="left-view-container" class="x-form-view" style="overflow:auto;height:215px">
+                       </div>
+               </fieldset>
+       </div>
+       <div class="x-form-ct x-form-column x-form-label-left ">
+               <fieldset class="x-form-fieldset x-form-label-left" style="margin-left:10px">
+                       <legend>Available subcomponents</legend>
+                       <div id="right-view-container" class="x-form-view" style="overflow:auto;height:215px">
+                       </div>
+               </fieldset>
+       </div>
+</form>
+</body>
+</html>
\ No newline at end of file
diff --git a/examples/view/get-images.php b/examples/view/get-images.php
new file mode 100644 (file)
index 0000000..5660924
--- /dev/null
@@ -0,0 +1,18 @@
+<?php\r
+$dir = dirname(__FILE__) ."/images/thumbs/";\r
+\r
+$images = array();\r
+$d = dir($dir);\r
+while($name = $d->read()){\r
+    if(!preg_match('/\.(jpg|gif|png)$/', $name)) continue;
+    
+    \r
+    $size = filesize($dir.$name);\r
+    $lastmod = filemtime($dir.$name)*1000;\r
+    $images[] = array('name'=>$name, 'size'=>$size, \r
+                       'lastmod'=>$lastmod, 'url'=>"images/thumbs/".$name);\r
+}\r
+$d->close();\r
+$o = array('images'=>$images);\r
+\r
+echo json_encode($o);\r
diff --git a/examples/view/images/thumbs/dance_fever.jpg b/examples/view/images/thumbs/dance_fever.jpg
new file mode 100644 (file)
index 0000000..52e7081
Binary files /dev/null and b/examples/view/images/thumbs/dance_fever.jpg differ
diff --git a/examples/view/images/thumbs/gangster_zack.jpg b/examples/view/images/thumbs/gangster_zack.jpg
new file mode 100644 (file)
index 0000000..f5a9f80
Binary files /dev/null and b/examples/view/images/thumbs/gangster_zack.jpg differ
diff --git a/examples/view/images/thumbs/kids_hug.jpg b/examples/view/images/thumbs/kids_hug.jpg
new file mode 100644 (file)
index 0000000..ac3d582
Binary files /dev/null and b/examples/view/images/thumbs/kids_hug.jpg differ
diff --git a/examples/view/images/thumbs/kids_hug2.jpg b/examples/view/images/thumbs/kids_hug2.jpg
new file mode 100644 (file)
index 0000000..38152f5
Binary files /dev/null and b/examples/view/images/thumbs/kids_hug2.jpg differ
diff --git a/examples/view/images/thumbs/sara_pink.jpg b/examples/view/images/thumbs/sara_pink.jpg
new file mode 100644 (file)
index 0000000..a443c04
Binary files /dev/null and b/examples/view/images/thumbs/sara_pink.jpg differ
diff --git a/examples/view/images/thumbs/sara_pumpkin.jpg b/examples/view/images/thumbs/sara_pumpkin.jpg
new file mode 100644 (file)
index 0000000..ce9a90b
Binary files /dev/null and b/examples/view/images/thumbs/sara_pumpkin.jpg differ
diff --git a/examples/view/images/thumbs/sara_smile.jpg b/examples/view/images/thumbs/sara_smile.jpg
new file mode 100644 (file)
index 0000000..08919e2
Binary files /dev/null and b/examples/view/images/thumbs/sara_smile.jpg differ
diff --git a/examples/view/images/thumbs/up_to_something.jpg b/examples/view/images/thumbs/up_to_something.jpg
new file mode 100644 (file)
index 0000000..771ea91
Binary files /dev/null and b/examples/view/images/thumbs/up_to_something.jpg differ
diff --git a/examples/view/images/thumbs/zack.jpg b/examples/view/images/thumbs/zack.jpg
new file mode 100644 (file)
index 0000000..a7ce7bc
Binary files /dev/null and b/examples/view/images/thumbs/zack.jpg differ
diff --git a/examples/view/images/thumbs/zack_dress.jpg b/examples/view/images/thumbs/zack_dress.jpg
new file mode 100644 (file)
index 0000000..b15f551
Binary files /dev/null and b/examples/view/images/thumbs/zack_dress.jpg differ
diff --git a/examples/view/images/thumbs/zack_hat.jpg b/examples/view/images/thumbs/zack_hat.jpg
new file mode 100644 (file)
index 0000000..df475ba
Binary files /dev/null and b/examples/view/images/thumbs/zack_hat.jpg differ
diff --git a/examples/view/images/thumbs/zack_sink.jpg b/examples/view/images/thumbs/zack_sink.jpg
new file mode 100644 (file)
index 0000000..01badd3
Binary files /dev/null and b/examples/view/images/thumbs/zack_sink.jpg differ
diff --git a/examples/view/images/thumbs/zacks_grill.jpg b/examples/view/images/thumbs/zacks_grill.jpg
new file mode 100644 (file)
index 0000000..5ca1ef6
Binary files /dev/null and b/examples/view/images/thumbs/zacks_grill.jpg differ
diff --git a/images/aero/basic-dialog/aero-close-over.gif b/images/aero/basic-dialog/aero-close-over.gif
new file mode 100644 (file)
index 0000000..9ed8d81
Binary files /dev/null and b/images/aero/basic-dialog/aero-close-over.gif differ
diff --git a/images/aero/basic-dialog/aero-close.gif b/images/aero/basic-dialog/aero-close.gif
new file mode 100644 (file)
index 0000000..c61d29f
Binary files /dev/null and b/images/aero/basic-dialog/aero-close.gif differ
diff --git a/images/aero/basic-dialog/bg-center.gif b/images/aero/basic-dialog/bg-center.gif
new file mode 100644 (file)
index 0000000..4d12d27
Binary files /dev/null and b/images/aero/basic-dialog/bg-center.gif differ
diff --git a/images/aero/basic-dialog/bg-left.gif b/images/aero/basic-dialog/bg-left.gif
new file mode 100644 (file)
index 0000000..9cebb78
Binary files /dev/null and b/images/aero/basic-dialog/bg-left.gif differ
diff --git a/images/aero/basic-dialog/bg-right.gif b/images/aero/basic-dialog/bg-right.gif
new file mode 100644 (file)
index 0000000..3d871f9
Binary files /dev/null and b/images/aero/basic-dialog/bg-right.gif differ
diff --git a/images/aero/basic-dialog/close.gif b/images/aero/basic-dialog/close.gif
new file mode 100644 (file)
index 0000000..4278db9
Binary files /dev/null and b/images/aero/basic-dialog/close.gif differ
diff --git a/images/aero/basic-dialog/dlg-bg.gif b/images/aero/basic-dialog/dlg-bg.gif
new file mode 100644 (file)
index 0000000..1a46663
Binary files /dev/null and b/images/aero/basic-dialog/dlg-bg.gif differ
diff --git a/images/aero/basic-dialog/e-handle.gif b/images/aero/basic-dialog/e-handle.gif
new file mode 100644 (file)
index 0000000..48877e7
Binary files /dev/null and b/images/aero/basic-dialog/e-handle.gif differ
diff --git a/images/aero/basic-dialog/hd-sprite.gif b/images/aero/basic-dialog/hd-sprite.gif
new file mode 100644 (file)
index 0000000..0d6d7ed
Binary files /dev/null and b/images/aero/basic-dialog/hd-sprite.gif differ
diff --git a/images/aero/basic-dialog/s-handle.gif b/images/aero/basic-dialog/s-handle.gif
new file mode 100644 (file)
index 0000000..c13c9cd
Binary files /dev/null and b/images/aero/basic-dialog/s-handle.gif differ
diff --git a/images/aero/basic-dialog/se-handle.gif b/images/aero/basic-dialog/se-handle.gif
new file mode 100644 (file)
index 0000000..743ab0a
Binary files /dev/null and b/images/aero/basic-dialog/se-handle.gif differ
diff --git a/images/aero/basic-dialog/w-handle.gif b/images/aero/basic-dialog/w-handle.gif
new file mode 100644 (file)
index 0000000..d59eafc
Binary files /dev/null and b/images/aero/basic-dialog/w-handle.gif differ
diff --git a/images/aero/gradient-bg.gif b/images/aero/gradient-bg.gif
new file mode 100644 (file)
index 0000000..8134e49
Binary files /dev/null and b/images/aero/gradient-bg.gif differ
diff --git a/images/aero/grid/grid-blue-split.gif b/images/aero/grid/grid-blue-split.gif
new file mode 100644 (file)
index 0000000..5286f58
Binary files /dev/null and b/images/aero/grid/grid-blue-split.gif differ
diff --git a/images/aero/grid/grid-hrow.gif b/images/aero/grid/grid-hrow.gif
new file mode 100644 (file)
index 0000000..addd0d9
Binary files /dev/null and b/images/aero/grid/grid-hrow.gif differ
diff --git a/images/aero/grid/grid-split.gif b/images/aero/grid/grid-split.gif
new file mode 100644 (file)
index 0000000..c76a16e
Binary files /dev/null and b/images/aero/grid/grid-split.gif differ
diff --git a/images/aero/grid/grid-vista-hd.gif b/images/aero/grid/grid-vista-hd.gif
new file mode 100644 (file)
index 0000000..d097263
Binary files /dev/null and b/images/aero/grid/grid-vista-hd.gif differ
diff --git a/images/aero/grid/sort-col-bg.gif b/images/aero/grid/sort-col-bg.gif
new file mode 100644 (file)
index 0000000..76c0bd4
Binary files /dev/null and b/images/aero/grid/sort-col-bg.gif differ
diff --git a/images/aero/grid/sort_asc.gif b/images/aero/grid/sort_asc.gif
new file mode 100644 (file)
index 0000000..67a2a4c
Binary files /dev/null and b/images/aero/grid/sort_asc.gif differ
diff --git a/images/aero/grid/sort_desc.gif b/images/aero/grid/sort_desc.gif
new file mode 100644 (file)
index 0000000..34db47c
Binary files /dev/null and b/images/aero/grid/sort_desc.gif differ
diff --git a/images/aero/layout/collapse.gif b/images/aero/layout/collapse.gif
new file mode 100644 (file)
index 0000000..cbd6e08
Binary files /dev/null and b/images/aero/layout/collapse.gif differ
diff --git a/images/aero/layout/expand.gif b/images/aero/layout/expand.gif
new file mode 100644 (file)
index 0000000..8103c0d
Binary files /dev/null and b/images/aero/layout/expand.gif differ
diff --git a/images/aero/layout/gradient-bg.gif b/images/aero/layout/gradient-bg.gif
new file mode 100644 (file)
index 0000000..d311e7d
Binary files /dev/null and b/images/aero/layout/gradient-bg.gif differ
diff --git a/images/aero/layout/layout-sprite.gif b/images/aero/layout/layout-sprite.gif
new file mode 100644 (file)
index 0000000..86daa20
Binary files /dev/null and b/images/aero/layout/layout-sprite.gif differ
diff --git a/images/aero/layout/ns-collapse.gif b/images/aero/layout/ns-collapse.gif
new file mode 100644 (file)
index 0000000..f2ad235
Binary files /dev/null and b/images/aero/layout/ns-collapse.gif differ
diff --git a/images/aero/layout/ns-expand.gif b/images/aero/layout/ns-expand.gif
new file mode 100644 (file)
index 0000000..0817ec6
Binary files /dev/null and b/images/aero/layout/ns-expand.gif differ
diff --git a/images/aero/layout/panel-close.gif b/images/aero/layout/panel-close.gif
new file mode 100644 (file)
index 0000000..4e96481
Binary files /dev/null and b/images/aero/layout/panel-close.gif differ
diff --git a/images/aero/layout/panel-title-bg.gif b/images/aero/layout/panel-title-bg.gif
new file mode 100644 (file)
index 0000000..681f517
Binary files /dev/null and b/images/aero/layout/panel-title-bg.gif differ
diff --git a/images/aero/layout/panel-title-light-bg.gif b/images/aero/layout/panel-title-light-bg.gif
new file mode 100644 (file)
index 0000000..f4c44ce
Binary files /dev/null and b/images/aero/layout/panel-title-light-bg.gif differ
diff --git a/images/aero/layout/tab-close-on.gif b/images/aero/layout/tab-close-on.gif
new file mode 100644 (file)
index 0000000..556e905
Binary files /dev/null and b/images/aero/layout/tab-close-on.gif differ
diff --git a/images/aero/layout/tab-close.gif b/images/aero/layout/tab-close.gif
new file mode 100644 (file)
index 0000000..0a6f019
Binary files /dev/null and b/images/aero/layout/tab-close.gif differ
diff --git a/images/aero/qtip/bg.gif b/images/aero/qtip/bg.gif
new file mode 100644 (file)
index 0000000..5c0e8c9
Binary files /dev/null and b/images/aero/qtip/bg.gif differ
diff --git a/images/aero/s.gif b/images/aero/s.gif
new file mode 100644 (file)
index 0000000..1d11fa9
Binary files /dev/null and b/images/aero/s.gif differ
diff --git a/images/aero/sizer/e-handle-dark.gif b/images/aero/sizer/e-handle-dark.gif
new file mode 100644 (file)
index 0000000..eac9662
Binary files /dev/null and b/images/aero/sizer/e-handle-dark.gif differ
diff --git a/images/aero/sizer/e-handle.gif b/images/aero/sizer/e-handle.gif
new file mode 100644 (file)
index 0000000..f2c9f53
Binary files /dev/null and b/images/aero/sizer/e-handle.gif differ
diff --git a/images/aero/sizer/ne-handle-dark.gif b/images/aero/sizer/ne-handle-dark.gif
new file mode 100644 (file)
index 0000000..c9c041c
Binary files /dev/null and b/images/aero/sizer/ne-handle-dark.gif differ
diff --git a/images/aero/sizer/ne-handle.gif b/images/aero/sizer/ne-handle.gif
new file mode 100644 (file)
index 0000000..942ae82
Binary files /dev/null and b/images/aero/sizer/ne-handle.gif differ
diff --git a/images/aero/sizer/nw-handle-dark.gif b/images/aero/sizer/nw-handle-dark.gif
new file mode 100644 (file)
index 0000000..23fced9
Binary files /dev/null and b/images/aero/sizer/nw-handle-dark.gif differ
diff --git a/images/aero/sizer/nw-handle.gif b/images/aero/sizer/nw-handle.gif
new file mode 100644 (file)
index 0000000..d39b0c3
Binary files /dev/null and b/images/aero/sizer/nw-handle.gif differ
diff --git a/images/aero/sizer/s-handle-dark.gif b/images/aero/sizer/s-handle-dark.gif
new file mode 100644 (file)
index 0000000..ddc2e18
Binary files /dev/null and b/images/aero/sizer/s-handle-dark.gif differ
diff --git a/images/aero/sizer/s-handle.gif b/images/aero/sizer/s-handle.gif
new file mode 100644 (file)
index 0000000..827c333
Binary files /dev/null and b/images/aero/sizer/s-handle.gif differ
diff --git a/images/aero/sizer/se-handle-dark.gif b/images/aero/sizer/se-handle-dark.gif
new file mode 100644 (file)
index 0000000..1a678e6
Binary files /dev/null and b/images/aero/sizer/se-handle-dark.gif differ
diff --git a/images/aero/sizer/se-handle.gif b/images/aero/sizer/se-handle.gif
new file mode 100644 (file)
index 0000000..69b5a9e
Binary files /dev/null and b/images/aero/sizer/se-handle.gif differ
diff --git a/images/aero/sizer/sw-handle-dark.gif b/images/aero/sizer/sw-handle-dark.gif
new file mode 100644 (file)
index 0000000..937102c
Binary files /dev/null and b/images/aero/sizer/sw-handle-dark.gif differ
diff --git a/images/aero/sizer/sw-handle.gif b/images/aero/sizer/sw-handle.gif
new file mode 100644 (file)
index 0000000..b9e2f56
Binary files /dev/null and b/images/aero/sizer/sw-handle.gif differ
diff --git a/images/aero/tabs/tab-btm-inactive-left-bg.gif b/images/aero/tabs/tab-btm-inactive-left-bg.gif
new file mode 100644 (file)
index 0000000..d057f6c
Binary files /dev/null and b/images/aero/tabs/tab-btm-inactive-left-bg.gif differ
diff --git a/images/aero/tabs/tab-btm-inactive-right-bg.gif b/images/aero/tabs/tab-btm-inactive-right-bg.gif
new file mode 100644 (file)
index 0000000..94deb88
Binary files /dev/null and b/images/aero/tabs/tab-btm-inactive-right-bg.gif differ
diff --git a/images/aero/tabs/tab-btm-left-bg.gif b/images/aero/tabs/tab-btm-left-bg.gif
new file mode 100644 (file)
index 0000000..ac54928
Binary files /dev/null and b/images/aero/tabs/tab-btm-left-bg.gif differ
diff --git a/images/aero/tabs/tab-btm-right-bg.gif b/images/aero/tabs/tab-btm-right-bg.gif
new file mode 100644 (file)
index 0000000..622812a
Binary files /dev/null and b/images/aero/tabs/tab-btm-right-bg.gif differ
diff --git a/images/aero/tabs/tab-sprite.gif b/images/aero/tabs/tab-sprite.gif
new file mode 100644 (file)
index 0000000..79211e4
Binary files /dev/null and b/images/aero/tabs/tab-sprite.gif differ
diff --git a/images/aero/tabs/tab-strip-bg.gif b/images/aero/tabs/tab-strip-bg.gif
new file mode 100644 (file)
index 0000000..287d316
Binary files /dev/null and b/images/aero/tabs/tab-strip-bg.gif differ
diff --git a/images/aero/tabs/tab-strip-bg.png b/images/aero/tabs/tab-strip-bg.png
new file mode 100644 (file)
index 0000000..fa8ab3f
Binary files /dev/null and b/images/aero/tabs/tab-strip-bg.png differ
diff --git a/images/aero/tabs/tab-strip-btm-bg.gif b/images/aero/tabs/tab-strip-btm-bg.gif
new file mode 100644 (file)
index 0000000..5eaba1e
Binary files /dev/null and b/images/aero/tabs/tab-strip-btm-bg.gif differ
diff --git a/images/aero/toolbar/bg.gif b/images/aero/toolbar/bg.gif
new file mode 100644 (file)
index 0000000..03cf427
Binary files /dev/null and b/images/aero/toolbar/bg.gif differ
diff --git a/images/default/basic-dialog/btn-clear.gif b/images/default/basic-dialog/btn-clear.gif
new file mode 100644 (file)
index 0000000..29aeb89
Binary files /dev/null and b/images/default/basic-dialog/btn-clear.gif differ
diff --git a/images/default/basic-dialog/btn-sprite.gif b/images/default/basic-dialog/btn-sprite.gif
new file mode 100644 (file)
index 0000000..8d657db
Binary files /dev/null and b/images/default/basic-dialog/btn-sprite.gif differ
diff --git a/images/default/basic-dialog/close.gif b/images/default/basic-dialog/close.gif
new file mode 100644 (file)
index 0000000..988ee82
Binary files /dev/null and b/images/default/basic-dialog/close.gif differ
diff --git a/images/default/basic-dialog/collapse.gif b/images/default/basic-dialog/collapse.gif
new file mode 100644 (file)
index 0000000..d886a1f
Binary files /dev/null and b/images/default/basic-dialog/collapse.gif differ
diff --git a/images/default/basic-dialog/e-handle.gif b/images/default/basic-dialog/e-handle.gif
new file mode 100644 (file)
index 0000000..dde2826
Binary files /dev/null and b/images/default/basic-dialog/e-handle.gif differ
diff --git a/images/default/basic-dialog/hd-sprite.gif b/images/default/basic-dialog/hd-sprite.gif
new file mode 100644 (file)
index 0000000..72b8741
Binary files /dev/null and b/images/default/basic-dialog/hd-sprite.gif differ
diff --git a/images/default/basic-dialog/progress.gif b/images/default/basic-dialog/progress.gif
new file mode 100644 (file)
index 0000000..0c3a537
Binary files /dev/null and b/images/default/basic-dialog/progress.gif differ
diff --git a/images/default/basic-dialog/progress2.gif b/images/default/basic-dialog/progress2.gif
new file mode 100644 (file)
index 0000000..0b3fcd2
Binary files /dev/null and b/images/default/basic-dialog/progress2.gif differ
diff --git a/images/default/basic-dialog/s-handle.gif b/images/default/basic-dialog/s-handle.gif
new file mode 100644 (file)
index 0000000..9b6c621
Binary files /dev/null and b/images/default/basic-dialog/s-handle.gif differ
diff --git a/images/default/basic-dialog/se-handle.gif b/images/default/basic-dialog/se-handle.gif
new file mode 100644 (file)
index 0000000..f730f60
Binary files /dev/null and b/images/default/basic-dialog/se-handle.gif differ
diff --git a/images/default/combo/arrow.gif b/images/default/combo/arrow.gif
new file mode 100644 (file)
index 0000000..ebe15cf
Binary files /dev/null and b/images/default/combo/arrow.gif differ
diff --git a/images/default/dd/dd-sprite.gif b/images/default/dd/dd-sprite.gif
new file mode 100644 (file)
index 0000000..ffab75c
Binary files /dev/null and b/images/default/dd/dd-sprite.gif differ
diff --git a/images/default/dd/drop-add.gif b/images/default/dd/drop-add.gif
new file mode 100644 (file)
index 0000000..b22cd14
Binary files /dev/null and b/images/default/dd/drop-add.gif differ
diff --git a/images/default/dd/drop-no.gif b/images/default/dd/drop-no.gif
new file mode 100644 (file)
index 0000000..08d0833
Binary files /dev/null and b/images/default/dd/drop-no.gif differ
diff --git a/images/default/dd/drop-sub.gif b/images/default/dd/drop-sub.gif
new file mode 100644 (file)
index 0000000..0d19706
Binary files /dev/null and b/images/default/dd/drop-sub.gif differ
diff --git a/images/default/dd/drop-yes.gif b/images/default/dd/drop-yes.gif
new file mode 100644 (file)
index 0000000..8aacb30
Binary files /dev/null and b/images/default/dd/drop-yes.gif differ
diff --git a/images/default/form/bg.gif b/images/default/form/bg.gif
new file mode 100644 (file)
index 0000000..ee0143e
Binary files /dev/null and b/images/default/form/bg.gif differ
diff --git a/images/default/form/date-trigger.gif b/images/default/form/date-trigger.gif
new file mode 100644 (file)
index 0000000..9238077
Binary files /dev/null and b/images/default/form/date-trigger.gif differ
diff --git a/images/default/form/exclamation.gif b/images/default/form/exclamation.gif
new file mode 100644 (file)
index 0000000..7268ead
Binary files /dev/null and b/images/default/form/exclamation.gif differ
diff --git a/images/default/form/htmleditor.gif b/images/default/form/htmleditor.gif
new file mode 100644 (file)
index 0000000..db95bac
Binary files /dev/null and b/images/default/form/htmleditor.gif differ
diff --git a/images/default/form/text-bg.gif b/images/default/form/text-bg.gif
new file mode 100644 (file)
index 0000000..f81008d
Binary files /dev/null and b/images/default/form/text-bg.gif differ
diff --git a/images/default/form/trigger.gif b/images/default/form/trigger.gif
new file mode 100644 (file)
index 0000000..2c683e1
Binary files /dev/null and b/images/default/form/trigger.gif differ
diff --git a/images/default/gradient-bg.gif b/images/default/gradient-bg.gif
new file mode 100644 (file)
index 0000000..8134e49
Binary files /dev/null and b/images/default/gradient-bg.gif differ
diff --git a/images/default/grid/arrow-left-white.gif b/images/default/grid/arrow-left-white.gif
new file mode 100644 (file)
index 0000000..63088f5
Binary files /dev/null and b/images/default/grid/arrow-left-white.gif differ
diff --git a/images/default/grid/arrow-right-white.gif b/images/default/grid/arrow-right-white.gif
new file mode 100644 (file)
index 0000000..e9e0678
Binary files /dev/null and b/images/default/grid/arrow-right-white.gif differ
diff --git a/images/default/grid/dirty.gif b/images/default/grid/dirty.gif
new file mode 100644 (file)
index 0000000..583772b
Binary files /dev/null and b/images/default/grid/dirty.gif differ
diff --git a/images/default/grid/done.gif b/images/default/grid/done.gif
new file mode 100644 (file)
index 0000000..a937cb2
Binary files /dev/null and b/images/default/grid/done.gif differ
diff --git a/images/default/grid/drop-no.gif b/images/default/grid/drop-no.gif
new file mode 100644 (file)
index 0000000..31a332b
Binary files /dev/null and b/images/default/grid/drop-no.gif differ
diff --git a/images/default/grid/drop-yes.gif b/images/default/grid/drop-yes.gif
new file mode 100644 (file)
index 0000000..926010e
Binary files /dev/null and b/images/default/grid/drop-yes.gif differ
diff --git a/images/default/grid/footer-bg.gif b/images/default/grid/footer-bg.gif
new file mode 100644 (file)
index 0000000..126120f
Binary files /dev/null and b/images/default/grid/footer-bg.gif differ
diff --git a/images/default/grid/grid-blue-hd.gif b/images/default/grid/grid-blue-hd.gif
new file mode 100644 (file)
index 0000000..862094e
Binary files /dev/null and b/images/default/grid/grid-blue-hd.gif differ
diff --git a/images/default/grid/grid-blue-split.gif b/images/default/grid/grid-blue-split.gif
new file mode 100644 (file)
index 0000000..5286f58
Binary files /dev/null and b/images/default/grid/grid-blue-split.gif differ
diff --git a/images/default/grid/grid-hrow.gif b/images/default/grid/grid-hrow.gif
new file mode 100644 (file)
index 0000000..a263abb
Binary files /dev/null and b/images/default/grid/grid-hrow.gif differ
diff --git a/images/default/grid/grid-loading.gif b/images/default/grid/grid-loading.gif
new file mode 100644 (file)
index 0000000..d112c54
Binary files /dev/null and b/images/default/grid/grid-loading.gif differ
diff --git a/images/default/grid/grid-split.gif b/images/default/grid/grid-split.gif
new file mode 100644 (file)
index 0000000..c76a16e
Binary files /dev/null and b/images/default/grid/grid-split.gif differ
diff --git a/images/default/grid/grid-vista-hd.gif b/images/default/grid/grid-vista-hd.gif
new file mode 100644 (file)
index 0000000..d097263
Binary files /dev/null and b/images/default/grid/grid-vista-hd.gif differ
diff --git a/images/default/grid/invalid_line.gif b/images/default/grid/invalid_line.gif
new file mode 100644 (file)
index 0000000..fb7e0f3
Binary files /dev/null and b/images/default/grid/invalid_line.gif differ
diff --git a/images/default/grid/loading.gif b/images/default/grid/loading.gif
new file mode 100644 (file)
index 0000000..e846e1d
Binary files /dev/null and b/images/default/grid/loading.gif differ
diff --git a/images/default/grid/mso-hd.gif b/images/default/grid/mso-hd.gif
new file mode 100644 (file)
index 0000000..669f3cf
Binary files /dev/null and b/images/default/grid/mso-hd.gif differ
diff --git a/images/default/grid/nowait.gif b/images/default/grid/nowait.gif
new file mode 100644 (file)
index 0000000..4c5862c
Binary files /dev/null and b/images/default/grid/nowait.gif differ
diff --git a/images/default/grid/page-first-disabled.gif b/images/default/grid/page-first-disabled.gif
new file mode 100644 (file)
index 0000000..1e02c41
Binary files /dev/null and b/images/default/grid/page-first-disabled.gif differ
diff --git a/images/default/grid/page-first.gif b/images/default/grid/page-first.gif
new file mode 100644 (file)
index 0000000..d84f41a
Binary files /dev/null and b/images/default/grid/page-first.gif differ
diff --git a/images/default/grid/page-last-disabled.gif b/images/default/grid/page-last-disabled.gif
new file mode 100644 (file)
index 0000000..8697067
Binary files /dev/null and b/images/default/grid/page-last-disabled.gif differ
diff --git a/images/default/grid/page-last.gif b/images/default/grid/page-last.gif
new file mode 100644 (file)
index 0000000..3df5c2b
Binary files /dev/null and b/images/default/grid/page-last.gif differ
diff --git a/images/default/grid/page-next-disabled.gif b/images/default/grid/page-next-disabled.gif
new file mode 100644 (file)
index 0000000..90a7756
Binary files /dev/null and b/images/default/grid/page-next-disabled.gif differ
diff --git a/images/default/grid/page-next.gif b/images/default/grid/page-next.gif
new file mode 100644 (file)
index 0000000..9601635
Binary files /dev/null and b/images/default/grid/page-next.gif differ
diff --git a/images/default/grid/page-prev-disabled.gif b/images/default/grid/page-prev-disabled.gif
new file mode 100644 (file)
index 0000000..37154d6
Binary files /dev/null and b/images/default/grid/page-prev-disabled.gif differ
diff --git a/images/default/grid/page-prev.gif b/images/default/grid/page-prev.gif
new file mode 100644 (file)
index 0000000..eb70cf8
Binary files /dev/null and b/images/default/grid/page-prev.gif differ
diff --git a/images/default/grid/pick-button.gif b/images/default/grid/pick-button.gif
new file mode 100644 (file)
index 0000000..6957924
Binary files /dev/null and b/images/default/grid/pick-button.gif differ
diff --git a/images/default/grid/refresh.gif b/images/default/grid/refresh.gif
new file mode 100644 (file)
index 0000000..254203b
Binary files /dev/null and b/images/default/grid/refresh.gif differ
diff --git a/images/default/grid/sort_asc.gif b/images/default/grid/sort_asc.gif
new file mode 100644 (file)
index 0000000..e12e0b6
Binary files /dev/null and b/images/default/grid/sort_asc.gif differ
diff --git a/images/default/grid/sort_desc.gif b/images/default/grid/sort_desc.gif
new file mode 100644 (file)
index 0000000..b9a69c6
Binary files /dev/null and b/images/default/grid/sort_desc.gif differ
diff --git a/images/default/grid/wait.gif b/images/default/grid/wait.gif
new file mode 100644 (file)
index 0000000..471c1a4
Binary files /dev/null and b/images/default/grid/wait.gif differ
diff --git a/images/default/layout/collapse.gif b/images/default/layout/collapse.gif
new file mode 100644 (file)
index 0000000..d87b0a9
Binary files /dev/null and b/images/default/layout/collapse.gif differ
diff --git a/images/default/layout/expand.gif b/images/default/layout/expand.gif
new file mode 100644 (file)
index 0000000..7b6e1c1
Binary files /dev/null and b/images/default/layout/expand.gif differ
diff --git a/images/default/layout/gradient-bg.gif b/images/default/layout/gradient-bg.gif
new file mode 100644 (file)
index 0000000..fb7b02c
Binary files /dev/null and b/images/default/layout/gradient-bg.gif differ
diff --git a/images/default/layout/layout-sprite.gif b/images/default/layout/layout-sprite.gif
new file mode 100644 (file)
index 0000000..88dc2fd
Binary files /dev/null and b/images/default/layout/layout-sprite.gif differ
diff --git a/images/default/layout/ns-collapse.gif b/images/default/layout/ns-collapse.gif
new file mode 100644 (file)
index 0000000..df2a77e
Binary files /dev/null and b/images/default/layout/ns-collapse.gif differ
diff --git a/images/default/layout/ns-expand.gif b/images/default/layout/ns-expand.gif
new file mode 100644 (file)
index 0000000..77ab9da
Binary files /dev/null and b/images/default/layout/ns-expand.gif differ
diff --git a/images/default/layout/panel-close.gif b/images/default/layout/panel-close.gif
new file mode 100644 (file)
index 0000000..2bdd623
Binary files /dev/null and b/images/default/layout/panel-close.gif differ
diff --git a/images/default/layout/panel-title-bg.gif b/images/default/layout/panel-title-bg.gif
new file mode 100644 (file)
index 0000000..d1daef5
Binary files /dev/null and b/images/default/layout/panel-title-bg.gif differ
diff --git a/images/default/layout/panel-title-light-bg.gif b/images/default/layout/panel-title-light-bg.gif
new file mode 100644 (file)
index 0000000..f111b5d
Binary files /dev/null and b/images/default/layout/panel-title-light-bg.gif differ
diff --git a/images/default/layout/tab-close-on.gif b/images/default/layout/tab-close-on.gif
new file mode 100644 (file)
index 0000000..eacea39
Binary files /dev/null and b/images/default/layout/tab-close-on.gif differ
diff --git a/images/default/layout/tab-close.gif b/images/default/layout/tab-close.gif
new file mode 100644 (file)
index 0000000..45db61e
Binary files /dev/null and b/images/default/layout/tab-close.gif differ
diff --git a/images/default/layout/tool-sprites.gif b/images/default/layout/tool-sprites.gif
new file mode 100644 (file)
index 0000000..295435b
Binary files /dev/null and b/images/default/layout/tool-sprites.gif differ
diff --git a/images/default/menu/chk-sprite.gif b/images/default/menu/chk-sprite.gif
new file mode 100644 (file)
index 0000000..8f40a3e
Binary files /dev/null and b/images/default/menu/chk-sprite.gif differ
diff --git a/images/default/menu/menu-bg.gif b/images/default/menu/menu-bg.gif
new file mode 100644 (file)
index 0000000..51bd1dc
Binary files /dev/null and b/images/default/menu/menu-bg.gif differ
diff --git a/images/default/qtip/bg.gif b/images/default/qtip/bg.gif
new file mode 100644 (file)
index 0000000..43488af
Binary files /dev/null and b/images/default/qtip/bg.gif differ
diff --git a/images/default/s.gif b/images/default/s.gif
new file mode 100644 (file)
index 0000000..1d11fa9
Binary files /dev/null and b/images/default/s.gif differ
diff --git a/images/default/sizer/corners-dark-sprite.gif b/images/default/sizer/corners-dark-sprite.gif
new file mode 100644 (file)
index 0000000..6ad46ac
Binary files /dev/null and b/images/default/sizer/corners-dark-sprite.gif differ
diff --git a/images/default/sizer/corners-sprite.gif b/images/default/sizer/corners-sprite.gif
new file mode 100644 (file)
index 0000000..f916607
Binary files /dev/null and b/images/default/sizer/corners-sprite.gif differ
diff --git a/images/default/sizer/e-handle-dark.gif b/images/default/sizer/e-handle-dark.gif
new file mode 100644 (file)
index 0000000..b5486c1
Binary files /dev/null and b/images/default/sizer/e-handle-dark.gif differ
diff --git a/images/default/sizer/e-handle.gif b/images/default/sizer/e-handle.gif
new file mode 100644 (file)
index 0000000..0f665f6
Binary files /dev/null and b/images/default/sizer/e-handle.gif differ
diff --git a/images/default/sizer/ne-handle-dark.gif b/images/default/sizer/ne-handle-dark.gif
new file mode 100644 (file)
index 0000000..04e5ecf
Binary files /dev/null and b/images/default/sizer/ne-handle-dark.gif differ
diff --git a/images/default/sizer/ne-handle.gif b/images/default/sizer/ne-handle.gif
new file mode 100644 (file)
index 0000000..09405c7
Binary files /dev/null and b/images/default/sizer/ne-handle.gif differ
diff --git a/images/default/sizer/nw-handle-dark.gif b/images/default/sizer/nw-handle-dark.gif
new file mode 100644 (file)
index 0000000..6e49d69
Binary files /dev/null and b/images/default/sizer/nw-handle-dark.gif differ
diff --git a/images/default/sizer/nw-handle.gif b/images/default/sizer/nw-handle.gif
new file mode 100644 (file)
index 0000000..2fcea8a
Binary files /dev/null and b/images/default/sizer/nw-handle.gif differ
diff --git a/images/default/sizer/s-handle-dark.gif b/images/default/sizer/s-handle-dark.gif
new file mode 100644 (file)
index 0000000..4eb5f0f
Binary files /dev/null and b/images/default/sizer/s-handle-dark.gif differ
diff --git a/images/default/sizer/s-handle.gif b/images/default/sizer/s-handle.gif
new file mode 100644 (file)
index 0000000..63dfcad
Binary files /dev/null and b/images/default/sizer/s-handle.gif differ
diff --git a/images/default/sizer/se-handle-dark.gif b/images/default/sizer/se-handle-dark.gif
new file mode 100644 (file)
index 0000000..c4c1087
Binary files /dev/null and b/images/default/sizer/se-handle-dark.gif differ
diff --git a/images/default/sizer/se-handle.gif b/images/default/sizer/se-handle.gif
new file mode 100644 (file)
index 0000000..972055e
Binary files /dev/null and b/images/default/sizer/se-handle.gif differ
diff --git a/images/default/sizer/square.gif b/images/default/sizer/square.gif
new file mode 100644 (file)
index 0000000..14ce6f7
Binary files /dev/null and b/images/default/sizer/square.gif differ
diff --git a/images/default/sizer/sw-handle-dark.gif b/images/default/sizer/sw-handle-dark.gif
new file mode 100644 (file)
index 0000000..77224b0
Binary files /dev/null and b/images/default/sizer/sw-handle-dark.gif differ
diff --git a/images/default/sizer/sw-handle.gif b/images/default/sizer/sw-handle.gif
new file mode 100644 (file)
index 0000000..3ca0ed9
Binary files /dev/null and b/images/default/sizer/sw-handle.gif differ
diff --git a/images/default/tabs/tab-btm-inactive-left-bg.gif b/images/default/tabs/tab-btm-inactive-left-bg.gif
new file mode 100644 (file)
index 0000000..6c1d8f4
Binary files /dev/null and b/images/default/tabs/tab-btm-inactive-left-bg.gif differ
diff --git a/images/default/tabs/tab-btm-inactive-right-bg.gif b/images/default/tabs/tab-btm-inactive-right-bg.gif
new file mode 100644 (file)
index 0000000..768b0e0
Binary files /dev/null and b/images/default/tabs/tab-btm-inactive-right-bg.gif differ
diff --git a/images/default/tabs/tab-btm-left-bg.gif b/images/default/tabs/tab-btm-left-bg.gif
new file mode 100644 (file)
index 0000000..e36ad20
Binary files /dev/null and b/images/default/tabs/tab-btm-left-bg.gif differ
diff --git a/images/default/tabs/tab-btm-right-bg.gif b/images/default/tabs/tab-btm-right-bg.gif
new file mode 100644 (file)
index 0000000..b538273
Binary files /dev/null and b/images/default/tabs/tab-btm-right-bg.gif differ
diff --git a/images/default/tabs/tab-sprite.gif b/images/default/tabs/tab-sprite.gif
new file mode 100644 (file)
index 0000000..feb5051
Binary files /dev/null and b/images/default/tabs/tab-sprite.gif differ
diff --git a/images/default/toolbar/btn-arrow.gif b/images/default/toolbar/btn-arrow.gif
new file mode 100644 (file)
index 0000000..2923955
Binary files /dev/null and b/images/default/toolbar/btn-arrow.gif differ
diff --git a/images/default/toolbar/btn-over-bg.gif b/images/default/toolbar/btn-over-bg.gif
new file mode 100644 (file)
index 0000000..f45fdb1
Binary files /dev/null and b/images/default/toolbar/btn-over-bg.gif differ
diff --git a/images/default/toolbar/gray-bg.gif b/images/default/toolbar/gray-bg.gif
new file mode 100644 (file)
index 0000000..68807de
Binary files /dev/null and b/images/default/toolbar/gray-bg.gif differ
diff --git a/images/default/tree/drop-add.gif b/images/default/tree/drop-add.gif
new file mode 100644 (file)
index 0000000..b22cd14
Binary files /dev/null and b/images/default/tree/drop-add.gif differ
diff --git a/images/default/tree/drop-between.gif b/images/default/tree/drop-between.gif
new file mode 100644 (file)
index 0000000..5c6c09d
Binary files /dev/null and b/images/default/tree/drop-between.gif differ
diff --git a/images/default/tree/drop-no.gif b/images/default/tree/drop-no.gif
new file mode 100644 (file)
index 0000000..9d9c6a9
Binary files /dev/null and b/images/default/tree/drop-no.gif differ
diff --git a/images/default/tree/drop-over.gif b/images/default/tree/drop-over.gif
new file mode 100644 (file)
index 0000000..30d1ca7
Binary files /dev/null and b/images/default/tree/drop-over.gif differ
diff --git a/images/default/tree/drop-sprite.gif b/images/default/tree/drop-sprite.gif
new file mode 100644 (file)
index 0000000..8bbf433
Binary files /dev/null and b/images/default/tree/drop-sprite.gif differ
diff --git a/images/default/tree/drop-under.gif b/images/default/tree/drop-under.gif
new file mode 100644 (file)
index 0000000..85f66b1
Binary files /dev/null and b/images/default/tree/drop-under.gif differ
diff --git a/images/default/tree/drop-yes.gif b/images/default/tree/drop-yes.gif
new file mode 100644 (file)
index 0000000..8aacb30
Binary files /dev/null and b/images/default/tree/drop-yes.gif differ
diff --git a/images/default/tree/elbow-end-minus-nl.gif b/images/default/tree/elbow-end-minus-nl.gif
new file mode 100644 (file)
index 0000000..928779e
Binary files /dev/null and b/images/default/tree/elbow-end-minus-nl.gif differ
diff --git a/images/default/tree/elbow-end-minus.gif b/images/default/tree/elbow-end-minus.gif
new file mode 100644 (file)
index 0000000..9a8d727
Binary files /dev/null and b/images/default/tree/elbow-end-minus.gif differ
diff --git a/images/default/tree/elbow-end-plus-nl.gif b/images/default/tree/elbow-end-plus-nl.gif
new file mode 100644 (file)
index 0000000..9f7f698
Binary files /dev/null and b/images/default/tree/elbow-end-plus-nl.gif differ
diff --git a/images/default/tree/elbow-end-plus.gif b/images/default/tree/elbow-end-plus.gif
new file mode 100644 (file)
index 0000000..5943a01
Binary files /dev/null and b/images/default/tree/elbow-end-plus.gif differ
diff --git a/images/default/tree/elbow-end.gif b/images/default/tree/elbow-end.gif
new file mode 100644 (file)
index 0000000..f24ddee
Binary files /dev/null and b/images/default/tree/elbow-end.gif differ
diff --git a/images/default/tree/elbow-line.gif b/images/default/tree/elbow-line.gif
new file mode 100644 (file)
index 0000000..75e6da4
Binary files /dev/null and b/images/default/tree/elbow-line.gif differ
diff --git a/images/default/tree/elbow-minus-nl.gif b/images/default/tree/elbow-minus-nl.gif
new file mode 100644 (file)
index 0000000..928779e
Binary files /dev/null and b/images/default/tree/elbow-minus-nl.gif differ
diff --git a/images/default/tree/elbow-minus.gif b/images/default/tree/elbow-minus.gif
new file mode 100644 (file)
index 0000000..97dcc71
Binary files /dev/null and b/images/default/tree/elbow-minus.gif differ
diff --git a/images/default/tree/elbow-plus-nl.gif b/images/default/tree/elbow-plus-nl.gif
new file mode 100644 (file)
index 0000000..9f7f698
Binary files /dev/null and b/images/default/tree/elbow-plus-nl.gif differ
diff --git a/images/default/tree/elbow-plus.gif b/images/default/tree/elbow-plus.gif
new file mode 100644 (file)
index 0000000..698de47
Binary files /dev/null and b/images/default/tree/elbow-plus.gif differ
diff --git a/images/default/tree/elbow-sprite.gif b/images/default/tree/elbow-sprite.gif
new file mode 100644 (file)
index 0000000..a63e3ad
Binary files /dev/null and b/images/default/tree/elbow-sprite.gif differ
diff --git a/images/default/tree/elbow.gif b/images/default/tree/elbow.gif
new file mode 100644 (file)
index 0000000..b8f4208
Binary files /dev/null and b/images/default/tree/elbow.gif differ
diff --git a/images/default/tree/folder-open.gif b/images/default/tree/folder-open.gif
new file mode 100644 (file)
index 0000000..56ba737
Binary files /dev/null and b/images/default/tree/folder-open.gif differ
diff --git a/images/default/tree/folder.gif b/images/default/tree/folder.gif
new file mode 100644 (file)
index 0000000..20412f7
Binary files /dev/null and b/images/default/tree/folder.gif differ
diff --git a/images/default/tree/leaf.gif b/images/default/tree/leaf.gif
new file mode 100644 (file)
index 0000000..445769d
Binary files /dev/null and b/images/default/tree/leaf.gif differ
diff --git a/images/default/tree/loading.gif b/images/default/tree/loading.gif
new file mode 100644 (file)
index 0000000..e846e1d
Binary files /dev/null and b/images/default/tree/loading.gif differ
diff --git a/images/default/tree/node-sprite.gif b/images/default/tree/node-sprite.gif
new file mode 100644 (file)
index 0000000..ba576c0
Binary files /dev/null and b/images/default/tree/node-sprite.gif differ
diff --git a/images/default/tree/s.gif b/images/default/tree/s.gif
new file mode 100644 (file)
index 0000000..1d11fa9
Binary files /dev/null and b/images/default/tree/s.gif differ
diff --git a/images/gray/basic-dialog/close.gif b/images/gray/basic-dialog/close.gif
new file mode 100644 (file)
index 0000000..1162347
Binary files /dev/null and b/images/gray/basic-dialog/close.gif differ
diff --git a/images/gray/basic-dialog/dlg-bg.gif b/images/gray/basic-dialog/dlg-bg.gif
new file mode 100644 (file)
index 0000000..1a46663
Binary files /dev/null and b/images/gray/basic-dialog/dlg-bg.gif differ
diff --git a/images/gray/basic-dialog/e-handle.gif b/images/gray/basic-dialog/e-handle.gif
new file mode 100644 (file)
index 0000000..48877e7
Binary files /dev/null and b/images/gray/basic-dialog/e-handle.gif differ
diff --git a/images/gray/basic-dialog/hd-sprite.gif b/images/gray/basic-dialog/hd-sprite.gif
new file mode 100644 (file)
index 0000000..2f84f73
Binary files /dev/null and b/images/gray/basic-dialog/hd-sprite.gif differ
diff --git a/images/gray/basic-dialog/s-handle.gif b/images/gray/basic-dialog/s-handle.gif
new file mode 100644 (file)
index 0000000..c13c9cd
Binary files /dev/null and b/images/gray/basic-dialog/s-handle.gif differ
diff --git a/images/gray/basic-dialog/se-handle.gif b/images/gray/basic-dialog/se-handle.gif
new file mode 100644 (file)
index 0000000..c4e38a2
Binary files /dev/null and b/images/gray/basic-dialog/se-handle.gif differ
diff --git a/images/gray/gradient-bg.gif b/images/gray/gradient-bg.gif
new file mode 100644 (file)
index 0000000..8134e49
Binary files /dev/null and b/images/gray/gradient-bg.gif differ
diff --git a/images/gray/layout/collapse.gif b/images/gray/layout/collapse.gif
new file mode 100644 (file)
index 0000000..6273b43
Binary files /dev/null and b/images/gray/layout/collapse.gif differ
diff --git a/images/gray/layout/expand.gif b/images/gray/layout/expand.gif
new file mode 100644 (file)
index 0000000..2bcf242
Binary files /dev/null and b/images/gray/layout/expand.gif differ
diff --git a/images/gray/layout/gradient-bg.gif b/images/gray/layout/gradient-bg.gif
new file mode 100644 (file)
index 0000000..d311e7d
Binary files /dev/null and b/images/gray/layout/gradient-bg.gif differ
diff --git a/images/gray/layout/layout-sprite.gif b/images/gray/layout/layout-sprite.gif
new file mode 100644 (file)
index 0000000..9b4fa00
Binary files /dev/null and b/images/gray/layout/layout-sprite.gif differ
diff --git a/images/gray/layout/ns-collapse.gif b/images/gray/layout/ns-collapse.gif
new file mode 100644 (file)
index 0000000..c567131
Binary files /dev/null and b/images/gray/layout/ns-collapse.gif differ
diff --git a/images/gray/layout/ns-expand.gif b/images/gray/layout/ns-expand.gif
new file mode 100644 (file)
index 0000000..bf967e7
Binary files /dev/null and b/images/gray/layout/ns-expand.gif differ
diff --git a/images/gray/layout/panel-close.gif b/images/gray/layout/panel-close.gif
new file mode 100644 (file)
index 0000000..4e96481
Binary files /dev/null and b/images/gray/layout/panel-close.gif differ
diff --git a/images/gray/layout/panel-title-bg.gif b/images/gray/layout/panel-title-bg.gif
new file mode 100644 (file)
index 0000000..d1daef5
Binary files /dev/null and b/images/gray/layout/panel-title-bg.gif differ
diff --git a/images/gray/layout/panel-title-light-bg.gif b/images/gray/layout/panel-title-light-bg.gif
new file mode 100644 (file)
index 0000000..a9187e3
Binary files /dev/null and b/images/gray/layout/panel-title-light-bg.gif differ
diff --git a/images/gray/layout/tab-close-on.gif b/images/gray/layout/tab-close-on.gif
new file mode 100644 (file)
index 0000000..556e905
Binary files /dev/null and b/images/gray/layout/tab-close-on.gif differ
diff --git a/images/gray/layout/tab-close.gif b/images/gray/layout/tab-close.gif
new file mode 100644 (file)
index 0000000..45db61e
Binary files /dev/null and b/images/gray/layout/tab-close.gif differ
diff --git a/images/gray/qtip/bg.gif b/images/gray/qtip/bg.gif
new file mode 100644 (file)
index 0000000..5c0e8c9
Binary files /dev/null and b/images/gray/qtip/bg.gif differ
diff --git a/images/gray/s.gif b/images/gray/s.gif
new file mode 100644 (file)
index 0000000..1d11fa9
Binary files /dev/null and b/images/gray/s.gif differ
diff --git a/images/gray/sizer/e-handle-dark.gif b/images/gray/sizer/e-handle-dark.gif
new file mode 100644 (file)
index 0000000..eac9662
Binary files /dev/null and b/images/gray/sizer/e-handle-dark.gif differ
diff --git a/images/gray/sizer/e-handle.gif b/images/gray/sizer/e-handle.gif
new file mode 100644 (file)
index 0000000..f2c9f53
Binary files /dev/null and b/images/gray/sizer/e-handle.gif differ
diff --git a/images/gray/sizer/ne-handle-dark.gif b/images/gray/sizer/ne-handle-dark.gif
new file mode 100644 (file)
index 0000000..c9c041c
Binary files /dev/null and b/images/gray/sizer/ne-handle-dark.gif differ
diff --git a/images/gray/sizer/ne-handle.gif b/images/gray/sizer/ne-handle.gif
new file mode 100644 (file)
index 0000000..942ae82
Binary files /dev/null and b/images/gray/sizer/ne-handle.gif differ
diff --git a/images/gray/sizer/nw-handle-dark.gif b/images/gray/sizer/nw-handle-dark.gif
new file mode 100644 (file)
index 0000000..23fced9
Binary files /dev/null and b/images/gray/sizer/nw-handle-dark.gif differ
diff --git a/images/gray/sizer/nw-handle.gif b/images/gray/sizer/nw-handle.gif
new file mode 100644 (file)
index 0000000..d39b0c3
Binary files /dev/null and b/images/gray/sizer/nw-handle.gif differ
diff --git a/images/gray/sizer/s-handle-dark.gif b/images/gray/sizer/s-handle-dark.gif
new file mode 100644 (file)
index 0000000..ddc2e18
Binary files /dev/null and b/images/gray/sizer/s-handle-dark.gif differ
diff --git a/images/gray/sizer/s-handle.gif b/images/gray/sizer/s-handle.gif
new file mode 100644 (file)
index 0000000..827c333
Binary files /dev/null and b/images/gray/sizer/s-handle.gif differ
diff --git a/images/gray/sizer/se-handle-dark.gif b/images/gray/sizer/se-handle-dark.gif
new file mode 100644 (file)
index 0000000..1a678e6
Binary files /dev/null and b/images/gray/sizer/se-handle-dark.gif differ
diff --git a/images/gray/sizer/se-handle.gif b/images/gray/sizer/se-handle.gif
new file mode 100644 (file)
index 0000000..69b5a9e
Binary files /dev/null and b/images/gray/sizer/se-handle.gif differ
diff --git a/images/gray/sizer/sw-handle-dark.gif b/images/gray/sizer/sw-handle-dark.gif
new file mode 100644 (file)
index 0000000..937102c
Binary files /dev/null and b/images/gray/sizer/sw-handle-dark.gif differ
diff --git a/images/gray/sizer/sw-handle.gif b/images/gray/sizer/sw-handle.gif
new file mode 100644 (file)
index 0000000..b9e2f56
Binary files /dev/null and b/images/gray/sizer/sw-handle.gif differ
diff --git a/images/gray/tabs/tab-btm-inactive-left-bg.gif b/images/gray/tabs/tab-btm-inactive-left-bg.gif
new file mode 100644 (file)
index 0000000..c8f7aca
Binary files /dev/null and b/images/gray/tabs/tab-btm-inactive-left-bg.gif differ
diff --git a/images/gray/tabs/tab-btm-inactive-right-bg.gif b/images/gray/tabs/tab-btm-inactive-right-bg.gif
new file mode 100644 (file)
index 0000000..b3f3dcb
Binary files /dev/null and b/images/gray/tabs/tab-btm-inactive-right-bg.gif differ
diff --git a/images/gray/tabs/tab-btm-left-bg.gif b/images/gray/tabs/tab-btm-left-bg.gif
new file mode 100644 (file)
index 0000000..ae47e17
Binary files /dev/null and b/images/gray/tabs/tab-btm-left-bg.gif differ
diff --git a/images/gray/tabs/tab-btm-right-bg.gif b/images/gray/tabs/tab-btm-right-bg.gif
new file mode 100644 (file)
index 0000000..bd70cbc
Binary files /dev/null and b/images/gray/tabs/tab-btm-right-bg.gif differ
diff --git a/images/gray/tabs/tab-sprite.gif b/images/gray/tabs/tab-sprite.gif
new file mode 100644 (file)
index 0000000..db15aee
Binary files /dev/null and b/images/gray/tabs/tab-sprite.gif differ
diff --git a/images/gray/toolbar/gray-bg.gif b/images/gray/toolbar/gray-bg.gif
new file mode 100644 (file)
index 0000000..bd49438
Binary files /dev/null and b/images/gray/toolbar/gray-bg.gif differ
diff --git a/images/license.txt b/images/license.txt
new file mode 100644 (file)
index 0000000..b195f53
--- /dev/null
@@ -0,0 +1,26 @@
+yui-ext\r
+Copyright (c) 2006, Jack Slocum\r
+All rights reserved.\r
+\r
+Redistribution and use in source and binary forms, with or without modification, \r
+are permitted provided that the following conditions are met:\r
+\r
+    * Redistributions of source code must retain the above copyright notice, \r
+    this list of conditions and the following disclaimer.\r
+    * Redistributions in binary form must reproduce the above copyright notice, \r
+    this list of conditions and the following disclaimer in the documentation \r
+    and/or other materials provided with the distribution.\r
+    * Neither the name yui-ext nor the names of its contributors \r
+    may be used to endorse or promote products derived from this software \r
+    without specific prior written permission.\r
+\r
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND \r
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED \r
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. \r
+IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, \r
+INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, \r
+BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, \r
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY \r
+OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING \r
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, \r
+EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
\ No newline at end of file
diff --git a/images/roojs_logo.jpg b/images/roojs_logo.jpg
new file mode 100644 (file)
index 0000000..39b42f0
Binary files /dev/null and b/images/roojs_logo.jpg differ
diff --git a/images/slate/button/btn-arrow.gif b/images/slate/button/btn-arrow.gif
new file mode 100644 (file)
index 0000000..a472564
Binary files /dev/null and b/images/slate/button/btn-arrow.gif differ
diff --git a/images/slate/button/btn-sprite.gif b/images/slate/button/btn-sprite.gif
new file mode 100644 (file)
index 0000000..cd95462
Binary files /dev/null and b/images/slate/button/btn-sprite.gif differ
diff --git a/images/slate/editor/tb-sprite.gif b/images/slate/editor/tb-sprite.gif
new file mode 100644 (file)
index 0000000..bd4011d
Binary files /dev/null and b/images/slate/editor/tb-sprite.gif differ
diff --git a/images/slate/form/clear-trigger.gif b/images/slate/form/clear-trigger.gif
new file mode 100644 (file)
index 0000000..0ae9d06
Binary files /dev/null and b/images/slate/form/clear-trigger.gif differ
diff --git a/images/slate/form/date-trigger.gif b/images/slate/form/date-trigger.gif
new file mode 100644 (file)
index 0000000..5da5850
Binary files /dev/null and b/images/slate/form/date-trigger.gif differ
diff --git a/images/slate/form/search-trigger.gif b/images/slate/form/search-trigger.gif
new file mode 100644 (file)
index 0000000..61e7d98
Binary files /dev/null and b/images/slate/form/search-trigger.gif differ
diff --git a/images/slate/form/trigger-tpl.gif b/images/slate/form/trigger-tpl.gif
new file mode 100644 (file)
index 0000000..df1ea98
Binary files /dev/null and b/images/slate/form/trigger-tpl.gif differ
diff --git a/images/slate/form/trigger.gif b/images/slate/form/trigger.gif
new file mode 100644 (file)
index 0000000..d2db1bd
Binary files /dev/null and b/images/slate/form/trigger.gif differ
diff --git a/images/slate/gradient-bg.gif b/images/slate/gradient-bg.gif
new file mode 100644 (file)
index 0000000..8134e49
Binary files /dev/null and b/images/slate/gradient-bg.gif differ
diff --git a/images/slate/grid/arrow-left-white.gif b/images/slate/grid/arrow-left-white.gif
new file mode 100644 (file)
index 0000000..63088f5
Binary files /dev/null and b/images/slate/grid/arrow-left-white.gif differ
diff --git a/images/slate/grid/arrow-right-white.gif b/images/slate/grid/arrow-right-white.gif
new file mode 100644 (file)
index 0000000..e9e0678
Binary files /dev/null and b/images/slate/grid/arrow-right-white.gif differ
diff --git a/images/slate/grid/col-move-bottom.gif b/images/slate/grid/col-move-bottom.gif
new file mode 100644 (file)
index 0000000..cc1e473
Binary files /dev/null and b/images/slate/grid/col-move-bottom.gif differ
diff --git a/images/slate/grid/col-move-top.gif b/images/slate/grid/col-move-top.gif
new file mode 100644 (file)
index 0000000..58ff32c
Binary files /dev/null and b/images/slate/grid/col-move-top.gif differ
diff --git a/images/slate/grid/footer-bg.gif b/images/slate/grid/footer-bg.gif
new file mode 100644 (file)
index 0000000..126120f
Binary files /dev/null and b/images/slate/grid/footer-bg.gif differ
diff --git a/images/slate/grid/grid-blue-hd.gif b/images/slate/grid/grid-blue-hd.gif
new file mode 100644 (file)
index 0000000..862094e
Binary files /dev/null and b/images/slate/grid/grid-blue-hd.gif differ
diff --git a/images/slate/grid/grid-blue-split.gif b/images/slate/grid/grid-blue-split.gif
new file mode 100644 (file)
index 0000000..5286f58
Binary files /dev/null and b/images/slate/grid/grid-blue-split.gif differ
diff --git a/images/slate/grid/grid-hrow.gif b/images/slate/grid/grid-hrow.gif
new file mode 100644 (file)
index 0000000..6374104
Binary files /dev/null and b/images/slate/grid/grid-hrow.gif differ
diff --git a/images/slate/grid/grid-split.gif b/images/slate/grid/grid-split.gif
new file mode 100644 (file)
index 0000000..2d27001
Binary files /dev/null and b/images/slate/grid/grid-split.gif differ
diff --git a/images/slate/grid/grid-vista-hd.gif b/images/slate/grid/grid-vista-hd.gif
new file mode 100644 (file)
index 0000000..d097263
Binary files /dev/null and b/images/slate/grid/grid-vista-hd.gif differ
diff --git a/images/slate/grid/grid3-hd-btn.gif b/images/slate/grid/grid3-hd-btn.gif
new file mode 100644 (file)
index 0000000..a7d09ee
Binary files /dev/null and b/images/slate/grid/grid3-hd-btn.gif differ
diff --git a/images/slate/grid/grid3-hrow-over.gif b/images/slate/grid/grid3-hrow-over.gif
new file mode 100644 (file)
index 0000000..f634059
Binary files /dev/null and b/images/slate/grid/grid3-hrow-over.gif differ
diff --git a/images/slate/grid/grid3-hrow.gif b/images/slate/grid/grid3-hrow.gif
new file mode 100644 (file)
index 0000000..b6abe1f
Binary files /dev/null and b/images/slate/grid/grid3-hrow.gif differ
diff --git a/images/slate/grid/grid3-special-col-bg.gif b/images/slate/grid/grid3-special-col-bg.gif
new file mode 100644 (file)
index 0000000..a1481dc
Binary files /dev/null and b/images/slate/grid/grid3-special-col-bg.gif differ
diff --git a/images/slate/grid/grid3-special-col-sel-bg.gif b/images/slate/grid/grid3-special-col-sel-bg.gif
new file mode 100644 (file)
index 0000000..34b242d
Binary files /dev/null and b/images/slate/grid/grid3-special-col-sel-bg.gif differ
diff --git a/images/slate/grid/group-expand-sprite.gif b/images/slate/grid/group-expand-sprite.gif
new file mode 100644 (file)
index 0000000..9c1653b
Binary files /dev/null and b/images/slate/grid/group-expand-sprite.gif differ
diff --git a/images/slate/grid/mso-hd.gif b/images/slate/grid/mso-hd.gif
new file mode 100644 (file)
index 0000000..669f3cf
Binary files /dev/null and b/images/slate/grid/mso-hd.gif differ
diff --git a/images/slate/grid/page-first-disabled.gif b/images/slate/grid/page-first-disabled.gif
new file mode 100644 (file)
index 0000000..1eddc0b
Binary files /dev/null and b/images/slate/grid/page-first-disabled.gif differ
diff --git a/images/slate/grid/page-first.gif b/images/slate/grid/page-first.gif
new file mode 100644 (file)
index 0000000..0cfc2f3
Binary files /dev/null and b/images/slate/grid/page-first.gif differ
diff --git a/images/slate/grid/page-last-disabled.gif b/images/slate/grid/page-last-disabled.gif
new file mode 100644 (file)
index 0000000..29881be
Binary files /dev/null and b/images/slate/grid/page-last-disabled.gif differ
diff --git a/images/slate/grid/page-last.gif b/images/slate/grid/page-last.gif
new file mode 100644 (file)
index 0000000..de01053
Binary files /dev/null and b/images/slate/grid/page-last.gif differ
diff --git a/images/slate/grid/page-next-disabled.gif b/images/slate/grid/page-next-disabled.gif
new file mode 100644 (file)
index 0000000..90a7756
Binary files /dev/null and b/images/slate/grid/page-next-disabled.gif differ
diff --git a/images/slate/grid/page-next.gif b/images/slate/grid/page-next.gif
new file mode 100644 (file)
index 0000000..39986b7
Binary files /dev/null and b/images/slate/grid/page-next.gif differ
diff --git a/images/slate/grid/page-prev-disabled.gif b/images/slate/grid/page-prev-disabled.gif
new file mode 100644 (file)
index 0000000..37154d6
Binary files /dev/null and b/images/slate/grid/page-prev-disabled.gif differ
diff --git a/images/slate/grid/page-prev.gif b/images/slate/grid/page-prev.gif
new file mode 100644 (file)
index 0000000..02f24a8
Binary files /dev/null and b/images/slate/grid/page-prev.gif differ
diff --git a/images/slate/grid/row-over.gif b/images/slate/grid/row-over.gif
new file mode 100644 (file)
index 0000000..b288e38
Binary files /dev/null and b/images/slate/grid/row-over.gif differ
diff --git a/images/slate/grid/row-sel.gif b/images/slate/grid/row-sel.gif
new file mode 100644 (file)
index 0000000..98209e6
Binary files /dev/null and b/images/slate/grid/row-sel.gif differ
diff --git a/images/slate/grid/sort_asc.gif b/images/slate/grid/sort_asc.gif
new file mode 100644 (file)
index 0000000..c4c6adb
Binary files /dev/null and b/images/slate/grid/sort_asc.gif differ
diff --git a/images/slate/grid/sort_desc.gif b/images/slate/grid/sort_desc.gif
new file mode 100644 (file)
index 0000000..941d88d
Binary files /dev/null and b/images/slate/grid/sort_desc.gif differ
diff --git a/images/slate/menu/item-over - Copy.gif b/images/slate/menu/item-over - Copy.gif
new file mode 100644 (file)
index 0000000..6d44e43
Binary files /dev/null and b/images/slate/menu/item-over - Copy.gif differ
diff --git a/images/slate/menu/item-over.gif b/images/slate/menu/item-over.gif
new file mode 100644 (file)
index 0000000..238a77d
Binary files /dev/null and b/images/slate/menu/item-over.gif differ
diff --git a/images/slate/menu/menu-parent.gif b/images/slate/menu/menu-parent.gif
new file mode 100644 (file)
index 0000000..2bdb679
Binary files /dev/null and b/images/slate/menu/menu-parent.gif differ
diff --git a/images/slate/menu/menu.gif b/images/slate/menu/menu.gif
new file mode 100644 (file)
index 0000000..7952233
Binary files /dev/null and b/images/slate/menu/menu.gif differ
diff --git a/images/slate/panel/corners-sprite.gif b/images/slate/panel/corners-sprite.gif
new file mode 100644 (file)
index 0000000..44a5722
Binary files /dev/null and b/images/slate/panel/corners-sprite.gif differ
diff --git a/images/slate/panel/left-right.gif b/images/slate/panel/left-right.gif
new file mode 100644 (file)
index 0000000..af759cc
Binary files /dev/null and b/images/slate/panel/left-right.gif differ
diff --git a/images/slate/panel/light-hd.gif b/images/slate/panel/light-hd.gif
new file mode 100644 (file)
index 0000000..d9432a0
Binary files /dev/null and b/images/slate/panel/light-hd.gif differ
diff --git a/images/slate/panel/tool-sprite-tpl.gif b/images/slate/panel/tool-sprite-tpl.gif
new file mode 100644 (file)
index 0000000..a195055
Binary files /dev/null and b/images/slate/panel/tool-sprite-tpl.gif differ
diff --git a/images/slate/panel/tool-sprites.gif b/images/slate/panel/tool-sprites.gif
new file mode 100644 (file)
index 0000000..e91fb9c
Binary files /dev/null and b/images/slate/panel/tool-sprites.gif differ
diff --git a/images/slate/panel/tools-sprites-trans.gif b/images/slate/panel/tools-sprites-trans.gif
new file mode 100644 (file)
index 0000000..e58bf20
Binary files /dev/null and b/images/slate/panel/tools-sprites-trans.gif differ
diff --git a/images/slate/panel/top-bottom.gif b/images/slate/panel/top-bottom.gif
new file mode 100644 (file)
index 0000000..e64abe3
Binary files /dev/null and b/images/slate/panel/top-bottom.gif differ
diff --git a/images/slate/panel/top-bottom.png b/images/slate/panel/top-bottom.png
new file mode 100644 (file)
index 0000000..578ffb6
Binary files /dev/null and b/images/slate/panel/top-bottom.png differ
diff --git a/images/slate/panel/white-corners-sprite.gif b/images/slate/panel/white-corners-sprite.gif
new file mode 100644 (file)
index 0000000..d5b8adf
Binary files /dev/null and b/images/slate/panel/white-corners-sprite.gif differ
diff --git a/images/slate/panel/white-left-right.gif b/images/slate/panel/white-left-right.gif
new file mode 100644 (file)
index 0000000..5b07a06
Binary files /dev/null and b/images/slate/panel/white-left-right.gif differ
diff --git a/images/slate/panel/white-top-bottom.gif b/images/slate/panel/white-top-bottom.gif
new file mode 100644 (file)
index 0000000..8f4ded4
Binary files /dev/null and b/images/slate/panel/white-top-bottom.gif differ
diff --git a/images/slate/progress/progress-bg.gif b/images/slate/progress/progress-bg.gif
new file mode 100644 (file)
index 0000000..caa061a
Binary files /dev/null and b/images/slate/progress/progress-bg.gif differ
diff --git a/images/slate/qtip/bg.gif b/images/slate/qtip/bg.gif
new file mode 100644 (file)
index 0000000..32ebaaa
Binary files /dev/null and b/images/slate/qtip/bg.gif differ
diff --git a/images/slate/qtip/close.gif b/images/slate/qtip/close.gif
new file mode 100644 (file)
index 0000000..69ab915
Binary files /dev/null and b/images/slate/qtip/close.gif differ
diff --git a/images/slate/qtip/tip-sprite.gif b/images/slate/qtip/tip-sprite.gif
new file mode 100644 (file)
index 0000000..fcd6ffe
Binary files /dev/null and b/images/slate/qtip/tip-sprite.gif differ
diff --git a/images/slate/s.gif b/images/slate/s.gif
new file mode 100644 (file)
index 0000000..1d11fa9
Binary files /dev/null and b/images/slate/s.gif differ
diff --git a/images/slate/shared/glass-bg.gif b/images/slate/shared/glass-bg.gif
new file mode 100644 (file)
index 0000000..0d52391
Binary files /dev/null and b/images/slate/shared/glass-bg.gif differ
diff --git a/images/slate/shared/hd-sprite.gif b/images/slate/shared/hd-sprite.gif
new file mode 100644 (file)
index 0000000..3b47087
Binary files /dev/null and b/images/slate/shared/hd-sprite.gif differ
diff --git a/images/slate/shared/left-btn.gif b/images/slate/shared/left-btn.gif
new file mode 100644 (file)
index 0000000..3239360
Binary files /dev/null and b/images/slate/shared/left-btn.gif differ
diff --git a/images/slate/shared/right-btn.gif b/images/slate/shared/right-btn.gif
new file mode 100644 (file)
index 0000000..e45c695
Binary files /dev/null and b/images/slate/shared/right-btn.gif differ
diff --git a/images/slate/sizer/e-handle-dark.gif b/images/slate/sizer/e-handle-dark.gif
new file mode 100644 (file)
index 0000000..2a4b30a
Binary files /dev/null and b/images/slate/sizer/e-handle-dark.gif differ
diff --git a/images/slate/sizer/e-handle.gif b/images/slate/sizer/e-handle.gif
new file mode 100644 (file)
index 0000000..7819f0f
Binary files /dev/null and b/images/slate/sizer/e-handle.gif differ
diff --git a/images/slate/sizer/ne-handle-dark.gif b/images/slate/sizer/ne-handle-dark.gif
new file mode 100644 (file)
index 0000000..817036d
Binary files /dev/null and b/images/slate/sizer/ne-handle-dark.gif differ
diff --git a/images/slate/sizer/ne-handle.gif b/images/slate/sizer/ne-handle.gif
new file mode 100644 (file)
index 0000000..6518a21
Binary files /dev/null and b/images/slate/sizer/ne-handle.gif differ
diff --git a/images/slate/sizer/nw-handle-dark.gif b/images/slate/sizer/nw-handle-dark.gif
new file mode 100644 (file)
index 0000000..fdfb7dc
Binary files /dev/null and b/images/slate/sizer/nw-handle-dark.gif differ
diff --git a/images/slate/sizer/nw-handle.gif b/images/slate/sizer/nw-handle.gif
new file mode 100644 (file)
index 0000000..7655a81
Binary files /dev/null and b/images/slate/sizer/nw-handle.gif differ
diff --git a/images/slate/sizer/s-handle-dark.gif b/images/slate/sizer/s-handle-dark.gif
new file mode 100644 (file)
index 0000000..aeafee2
Binary files /dev/null and b/images/slate/sizer/s-handle-dark.gif differ
diff --git a/images/slate/sizer/s-handle.gif b/images/slate/sizer/s-handle.gif
new file mode 100644 (file)
index 0000000..a1abc4a
Binary files /dev/null and b/images/slate/sizer/s-handle.gif differ
diff --git a/images/slate/sizer/se-handle-dark.gif b/images/slate/sizer/se-handle-dark.gif
new file mode 100644 (file)
index 0000000..362921c
Binary files /dev/null and b/images/slate/sizer/se-handle-dark.gif differ
diff --git a/images/slate/sizer/se-handle.gif b/images/slate/sizer/se-handle.gif
new file mode 100644 (file)
index 0000000..c6684f9
Binary files /dev/null and b/images/slate/sizer/se-handle.gif differ
diff --git a/images/slate/sizer/square.gif b/images/slate/sizer/square.gif
new file mode 100644 (file)
index 0000000..0c0e6b4
Binary files /dev/null and b/images/slate/sizer/square.gif differ
diff --git a/images/slate/sizer/sw-handle-dark.gif b/images/slate/sizer/sw-handle-dark.gif
new file mode 100644 (file)
index 0000000..698122f
Binary files /dev/null and b/images/slate/sizer/sw-handle-dark.gif differ
diff --git a/images/slate/sizer/sw-handle.gif b/images/slate/sizer/sw-handle.gif
new file mode 100644 (file)
index 0000000..920621e
Binary files /dev/null and b/images/slate/sizer/sw-handle.gif differ
diff --git a/images/slate/tabs/scroll-left.gif b/images/slate/tabs/scroll-left.gif
new file mode 100644 (file)
index 0000000..bbb3e3d
Binary files /dev/null and b/images/slate/tabs/scroll-left.gif differ
diff --git a/images/slate/tabs/scroll-right.gif b/images/slate/tabs/scroll-right.gif
new file mode 100644 (file)
index 0000000..feb6a76
Binary files /dev/null and b/images/slate/tabs/scroll-right.gif differ
diff --git a/images/slate/tabs/scroller-bg.gif b/images/slate/tabs/scroller-bg.gif
new file mode 100644 (file)
index 0000000..f089c0a
Binary files /dev/null and b/images/slate/tabs/scroller-bg.gif differ
diff --git a/images/slate/tabs/tab-btm-inactive-left-bg.gif b/images/slate/tabs/tab-btm-inactive-left-bg.gif
new file mode 100644 (file)
index 0000000..777ecd8
Binary files /dev/null and b/images/slate/tabs/tab-btm-inactive-left-bg.gif differ
diff --git a/images/slate/tabs/tab-btm-inactive-right-bg.gif b/images/slate/tabs/tab-btm-inactive-right-bg.gif
new file mode 100644 (file)
index 0000000..7c378ab
Binary files /dev/null and b/images/slate/tabs/tab-btm-inactive-right-bg.gif differ
diff --git a/images/slate/tabs/tab-btm-left-bg.gif b/images/slate/tabs/tab-btm-left-bg.gif
new file mode 100644 (file)
index 0000000..9f578f1
Binary files /dev/null and b/images/slate/tabs/tab-btm-left-bg.gif differ
diff --git a/images/slate/tabs/tab-btm-right-bg.gif b/images/slate/tabs/tab-btm-right-bg.gif
new file mode 100644 (file)
index 0000000..84e20cf
Binary files /dev/null and b/images/slate/tabs/tab-btm-right-bg.gif differ
diff --git a/images/slate/tabs/tab-close.gif b/images/slate/tabs/tab-close.gif
new file mode 100644 (file)
index 0000000..3bdff41
Binary files /dev/null and b/images/slate/tabs/tab-close.gif differ
diff --git a/images/slate/tabs/tab-strip-bg.gif b/images/slate/tabs/tab-strip-bg.gif
new file mode 100644 (file)
index 0000000..03e7574
Binary files /dev/null and b/images/slate/tabs/tab-strip-bg.gif differ
diff --git a/images/slate/tabs/tab-strip-bg.png b/images/slate/tabs/tab-strip-bg.png
new file mode 100644 (file)
index 0000000..fa8ab3f
Binary files /dev/null and b/images/slate/tabs/tab-strip-bg.png differ
diff --git a/images/slate/tabs/tab-strip-btm-bg.gif b/images/slate/tabs/tab-strip-btm-bg.gif
new file mode 100644 (file)
index 0000000..f35087f
Binary files /dev/null and b/images/slate/tabs/tab-strip-btm-bg.gif differ
diff --git a/images/slate/tabs/tabs-sprite.gif b/images/slate/tabs/tabs-sprite.gif
new file mode 100644 (file)
index 0000000..d7f1f32
Binary files /dev/null and b/images/slate/tabs/tabs-sprite.gif differ
diff --git a/images/slate/toolbar/bg.gif b/images/slate/toolbar/bg.gif
new file mode 100644 (file)
index 0000000..f61468f
Binary files /dev/null and b/images/slate/toolbar/bg.gif differ
diff --git a/images/slate/toolbar/btn-arrow-light.gif b/images/slate/toolbar/btn-arrow-light.gif
new file mode 100644 (file)
index 0000000..b0e24b5
Binary files /dev/null and b/images/slate/toolbar/btn-arrow-light.gif differ
diff --git a/images/slate/toolbar/btn-arrow.gif b/images/slate/toolbar/btn-arrow.gif
new file mode 100644 (file)
index 0000000..9fad756
Binary files /dev/null and b/images/slate/toolbar/btn-arrow.gif differ
diff --git a/images/slate/toolbar/btn-over-bg.gif b/images/slate/toolbar/btn-over-bg.gif
new file mode 100644 (file)
index 0000000..62464c0
Binary files /dev/null and b/images/slate/toolbar/btn-over-bg.gif differ
diff --git a/images/slate/toolbar/gray-bg.gif b/images/slate/toolbar/gray-bg.gif
new file mode 100644 (file)
index 0000000..bd49438
Binary files /dev/null and b/images/slate/toolbar/gray-bg.gif differ
diff --git a/images/slate/toolbar/tb-bg.gif b/images/slate/toolbar/tb-bg.gif
new file mode 100644 (file)
index 0000000..4969e4e
Binary files /dev/null and b/images/slate/toolbar/tb-bg.gif differ
diff --git a/images/slate/toolbar/tb-btn-sprite.gif b/images/slate/toolbar/tb-btn-sprite.gif
new file mode 100644 (file)
index 0000000..483d51f
Binary files /dev/null and b/images/slate/toolbar/tb-btn-sprite.gif differ
diff --git a/images/slate/window/icon-error.gif b/images/slate/window/icon-error.gif
new file mode 100644 (file)
index 0000000..397b655
Binary files /dev/null and b/images/slate/window/icon-error.gif differ
diff --git a/images/slate/window/icon-info.gif b/images/slate/window/icon-info.gif
new file mode 100644 (file)
index 0000000..58281c3
Binary files /dev/null and b/images/slate/window/icon-info.gif differ
diff --git a/images/slate/window/icon-question.gif b/images/slate/window/icon-question.gif
new file mode 100644 (file)
index 0000000..08abd82
Binary files /dev/null and b/images/slate/window/icon-question.gif differ
diff --git a/images/slate/window/icon-warning.gif b/images/slate/window/icon-warning.gif
new file mode 100644 (file)
index 0000000..27ff98b
Binary files /dev/null and b/images/slate/window/icon-warning.gif differ
diff --git a/images/slate/window/left-corners.png b/images/slate/window/left-corners.png
new file mode 100644 (file)
index 0000000..29fcd3b
Binary files /dev/null and b/images/slate/window/left-corners.png differ
diff --git a/images/slate/window/left-right.png b/images/slate/window/left-right.png
new file mode 100644 (file)
index 0000000..8136bf6
Binary files /dev/null and b/images/slate/window/left-right.png differ
diff --git a/images/slate/window/right-corners.png b/images/slate/window/right-corners.png
new file mode 100644 (file)
index 0000000..314da07
Binary files /dev/null and b/images/slate/window/right-corners.png differ
diff --git a/images/slate/window/top-bottom.png b/images/slate/window/top-bottom.png
new file mode 100644 (file)
index 0000000..04d3cb1
Binary files /dev/null and b/images/slate/window/top-bottom.png differ
diff --git a/images/vista/basic-dialog/bg-center.gif b/images/vista/basic-dialog/bg-center.gif
new file mode 100644 (file)
index 0000000..7bf4a4b
Binary files /dev/null and b/images/vista/basic-dialog/bg-center.gif differ
diff --git a/images/vista/basic-dialog/bg-left.gif b/images/vista/basic-dialog/bg-left.gif
new file mode 100644 (file)
index 0000000..94b1daf
Binary files /dev/null and b/images/vista/basic-dialog/bg-left.gif differ
diff --git a/images/vista/basic-dialog/bg-right.gif b/images/vista/basic-dialog/bg-right.gif
new file mode 100644 (file)
index 0000000..6dadaf6
Binary files /dev/null and b/images/vista/basic-dialog/bg-right.gif differ
diff --git a/images/vista/basic-dialog/close.gif b/images/vista/basic-dialog/close.gif
new file mode 100644 (file)
index 0000000..4278db9
Binary files /dev/null and b/images/vista/basic-dialog/close.gif differ
diff --git a/images/vista/basic-dialog/dlg-bg.gif b/images/vista/basic-dialog/dlg-bg.gif
new file mode 100644 (file)
index 0000000..1a46663
Binary files /dev/null and b/images/vista/basic-dialog/dlg-bg.gif differ
diff --git a/images/vista/basic-dialog/e-handle.gif b/images/vista/basic-dialog/e-handle.gif
new file mode 100644 (file)
index 0000000..48877e7
Binary files /dev/null and b/images/vista/basic-dialog/e-handle.gif differ
diff --git a/images/vista/basic-dialog/hd-sprite.gif b/images/vista/basic-dialog/hd-sprite.gif
new file mode 100644 (file)
index 0000000..3c2dd63
Binary files /dev/null and b/images/vista/basic-dialog/hd-sprite.gif differ
diff --git a/images/vista/basic-dialog/s-handle.gif b/images/vista/basic-dialog/s-handle.gif
new file mode 100644 (file)
index 0000000..c13c9cd
Binary files /dev/null and b/images/vista/basic-dialog/s-handle.gif differ
diff --git a/images/vista/basic-dialog/se-handle.gif b/images/vista/basic-dialog/se-handle.gif
new file mode 100644 (file)
index 0000000..c4e38a2
Binary files /dev/null and b/images/vista/basic-dialog/se-handle.gif differ
diff --git a/images/vista/basic-dialog/w-handle.gif b/images/vista/basic-dialog/w-handle.gif
new file mode 100644 (file)
index 0000000..d59eafc
Binary files /dev/null and b/images/vista/basic-dialog/w-handle.gif differ
diff --git a/images/vista/gradient-bg.gif b/images/vista/gradient-bg.gif
new file mode 100644 (file)
index 0000000..8134e49
Binary files /dev/null and b/images/vista/gradient-bg.gif differ
diff --git a/images/vista/grid/grid-split.gif b/images/vista/grid/grid-split.gif
new file mode 100644 (file)
index 0000000..c76a16e
Binary files /dev/null and b/images/vista/grid/grid-split.gif differ
diff --git a/images/vista/grid/grid-vista-hd.gif b/images/vista/grid/grid-vista-hd.gif
new file mode 100644 (file)
index 0000000..d097263
Binary files /dev/null and b/images/vista/grid/grid-vista-hd.gif differ
diff --git a/images/vista/layout/collapse.gif b/images/vista/layout/collapse.gif
new file mode 100644 (file)
index 0000000..cbd6e08
Binary files /dev/null and b/images/vista/layout/collapse.gif differ
diff --git a/images/vista/layout/expand.gif b/images/vista/layout/expand.gif
new file mode 100644 (file)
index 0000000..8103c0d
Binary files /dev/null and b/images/vista/layout/expand.gif differ
diff --git a/images/vista/layout/gradient-bg.gif b/images/vista/layout/gradient-bg.gif
new file mode 100644 (file)
index 0000000..d311e7d
Binary files /dev/null and b/images/vista/layout/gradient-bg.gif differ
diff --git a/images/vista/layout/layout-sprite.gif b/images/vista/layout/layout-sprite.gif
new file mode 100644 (file)
index 0000000..86daa20
Binary files /dev/null and b/images/vista/layout/layout-sprite.gif differ
diff --git a/images/vista/layout/ns-collapse.gif b/images/vista/layout/ns-collapse.gif
new file mode 100644 (file)
index 0000000..f2ad235
Binary files /dev/null and b/images/vista/layout/ns-collapse.gif differ
diff --git a/images/vista/layout/ns-expand.gif b/images/vista/layout/ns-expand.gif
new file mode 100644 (file)
index 0000000..0817ec6
Binary files /dev/null and b/images/vista/layout/ns-expand.gif differ
diff --git a/images/vista/layout/panel-close.gif b/images/vista/layout/panel-close.gif
new file mode 100644 (file)
index 0000000..4e96481
Binary files /dev/null and b/images/vista/layout/panel-close.gif differ
diff --git a/images/vista/layout/panel-title-bg.gif b/images/vista/layout/panel-title-bg.gif
new file mode 100644 (file)
index 0000000..681f517
Binary files /dev/null and b/images/vista/layout/panel-title-bg.gif differ
diff --git a/images/vista/layout/panel-title-light-bg.gif b/images/vista/layout/panel-title-light-bg.gif
new file mode 100644 (file)
index 0000000..23d8288
Binary files /dev/null and b/images/vista/layout/panel-title-light-bg.gif differ
diff --git a/images/vista/layout/tab-close-on.gif b/images/vista/layout/tab-close-on.gif
new file mode 100644 (file)
index 0000000..556e905
Binary files /dev/null and b/images/vista/layout/tab-close-on.gif differ
diff --git a/images/vista/layout/tab-close.gif b/images/vista/layout/tab-close.gif
new file mode 100644 (file)
index 0000000..0a6f019
Binary files /dev/null and b/images/vista/layout/tab-close.gif differ
diff --git a/images/vista/qtip/bg.gif b/images/vista/qtip/bg.gif
new file mode 100644 (file)
index 0000000..5c0e8c9
Binary files /dev/null and b/images/vista/qtip/bg.gif differ
diff --git a/images/vista/s.gif b/images/vista/s.gif
new file mode 100644 (file)
index 0000000..1d11fa9
Binary files /dev/null and b/images/vista/s.gif differ
diff --git a/images/vista/sizer/e-handle-dark.gif b/images/vista/sizer/e-handle-dark.gif
new file mode 100644 (file)
index 0000000..eac9662
Binary files /dev/null and b/images/vista/sizer/e-handle-dark.gif differ
diff --git a/images/vista/sizer/e-handle.gif b/images/vista/sizer/e-handle.gif
new file mode 100644 (file)
index 0000000..f2c9f53
Binary files /dev/null and b/images/vista/sizer/e-handle.gif differ
diff --git a/images/vista/sizer/ne-handle-dark.gif b/images/vista/sizer/ne-handle-dark.gif
new file mode 100644 (file)
index 0000000..c9c041c
Binary files /dev/null and b/images/vista/sizer/ne-handle-dark.gif differ
diff --git a/images/vista/sizer/ne-handle.gif b/images/vista/sizer/ne-handle.gif
new file mode 100644 (file)
index 0000000..942ae82
Binary files /dev/null and b/images/vista/sizer/ne-handle.gif differ
diff --git a/images/vista/sizer/nw-handle-dark.gif b/images/vista/sizer/nw-handle-dark.gif
new file mode 100644 (file)
index 0000000..23fced9
Binary files /dev/null and b/images/vista/sizer/nw-handle-dark.gif differ
diff --git a/images/vista/sizer/nw-handle.gif b/images/vista/sizer/nw-handle.gif
new file mode 100644 (file)
index 0000000..d39b0c3
Binary files /dev/null and b/images/vista/sizer/nw-handle.gif differ
diff --git a/images/vista/sizer/s-handle-dark.gif b/images/vista/sizer/s-handle-dark.gif
new file mode 100644 (file)
index 0000000..ddc2e18
Binary files /dev/null and b/images/vista/sizer/s-handle-dark.gif differ
diff --git a/images/vista/sizer/s-handle.gif b/images/vista/sizer/s-handle.gif
new file mode 100644 (file)
index 0000000..827c333
Binary files /dev/null and b/images/vista/sizer/s-handle.gif differ
diff --git a/images/vista/sizer/se-handle-dark.gif b/images/vista/sizer/se-handle-dark.gif
new file mode 100644 (file)
index 0000000..1a678e6
Binary files /dev/null and b/images/vista/sizer/se-handle-dark.gif differ
diff --git a/images/vista/sizer/se-handle.gif b/images/vista/sizer/se-handle.gif
new file mode 100644 (file)
index 0000000..69b5a9e
Binary files /dev/null and b/images/vista/sizer/se-handle.gif differ
diff --git a/images/vista/sizer/sw-handle-dark.gif b/images/vista/sizer/sw-handle-dark.gif
new file mode 100644 (file)
index 0000000..937102c
Binary files /dev/null and b/images/vista/sizer/sw-handle-dark.gif differ
diff --git a/images/vista/sizer/sw-handle.gif b/images/vista/sizer/sw-handle.gif
new file mode 100644 (file)
index 0000000..b9e2f56
Binary files /dev/null and b/images/vista/sizer/sw-handle.gif differ
diff --git a/images/vista/tabs/tab-btm-inactive-left-bg.gif b/images/vista/tabs/tab-btm-inactive-left-bg.gif
new file mode 100644 (file)
index 0000000..667beeb
Binary files /dev/null and b/images/vista/tabs/tab-btm-inactive-left-bg.gif differ
diff --git a/images/vista/tabs/tab-btm-inactive-right-bg.gif b/images/vista/tabs/tab-btm-inactive-right-bg.gif
new file mode 100644 (file)
index 0000000..6c4e0a4
Binary files /dev/null and b/images/vista/tabs/tab-btm-inactive-right-bg.gif differ
diff --git a/images/vista/tabs/tab-btm-left-bg.gif b/images/vista/tabs/tab-btm-left-bg.gif
new file mode 100644 (file)
index 0000000..1d81e54
Binary files /dev/null and b/images/vista/tabs/tab-btm-left-bg.gif differ
diff --git a/images/vista/tabs/tab-btm-right-bg.gif b/images/vista/tabs/tab-btm-right-bg.gif
new file mode 100644 (file)
index 0000000..47d0050
Binary files /dev/null and b/images/vista/tabs/tab-btm-right-bg.gif differ
diff --git a/images/vista/tabs/tab-sprite.gif b/images/vista/tabs/tab-sprite.gif
new file mode 100644 (file)
index 0000000..a16eedb
Binary files /dev/null and b/images/vista/tabs/tab-sprite.gif differ
diff --git a/images/vista/toolbar/gray-bg.gif b/images/vista/toolbar/gray-bg.gif
new file mode 100644 (file)
index 0000000..9af15c2
Binary files /dev/null and b/images/vista/toolbar/gray-bg.gif differ
diff --git a/licence.txt b/licence.txt
new file mode 100644 (file)
index 0000000..bdb526e
--- /dev/null
@@ -0,0 +1,32 @@
+This is A forked ExtJs - All under LGPL or better.
+
+
+--------------------------------------------------
+Original information.
+
+
+
+Based on ExtJs version 1.1.1
+Ext JS - JavaScript Library
+Copyright (c) 2006-2007, Ext JS, LLC
+All rights reserved.
+licensing@extjs.com (probably not a worth emailing)
+
+-- This is the original text from the licence file -------
+
+The JavaScript code distributed with Ext (the "Software") is licensed under the
+Lesser GNU (LGPL) open source license version 3.0.
+
+http://www.gnu.org/licenses/lgpl.html
+
+If you are using this library for commercial purposes, we encourage you to purch
+ase
+a commercial license. Please visit http://extjs.com/license for more details.
+
+This library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+Lesser General Public License for more details.
+
+
+
diff --git a/resources_licence.txt b/resources_licence.txt
new file mode 100644 (file)
index 0000000..00665ef
--- /dev/null
@@ -0,0 +1,27 @@
+yui-ext
+Copyright (c) 2006, Jack Slocum
+All rights reserved.
+
+Redistribution and use in source and binary forms, with or without modification, 
+are permitted provided that the following conditions are met:
+
+    * Redistributions of source code must retain the above copyright notice, 
+    this list of conditions and the following disclaimer.
+    * Redistributions in binary form must reproduce the above copyright notice, 
+    this list of conditions and the following disclaimer in the documentation 
+    and/or other materials provided with the distribution.
+    * Neither the name yui-ext nor the names of its contributors 
+    may be used to endorse or promote products derived from this software 
+    without specific prior written permission.
+
+THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
+ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
+IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 
+INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 
+BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 
+DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY 
+OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 
+NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, 
+EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+