From 24cb2749ed1899af2689aef87f40bd8f8a8bddb5 Mon Sep 17 00:00:00 2001 From: Eike Foken Date: Sat, 16 Apr 2011 14:11:47 +0200 Subject: [PATCH] Removed extJS src folder --- .../js/ext/src/adapter/ext-base-dom-more.js | 9 - assets/js/ext/src/adapter/jquery-bridge.js | 579 --- assets/js/ext/src/adapter/prototype-bridge.js | 608 ---- assets/js/ext/src/adapter/yui-bridge.js | 374 -- assets/js/ext/src/core/CompositeElement.js | 112 - .../ext/src/core/CompositeElementLite-more.js | 75 - assets/js/ext/src/core/DomHelper-more.js | 154 - assets/js/ext/src/core/Element-more.js | 200 -- assets/js/ext/src/core/Element.alignment.js | 417 --- assets/js/ext/src/core/Element.dd.js | 46 - assets/js/ext/src/core/Element.fx-more.js | 162 - .../js/ext/src/core/Element.insertion-more.js | 57 - assets/js/ext/src/core/Element.keys.js | 52 - .../js/ext/src/core/Element.position-more.js | 176 - assets/js/ext/src/core/Element.scroll-more.js | 118 - assets/js/ext/src/core/Element.style-more.js | 360 -- .../js/ext/src/core/Element.traversal-more.js | 20 - assets/js/ext/src/core/Error.js | 81 - assets/js/ext/src/core/EventManager-more.js | 335 -- assets/js/ext/src/core/Ext-more.js | 688 ---- assets/js/ext/src/core/Template-more.js | 137 - assets/js/ext/src/data/Api.js | 285 -- assets/js/ext/src/data/ArrayReader.js | 103 - assets/js/ext/src/data/ArrayStore.js | 70 - assets/js/ext/src/data/DataField.js | 203 -- assets/js/ext/src/data/DataProxy.js | 511 --- assets/js/ext/src/data/DataReader.js | 228 -- assets/js/ext/src/data/DataWriter.js | 210 -- assets/js/ext/src/data/DirectProxy.js | 173 - assets/js/ext/src/data/DirectStore.js | 54 - assets/js/ext/src/data/GroupingStore.js | 263 -- assets/js/ext/src/data/HttpProxy.js | 261 -- assets/js/ext/src/data/JsonReader.js | 358 -- assets/js/ext/src/data/JsonStore.js | 49 - assets/js/ext/src/data/JsonWriter.js | 96 - assets/js/ext/src/data/MemoryProxy.js | 69 - assets/js/ext/src/data/Record.js | 415 --- assets/js/ext/src/data/Request.js | 41 - assets/js/ext/src/data/Response.js | 39 - assets/js/ext/src/data/ScriptTagProxy.js | 305 -- assets/js/ext/src/data/SortTypes.js | 91 - assets/js/ext/src/data/Store.js | 1977 ----------- assets/js/ext/src/data/StoreMgr.js | 72 - assets/js/ext/src/data/Tree.js | 833 ----- assets/js/ext/src/data/Types.js | 187 - assets/js/ext/src/data/XmlReader.js | 259 -- assets/js/ext/src/data/XmlStore.js | 75 - assets/js/ext/src/data/XmlWriter.js | 158 - assets/js/ext/src/dd/DDCore.js | 3158 ----------------- assets/js/ext/src/dd/DragSource.js | 370 -- assets/js/ext/src/dd/DragTracker.js | 251 -- assets/js/ext/src/dd/DragZone.js | 141 - assets/js/ext/src/dd/DropTarget.js | 122 - assets/js/ext/src/dd/DropZone.js | 262 -- assets/js/ext/src/dd/Registry.js | 127 - assets/js/ext/src/dd/ScrollManager.js | 213 -- assets/js/ext/src/dd/StatusProxy.js | 175 - assets/js/ext/src/debug.js | 907 ----- assets/js/ext/src/direct/Direct.js | 235 -- assets/js/ext/src/direct/Event.js | 34 - assets/js/ext/src/direct/JsonProvider.js | 45 - assets/js/ext/src/direct/PollingProvider.js | 151 - assets/js/ext/src/direct/Provider.js | 110 - assets/js/ext/src/direct/RemotingProvider.js | 380 -- assets/js/ext/src/direct/Transaction.js | 32 - assets/js/ext/src/error-checking.js | 364 -- .../ext-core/examples/carousel/carousel.js | 333 -- .../ext/src/ext-core/examples/jsonp/jsonp.js | 78 - .../ext-core/examples/lightbox/lightbox.js | 366 -- .../js/ext/src/ext-core/examples/menu/menu.js | 258 -- .../src/ext-core/examples/rating/rating.js | 267 -- .../js/ext/src/ext-core/examples/tabs/tabs.js | 79 - .../src/ext-core/src/adapter/ext-base-ajax.js | 371 -- .../src/adapter/ext-base-anim-extra.js | 305 -- .../src/ext-core/src/adapter/ext-base-anim.js | 475 --- .../ext-core/src/adapter/ext-base-begin.js | 18 - .../src/ext-core/src/adapter/ext-base-dom.js | 160 - .../src/ext-core/src/adapter/ext-base-end.js | 21 - .../ext-core/src/adapter/ext-base-event.js | 359 -- .../ext-core/src/adapter/ext-base-point.js | 17 - .../ext-core/src/adapter/ext-base-region.js | 81 - .../ext-core/src/core/CompositeElementLite.js | 322 -- .../js/ext/src/ext-core/src/core/DomHelper.js | 426 --- .../js/ext/src/ext-core/src/core/DomQuery.js | 932 ----- .../ext/src/ext-core/src/core/Element.fx.js | 421 --- .../ext-core/src/core/Element.insertion.js | 145 - .../js/ext/src/ext-core/src/core/Element.js | 985 ----- .../src/ext-core/src/core/Element.position.js | 301 -- .../src/ext-core/src/core/Element.scroll.js | 58 - .../src/ext-core/src/core/Element.style.js | 503 --- .../ext-core/src/core/Element.traversal.js | 175 - .../ext/src/ext-core/src/core/EventManager.js | 933 ----- assets/js/ext/src/ext-core/src/core/Ext.js | 1051 ------ assets/js/ext/src/ext-core/src/core/Fx.js | 1112 ------ assets/js/ext/src/ext-core/src/core/Loader.js | 96 - .../js/ext/src/ext-core/src/core/Template.js | 246 -- .../ext/src/ext-core/src/data/Connection.js | 583 --- .../ext/src/ext-core/src/util/DelayedTask.js | 70 - assets/js/ext/src/ext-core/src/util/JSON.js | 190 - .../ext/src/ext-core/src/util/Observable.js | 528 --- .../js/ext/src/ext-core/src/util/TaskMgr.js | 180 - .../yui_2.6.0/yui/build/logger/logger-min.js | 15 - .../build/yahoo-dom-event/yahoo-dom-event.js | 18 - .../yui/build/yuitest/yuitest-min.js | 17 - assets/js/ext/src/locale/ext-lang-af.js | 185 - assets/js/ext/src/locale/ext-lang-am.js | 359 -- assets/js/ext/src/locale/ext-lang-bg.js | 279 -- assets/js/ext/src/locale/ext-lang-ca.js | 316 -- assets/js/ext/src/locale/ext-lang-cs.js | 311 -- assets/js/ext/src/locale/ext-lang-da.js | 297 -- assets/js/ext/src/locale/ext-lang-de.js | 346 -- assets/js/ext/src/locale/ext-lang-el_GR.js | 309 -- assets/js/ext/src/locale/ext-lang-en.js | 346 -- assets/js/ext/src/locale/ext-lang-en_GB.js | 322 -- assets/js/ext/src/locale/ext-lang-es.js | 319 -- assets/js/ext/src/locale/ext-lang-fa.js | 273 -- assets/js/ext/src/locale/ext-lang-fi.js | 303 -- assets/js/ext/src/locale/ext-lang-fr.js | 346 -- assets/js/ext/src/locale/ext-lang-fr_CA.js | 218 -- assets/js/ext/src/locale/ext-lang-gr.js | 175 - assets/js/ext/src/locale/ext-lang-he.js | 293 -- assets/js/ext/src/locale/ext-lang-hr.js | 296 -- assets/js/ext/src/locale/ext-lang-hu.js | 297 -- assets/js/ext/src/locale/ext-lang-id.js | 303 -- assets/js/ext/src/locale/ext-lang-it.js | 296 -- assets/js/ext/src/locale/ext-lang-ja.js | 319 -- assets/js/ext/src/locale/ext-lang-ko.js | 268 -- assets/js/ext/src/locale/ext-lang-lt.js | 334 -- assets/js/ext/src/locale/ext-lang-lv.js | 177 - assets/js/ext/src/locale/ext-lang-mk.js | 176 - assets/js/ext/src/locale/ext-lang-nl.js | 324 -- assets/js/ext/src/locale/ext-lang-no_NB.js | 295 -- assets/js/ext/src/locale/ext-lang-no_NN.js | 295 -- assets/js/ext/src/locale/ext-lang-pl.js | 304 -- assets/js/ext/src/locale/ext-lang-pt.js | 261 -- assets/js/ext/src/locale/ext-lang-pt_BR.js | 303 -- assets/js/ext/src/locale/ext-lang-pt_PT.js | 298 -- assets/js/ext/src/locale/ext-lang-ro.js | 296 -- assets/js/ext/src/locale/ext-lang-ru.js | 320 -- assets/js/ext/src/locale/ext-lang-sk.js | 182 - assets/js/ext/src/locale/ext-lang-sl.js | 177 - assets/js/ext/src/locale/ext-lang-sr.js | 180 - assets/js/ext/src/locale/ext-lang-sr_RS.js | 179 - assets/js/ext/src/locale/ext-lang-sv_SE.js | 179 - assets/js/ext/src/locale/ext-lang-th.js | 295 -- assets/js/ext/src/locale/ext-lang-tr.js | 307 -- assets/js/ext/src/locale/ext-lang-ukr.js | 263 -- assets/js/ext/src/locale/ext-lang-vn.js | 181 - assets/js/ext/src/locale/ext-lang-zh_CN.js | 263 -- assets/js/ext/src/locale/ext-lang-zh_TW.js | 178 - assets/js/ext/src/state/CookieProvider.js | 94 - assets/js/ext/src/state/Provider.js | 154 - assets/js/ext/src/state/StateManager.js | 69 - assets/js/ext/src/util/AbstractManager.js | 112 - assets/js/ext/src/util/CSS.js | 161 - assets/js/ext/src/util/ClickRepeater.js | 214 -- assets/js/ext/src/util/Cookies.js | 96 - assets/js/ext/src/util/Date.js | 1334 ------- assets/js/ext/src/util/Format.js | 367 -- assets/js/ext/src/util/Function.js | 240 -- assets/js/ext/src/util/History.js | 216 -- assets/js/ext/src/util/KeyMap.js | 242 -- assets/js/ext/src/util/KeyNav.js | 167 - assets/js/ext/src/util/MixedCollection.js | 670 ---- assets/js/ext/src/util/Observable-more.js | 226 -- assets/js/ext/src/util/TextMetrics.js | 136 - assets/js/ext/src/util/UpdateManager.js | 536 --- assets/js/ext/src/util/XTemplate.js | 478 --- assets/js/ext/src/widgets/Action.js | 253 -- assets/js/ext/src/widgets/BoxComponent.js | 591 --- assets/js/ext/src/widgets/Button.js | 840 ----- assets/js/ext/src/widgets/ButtonGroup.js | 106 - assets/js/ext/src/widgets/ColorPalette.js | 172 - assets/js/ext/src/widgets/Component.js | 1801 ---------- assets/js/ext/src/widgets/ComponentMgr.js | 196 - assets/js/ext/src/widgets/Container.js | 1000 ------ assets/js/ext/src/widgets/CycleButton.js | 193 - assets/js/ext/src/widgets/DataView.js | 787 ---- assets/js/ext/src/widgets/DatePicker.js | 795 ----- assets/js/ext/src/widgets/Editor.js | 401 --- assets/js/ext/src/widgets/Layer.js | 469 --- assets/js/ext/src/widgets/LoadMask.js | 129 - assets/js/ext/src/widgets/MessageBox.js | 644 ---- assets/js/ext/src/widgets/PagingToolbar.js | 537 --- assets/js/ext/src/widgets/Panel.js | 1799 ---------- assets/js/ext/src/widgets/PanelDD.js | 158 - assets/js/ext/src/widgets/ProgressBar.js | 306 -- assets/js/ext/src/widgets/Resizable.js | 770 ---- assets/js/ext/src/widgets/Shadow.js | 203 -- assets/js/ext/src/widgets/Slider.js | 967 ----- assets/js/ext/src/widgets/SplitBar.js | 436 --- assets/js/ext/src/widgets/SplitButton.js | 126 - assets/js/ext/src/widgets/TabPanel.js | 1132 ------ assets/js/ext/src/widgets/Toolbar.js | 585 --- assets/js/ext/src/widgets/Viewport.js | 125 - assets/js/ext/src/widgets/Window.js | 1033 ------ assets/js/ext/src/widgets/WindowManager.js | 209 -- assets/js/ext/src/widgets/chart/Chart.js | 1002 ------ assets/js/ext/src/widgets/chart/EventProxy.js | 20 - .../ext/src/widgets/chart/FlashComponent.js | 137 - assets/js/ext/src/widgets/chart/swfobject.js | 788 ---- assets/js/ext/src/widgets/form/Action.js | 778 ---- assets/js/ext/src/widgets/form/BasicForm.js | 810 ----- assets/js/ext/src/widgets/form/Checkbox.js | 178 - .../js/ext/src/widgets/form/CheckboxGroup.js | 496 --- assets/js/ext/src/widgets/form/Combo.js | 1358 ------- .../js/ext/src/widgets/form/CompositeField.js | 445 --- assets/js/ext/src/widgets/form/DateField.js | 446 --- .../js/ext/src/widgets/form/DisplayField.js | 98 - assets/js/ext/src/widgets/form/Field.js | 750 ---- assets/js/ext/src/widgets/form/FieldSet.js | 297 -- assets/js/ext/src/widgets/form/Form.js | 358 -- assets/js/ext/src/widgets/form/Hidden.js | 41 - assets/js/ext/src/widgets/form/HtmlEditor.js | 1263 ------- assets/js/ext/src/widgets/form/Label.js | 64 - assets/js/ext/src/widgets/form/NumberField.js | 194 - assets/js/ext/src/widgets/form/Radio.js | 80 - assets/js/ext/src/widgets/form/RadioGroup.js | 122 - assets/js/ext/src/widgets/form/SliderField.js | 183 - assets/js/ext/src/widgets/form/TextArea.js | 120 - assets/js/ext/src/widgets/form/TextField.js | 548 --- assets/js/ext/src/widgets/form/TimeField.js | 188 - .../js/ext/src/widgets/form/TriggerField.js | 407 --- assets/js/ext/src/widgets/form/VTypes.js | 135 - .../widgets/grid/AbstractSelectionModel.js | 99 - .../src/widgets/grid/CellSelectionModel.js | 286 -- .../widgets/grid/CheckboxSelectionModel.js | 121 - assets/js/ext/src/widgets/grid/Column.js | 674 ---- assets/js/ext/src/widgets/grid/ColumnDD.js | 206 -- assets/js/ext/src/widgets/grid/ColumnModel.js | 655 ---- .../js/ext/src/widgets/grid/ColumnSplitDD.js | 63 - assets/js/ext/src/widgets/grid/EditorGrid.js | 328 -- assets/js/ext/src/widgets/grid/GridDD.js | 95 - assets/js/ext/src/widgets/grid/GridEditor.js | 21 - assets/js/ext/src/widgets/grid/GridPanel.js | 1121 ------ assets/js/ext/src/widgets/grid/GridView.js | 2517 ------------- .../js/ext/src/widgets/grid/GroupingView.js | 609 ---- assets/js/ext/src/widgets/grid/PivotAxis.js | 319 -- assets/js/ext/src/widgets/grid/PivotGrid.js | 389 -- .../js/ext/src/widgets/grid/PivotGridView.js | 437 --- .../js/ext/src/widgets/grid/PropertyGrid.js | 468 --- assets/js/ext/src/widgets/grid/RowNumberer.js | 62 - .../ext/src/widgets/grid/RowSelectionModel.js | 541 --- .../ext/src/widgets/layout/AbsoluteLayout.js | 83 - .../ext/src/widgets/layout/AccordionLayout.js | 202 -- .../js/ext/src/widgets/layout/AnchorLayout.js | 266 -- .../js/ext/src/widgets/layout/AutoLayout.js | 32 - .../js/ext/src/widgets/layout/BorderLayout.js | 1151 ------ assets/js/ext/src/widgets/layout/BoxLayout.js | 344 -- .../js/ext/src/widgets/layout/CardLayout.js | 147 - .../js/ext/src/widgets/layout/ColumnLayout.js | 176 - .../ext/src/widgets/layout/ContainerLayout.js | 309 -- assets/js/ext/src/widgets/layout/FitLayout.js | 58 - .../js/ext/src/widgets/layout/FormLayout.js | 360 -- .../js/ext/src/widgets/layout/HBoxLayout.js | 291 -- .../js/ext/src/widgets/layout/MenuLayout.js | 102 - .../js/ext/src/widgets/layout/TableLayout.js | 210 -- .../ext/src/widgets/layout/ToolbarLayout.js | 439 --- .../js/ext/src/widgets/layout/VBoxLayout.js | 293 -- .../src/widgets/layout/box/MenuOverflow.js | 351 -- .../widgets/layout/box/ScrollerOverflow.js | 507 --- assets/js/ext/src/widgets/list/Column.js | 158 - .../js/ext/src/widgets/list/ColumnResizer.js | 159 - assets/js/ext/src/widgets/list/ListView.js | 389 -- assets/js/ext/src/widgets/list/Sorter.js | 73 - assets/js/ext/src/widgets/menu/BaseItem.js | 166 - assets/js/ext/src/widgets/menu/CheckItem.js | 117 - assets/js/ext/src/widgets/menu/ColorMenu.js | 109 - assets/js/ext/src/widgets/menu/DateMenu.js | 125 - assets/js/ext/src/widgets/menu/Item.js | 224 -- assets/js/ext/src/widgets/menu/Menu.js | 718 ---- assets/js/ext/src/widgets/menu/MenuMgr.js | 206 -- assets/js/ext/src/widgets/menu/Separator.js | 42 - assets/js/ext/src/widgets/menu/TextItem.js | 48 - assets/js/ext/src/widgets/tips/QuickTip.js | 221 -- assets/js/ext/src/widgets/tips/QuickTips.js | 179 - assets/js/ext/src/widgets/tips/SliderTip.js | 74 - assets/js/ext/src/widgets/tips/Tip.js | 161 - assets/js/ext/src/widgets/tips/ToolTip.js | 539 --- .../js/ext/src/widgets/tree/AsyncTreeNode.js | 114 - .../js/ext/src/widgets/tree/TreeDragZone.js | 82 - .../js/ext/src/widgets/tree/TreeDropZone.js | 321 -- assets/js/ext/src/widgets/tree/TreeEditor.js | 177 - .../js/ext/src/widgets/tree/TreeEventModel.js | 198 -- assets/js/ext/src/widgets/tree/TreeFilter.js | 114 - assets/js/ext/src/widgets/tree/TreeLoader.js | 357 -- assets/js/ext/src/widgets/tree/TreeNode.js | 627 ---- assets/js/ext/src/widgets/tree/TreeNodeUI.js | 676 ---- assets/js/ext/src/widgets/tree/TreePanel.js | 981 ----- .../src/widgets/tree/TreeSelectionModel.js | 325 -- assets/js/ext/src/widgets/tree/TreeSorter.js | 114 - 291 files changed, 99967 deletions(-) delete mode 100644 assets/js/ext/src/adapter/ext-base-dom-more.js delete mode 100644 assets/js/ext/src/adapter/jquery-bridge.js delete mode 100644 assets/js/ext/src/adapter/prototype-bridge.js delete mode 100644 assets/js/ext/src/adapter/yui-bridge.js delete mode 100644 assets/js/ext/src/core/CompositeElement.js delete mode 100644 assets/js/ext/src/core/CompositeElementLite-more.js delete mode 100644 assets/js/ext/src/core/DomHelper-more.js delete mode 100644 assets/js/ext/src/core/Element-more.js delete mode 100644 assets/js/ext/src/core/Element.alignment.js delete mode 100644 assets/js/ext/src/core/Element.dd.js delete mode 100644 assets/js/ext/src/core/Element.fx-more.js delete mode 100644 assets/js/ext/src/core/Element.insertion-more.js delete mode 100644 assets/js/ext/src/core/Element.keys.js delete mode 100644 assets/js/ext/src/core/Element.position-more.js delete mode 100644 assets/js/ext/src/core/Element.scroll-more.js delete mode 100644 assets/js/ext/src/core/Element.style-more.js delete mode 100644 assets/js/ext/src/core/Element.traversal-more.js delete mode 100644 assets/js/ext/src/core/Error.js delete mode 100644 assets/js/ext/src/core/EventManager-more.js delete mode 100644 assets/js/ext/src/core/Ext-more.js delete mode 100644 assets/js/ext/src/core/Template-more.js delete mode 100644 assets/js/ext/src/data/Api.js delete mode 100644 assets/js/ext/src/data/ArrayReader.js delete mode 100644 assets/js/ext/src/data/ArrayStore.js delete mode 100644 assets/js/ext/src/data/DataField.js delete mode 100644 assets/js/ext/src/data/DataProxy.js delete mode 100644 assets/js/ext/src/data/DataReader.js delete mode 100644 assets/js/ext/src/data/DataWriter.js delete mode 100644 assets/js/ext/src/data/DirectProxy.js delete mode 100644 assets/js/ext/src/data/DirectStore.js delete mode 100644 assets/js/ext/src/data/GroupingStore.js delete mode 100644 assets/js/ext/src/data/HttpProxy.js delete mode 100644 assets/js/ext/src/data/JsonReader.js delete mode 100644 assets/js/ext/src/data/JsonStore.js delete mode 100644 assets/js/ext/src/data/JsonWriter.js delete mode 100644 assets/js/ext/src/data/MemoryProxy.js delete mode 100644 assets/js/ext/src/data/Record.js delete mode 100644 assets/js/ext/src/data/Request.js delete mode 100644 assets/js/ext/src/data/Response.js delete mode 100644 assets/js/ext/src/data/ScriptTagProxy.js delete mode 100644 assets/js/ext/src/data/SortTypes.js delete mode 100644 assets/js/ext/src/data/Store.js delete mode 100644 assets/js/ext/src/data/StoreMgr.js delete mode 100644 assets/js/ext/src/data/Tree.js delete mode 100644 assets/js/ext/src/data/Types.js delete mode 100644 assets/js/ext/src/data/XmlReader.js delete mode 100644 assets/js/ext/src/data/XmlStore.js delete mode 100644 assets/js/ext/src/data/XmlWriter.js delete mode 100644 assets/js/ext/src/dd/DDCore.js delete mode 100644 assets/js/ext/src/dd/DragSource.js delete mode 100644 assets/js/ext/src/dd/DragTracker.js delete mode 100644 assets/js/ext/src/dd/DragZone.js delete mode 100644 assets/js/ext/src/dd/DropTarget.js delete mode 100644 assets/js/ext/src/dd/DropZone.js delete mode 100644 assets/js/ext/src/dd/Registry.js delete mode 100644 assets/js/ext/src/dd/ScrollManager.js delete mode 100644 assets/js/ext/src/dd/StatusProxy.js delete mode 100644 assets/js/ext/src/debug.js delete mode 100644 assets/js/ext/src/direct/Direct.js delete mode 100644 assets/js/ext/src/direct/Event.js delete mode 100644 assets/js/ext/src/direct/JsonProvider.js delete mode 100644 assets/js/ext/src/direct/PollingProvider.js delete mode 100644 assets/js/ext/src/direct/Provider.js delete mode 100644 assets/js/ext/src/direct/RemotingProvider.js delete mode 100644 assets/js/ext/src/direct/Transaction.js delete mode 100644 assets/js/ext/src/error-checking.js delete mode 100644 assets/js/ext/src/ext-core/examples/carousel/carousel.js delete mode 100644 assets/js/ext/src/ext-core/examples/jsonp/jsonp.js delete mode 100644 assets/js/ext/src/ext-core/examples/lightbox/lightbox.js delete mode 100644 assets/js/ext/src/ext-core/examples/menu/menu.js delete mode 100644 assets/js/ext/src/ext-core/examples/rating/rating.js delete mode 100644 assets/js/ext/src/ext-core/examples/tabs/tabs.js delete mode 100644 assets/js/ext/src/ext-core/src/adapter/ext-base-ajax.js delete mode 100644 assets/js/ext/src/ext-core/src/adapter/ext-base-anim-extra.js delete mode 100644 assets/js/ext/src/ext-core/src/adapter/ext-base-anim.js delete mode 100644 assets/js/ext/src/ext-core/src/adapter/ext-base-begin.js delete mode 100644 assets/js/ext/src/ext-core/src/adapter/ext-base-dom.js delete mode 100644 assets/js/ext/src/ext-core/src/adapter/ext-base-end.js delete mode 100644 assets/js/ext/src/ext-core/src/adapter/ext-base-event.js delete mode 100644 assets/js/ext/src/ext-core/src/adapter/ext-base-point.js delete mode 100644 assets/js/ext/src/ext-core/src/adapter/ext-base-region.js delete mode 100644 assets/js/ext/src/ext-core/src/core/CompositeElementLite.js delete mode 100644 assets/js/ext/src/ext-core/src/core/DomHelper.js delete mode 100644 assets/js/ext/src/ext-core/src/core/DomQuery.js delete mode 100644 assets/js/ext/src/ext-core/src/core/Element.fx.js delete mode 100644 assets/js/ext/src/ext-core/src/core/Element.insertion.js delete mode 100644 assets/js/ext/src/ext-core/src/core/Element.js delete mode 100644 assets/js/ext/src/ext-core/src/core/Element.position.js delete mode 100644 assets/js/ext/src/ext-core/src/core/Element.scroll.js delete mode 100644 assets/js/ext/src/ext-core/src/core/Element.style.js delete mode 100644 assets/js/ext/src/ext-core/src/core/Element.traversal.js delete mode 100644 assets/js/ext/src/ext-core/src/core/EventManager.js delete mode 100644 assets/js/ext/src/ext-core/src/core/Ext.js delete mode 100644 assets/js/ext/src/ext-core/src/core/Fx.js delete mode 100644 assets/js/ext/src/ext-core/src/core/Loader.js delete mode 100644 assets/js/ext/src/ext-core/src/core/Template.js delete mode 100644 assets/js/ext/src/ext-core/src/data/Connection.js delete mode 100644 assets/js/ext/src/ext-core/src/util/DelayedTask.js delete mode 100644 assets/js/ext/src/ext-core/src/util/JSON.js delete mode 100644 assets/js/ext/src/ext-core/src/util/Observable.js delete mode 100644 assets/js/ext/src/ext-core/src/util/TaskMgr.js delete mode 100644 assets/js/ext/src/ext-core/test/yui_2.6.0/yui/build/logger/logger-min.js delete mode 100644 assets/js/ext/src/ext-core/test/yui_2.6.0/yui/build/yahoo-dom-event/yahoo-dom-event.js delete mode 100644 assets/js/ext/src/ext-core/test/yui_2.6.0/yui/build/yuitest/yuitest-min.js delete mode 100644 assets/js/ext/src/locale/ext-lang-af.js delete mode 100644 assets/js/ext/src/locale/ext-lang-am.js delete mode 100644 assets/js/ext/src/locale/ext-lang-bg.js delete mode 100644 assets/js/ext/src/locale/ext-lang-ca.js delete mode 100644 assets/js/ext/src/locale/ext-lang-cs.js delete mode 100644 assets/js/ext/src/locale/ext-lang-da.js delete mode 100644 assets/js/ext/src/locale/ext-lang-de.js delete mode 100644 assets/js/ext/src/locale/ext-lang-el_GR.js delete mode 100644 assets/js/ext/src/locale/ext-lang-en.js delete mode 100644 assets/js/ext/src/locale/ext-lang-en_GB.js delete mode 100644 assets/js/ext/src/locale/ext-lang-es.js delete mode 100644 assets/js/ext/src/locale/ext-lang-fa.js delete mode 100644 assets/js/ext/src/locale/ext-lang-fi.js delete mode 100644 assets/js/ext/src/locale/ext-lang-fr.js delete mode 100644 assets/js/ext/src/locale/ext-lang-fr_CA.js delete mode 100644 assets/js/ext/src/locale/ext-lang-gr.js delete mode 100644 assets/js/ext/src/locale/ext-lang-he.js delete mode 100644 assets/js/ext/src/locale/ext-lang-hr.js delete mode 100644 assets/js/ext/src/locale/ext-lang-hu.js delete mode 100644 assets/js/ext/src/locale/ext-lang-id.js delete mode 100644 assets/js/ext/src/locale/ext-lang-it.js delete mode 100644 assets/js/ext/src/locale/ext-lang-ja.js delete mode 100644 assets/js/ext/src/locale/ext-lang-ko.js delete mode 100644 assets/js/ext/src/locale/ext-lang-lt.js delete mode 100644 assets/js/ext/src/locale/ext-lang-lv.js delete mode 100644 assets/js/ext/src/locale/ext-lang-mk.js delete mode 100644 assets/js/ext/src/locale/ext-lang-nl.js delete mode 100644 assets/js/ext/src/locale/ext-lang-no_NB.js delete mode 100644 assets/js/ext/src/locale/ext-lang-no_NN.js delete mode 100644 assets/js/ext/src/locale/ext-lang-pl.js delete mode 100644 assets/js/ext/src/locale/ext-lang-pt.js delete mode 100644 assets/js/ext/src/locale/ext-lang-pt_BR.js delete mode 100644 assets/js/ext/src/locale/ext-lang-pt_PT.js delete mode 100644 assets/js/ext/src/locale/ext-lang-ro.js delete mode 100644 assets/js/ext/src/locale/ext-lang-ru.js delete mode 100644 assets/js/ext/src/locale/ext-lang-sk.js delete mode 100644 assets/js/ext/src/locale/ext-lang-sl.js delete mode 100644 assets/js/ext/src/locale/ext-lang-sr.js delete mode 100644 assets/js/ext/src/locale/ext-lang-sr_RS.js delete mode 100644 assets/js/ext/src/locale/ext-lang-sv_SE.js delete mode 100644 assets/js/ext/src/locale/ext-lang-th.js delete mode 100644 assets/js/ext/src/locale/ext-lang-tr.js delete mode 100644 assets/js/ext/src/locale/ext-lang-ukr.js delete mode 100644 assets/js/ext/src/locale/ext-lang-vn.js delete mode 100644 assets/js/ext/src/locale/ext-lang-zh_CN.js delete mode 100644 assets/js/ext/src/locale/ext-lang-zh_TW.js delete mode 100644 assets/js/ext/src/state/CookieProvider.js delete mode 100644 assets/js/ext/src/state/Provider.js delete mode 100644 assets/js/ext/src/state/StateManager.js delete mode 100644 assets/js/ext/src/util/AbstractManager.js delete mode 100644 assets/js/ext/src/util/CSS.js delete mode 100644 assets/js/ext/src/util/ClickRepeater.js delete mode 100644 assets/js/ext/src/util/Cookies.js delete mode 100644 assets/js/ext/src/util/Date.js delete mode 100644 assets/js/ext/src/util/Format.js delete mode 100644 assets/js/ext/src/util/Function.js delete mode 100644 assets/js/ext/src/util/History.js delete mode 100644 assets/js/ext/src/util/KeyMap.js delete mode 100644 assets/js/ext/src/util/KeyNav.js delete mode 100644 assets/js/ext/src/util/MixedCollection.js delete mode 100644 assets/js/ext/src/util/Observable-more.js delete mode 100644 assets/js/ext/src/util/TextMetrics.js delete mode 100644 assets/js/ext/src/util/UpdateManager.js delete mode 100644 assets/js/ext/src/util/XTemplate.js delete mode 100644 assets/js/ext/src/widgets/Action.js delete mode 100644 assets/js/ext/src/widgets/BoxComponent.js delete mode 100644 assets/js/ext/src/widgets/Button.js delete mode 100644 assets/js/ext/src/widgets/ButtonGroup.js delete mode 100644 assets/js/ext/src/widgets/ColorPalette.js delete mode 100644 assets/js/ext/src/widgets/Component.js delete mode 100644 assets/js/ext/src/widgets/ComponentMgr.js delete mode 100644 assets/js/ext/src/widgets/Container.js delete mode 100644 assets/js/ext/src/widgets/CycleButton.js delete mode 100644 assets/js/ext/src/widgets/DataView.js delete mode 100644 assets/js/ext/src/widgets/DatePicker.js delete mode 100644 assets/js/ext/src/widgets/Editor.js delete mode 100644 assets/js/ext/src/widgets/Layer.js delete mode 100644 assets/js/ext/src/widgets/LoadMask.js delete mode 100644 assets/js/ext/src/widgets/MessageBox.js delete mode 100644 assets/js/ext/src/widgets/PagingToolbar.js delete mode 100644 assets/js/ext/src/widgets/Panel.js delete mode 100644 assets/js/ext/src/widgets/PanelDD.js delete mode 100644 assets/js/ext/src/widgets/ProgressBar.js delete mode 100644 assets/js/ext/src/widgets/Resizable.js delete mode 100644 assets/js/ext/src/widgets/Shadow.js delete mode 100644 assets/js/ext/src/widgets/Slider.js delete mode 100644 assets/js/ext/src/widgets/SplitBar.js delete mode 100644 assets/js/ext/src/widgets/SplitButton.js delete mode 100644 assets/js/ext/src/widgets/TabPanel.js delete mode 100644 assets/js/ext/src/widgets/Toolbar.js delete mode 100644 assets/js/ext/src/widgets/Viewport.js delete mode 100644 assets/js/ext/src/widgets/Window.js delete mode 100644 assets/js/ext/src/widgets/WindowManager.js delete mode 100644 assets/js/ext/src/widgets/chart/Chart.js delete mode 100644 assets/js/ext/src/widgets/chart/EventProxy.js delete mode 100644 assets/js/ext/src/widgets/chart/FlashComponent.js delete mode 100644 assets/js/ext/src/widgets/chart/swfobject.js delete mode 100644 assets/js/ext/src/widgets/form/Action.js delete mode 100644 assets/js/ext/src/widgets/form/BasicForm.js delete mode 100644 assets/js/ext/src/widgets/form/Checkbox.js delete mode 100644 assets/js/ext/src/widgets/form/CheckboxGroup.js delete mode 100644 assets/js/ext/src/widgets/form/Combo.js delete mode 100644 assets/js/ext/src/widgets/form/CompositeField.js delete mode 100644 assets/js/ext/src/widgets/form/DateField.js delete mode 100644 assets/js/ext/src/widgets/form/DisplayField.js delete mode 100644 assets/js/ext/src/widgets/form/Field.js delete mode 100644 assets/js/ext/src/widgets/form/FieldSet.js delete mode 100644 assets/js/ext/src/widgets/form/Form.js delete mode 100644 assets/js/ext/src/widgets/form/Hidden.js delete mode 100644 assets/js/ext/src/widgets/form/HtmlEditor.js delete mode 100644 assets/js/ext/src/widgets/form/Label.js delete mode 100644 assets/js/ext/src/widgets/form/NumberField.js delete mode 100644 assets/js/ext/src/widgets/form/Radio.js delete mode 100644 assets/js/ext/src/widgets/form/RadioGroup.js delete mode 100644 assets/js/ext/src/widgets/form/SliderField.js delete mode 100644 assets/js/ext/src/widgets/form/TextArea.js delete mode 100644 assets/js/ext/src/widgets/form/TextField.js delete mode 100644 assets/js/ext/src/widgets/form/TimeField.js delete mode 100644 assets/js/ext/src/widgets/form/TriggerField.js delete mode 100644 assets/js/ext/src/widgets/form/VTypes.js delete mode 100644 assets/js/ext/src/widgets/grid/AbstractSelectionModel.js delete mode 100644 assets/js/ext/src/widgets/grid/CellSelectionModel.js delete mode 100644 assets/js/ext/src/widgets/grid/CheckboxSelectionModel.js delete mode 100644 assets/js/ext/src/widgets/grid/Column.js delete mode 100644 assets/js/ext/src/widgets/grid/ColumnDD.js delete mode 100644 assets/js/ext/src/widgets/grid/ColumnModel.js delete mode 100644 assets/js/ext/src/widgets/grid/ColumnSplitDD.js delete mode 100644 assets/js/ext/src/widgets/grid/EditorGrid.js delete mode 100644 assets/js/ext/src/widgets/grid/GridDD.js delete mode 100644 assets/js/ext/src/widgets/grid/GridEditor.js delete mode 100644 assets/js/ext/src/widgets/grid/GridPanel.js delete mode 100644 assets/js/ext/src/widgets/grid/GridView.js delete mode 100644 assets/js/ext/src/widgets/grid/GroupingView.js delete mode 100644 assets/js/ext/src/widgets/grid/PivotAxis.js delete mode 100644 assets/js/ext/src/widgets/grid/PivotGrid.js delete mode 100644 assets/js/ext/src/widgets/grid/PivotGridView.js delete mode 100644 assets/js/ext/src/widgets/grid/PropertyGrid.js delete mode 100644 assets/js/ext/src/widgets/grid/RowNumberer.js delete mode 100644 assets/js/ext/src/widgets/grid/RowSelectionModel.js delete mode 100644 assets/js/ext/src/widgets/layout/AbsoluteLayout.js delete mode 100644 assets/js/ext/src/widgets/layout/AccordionLayout.js delete mode 100644 assets/js/ext/src/widgets/layout/AnchorLayout.js delete mode 100644 assets/js/ext/src/widgets/layout/AutoLayout.js delete mode 100644 assets/js/ext/src/widgets/layout/BorderLayout.js delete mode 100644 assets/js/ext/src/widgets/layout/BoxLayout.js delete mode 100644 assets/js/ext/src/widgets/layout/CardLayout.js delete mode 100644 assets/js/ext/src/widgets/layout/ColumnLayout.js delete mode 100644 assets/js/ext/src/widgets/layout/ContainerLayout.js delete mode 100644 assets/js/ext/src/widgets/layout/FitLayout.js delete mode 100644 assets/js/ext/src/widgets/layout/FormLayout.js delete mode 100644 assets/js/ext/src/widgets/layout/HBoxLayout.js delete mode 100644 assets/js/ext/src/widgets/layout/MenuLayout.js delete mode 100644 assets/js/ext/src/widgets/layout/TableLayout.js delete mode 100644 assets/js/ext/src/widgets/layout/ToolbarLayout.js delete mode 100644 assets/js/ext/src/widgets/layout/VBoxLayout.js delete mode 100644 assets/js/ext/src/widgets/layout/box/MenuOverflow.js delete mode 100644 assets/js/ext/src/widgets/layout/box/ScrollerOverflow.js delete mode 100644 assets/js/ext/src/widgets/list/Column.js delete mode 100644 assets/js/ext/src/widgets/list/ColumnResizer.js delete mode 100644 assets/js/ext/src/widgets/list/ListView.js delete mode 100644 assets/js/ext/src/widgets/list/Sorter.js delete mode 100644 assets/js/ext/src/widgets/menu/BaseItem.js delete mode 100644 assets/js/ext/src/widgets/menu/CheckItem.js delete mode 100644 assets/js/ext/src/widgets/menu/ColorMenu.js delete mode 100644 assets/js/ext/src/widgets/menu/DateMenu.js delete mode 100644 assets/js/ext/src/widgets/menu/Item.js delete mode 100644 assets/js/ext/src/widgets/menu/Menu.js delete mode 100644 assets/js/ext/src/widgets/menu/MenuMgr.js delete mode 100644 assets/js/ext/src/widgets/menu/Separator.js delete mode 100644 assets/js/ext/src/widgets/menu/TextItem.js delete mode 100644 assets/js/ext/src/widgets/tips/QuickTip.js delete mode 100644 assets/js/ext/src/widgets/tips/QuickTips.js delete mode 100644 assets/js/ext/src/widgets/tips/SliderTip.js delete mode 100644 assets/js/ext/src/widgets/tips/Tip.js delete mode 100644 assets/js/ext/src/widgets/tips/ToolTip.js delete mode 100644 assets/js/ext/src/widgets/tree/AsyncTreeNode.js delete mode 100644 assets/js/ext/src/widgets/tree/TreeDragZone.js delete mode 100644 assets/js/ext/src/widgets/tree/TreeDropZone.js delete mode 100644 assets/js/ext/src/widgets/tree/TreeEditor.js delete mode 100644 assets/js/ext/src/widgets/tree/TreeEventModel.js delete mode 100644 assets/js/ext/src/widgets/tree/TreeFilter.js delete mode 100644 assets/js/ext/src/widgets/tree/TreeLoader.js delete mode 100644 assets/js/ext/src/widgets/tree/TreeNode.js delete mode 100644 assets/js/ext/src/widgets/tree/TreeNodeUI.js delete mode 100644 assets/js/ext/src/widgets/tree/TreePanel.js delete mode 100644 assets/js/ext/src/widgets/tree/TreeSelectionModel.js delete mode 100644 assets/js/ext/src/widgets/tree/TreeSorter.js diff --git a/assets/js/ext/src/adapter/ext-base-dom-more.js b/assets/js/ext/src/adapter/ext-base-dom-more.js deleted file mode 100644 index f684ddf..0000000 --- a/assets/js/ext/src/adapter/ext-base-dom-more.js +++ /dev/null @@ -1,9 +0,0 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.com/license - */ -Ext.lib.Dom.getRegion = function(el) { - return Ext.lib.Region.getRegion(el); -}; \ No newline at end of file diff --git a/assets/js/ext/src/adapter/jquery-bridge.js b/assets/js/ext/src/adapter/jquery-bridge.js deleted file mode 100644 index bbffceb..0000000 --- a/assets/js/ext/src/adapter/jquery-bridge.js +++ /dev/null @@ -1,579 +0,0 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.com/license - */ -if(typeof jQuery == "undefined"){ - throw "Unable to load Ext, jQuery not found."; -} - -(function(){ -var libFlyweight; - -Ext.lib.Dom = { - getViewWidth : function(full){ - // jQuery doesn't report full window size on document query, so max both - return full ? Math.max(jQuery(document).width(),jQuery(window).width()) : jQuery(window).width(); - }, - - getViewHeight : function(full){ - // jQuery doesn't report full window size on document query, so max both - return full ? Math.max(jQuery(document).height(),jQuery(window).height()) : jQuery(window).height(); - }, - - isAncestor : function(p, c){ - var ret = false; - - p = Ext.getDom(p); - c = Ext.getDom(c); - if (p && c) { - if (p.contains) { - return p.contains(c); - } else if (p.compareDocumentPosition) { - return !!(p.compareDocumentPosition(c) & 16); - } else { - while (c = c.parentNode) { - ret = c == p || ret; - } - } - } - return ret; - }, - - getRegion : function(el){ - return Ext.lib.Region.getRegion(el); - }, - - ////////////////////////////////////////////////////////////////////////////////////// - // Use of jQuery.offset() removed to promote consistent behavior across libs. - // JVS 05/23/07 - ////////////////////////////////////////////////////////////////////////////////////// - - 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 || document.documentElement); - el = Ext.getDom(el); - - if(el == bd){ - return [0, 0]; - } - - if (el.getBoundingClientRect) { - b = el.getBoundingClientRect(); - scroll = fly(document).getScroll(); - return [Math.round(b.left + scroll.left), Math.round(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 (Ext.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 (Ext.isSafari && hasAbsolute) { - x -= bd.offsetLeft; - y -= bd.offsetTop; - } - - if (Ext.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 (!Ext.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 = Ext.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]); - } -}; - -// all lib flyweight calls use their own flyweight to prevent collisions with developer flyweights -function fly(el){ - if(!libFlyweight){ - libFlyweight = new Ext.Element.Flyweight(); - } - libFlyweight.dom = el; - return libFlyweight; -} -Ext.lib.Event = { - getPageX : function(e){ - e = e.browserEvent || e; - return e.pageX; - }, - - getPageY : function(e){ - e = e.browserEvent || e; - return e.pageY; - }, - - getXY : function(e){ - e = e.browserEvent || e; - return [e.pageX, e.pageY]; - }, - - getTarget : function(e){ - return e.target; - }, - - // all Ext events will go through event manager which provides scoping - on : function(el, eventName, fn, scope, override){ - jQuery(el).bind(eventName, fn); - }, - - un : function(el, eventName, fn){ - jQuery(el).unbind(eventName, fn); - }, - - purgeElement : function(el){ - jQuery(el).unbind(); - }, - - preventDefault : function(e){ - e = e.browserEvent || e; - if(e.preventDefault){ - e.preventDefault(); - }else{ - e.returnValue = false; - } - }, - - stopPropagation : function(e){ - e = e.browserEvent || e; - if(e.stopPropagation){ - e.stopPropagation(); - }else{ - e.cancelBubble = true; - } - }, - - stopEvent : function(e){ - this.preventDefault(e); - this.stopPropagation(e); - }, - - onAvailable : function(id, fn, scope){ - var start = new Date(); - var f = function(){ - if(start.getElapsed() > 10000){ - clearInterval(iid); - } - var el = document.getElementById(id); - if(el){ - clearInterval(iid); - fn.call(scope||window, el); - } - }; - var iid = setInterval(f, 50); - }, - - resolveTextNode: Ext.isGecko ? function(node){ - if(!node){ - return; - } - var s = HTMLElement.prototype.toString.call(node); - if(s == '[xpconnect wrapped native prototype]' || s == '[object XULElement]'){ - return; - } - return node.nodeType == 3 ? node.parentNode : node; - } : function(node){ - return node && node.nodeType == 3 ? node.parentNode : node; - }, - - 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); - } -}; - -Ext.lib.Ajax = function(){ - var createComplete = function(cb){ - return function(xhr, status){ - if((status == 'error' || status == 'timeout') && cb.failure){ - cb.failure.call(cb.scope||window, createResponse(cb, xhr)); - }else if(cb.success){ - cb.success.call(cb.scope||window, createResponse(cb, xhr)); - } - }; - }; - - var createResponse = function(cb, xhr){ - var headerObj = {}, - headerStr, - t, - s; - - try { - headerStr = xhr.getAllResponseHeaders(); - Ext.each(headerStr.replace(/\r\n/g, '\n').split('\n'), function(v){ - t = v.indexOf(':'); - if(t >= 0){ - s = v.substr(0, t).toLowerCase(); - if(v.charAt(t + 1) == ' '){ - ++t; - } - headerObj[s] = v.substr(t + 1); - } - }); - } catch(e) {} - - return { - responseText: xhr.responseText, - responseXML : xhr.responseXML, - argument: cb.argument, - status: xhr.status, - statusText: xhr.statusText, - getResponseHeader : function(header){ - return headerObj[header.toLowerCase()]; - }, - getAllResponseHeaders : function(){ - return headerStr; - } - }; - }; - return { - request : function(method, uri, cb, data, options){ - var o = { - type: method, - url: uri, - data: data, - timeout: cb.timeout, - complete: createComplete(cb) - }; - - if(options){ - var hs = options.headers; - if(options.xmlData){ - o.data = options.xmlData; - o.processData = false; - o.type = (method ? method : (options.method ? options.method : 'POST')); - if (!hs || !hs['Content-Type']){ - o.contentType = 'text/xml'; - } - }else if(options.jsonData){ - o.data = typeof options.jsonData == 'object' ? Ext.encode(options.jsonData) : options.jsonData; - o.processData = false; - o.type = (method ? method : (options.method ? options.method : 'POST')); - if (!hs || !hs['Content-Type']){ - o.contentType = 'application/json'; - } - } - if(hs){ - o.beforeSend = function(xhr){ - for (var h in hs) { - if (hs.hasOwnProperty(h)) { - xhr.setRequestHeader(h, hs[h]); - } - } - }; - } - } - jQuery.ajax(o); - }, - - formRequest : function(form, uri, cb, data, isUpload, sslUri){ - jQuery.ajax({ - type: Ext.getDom(form).method ||'POST', - url: uri, - data: jQuery(form).serialize()+(data?'&'+data:''), - timeout: cb.timeout, - complete: createComplete(cb) - }); - }, - - isCallInProgress : function(trans){ - return false; - }, - - abort : function(trans){ - return false; - }, - - serializeForm : function(form){ - return jQuery(form.dom||form).serialize(); - } - }; -}(); - -Ext.lib.Anim = function(){ - var createAnim = function(cb, scope){ - var animated = true; - return { - stop : function(skipToLast){ - // do nothing - }, - - isAnimated : function(){ - return animated; - }, - - proxyCallback : function(){ - animated = false; - Ext.callback(cb, scope); - } - }; - }; - return { - scroll : function(el, args, duration, easing, cb, scope){ - // scroll anim not supported so just scroll immediately - var anim = createAnim(cb, scope); - el = Ext.getDom(el); - if(typeof args.scroll.to[0] == 'number'){ - el.scrollLeft = args.scroll.to[0]; - } - if(typeof args.scroll.to[1] == 'number'){ - el.scrollTop = args.scroll.to[1]; - } - anim.proxyCallback(); - return anim; - }, - - motion : function(el, args, duration, easing, cb, scope){ - return this.run(el, args, duration, easing, cb, scope); - }, - - color : function(el, args, duration, easing, cb, scope){ - // color anim not supported, so execute callback immediately - var anim = createAnim(cb, scope); - anim.proxyCallback(); - return anim; - }, - - run : function(el, args, duration, easing, cb, scope, type){ - var anim = createAnim(cb, scope), e = Ext.fly(el, '_animrun'); - var o = {}; - for(var k in args){ - switch(k){ // jquery doesn't support, so convert - case 'points': - var by, pts; - e.position(); - if(by = args.points.by){ - var xy = e.getXY(); - pts = e.translatePoints([xy[0]+by[0], xy[1]+by[1]]); - }else{ - pts = e.translatePoints(args.points.to); - } - o.left = pts.left; - o.top = pts.top; - if(!parseInt(e.getStyle('left'), 10)){ // auto bug - e.setLeft(0); - } - if(!parseInt(e.getStyle('top'), 10)){ - e.setTop(0); - } - if(args.points.from){ - e.setXY(args.points.from); - } - break; - case 'width': - o.width = args.width.to; - if (args.width.from) - e.setWidth(args.width.from); - break; - case 'height': - o.height = args.height.to; - if (args.height.from) - e.setHeight(args.height.from); - break; - case 'opacity': - o.opacity = args.opacity.to; - if (args.opacity.from) - e.setOpacity(args.opacity.from); - break; - case 'left': - o.left = args.left.to; - if (args.left.from) - e.setLeft(args.left.from); - break; - case 'top': - o.top = args.top.to; - if (args.top.from) - e.setTop(args.top.from); - break; - // jQuery can't handle callback, scope, and xy arguments, so break here - case 'callback': - case 'scope': - case 'xy': - break; - - default: - o[k] = args[k].to; - if (args[k].from) - e.setStyle(k, args[k].from); - break; - } - } - // TODO: find out about easing plug in? - jQuery(el).animate(o, duration*1000, undefined, anim.proxyCallback); - return anim; - } - }; -}(); - - -Ext.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; -}; - -Ext.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 Ext.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 Ext.lib.Region(t, r, b, l); - }, - - constrainTo : function(r) { - this.top = this.top.constrain(r.top, r.bottom); - this.bottom = this.bottom.constrain(r.top, r.bottom); - this.left = this.left.constrain(r.left, r.right); - this.right = this.right.constrain(r.left, r.right); - return this; - }, - - adjust : function(t, l, b, r){ - this.top += t; - this.left += l; - this.right += r; - this.bottom += b; - return this; - } -}; - -Ext.lib.Region.getRegion = function(el) { - var p = Ext.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 Ext.lib.Region(t, r, b, l); -}; - -Ext.lib.Point = function(x, y) { - if (Ext.isArray(x)) { - y = x[1]; - x = x[0]; - } - this.x = this.right = this.left = this[0] = x; - this.y = this.top = this.bottom = this[1] = y; -}; - -Ext.lib.Point.prototype = new Ext.lib.Region(); - -// prevent IE leaks -if(Ext.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); -} -})(); \ No newline at end of file diff --git a/assets/js/ext/src/adapter/prototype-bridge.js b/assets/js/ext/src/adapter/prototype-bridge.js deleted file mode 100644 index ce0c708..0000000 --- a/assets/js/ext/src/adapter/prototype-bridge.js +++ /dev/null @@ -1,608 +0,0 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.com/license - */ -(function(){ - -var libFlyweight, - version = Prototype.Version.split('.'), - mouseEnterSupported = (parseInt(version[0], 10) >= 2) || (parseInt(version[1], 10) >= 7) || (parseInt(version[2], 10) >= 1), - mouseCache = {}, - elContains = function(parent, child) { - if(parent && parent.firstChild){ - while(child) { - if(child === parent) { - return true; - } - child = child.parentNode; - if(child && (child.nodeType != 1)) { - child = null; - } - } - } - return false; - }, - checkRelatedTarget = function(e) { - return !elContains(e.currentTarget, Ext.lib.Event.getRelatedTarget(e)); - }; - -Ext.lib.Dom = { - getViewWidth : function(full){ - return full ? this.getDocumentWidth() : this.getViewportWidth(); - }, - - getViewHeight : function(full){ - return full ? this.getDocumentHeight() : this.getViewportHeight(); - }, - - getDocumentHeight: function() { // missing from prototype? - var scrollHeight = (document.compatMode != "CSS1Compat") ? document.body.scrollHeight : document.documentElement.scrollHeight; - return Math.max(scrollHeight, this.getViewportHeight()); - }, - - getDocumentWidth: function() { // missing from prototype? - var scrollWidth = (document.compatMode != "CSS1Compat") ? document.body.scrollWidth : document.documentElement.scrollWidth; - return Math.max(scrollWidth, this.getViewportWidth()); - }, - - getViewportHeight: function() { // missing from prototype? - var height = self.innerHeight; - var mode = document.compatMode; - - if ( (mode || Ext.isIE) && !Ext.isOpera ) { - height = (mode == "CSS1Compat") ? - document.documentElement.clientHeight : // Standards - document.body.clientHeight; // Quirks - } - - return height; - }, - - getViewportWidth: function() { // missing from prototype? - var width = self.innerWidth; // Safari - var mode = document.compatMode; - - if (mode || Ext.isIE) { // IE, Gecko, Opera - width = (mode == "CSS1Compat") ? - document.documentElement.clientWidth : // Standards - document.body.clientWidth; // Quirks - } - return width; - }, - - isAncestor : function(p, c){ // missing from prototype? - var ret = false; - - p = Ext.getDom(p); - c = Ext.getDom(c); - if (p && c) { - if (p.contains) { - return p.contains(c); - } else if (p.compareDocumentPosition) { - return !!(p.compareDocumentPosition(c) & 16); - } else { - while (c = c.parentNode) { - ret = c == p || ret; - } - } - } - return ret; - }, - - getRegion : function(el){ - return Ext.lib.Region.getRegion(el); - }, - - getY : function(el){ - return this.getXY(el)[1]; - }, - - getX : function(el){ - return this.getXY(el)[0]; - }, - - getXY : function(el){ // this initially used Position.cumulativeOffset but it is not accurate enough - var p, pe, b, scroll, bd = (document.body || document.documentElement); - el = Ext.getDom(el); - - if(el == bd){ - return [0, 0]; - } - - if (el.getBoundingClientRect) { - b = el.getBoundingClientRect(); - scroll = fly(document).getScroll(); - return [Math.round(b.left + scroll.left), Math.round(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 (Ext.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 (Ext.isSafari && hasAbsolute) { - x -= bd.offsetLeft; - y -= bd.offsetTop; - } - - if (Ext.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 (!Ext.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){ // this initially used Position.cumulativeOffset but it is not accurate enough - el = Ext.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]); - } -}; - -Ext.lib.Event = { - getPageX : function(e){ - return Event.pointerX(e.browserEvent || e); - }, - - getPageY : function(e){ - return Event.pointerY(e.browserEvent || e); - }, - - getXY : function(e){ - e = e.browserEvent || e; - return [Event.pointerX(e), Event.pointerY(e)]; - }, - - getTarget : function(e){ - return Event.element(e.browserEvent || e); - }, - - resolveTextNode: Ext.isGecko ? function(node){ - if(!node){ - return; - } - var s = HTMLElement.prototype.toString.call(node); - if(s == '[xpconnect wrapped native prototype]' || s == '[object XULElement]'){ - return; - } - return node.nodeType == 3 ? node.parentNode : node; - } : function(node){ - return node && node.nodeType == 3 ? node.parentNode : node; - }, - - getRelatedTarget: function(ev) { // missing from prototype? - 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); - }, - - on : function(el, eventName, fn){ - if((eventName == 'mouseenter' || eventName == 'mouseleave') && !mouseEnterSupported){ - var item = mouseCache[el.id] || (mouseCache[el.id] = {}); - item[eventName] = fn; - fn = fn.createInterceptor(checkRelatedTarget); - eventName = (eventName == 'mouseenter') ? 'mouseover' : 'mouseout'; - } - Event.observe(el, eventName, fn, false); - }, - - un : function(el, eventName, fn){ - if((eventName == 'mouseenter' || eventName == 'mouseleave') && !mouseEnterSupported){ - var item = mouseCache[el.id], - ev = item && item[eventName]; - - if(ev){ - fn = ev.fn; - delete item[eventName]; - eventName = (eventName == 'mouseenter') ? 'mouseover' : 'mouseout'; - } - } - Event.stopObserving(el, eventName, fn, false); - }, - - purgeElement : function(el){ - // no equiv? - }, - - preventDefault : function(e){ // missing from prototype? - e = e.browserEvent || e; - if(e.preventDefault) { - e.preventDefault(); - } else { - e.returnValue = false; - } - }, - - stopPropagation : function(e){ // missing from prototype? - e = e.browserEvent || e; - if(e.stopPropagation) { - e.stopPropagation(); - } else { - e.cancelBubble = true; - } - }, - - stopEvent : function(e){ - Event.stop(e.browserEvent || e); - }, - - onAvailable : function(id, fn, scope){ // no equiv - var start = new Date(), iid; - var f = function(){ - if(start.getElapsed() > 10000){ - clearInterval(iid); - } - var el = document.getElementById(id); - if(el){ - clearInterval(iid); - fn.call(scope||window, el); - } - }; - iid = setInterval(f, 50); - } -}; - -Ext.lib.Ajax = function(){ - var createSuccess = function(cb){ - return cb.success ? function(xhr){ - cb.success.call(cb.scope||window, createResponse(cb, xhr)); - } : Ext.emptyFn; - }; - var createFailure = function(cb){ - return cb.failure ? function(xhr){ - cb.failure.call(cb.scope||window, createResponse(cb, xhr)); - } : Ext.emptyFn; - }; - var createResponse = function(cb, xhr){ - var headerObj = {}, - headerStr, - t, - s; - - try { - headerStr = xhr.getAllResponseHeaders(); - Ext.each(headerStr.replace(/\r\n/g, '\n').split('\n'), function(v){ - t = v.indexOf(':'); - if(t >= 0){ - s = v.substr(0, t).toLowerCase(); - if(v.charAt(t + 1) == ' '){ - ++t; - } - headerObj[s] = v.substr(t + 1); - } - }); - } catch(e) {} - - return { - responseText: xhr.responseText, - responseXML : xhr.responseXML, - argument: cb.argument, - status: xhr.status, - statusText: xhr.statusText, - getResponseHeader : function(header){ - return headerObj[header.toLowerCase()]; - }, - getAllResponseHeaders : function(){ - return headerStr; - } - }; - }; - return { - request : function(method, uri, cb, data, options){ - var o = { - method: method, - parameters: data || '', - timeout: cb.timeout, - onSuccess: createSuccess(cb), - onFailure: createFailure(cb) - }; - if(options){ - var hs = options.headers; - if(hs){ - o.requestHeaders = hs; - } - if(options.xmlData){ - method = (method ? method : (options.method ? options.method : 'POST')); - if (!hs || !hs['Content-Type']){ - o.contentType = 'text/xml'; - } - o.postBody = options.xmlData; - delete o.parameters; - } - if(options.jsonData){ - method = (method ? method : (options.method ? options.method : 'POST')); - if (!hs || !hs['Content-Type']){ - o.contentType = 'application/json'; - } - o.postBody = typeof options.jsonData == 'object' ? Ext.encode(options.jsonData) : options.jsonData; - delete o.parameters; - } - } - new Ajax.Request(uri, o); - }, - - formRequest : function(form, uri, cb, data, isUpload, sslUri){ - new Ajax.Request(uri, { - method: Ext.getDom(form).method ||'POST', - parameters: Form.serialize(form)+(data?'&'+data:''), - timeout: cb.timeout, - onSuccess: createSuccess(cb), - onFailure: createFailure(cb) - }); - }, - - isCallInProgress : function(trans){ - return false; - }, - - abort : function(trans){ - return false; - }, - - serializeForm : function(form){ - return Form.serialize(form.dom||form); - } - }; -}(); - - -Ext.lib.Anim = function(){ - - var easings = { - easeOut: function(pos) { - return 1-Math.pow(1-pos,2); - }, - easeIn: function(pos) { - return 1-Math.pow(1-pos,2); - } - }; - var createAnim = function(cb, scope){ - return { - stop : function(skipToLast){ - this.effect.cancel(); - }, - - isAnimated : function(){ - return this.effect.state == 'running'; - }, - - proxyCallback : function(){ - Ext.callback(cb, scope); - } - }; - }; - return { - scroll : function(el, args, duration, easing, cb, scope){ - // not supported so scroll immediately? - var anim = createAnim(cb, scope); - el = Ext.getDom(el); - if(typeof args.scroll.to[0] == 'number'){ - el.scrollLeft = args.scroll.to[0]; - } - if(typeof args.scroll.to[1] == 'number'){ - el.scrollTop = args.scroll.to[1]; - } - anim.proxyCallback(); - return anim; - }, - - motion : function(el, args, duration, easing, cb, scope){ - return this.run(el, args, duration, easing, cb, scope); - }, - - color : function(el, args, duration, easing, cb, scope){ - return this.run(el, args, duration, easing, cb, scope); - }, - - run : function(el, args, duration, easing, cb, scope, type){ - var o = {}; - for(var k in args){ - switch(k){ // scriptaculous doesn't support, so convert these - case 'points': - var by, pts, e = Ext.fly(el, '_animrun'); - e.position(); - if(by = args.points.by){ - var xy = e.getXY(); - pts = e.translatePoints([xy[0]+by[0], xy[1]+by[1]]); - }else{ - pts = e.translatePoints(args.points.to); - } - o.left = pts.left+'px'; - o.top = pts.top+'px'; - break; - case 'width': - o.width = args.width.to+'px'; - break; - case 'height': - o.height = args.height.to+'px'; - break; - case 'opacity': - o.opacity = String(args.opacity.to); - break; - default: - o[k] = String(args[k].to); - break; - } - } - var anim = createAnim(cb, scope); - anim.effect = new Effect.Morph(Ext.id(el), { - duration: duration, - afterFinish: anim.proxyCallback, - transition: easings[easing] || Effect.Transitions.linear, - style: o - }); - return anim; - } - }; -}(); - - -// all lib flyweight calls use their own flyweight to prevent collisions with developer flyweights -function fly(el){ - if(!libFlyweight){ - libFlyweight = new Ext.Element.Flyweight(); - } - libFlyweight.dom = el; - return libFlyweight; -} - -Ext.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; -}; - -Ext.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 Ext.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 Ext.lib.Region(t, r, b, l); - }, - - constrainTo : function(r) { - this.top = this.top.constrain(r.top, r.bottom); - this.bottom = this.bottom.constrain(r.top, r.bottom); - this.left = this.left.constrain(r.left, r.right); - this.right = this.right.constrain(r.left, r.right); - return this; - }, - - adjust : function(t, l, b, r){ - this.top += t; - this.left += l; - this.right += r; - this.bottom += b; - return this; - } -}; - -Ext.lib.Region.getRegion = function(el) { - var p = Ext.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 Ext.lib.Region(t, r, b, l); -}; - -Ext.lib.Point = function(x, y) { - if (Ext.isArray(x)) { - y = x[1]; - x = x[0]; - } - this.x = this.right = this.left = this[0] = x; - this.y = this.top = this.bottom = this[1] = y; -}; - -Ext.lib.Point.prototype = new Ext.lib.Region(); - - -// prevent IE leaks -if(Ext.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); -} -})(); \ No newline at end of file diff --git a/assets/js/ext/src/adapter/yui-bridge.js b/assets/js/ext/src/adapter/yui-bridge.js deleted file mode 100644 index e790ea3..0000000 --- a/assets/js/ext/src/adapter/yui-bridge.js +++ /dev/null @@ -1,374 +0,0 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.com/license - */ -if(typeof YAHOO == "undefined"){ - throw "Unable to load Ext, core YUI utilities (yahoo, dom, event) not found."; -} - -(function(){ - var E = YAHOO.util.Event, - D = YAHOO.util.Dom, - CN = YAHOO.util.Connect, - ES = YAHOO.util.Easing, - A = YAHOO.util.Anim, - libFlyweight, - version = YAHOO.env.getVersion('yahoo').version.split('.'), - mouseEnterSupported = parseInt(version[0], 10) >= 3, - mouseCache = {}, - elContains = function(parent, child){ - if(parent && parent.firstChild){ - while(child){ - if(child === parent){ - return true; - } - child = child.parentNode; - if(child && (child.nodeType != 1)){ - child = null; - } - } - } - return false; - }, checkRelatedTarget = function(e){ - return !elContains(e.currentTarget, Ext.lib.Event.getRelatedTarget(e)); - }; - -Ext.lib.Dom = { - getViewWidth : function(full){ - return full ? D.getDocumentWidth() : D.getViewportWidth(); - }, - - getViewHeight : function(full){ - return full ? D.getDocumentHeight() : D.getViewportHeight(); - }, - - isAncestor : function(haystack, needle){ - return D.isAncestor(haystack, needle); - }, - - getRegion : function(el){ - return D.getRegion(el); - }, - - getY : function(el){ - return this.getXY(el)[1]; - }, - - getX : function(el){ - return this.getXY(el)[0]; - }, - - // original version based on YahooUI getXY - // this version fixes several issues in Safari and FF - // and boosts performance by removing the batch overhead, repetitive dom lookups and array index calls - getXY : function(el){ - var p, pe, b, scroll, bd = (document.body || document.documentElement); - el = Ext.getDom(el); - - if(el == bd){ - return [0, 0]; - } - - if (el.getBoundingClientRect) { - b = el.getBoundingClientRect(); - scroll = fly(document).getScroll(); - return [Math.round(b.left + scroll.left), Math.round(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 (Ext.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 (Ext.isSafari && hasAbsolute) { - x -= bd.offsetLeft; - y -= bd.offsetTop; - } - - if (Ext.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 (!Ext.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 = Ext.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]); - } -}; - -Ext.lib.Event = { - getPageX : function(e){ - return E.getPageX(e.browserEvent || e); - }, - - getPageY : function(e){ - return E.getPageY(e.browserEvent || e); - }, - - getXY : function(e){ - return E.getXY(e.browserEvent || e); - }, - - getTarget : function(e){ - return E.getTarget(e.browserEvent || e); - }, - - getRelatedTarget : function(e){ - return E.getRelatedTarget(e.browserEvent || e); - }, - - on : function(el, eventName, fn, scope, override){ - if((eventName == 'mouseenter' || eventName == 'mouseleave') && !mouseEnterSupported){ - var item = mouseCache[el.id] || (mouseCache[el.id] = {}); - item[eventName] = fn; - fn = fn.createInterceptor(checkRelatedTarget); - eventName = (eventName == 'mouseenter') ? 'mouseover' : 'mouseout'; - } - E.on(el, eventName, fn, scope, override); - }, - - un : function(el, eventName, fn){ - if((eventName == 'mouseenter' || eventName == 'mouseleave') && !mouseEnterSupported){ - var item = mouseCache[el.id], - ev = item && item[eventName]; - - if(ev){ - fn = ev.fn; - delete item[eventName]; - eventName = (eventName == 'mouseenter') ? 'mouseover' : 'mouseout'; - } - } - E.removeListener(el, eventName, fn);; - }, - - purgeElement : function(el){ - E.purgeElement(el); - }, - - preventDefault : function(e){ - E.preventDefault(e.browserEvent || e); - }, - - stopPropagation : function(e){ - E.stopPropagation(e.browserEvent || e); - }, - - stopEvent : function(e){ - E.stopEvent(e.browserEvent || e); - }, - - onAvailable : function(el, fn, scope, override){ - return E.onAvailable(el, fn, scope, override); - } -}; - -Ext.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)){ - CN.initHeader(h, hs[h], false); - } - } - } - if(options.xmlData){ - if (!hs || !hs['Content-Type']){ - CN.initHeader('Content-Type', 'text/xml', false); - } - method = (method ? method : (options.method ? options.method : 'POST')); - data = options.xmlData; - }else if(options.jsonData){ - if (!hs || !hs['Content-Type']){ - CN.initHeader('Content-Type', 'application/json', false); - } - method = (method ? method : (options.method ? options.method : 'POST')); - data = typeof options.jsonData == 'object' ? Ext.encode(options.jsonData) : options.jsonData; - } - } - return CN.asyncRequest(method, uri, cb, data); - }, - - formRequest : function(form, uri, cb, data, isUpload, sslUri){ - CN.setForm(form, isUpload, sslUri); - return CN.asyncRequest(Ext.getDom(form).method ||'POST', uri, cb, data); - }, - - isCallInProgress : function(trans){ - return CN.isCallInProgress(trans); - }, - - abort : function(trans){ - return CN.abort(trans); - }, - - serializeForm : function(form){ - var d = CN.setForm(form.dom || form); - CN.resetFormState(); - return d; - } -}; - -Ext.lib.Region = YAHOO.util.Region; -Ext.lib.Point = YAHOO.util.Point; - - -Ext.lib.Anim = { - scroll : function(el, args, duration, easing, cb, scope){ - this.run(el, args, duration, easing, cb, scope, YAHOO.util.Scroll); - }, - - motion : function(el, args, duration, easing, cb, scope){ - this.run(el, args, duration, easing, cb, scope, YAHOO.util.Motion); - }, - - color : function(el, args, duration, easing, cb, scope){ - this.run(el, args, duration, easing, cb, scope, YAHOO.util.ColorAnim); - }, - - run : function(el, args, duration, easing, cb, scope, type){ - type = type || YAHOO.util.Anim; - if(typeof easing == "string"){ - easing = YAHOO.util.Easing[easing]; - } - var anim = new type(el, args, duration, easing); - anim.animateX(function(){ - Ext.callback(cb, scope); - }); - return anim; - } -}; - -// all lib flyweight calls use their own flyweight to prevent collisions with developer flyweights -function fly(el){ - if(!libFlyweight){ - libFlyweight = new Ext.Element.Flyweight(); - } - libFlyweight.dom = el; - return libFlyweight; -} - -// prevent IE leaks -if(Ext.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); -} -// various overrides - -// add ability for callbacks with animations -if(YAHOO.util.Anim){ - YAHOO.util.Anim.prototype.animateX = function(callback, scope){ - var f = function(){ - this.onComplete.unsubscribe(f); - if(typeof callback == "function"){ - callback.call(scope || this, this); - } - }; - this.onComplete.subscribe(f, this, true); - this.animate(); - }; -} - -if(YAHOO.util.DragDrop && Ext.dd.DragDrop){ - YAHOO.util.DragDrop.defaultPadding = Ext.dd.DragDrop.defaultPadding; - YAHOO.util.DragDrop.constrainTo = Ext.dd.DragDrop.constrainTo; -} - -YAHOO.util.Dom.getXY = function(el) { - var f = function(el) { - return Ext.lib.Dom.getXY(el); - }; - return YAHOO.util.Dom.batch(el, f, YAHOO.util.Dom, true); -}; - - -// workaround for Safari anim duration speed problems -if(YAHOO.util.AnimMgr){ - YAHOO.util.AnimMgr.fps = 1000; -} - -YAHOO.util.Region.prototype.adjust = function(t, l, b, r){ - this.top += t; - this.left += l; - this.right += r; - this.bottom += b; - return this; -}; - -YAHOO.util.Region.prototype.constrainTo = function(r) { - this.top = this.top.constrain(r.top, r.bottom); - this.bottom = this.bottom.constrain(r.top, r.bottom); - this.left = this.left.constrain(r.left, r.right); - this.right = this.right.constrain(r.left, r.right); - return this; -}; - - -})(); \ No newline at end of file diff --git a/assets/js/ext/src/core/CompositeElement.js b/assets/js/ext/src/core/CompositeElement.js deleted file mode 100644 index 3c908f2..0000000 --- a/assets/js/ext/src/core/CompositeElement.js +++ /dev/null @@ -1,112 +0,0 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.com/license - */ -/** - * @class Ext.CompositeElement - * @extends Ext.CompositeElementLite - *

This class encapsulates a collection of DOM elements, providing methods to filter - * members, or to perform collective actions upon the whole set.

- *

Although they are not listed, this class supports all of the methods of {@link Ext.Element} and - * {@link Ext.Fx}. The methods from these classes will be performed on all the elements in this collection.

- *

All methods return this and can be chained.

- * Usage: -

-var els = Ext.select("#some-el div.some-class", true);
-// or select directly from an existing element
-var el = Ext.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);
-
- */ -Ext.CompositeElement = Ext.extend(Ext.CompositeElementLite, { - - constructor : function(els, root){ - this.elements = []; - this.add(els, root); - }, - - // private - getElement : function(el){ - // In this case just return it, since we already have a reference to it - return el; - }, - - // private - transformElement : function(el){ - return Ext.get(el); - } - - /** - * Adds elements to this composite. - * @param {String/Array} els A string CSS selector, an array of elements or an element - * @return {CompositeElement} this - */ - - /** - * Returns the Element object at the specified index - * @param {Number} index - * @return {Ext.Element} - */ - - /** - * Iterates each element in this composite - * calling the supplied function using {@link Ext#each}. - * @param {Function} fn The function to be called with each - * element. If the supplied function returns false, - * iteration stops. This function is called with the following arguments: - *
- * @param {Object} scope (optional) The scope ( reference) in which the specified function is executed. - * Defaults to the element at the current index - * within the composite. - * @return {CompositeElement} this - */ -}); - -/** - * Selects elements based on the passed CSS selector to enable {@link Ext.Element Element} methods - * to be applied to many related elements in one statement through the returned {@link Ext.CompositeElement CompositeElement} or - * {@link Ext.CompositeElementLite CompositeElementLite} object. - * @param {String/Array} selector The CSS selector or an array of elements - * @param {Boolean} unique (optional) true to create a unique Ext.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 Ext.Element - * @method select - */ -Ext.Element.select = function(selector, unique, root){ - var els; - if(typeof selector == "string"){ - els = Ext.Element.selectorFunction(selector, root); - }else if(selector.length !== undefined){ - els = selector; - }else{ - throw "Invalid selector"; - } - - return (unique === true) ? new Ext.CompositeElement(els) : new Ext.CompositeElementLite(els); -}; - -/** - * Selects elements based on the passed CSS selector to enable {@link Ext.Element Element} methods - * to be applied to many related elements in one statement through the returned {@link Ext.CompositeElement CompositeElement} or - * {@link Ext.CompositeElementLite CompositeElementLite} object. - * @param {String/Array} selector The CSS selector or an array of elements - * @param {Boolean} unique (optional) true to create a unique Ext.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 Ext - * @method select - */ -Ext.select = Ext.Element.select; \ No newline at end of file diff --git a/assets/js/ext/src/core/CompositeElementLite-more.js b/assets/js/ext/src/core/CompositeElementLite-more.js deleted file mode 100644 index ade6ddd..0000000 --- a/assets/js/ext/src/core/CompositeElementLite-more.js +++ /dev/null @@ -1,75 +0,0 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.com/license - */ -/** - * @class Ext.CompositeElementLite - */ -Ext.apply(Ext.CompositeElementLite.prototype, { - addElements : function(els, root){ - if(!els){ - return this; - } - if(typeof els == "string"){ - els = Ext.Element.selectorFunction(els, root); - } - var yels = this.elements; - Ext.each(els, function(e) { - yels.push(Ext.get(e)); - }); - return this; - }, - - /** - * Returns the first Element - * @return {Ext.Element} - */ - first : function(){ - return this.item(0); - }, - - /** - * Returns the last Element - * @return {Ext.Element} - */ - last : function(){ - return this.item(this.getCount()-1); - }, - - /** - * Returns true if this composite contains the passed element - * @param el {Mixed} The id of an element, or an Ext.Element, or an HtmlElement to find within the composite collection. - * @return Boolean - */ - contains : function(el){ - return this.indexOf(el) != -1; - }, - - /** - * 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(keys, removeDom){ - var me = this, - els = this.elements, - el; - Ext.each(keys, function(val){ - if ((el = (els[val] || els[val = me.indexOf(val)]))) { - if(removeDom){ - if(el.dom){ - el.remove(); - }else{ - Ext.removeNode(el); - } - } - els.splice(val, 1); - } - }); - return this; - } -}); diff --git a/assets/js/ext/src/core/DomHelper-more.js b/assets/js/ext/src/core/DomHelper-more.js deleted file mode 100644 index c040124..0000000 --- a/assets/js/ext/src/core/DomHelper-more.js +++ /dev/null @@ -1,154 +0,0 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.com/license - */ -/** - * @class Ext.DomHelper - */ -Ext.apply(Ext.DomHelper, -function(){ - var pub, - afterbegin = 'afterbegin', - afterend = 'afterend', - beforebegin = 'beforebegin', - beforeend = 'beforeend', - confRe = /tag|children|cn|html$/i; - - // private - function doInsert(el, o, returnElement, pos, sibling, append){ - el = Ext.getDom(el); - var newNode; - if (pub.useDom) { - newNode = createDom(o, null); - if (append) { - el.appendChild(newNode); - } else { - (sibling == 'firstChild' ? el : el.parentNode).insertBefore(newNode, el[sibling] || el); - } - } else { - newNode = Ext.DomHelper.insertHtml(pos, el, Ext.DomHelper.createHtml(o)); - } - return returnElement ? Ext.get(newNode, true) : newNode; - } - - // build as dom - /** @ignore */ - function createDom(o, parentNode){ - var el, - doc = document, - useSet, - attr, - val, - cn; - - if (Ext.isArray(o)) { // Allow Arrays of siblings to be inserted - el = doc.createDocumentFragment(); // in one shot using a DocumentFragment - for (var i = 0, l = o.length; i < l; i++) { - createDom(o[i], el); - } - } else if (typeof o == 'string') { // Allow a string as a child spec. - el = doc.createTextNode(o); - } else { - el = doc.createElement( o.tag || 'div' ); - useSet = !!el.setAttribute; // In IE some elements don't have setAttribute - for (var attr in o) { - if(!confRe.test(attr)){ - val = o[attr]; - if(attr == 'cls'){ - el.className = val; - }else{ - if(useSet){ - el.setAttribute(attr, val); - }else{ - el[attr] = val; - } - } - } - } - Ext.DomHelper.applyStyles(el, o.style); - - if ((cn = o.children || o.cn)) { - createDom(cn, el); - } else if (o.html) { - el.innerHTML = o.html; - } - } - if(parentNode){ - parentNode.appendChild(el); - } - return el; - } - - pub = { - /** - * Creates a new Ext.Template from the DOM object spec. - * @param {Object} o The DOM object spec (and children) - * @return {Ext.Template} The new template - */ - createTemplate : function(o){ - var html = Ext.DomHelper.createHtml(o); - return new Ext.Template(html); - }, - - /** True to force the use of DOM instead of html fragments @type Boolean */ - useDom : false, - - /** - * Creates new DOM element(s) and inserts them before el. - * @param {Mixed} 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 Ext.Element - * @return {HTMLElement/Ext.Element} The new node - * @hide (repeat) - */ - insertBefore : function(el, o, returnElement){ - return doInsert(el, o, returnElement, beforebegin); - }, - - /** - * Creates new DOM element(s) and inserts them after el. - * @param {Mixed} el The context element - * @param {Object} o The DOM object spec (and children) - * @param {Boolean} returnElement (optional) true to return a Ext.Element - * @return {HTMLElement/Ext.Element} The new node - * @hide (repeat) - */ - insertAfter : function(el, o, returnElement){ - return doInsert(el, o, returnElement, afterend, 'nextSibling'); - }, - - /** - * Creates new DOM element(s) and inserts them as the first child of el. - * @param {Mixed} 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 Ext.Element - * @return {HTMLElement/Ext.Element} The new node - * @hide (repeat) - */ - insertFirst : function(el, o, returnElement){ - return doInsert(el, o, returnElement, afterbegin, 'firstChild'); - }, - - /** - * Creates new DOM element(s) and appends them to el. - * @param {Mixed} 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 Ext.Element - * @return {HTMLElement/Ext.Element} The new node - * @hide (repeat) - */ - append: function(el, o, returnElement){ - return doInsert(el, o, returnElement, beforeend, '', true); - }, - - /** - * Creates new DOM element(s) without inserting them to the document. - * @param {Object/String} o The DOM object spec (and children) or raw HTML blob - * @return {HTMLElement} The new uninserted node - */ - createDom: createDom - }; - return pub; -}()); diff --git a/assets/js/ext/src/core/Element-more.js b/assets/js/ext/src/core/Element-more.js deleted file mode 100644 index f0f2220..0000000 --- a/assets/js/ext/src/core/Element-more.js +++ /dev/null @@ -1,200 +0,0 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.com/license - */ -/** - * @class Ext.Element - */ -Ext.Element.addMethods({ - /** - * Stops the specified event(s) from bubbling and optionally prevents the default action - * @param {String/Array} eventName an event / array of events to stop from bubbling - * @param {Boolean} preventDefault (optional) true to prevent the default action too - * @return {Ext.Element} this - */ - swallowEvent : function(eventName, preventDefault) { - var me = this; - function fn(e) { - e.stopPropagation(); - if (preventDefault) { - e.preventDefault(); - } - } - - if (Ext.isArray(eventName)) { - Ext.each(eventName, function(e) { - me.on(e, fn); - }); - return me; - } - me.on(eventName, fn); - return me; - }, - - /** - * Create an event handler on this element such that when the event fires and is handled by this element, - * it will be relayed to another object (i.e., fired again as if it originated from that object instead). - * @param {String} eventName The type of event to relay - * @param {Object} object Any object that extends {@link Ext.util.Observable} that will provide the context - * for firing the relayed event - */ - relayEvent : function(eventName, observable) { - this.on(eventName, function(e) { - observable.fireEvent(eventName, e); - }); - }, - - /** - * 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) { - var me = this, - dom = me.dom, - n = dom.firstChild, - ni = -1; - - if (Ext.Element.data(dom, 'isCleaned') && forceReclean !== true) { - return me; - } - - while (n) { - var nx = n.nextSibling; - if (n.nodeType == 3 && !(/\S/.test(n.nodeValue))) { - dom.removeChild(n); - } else { - n.nodeIndex = ++ni; - } - n = nx; - } - - Ext.Element.data(dom, 'isCleaned', true); - return me; - }, - - /** - * Direct access to the Updater {@link Ext.Updater#update} method. The method takes the same object - * parameter as {@link Ext.Updater#update} - * @return {Ext.Element} this - */ - load : function() { - var updateManager = this.getUpdater(); - updateManager.update.apply(updateManager, arguments); - - return this; - }, - - /** - * Gets this element's {@link Ext.Updater Updater} - * @return {Ext.Updater} The Updater - */ - getUpdater : function() { - return this.updateManager || (this.updateManager = new Ext.Updater(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 (defaults to false) - * @param {Function} callback (optional) For async script loading you can be notified when the update completes - * @return {Ext.Element} this - */ - update : function(html, loadScripts, callback) { - if (!this.dom) { - return this; - } - html = html || ""; - - if (loadScripts !== true) { - this.dom.innerHTML = html; - if (typeof callback == 'function') { - callback(); - } - return this; - } - - var id = Ext.id(), - dom = this.dom; - - html += ''; - - Ext.lib.Event.onAvailable(id, function() { - var DOC = document, - hd = DOC.getElementsByTagName("head")[0], - re = /(?:]*)?>)((\n|\r|.)*?)(?:<\/script>)/ig, - srcRe = /\ssrc=([\'\"])(.*?)\1/i, - typeRe = /\stype=([\'\"])(.*?)\1/i, - match, - attrs, - srcMatch, - typeMatch, - el, - s; - - while ((match = re.exec(html))) { - attrs = match[1]; - srcMatch = attrs ? attrs.match(srcRe) : false; - if (srcMatch && srcMatch[2]) { - s = DOC.createElement("script"); - s.src = srcMatch[2]; - 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 { - window.eval(match[2]); - } - } - } - - el = DOC.getElementById(id); - if (el) { - Ext.removeNode(el); - } - - if (typeof callback == 'function') { - callback(); - } - }); - dom.innerHTML = html.replace(/(?:)((\n|\r|.)*?)(?:<\/script>)/ig, ""); - return this; - }, - - // inherit docs, overridden so we can add removeAnchor - removeAllListeners : function() { - this.removeAnchor(); - Ext.EventManager.removeAll(this.dom); - return this; - }, - - /** - * 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 {Ext.Element} The new proxy element - */ - createProxy : function(config, renderTo, matchBox) { - config = (typeof config == 'object') ? config : {tag : "div", cls: config}; - - var me = this, - proxy = renderTo ? Ext.DomHelper.append(renderTo, config, true) : - Ext.DomHelper.insertBefore(me.dom, config, true); - - if (matchBox && me.setBox && me.getBox) { // check to make sure Element.position.js is loaded - proxy.setBox(me.getBox()); - } - return proxy; - } -}); - -Ext.Element.prototype.getUpdateManager = Ext.Element.prototype.getUpdater; diff --git a/assets/js/ext/src/core/Element.alignment.js b/assets/js/ext/src/core/Element.alignment.js deleted file mode 100644 index d9e321c..0000000 --- a/assets/js/ext/src/core/Element.alignment.js +++ /dev/null @@ -1,417 +0,0 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.com/license - */ -/** - * @class Ext.Element - */ -Ext.Element.addMethods({ - /** - * 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 {Boolean} local (optional) True to get the local (element top/left-relative) anchor position instead - * of page coordinates - * @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) - * @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. - anchor = (anchor || "tl").toLowerCase(); - s = s || {}; - - var me = this, - vp = me.dom == document.body || me.dom == document, - w = s.width || vp ? Ext.lib.Dom.getViewWidth() : me.getWidth(), - h = s.height || vp ? Ext.lib.Dom.getViewHeight() : me.getHeight(), - xy, - r = Math.round, - o = me.getXY(), - scroll = me.getScroll(), - extraX = vp ? scroll.left : !local ? o[0] : 0, - extraY = vp ? scroll.top : !local ? o[1] : 0, - hash = { - c : [r(w * 0.5), r(h * 0.5)], - t : [r(w * 0.5), 0], - l : [0, r(h * 0.5)], - r : [w, r(h * 0.5)], - b : [r(w * 0.5), h], - tl : [0, 0], - bl : [0, h], - br : [w, h], - tr : [w, 0] - }; - - xy = hash[anchor]; - return [xy[0] + extraX, xy[1] + extraY]; - }, - - /** - * Anchors an element to another element and realigns it when the window is resized. - * @param {Mixed} 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 {Ext.Element} this - */ - anchorTo : function(el, alignment, offsets, animate, monitorScroll, callback){ - var me = this, - dom = me.dom, - scroll = !Ext.isEmpty(monitorScroll), - action = function(){ - Ext.fly(dom).alignTo(el, alignment, offsets, animate); - Ext.callback(callback, Ext.fly(dom)); - }, - anchor = this.getAnchor(); - - // previous listener anchor, remove it - this.removeAnchor(); - Ext.apply(anchor, { - fn: action, - scroll: scroll - }); - - Ext.EventManager.onWindowResize(action, null); - - if(scroll){ - Ext.EventManager.on(window, 'scroll', action, null, - {buffer: !isNaN(monitorScroll) ? monitorScroll : 50}); - } - action.call(me); // align immediately - return me; - }, - - /** - * Remove any anchor to this element. See {@link #anchorTo}. - * @return {Ext.Element} this - */ - removeAnchor : function(){ - var me = this, - anchor = this.getAnchor(); - - if(anchor && anchor.fn){ - Ext.EventManager.removeResizeListener(anchor.fn); - if(anchor.scroll){ - Ext.EventManager.un(window, 'scroll', anchor.fn); - } - delete anchor.fn; - } - return me; - }, - - // private - getAnchor : function(){ - var data = Ext.Element.data, - dom = this.dom; - if (!dom) { - return; - } - var anchor = data(dom, '_anchor'); - - if(!anchor){ - anchor = data(dom, '_anchor', {}); - } - return anchor; - }, - - /** - * Gets the x,y coordinates to align this element with another element. See {@link #alignTo} for more info on the - * supported position values. - * @param {Mixed} element The element to align to. - * @param {String} position (optional, defaults to "tl-bl?") 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 = Ext.get(el); - - if(!el || !el.dom){ - throw "Element.alignToXY with an element that doesn't exist"; - } - - o = o || [0,0]; - p = (!p || p == "?" ? "tl-bl?" : (!(/-/).test(p) && p !== "" ? "tl-" + p : p || "tl-bl")).toLowerCase(); - - var me = this, - d = me.dom, - a1, - a2, - x, - y, - //constrain the aligned el to viewport if necessary - w, - h, - r, - dw = Ext.lib.Dom.getViewWidth() -10, // 10px of margin for ie - dh = Ext.lib.Dom.getViewHeight()-10, // 10px of margin for ie - p1y, - p1x, - p2y, - p2x, - swapY, - swapX, - doc = document, - docElement = doc.documentElement, - docBody = doc.body, - scrollX = (docElement.scrollLeft || docBody.scrollLeft || 0)+5, - scrollY = (docElement.scrollTop || docBody.scrollTop || 0)+5, - c = false, //constrain to viewport - p1 = "", - p2 = "", - 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 - a1 = me.getAnchorXY(p1, true); - a2 = el.getAnchorXY(p2, false); - - x = a2[0] - a1[0] + o[0]; - y = a2[1] - a1[1] + o[1]; - - if(c){ - w = me.getWidth(); - h = me.getHeight(); - r = el.getRegion(); - //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. - p1y = p1.charAt(0); - p1x = p1.charAt(p1.length-1); - p2y = p2.charAt(0); - p2x = p2.charAt(p2.length-1); - swapY = ((p1y=="t" && p2y=="b") || (p1y=="b" && p2y=="t")); - swapX = ((p1x=="r" && p2x=="l") || (p1x=="l" && p2x=="r")); - - - 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]; - }, - - /** - * 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: - *
    - *
  • Blank: Defaults to aligning the element's top-left corner to the target's bottom-left corner ("tl-bl").
  • - *
  • One anchor (deprecated): 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. This method has been - * deprecated in favor of the newer two anchor syntax below.
  • - *
  • Two anchors: 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.
  • - *
- * 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: -
-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
-
-Example Usage: -

-// 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]);
-
- * @param {Mixed} element The element to align to. - * @param {String} position (optional, defaults to "tl-bl?") 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 {Ext.Element} this - */ - alignTo : function(element, position, offsets, animate){ - var me = this; - return me.setXY(me.getAlignToXY(element, position, offsets), - me.preanim && !!animate ? me.preanim(arguments, 3) : false); - }, - - // private ==> used outside of core - adjustForConstraints : function(xy, parent, offsets){ - return this.getConstrainToXY(parent || document, false, offsets, xy) || xy; - }, - - // private ==> used outside of core - getConstrainToXY : function(el, local, offsets, proposedXY){ - var os = {top:0, left:0, bottom:0, right: 0}; - - return function(el, local, offsets, proposedXY){ - el = Ext.get(el); - offsets = offsets ? Ext.applyIf(offsets, os) : os; - - var vw, vh, vx = 0, vy = 0; - if(el.dom == document.body || el.dom == document){ - vw =Ext.lib.Dom.getViewWidth(); - vh = Ext.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, - vb = vy + vh, - xy = proposedXY || (!local ? this.getXY() : [this.getLeft(true), this.getTop(true)]), - x = xy[0], y = xy[1], - offset = this.getConstrainOffset(), - w = this.dom.offsetWidth + offset, - h = this.dom.offsetHeight + offset; - - // 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; - }; - }(), - - - -// el = Ext.get(el); -// offsets = Ext.applyIf(offsets || {}, {top : 0, left : 0, bottom : 0, right : 0}); - -// var me = this, -// doc = document, -// s = el.getScroll(), -// vxy = el.getXY(), -// vx = offsets.left + s.left, -// vy = offsets.top + s.top, -// vw = -offsets.right, -// vh = -offsets.bottom, -// vr, -// vb, -// xy = proposedXY || (!local ? me.getXY() : [me.getLeft(true), me.getTop(true)]), -// x = xy[0], -// y = xy[1], -// w = me.dom.offsetWidth, h = me.dom.offsetHeight, -// moved = false; // only move it if it needs it -// -// -// if(el.dom == doc.body || el.dom == doc){ -// vw += Ext.lib.Dom.getViewWidth(); -// vh += Ext.lib.Dom.getViewHeight(); -// }else{ -// vw += el.dom.clientWidth; -// vh += el.dom.clientHeight; -// if(!local){ -// vx += vxy[0]; -// vy += vxy[1]; -// } -// } - -// // first validate right/bottom -// if(x + w > vx + vw){ -// x = vx + vw - w; -// moved = true; -// } -// if(y + h > vy + vh){ -// y = vy + vh - 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, used internally - getConstrainOffset : function(){ - return 0; - }, - - /** - * 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 {Mixed} centerIn (optional) The element in which to center the element. - */ - center : function(centerIn){ - return this.alignTo(centerIn || document, 'c-c'); - } -}); diff --git a/assets/js/ext/src/core/Element.dd.js b/assets/js/ext/src/core/Element.dd.js deleted file mode 100644 index e3bceff..0000000 --- a/assets/js/ext/src/core/Element.dd.js +++ /dev/null @@ -1,46 +0,0 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.com/license - */ -/** - * @class Ext.Element - */ -Ext.Element.addMethods({ - /** - * Initializes a {@link Ext.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 {Ext.dd.DD} The DD object - */ - initDD : function(group, config, overrides){ - var dd = new Ext.dd.DD(Ext.id(this.dom), group, config); - return Ext.apply(dd, overrides); - }, - - /** - * Initializes a {@link Ext.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 {Ext.dd.DDProxy} The DDProxy object - */ - initDDProxy : function(group, config, overrides){ - var dd = new Ext.dd.DDProxy(Ext.id(this.dom), group, config); - return Ext.apply(dd, overrides); - }, - - /** - * Initializes a {@link Ext.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 {Ext.dd.DDTarget} The DDTarget object - */ - initDDTarget : function(group, config, overrides){ - var dd = new Ext.dd.DDTarget(Ext.id(this.dom), group, config); - return Ext.apply(dd, overrides); - } -}); \ No newline at end of file diff --git a/assets/js/ext/src/core/Element.fx-more.js b/assets/js/ext/src/core/Element.fx-more.js deleted file mode 100644 index c201e71..0000000 --- a/assets/js/ext/src/core/Element.fx-more.js +++ /dev/null @@ -1,162 +0,0 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.com/license - */ -/** - * @class Ext.Element - */ -Ext.Element.addMethods( - function() { - var VISIBILITY = "visibility", - DISPLAY = "display", - HIDDEN = "hidden", - NONE = "none", - XMASKED = "x-masked", - XMASKEDRELATIVE = "x-masked-relative", - data = Ext.Element.data; - - return { - /** - * 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.isStyle(VISIBILITY, HIDDEN) && !this.isStyle(DISPLAY, NONE), - p = this.dom.parentNode; - - if (deep !== true || !vis) { - return vis; - } - - while (p && !(/^body/i.test(p.tagName))) { - if (!Ext.fly(p, '_isVisible').isVisible()) { - return false; - } - p = p.parentNode; - } - return true; - }, - - /** - * Returns true if display is not "none" - * @return {Boolean} - */ - isDisplayed : function() { - return !this.isStyle(DISPLAY, NONE); - }, - - /** - * Convenience method for setVisibilityMode(Element.DISPLAY) - * @param {String} display (optional) What to set display to when visible - * @return {Ext.Element} this - */ - enableDisplayMode : function(display) { - this.setVisibilityMode(Ext.Element.DISPLAY); - - if (!Ext.isEmpty(display)) { - data(this.dom, 'originalDisplay', display); - } - - return this; - }, - - /** - * 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) { - var me = this, - dom = me.dom, - dh = Ext.DomHelper, - EXTELMASKMSG = "ext-el-mask-msg", - el, - mask; - - if (!(/^body/i.test(dom.tagName) && me.getStyle('position') == 'static')) { - me.addClass(XMASKEDRELATIVE); - } - if (el = data(dom, 'maskMsg')) { - el.remove(); - } - if (el = data(dom, 'mask')) { - el.remove(); - } - - mask = dh.append(dom, {cls : "ext-el-mask"}, true); - data(dom, 'mask', mask); - - me.addClass(XMASKED); - mask.setDisplayed(true); - - if (typeof msg == 'string') { - var mm = dh.append(dom, {cls : EXTELMASKMSG, cn:{tag:'div'}}, true); - data(dom, 'maskMsg', mm); - mm.dom.className = msgCls ? EXTELMASKMSG + " " + msgCls : EXTELMASKMSG; - mm.dom.firstChild.innerHTML = msg; - mm.setDisplayed(true); - mm.center(me); - } - - // ie will not expand full height automatically - if (Ext.isIE && !(Ext.isIE7 && Ext.isStrict) && me.getStyle('height') == 'auto') { - mask.setSize(undefined, me.getHeight()); - } - - return mask; - }, - - /** - * Removes a previously applied mask. - */ - unmask : function() { - var me = this, - dom = me.dom, - mask = data(dom, 'mask'), - maskMsg = data(dom, 'maskMsg'); - - if (mask) { - if (maskMsg) { - maskMsg.remove(); - data(dom, 'maskMsg', undefined); - } - - mask.remove(); - data(dom, 'mask', undefined); - me.removeClass([XMASKED, XMASKEDRELATIVE]); - } - }, - - /** - * Returns true if this element is masked - * @return {Boolean} - */ - isMasked : function() { - var m = data(this.dom, 'mask'); - return m && m.isVisible(); - }, - - /** - * Creates an iframe shim for this element to keep selects and other windowed objects from - * showing through. - * @return {Ext.Element} The new shim element - */ - createShim : function() { - var el = document.createElement('iframe'), - shim; - - el.frameBorder = '0'; - el.className = 'ext-shim'; - el.src = Ext.SSL_SECURE_URL; - shim = Ext.get(this.dom.parentNode.insertBefore(el, this.dom)); - shim.autoBoxAdjust = false; - return shim; - } - }; - }() -); \ No newline at end of file diff --git a/assets/js/ext/src/core/Element.insertion-more.js b/assets/js/ext/src/core/Element.insertion-more.js deleted file mode 100644 index 82820b9..0000000 --- a/assets/js/ext/src/core/Element.insertion-more.js +++ /dev/null @@ -1,57 +0,0 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.com/license - */ -/** - * @class Ext.Element - */ -Ext.apply(Ext.Element.prototype, function() { - var GETDOM = Ext.getDom, - GET = Ext.get, - DH = Ext.DomHelper; - - return { - /** - * Inserts (or creates) the passed element (or DomHelper config) as a sibling of this element - * @param {Mixed/Object/Array} el The id, element to insert or a DomHelper config to create and insert *or* an array of any of those. - * @param {String} where (optional) 'before' or 'after' defaults to before - * @param {Boolean} returnDom (optional) True to return the raw DOM element instead of Ext.Element - * @return {Ext.Element} The inserted Element. If an array is passed, the last inserted element is returned. - */ - insertSibling: function(el, where, returnDom){ - var me = this, - rt, - isAfter = (where || 'before').toLowerCase() == 'after', - insertEl; - - if(Ext.isArray(el)){ - insertEl = me; - Ext.each(el, function(e) { - rt = Ext.fly(insertEl, '_internal').insertSibling(e, where, returnDom); - if(isAfter){ - insertEl = rt; - } - }); - return rt; - } - - el = el || {}; - - if(el.nodeType || el.dom){ - rt = me.dom.parentNode.insertBefore(GETDOM(el), isAfter ? me.dom.nextSibling : me.dom); - if (!returnDom) { - rt = GET(rt); - } - }else{ - if (isAfter && !me.dom.nextSibling) { - rt = DH.append(me.dom.parentNode, el, !returnDom); - } else { - rt = DH[isAfter ? 'insertAfter' : 'insertBefore'](me.dom, el, !returnDom); - } - } - return rt; - } - }; -}()); \ No newline at end of file diff --git a/assets/js/ext/src/core/Element.keys.js b/assets/js/ext/src/core/Element.keys.js deleted file mode 100644 index b6f020b..0000000 --- a/assets/js/ext/src/core/Element.keys.js +++ /dev/null @@ -1,52 +0,0 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.com/license - */ -/** - * @class Ext.Element - */ -Ext.Element.addMethods({ - /** - * 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 (this reference) in which the specified function is executed. Defaults to this Element. - * @return {Ext.KeyMap} The KeyMap created - */ - addKeyListener : function(key, fn, scope){ - var config; - if(typeof key != 'object' || Ext.isArray(key)){ - 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 Ext.KeyMap(this, config); - }, - - /** - * Creates a KeyMap for this element - * @param {Object} config The KeyMap config. See {@link Ext.KeyMap} for more details - * @return {Ext.KeyMap} The KeyMap created - */ - addKeyMap : function(config){ - return new Ext.KeyMap(this, config); - } -}); - -//Import the newly-added Ext.Element functions into CompositeElementLite. We call this here because -//Element.keys.js is the last extra Ext.Element include in the ext-all.js build -Ext.CompositeElementLite.importElementMethods(); \ No newline at end of file diff --git a/assets/js/ext/src/core/Element.position-more.js b/assets/js/ext/src/core/Element.position-more.js deleted file mode 100644 index ccafe0d..0000000 --- a/assets/js/ext/src/core/Element.position-more.js +++ /dev/null @@ -1,176 +0,0 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.com/license - */ -/** - * @class Ext.Element - */ -Ext.Element.addMethods({ - /** - * 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 {Ext.Element} this - */ - setBox : function(box, adjust, animate){ - var me = this, - w = box.width, - h = box.height; - if((adjust && !me.autoBoxAdjust) && !me.isBorderBox()){ - w -= (me.getBorderWidth("lr") + me.getPadding("lr")); - h -= (me.getBorderWidth("tb") + me.getPadding("tb")); - } - me.setBounds(box.x, box.y, w, h, me.animTest.call(me, arguments, animate, 2)); - return me; - }, - - /** - * Return an object defining the area of this Element which can be passed to {@link #setBox} to - * set another Element's 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: <Element's X position>,
-    y: <Element's Y position>,
-    width: <Element's width>,
-    height: <Element's height>,
-    bottom: <Element's lower bound>,
-    right: <Element's rightmost bound>
-}
-
- * The returned object may also be addressed as an Array where index 0 contains the X position - * and index 1 contains the Y position. So the result may also be used for {@link #setXY} - */ - getBox : function(contentBox, local) { - var me = this, - xy, - left, - top, - getBorderWidth = me.getBorderWidth, - getPadding = me.getPadding, - l, - r, - t, - b; - if(!local){ - xy = me.getXY(); - }else{ - left = parseInt(me.getStyle("left"), 10) || 0; - top = parseInt(me.getStyle("top"), 10) || 0; - xy = [left, top]; - } - var el = me.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{ - l = getBorderWidth.call(me, "l") + getPadding.call(me, "l"); - r = getBorderWidth.call(me, "r") + getPadding.call(me, "r"); - t = getBorderWidth.call(me, "t") + getPadding.call(me, "t"); - b = getBorderWidth.call(me, "b") + getPadding.call(me, "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; - }, - - /** - * Move this element relative to its current position. - * @param {String} direction Possible values are: "l" (or "left"), "r" (or "right"), "t" (or "top", or "up"), "b" (or "bottom", or "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 {Ext.Element} this - */ - move : function(direction, distance, animate){ - var me = this, - xy = me.getXY(), - x = xy[0], - y = xy[1], - left = [x - distance, y], - right = [x + distance, y], - top = [x, y - distance], - bottom = [x, y + distance], - hash = { - l : left, - left : left, - r : right, - right : right, - t : top, - top : top, - up : top, - b : bottom, - bottom : bottom, - down : bottom - }; - - direction = direction.toLowerCase(); - me.moveTo(hash[direction][0], hash[direction][1], me.animTest.call(me, arguments, animate, 2)); - }, - - /** - * 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 {Ext.Element} this - */ - setLeftTop : function(left, top){ - var me = this, - style = me.dom.style; - style.left = me.addUnits(left); - style.top = me.addUnits(top); - return me; - }, - - /** - * 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 Ext.lib.Region containing "top, left, bottom, right" member data. - */ - getRegion : function(){ - return Ext.lib.Dom.getRegion(this.dom); - }, - - /** - * 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 {Mixed} width The new width. This may be one of:
    - *
  • A Number specifying the new width in this Element's {@link #defaultUnit}s (by default, pixels)
  • - *
  • A String used to set the CSS width style. Animation may not be used. - *
- * @param {Mixed} height The new height. This may be one of:
    - *
  • A Number specifying the new height in this Element's {@link #defaultUnit}s (by default, pixels)
  • - *
  • A String used to set the CSS height style. Animation may not be used.
  • - *
- * @param {Boolean/Object} animate (optional) true for the default animation or a standard Element animation config object - * @return {Ext.Element} this - */ - setBounds : function(x, y, width, height, animate){ - var me = this; - if (!animate || !me.anim) { - me.setSize(width, height); - me.setLocation(x, y); - } else { - me.anim({points: {to: [x, y]}, - width: {to: me.adjustWidth(width)}, - height: {to: me.adjustHeight(height)}}, - me.preanim(arguments, 4), - 'motion'); - } - return me; - }, - - /** - * Sets the element's position and size the specified region. If animation is true then width, height, x and y will be animated concurrently. - * @param {Ext.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 {Ext.Element} this - */ - setRegion : function(region, animate) { - return this.setBounds(region.left, region.top, region.right-region.left, region.bottom-region.top, this.animTest.call(this, arguments, animate, 1)); - } -}); \ No newline at end of file diff --git a/assets/js/ext/src/core/Element.scroll-more.js b/assets/js/ext/src/core/Element.scroll-more.js deleted file mode 100644 index c3acb02..0000000 --- a/assets/js/ext/src/core/Element.scroll-more.js +++ /dev/null @@ -1,118 +0,0 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.com/license - */ -/** - * @class Ext.Element - */ -Ext.Element.addMethods({ - /** - * 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) { - //check if we're scrolling top or left - var top = /top/i.test(side), - me = this, - dom = me.dom, - prop; - if (!animate || !me.anim) { - // just setting the value, so grab the direction - prop = 'scroll' + (top ? 'Top' : 'Left'); - dom[prop] = value; - } - else { - // if scrolling top, we need to grab scrollLeft, if left, scrollTop - prop = 'scroll' + (top ? 'Left' : 'Top'); - me.anim({scroll: {to: top ? [dom[prop], value] : [value, dom[prop]]}}, me.preanim(arguments, 2), 'scroll'); - } - return me; - }, - - /** - * Scrolls this element into view within the passed container. - * @param {Mixed} container (optional) The container element to scroll (defaults to document.body). Should be a - * string (id), dom node, or Ext.Element. - * @param {Boolean} hscroll (optional) False to disable horizontal scroll (defaults to true) - * @return {Ext.Element} this - */ - scrollIntoView : function(container, hscroll) { - var c = Ext.getDom(container) || Ext.getBody().dom, - el = this.dom, - o = this.getOffsetsTo(c), - l = o[0] + c.scrollLeft, - t = o[1] + c.scrollTop, - b = t + el.offsetHeight, - r = l + el.offsetWidth, - ch = c.clientHeight, - ct = parseInt(c.scrollTop, 10), - cl = parseInt(c.scrollLeft, 10), - cb = ct + ch, - cr = cl + c.clientWidth; - - if (el.offsetHeight > ch || t < ct) { - c.scrollTop = t; - } - else if (b > cb) { - c.scrollTop = b-ch; - } - // corrects IE, other browsers will ignore - c.scrollTop = c.scrollTop; - - if (hscroll !== false) { - if (el.offsetWidth > c.clientWidth || l < cl) { - c.scrollLeft = l; - } - else if (r > cr) { - c.scrollLeft = r - c.clientWidth; - } - c.scrollLeft = c.scrollLeft; - } - return this; - }, - - // private - scrollChildIntoView : function(child, hscroll) { - Ext.fly(child, '_scrollChildIntoView').scrollIntoView(this, hscroll); - }, - - /** - * 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" (or "left"), "r" (or "right"), "t" (or "top", or "up"), "b" (or "bottom", or "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 false; - } - var el = this.dom, - l = el.scrollLeft, t = el.scrollTop, - w = el.scrollWidth, h = el.scrollHeight, - cw = el.clientWidth, ch = el.clientHeight, - scrolled = false, v, - hash = { - l: Math.min(l + distance, w-cw), - r: v = Math.max(l - distance, 0), - t: Math.max(t - distance, 0), - b: Math.min(t + distance, h-ch) - }; - hash.d = hash.b; - hash.u = hash.t; - - direction = direction.substr(0, 1); - if ((v = hash[direction]) > -1) { - scrolled = true; - this.scrollTo(direction == 'l' || direction == 'r' ? 'left' : 'top', v, this.preanim(arguments, 2)); - } - return scrolled; - } -}); \ No newline at end of file diff --git a/assets/js/ext/src/core/Element.style-more.js b/assets/js/ext/src/core/Element.style-more.js deleted file mode 100644 index 3de1b61..0000000 --- a/assets/js/ext/src/core/Element.style-more.js +++ /dev/null @@ -1,360 +0,0 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.com/license - */ -/** - * @class Ext.Element - */ - -// special markup used throughout Ext when box wrapping elements -Ext.Element.boxMarkup = '
'; - -Ext.Element.addMethods(function(){ - var INTERNAL = "_internal", - pxMatch = /(\d+\.?\d+)px/; - return { - /** - * 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 {Ext.Element} this - */ - applyStyles : function(style){ - Ext.DomHelper.applyStyles(this.dom, style); - 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 ret = {}; - Ext.each(arguments, function(v) { - ret[v] = this.getStyle(v); - }, - this); - return ret; - }, - - // private ==> used by ext full - setOverflow : function(v){ - var dom = this.dom; - if(v=='auto' && Ext.isMac && Ext.isGecko2){ // work around stupid FF 2.0/Mac scroll bar bug - dom.style.overflow = 'hidden'; - (function(){dom.style.overflow = 'auto';}).defer(1); - }else{ - dom.style.overflow = v; - } - }, - - /** - *

Wraps the specified element with a special 9 element markup/CSS block that renders by default as - * a gray container with a gradient background, rounded corners and a 4-way shadow.

- *

This special markup is used throughout Ext when box wrapping elements ({@link Ext.Button}, - * {@link Ext.Panel} when {@link Ext.Panel#frame frame=true}, {@link Ext.Window}). The markup - * is of this form:

- *

-    Ext.Element.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>';
-        * 
- *

Example usage:

- *

-    // Basic box wrap
-    Ext.get("foo").boxWrap();
-
-    // You can also add a custom class and use CSS inheritance rules to customize the box look.
-    // 'x-box-blue' is a built-in alternative -- look at the related CSS definitions as an example
-    // for how to create a custom box wrap style.
-    Ext.get("foo").boxWrap().addClass("x-box-blue");
-        * 
- * @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 {Ext.Element} The outermost wrapping element of the created box structure. - */ - boxWrap : function(cls){ - cls = cls || 'x-box'; - var el = Ext.get(this.insertHtml("beforeBegin", "
" + String.format(Ext.Element.boxMarkup, cls) + "
")); //String.format('
'+Ext.Element.boxMarkup+'
', cls))); - Ext.DomQuery.selectNode('.' + cls + '-mc', el.dom).appendChild(this.dom); - return el; - }, - - /** - * Set the size of this Element. If animation is true, both width and height will be animated concurrently. - * @param {Mixed} width The new width. This may be one of:
    - *
  • A Number specifying the new width in this Element's {@link #defaultUnit}s (by default, pixels).
  • - *
  • A String used to set the CSS width style. Animation may not be used. - *
  • A size object in the format {width: widthValue, height: heightValue}.
  • - *
- * @param {Mixed} height The new height. This may be one of:
    - *
  • A Number specifying the new height in this Element's {@link #defaultUnit}s (by default, pixels).
  • - *
  • A String used to set the CSS height style. Animation may not be used.
  • - *
- * @param {Boolean/Object} animate (optional) true for the default animation or a standard Element animation config object - * @return {Ext.Element} this - */ - setSize : function(width, height, animate){ - var me = this; - if(typeof width == 'object'){ // in case of object from getSize() - height = width.height; - width = width.width; - } - width = me.adjustWidth(width); - height = me.adjustHeight(height); - if(!animate || !me.anim){ - me.dom.style.width = me.addUnits(width); - me.dom.style.height = me.addUnits(height); - }else{ - me.anim({width: {to: width}, height: {to: height}}, me.preanim(arguments, 2)); - } - return me; - }, - - /** - * 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 me = this, - h = Math.max(me.dom.offsetHeight, me.dom.clientHeight); - if(!h){ - h = parseFloat(me.getStyle('height')) || 0; - if(!me.isBorderBox()){ - h += me.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 = parseFloat(this.getStyle('width')) || 0; - if(!this.isBorderBox()){ - w += this.getFrameWidth('lr'); - } - } - return w; - }, - - /** - * 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 && this.isBorderBox() ? 0 : (this.getPadding(sides) + this.getBorderWidth(sides)); - }, - - /** - * Sets up event handlers to add and remove a css class when the mouse is over this element - * @param {String} className - * @return {Ext.Element} this - */ - addClassOnOver : function(className){ - this.hover( - function(){ - Ext.fly(this, INTERNAL).addClass(className); - }, - function(){ - Ext.fly(this, INTERNAL).removeClass(className); - } - ); - return this; - }, - - /** - * Sets up event handlers to add and remove a css class when this element has the focus - * @param {String} className - * @return {Ext.Element} this - */ - addClassOnFocus : function(className){ - this.on("focus", function(){ - Ext.fly(this, INTERNAL).addClass(className); - }, this.dom); - this.on("blur", function(){ - Ext.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 {Ext.Element} this - */ - addClassOnClick : function(className){ - var dom = this.dom; - this.on("mousedown", function(){ - Ext.fly(dom, INTERNAL).addClass(className); - var d = Ext.getDoc(), - fn = function(){ - Ext.fly(dom, INTERNAL).removeClass(className); - d.removeListener("mouseup", fn); - }; - d.on("mouseup", fn); - }); - return this; - }, - - /** - *

Returns the dimensions of the element available to lay content out in.

- *

If the element (or any ancestor element) has CSS style display : none, the dimensions will be zero.

- * example:

-        var vpSize = Ext.getBody().getViewSize();
-
-        // all Windows created afterwards will have a default value of 90% height and 95% width
-        Ext.Window.override({
-            width: vpSize.width * 0.9,
-            height: vpSize.height * 0.95
-        });
-        // To handle window resizing you would have to hook onto onWindowResize.
-        * 
- * - * getViewSize utilizes clientHeight/clientWidth which excludes sizing of scrollbars. - * To obtain the size including scrollbars, use getStyleSize - * - * Sizing of the document body is handled at the adapter level which handles special cases for IE and strict modes, etc. - */ - - getViewSize : function(){ - var doc = document, - d = this.dom, - isDoc = (d == doc || d == doc.body); - - // If the body, use Ext.lib.Dom - if (isDoc) { - var extdom = Ext.lib.Dom; - return { - width : extdom.getViewWidth(), - height : extdom.getViewHeight() - }; - - // Else use clientHeight/clientWidth - } else { - return { - width : d.clientWidth, - height : d.clientHeight - }; - } - }, - - /** - *

Returns the dimensions of the element available to lay content out in.

- * - * getStyleSize utilizes prefers style sizing if present, otherwise it chooses the larger of offsetHeight/clientHeight and offsetWidth/clientWidth. - * To obtain the size excluding scrollbars, use getViewSize - * - * Sizing of the document body is handled at the adapter level which handles special cases for IE and strict modes, etc. - */ - - getStyleSize : function(){ - var me = this, - w, h, - doc = document, - d = this.dom, - isDoc = (d == doc || d == doc.body), - s = d.style; - - // If the body, use Ext.lib.Dom - if (isDoc) { - var extdom = Ext.lib.Dom; - return { - width : extdom.getViewWidth(), - height : extdom.getViewHeight() - }; - } - // Use Styles if they are set - if(s.width && s.width != 'auto'){ - w = parseFloat(s.width); - if(me.isBorderBox()){ - w -= me.getFrameWidth('lr'); - } - } - // Use Styles if they are set - if(s.height && s.height != 'auto'){ - h = parseFloat(s.height); - if(me.isBorderBox()){ - h -= me.getFrameWidth('tb'); - } - } - // Use getWidth/getHeight if style not set. - return {width: w || me.getWidth(true), height: h || me.getHeight(true)}; - }, - - /** - * 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)}; - }, - - /** - * Forces the browser to repaint this element - * @return {Ext.Element} this - */ - repaint : function(){ - var dom = this.dom; - this.addClass("x-repaint"); - setTimeout(function(){ - Ext.fly(dom).removeClass("x-repaint"); - }, 1); - return this; - }, - - /** - * Disables text selection for this element (normalized across browsers) - * @return {Ext.Element} this - */ - unselectable : function(){ - this.dom.unselectable = "on"; - return this.swallowEvent("selectstart", true). - applyStyles("-moz-user-select:none;-khtml-user-select:none;"). - addClass("x-unselectable"); - }, - - /** - * 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){ - var me = this, - key, - hash = {t:"top", l:"left", r:"right", b: "bottom"}, - o = {}; - - if (!side) { - for (key in me.margins){ - o[hash[key]] = parseFloat(me.getStyle(me.margins[key])) || 0; - } - return o; - } else { - return me.addStyles.call(me, side, me.margins); - } - } - }; -}()); diff --git a/assets/js/ext/src/core/Element.traversal-more.js b/assets/js/ext/src/core/Element.traversal-more.js deleted file mode 100644 index cc3a3bd..0000000 --- a/assets/js/ext/src/core/Element.traversal-more.js +++ /dev/null @@ -1,20 +0,0 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.com/license - */ -/** - * @class Ext.Element - */ -Ext.Element.addMethods({ - /** - * Creates a {@link Ext.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 Ext.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 Ext.Element.select(selector, unique, this.dom); - } -}); \ No newline at end of file diff --git a/assets/js/ext/src/core/Error.js b/assets/js/ext/src/core/Error.js deleted file mode 100644 index 580c918..0000000 --- a/assets/js/ext/src/core/Error.js +++ /dev/null @@ -1,81 +0,0 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.com/license - */ -/** - * Framework-wide error-handler. Developers can override this method to provide - * custom exception-handling. Framework errors will often extend from the base - * Ext.Error class. - * @param {Object/Error} e The thrown exception object. - */ -Ext.handleError = function(e) { - throw e; -}; - -/** - * @class Ext.Error - * @extends Error - *

A base error class. Future implementations are intended to provide more - * robust error handling throughout the framework (in the debug build only) - * to check for common errors and problems. The messages issued by this class - * will aid error checking. Error checks will be automatically removed in the - * production build so that performance is not negatively impacted.

- *

Some sample messages currently implemented:

-"DataProxy attempted to execute an API-action but found an undefined
-url / function. Please review your Proxy url/api-configuration."
- * 
-"Could not locate your "root" property in your server response.
-Please review your JsonReader config to ensure the config-property
-"root" matches the property your server-response.  See the JsonReader
-docs for additional assistance."
- * 
- *

An example of the code used for generating error messages:


-try {
-    generateError({
-        foo: 'bar'
-    });
-}
-catch (e) {
-    console.error(e);
-}
-function generateError(data) {
-    throw new Ext.Error('foo-error', data);
-}
- * 
- * @param {String} message - */ -Ext.Error = function(message) { - // Try to read the message from Ext.Error.lang - this.message = (this.lang[message]) ? this.lang[message] : message; -}; - -Ext.Error.prototype = new Error(); -Ext.apply(Ext.Error.prototype, { - // protected. Extensions place their error-strings here. - lang: {}, - - name: 'Ext.Error', - /** - * getName - * @return {String} - */ - getName : function() { - return this.name; - }, - /** - * getMessage - * @return {String} - */ - getMessage : function() { - return this.message; - }, - /** - * toJson - * @return {String} - */ - toJson : function() { - return Ext.encode(this); - } -}); diff --git a/assets/js/ext/src/core/EventManager-more.js b/assets/js/ext/src/core/EventManager-more.js deleted file mode 100644 index f5a39d2..0000000 --- a/assets/js/ext/src/core/EventManager-more.js +++ /dev/null @@ -1,335 +0,0 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.com/license - */ -/** -* @class Ext.EventManager -*/ -Ext.apply(Ext.EventManager, function(){ - var resizeEvent, - resizeTask, - textEvent, - textSize, - D = Ext.lib.Dom, - propRe = /^(?:scope|delay|buffer|single|stopEvent|preventDefault|stopPropagation|normalized|args|delegate)$/, - curWidth = 0, - curHeight = 0, - // note 1: IE fires ONLY the keydown event on specialkey autorepeat - // note 2: Safari < 3.1, Gecko (Mac/Linux) & Opera fire only the keypress event on specialkey autorepeat - // (research done by @Jan Wolter at http://unixpapa.com/js/key.html) - useKeydown = Ext.isWebKit ? - Ext.num(navigator.userAgent.match(/AppleWebKit\/(\d+)/)[1]) >= 525 : - !((Ext.isGecko && !Ext.isWindows) || Ext.isOpera); - - return { - // private - doResizeEvent: function(){ - var h = D.getViewHeight(), - w = D.getViewWidth(); - - //whacky problem in IE where the resize event will fire even though the w/h are the same. - if(curHeight != h || curWidth != w){ - resizeEvent.fire(curWidth = w, curHeight = h); - } - }, - - /** - * Adds a listener to be notified when the browser window is resized and provides resize event buffering (100 milliseconds), - * passes new viewport width and height to handlers. - * @param {Function} fn The handler function the window resize event invokes. - * @param {Object} scope The scope (this reference) in which the handler function executes. Defaults to the browser window. - * @param {boolean} options Options object as passed to {@link Ext.Element#addListener} - */ - onWindowResize : function(fn, scope, options){ - if(!resizeEvent){ - resizeEvent = new Ext.util.Event(); - resizeTask = new Ext.util.DelayedTask(this.doResizeEvent); - Ext.EventManager.on(window, "resize", this.fireWindowResize, this); - } - resizeEvent.addListener(fn, scope, options); - }, - - // exposed only to allow manual firing - fireWindowResize : function(){ - if(resizeEvent){ - resizeTask.delay(100); - } - }, - - /** - * Adds a listener to be notified 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 function the event invokes. - * @param {Object} scope The scope (this reference) in which the handler function executes. Defaults to the browser window. - * @param {boolean} options Options object as passed to {@link Ext.Element#addListener} - */ - onTextResize : function(fn, scope, options){ - if(!textEvent){ - textEvent = new Ext.util.Event(); - var textEl = new Ext.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()); - } - }, - - /** - * The frequency, in milliseconds, to check for text resize events (defaults to 50) - */ - textResizeInterval : 50, - - /** - * Url used for onDocumentReady with using SSL (defaults to Ext.SSL_SECURE_URL) - */ - ieDeferSrc : false, - - // protected, short accessor for useKeydown - getKeyEvent : function(){ - return useKeydown ? 'keydown' : 'keypress'; - }, - - // protected for use inside the framework - // detects whether we should use keydown or keypress based on the browser. - useKeydown: useKeydown - }; -}()); - -Ext.EventManager.on = Ext.EventManager.addListener; - - -Ext.apply(Ext.EventObjectImpl.prototype, { - /** Key constant @type Number */ - BACKSPACE: 8, - /** Key constant @type Number */ - TAB: 9, - /** Key constant @type Number */ - NUM_CENTER: 12, - /** Key constant @type Number */ - ENTER: 13, - /** Key constant @type Number */ - RETURN: 13, - /** Key constant @type Number */ - SHIFT: 16, - /** Key constant @type Number */ - CTRL: 17, - CONTROL : 17, // legacy - /** Key constant @type Number */ - ALT: 18, - /** Key constant @type Number */ - PAUSE: 19, - /** Key constant @type Number */ - CAPS_LOCK: 20, - /** Key constant @type Number */ - ESC: 27, - /** Key constant @type Number */ - SPACE: 32, - /** Key constant @type Number */ - PAGE_UP: 33, - PAGEUP : 33, // legacy - /** Key constant @type Number */ - PAGE_DOWN: 34, - PAGEDOWN : 34, // legacy - /** 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 */ - PRINT_SCREEN: 44, - /** Key constant @type Number */ - INSERT: 45, - /** Key constant @type Number */ - DELETE: 46, - /** Key constant @type Number */ - ZERO: 48, - /** Key constant @type Number */ - ONE: 49, - /** Key constant @type Number */ - TWO: 50, - /** Key constant @type Number */ - THREE: 51, - /** Key constant @type Number */ - FOUR: 52, - /** Key constant @type Number */ - FIVE: 53, - /** Key constant @type Number */ - SIX: 54, - /** Key constant @type Number */ - SEVEN: 55, - /** Key constant @type Number */ - EIGHT: 56, - /** Key constant @type Number */ - NINE: 57, - /** Key constant @type Number */ - A: 65, - /** Key constant @type Number */ - B: 66, - /** Key constant @type Number */ - C: 67, - /** Key constant @type Number */ - D: 68, - /** Key constant @type Number */ - E: 69, - /** Key constant @type Number */ - F: 70, - /** Key constant @type Number */ - G: 71, - /** Key constant @type Number */ - H: 72, - /** Key constant @type Number */ - I: 73, - /** Key constant @type Number */ - J: 74, - /** Key constant @type Number */ - K: 75, - /** Key constant @type Number */ - L: 76, - /** Key constant @type Number */ - M: 77, - /** Key constant @type Number */ - N: 78, - /** Key constant @type Number */ - O: 79, - /** Key constant @type Number */ - P: 80, - /** Key constant @type Number */ - Q: 81, - /** Key constant @type Number */ - R: 82, - /** Key constant @type Number */ - S: 83, - /** Key constant @type Number */ - T: 84, - /** Key constant @type Number */ - U: 85, - /** Key constant @type Number */ - V: 86, - /** Key constant @type Number */ - W: 87, - /** Key constant @type Number */ - X: 88, - /** Key constant @type Number */ - Y: 89, - /** Key constant @type Number */ - Z: 90, - /** Key constant @type Number */ - CONTEXT_MENU: 93, - /** Key constant @type Number */ - NUM_ZERO: 96, - /** Key constant @type Number */ - NUM_ONE: 97, - /** Key constant @type Number */ - NUM_TWO: 98, - /** Key constant @type Number */ - NUM_THREE: 99, - /** Key constant @type Number */ - NUM_FOUR: 100, - /** Key constant @type Number */ - NUM_FIVE: 101, - /** Key constant @type Number */ - NUM_SIX: 102, - /** Key constant @type Number */ - NUM_SEVEN: 103, - /** Key constant @type Number */ - NUM_EIGHT: 104, - /** Key constant @type Number */ - NUM_NINE: 105, - /** Key constant @type Number */ - NUM_MULTIPLY: 106, - /** Key constant @type Number */ - NUM_PLUS: 107, - /** Key constant @type Number */ - NUM_MINUS: 109, - /** Key constant @type Number */ - NUM_PERIOD: 110, - /** Key constant @type Number */ - NUM_DIVISION: 111, - /** Key constant @type Number */ - F1: 112, - /** Key constant @type Number */ - F2: 113, - /** Key constant @type Number */ - F3: 114, - /** Key constant @type Number */ - F4: 115, - /** Key constant @type Number */ - F5: 116, - /** Key constant @type Number */ - F6: 117, - /** Key constant @type Number */ - F7: 118, - /** Key constant @type Number */ - F8: 119, - /** Key constant @type Number */ - F9: 120, - /** Key constant @type Number */ - F10: 121, - /** Key constant @type Number */ - F11: 122, - /** Key constant @type Number */ - F12: 123, - - /** @private */ - isNavKeyPress : function(){ - var me = this, - k = this.normalizeKey(me.keyCode); - return (k >= 33 && k <= 40) || // Page Up/Down, End, Home, Left, Up, Right, Down - k == me.RETURN || - k == me.TAB || - k == me.ESC; - }, - - isSpecialKey : function(){ - var k = this.normalizeKey(this.keyCode); - return (this.type == 'keypress' && this.ctrlKey) || - this.isNavKeyPress() || - (k == this.BACKSPACE) || // Backspace - (k >= 16 && k <= 20) || // Shift, Ctrl, Alt, Pause, Caps Lock - (k >= 44 && k <= 46); // Print Screen, Insert, Delete - }, - - getPoint : function(){ - return new Ext.lib.Point(this.xy[0], this.xy[1]); - }, - - /** - * 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); - } -}); \ No newline at end of file diff --git a/assets/js/ext/src/core/Ext-more.js b/assets/js/ext/src/core/Ext-more.js deleted file mode 100644 index 6f88c00..0000000 --- a/assets/js/ext/src/core/Ext-more.js +++ /dev/null @@ -1,688 +0,0 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.com/license - */ -/** - * @class Ext - */ - -Ext.ns("Ext.grid", "Ext.list", "Ext.dd", "Ext.tree", "Ext.form", "Ext.menu", - "Ext.state", "Ext.layout", "Ext.app", "Ext.ux", "Ext.chart", "Ext.direct"); - /** - * Namespace alloted for extensions to the framework. - * @property ux - * @type Object - */ - -Ext.apply(Ext, function(){ - var E = Ext, - idSeed = 0, - scrollWidth = null; - - return { - /** - * A reusable empty function - * @property - * @type Function - */ - emptyFn : function(){}, - - /** - * URL to a 1x1 transparent gif image used by Ext to create inline icons with CSS background images. - * In older versions of IE, this defaults to "http://extjs.com/s.gif" and you should change this to a URL on your server. - * For other browsers it uses an inline data URL. - * @type String - */ - BLANK_IMAGE_URL : Ext.isIE6 || Ext.isIE7 || Ext.isAir ? - 'http:/' + '/www.extjs.com/s.gif' : - 'data:image/gif;base64,R0lGODlhAQABAID/AMDAwAAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==', - - extendX : function(supr, fn){ - return Ext.extend(supr, fn(supr.prototype)); - }, - - /** - * Returns the current HTML document object as an {@link Ext.Element}. - * @return Ext.Element The document - */ - getDoc : function(){ - return Ext.get(document); - }, - - /** - * Utility method for validating that a value is numeric, returning the specified default value if it is not. - * @param {Mixed} value Should be a number, but any type will be handled appropriately - * @param {Number} defaultValue The value to return if the original value is non-numeric - * @return {Number} Value, if numeric, else defaultValue - */ - num : function(v, defaultValue){ - v = Number(Ext.isEmpty(v) || Ext.isArray(v) || typeof v == 'boolean' || (typeof v == 'string' && v.trim().length == 0) ? NaN : v); - return isNaN(v) ? defaultValue : v; - }, - - /** - *

Utility method for returning a default value if the passed value is empty.

- *

The value is deemed to be empty if it is

    - *
  • null
  • - *
  • undefined
  • - *
  • an empty array
  • - *
  • a zero length string (Unless the allowBlank parameter is true)
  • - *
- * @param {Mixed} value The value to test - * @param {Mixed} defaultValue The value to return if the original value is empty - * @param {Boolean} allowBlank (optional) true to allow zero length strings to qualify as non-empty (defaults to false) - * @return {Mixed} value, if non-empty, else defaultValue - */ - value : function(v, defaultValue, allowBlank){ - return Ext.isEmpty(v, allowBlank) ? defaultValue : v; - }, - - /** - * Escapes the passed string for use in a regular expression - * @param {String} str - * @return {String} - */ - escapeRe : function(s) { - return s.replace(/([-.*+?^${}()|[\]\/\\])/g, "\\$1"); - }, - - sequence : function(o, name, fn, scope){ - o[name] = o[name].createSequence(fn, scope); - }, - - /** - * Applies event listeners to elements by selectors when the document is ready. - * The event name is specified with an @ suffix. - *

-Ext.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
-    }
-});
-         * 
- * @param {Object} obj The list of behaviors to apply - */ - addBehaviors : function(o){ - if(!Ext.isReady){ - Ext.onReady(function(){ - Ext.addBehaviors(o); - }); - } else { - var cache = {}, // simple cache for applying multiple behaviors to same selector does query multiple times - parts, - b, - s; - for (b in o) { - if ((parts = b.split('@'))[1]) { // for Object prototype breakers - s = parts[0]; - if(!cache[s]){ - cache[s] = Ext.select(s); - } - cache[s].on(parts[1], o[b]); - } - } - cache = null; - } - }, - - /** - * Utility method for getting the width of the browser scrollbar. This can differ depending on - * operating system settings, such as the theme or font size. - * @param {Boolean} force (optional) true to force a recalculation of the value. - * @return {Number} The width of the scrollbar. - */ - getScrollBarWidth: function(force){ - if(!Ext.isReady){ - return 0; - } - - if(force === true || scrollWidth === null){ - // Append our div, do our calculation and then remove it - var div = Ext.getBody().createChild('
'), - child = div.child('div', true); - var w1 = child.offsetWidth; - div.setStyle('overflow', (Ext.isWebKit || Ext.isGecko) ? 'auto' : 'scroll'); - var w2 = child.offsetWidth; - div.remove(); - // Need to add 2 to ensure we leave enough space - scrollWidth = w1 - w2 + 2; - } - return scrollWidth; - }, - - - // deprecated - combine : function(){ - var as = arguments, l = as.length, r = []; - for(var i = 0; i < l; i++){ - var a = as[i]; - if(Ext.isArray(a)){ - 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; - }, - - /** - * Copies a set of named properties fom the source object to the destination object. - *

example:


-ImageComponent = Ext.extend(Ext.BoxComponent, {
-    initComponent: function() {
-        this.autoEl = { tag: 'img' };
-        MyComponent.superclass.initComponent.apply(this, arguments);
-        this.initialBox = Ext.copyTo({}, this.initialConfig, 'x,y,width,height');
-    }
-});
-         * 
- * @param {Object} dest The destination object. - * @param {Object} source The source object. - * @param {Array/String} names Either an Array of property names, or a comma-delimited list - * of property names to copy. - * @return {Object} The modified object. - */ - copyTo : function(dest, source, names){ - if(typeof names == 'string'){ - names = names.split(/[,;\s]/); - } - Ext.each(names, function(name){ - if(source.hasOwnProperty(name)){ - dest[name] = source[name]; - } - }, this); - return dest; - }, - - /** - * Attempts to destroy any objects passed to it by removing all event listeners, removing them from the - * DOM (if applicable) and calling their destroy functions (if available). This method is primarily - * intended for arguments of type {@link Ext.Element} and {@link Ext.Component}, but any subclass of - * {@link Ext.util.Observable} can be passed in. Any number of elements and/or components can be - * passed into this function in a single call as separate arguments. - * @param {Mixed} arg1 An {@link Ext.Element}, {@link Ext.Component}, or an Array of either of these to destroy - * @param {Mixed} arg2 (optional) - * @param {Mixed} etc... (optional) - */ - destroy : function(){ - Ext.each(arguments, function(arg){ - if(arg){ - if(Ext.isArray(arg)){ - this.destroy.apply(this, arg); - }else if(typeof arg.destroy == 'function'){ - arg.destroy(); - }else if(arg.dom){ - arg.remove(); - } - } - }, this); - }, - - /** - * Attempts to destroy and then remove a set of named properties of the passed object. - * @param {Object} o The object (most likely a Component) who's properties you wish to destroy. - * @param {Mixed} arg1 The name of the property to destroy and remove from the object. - * @param {Mixed} etc... More property names to destroy and remove. - */ - destroyMembers : function(o, arg1, arg2, etc){ - for(var i = 1, a = arguments, len = a.length; i < len; i++) { - Ext.destroy(o[a[i]]); - delete o[a[i]]; - } - }, - - /** - * Creates a copy of the passed Array with falsy values removed. - * @param {Array/NodeList} arr The Array from which to remove falsy values. - * @return {Array} The new, compressed Array. - */ - clean : function(arr){ - var ret = []; - Ext.each(arr, function(v){ - if(!!v){ - ret.push(v); - } - }); - return ret; - }, - - /** - * Creates a copy of the passed Array, filtered to contain only unique values. - * @param {Array} arr The Array to filter - * @return {Array} The new Array containing unique values. - */ - unique : function(arr){ - var ret = [], - collect = {}; - - Ext.each(arr, function(v) { - if(!collect[v]){ - ret.push(v); - } - collect[v] = true; - }); - return ret; - }, - - /** - * Recursively flattens into 1-d Array. Injects Arrays inline. - * @param {Array} arr The array to flatten - * @return {Array} The new, flattened array. - */ - flatten : function(arr){ - var worker = []; - function rFlatten(a) { - Ext.each(a, function(v) { - if(Ext.isArray(v)){ - rFlatten(v); - }else{ - worker.push(v); - } - }); - return worker; - } - return rFlatten(arr); - }, - - /** - * Returns the minimum value in the Array. - * @param {Array|NodeList} arr The Array from which to select the minimum value. - * @param {Function} comp (optional) a function to perform the comparision which determines minimization. - * If omitted the "<" operator will be used. Note: gt = 1; eq = 0; lt = -1 - * @return {Object} The minimum value in the Array. - */ - min : function(arr, comp){ - var ret = arr[0]; - comp = comp || function(a,b){ return a < b ? -1 : 1; }; - Ext.each(arr, function(v) { - ret = comp(ret, v) == -1 ? ret : v; - }); - return ret; - }, - - /** - * Returns the maximum value in the Array - * @param {Array|NodeList} arr The Array from which to select the maximum value. - * @param {Function} comp (optional) a function to perform the comparision which determines maximization. - * If omitted the ">" operator will be used. Note: gt = 1; eq = 0; lt = -1 - * @return {Object} The maximum value in the Array. - */ - max : function(arr, comp){ - var ret = arr[0]; - comp = comp || function(a,b){ return a > b ? 1 : -1; }; - Ext.each(arr, function(v) { - ret = comp(ret, v) == 1 ? ret : v; - }); - return ret; - }, - - /** - * Calculates the mean of the Array - * @param {Array} arr The Array to calculate the mean value of. - * @return {Number} The mean. - */ - mean : function(arr){ - return arr.length > 0 ? Ext.sum(arr) / arr.length : undefined; - }, - - /** - * Calculates the sum of the Array - * @param {Array} arr The Array to calculate the sum value of. - * @return {Number} The sum. - */ - sum : function(arr){ - var ret = 0; - Ext.each(arr, function(v) { - ret += v; - }); - return ret; - }, - - /** - * Partitions the set into two sets: a true set and a false set. - * Example: - * Example2: - *

-// Example 1:
-Ext.partition([true, false, true, true, false]); // [[true, true, true], [false, false]]
-
-// Example 2:
-Ext.partition(
-    Ext.query("p"),
-    function(val){
-        return val.className == "class1"
-    }
-);
-// true are those paragraph elements with a className of "class1",
-// false set are those that do not have that className.
-         * 
- * @param {Array|NodeList} arr The array to partition - * @param {Function} truth (optional) a function to determine truth. If this is omitted the element - * itself must be able to be evaluated for its truthfulness. - * @return {Array} [true,false] - */ - partition : function(arr, truth){ - var ret = [[],[]]; - Ext.each(arr, function(v, i, a) { - ret[ (truth && truth(v, i, a)) || (!truth && v) ? 0 : 1].push(v); - }); - return ret; - }, - - /** - * Invokes a method on each item in an Array. - *

-// Example:
-Ext.invoke(Ext.query("p"), "getAttribute", "id");
-// [el1.getAttribute("id"), el2.getAttribute("id"), ..., elN.getAttribute("id")]
-         * 
- * @param {Array|NodeList} arr The Array of items to invoke the method on. - * @param {String} methodName The method name to invoke. - * @param {...*} args Arguments to send into the method invocation. - * @return {Array} The results of invoking the method on each item in the array. - */ - invoke : function(arr, methodName){ - var ret = [], - args = Array.prototype.slice.call(arguments, 2); - Ext.each(arr, function(v,i) { - if (v && typeof v[methodName] == 'function') { - ret.push(v[methodName].apply(v, args)); - } else { - ret.push(undefined); - } - }); - return ret; - }, - - /** - * Plucks the value of a property from each item in the Array - *

-// Example:
-Ext.pluck(Ext.query("p"), "className"); // [el1.className, el2.className, ..., elN.className]
-         * 
- * @param {Array|NodeList} arr The Array of items to pluck the value from. - * @param {String} prop The property name to pluck from each element. - * @return {Array} The value from each item in the Array. - */ - pluck : function(arr, prop){ - var ret = []; - Ext.each(arr, function(v) { - ret.push( v[prop] ); - }); - return ret; - }, - - /** - *

Zips N sets together.

- *

-// Example 1:
-Ext.zip([1,2,3],[4,5,6]); // [[1,4],[2,5],[3,6]]
-// Example 2:
-Ext.zip(
-    [ "+", "-", "+"],
-    [  12,  10,  22],
-    [  43,  15,  96],
-    function(a, b, c){
-        return "$" + a + "" + b + "." + c
-    }
-); // ["$+12.43", "$-10.15", "$+22.96"]
-         * 
- * @param {Arrays|NodeLists} arr This argument may be repeated. Array(s) to contribute values. - * @param {Function} zipper (optional) The last item in the argument list. This will drive how the items are zipped together. - * @return {Array} The zipped set. - */ - zip : function(){ - var parts = Ext.partition(arguments, function( val ){ return typeof val != 'function'; }), - arrs = parts[0], - fn = parts[1][0], - len = Ext.max(Ext.pluck(arrs, "length")), - ret = []; - - for (var i = 0; i < len; i++) { - ret[i] = []; - if(fn){ - ret[i] = fn.apply(fn, Ext.pluck(arrs, i)); - }else{ - for (var j = 0, aLen = arrs.length; j < aLen; j++){ - ret[i].push( arrs[j][i] ); - } - } - } - return ret; - }, - - /** - * This is shorthand reference to {@link Ext.ComponentMgr#get}. - * Looks up an existing {@link Ext.Component Component} by {@link Ext.Component#id id} - * @param {String} id The component {@link Ext.Component#id id} - * @return Ext.Component The Component, undefined if not found, or null if a - * Class was found. - */ - getCmp : function(id){ - return Ext.ComponentMgr.get(id); - }, - - /** - * 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: E.isIE6 || (E.isMac && E.isGecko2), - - // 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:
    - *
  • string: If the object passed is a string
  • - *
  • number: If the object passed is a number
  • - *
  • boolean: If the object passed is a boolean value
  • - *
  • date: If the object passed is a Date object
  • - *
  • function: If the object passed is a function reference
  • - *
  • object: If the object passed is an object
  • - *
  • array: If the object passed is an array
  • - *
  • regexp: If the object passed is a regular expression
  • - *
  • element: If the object passed is a DOM Element
  • - *
  • nodelist: If the object passed is a DOM NodeList
  • - *
  • textnode: If the object passed is a DOM text node and contains something other than whitespace
  • - *
  • whitespace: If the object passed is a DOM text node and contains only whitespace
  • - *
- * @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'; - case Date: return 'date'; - } - if(typeof o.length == 'number' && typeof o.item == 'function') { - return 'nodelist'; - } - } - return t; - }, - - intercept : function(o, name, fn, scope){ - o[name] = o[name].createInterceptor(fn, scope); - }, - - // internal - callback : function(cb, scope, args, delay){ - if(typeof cb == 'function'){ - if(delay){ - cb.defer(delay, scope, args || []); - }else{ - cb.apply(scope, args || []); - } - } - } - }; -}()); - -/** - * @class Function - * These functions are available on every Function object (any JavaScript function). - */ -Ext.apply(Function.prototype, { - /** - * 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. Example usage: - *

-var sayHi = function(name){
-    alert('Hi, ' + name);
-}
-
-sayHi('Fred'); // alerts "Hi, Fred"
-
-var sayGoodbye = sayHi.createSequence(function(name){
-    alert('Bye, ' + name);
-});
-
-sayGoodbye('Fred'); // both alerts show
-
- * @param {Function} fcn The function to sequence - * @param {Object} scope (optional) The scope (this reference) in which the passed function is executed. - * If omitted, defaults to the scope in which the original function is called or the browser window. - * @return {Function} The new function - */ - createSequence : function(fcn, scope){ - var method = this; - return (typeof fcn != 'function') ? - this : - function(){ - var retval = method.apply(this || window, arguments); - fcn.apply(scope || this || window, arguments); - return retval; - }; - } -}); - - -/** - * @class String - * These functions are available as static methods on the JavaScript String object. - */ -Ext.applyIf(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: - *

-var s = String.leftPad('123', 5, '0');
-// s now contains the string: '00123'
-     * 
- * @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 = String(val); - if(!ch) { - ch = " "; - } - while (result.length < size) { - result = ch + result; - } - return result; - } -}); - -/** - * 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. - *

-// alternate sort directions
-sort = sort.toggle('ASC', 'DESC');
-
-// instead of conditional logic:
-sort = (sort == 'ASC' ? 'DESC' : 'ASC');
-
- * @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; -}; - -/** - * Trims whitespace from either end of a string, leaving spaces within the string intact. Example: - *

-var s = '  foo bar  ';
-alert('-' + s + '-');         //alerts "- foo bar -"
-alert('-' + s.trim() + '-');  //alerts "-foo bar-"
-
- * @return {String} The trimmed string - */ -String.prototype.trim = function(){ - var re = /^\s+|\s+$/g; - return function(){ return this.replace(re, ""); }; -}(); - -// here to prevent dependency on Date.js -/** - 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()); -}; - - -/** - * @class Number - */ -Ext.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); - } -}); diff --git a/assets/js/ext/src/core/Template-more.js b/assets/js/ext/src/core/Template-more.js deleted file mode 100644 index 2d915ce..0000000 --- a/assets/js/ext/src/core/Template-more.js +++ /dev/null @@ -1,137 +0,0 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.com/license - */ -/** - * @class Ext.Template - */ -Ext.apply(Ext.Template.prototype, { - /** - * @cfg {Boolean} disableFormats Specify true to disable format - * functions in the template. If the template does not contain - * {@link Ext.util.Format format functions}, setting disableFormats - * to true will reduce {@link #apply} time. Defaults to false. - *

-var t = new Ext.Template(
-    '<div name="{id}">',
-        '<span class="{cls}">{name} {value}</span>',
-    '</div>',
-    {
-        compiled: true,      // {@link #compile} immediately
-        disableFormats: true // reduce {@link #apply} time since no formatting
-    }
-);
-     * 
- * For a list of available format functions, see {@link Ext.util.Format}. - */ - disableFormats : false, - /** - * See {@link #disableFormats}. - * @type Boolean - * @property disableFormats - */ - - /** - * The regular expression used to match template variables - * @type RegExp - * @property - * @hide repeat doc - */ - re : /\{([\w-]+)(?:\:([\w\.]*)(?:\((.*?)?\))?)?\}/g, - argsRe : /^\s*['"](.*)["']\s*$/, - compileARe : /\\/g, - compileBRe : /(\r\n|\n)/g, - compileCRe : /'/g, - - /** - * Returns an HTML fragment of this template with the specified values applied. - * @param {Object/Array} 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 - * @hide repeat doc - */ - applyTemplate : function(values){ - var me = this, - useF = me.disableFormats !== true, - fm = Ext.util.Format, - tpl = me; - - if(me.compiled){ - return me.compiled(values); - } - function fn(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 = me.argsRe; - 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 me.html.replace(me.re, fn); - }, - - /** - * Compiles the template into an internal function, eliminating the RegEx overhead. - * @return {Ext.Template} this - * @hide repeat doc - */ - compile : function(){ - var me = this, - fm = Ext.util.Format, - useF = me.disableFormats !== true, - sep = Ext.isGecko ? "+" : ",", - body; - - function fn(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+"'"; - } - - // branched to use + in gecko and [].join() in others - if(Ext.isGecko){ - body = "this.compiled = function(values){ return '" + - me.html.replace(me.compileARe, '\\\\').replace(me.compileBRe, '\\n').replace(me.compileCRe, "\\'").replace(me.re, fn) + - "';};"; - }else{ - body = ["this.compiled = function(values){ return ['"]; - body.push(me.html.replace(me.compileARe, '\\\\').replace(me.compileBRe, '\\n').replace(me.compileCRe, "\\'").replace(me.re, fn)); - body.push("'].join('');};"); - body = body.join(''); - } - eval(body); - return me; - }, - - // private function used to call members - call : function(fnName, value, allValues){ - return this[fnName](value, allValues); - } -}); -Ext.Template.prototype.apply = Ext.Template.prototype.applyTemplate; diff --git a/assets/js/ext/src/data/Api.js b/assets/js/ext/src/data/Api.js deleted file mode 100644 index bef8db0..0000000 --- a/assets/js/ext/src/data/Api.js +++ /dev/null @@ -1,285 +0,0 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.com/license - */ - -/** - * @class Ext.data.Api - * @extends Object - * Ext.data.Api is a singleton designed to manage the data API including methods - * for validating a developer's DataProxy API. Defines variables for CRUD actions - * create, read, update and destroy in addition to a mapping of RESTful HTTP methods - * GET, POST, PUT and DELETE to CRUD actions. - * @singleton - */ -Ext.data.Api = (function() { - - // private validActions. validActions is essentially an inverted hash of Ext.data.Api.actions, where value becomes the key. - // Some methods in this singleton (e.g.: getActions, getVerb) will loop through actions with the code for (var verb in this.actions) - // For efficiency, some methods will first check this hash for a match. Those methods which do acces validActions will cache their result here. - // We cannot pre-define this hash since the developer may over-ride the actions at runtime. - var validActions = {}; - - return { - /** - * Defined actions corresponding to remote actions: - *

-actions: {
-    create  : 'create',  // Text representing the remote-action to create records on server.
-    read    : 'read',    // Text representing the remote-action to read/load data from server.
-    update  : 'update',  // Text representing the remote-action to update records on server.
-    destroy : 'destroy'  // Text representing the remote-action to destroy records on server.
-}
-         * 
- * @property actions - * @type Object - */ - actions : { - create : 'create', - read : 'read', - update : 'update', - destroy : 'destroy' - }, - - /** - * Defined {CRUD action}:{HTTP method} pairs to associate HTTP methods with the - * corresponding actions for {@link Ext.data.DataProxy#restful RESTful proxies}. - * Defaults to: - *

-restActions : {
-    create  : 'POST',
-    read    : 'GET',
-    update  : 'PUT',
-    destroy : 'DELETE'
-},
-         * 
- */ - restActions : { - create : 'POST', - read : 'GET', - update : 'PUT', - destroy : 'DELETE' - }, - - /** - * Returns true if supplied action-name is a valid API action defined in {@link #actions} constants - * @param {String} action Action to test for availability. - * @return {Boolean} - */ - isAction : function(action) { - return (Ext.data.Api.actions[action]) ? true : false; - }, - - /** - * Returns the actual CRUD action KEY "create", "read", "update" or "destroy" from the supplied action-name. This method is used internally and shouldn't generally - * need to be used directly. The key/value pair of Ext.data.Api.actions will often be identical but this is not necessarily true. A developer can override this naming - * convention if desired. However, the framework internally calls methods based upon the KEY so a way of retreiving the the words "create", "read", "update" and "destroy" is - * required. This method will cache discovered KEYS into the private validActions hash. - * @param {String} name The runtime name of the action. - * @return {String||null} returns the action-key, or verb of the user-action or null if invalid. - * @nodoc - */ - getVerb : function(name) { - if (validActions[name]) { - return validActions[name]; // <-- found in cache. return immediately. - } - for (var verb in this.actions) { - if (this.actions[verb] === name) { - validActions[name] = verb; - break; - } - } - return (validActions[name] !== undefined) ? validActions[name] : null; - }, - - /** - * Returns true if the supplied API is valid; that is, check that all keys match defined actions - * otherwise returns an array of mistakes. - * @return {String[]|true} - */ - isValid : function(api){ - var invalid = []; - var crud = this.actions; // <-- cache a copy of the actions. - for (var action in api) { - if (!(action in crud)) { - invalid.push(action); - } - } - return (!invalid.length) ? true : invalid; - }, - - /** - * Returns true if the supplied verb upon the supplied proxy points to a unique url in that none of the other api-actions - * point to the same url. The question is important for deciding whether to insert the "xaction" HTTP parameter within an - * Ajax request. This method is used internally and shouldn't generally need to be called directly. - * @param {Ext.data.DataProxy} proxy - * @param {String} verb - * @return {Boolean} - */ - hasUniqueUrl : function(proxy, verb) { - var url = (proxy.api[verb]) ? proxy.api[verb].url : null; - var unique = true; - for (var action in proxy.api) { - if ((unique = (action === verb) ? true : (proxy.api[action].url != url) ? true : false) === false) { - break; - } - } - return unique; - }, - - /** - * This method is used internally by {@link Ext.data.DataProxy DataProxy} and should not generally need to be used directly. - * Each action of a DataProxy api can be initially defined as either a String or an Object. When specified as an object, - * one can explicitly define the HTTP method (GET|POST) to use for each CRUD action. This method will prepare the supplied API, setting - * each action to the Object form. If your API-actions do not explicitly define the HTTP method, the "method" configuration-parameter will - * be used. If the method configuration parameter is not specified, POST will be used. -

-new Ext.data.HttpProxy({
-    method: "POST",     // <-- default HTTP method when not specified.
-    api: {
-        create: 'create.php',
-        load: 'read.php',
-        save: 'save.php',
-        destroy: 'destroy.php'
-    }
-});
-
-// Alternatively, one can use the object-form to specify the API
-new Ext.data.HttpProxy({
-    api: {
-        load: {url: 'read.php', method: 'GET'},
-        create: 'create.php',
-        destroy: 'destroy.php',
-        save: 'update.php'
-    }
-});
-        
- * - * @param {Ext.data.DataProxy} proxy - */ - prepare : function(proxy) { - if (!proxy.api) { - proxy.api = {}; // <-- No api? create a blank one. - } - for (var verb in this.actions) { - var action = this.actions[verb]; - proxy.api[action] = proxy.api[action] || proxy.url || proxy.directFn; - if (typeof(proxy.api[action]) == 'string') { - proxy.api[action] = { - url: proxy.api[action], - method: (proxy.restful === true) ? Ext.data.Api.restActions[action] : undefined - }; - } - } - }, - - /** - * Prepares a supplied Proxy to be RESTful. Sets the HTTP method for each api-action to be one of - * GET, POST, PUT, DELETE according to the defined {@link #restActions}. - * @param {Ext.data.DataProxy} proxy - */ - restify : function(proxy) { - proxy.restful = true; - for (var verb in this.restActions) { - proxy.api[this.actions[verb]].method || - (proxy.api[this.actions[verb]].method = this.restActions[verb]); - } - // TODO: perhaps move this interceptor elsewhere? like into DataProxy, perhaps? Placed here - // to satisfy initial 3.0 final release of REST features. - proxy.onWrite = proxy.onWrite.createInterceptor(function(action, o, response, rs) { - var reader = o.reader; - var res = new Ext.data.Response({ - action: action, - raw: response - }); - - switch (response.status) { - case 200: // standard 200 response, send control back to HttpProxy#onWrite by returning true from this intercepted #onWrite - return true; - break; - case 201: // entity created but no response returned - if (Ext.isEmpty(res.raw.responseText)) { - res.success = true; - } else { - //if the response contains data, treat it like a 200 - return true; - } - break; - case 204: // no-content. Create a fake response. - res.success = true; - res.data = null; - break; - default: - return true; - break; - } - if (res.success === true) { - this.fireEvent("write", this, action, res.data, res, rs, o.request.arg); - } else { - this.fireEvent('exception', this, 'remote', action, o, res, rs); - } - o.request.callback.call(o.request.scope, res.data, res, res.success); - - return false; // <-- false to prevent intercepted function from running. - }, proxy); - } - }; -})(); - -/** - * Ext.data.Response - * Experimental. Do not use directly. - */ -Ext.data.Response = function(params, response) { - Ext.apply(this, params, { - raw: response - }); -}; -Ext.data.Response.prototype = { - message : null, - success : false, - status : null, - root : null, - raw : null, - - getMessage : function() { - return this.message; - }, - getSuccess : function() { - return this.success; - }, - getStatus : function() { - return this.status; - }, - getRoot : function() { - return this.root; - }, - getRawResponse : function() { - return this.raw; - } -}; - -/** - * @class Ext.data.Api.Error - * @extends Ext.Error - * Error class for Ext.data.Api errors - */ -Ext.data.Api.Error = Ext.extend(Ext.Error, { - constructor : function(message, arg) { - this.arg = arg; - Ext.Error.call(this, message); - }, - name: 'Ext.data.Api' -}); -Ext.apply(Ext.data.Api.Error.prototype, { - lang: { - 'action-url-undefined': 'No fallback url defined for this action. When defining a DataProxy api, please be sure to define an url for each CRUD action in Ext.data.Api.actions or define a default url in addition to your api-configuration.', - 'invalid': 'received an invalid API-configuration. Please ensure your proxy API-configuration contains only the actions defined in Ext.data.Api.actions', - 'invalid-url': 'Invalid url. Please review your proxy configuration.', - 'execute': 'Attempted to execute an unknown action. Valid API actions are defined in Ext.data.Api.actions"' - } -}); - - diff --git a/assets/js/ext/src/data/ArrayReader.js b/assets/js/ext/src/data/ArrayReader.js deleted file mode 100644 index 4a2ec6d..0000000 --- a/assets/js/ext/src/data/ArrayReader.js +++ /dev/null @@ -1,103 +0,0 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.com/license - */ -/** - * @class Ext.data.ArrayReader - * @extends Ext.data.JsonReader - *

Data reader class to create an Array of {@link Ext.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 mapping property - * of the field definition if it exists, or the field's ordinal position in the definition.

- *

Example code:

- *

-var Employee = Ext.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 Ext.data.ArrayReader({
-    {@link #idIndex}: 0
-}, Employee);
-
- *

This would consume an Array like this:

- *

-[ [1, 'Bill', 'Gardener'], [2, 'Ben', 'Horticulturalist'] ]
- * 
- * @constructor - * Create a new ArrayReader - * @param {Object} meta Metadata configuration options. - * @param {Array/Object} recordType - *

Either an Array of {@link Ext.data.Field Field} definition objects (which - * will be passed to {@link Ext.data.Record#create}, or a {@link Ext.data.Record Record} - * constructor created from {@link Ext.data.Record#create}.

- */ -Ext.data.ArrayReader = Ext.extend(Ext.data.JsonReader, { - /** - * @cfg {String} successProperty - * @hide - */ - /** - * @cfg {Number} id (optional) The subscript within row Array that provides an ID for the Record. - * Deprecated. Use {@link #idIndex} instead. - */ - /** - * @cfg {Number} idIndex (optional) The subscript within row Array that provides an ID for the Record. - */ - /** - * Create a data block containing Ext.data.Records from an Array. - * @param {Object} o An Array of row objects which represents the dataset. - * @return {Object} data A data block which is used by an Ext.data.Store object as - * a cache of Ext.data.Records. - */ - readRecords : function(o){ - this.arrayData = o; - var s = this.meta, - sid = s ? Ext.num(s.idIndex, s.id) : null, - recordType = this.recordType, - fields = recordType.prototype.fields, - records = [], - success = true, - v; - - var root = this.getRoot(o); - - for(var i = 0, len = root.length; i < len; i++) { - var n = root[i], - values = {}, - 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], - k = f.mapping !== undefined && f.mapping !== null ? f.mapping : j; - v = n[k] !== undefined ? n[k] : f.defaultValue; - v = f.convert(v, n); - values[f.name] = v; - } - var record = new recordType(values, id); - record.json = n; - records[records.length] = record; - } - - var totalRecords = records.length; - - if(s.totalProperty) { - v = parseInt(this.getTotal(o), 10); - if(!isNaN(v)) { - totalRecords = v; - } - } - if(s.successProperty){ - v = this.getSuccess(o); - if(v === false || v === 'false'){ - success = false; - } - } - - return { - success : success, - records : records, - totalRecords : totalRecords - }; - } -}); \ No newline at end of file diff --git a/assets/js/ext/src/data/ArrayStore.js b/assets/js/ext/src/data/ArrayStore.js deleted file mode 100644 index 366d489..0000000 --- a/assets/js/ext/src/data/ArrayStore.js +++ /dev/null @@ -1,70 +0,0 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.com/license - */ -/** - * @class Ext.data.ArrayStore - * @extends Ext.data.Store - *

Formerly known as "SimpleStore".

- *

Small helper class to make creating {@link Ext.data.Store}s from Array data easier. - * An ArrayStore will be automatically configured with a {@link Ext.data.ArrayReader}.

- *

A store configuration would be something like:


-var store = new Ext.data.ArrayStore({
-    // store configs
-    autoDestroy: true,
-    storeId: 'myStore',
-    // reader configs
-    idIndex: 0,  
-    fields: [
-       'company',
-       {name: 'price', type: 'float'},
-       {name: 'change', type: 'float'},
-       {name: 'pctChange', type: 'float'},
-       {name: 'lastChange', type: 'date', dateFormat: 'n/j h:ia'}
-    ]
-});
- * 

- *

This store is configured to consume a returned object of the form:


-var myData = [
-    ['3m Co',71.72,0.02,0.03,'9/1 12:00am'],
-    ['Alcoa Inc',29.01,0.42,1.47,'9/1 12:00am'],
-    ['Boeing Co.',75.43,0.53,0.71,'9/1 12:00am'],
-    ['Hewlett-Packard Co.',36.53,-0.03,-0.08,'9/1 12:00am'],
-    ['Wal-Mart Stores, Inc.',45.45,0.73,1.63,'9/1 12:00am']
-];
- * 
- * An object literal of this form could also be used as the {@link #data} config option.

- *

*Note: Although not listed here, this class accepts all of the configuration options of - * {@link Ext.data.ArrayReader ArrayReader}.

- * @constructor - * @param {Object} config - * @xtype arraystore - */ -Ext.data.ArrayStore = Ext.extend(Ext.data.Store, { - /** - * @cfg {Ext.data.DataReader} reader @hide - */ - constructor: function(config){ - Ext.data.ArrayStore.superclass.constructor.call(this, Ext.apply(config, { - reader: new Ext.data.ArrayReader(config) - })); - }, - - loadData : function(data, append){ - if(this.expandData === true){ - var r = []; - for(var i = 0, len = data.length; i < len; i++){ - r[r.length] = [data[i]]; - } - data = r; - } - Ext.data.ArrayStore.superclass.loadData.call(this, data, append); - } -}); -Ext.reg('arraystore', Ext.data.ArrayStore); - -// backwards compat -Ext.data.SimpleStore = Ext.data.ArrayStore; -Ext.reg('simplestore', Ext.data.SimpleStore); \ No newline at end of file diff --git a/assets/js/ext/src/data/DataField.js b/assets/js/ext/src/data/DataField.js deleted file mode 100644 index 928a1fb..0000000 --- a/assets/js/ext/src/data/DataField.js +++ /dev/null @@ -1,203 +0,0 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.com/license - */ -/** - * @class Ext.data.Field - *

This class encapsulates the field definition information specified in the field definition objects - * passed to {@link Ext.data.Record#create}.

- *

Developers do not need to instantiate this class. Instances are created by {@link Ext.data.Record.create} - * and cached in the {@link Ext.data.Record#fields fields} property of the created Record constructor's prototype.

- */ -Ext.data.Field = Ext.extend(Object, { - - constructor : function(config){ - if(Ext.isString(config)){ - config = {name: config}; - } - Ext.apply(this, config); - - var types = Ext.data.Types, - st = this.sortType, - t; - - if(this.type){ - if(Ext.isString(this.type)){ - this.type = Ext.data.Types[this.type.toUpperCase()] || types.AUTO; - } - }else{ - this.type = types.AUTO; - } - - // named sortTypes are supported, here we look them up - if(Ext.isString(st)){ - this.sortType = Ext.data.SortTypes[st]; - }else if(Ext.isEmpty(st)){ - this.sortType = this.type.sortType; - } - - if(!this.convert){ - this.convert = this.type.convert; - } - }, - - /** - * @cfg {String} name - * The name by which the field is referenced within the Record. This is referenced by, for example, - * the dataIndex property in column definition objects passed to {@link Ext.grid.ColumnModel}. - *

Note: In the simplest case, if no properties other than name are required, a field - * definition may consist of just a String for the field name.

- */ - /** - * @cfg {Mixed} type - * (Optional) The data type for automatic conversion from received data to the stored value if {@link Ext.data.Field#convert convert} - * has not been specified. This may be specified as a string value. Possible values are - *
    - *
  • auto (Default, implies no conversion)
  • - *
  • string
  • - *
  • int
  • - *
  • float
  • - *
  • boolean
  • - *
  • date
- *

This may also be specified by referencing a member of the {@link Ext.data.Types} class.

- *

Developers may create their own application-specific data types by defining new members of the - * {@link Ext.data.Types} class.

- */ - /** - * @cfg {Function} convert - * (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:
    - *
  • v : Mixed
    The data value as read by the Reader, if undefined will use - * the configured {@link Ext.data.Field#defaultValue defaultValue}.
  • - *
  • rec : Mixed
    The data object containing the row as read by the Reader. - * Depending on the Reader type, this could be an Array ({@link Ext.data.ArrayReader ArrayReader}), an object - * ({@link Ext.data.JsonReader JsonReader}), or an XML element ({@link Ext.data.XMLReader XMLReader}).
  • - *
- *

-// example of convert function
-function fullName(v, record){
-    return record.name.last + ', ' + record.name.first;
-}
-
-function location(v, record){
-    return !record.city ? '' : (record.city + ', ' + record.state);
-}
-
-var Dude = Ext.data.Record.create([
-    {name: 'fullname',  convert: fullName},
-    {name: 'firstname', mapping: 'name.first'},
-    {name: 'lastname',  mapping: 'name.last'},
-    {name: 'city', defaultValue: 'homeless'},
-    'state',
-    {name: 'location',  convert: location}
-]);
-
-// create the data store
-var store = new Ext.data.Store({
-    reader: new Ext.data.JsonReader(
-        {
-            idProperty: 'key',
-            root: 'daRoot',
-            totalProperty: 'total'
-        },
-        Dude  // recordType
-    )
-});
-
-var myData = [
-    { key: 1,
-      name: { first: 'Fat',    last:  'Albert' }
-      // notice no city, state provided in data object
-    },
-    { key: 2,
-      name: { first: 'Barney', last:  'Rubble' },
-      city: 'Bedrock', state: 'Stoneridge'
-    },
-    { key: 3,
-      name: { first: 'Cliff',  last:  'Claven' },
-      city: 'Boston',  state: 'MA'
-    }
-];
-     * 
- */ - /** - * @cfg {String} dateFormat - *

(Optional) Used when converting received data into a Date when the {@link #type} is specified as "date".

- *

A format string for the {@link Date#parseDate Date.parseDate} function, or "timestamp" if the - * value provided by the Reader is a UNIX timestamp, or "time" if the value provided by the Reader is a - * javascript millisecond timestamp. See {@link Date}

- */ - dateFormat: null, - - /** - * @cfg {Boolean} useNull - *

(Optional) Use when converting received data into a Number type (either int or float). If the value cannot be parsed, - * null will be used if useNull is true, otherwise the value will be 0. Defaults to false - */ - useNull: false, - - /** - * @cfg {Mixed} defaultValue - * (Optional) The default value used when a Record is being created by a {@link Ext.data.Reader Reader} - * when the item referenced by the {@link Ext.data.Field#mapping mapping} does not exist in the data - * object (i.e. undefined). (defaults to "") - */ - defaultValue: "", - /** - * @cfg {String/Number} mapping - *

(Optional) A path expression for use by the {@link Ext.data.DataReader} implementation - * that is creating the {@link Ext.data.Record Record} to extract the Field value from the data object. - * If the path expression is the same as the field name, the mapping may be omitted.

- *

The form of the mapping expression depends on the Reader being used.

- *
    - *
  • {@link Ext.data.JsonReader}
    The mapping is a string containing the javascript - * expression to reference the data from an element of the data item's {@link Ext.data.JsonReader#root root} Array. Defaults to the field name.
  • - *
  • {@link Ext.data.XmlReader}
    The mapping is an {@link Ext.DomQuery} path to the data - * item relative to the DOM element that represents the {@link Ext.data.XmlReader#record record}. Defaults to the field name.
  • - *
  • {@link Ext.data.ArrayReader}
    The mapping is a number indicating the Array index - * of the field's value. Defaults to the field specification's Array position.
  • - *
- *

If a more complex value extraction strategy is required, then configure the Field with a {@link #convert} - * function. This is passed the whole row object, and may interrogate it in whatever way is necessary in order to - * return the desired data.

- */ - mapping: null, - /** - * @cfg {Function} sortType - * (Optional) A function which converts a Field's value to a comparable value in order to ensure - * correct sort ordering. Predefined functions are provided in {@link Ext.data.SortTypes}. A custom - * sort example:

-// current sort     after sort we want
-// +-+------+          +-+------+
-// |1|First |          |1|First |
-// |2|Last  |          |3|Second|
-// |3|Second|          |2|Last  |
-// +-+------+          +-+------+
-
-sortType: function(value) {
-   switch (value.toLowerCase()) // native toLowerCase():
-   {
-      case 'first': return 1;
-      case 'second': return 2;
-      default: return 3;
-   }
-}
-     * 
- */ - sortType : null, - /** - * @cfg {String} sortDir - * (Optional) Initial direction to sort ("ASC" or "DESC"). Defaults to - * "ASC". - */ - sortDir : "ASC", - /** - * @cfg {Boolean} allowBlank - * (Optional) Used for validating a {@link Ext.data.Record record}, defaults to true. - * An empty value here will cause {@link Ext.data.Record}.{@link Ext.data.Record#isValid isValid} - * to evaluate to false. - */ - allowBlank : true -}); diff --git a/assets/js/ext/src/data/DataProxy.js b/assets/js/ext/src/data/DataProxy.js deleted file mode 100644 index 216b6e1..0000000 --- a/assets/js/ext/src/data/DataProxy.js +++ /dev/null @@ -1,511 +0,0 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.com/license - */ -/** - * @class Ext.data.DataProxy - * @extends Ext.util.Observable - *

Abstract base class for implementations which provide retrieval of unformatted data objects. - * This class is intended to be extended and should not be created directly. For existing implementations, - * see {@link Ext.data.DirectProxy}, {@link Ext.data.HttpProxy}, {@link Ext.data.ScriptTagProxy} and - * {@link Ext.data.MemoryProxy}.

- *

DataProxy implementations are usually used in conjunction with an implementation of {@link Ext.data.DataReader} - * (of the appropriate type which knows how to parse the data object) to provide a block of - * {@link Ext.data.Records} to an {@link Ext.data.Store}.

- *

The parameter to a DataProxy constructor may be an {@link Ext.data.Connection} or can also be the - * config object to an {@link Ext.data.Connection}.

- *

Custom implementations must implement either the doRequest method (preferred) or the - * load method (deprecated). See - * {@link Ext.data.HttpProxy}.{@link Ext.data.HttpProxy#doRequest doRequest} or - * {@link Ext.data.HttpProxy}.{@link Ext.data.HttpProxy#load load} for additional details.

- *

Example 1

- *

-proxy: new Ext.data.ScriptTagProxy({
-    {@link Ext.data.Connection#url url}: 'http://extjs.com/forum/topics-remote.php'
-}),
- * 
- *

Example 2

- *

-proxy : new Ext.data.HttpProxy({
-    {@link Ext.data.Connection#method method}: 'GET',
-    {@link Ext.data.HttpProxy#prettyUrls prettyUrls}: false,
-    {@link Ext.data.Connection#url url}: 'local/default.php', // see options parameter for {@link Ext.Ajax#request}
-    {@link #api}: {
-        // all actions except the following will use above url
-        create  : 'local/new.php',
-        update  : 'local/update.php'
-    }
-}),
- * 
- *

And new in Ext version 3, attach centralized event-listeners upon the DataProxy class itself! This is a great place - * to implement a messaging system to centralize your application's user-feedback and error-handling.

- *

-// Listen to all "beforewrite" event fired by all proxies.
-Ext.data.DataProxy.on('beforewrite', function(proxy, action) {
-    console.log('beforewrite: ', action);
-});
-
-// Listen to "write" event fired by all proxies
-Ext.data.DataProxy.on('write', function(proxy, action, data, res, rs) {
-    console.info('write: ', action);
-});
-
-// Listen to "exception" event fired by all proxies
-Ext.data.DataProxy.on('exception', function(proxy, type, action, exception) {
-    console.error(type + action + ' exception);
-});
- * 
- * Note: These three events are all fired with the signature of the corresponding DataProxy instance event {@link #beforewrite beforewrite}, {@link #write write} and {@link #exception exception}. - */ -Ext.data.DataProxy = function(conn){ - // make sure we have a config object here to support ux proxies. - // All proxies should now send config into superclass constructor. - conn = conn || {}; - - // This line caused a bug when people use custom Connection object having its own request method. - // http://extjs.com/forum/showthread.php?t=67194. Have to set DataProxy config - //Ext.applyIf(this, conn); - - this.api = conn.api; - this.url = conn.url; - this.restful = conn.restful; - this.listeners = conn.listeners; - - // deprecated - this.prettyUrls = conn.prettyUrls; - - /** - * @cfg {Object} api - * Specific urls to call on CRUD action methods "read", "create", "update" and "destroy". - * Defaults to:

-api: {
-    read    : undefined,
-    create  : undefined,
-    update  : undefined,
-    destroy : undefined
-}
-     * 
- *

The url is built based upon the action being executed [load|create|save|destroy] - * using the commensurate {@link #api} property, or if undefined default to the - * configured {@link Ext.data.Store}.{@link Ext.data.Store#url url}.


- *

For example:

- *

-api: {
-    load :    '/controller/load',
-    create :  '/controller/new',  // Server MUST return idProperty of new record
-    save :    '/controller/update',
-    destroy : '/controller/destroy_action'
-}
-
-// Alternatively, one can use the object-form to specify each API-action
-api: {
-    load: {url: 'read.php', method: 'GET'},
-    create: 'create.php',
-    destroy: 'destroy.php',
-    save: 'update.php'
-}
-     * 
- *

If the specific URL for a given CRUD action is undefined, the CRUD action request - * will be directed to the configured {@link Ext.data.Connection#url url}.

- *

Note: To modify the URL for an action dynamically the appropriate API - * property should be modified before the action is requested using the corresponding before - * action event. For example to modify the URL associated with the load action: - *


-// modify the url for the action
-myStore.on({
-    beforeload: {
-        fn: function (store, options) {
-            // use {@link Ext.data.HttpProxy#setUrl setUrl} to change the URL for *just* this request.
-            store.proxy.setUrl('changed1.php');
-
-            // set optional second parameter to true to make this URL change
-            // permanent, applying this URL for all subsequent requests.
-            store.proxy.setUrl('changed1.php', true);
-
-            // Altering the proxy API should be done using the public
-            // method {@link Ext.data.DataProxy#setApi setApi}.
-            store.proxy.setApi('read', 'changed2.php');
-
-            // Or set the entire API with a config-object.
-            // When using the config-object option, you must redefine the entire
-            // API -- not just a specific action of it.
-            store.proxy.setApi({
-                read    : 'changed_read.php',
-                create  : 'changed_create.php',
-                update  : 'changed_update.php',
-                destroy : 'changed_destroy.php'
-            });
-        }
-    }
-});
-     * 
- *

- */ - - this.addEvents( - /** - * @event exception - *

Fires if an exception occurs in the Proxy during a remote request. This event is relayed - * through a corresponding {@link Ext.data.Store}.{@link Ext.data.Store#exception exception}, - * so any Store instance may observe this event.

- *

In addition to being fired through the DataProxy instance that raised the event, this event is also fired - * through the Ext.data.DataProxy class to allow for centralized processing of exception events from all - * DataProxies by attaching a listener to the Ext.data.DataProxy class itself.

- *

This event can be fired for one of two reasons:

- *
    - *
  • remote-request failed :
    - * The server did not return status === 200. - *
  • - *
  • remote-request succeeded :
    - * The remote-request succeeded but the reader could not read the response. - * This means the server returned data, but the configured Reader threw an - * error while reading the response. In this case, this event will be - * raised and the caught error will be passed along into this event. - *
  • - *
- *

This event fires with two different contexts based upon the 2nd - * parameter type [remote|response]. The first four parameters - * are identical between the two contexts -- only the final two parameters - * differ.

- * @param {DataProxy} this The proxy that sent the request - * @param {String} type - *

The value of this parameter will be either 'response' or 'remote'.

- *
    - *
  • 'response' :
    - *

    An invalid response from the server was returned: either 404, - * 500 or the response meta-data does not match that defined in the DataReader - * (e.g.: root, idProperty, successProperty).

    - *
  • - *
  • 'remote' :
    - *

    A valid response was returned from the server having - * successProperty === false. This response might contain an error-message - * sent from the server. For example, the user may have failed - * authentication/authorization or a database validation error occurred.

    - *
  • - *
- * @param {String} action Name of the action (see {@link Ext.data.Api#actions}. - * @param {Object} options The options for the action that were specified in the {@link #request}. - * @param {Object} response - *

The value of this parameter depends on the value of the type parameter:

- *
    - *
  • 'response' :
    - *

    The raw browser response object (e.g.: XMLHttpRequest)

    - *
  • - *
  • 'remote' :
    - *

    The decoded response object sent from the server.

    - *
  • - *
- * @param {Mixed} arg - *

The type and value of this parameter depends on the value of the type parameter:

- *
    - *
  • 'response' : Error
    - *

    The JavaScript Error object caught if the configured Reader could not read the data. - * If the remote request returns success===false, this parameter will be null.

    - *
  • - *
  • 'remote' : Record/Record[]
    - *

    This parameter will only exist if the action was a write action - * (Ext.data.Api.actions.create|update|destroy).

    - *
  • - *
- */ - 'exception', - /** - * @event beforeload - * Fires before a request to retrieve a data object. - * @param {DataProxy} this The proxy for the request - * @param {Object} params The params object passed to the {@link #request} function - */ - 'beforeload', - /** - * @event load - * Fires before the load method's callback is called. - * @param {DataProxy} this The proxy for the request - * @param {Object} o The request transaction object - * @param {Object} options The callback's options property as passed to the {@link #request} function - */ - 'load', - /** - * @event loadexception - *

This event is deprecated. The signature of the loadexception event - * varies depending on the proxy, use the catch-all {@link #exception} event instead. - * This event will fire in addition to the {@link #exception} event.

- * @param {misc} misc See {@link #exception}. - * @deprecated - */ - 'loadexception', - /** - * @event beforewrite - *

Fires before a request is generated for one of the actions Ext.data.Api.actions.create|update|destroy

- *

In addition to being fired through the DataProxy instance that raised the event, this event is also fired - * through the Ext.data.DataProxy class to allow for centralized processing of beforewrite events from all - * DataProxies by attaching a listener to the Ext.data.DataProxy class itself.

- * @param {DataProxy} this The proxy for the request - * @param {String} action [Ext.data.Api.actions.create|update|destroy] - * @param {Record/Record[]} rs The Record(s) to create|update|destroy. - * @param {Object} params The request params object. Edit params to add parameters to the request. - */ - 'beforewrite', - /** - * @event write - *

Fires before the request-callback is called

- *

In addition to being fired through the DataProxy instance that raised the event, this event is also fired - * through the Ext.data.DataProxy class to allow for centralized processing of write events from all - * DataProxies by attaching a listener to the Ext.data.DataProxy class itself.

- * @param {DataProxy} this The proxy that sent the request - * @param {String} action [Ext.data.Api.actions.create|upate|destroy] - * @param {Object} data The data object extracted from the server-response - * @param {Object} response The decoded response from server - * @param {Record/Record[]} rs The Record(s) from Store - * @param {Object} options The callback's options property as passed to the {@link #request} function - */ - 'write' - ); - Ext.data.DataProxy.superclass.constructor.call(this); - - // Prepare the proxy api. Ensures all API-actions are defined with the Object-form. - try { - Ext.data.Api.prepare(this); - } catch (e) { - if (e instanceof Ext.data.Api.Error) { - e.toConsole(); - } - } - // relay each proxy's events onto Ext.data.DataProxy class for centralized Proxy-listening - Ext.data.DataProxy.relayEvents(this, ['beforewrite', 'write', 'exception']); -}; - -Ext.extend(Ext.data.DataProxy, Ext.util.Observable, { - /** - * @cfg {Boolean} restful - *

Defaults to false. Set to true to operate in a RESTful manner.

- *

Note: this parameter will automatically be set to true if the - * {@link Ext.data.Store} it is plugged into is set to restful: true. If the - * Store is RESTful, there is no need to set this option on the proxy.

- *

RESTful implementations enable the serverside framework to automatically route - * actions sent to one url based upon the HTTP method, for example: - *


-store: new Ext.data.Store({
-    restful: true,
-    proxy: new Ext.data.HttpProxy({url:'/users'}); // all requests sent to /users
-    ...
-)}
-     * 
- * If there is no {@link #api} specified in the configuration of the proxy, - * all requests will be marshalled to a single RESTful url (/users) so the serverside - * framework can inspect the HTTP Method and act accordingly: - *
-Method   url        action
-POST     /users     create
-GET      /users     read
-PUT      /users/23  update
-DESTROY  /users/23  delete
-     * 

- *

If set to true, a {@link Ext.data.Record#phantom non-phantom} record's - * {@link Ext.data.Record#id id} will be appended to the url. Some MVC (e.g., Ruby on Rails, - * Merb and Django) support segment based urls where the segments in the URL follow the - * Model-View-Controller approach:


-     * someSite.com/controller/action/id
-     * 
- * Where the segments in the url are typically:
    - *
  • The first segment : represents the controller class that should be invoked.
  • - *
  • The second segment : represents the class function, or method, that should be called.
  • - *
  • The third segment : represents the ID (a variable typically passed to the method).
  • - *

- *

Refer to {@link Ext.data.DataProxy#api} for additional information.

- */ - restful: false, - - /** - *

Redefines the Proxy's API or a single action of an API. Can be called with two method signatures.

- *

If called with an object as the only parameter, the object should redefine the entire API, e.g.:


-proxy.setApi({
-    read    : '/users/read',
-    create  : '/users/create',
-    update  : '/users/update',
-    destroy : '/users/destroy'
-});
-
- *

If called with two parameters, the first parameter should be a string specifying the API action to - * redefine and the second parameter should be the URL (or function if using DirectProxy) to call for that action, e.g.:


-proxy.setApi(Ext.data.Api.actions.read, '/users/new_load_url');
-
- * @param {String/Object} api An API specification object, or the name of an action. - * @param {String/Function} url The URL (or function if using DirectProxy) to call for the action. - */ - setApi : function() { - if (arguments.length == 1) { - var valid = Ext.data.Api.isValid(arguments[0]); - if (valid === true) { - this.api = arguments[0]; - } - else { - throw new Ext.data.Api.Error('invalid', valid); - } - } - else if (arguments.length == 2) { - if (!Ext.data.Api.isAction(arguments[0])) { - throw new Ext.data.Api.Error('invalid', arguments[0]); - } - this.api[arguments[0]] = arguments[1]; - } - Ext.data.Api.prepare(this); - }, - - /** - * Returns true if the specified action is defined as a unique action in the api-config. - * request. If all API-actions are routed to unique urls, the xaction parameter is unecessary. However, if no api is defined - * and all Proxy actions are routed to DataProxy#url, the server-side will require the xaction parameter to perform a switch to - * the corresponding code for CRUD action. - * @param {String [Ext.data.Api.CREATE|READ|UPDATE|DESTROY]} action - * @return {Boolean} - */ - isApiAction : function(action) { - return (this.api[action]) ? true : false; - }, - - /** - * All proxy actions are executed through this method. Automatically fires the "before" + action event - * @param {String} action Name of the action - * @param {Ext.data.Record/Ext.data.Record[]/null} rs Will be null when action is 'load' - * @param {Object} params - * @param {Ext.data.DataReader} reader - * @param {Function} callback - * @param {Object} scope The scope (this reference) in which the callback function is executed. Defaults to the Proxy object. - * @param {Object} options Any options specified for the action (e.g. see {@link Ext.data.Store#load}. - */ - request : function(action, rs, params, reader, callback, scope, options) { - if (!this.api[action] && !this.load) { - throw new Ext.data.DataProxy.Error('action-undefined', action); - } - params = params || {}; - if ((action === Ext.data.Api.actions.read) ? this.fireEvent("beforeload", this, params) : this.fireEvent("beforewrite", this, action, rs, params) !== false) { - this.doRequest.apply(this, arguments); - } - else { - callback.call(scope || this, null, options, false); - } - }, - - - /** - * Deprecated load method using old method signature. See {@doRequest} for preferred method. - * @deprecated - * @param {Object} params - * @param {Object} reader - * @param {Object} callback - * @param {Object} scope - * @param {Object} arg - */ - load : null, - - /** - * @cfg {Function} doRequest Abstract method that should be implemented in all subclasses. Note: Should only be used by custom-proxy developers. - * (e.g.: {@link Ext.data.HttpProxy#doRequest HttpProxy.doRequest}, - * {@link Ext.data.DirectProxy#doRequest DirectProxy.doRequest}). - */ - doRequest : function(action, rs, params, reader, callback, scope, options) { - // default implementation of doRequest for backwards compatibility with 2.0 proxies. - // If we're executing here, the action is probably "load". - // Call with the pre-3.0 method signature. - this.load(params, reader, callback, scope, options); - }, - - /** - * @cfg {Function} onRead Abstract method that should be implemented in all subclasses. Note: Should only be used by custom-proxy developers. Callback for read {@link Ext.data.Api#actions action}. - * @param {String} action Action name as per {@link Ext.data.Api.actions#read}. - * @param {Object} o The request transaction object - * @param {Object} res The server response - * @fires loadexception (deprecated) - * @fires exception - * @fires load - * @protected - */ - onRead : Ext.emptyFn, - /** - * @cfg {Function} onWrite Abstract method that should be implemented in all subclasses. Note: Should only be used by custom-proxy developers. Callback for create, update and destroy {@link Ext.data.Api#actions actions}. - * @param {String} action [Ext.data.Api.actions.create|read|update|destroy] - * @param {Object} trans The request transaction object - * @param {Object} res The server response - * @fires exception - * @fires write - * @protected - */ - onWrite : Ext.emptyFn, - /** - * buildUrl - * Sets the appropriate url based upon the action being executed. If restful is true, and only a single record is being acted upon, - * url will be built Rails-style, as in "/controller/action/32". restful will aply iff the supplied record is an - * instance of Ext.data.Record rather than an Array of them. - * @param {String} action The api action being executed [read|create|update|destroy] - * @param {Ext.data.Record/Ext.data.Record[]} record The record or Array of Records being acted upon. - * @return {String} url - * @private - */ - buildUrl : function(action, record) { - record = record || null; - - // conn.url gets nullified after each request. If it's NOT null here, that means the user must have intervened with a call - // to DataProxy#setUrl or DataProxy#setApi and changed it before the request was executed. If that's the case, use conn.url, - // otherwise, build the url from the api or this.url. - var url = (this.conn && this.conn.url) ? this.conn.url : (this.api[action]) ? this.api[action].url : this.url; - if (!url) { - throw new Ext.data.Api.Error('invalid-url', action); - } - - // look for urls having "provides" suffix used in some MVC frameworks like Rails/Merb and others. The provides suffice informs - // the server what data-format the client is dealing with and returns data in the same format (eg: application/json, application/xml, etc) - // e.g.: /users.json, /users.xml, etc. - // with restful routes, we need urls like: - // PUT /users/1.json - // DELETE /users/1.json - var provides = null; - var m = url.match(/(.*)(\.json|\.xml|\.html)$/); - if (m) { - provides = m[2]; // eg ".json" - url = m[1]; // eg: "/users" - } - // prettyUrls is deprectated in favor of restful-config - if ((this.restful === true || this.prettyUrls === true) && record instanceof Ext.data.Record && !record.phantom) { - url += '/' + record.id; - } - return (provides === null) ? url : url + provides; - }, - - /** - * Destroys the proxy by purging any event listeners and cancelling any active requests. - */ - destroy: function(){ - this.purgeListeners(); - } -}); - -// Apply the Observable prototype to the DataProxy class so that proxy instances can relay their -// events to the class. Allows for centralized listening of all proxy instances upon the DataProxy class. -Ext.apply(Ext.data.DataProxy, Ext.util.Observable.prototype); -Ext.util.Observable.call(Ext.data.DataProxy); - -/** - * @class Ext.data.DataProxy.Error - * @extends Ext.Error - * DataProxy Error extension. - * constructor - * @param {String} message Message describing the error. - * @param {Record/Record[]} arg - */ -Ext.data.DataProxy.Error = Ext.extend(Ext.Error, { - constructor : function(message, arg) { - this.arg = arg; - Ext.Error.call(this, message); - }, - name: 'Ext.data.DataProxy' -}); -Ext.apply(Ext.data.DataProxy.Error.prototype, { - lang: { - 'action-undefined': "DataProxy attempted to execute an API-action but found an undefined url / function. Please review your Proxy url/api-configuration.", - 'api-invalid': 'Recieved an invalid API-configuration. Please ensure your proxy API-configuration contains only the actions from Ext.data.Api.actions.' - } -}); - - diff --git a/assets/js/ext/src/data/DataReader.js b/assets/js/ext/src/data/DataReader.js deleted file mode 100644 index 09cfc41..0000000 --- a/assets/js/ext/src/data/DataReader.js +++ /dev/null @@ -1,228 +0,0 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.com/license - */ -/** - * @class Ext.data.DataReader - * Abstract base class for reading structured data from a data source and converting - * it into an object containing {@link Ext.data.Record} objects and metadata for use - * by an {@link Ext.data.Store}. This class is intended to be extended and should not - * be created directly. For existing implementations, see {@link Ext.data.ArrayReader}, - * {@link Ext.data.JsonReader} and {@link Ext.data.XmlReader}. - * @constructor Create a new DataReader - * @param {Object} meta Metadata configuration options (implementation-specific). - * @param {Array/Object} recordType - *

Either an Array of {@link Ext.data.Field Field} definition objects (which - * will be passed to {@link Ext.data.Record#create}, or a {@link Ext.data.Record Record} - * constructor created using {@link Ext.data.Record#create}.

- */ -Ext.data.DataReader = function(meta, recordType){ - /** - * This DataReader's configured metadata as passed to the constructor. - * @type Mixed - * @property meta - */ - this.meta = meta; - /** - * @cfg {Array/Object} fields - *

Either an Array of {@link Ext.data.Field Field} definition objects (which - * will be passed to {@link Ext.data.Record#create}, or a {@link Ext.data.Record Record} - * constructor created from {@link Ext.data.Record#create}.

- */ - this.recordType = Ext.isArray(recordType) ? - Ext.data.Record.create(recordType) : recordType; - - // if recordType defined make sure extraction functions are defined - if (this.recordType){ - this.buildExtractors(); - } -}; - -Ext.data.DataReader.prototype = { - /** - * @cfg {String} messageProperty [undefined] Optional name of a property within a server-response that represents a user-feedback message. - */ - /** - * Abstract method created in extension's buildExtractors impl. - */ - getTotal: Ext.emptyFn, - /** - * Abstract method created in extension's buildExtractors impl. - */ - getRoot: Ext.emptyFn, - /** - * Abstract method created in extension's buildExtractors impl. - */ - getMessage: Ext.emptyFn, - /** - * Abstract method created in extension's buildExtractors impl. - */ - getSuccess: Ext.emptyFn, - /** - * Abstract method created in extension's buildExtractors impl. - */ - getId: Ext.emptyFn, - /** - * Abstract method, overridden in DataReader extensions such as {@link Ext.data.JsonReader} and {@link Ext.data.XmlReader} - */ - buildExtractors : Ext.emptyFn, - /** - * Abstract method overridden in DataReader extensions such as {@link Ext.data.JsonReader} and {@link Ext.data.XmlReader} - */ - extractValues : Ext.emptyFn, - - /** - * Used for un-phantoming a record after a successful database insert. Sets the records pk along with new data from server. - * You must return at least the database pk using the idProperty defined in your DataReader configuration. The incoming - * data from server will be merged with the data in the local record. - * In addition, you must return record-data from the server in the same order received. - * Will perform a commit as well, un-marking dirty-fields. Store's "update" event will be suppressed. - * @param {Record/Record[]} record The phantom record to be realized. - * @param {Object/Object[]} data The new record data to apply. Must include the primary-key from database defined in idProperty field. - */ - realize: function(rs, data){ - if (Ext.isArray(rs)) { - for (var i = rs.length - 1; i >= 0; i--) { - // recurse - if (Ext.isArray(data)) { - this.realize(rs.splice(i,1).shift(), data.splice(i,1).shift()); - } - else { - // weird...rs is an array but data isn't?? recurse but just send in the whole invalid data object. - // the else clause below will detect !this.isData and throw exception. - this.realize(rs.splice(i,1).shift(), data); - } - } - } - else { - // If rs is NOT an array but data IS, see if data contains just 1 record. If so extract it and carry on. - if (Ext.isArray(data) && data.length == 1) { - data = data.shift(); - } - if (!this.isData(data)) { - // TODO: Let exception-handler choose to commit or not rather than blindly rs.commit() here. - //rs.commit(); - throw new Ext.data.DataReader.Error('realize', rs); - } - rs.phantom = false; // <-- That's what it's all about - rs._phid = rs.id; // <-- copy phantom-id -> _phid, so we can remap in Store#onCreateRecords - rs.id = this.getId(data); - rs.data = data; - - rs.commit(); - } - }, - - /** - * Used for updating a non-phantom or "real" record's data with fresh data from server after remote-save. - * If returning data from multiple-records after a batch-update, you must return record-data from the server in - * the same order received. Will perform a commit as well, un-marking dirty-fields. Store's "update" event will be - * suppressed as the record receives fresh new data-hash - * @param {Record/Record[]} rs - * @param {Object/Object[]} data - */ - update : function(rs, data) { - if (Ext.isArray(rs)) { - for (var i=rs.length-1; i >= 0; i--) { - if (Ext.isArray(data)) { - this.update(rs.splice(i,1).shift(), data.splice(i,1).shift()); - } - else { - // weird...rs is an array but data isn't?? recurse but just send in the whole data object. - // the else clause below will detect !this.isData and throw exception. - this.update(rs.splice(i,1).shift(), data); - } - } - } - else { - // If rs is NOT an array but data IS, see if data contains just 1 record. If so extract it and carry on. - if (Ext.isArray(data) && data.length == 1) { - data = data.shift(); - } - if (this.isData(data)) { - rs.data = Ext.apply(rs.data, data); - } - rs.commit(); - } - }, - - /** - * returns extracted, type-cast rows of data. Iterates to call #extractValues for each row - * @param {Object[]/Object} data-root from server response - * @param {Boolean} returnRecords [false] Set true to return instances of Ext.data.Record - * @private - */ - extractData : function(root, returnRecords) { - // A bit ugly this, too bad the Record's raw data couldn't be saved in a common property named "raw" or something. - var rawName = (this instanceof Ext.data.JsonReader) ? 'json' : 'node'; - - var rs = []; - - // Had to add Check for XmlReader, #isData returns true if root is an Xml-object. Want to check in order to re-factor - // #extractData into DataReader base, since the implementations are almost identical for JsonReader, XmlReader - if (this.isData(root) && !(this instanceof Ext.data.XmlReader)) { - root = [root]; - } - var f = this.recordType.prototype.fields, - fi = f.items, - fl = f.length, - rs = []; - if (returnRecords === true) { - var Record = this.recordType; - for (var i = 0; i < root.length; i++) { - var n = root[i]; - var record = new Record(this.extractValues(n, fi, fl), this.getId(n)); - record[rawName] = n; // <-- There's implementation of ugly bit, setting the raw record-data. - rs.push(record); - } - } - else { - for (var i = 0; i < root.length; i++) { - var data = this.extractValues(root[i], fi, fl); - data[this.meta.idProperty] = this.getId(root[i]); - rs.push(data); - } - } - return rs; - }, - - /** - * Returns true if the supplied data-hash looks and quacks like data. Checks to see if it has a key - * corresponding to idProperty defined in your DataReader config containing non-empty pk. - * @param {Object} data - * @return {Boolean} - */ - isData : function(data) { - return (data && Ext.isObject(data) && !Ext.isEmpty(this.getId(data))) ? true : false; - }, - - // private function a store will createSequence upon - onMetaChange : function(meta){ - delete this.ef; - this.meta = meta; - this.recordType = Ext.data.Record.create(meta.fields); - this.buildExtractors(); - } -}; - -/** - * @class Ext.data.DataReader.Error - * @extends Ext.Error - * General error class for Ext.data.DataReader - */ -Ext.data.DataReader.Error = Ext.extend(Ext.Error, { - constructor : function(message, arg) { - this.arg = arg; - Ext.Error.call(this, message); - }, - name: 'Ext.data.DataReader' -}); -Ext.apply(Ext.data.DataReader.Error.prototype, { - lang : { - 'update': "#update received invalid data from server. Please see docs for DataReader#update and review your DataReader configuration.", - 'realize': "#realize was called with invalid remote-data. Please see the docs for DataReader#realize and review your DataReader configuration.", - 'invalid-response': "#readResponse received an invalid response from the server." - } -}); diff --git a/assets/js/ext/src/data/DataWriter.js b/assets/js/ext/src/data/DataWriter.js deleted file mode 100644 index deb8224..0000000 --- a/assets/js/ext/src/data/DataWriter.js +++ /dev/null @@ -1,210 +0,0 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.com/license - */ -/** - * @class Ext.data.DataWriter - *

Ext.data.DataWriter facilitates create, update, and destroy actions between - * an Ext.data.Store and a server-side framework. A Writer enabled Store will - * automatically manage the Ajax requests to perform CRUD actions on a Store.

- *

Ext.data.DataWriter is an abstract base class which is intended to be extended - * and should not be created directly. For existing implementations, see - * {@link Ext.data.JsonWriter}.

- *

Creating a writer is simple:

- *

-var writer = new Ext.data.JsonWriter({
-    encode: false   // <--- false causes data to be printed to jsonData config-property of Ext.Ajax#reqeust
-});
- * 
- * *

Same old JsonReader as Ext-2.x:

- *

-var reader = new Ext.data.JsonReader({idProperty: 'id'}, [{name: 'first'}, {name: 'last'}, {name: 'email'}]);
- * 
- * - *

The proxy for a writer enabled store can be configured with a simple url:

- *

-// Create a standard HttpProxy instance.
-var proxy = new Ext.data.HttpProxy({
-    url: 'app.php/users'    // <--- Supports "provides"-type urls, such as '/users.json', '/products.xml' (Hello Rails/Merb)
-});
- * 
- *

For finer grained control, the proxy may also be configured with an API:

- *

-// Maximum flexibility with the API-configuration
-var proxy = new Ext.data.HttpProxy({
-    api: {
-        read    : 'app.php/users/read',
-        create  : 'app.php/users/create',
-        update  : 'app.php/users/update',
-        destroy : {  // <--- Supports object-syntax as well
-            url: 'app.php/users/destroy',
-            method: "DELETE"
-        }
-    }
-});
- * 
- *

Pulling it all together into a Writer-enabled Store:

- *

-var store = new Ext.data.Store({
-    proxy: proxy,
-    reader: reader,
-    writer: writer,
-    autoLoad: true,
-    autoSave: true  // -- Cell-level updates.
-});
- * 
- *

Initiating write-actions automatically, using the existing Ext2.0 Store/Record API:

- *

-var rec = store.getAt(0);
-rec.set('email', 'foo@bar.com');  // <--- Immediately initiates an UPDATE action through configured proxy.
-
-store.remove(rec);  // <---- Immediately initiates a DESTROY action through configured proxy.
- * 
- *

For record/batch updates, use the Store-configuration {@link Ext.data.Store#autoSave autoSave:false}

- *

-var store = new Ext.data.Store({
-    proxy: proxy,
-    reader: reader,
-    writer: writer,
-    autoLoad: true,
-    autoSave: false  // -- disable cell-updates
-});
-
-var urec = store.getAt(0);
-urec.set('email', 'foo@bar.com');
-
-var drec = store.getAt(1);
-store.remove(drec);
-
-// Push the button!
-store.save();
- * 
- * @constructor Create a new DataWriter - * @param {Object} meta Metadata configuration options (implementation-specific) - * @param {Object} recordType Either an Array of field definition objects as specified - * in {@link Ext.data.Record#create}, or an {@link Ext.data.Record} object created - * using {@link Ext.data.Record#create}. - */ -Ext.data.DataWriter = function(config){ - Ext.apply(this, config); -}; -Ext.data.DataWriter.prototype = { - - /** - * @cfg {Boolean} writeAllFields - * false by default. Set true to have DataWriter return ALL fields of a modified - * record -- not just those that changed. - * false to have DataWriter only request modified fields from a record. - */ - writeAllFields : false, - /** - * @cfg {Boolean} listful - * false by default. Set true to have the DataWriter always write HTTP params as a list, - * even when acting upon a single record. - */ - listful : false, // <-- listful is actually not used internally here in DataWriter. @see Ext.data.Store#execute. - - /** - * Compiles a Store recordset into a data-format defined by an extension such as {@link Ext.data.JsonWriter} or {@link Ext.data.XmlWriter} in preparation for a {@link Ext.data.Api#actions server-write action}. The first two params are similar similar in nature to {@link Ext#apply}, - * Where the first parameter is the receiver of paramaters and the second, baseParams, the source. - * @param {Object} params The request-params receiver. - * @param {Object} baseParams as defined by {@link Ext.data.Store#baseParams}. The baseParms must be encoded by the extending class, eg: {@link Ext.data.JsonWriter}, {@link Ext.data.XmlWriter}. - * @param {String} action [{@link Ext.data.Api#actions create|update|destroy}] - * @param {Record/Record[]} rs The recordset to write, the subject(s) of the write action. - */ - apply : function(params, baseParams, action, rs) { - var data = [], - renderer = action + 'Record'; - // TODO implement @cfg listful here - if (Ext.isArray(rs)) { - Ext.each(rs, function(rec){ - data.push(this[renderer](rec)); - }, this); - } - else if (rs instanceof Ext.data.Record) { - data = this[renderer](rs); - } - this.render(params, baseParams, data); - }, - - /** - * abstract method meant to be overridden by all DataWriter extensions. It's the extension's job to apply the "data" to the "params". - * The data-object provided to render is populated with data according to the meta-info defined in the user's DataReader config, - * @param {String} action [Ext.data.Api.actions.create|read|update|destroy] - * @param {Record[]} rs Store recordset - * @param {Object} params Http params to be sent to server. - * @param {Object} data object populated according to DataReader meta-data. - */ - render : Ext.emptyFn, - - /** - * @cfg {Function} updateRecord Abstract method that should be implemented in all subclasses - * (e.g.: {@link Ext.data.JsonWriter#updateRecord JsonWriter.updateRecord} - */ - updateRecord : Ext.emptyFn, - - /** - * @cfg {Function} createRecord Abstract method that should be implemented in all subclasses - * (e.g.: {@link Ext.data.JsonWriter#createRecord JsonWriter.createRecord}) - */ - createRecord : Ext.emptyFn, - - /** - * @cfg {Function} destroyRecord Abstract method that should be implemented in all subclasses - * (e.g.: {@link Ext.data.JsonWriter#destroyRecord JsonWriter.destroyRecord}) - */ - destroyRecord : Ext.emptyFn, - - /** - * Converts a Record to a hash, taking into account the state of the Ext.data.Record along with configuration properties - * related to its rendering, such as {@link #writeAllFields}, {@link Ext.data.Record#phantom phantom}, {@link Ext.data.Record#getChanges getChanges} and - * {@link Ext.data.DataReader#idProperty idProperty} - * @param {Ext.data.Record} rec The Record from which to create a hash. - * @param {Object} config NOT YET IMPLEMENTED. Will implement an exlude/only configuration for fine-control over which fields do/don't get rendered. - * @return {Object} - * @protected - * TODO Implement excludes/only configuration with 2nd param? - */ - toHash : function(rec, config) { - var map = rec.fields.map, - data = {}, - raw = (this.writeAllFields === false && rec.phantom === false) ? rec.getChanges() : rec.data, - m; - Ext.iterate(raw, function(prop, value){ - if((m = map[prop])){ - data[m.mapping ? m.mapping : m.name] = value; - } - }); - // we don't want to write Ext auto-generated id to hash. Careful not to remove it on Models not having auto-increment pk though. - // We can tell its not auto-increment if the user defined a DataReader field for it *and* that field's value is non-empty. - // we could also do a RegExp here for the Ext.data.Record AUTO_ID prefix. - if (rec.phantom) { - if (rec.fields.containsKey(this.meta.idProperty) && Ext.isEmpty(rec.data[this.meta.idProperty])) { - delete data[this.meta.idProperty]; - } - } else { - data[this.meta.idProperty] = rec.id; - } - return data; - }, - - /** - * Converts a {@link Ext.data.DataWriter#toHash Hashed} {@link Ext.data.Record} to fields-array array suitable - * for encoding to xml via XTemplate, eg: -
<tpl for="."><{name}>{value}</{name}</tpl>
- * eg, non-phantom: -
{id: 1, first: 'foo', last: 'bar'} --> [{name: 'id', value: 1}, {name: 'first', value: 'foo'}, {name: 'last', value: 'bar'}]
- * {@link Ext.data.Record#phantom Phantom} records will have had their idProperty omitted in {@link #toHash} if determined to be auto-generated. - * Non AUTOINCREMENT pks should have been protected. - * @param {Hash} data Hashed by Ext.data.DataWriter#toHash - * @return {[Object]} Array of attribute-objects. - * @protected - */ - toArray : function(data) { - var fields = []; - Ext.iterate(data, function(k, v) {fields.push({name: k, value: v});},this); - return fields; - } -}; \ No newline at end of file diff --git a/assets/js/ext/src/data/DirectProxy.js b/assets/js/ext/src/data/DirectProxy.js deleted file mode 100644 index 25addc6..0000000 --- a/assets/js/ext/src/data/DirectProxy.js +++ /dev/null @@ -1,173 +0,0 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.com/license - */ -/** - * @class Ext.data.DirectProxy - * @extends Ext.data.DataProxy - */ -Ext.data.DirectProxy = function(config){ - Ext.apply(this, config); - if(typeof this.paramOrder == 'string'){ - this.paramOrder = this.paramOrder.split(/[\s,|]/); - } - Ext.data.DirectProxy.superclass.constructor.call(this, config); -}; - -Ext.extend(Ext.data.DirectProxy, Ext.data.DataProxy, { - /** - * @cfg {Array/String} paramOrder Defaults to undefined. A list of params to be executed - * server side. Specify the params in the order in which they must be executed on the server-side - * as either (1) an Array of String values, or (2) a String of params delimited by either whitespace, - * comma, or pipe. For example, - * any of the following would be acceptable:

-paramOrder: ['param1','param2','param3']
-paramOrder: 'param1 param2 param3'
-paramOrder: 'param1,param2,param3'
-paramOrder: 'param1|param2|param'
-     
- */ - paramOrder: undefined, - - /** - * @cfg {Boolean} paramsAsHash - * Send parameters as a collection of named arguments (defaults to true). Providing a - * {@link #paramOrder} nullifies this configuration. - */ - paramsAsHash: true, - - /** - * @cfg {Function} directFn - * Function to call when executing a request. directFn is a simple alternative to defining the api configuration-parameter - * for Store's which will not implement a full CRUD api. - */ - directFn : undefined, - - /** - * DirectProxy implementation of {@link Ext.data.DataProxy#doRequest} - * @param {String} action The crud action type (create, read, update, destroy) - * @param {Ext.data.Record/Ext.data.Record[]} rs If action is load, rs will be null - * @param {Object} params An object containing properties which are to be used as HTTP parameters - * for the request to the remote server. - * @param {Ext.data.DataReader} reader The Reader object which converts the data - * object into a block of Ext.data.Records. - * @param {Function} callback - *

A function to be called after the request. - * The callback is passed the following arguments:

    - *
  • r : Ext.data.Record[] The block of Ext.data.Records.
  • - *
  • options: Options object from the action request
  • - *
  • success: Boolean success indicator

- * @param {Object} scope The scope (this reference) in which the callback function is executed. Defaults to the browser window. - * @param {Object} arg An optional argument which is passed to the callback as its second parameter. - * @protected - */ - doRequest : function(action, rs, params, reader, callback, scope, options) { - var args = [], - directFn = this.api[action] || this.directFn; - - switch (action) { - case Ext.data.Api.actions.create: - args.push(params.jsonData); // <-- create(Hash) - break; - case Ext.data.Api.actions.read: - // If the method has no parameters, ignore the paramOrder/paramsAsHash. - if(directFn.directCfg.method.len > 0){ - if(this.paramOrder){ - for(var i = 0, len = this.paramOrder.length; i < len; i++){ - args.push(params[this.paramOrder[i]]); - } - }else if(this.paramsAsHash){ - args.push(params); - } - } - break; - case Ext.data.Api.actions.update: - args.push(params.jsonData); // <-- update(Hash/Hash[]) - break; - case Ext.data.Api.actions.destroy: - args.push(params.jsonData); // <-- destroy(Int/Int[]) - break; - } - - var trans = { - params : params || {}, - request: { - callback : callback, - scope : scope, - arg : options - }, - reader: reader - }; - - args.push(this.createCallback(action, rs, trans), this); - directFn.apply(window, args); - }, - - // private - createCallback : function(action, rs, trans) { - var me = this; - return function(result, res) { - if (!res.status) { - // @deprecated fire loadexception - if (action === Ext.data.Api.actions.read) { - me.fireEvent("loadexception", me, trans, res, null); - } - me.fireEvent('exception', me, 'remote', action, trans, res, null); - trans.request.callback.call(trans.request.scope, null, trans.request.arg, false); - return; - } - if (action === Ext.data.Api.actions.read) { - me.onRead(action, trans, result, res); - } else { - me.onWrite(action, trans, result, res, rs); - } - }; - }, - - /** - * Callback for read actions - * @param {String} action [Ext.data.Api.actions.create|read|update|destroy] - * @param {Object} trans The request transaction object - * @param {Object} result Data object picked out of the server-response. - * @param {Object} res The server response - * @protected - */ - onRead : function(action, trans, result, res) { - var records; - try { - records = trans.reader.readRecords(result); - } - catch (ex) { - // @deprecated: Fire old loadexception for backwards-compat. - this.fireEvent("loadexception", this, trans, res, ex); - - this.fireEvent('exception', this, 'response', action, trans, res, ex); - trans.request.callback.call(trans.request.scope, null, trans.request.arg, false); - return; - } - this.fireEvent("load", this, res, trans.request.arg); - trans.request.callback.call(trans.request.scope, records, trans.request.arg, true); - }, - /** - * Callback for write actions - * @param {String} action [{@link Ext.data.Api#actions create|read|update|destroy}] - * @param {Object} trans The request transaction object - * @param {Object} result Data object picked out of the server-response. - * @param {Object} res The server response - * @param {Ext.data.Record/[Ext.data.Record]} rs The Store resultset associated with the action. - * @protected - */ - onWrite : function(action, trans, result, res, rs) { - var data = trans.reader.extractData(trans.reader.getRoot(result), false); - var success = trans.reader.getSuccess(result); - success = (success !== false); - if (success){ - this.fireEvent("write", this, action, data, res, rs, trans.request.arg); - }else{ - this.fireEvent('exception', this, 'remote', action, trans, result, rs); - } - trans.request.callback.call(trans.request.scope, data, res, success); - } -}); diff --git a/assets/js/ext/src/data/DirectStore.js b/assets/js/ext/src/data/DirectStore.js deleted file mode 100644 index 9e4421d..0000000 --- a/assets/js/ext/src/data/DirectStore.js +++ /dev/null @@ -1,54 +0,0 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.com/license - */ -/** - * @class Ext.data.DirectStore - * @extends Ext.data.Store - *

Small helper class to create an {@link Ext.data.Store} configured with an - * {@link Ext.data.DirectProxy} and {@link Ext.data.JsonReader} to make interacting - * with an {@link Ext.Direct} Server-side {@link Ext.direct.Provider Provider} easier. - * To create a different proxy/reader combination create a basic {@link Ext.data.Store} - * configured as needed.

- * - *

*Note: Although they are not listed, this class inherits all of the config options of:

- *
    - *
  • {@link Ext.data.Store Store}
  • - *
      - * - *
    - *
  • {@link Ext.data.JsonReader JsonReader}
  • - *
      - *
    • {@link Ext.data.JsonReader#root root}
    • - *
    • {@link Ext.data.JsonReader#idProperty idProperty}
    • - *
    • {@link Ext.data.JsonReader#totalProperty totalProperty}
    • - *
    - * - *
  • {@link Ext.data.DirectProxy DirectProxy}
  • - *
      - *
    • {@link Ext.data.DirectProxy#directFn directFn}
    • - *
    • {@link Ext.data.DirectProxy#paramOrder paramOrder}
    • - *
    • {@link Ext.data.DirectProxy#paramsAsHash paramsAsHash}
    • - *
    - *
- * - * @xtype directstore - * - * @constructor - * @param {Object} config - */ -Ext.data.DirectStore = Ext.extend(Ext.data.Store, { - constructor : function(config){ - // each transaction upon a singe record will generate a distinct Direct transaction since Direct queues them into one Ajax request. - var c = Ext.apply({}, { - batchTransactions: false - }, config); - Ext.data.DirectStore.superclass.constructor.call(this, Ext.apply(c, { - proxy: Ext.isDefined(c.proxy) ? c.proxy : new Ext.data.DirectProxy(Ext.copyTo({}, c, 'paramOrder,paramsAsHash,directFn,api')), - reader: (!Ext.isDefined(c.reader) && c.fields) ? new Ext.data.JsonReader(Ext.copyTo({}, c, 'totalProperty,root,idProperty'), c.fields) : c.reader - })); - } -}); -Ext.reg('directstore', Ext.data.DirectStore); diff --git a/assets/js/ext/src/data/GroupingStore.js b/assets/js/ext/src/data/GroupingStore.js deleted file mode 100644 index d07bf73..0000000 --- a/assets/js/ext/src/data/GroupingStore.js +++ /dev/null @@ -1,263 +0,0 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.com/license - */ -/** - * @class Ext.data.GroupingStore - * @extends Ext.data.Store - * A specialized store implementation that provides for grouping records by one of the available fields. This - * is usually used in conjunction with an {@link Ext.grid.GroupingView} to provide the data model for - * a grouped GridPanel. - * - * Internally, GroupingStore is simply a normal Store with multi sorting enabled from the start. The grouping field - * and direction are always injected as the first sorter pair. GroupingView picks up on the configured groupField and - * builds grid rows appropriately. - * - * @constructor - * Creates a new GroupingStore. - * @param {Object} config A config object containing the objects needed for the Store to access data, - * and read the data into Records. - * @xtype groupingstore - */ -Ext.data.GroupingStore = Ext.extend(Ext.data.Store, { - - //inherit docs - constructor: function(config) { - config = config || {}; - - //We do some preprocessing here to massage the grouping + sorting options into a single - //multi sort array. If grouping and sorting options are both presented to the constructor, - //the sorters array consists of the grouping sorter object followed by the sorting sorter object - //see Ext.data.Store's sorting functions for details about how multi sorting works - this.hasMultiSort = true; - this.multiSortInfo = this.multiSortInfo || {sorters: []}; - - var sorters = this.multiSortInfo.sorters, - groupField = config.groupField || this.groupField, - sortInfo = config.sortInfo || this.sortInfo, - groupDir = config.groupDir || this.groupDir; - - //add the grouping sorter object first - if(groupField){ - sorters.push({ - field : groupField, - direction: groupDir - }); - } - - //add the sorting sorter object if it is present - if (sortInfo) { - sorters.push(sortInfo); - } - - Ext.data.GroupingStore.superclass.constructor.call(this, config); - - this.addEvents( - /** - * @event groupchange - * Fired whenever a call to store.groupBy successfully changes the grouping on the store - * @param {Ext.data.GroupingStore} store The grouping store - * @param {String} groupField The field that the store is now grouped by - */ - 'groupchange' - ); - - this.applyGroupField(); - }, - - /** - * @cfg {String} groupField - * The field name by which to sort the store's data (defaults to ''). - */ - /** - * @cfg {Boolean} remoteGroup - * True if the grouping should apply on the server side, false if it is local only (defaults to false). If the - * grouping is local, it can be applied immediately to the data. If it is remote, then it will simply act as a - * helper, automatically sending the grouping field name as the 'groupBy' param with each XHR call. - */ - remoteGroup : false, - /** - * @cfg {Boolean} groupOnSort - * True to sort the data on the grouping field when a grouping operation occurs, false to sort based on the - * existing sort info (defaults to false). - */ - groupOnSort:false, - - /** - * @cfg {String} groupDir - * The direction to sort the groups. Defaults to 'ASC'. - */ - groupDir : 'ASC', - - /** - * Clears any existing grouping and refreshes the data using the default sort. - */ - clearGrouping : function(){ - this.groupField = false; - - if(this.remoteGroup){ - if(this.baseParams){ - delete this.baseParams.groupBy; - delete this.baseParams.groupDir; - } - var lo = this.lastOptions; - if(lo && lo.params){ - delete lo.params.groupBy; - delete lo.params.groupDir; - } - - this.reload(); - }else{ - this.sort(); - this.fireEvent('datachanged', this); - } - }, - - /** - * Groups the data by the specified field. - * @param {String} field The field name by which to sort the store's data - * @param {Boolean} forceRegroup (optional) True to force the group to be refreshed even if the field passed - * in is the same as the current grouping field, false to skip grouping on the same field (defaults to false) - */ - groupBy : function(field, forceRegroup, direction) { - direction = direction ? (String(direction).toUpperCase() == 'DESC' ? 'DESC' : 'ASC') : this.groupDir; - - if (this.groupField == field && this.groupDir == direction && !forceRegroup) { - return; // already grouped by this field - } - - //check the contents of the first sorter. If the field matches the CURRENT groupField (before it is set to the new one), - //remove the sorter as it is actually the grouper. The new grouper is added back in by this.sort - var sorters = this.multiSortInfo.sorters; - if (sorters.length > 0 && sorters[0].field == this.groupField) { - sorters.shift(); - } - - this.groupField = field; - this.groupDir = direction; - this.applyGroupField(); - - var fireGroupEvent = function() { - this.fireEvent('groupchange', this, this.getGroupState()); - }; - - if (this.groupOnSort) { - this.sort(field, direction); - fireGroupEvent.call(this); - return; - } - - if (this.remoteGroup) { - this.on('load', fireGroupEvent, this, {single: true}); - this.reload(); - } else { - this.sort(sorters); - fireGroupEvent.call(this); - } - }, - - //GroupingStore always uses multisorting so we intercept calls to sort here to make sure that our grouping sorter object - //is always injected first. - sort : function(fieldName, dir) { - if (this.remoteSort) { - return Ext.data.GroupingStore.superclass.sort.call(this, fieldName, dir); - } - - var sorters = []; - - //cater for any existing valid arguments to this.sort, massage them into an array of sorter objects - if (Ext.isArray(arguments[0])) { - sorters = arguments[0]; - } else if (fieldName == undefined) { - //we preserve the existing sortInfo here because this.sort is called after - //clearGrouping and there may be existing sorting - sorters = this.sortInfo ? [this.sortInfo] : []; - } else { - //TODO: this is lifted straight from Ext.data.Store's singleSort function. It should instead be - //refactored into a common method if possible - var field = this.fields.get(fieldName); - if (!field) return false; - - var name = field.name, - sortInfo = this.sortInfo || null, - sortToggle = this.sortToggle ? this.sortToggle[name] : null; - - if (!dir) { - if (sortInfo && sortInfo.field == name) { // toggle sort dir - dir = (this.sortToggle[name] || 'ASC').toggle('ASC', 'DESC'); - } else { - dir = field.sortDir; - } - } - - this.sortToggle[name] = dir; - this.sortInfo = {field: name, direction: dir}; - - sorters = [this.sortInfo]; - } - - //add the grouping sorter object as the first multisort sorter - if (this.groupField) { - sorters.unshift({direction: this.groupDir, field: this.groupField}); - } - - return this.multiSort.call(this, sorters, dir); - }, - - /** - * @private - * Saves the current grouping field and direction to this.baseParams and this.lastOptions.params - * if we're using remote grouping. Does not actually perform any grouping - just stores values - */ - applyGroupField: function(){ - if (this.remoteGroup) { - if(!this.baseParams){ - this.baseParams = {}; - } - - Ext.apply(this.baseParams, { - groupBy : this.groupField, - groupDir: this.groupDir - }); - - var lo = this.lastOptions; - if (lo && lo.params) { - lo.params.groupDir = this.groupDir; - - //this is deleted because of a bug reported at http://www.extjs.com/forum/showthread.php?t=82907 - delete lo.params.groupBy; - } - } - }, - - /** - * @private - * TODO: This function is apparently never invoked anywhere in the framework. It has no documentation - * and should be considered for deletion - */ - applyGrouping : function(alwaysFireChange){ - if(this.groupField !== false){ - this.groupBy(this.groupField, true, this.groupDir); - return true; - }else{ - if(alwaysFireChange === true){ - this.fireEvent('datachanged', this); - } - return false; - } - }, - - /** - * @private - * Returns the grouping field that should be used. If groupOnSort is used this will be sortInfo's field, - * otherwise it will be this.groupField - * @return {String} The group field - */ - getGroupState : function(){ - return this.groupOnSort && this.groupField !== false ? - (this.sortInfo ? this.sortInfo.field : undefined) : this.groupField; - } -}); -Ext.reg('groupingstore', Ext.data.GroupingStore); diff --git a/assets/js/ext/src/data/HttpProxy.js b/assets/js/ext/src/data/HttpProxy.js deleted file mode 100644 index 3db34d3..0000000 --- a/assets/js/ext/src/data/HttpProxy.js +++ /dev/null @@ -1,261 +0,0 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.com/license - */ -/** - * @class Ext.data.HttpProxy - * @extends Ext.data.DataProxy - *

An implementation of {@link Ext.data.DataProxy} that processes data requests within the same - * domain of the originating page.

- *

Note: this class cannot be used to retrieve data from a domain other - * than the domain from which the running page was served. For cross-domain requests, use a - * {@link Ext.data.ScriptTagProxy ScriptTagProxy}.

- *

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 - * An {@link Ext.data.Connection} object, or options parameter to {@link Ext.Ajax#request}. - *

Note that if this HttpProxy is being used by a {@link Ext.data.Store Store}, then the - * Store's call to {@link #load} will override any specified callback and params - * options. In this case, use the Store's {@link Ext.data.Store#events events} to modify parameters, - * or react to loading events. The Store's {@link Ext.data.Store#baseParams baseParams} may also be - * used to pass parameters known at instantiation time.

- *

If an options parameter is passed, the singleton {@link Ext.Ajax} object will be used to make - * the request.

- */ -Ext.data.HttpProxy = function(conn){ - Ext.data.HttpProxy.superclass.constructor.call(this, conn); - - /** - * The Connection object (Or options parameter to {@link Ext.Ajax#request}) which this HttpProxy - * uses to make requests to the server. Properties of this object may be changed dynamically to - * change the way data is requested. - * @property - */ - this.conn = conn; - - // nullify the connection url. The url param has been copied to 'this' above. The connection - // url will be set during each execution of doRequest when buildUrl is called. This makes it easier for users to override the - // connection url during beforeaction events (ie: beforeload, beforewrite, etc). - // Url is always re-defined during doRequest. - this.conn.url = null; - - this.useAjax = !conn || !conn.events; - - // A hash containing active requests, keyed on action [Ext.data.Api.actions.create|read|update|destroy] - var actions = Ext.data.Api.actions; - this.activeRequest = {}; - for (var verb in actions) { - this.activeRequest[actions[verb]] = undefined; - } -}; - -Ext.extend(Ext.data.HttpProxy, Ext.data.DataProxy, { - /** - * Return the {@link Ext.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 ? Ext.Ajax : this.conn; - }, - - /** - * Used for overriding the url used for a single request. Designed to be called during a beforeaction event. Calling setUrl - * will override any urls set via the api configuration parameter. Set the optional parameter makePermanent to set the url for - * all subsequent requests. If not set to makePermanent, the next request will use the same url or api configuration defined - * in the initial proxy configuration. - * @param {String} url - * @param {Boolean} makePermanent (Optional) [false] - * - * (e.g.: beforeload, beforesave, etc). - */ - setUrl : function(url, makePermanent) { - this.conn.url = url; - if (makePermanent === true) { - this.url = url; - this.api = null; - Ext.data.Api.prepare(this); - } - }, - - /** - * HttpProxy implementation of DataProxy#doRequest - * @param {String} action The crud action type (create, read, update, destroy) - * @param {Ext.data.Record/Ext.data.Record[]} rs If action is load, rs will be null - * @param {Object} params An object containing properties which are to be used as HTTP parameters - * for the request to the remote server. - * @param {Ext.data.DataReader} reader The Reader object which converts the data - * object into a block of Ext.data.Records. - * @param {Function} callback - *

A function to be called after the request. - * The callback is passed the following arguments:

    - *
  • r : Ext.data.Record[] The block of Ext.data.Records.
  • - *
  • options: Options object from the action request
  • - *
  • success: Boolean success indicator

- * @param {Object} scope The scope (this reference) in which the callback function is executed. Defaults to the browser window. - * @param {Object} arg An optional argument which is passed to the callback as its second parameter. - * @protected - */ - doRequest : function(action, rs, params, reader, cb, scope, arg) { - var o = { - method: (this.api[action]) ? this.api[action]['method'] : undefined, - request: { - callback : cb, - scope : scope, - arg : arg - }, - reader: reader, - callback : this.createCallback(action, rs), - scope: this - }; - - // If possible, transmit data using jsonData || xmlData on Ext.Ajax.request (An installed DataWriter would have written it there.). - // Use std HTTP params otherwise. - if (params.jsonData) { - o.jsonData = params.jsonData; - } else if (params.xmlData) { - o.xmlData = params.xmlData; - } else { - o.params = params || {}; - } - // Set the connection url. If this.conn.url is not null here, - // the user must have overridden the url during a beforewrite/beforeload event-handler. - // this.conn.url is nullified after each request. - this.conn.url = this.buildUrl(action, rs); - - if(this.useAjax){ - - Ext.applyIf(o, this.conn); - - // If a currently running request is found for this action, abort it. - if (this.activeRequest[action]) { - //// - // Disabled aborting activeRequest while implementing REST. activeRequest[action] will have to become an array - // TODO ideas anyone? - // - //Ext.Ajax.abort(this.activeRequest[action]); - } - this.activeRequest[action] = Ext.Ajax.request(o); - }else{ - this.conn.request(o); - } - // request is sent, nullify the connection url in preparation for the next request - this.conn.url = null; - }, - - /** - * Returns a callback function for a request. Note a special case is made for the - * read action vs all the others. - * @param {String} action [create|update|delete|load] - * @param {Ext.data.Record[]} rs The Store-recordset being acted upon - * @private - */ - createCallback : function(action, rs) { - return function(o, success, response) { - this.activeRequest[action] = undefined; - if (!success) { - if (action === Ext.data.Api.actions.read) { - // @deprecated: fire loadexception for backwards compat. - // TODO remove - this.fireEvent('loadexception', this, o, response); - } - this.fireEvent('exception', this, 'response', action, o, response); - o.request.callback.call(o.request.scope, null, o.request.arg, false); - return; - } - if (action === Ext.data.Api.actions.read) { - this.onRead(action, o, response); - } else { - this.onWrite(action, o, response, rs); - } - }; - }, - - /** - * Callback for read action - * @param {String} action Action name as per {@link Ext.data.Api.actions#read}. - * @param {Object} o The request transaction object - * @param {Object} res The server response - * @fires loadexception (deprecated) - * @fires exception - * @fires load - * @protected - */ - onRead : function(action, o, response) { - var result; - try { - result = o.reader.read(response); - }catch(e){ - // @deprecated: fire old loadexception for backwards-compat. - // TODO remove - this.fireEvent('loadexception', this, o, response, e); - - this.fireEvent('exception', this, 'response', action, o, response, e); - o.request.callback.call(o.request.scope, null, o.request.arg, false); - return; - } - if (result.success === false) { - // @deprecated: fire old loadexception for backwards-compat. - // TODO remove - this.fireEvent('loadexception', this, o, response); - - // Get DataReader read-back a response-object to pass along to exception event - var res = o.reader.readResponse(action, response); - this.fireEvent('exception', this, 'remote', action, o, res, null); - } - else { - this.fireEvent('load', this, o, o.request.arg); - } - // TODO refactor onRead, onWrite to be more generalized now that we're dealing with Ext.data.Response instance - // the calls to request.callback(...) in each will have to be made identical. - // NOTE reader.readResponse does not currently return Ext.data.Response - o.request.callback.call(o.request.scope, result, o.request.arg, result.success); - }, - /** - * Callback for write actions - * @param {String} action [Ext.data.Api.actions.create|read|update|destroy] - * @param {Object} trans The request transaction object - * @param {Object} res The server response - * @fires exception - * @fires write - * @protected - */ - onWrite : function(action, o, response, rs) { - var reader = o.reader; - var res; - try { - res = reader.readResponse(action, response); - } catch (e) { - this.fireEvent('exception', this, 'response', action, o, response, e); - o.request.callback.call(o.request.scope, null, o.request.arg, false); - return; - } - if (res.success === true) { - this.fireEvent('write', this, action, res.data, res, rs, o.request.arg); - } else { - this.fireEvent('exception', this, 'remote', action, o, res, rs); - } - // TODO refactor onRead, onWrite to be more generalized now that we're dealing with Ext.data.Response instance - // the calls to request.callback(...) in each will have to be made similar. - // NOTE reader.readResponse does not currently return Ext.data.Response - o.request.callback.call(o.request.scope, res.data, res, res.success); - }, - - // inherit docs - destroy: function(){ - if(!this.useAjax){ - this.conn.abort(); - }else if(this.activeRequest){ - var actions = Ext.data.Api.actions; - for (var verb in actions) { - if(this.activeRequest[actions[verb]]){ - Ext.Ajax.abort(this.activeRequest[actions[verb]]); - } - } - } - Ext.data.HttpProxy.superclass.destroy.call(this); - } -}); \ No newline at end of file diff --git a/assets/js/ext/src/data/JsonReader.js b/assets/js/ext/src/data/JsonReader.js deleted file mode 100644 index 06c327d..0000000 --- a/assets/js/ext/src/data/JsonReader.js +++ /dev/null @@ -1,358 +0,0 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.com/license - */ -/** - * @class Ext.data.JsonReader - * @extends Ext.data.DataReader - *

Data reader class to create an Array of {@link Ext.data.Record} objects - * from a JSON packet based on mappings in a provided {@link Ext.data.Record} - * constructor.

- *

Example code:

- *

-var myReader = new Ext.data.JsonReader({
-    // metadata configuration options:
-    {@link #idProperty}: 'id'
-    {@link #root}: 'rows',
-    {@link #totalProperty}: 'results',
-    {@link Ext.data.DataReader#messageProperty}: "msg"  // The element within the response that provides a user-feedback message (optional)
-
-    // the fields config option will internally create an {@link Ext.data.Record}
-    // constructor that provides mapping for reading the record data objects
-    {@link Ext.data.DataReader#fields fields}: [
-        // map Record's 'firstname' field to data object's key of same name
-        {name: 'name', mapping: 'firstname'},
-        // map Record's 'job' field to data object's 'occupation' key
-        {name: 'job', mapping: 'occupation'}
-    ]
-});
-
- *

This would consume a JSON data object of the form:


-{
-    results: 2000, // Reader's configured {@link #totalProperty}
-    rows: [        // Reader's configured {@link #root}
-        // record data objects:
-        { {@link #idProperty id}: 1, firstname: 'Bill', occupation: 'Gardener' },
-        { {@link #idProperty id}: 2, firstname: 'Ben' , occupation: 'Horticulturalist' },
-        ...
-    ]
-}
-
- *

Automatic configuration using metaData

- *

It is possible to change a JsonReader's metadata at any time by including - * a metaData property in the JSON data object. If the JSON data - * object has a metaData property, a {@link Ext.data.Store Store} - * object using this Reader will reconfigure itself to use the newly provided - * field definition and fire its {@link Ext.data.Store#metachange metachange} - * event. The metachange event handler may interrogate the metaData - * property to perform any configuration required.

- *

Note that reconfiguring a Store potentially invalidates objects which may - * refer to Fields or Records which no longer exist.

- *

To use this facility you would create the JsonReader like this:


-var myReader = new Ext.data.JsonReader();
-
- *

The first data packet from the server would configure the reader by - * containing a metaData property and the data. For - * example, the JSON data object might take the form:


-{
-    metaData: {
-        "{@link #idProperty}": "id",
-        "{@link #root}": "rows",
-        "{@link #totalProperty}": "results"
-        "{@link #successProperty}": "success",
-        "{@link Ext.data.DataReader#fields fields}": [
-            {"name": "name"},
-            {"name": "job", "mapping": "occupation"}
-        ],
-        // used by store to set its sortInfo
-        "sortInfo":{
-           "field": "name",
-           "direction": "ASC"
-        },
-        // {@link Ext.PagingToolbar paging data} (if applicable)
-        "start": 0,
-        "limit": 2,
-        // custom property
-        "foo": "bar"
-    },
-    // Reader's configured {@link #successProperty}
-    "success": true,
-    // Reader's configured {@link #totalProperty}
-    "results": 2000,
-    // Reader's configured {@link #root}
-    // (this data simulates 2 results {@link Ext.PagingToolbar per page})
-    "rows": [ // *Note: this must be an Array
-        { "id": 1, "name": "Bill", "occupation": "Gardener" },
-        { "id": 2, "name":  "Ben", "occupation": "Horticulturalist" }
-    ]
-}
- * 
- *

The metaData property in the JSON data object should contain:

- *
    - *
  • any of the configuration options for this class
  • - *
  • a {@link Ext.data.Record#fields fields} property which - * the JsonReader will use as an argument to the - * {@link Ext.data.Record#create data Record create method} in order to - * configure the layout of the Records it will produce.
  • - *
  • a {@link Ext.data.Store#sortInfo sortInfo} property - * which the JsonReader will use to set the {@link Ext.data.Store}'s - * {@link Ext.data.Store#sortInfo sortInfo} property
  • - *
  • any custom properties needed
  • - *
- * - * @constructor - * Create a new JsonReader - * @param {Object} meta Metadata configuration options. - * @param {Array/Object} recordType - *

Either an Array of {@link Ext.data.Field Field} definition objects (which - * will be passed to {@link Ext.data.Record#create}, or a {@link Ext.data.Record Record} - * constructor created from {@link Ext.data.Record#create}.

- */ -Ext.data.JsonReader = function(meta, recordType){ - meta = meta || {}; - /** - * @cfg {String} idProperty [id] Name of the property within a row object - * that contains a record identifier value. Defaults to id - */ - /** - * @cfg {String} successProperty [success] Name of the property from which to - * retrieve the success attribute. Defaults to success. See - * {@link Ext.data.DataProxy}.{@link Ext.data.DataProxy#exception exception} - * for additional information. - */ - /** - * @cfg {String} totalProperty [total] 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. Defaults to total. - */ - /** - * @cfg {String} root [undefined] Required. The name of the property - * which contains the Array of row objects. Defaults to undefined. - * An exception will be thrown if the root property is undefined. The data - * packet value for this property should be an empty array to clear the data - * or show no data. - */ - Ext.applyIf(meta, { - idProperty: 'id', - successProperty: 'success', - totalProperty: 'total' - }); - - Ext.data.JsonReader.superclass.constructor.call(this, meta, recordType || meta.fields); -}; -Ext.extend(Ext.data.JsonReader, Ext.data.DataReader, { - /** - * This JsonReader's metadata as passed to the constructor, or as passed in - * the last data packet's metaData property. - * @type Mixed - * @property meta - */ - /** - * 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 Ext.data.Store object as - * a cache of Ext.data.Records. - */ - read : function(response){ - var json = response.responseText; - var o = Ext.decode(json); - if(!o) { - throw {message: 'JsonReader.read: Json object not found'}; - } - return this.readRecords(o); - }, - - /* - * TODO: refactor code between JsonReader#readRecords, #readResponse into 1 method. - * there's ugly duplication going on due to maintaining backwards compat. with 2.0. It's time to do this. - */ - /** - * Decode a JSON response from server. - * @param {String} action [Ext.data.Api.actions.create|read|update|destroy] - * @param {Object} response The XHR object returned through an Ajax server request. - * @return {Response} A {@link Ext.data.Response Response} object containing the data response, and also status information. - */ - readResponse : function(action, response) { - var o = (response.responseText !== undefined) ? Ext.decode(response.responseText) : response; - if(!o) { - throw new Ext.data.JsonReader.Error('response'); - } - - var root = this.getRoot(o); - if (action === Ext.data.Api.actions.create) { - var def = Ext.isDefined(root); - if (def && Ext.isEmpty(root)) { - throw new Ext.data.JsonReader.Error('root-empty', this.meta.root); - } - else if (!def) { - throw new Ext.data.JsonReader.Error('root-undefined-response', this.meta.root); - } - } - - // instantiate response object - var res = new Ext.data.Response({ - action: action, - success: this.getSuccess(o), - data: (root) ? this.extractData(root, false) : [], - message: this.getMessage(o), - raw: o - }); - - // blow up if no successProperty - if (Ext.isEmpty(res.success)) { - throw new Ext.data.JsonReader.Error('successProperty-response', this.meta.successProperty); - } - return res; - }, - - /** - * Create a data block containing Ext.data.Records from a JSON object. - * @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 Ext.data.Store object as - * a cache of Ext.data.Records. - */ - readRecords : function(o){ - /** - * After any data loads, the raw JSON data is available for further custom processing. If no data is - * loaded or there is a load exception this property will be undefined. - * @type Object - */ - this.jsonData = o; - if(o.metaData){ - this.onMetaChange(o.metaData); - } - var s = this.meta, Record = this.recordType, - f = Record.prototype.fields, fi = f.items, fl = f.length, v; - - var root = this.getRoot(o), c = root.length, totalRecords = c, success = true; - if(s.totalProperty){ - v = parseInt(this.getTotal(o), 10); - if(!isNaN(v)){ - totalRecords = v; - } - } - if(s.successProperty){ - v = this.getSuccess(o); - if(v === false || v === 'false'){ - success = false; - } - } - - // TODO return Ext.data.Response instance instead. @see #readResponse - return { - success : success, - records : this.extractData(root, true), // <-- true to return [Ext.data.Record] - totalRecords : totalRecords - }; - }, - - // private - buildExtractors : function() { - if(this.ef){ - return; - } - var s = this.meta, Record = this.recordType, - f = Record.prototype.fields, fi = f.items, fl = f.length; - - if(s.totalProperty) { - this.getTotal = this.createAccessor(s.totalProperty); - } - if(s.successProperty) { - this.getSuccess = this.createAccessor(s.successProperty); - } - if (s.messageProperty) { - this.getMessage = this.createAccessor(s.messageProperty); - } - this.getRoot = s.root ? this.createAccessor(s.root) : function(p){return p;}; - if (s.id || s.idProperty) { - var g = this.createAccessor(s.id || s.idProperty); - this.getId = function(rec) { - var r = g(rec); - return (r === undefined || r === '') ? null : r; - }; - } else { - this.getId = function(){return null;}; - } - var ef = []; - for(var i = 0; i < fl; i++){ - f = fi[i]; - var map = (f.mapping !== undefined && f.mapping !== null) ? f.mapping : f.name; - ef.push(this.createAccessor(map)); - } - this.ef = ef; - }, - - /** - * @ignore - * TODO This isn't used anywhere?? Don't we want to use this where possible instead of complex #createAccessor? - */ - simpleAccess : function(obj, subsc) { - return obj[subsc]; - }, - - /** - * @ignore - */ - createAccessor : function(){ - var re = /[\[\.]/; - return function(expr) { - if(Ext.isEmpty(expr)){ - return Ext.emptyFn; - } - if(Ext.isFunction(expr)){ - return expr; - } - var i = String(expr).search(re); - if(i >= 0){ - return new Function('obj', 'return obj' + (i > 0 ? '.' : '') + expr); - } - return function(obj){ - return obj[expr]; - }; - - }; - }(), - - /** - * type-casts a single row of raw-data from server - * @param {Object} data - * @param {Array} items - * @param {Integer} len - * @private - */ - extractValues : function(data, items, len) { - var f, values = {}; - for(var j = 0; j < len; j++){ - f = items[j]; - var v = this.ef[j](data); - values[f.name] = f.convert((v !== undefined) ? v : f.defaultValue, data); - } - return values; - } -}); - -/** - * @class Ext.data.JsonReader.Error - * Error class for JsonReader - */ -Ext.data.JsonReader.Error = Ext.extend(Ext.Error, { - constructor : function(message, arg) { - this.arg = arg; - Ext.Error.call(this, message); - }, - name : 'Ext.data.JsonReader' -}); -Ext.apply(Ext.data.JsonReader.Error.prototype, { - lang: { - 'response': 'An error occurred while json-decoding your server response', - 'successProperty-response': 'Could not locate your "successProperty" in your server response. Please review your JsonReader config to ensure the config-property "successProperty" matches the property in your server-response. See the JsonReader docs.', - 'root-undefined-config': 'Your JsonReader was configured without a "root" property. Please review your JsonReader config and make sure to define the root property. See the JsonReader docs.', - 'idProperty-undefined' : 'Your JsonReader was configured without an "idProperty" Please review your JsonReader configuration and ensure the "idProperty" is set (e.g.: "id"). See the JsonReader docs.', - 'root-empty': 'Data was expected to be returned by the server in the "root" property of the response. Please review your JsonReader configuration to ensure the "root" property matches that returned in the server-response. See JsonReader docs.' - } -}); diff --git a/assets/js/ext/src/data/JsonStore.js b/assets/js/ext/src/data/JsonStore.js deleted file mode 100644 index 4dbd357..0000000 --- a/assets/js/ext/src/data/JsonStore.js +++ /dev/null @@ -1,49 +0,0 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.com/license - */ -/** - * @class Ext.data.JsonStore - * @extends Ext.data.Store - *

Small helper class to make creating {@link Ext.data.Store}s from JSON data easier. - * A JsonStore will be automatically configured with a {@link Ext.data.JsonReader}.

- *

A store configuration would be something like:


-var store = new Ext.data.JsonStore({
-    // store configs
-    autoDestroy: true,
-    url: 'get-images.php',
-    storeId: 'myStore',
-    // reader configs
-    root: 'images',
-    idProperty: 'name',
-    fields: ['name', 'url', {name:'size', type: 'float'}, {name:'lastmod', type:'date'}]
-});
- * 

- *

This store is configured to consume a returned object of the form:


-{
-    images: [
-        {name: 'Image one', url:'/GetImage.php?id=1', size:46.5, lastmod: new Date(2007, 10, 29)},
-        {name: 'Image Two', url:'/GetImage.php?id=2', size:43.2, lastmod: new Date(2007, 10, 30)}
-    ]
-}
- * 
- * An object literal of this form could also be used as the {@link #data} config option.

- *

*Note: Although not listed here, this class accepts all of the configuration options of - * {@link Ext.data.JsonReader JsonReader}.

- * @constructor - * @param {Object} config - * @xtype jsonstore - */ -Ext.data.JsonStore = Ext.extend(Ext.data.Store, { - /** - * @cfg {Ext.data.DataReader} reader @hide - */ - constructor: function(config){ - Ext.data.JsonStore.superclass.constructor.call(this, Ext.apply(config, { - reader: new Ext.data.JsonReader(config) - })); - } -}); -Ext.reg('jsonstore', Ext.data.JsonStore); \ No newline at end of file diff --git a/assets/js/ext/src/data/JsonWriter.js b/assets/js/ext/src/data/JsonWriter.js deleted file mode 100644 index bf161ae..0000000 --- a/assets/js/ext/src/data/JsonWriter.js +++ /dev/null @@ -1,96 +0,0 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.com/license - */ -/** - * @class Ext.data.JsonWriter - * @extends Ext.data.DataWriter - * DataWriter extension for writing an array or single {@link Ext.data.Record} object(s) in preparation for executing a remote CRUD action. - */ -Ext.data.JsonWriter = Ext.extend(Ext.data.DataWriter, { - /** - * @cfg {Boolean} encode

true to {@link Ext.util.JSON#encode JSON encode} the - * {@link Ext.data.DataWriter#toHash hashed data} into a standard HTTP parameter named after this - * Reader's meta.root property which, by default is imported from the associated Reader. Defaults to true.

- *

If set to false, the hashed data is {@link Ext.util.JSON#encode JSON encoded}, along with - * the associated {@link Ext.data.Store}'s {@link Ext.data.Store#baseParams baseParams}, into the POST body.

- *

When using {@link Ext.data.DirectProxy}, set this to false since Ext.Direct.JsonProvider will perform - * its own json-encoding. In addition, if you're using {@link Ext.data.HttpProxy}, setting to false - * will cause HttpProxy to transmit data using the jsonData configuration-params of {@link Ext.Ajax#request} - * instead of params.

- *

When using a {@link Ext.data.Store#restful} Store, some serverside frameworks are - * tuned to expect data through the jsonData mechanism. In those cases, one will want to set encode: false, as in - * let the lower-level connection object (eg: Ext.Ajax) do the encoding.

- */ - encode : true, - /** - * @cfg {Boolean} encodeDelete False to send only the id to the server on delete, true to encode it in an object - * literal, eg:

-{id: 1}
- * 
Defaults to false - */ - encodeDelete: false, - - constructor : function(config){ - Ext.data.JsonWriter.superclass.constructor.call(this, config); - }, - - /** - *

This method should not need to be called by application code, however it may be useful on occasion to - * override it, or augment it with an {@link Function#createInterceptor interceptor} or {@link Function#createSequence sequence}.

- *

The provided implementation encodes the serialized data representing the Store's modified Records into the Ajax request's - * params according to the {@link #encode} setting.

- * @param {Object} Ajax request params object to write into. - * @param {Object} baseParams as defined by {@link Ext.data.Store#baseParams}. The baseParms must be encoded by the extending class, eg: {@link Ext.data.JsonWriter}, {@link Ext.data.XmlWriter}. - * @param {Object/Object[]} data Data object representing the serialized modified records from the Store. May be either a single object, - * or an Array of objects - user implementations must handle both cases. - */ - render : function(params, baseParams, data) { - if (this.encode === true) { - // Encode here now. - Ext.apply(params, baseParams); - params[this.meta.root] = Ext.encode(data); - } else { - // defer encoding for some other layer, probably in {@link Ext.Ajax#request}. Place everything into "jsonData" key. - var jdata = Ext.apply({}, baseParams); - jdata[this.meta.root] = data; - params.jsonData = jdata; - } - }, - /** - * Implements abstract Ext.data.DataWriter#createRecord - * @protected - * @param {Ext.data.Record} rec - * @return {Object} - */ - createRecord : function(rec) { - return this.toHash(rec); - }, - /** - * Implements abstract Ext.data.DataWriter#updateRecord - * @protected - * @param {Ext.data.Record} rec - * @return {Object} - */ - updateRecord : function(rec) { - return this.toHash(rec); - - }, - /** - * Implements abstract Ext.data.DataWriter#destroyRecord - * @protected - * @param {Ext.data.Record} rec - * @return {Object} - */ - destroyRecord : function(rec){ - if(this.encodeDelete){ - var data = {}; - data[this.meta.idProperty] = rec.id; - return data; - }else{ - return rec.id; - } - } -}); \ No newline at end of file diff --git a/assets/js/ext/src/data/MemoryProxy.js b/assets/js/ext/src/data/MemoryProxy.js deleted file mode 100644 index 6cf76d3..0000000 --- a/assets/js/ext/src/data/MemoryProxy.js +++ /dev/null @@ -1,69 +0,0 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.com/license - */ -/** - * @class Ext.data.MemoryProxy - * @extends Ext.data.DataProxy - * An implementation of Ext.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 Ext.data.Records. - */ -Ext.data.MemoryProxy = function(data){ - // Must define a dummy api with "read" action to satisfy DataProxy#doRequest and Ext.data.Api#prepare *before* calling super - var api = {}; - api[Ext.data.Api.actions.read] = true; - Ext.data.MemoryProxy.superclass.constructor.call(this, { - api: api - }); - this.data = data; -}; - -Ext.extend(Ext.data.MemoryProxy, Ext.data.DataProxy, { - /** - * @event loadexception - * Fires if an exception occurs in the Proxy during data loading. Note that this event is also relayed - * through {@link Ext.data.Store}, so you can listen for it directly on any Store instance. - * @param {Object} this - * @param {Object} arg The callback's arg object passed to the {@link #load} function - * @param {Object} null This parameter does not apply and will always be null for MemoryProxy - * @param {Error} e The JavaScript Error object caught if the configured Reader could not read the data - */ - - /** - * MemoryProxy implementation of DataProxy#doRequest - * @param {String} action - * @param {Ext.data.Record/Ext.data.Record[]} rs If action is load, rs will be null - * @param {Object} params An object containing properties which are to be used as HTTP parameters - * for the request to the remote server. - * @param {Ext.data.DataReader} reader The Reader object which converts the data - * object into a block of Ext.data.Records. - * @param {Function} callback The function into which to pass the block of Ext.data.Records. - * The function must be passed
    - *
  • The Record block object
  • - *
  • The "arg" argument from the load function
  • - *
  • A boolean success indicator
  • - *
- * @param {Object} scope The scope (this reference) in which the callback function is executed. Defaults to the browser window. - * @param {Object} arg An optional argument which is passed to the callback as its second parameter. - */ - doRequest : function(action, rs, params, reader, callback, scope, arg) { - // No implementation for CRUD in MemoryProxy. Assumes all actions are 'load' - params = params || {}; - var result; - try { - result = reader.readRecords(this.data); - }catch(e){ - // @deprecated loadexception - this.fireEvent("loadexception", this, null, arg, e); - - this.fireEvent('exception', this, 'response', action, arg, null, e); - callback.call(scope, null, arg, false); - return; - } - callback.call(scope, result, arg, true); - } -}); \ No newline at end of file diff --git a/assets/js/ext/src/data/Record.js b/assets/js/ext/src/data/Record.js deleted file mode 100644 index 4405b93..0000000 --- a/assets/js/ext/src/data/Record.js +++ /dev/null @@ -1,415 +0,0 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.com/license - */ -/** - * @class Ext.data.Record - *

Instances of this class encapsulate both Record definition information, and Record - * value information for use in {@link Ext.data.Store} objects, or any code which needs - * to access Records cached in an {@link Ext.data.Store} object.

- *

Constructors for this class are generated by passing an Array of field definition objects to {@link #create}. - * Instances are usually only created by {@link Ext.data.Reader} implementations when processing unformatted data - * objects.

- *

Note that an instance of a Record class may only belong to one {@link Ext.data.Store Store} at a time. - * In order to copy data from one Store to another, use the {@link #copy} method to create an exact - * copy of the Record, and insert the new instance into the other Store.

- *

When serializing a Record for submission to the server, be aware that it contains many private - * properties, and also a reference to its owning Store which in turn holds references to its Records. - * This means that a whole Record may not be encoded using {@link Ext.util.JSON.encode}. Instead, use the - * {@link #data} and {@link #id} properties.

- *

Record objects generated by this constructor inherit all the methods of Ext.data.Record listed below.

- * @constructor - *

This constructor should not be used to create Record objects. Instead, use {@link #create} to - * generate a subclass of Ext.data.Record configured with information about its constituent fields.

- *

The generated constructor has the same signature as this constructor.

- * @param {Object} data (Optional) An object, the properties of which provide values for the new Record's - * fields. If not specified the {@link Ext.data.Field#defaultValue defaultValue} - * for each field will be assigned. - * @param {Object} id (Optional) The id of the Record. The id is used by the - * {@link Ext.data.Store} object which owns the Record to index its collection - * of Records (therefore this id should be unique within each store). If an - * id is not specified a {@link #phantom} - * Record will be created with an {@link #Record.id automatically generated id}. - */ -Ext.data.Record = function(data, id){ - // if no id, call the auto id method - this.id = (id || id === 0) ? id : Ext.data.Record.id(this); - this.data = data || {}; -}; - -/** - * Generate a constructor for a specific Record layout. - * @param {Array} o An Array of {@link Ext.data.Field Field} definition objects. - * The constructor generated by this method may be used to create new Record instances. The data - * object must contain properties named after the {@link Ext.data.Field field} - * {@link Ext.data.Field#name}s. Example usage:

-// create a Record constructor from a description of the fields
-var TopicRecord = Ext.data.Record.create([ // creates a subclass of Ext.data.Record
-    {{@link Ext.data.Field#name name}: 'title', {@link Ext.data.Field#mapping mapping}: 'topic_title'},
-    {name: 'author', mapping: 'username', allowBlank: false},
-    {name: 'totalPosts', mapping: 'topic_replies', type: 'int'},
-    {name: 'lastPost', mapping: 'post_time', type: 'date'},
-    {name: 'lastPoster', mapping: 'user2'},
-    {name: 'excerpt', mapping: 'post_text', allowBlank: false},
-    // In the simplest case, if no properties other than name are required,
-    // a field definition may consist of just a String for the field name.
-    'signature'
-]);
-
-// create Record instance
-var myNewRecord = new TopicRecord(
-    {
-        title: 'Do my job please',
-        author: 'noobie',
-        totalPosts: 1,
-        lastPost: new Date(),
-        lastPoster: 'Animal',
-        excerpt: 'No way dude!',
-        signature: ''
-    },
-    id // optionally specify the id of the record otherwise {@link #Record.id one is auto-assigned}
-);
-myStore.{@link Ext.data.Store#add add}(myNewRecord);
-
- * @method create - * @return {Function} A constructor which is used to create new Records according - * to the definition. The constructor has the same signature as {@link #Record}. - * @static - */ -Ext.data.Record.create = function(o){ - var f = Ext.extend(Ext.data.Record, {}); - var p = f.prototype; - p.fields = new Ext.util.MixedCollection(false, function(field){ - return field.name; - }); - for(var i = 0, len = o.length; i < len; i++){ - p.fields.add(new Ext.data.Field(o[i])); - } - f.getField = function(name){ - return p.fields.get(name); - }; - return f; -}; - -Ext.data.Record.PREFIX = 'ext-record'; -Ext.data.Record.AUTO_ID = 1; -Ext.data.Record.EDIT = 'edit'; -Ext.data.Record.REJECT = 'reject'; -Ext.data.Record.COMMIT = 'commit'; - - -/** - * Generates a sequential id. This method is typically called when a record is {@link #create}d - * and {@link #Record no id has been specified}. The returned id takes the form: - * {PREFIX}-{AUTO_ID}.
    - *
  • PREFIX : String

    Ext.data.Record.PREFIX - * (defaults to 'ext-record')

  • - *
  • AUTO_ID : String

    Ext.data.Record.AUTO_ID - * (defaults to 1 initially)

  • - *
- * @param {Record} rec The record being created. The record does not exist, it's a {@link #phantom}. - * @return {String} auto-generated string id, "ext-record-i++'; - */ -Ext.data.Record.id = function(rec) { - rec.phantom = true; - return [Ext.data.Record.PREFIX, '-', Ext.data.Record.AUTO_ID++].join(''); -}; - -Ext.data.Record.prototype = { - /** - *

This property is stored in the Record definition's prototype

- * A MixedCollection containing the defined {@link Ext.data.Field Field}s for this Record. Read-only. - * @property fields - * @type Ext.util.MixedCollection - */ - /** - * An object hash representing the data for this Record. Every field name in the Record definition - * is represented by a property of that name in this object. Note that unless you specified a field - * with {@link Ext.data.Field#name name} "id" in the Record definition, this will not contain - * an id property. - * @property data - * @type {Object} - */ - /** - * The unique ID of the Record {@link #Record as specified at construction time}. - * @property id - * @type {Object} - */ - /** - *

Only present if this Record was created by an {@link Ext.data.XmlReader XmlReader}.

- *

The XML element which was the source of the data for this Record.

- * @property node - * @type {XMLElement} - */ - /** - *

Only present if this Record was created by an {@link Ext.data.ArrayReader ArrayReader} or a {@link Ext.data.JsonReader JsonReader}.

- *

The Array or object which was the source of the data for this Record.

- * @property json - * @type {Array|Object} - */ - /** - * Readonly flag - true if this Record has been modified. - * @type Boolean - */ - dirty : false, - editing : false, - error : null, - /** - * This object contains a key and value storing the original values of all modified - * fields or is null if no fields have been modified. - * @property modified - * @type {Object} - */ - modified : null, - /** - * true when the record does not yet exist in a server-side database (see - * {@link #markDirty}). Any record which has a real database pk set as its id property - * is NOT a phantom -- it's real. - * @property phantom - * @type {Boolean} - */ - phantom : false, - - // private - join : function(store){ - /** - * The {@link Ext.data.Store} to which this Record belongs. - * @property store - * @type {Ext.data.Store} - */ - this.store = store; - }, - - /** - * Set the {@link Ext.data.Field#name named field} to the specified value. For example: - *

-// record has a field named 'firstname'
-var Employee = Ext.data.Record.{@link #create}([
-    {name: 'firstname'},
-    ...
-]);
-
-// update the 2nd record in the store:
-var rec = myStore.{@link Ext.data.Store#getAt getAt}(1);
-
-// set the value (shows dirty flag):
-rec.set('firstname', 'Betty');
-
-// commit the change (removes dirty flag):
-rec.{@link #commit}();
-
-// update the record in the store, bypass setting dirty flag,
-// and do not store the change in the {@link Ext.data.Store#getModifiedRecords modified records}
-rec.{@link #data}['firstname'] = 'Wilma'; // updates record, but not the view
-rec.{@link #commit}(); // updates the view
-     * 
- * Notes:
    - *
  • If the store has a writer and autoSave=true, each set() - * will execute an XHR to the server.
  • - *
  • Use {@link #beginEdit} to prevent the store's update - * event firing while using set().
  • - *
  • Use {@link #endEdit} to have the store's update - * event fire.
  • - *
- * @param {String} name The {@link Ext.data.Field#name name of the field} to set. - * @param {String/Object/Array} value The value to set the field to. - */ - set : function(name, value){ - var encode = Ext.isPrimitive(value) ? String : Ext.encode; - if(encode(this.data[name]) == encode(value)) { - return; - } - this.dirty = true; - if(!this.modified){ - this.modified = {}; - } - if(this.modified[name] === undefined){ - this.modified[name] = this.data[name]; - } - this.data[name] = value; - if(!this.editing){ - this.afterEdit(); - } - }, - - // private - afterEdit : function(){ - if (this.store != undefined && typeof this.store.afterEdit == "function") { - this.store.afterEdit(this); - } - }, - - // private - afterReject : function(){ - if(this.store){ - this.store.afterReject(this); - } - }, - - // private - afterCommit : function(){ - if(this.store){ - this.store.afterCommit(this); - } - }, - - /** - * Get the value of the {@link Ext.data.Field#name named field}. - * @param {String} name The {@link Ext.data.Field#name name of the field} to get the value of. - * @return {Object} The value of the field. - */ - get : function(name){ - return this.data[name]; - }, - - /** - * Begin an edit. While in edit mode, no events (e.g.. the update event) - * are relayed to the containing store. - * See also: {@link #endEdit} and {@link #cancelEdit}. - */ - beginEdit : function(){ - this.editing = true; - this.modified = this.modified || {}; - }, - - /** - * Cancels all changes made in the current edit operation. - */ - cancelEdit : function(){ - this.editing = false; - delete this.modified; - }, - - /** - * End an edit. If any data was modified, the containing store is notified - * (ie, the store's update event will fire). - */ - endEdit : function(){ - this.editing = false; - if(this.dirty){ - this.afterEdit(); - } - }, - - /** - * Usually called by the {@link Ext.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. - *

Developers should subscribe to the {@link Ext.data.Store#update} event - * to have their code notified of reject operations.

- * @param {Boolean} silent (optional) True to skip notification of the owning - * store of the change (defaults to false) - */ - reject : function(silent){ - 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(silent !== true){ - this.afterReject(); - } - }, - - /** - * Usually called by the {@link Ext.data.Store} which owns the Record. - * Commits all changes made to the Record since either creation, or the last commit operation. - *

Developers should subscribe to the {@link Ext.data.Store#update} event - * to have their code notified of commit operations.

- * @param {Boolean} silent (optional) True to skip notification of the owning - * store of the change (defaults to false) - */ - commit : function(silent){ - this.dirty = false; - delete this.modified; - this.editing = false; - if(silent !== true){ - this.afterCommit(); - } - }, - - /** - * Gets a hash of only the fields that have been modified since this Record was created or commited. - * @return Object - */ - getChanges : function(){ - var m = this.modified, cs = {}; - for(var n in m){ - if(m.hasOwnProperty(n)){ - cs[n] = this.data[n]; - } - } - return cs; - }, - - // private - hasError : function(){ - return this.error !== null; - }, - - // private - clearError : function(){ - this.error = null; - }, - - /** - * Creates a copy (clone) of this Record. - * @param {String} id (optional) A new Record id, defaults to the id - * of the record being copied. See {@link #id}. - * To generate a phantom record with a new id use:

-var rec = record.copy(); // clone the record
-Ext.data.Record.id(rec); // automatically generate a unique sequential id
-     * 
- * @return {Record} - */ - copy : function(newId) { - return new this.constructor(Ext.apply({}, this.data), newId || this.id); - }, - - /** - * Returns true if the passed field name has been {@link #modified} - * since the load or last commit. - * @param {String} fieldName {@link Ext.data.Field.{@link Ext.data.Field#name} - * @return {Boolean} - */ - isModified : function(fieldName){ - return !!(this.modified && this.modified.hasOwnProperty(fieldName)); - }, - - /** - * By default returns false if any {@link Ext.data.Field field} within the - * record configured with {@link Ext.data.Field#allowBlank} = false returns - * true from an {@link Ext}.{@link Ext#isEmpty isempty} test. - * @return {Boolean} - */ - isValid : function() { - return this.fields.find(function(f) { - return (f.allowBlank === false && Ext.isEmpty(this.data[f.name])) ? true : false; - },this) ? false : true; - }, - - /** - *

Marks this Record as {@link #dirty}. This method - * is used interally when adding {@link #phantom} records to a - * {@link Ext.data.Store#writer writer enabled store}.

- *

Marking a record {@link #dirty} causes the phantom to - * be returned by {@link Ext.data.Store#getModifiedRecords} where it will - * have a create action composed for it during {@link Ext.data.Store#save store save} - * operations.

- */ - markDirty : function(){ - this.dirty = true; - if(!this.modified){ - this.modified = {}; - } - this.fields.each(function(f) { - this.modified[f.name] = this.data[f.name]; - },this); - } -}; diff --git a/assets/js/ext/src/data/Request.js b/assets/js/ext/src/data/Request.js deleted file mode 100644 index 6c37b2a..0000000 --- a/assets/js/ext/src/data/Request.js +++ /dev/null @@ -1,41 +0,0 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.com/license - */ -/** - * @class Ext.data.Request - * A simple Request class used internally to the data package to provide more generalized remote-requests - * to a DataProxy. - * TODO Not yet implemented. Implement in Ext.data.Store#execute - */ -Ext.data.Request = function(params) { - Ext.apply(this, params); -}; -Ext.data.Request.prototype = { - /** - * @cfg {String} action - */ - action : undefined, - /** - * @cfg {Ext.data.Record[]/Ext.data.Record} rs The Store recordset associated with the request. - */ - rs : undefined, - /** - * @cfg {Object} params HTTP request params - */ - params: undefined, - /** - * @cfg {Function} callback The function to call when request is complete - */ - callback : Ext.emptyFn, - /** - * @cfg {Object} scope The scope of the callback funtion - */ - scope : undefined, - /** - * @cfg {Ext.data.DataReader} reader The DataReader instance which will parse the received response - */ - reader : undefined -}; diff --git a/assets/js/ext/src/data/Response.js b/assets/js/ext/src/data/Response.js deleted file mode 100644 index a90a779..0000000 --- a/assets/js/ext/src/data/Response.js +++ /dev/null @@ -1,39 +0,0 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.com/license - */ -/** - * @class Ext.data.Response - * A generic response class to normalize response-handling internally to the framework. - */ -Ext.data.Response = function(params) { - Ext.apply(this, params); -}; -Ext.data.Response.prototype = { - /** - * @cfg {String} action {@link Ext.data.Api#actions} - */ - action: undefined, - /** - * @cfg {Boolean} success - */ - success : undefined, - /** - * @cfg {String} message - */ - message : undefined, - /** - * @cfg {Array/Object} data - */ - data: undefined, - /** - * @cfg {Object} raw The raw response returned from server-code - */ - raw: undefined, - /** - * @cfg {Ext.data.Record/Ext.data.Record[]} records related to the Request action - */ - records: undefined -}; diff --git a/assets/js/ext/src/data/ScriptTagProxy.js b/assets/js/ext/src/data/ScriptTagProxy.js deleted file mode 100644 index 80d0466..0000000 --- a/assets/js/ext/src/data/ScriptTagProxy.js +++ /dev/null @@ -1,305 +0,0 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.com/license - */ -/** - * @class Ext.data.ScriptTagProxy - * @extends Ext.data.DataProxy - * An implementation of Ext.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.
- *

- * 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 HttpProxy.
- *

- * The content passed back from a server resource requested by a ScriptTagProxy must be executable JavaScript - * source code because it is used as the source inside a <script> tag.
- *

- * 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: - *

- *


-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(");");
-}
-
- *

Below is a PHP example to do the same thing:


-$callback = $_REQUEST['callback'];
-
-// Create the output object.
-$output = array('a' => 'Apple', 'b' => 'Banana');
-
-//start output
-if ($callback) {
-    header('Content-Type: text/javascript');
-    echo $callback . '(' . json_encode($output) . ');';
-} else {
-    header('Content-Type: application/x-json');
-    echo json_encode($output);
-}
-
- *

Below is the ASP.Net code to do the same thing:


-String jsonString = "{success: true}";
-String cb = Request.Params.Get("callback");
-String responseString = "";
-if (!String.IsNullOrEmpty(cb)) {
-    responseString = cb + "(" + jsonString + ")";
-} else {
-    responseString = jsonString;
-}
-Response.Write(responseString);
-
- * - * @constructor - * @param {Object} config A configuration object. - */ -Ext.data.ScriptTagProxy = function(config){ - Ext.apply(this, config); - - Ext.data.ScriptTagProxy.superclass.constructor.call(this, config); - - this.head = document.getElementsByTagName("head")[0]; - - /** - * @event loadexception - * Deprecated in favor of 'exception' event. - * Fires if an exception occurs in the Proxy during data loading. This event can be fired for one of two reasons: - *
  • The load call timed out. This means the load callback did not execute within the time limit - * specified by {@link #timeout}. In this case, this event will be raised and the - * fourth parameter (read error) will be null.
  • - *
  • The load succeeded but the reader could not read the response. This means the server returned - * data, but the configured Reader threw an error while reading the data. In this case, this event will be - * raised and the caught error will be passed along as the fourth parameter of this event.
- * Note that this event is also relayed through {@link Ext.data.Store}, so you can listen for it directly - * on any Store instance. - * @param {Object} this - * @param {Object} options The loading options that were specified (see {@link #load} for details). If the load - * call timed out, this parameter will be null. - * @param {Object} arg The callback's arg object passed to the {@link #load} function - * @param {Error} e The JavaScript Error object caught if the configured Reader could not read the data. - * If the remote request returns success: false, this parameter will be null. - */ -}; - -Ext.data.ScriptTagProxy.TRANS_ID = 1000; - -Ext.extend(Ext.data.ScriptTagProxy, Ext.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".

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 caching by adding a unique parameter - * name to the request. - */ - nocache : true, - - /** - * HttpProxy implementation of DataProxy#doRequest - * @param {String} action - * @param {Ext.data.Record/Ext.data.Record[]} rs If action is read, rs will be null - * @param {Object} params An object containing properties which are to be used as HTTP parameters - * for the request to the remote server. - * @param {Ext.data.DataReader} reader The Reader object which converts the data - * object into a block of Ext.data.Records. - * @param {Function} callback The function into which to pass the block of Ext.data.Records. - * The function must be passed

    - *
  • The Record block object
  • - *
  • The "arg" argument from the load function
  • - *
  • A boolean success indicator
  • - *
- * @param {Object} scope The scope (this reference) in which the callback function is executed. Defaults to the browser window. - * @param {Object} arg An optional argument which is passed to the callback as its second parameter. - */ - doRequest : function(action, rs, params, reader, callback, scope, arg) { - var p = Ext.urlEncode(Ext.apply(params, this.extraParams)); - - var url = this.buildUrl(action, rs); - if (!url) { - throw new Ext.data.Api.Error('invalid-url', url); - } - url = Ext.urlAppend(url, p); - - if(this.nocache){ - url = Ext.urlAppend(url, '_dc=' + (new Date().getTime())); - } - var transId = ++Ext.data.ScriptTagProxy.TRANS_ID; - var trans = { - id : transId, - action: action, - cb : "stcCallback"+transId, - scriptId : "stcScript"+transId, - params : params, - arg : arg, - url : url, - callback : callback, - scope : scope, - reader : reader - }; - window[trans.cb] = this.createCallback(action, rs, 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; - }, - - // @private createCallback - createCallback : function(action, rs, trans) { - var self = this; - return function(res) { - self.trans = false; - self.destroyTrans(trans, true); - if (action === Ext.data.Api.actions.read) { - self.onRead.call(self, action, trans, res); - } else { - self.onWrite.call(self, action, trans, res, rs); - } - }; - }, - /** - * Callback for read actions - * @param {String} action [Ext.data.Api.actions.create|read|update|destroy] - * @param {Object} trans The request transaction object - * @param {Object} res The server response - * @protected - */ - onRead : function(action, trans, res) { - var result; - try { - result = trans.reader.readRecords(res); - }catch(e){ - // @deprecated: fire loadexception - this.fireEvent("loadexception", this, trans, res, e); - - this.fireEvent('exception', this, 'response', action, trans, res, e); - trans.callback.call(trans.scope||window, null, trans.arg, false); - return; - } - if (result.success === false) { - // @deprecated: fire old loadexception for backwards-compat. - this.fireEvent('loadexception', this, trans, res); - - this.fireEvent('exception', this, 'remote', action, trans, res, null); - } else { - this.fireEvent("load", this, res, trans.arg); - } - trans.callback.call(trans.scope||window, result, trans.arg, result.success); - }, - /** - * Callback for write actions - * @param {String} action [Ext.data.Api.actions.create|read|update|destroy] - * @param {Object} trans The request transaction object - * @param {Object} res The server response - * @protected - */ - onWrite : function(action, trans, response, rs) { - var reader = trans.reader; - try { - // though we already have a response object here in STP, run through readResponse to catch any meta-data exceptions. - var res = reader.readResponse(action, response); - } catch (e) { - this.fireEvent('exception', this, 'response', action, trans, res, e); - trans.callback.call(trans.scope||window, null, res, false); - return; - } - if(!res.success === true){ - this.fireEvent('exception', this, 'remote', action, trans, res, rs); - trans.callback.call(trans.scope||window, null, res, false); - return; - } - this.fireEvent("write", this, action, res.data, res, rs, trans.arg ); - trans.callback.call(trans.scope||window, res.data, res, true); - }, - - // 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 - handleFailure : function(trans){ - this.trans = false; - this.destroyTrans(trans, false); - if (trans.action === Ext.data.Api.actions.read) { - // @deprecated firing loadexception - this.fireEvent("loadexception", this, null, trans.arg); - } - - this.fireEvent('exception', this, 'response', trans.action, { - response: null, - options: trans.arg - }); - trans.callback.call(trans.scope||window, null, trans.arg, false); - }, - - // inherit docs - destroy: function(){ - this.abort(); - Ext.data.ScriptTagProxy.superclass.destroy.call(this); - } -}); \ No newline at end of file diff --git a/assets/js/ext/src/data/SortTypes.js b/assets/js/ext/src/data/SortTypes.js deleted file mode 100644 index 454024c..0000000 --- a/assets/js/ext/src/data/SortTypes.js +++ /dev/null @@ -1,91 +0,0 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.com/license - */ - -/** - * @class Ext.data.SortTypes - * @singleton - * Defines the default sorting (casting?) comparison functions used when sorting data. - */ -Ext.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(Ext.isDate(s)){ - 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, "")); - return isNaN(val) ? 0 : 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, ""), 10); - return isNaN(val) ? 0 : val; - } -}; \ No newline at end of file diff --git a/assets/js/ext/src/data/Store.js b/assets/js/ext/src/data/Store.js deleted file mode 100644 index d6ae239..0000000 --- a/assets/js/ext/src/data/Store.js +++ /dev/null @@ -1,1977 +0,0 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.com/license - */ -/** - * @class Ext.data.Store - * @extends Ext.util.Observable - *

The Store class encapsulates a client side cache of {@link Ext.data.Record Record} - * objects which provide input data for Components such as the {@link Ext.grid.GridPanel GridPanel}, - * the {@link Ext.form.ComboBox ComboBox}, or the {@link Ext.DataView DataView}.

- *

Retrieving Data

- *

A Store object may access a data object using:

    - *
  • {@link #proxy configured implementation} of {@link Ext.data.DataProxy DataProxy}
  • - *
  • {@link #data} to automatically pass in data
  • - *
  • {@link #loadData} to manually pass in data
  • - *

- *

Reading Data

- *

A Store object has no inherent knowledge of the format of the data object (it could be - * an Array, XML, or JSON). A Store object uses an appropriate {@link #reader configured implementation} - * of a {@link Ext.data.DataReader DataReader} to create {@link Ext.data.Record Record} instances from the data - * object.

- *

Store Types

- *

There are several implementations of Store available which are customized for use with - * a specific DataReader implementation. Here is an example using an ArrayStore which implicitly - * creates a reader commensurate to an Array data object.

- *

-var myStore = new Ext.data.ArrayStore({
-    fields: ['fullname', 'first'],
-    idIndex: 0 // id for each record will be the first element
-});
- * 
- *

For custom implementations create a basic {@link Ext.data.Store} configured as needed:

- *

-// create a {@link Ext.data.Record Record} constructor:
-var rt = Ext.data.Record.create([
-    {name: 'fullname'},
-    {name: 'first'}
-]);
-var myStore = new Ext.data.Store({
-    // explicitly create reader
-    reader: new Ext.data.ArrayReader(
-        {
-            idIndex: 0  // id for each record will be the first element
-        },
-        rt // recordType
-    )
-});
- * 
- *

Load some data into store (note the data object is an array which corresponds to the reader):

- *

-var myData = [
-    [1, 'Fred Flintstone', 'Fred'],  // note that id for the record is the first element
-    [2, 'Barney Rubble', 'Barney']
-];
-myStore.loadData(myData);
- * 
- *

Records are cached and made available through accessor functions. An example of adding - * a record to the store:

- *

-var defaultData = {
-    fullname: 'Full Name',
-    first: 'First Name'
-};
-var recId = 100; // provide unique id for the record
-var r = new myStore.recordType(defaultData, ++recId); // create new record
-myStore.{@link #insert}(0, r); // insert a new record into the store (also see {@link #add})
- * 
- *

Writing Data

- *

And new in Ext version 3, use the new {@link Ext.data.DataWriter DataWriter} to create an automated, Writable Store - * along with RESTful features. - * @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. - * @xtype store - */ -Ext.data.Store = Ext.extend(Ext.util.Observable, { - /** - * @cfg {String} storeId If passed, the id to use to register with the {@link Ext.StoreMgr StoreMgr}. - *

Note: if a (deprecated) {@link #id} is specified it will supersede the storeId - * assignment.

- */ - /** - * @cfg {String} url If a {@link #proxy} is not specified the url will be used to - * implicitly configure a {@link Ext.data.HttpProxy HttpProxy} if an url is specified. - * Typically this option, or the {@link #data} option will be specified. - */ - /** - * @cfg {Boolean/Object} autoLoad If {@link #data} is not specified, and if autoLoad - * is true or an Object, this store's {@link #load} method is automatically called - * after creation. If the value of autoLoad is an Object, this Object will - * be passed to the store's {@link #load} method. - */ - /** - * @cfg {Ext.data.DataProxy} proxy The {@link Ext.data.DataProxy DataProxy} object which provides - * access to a data object. See {@link #url}. - */ - /** - * @cfg {Array} data An inline data object readable by the {@link #reader}. - * Typically this option, or the {@link #url} option will be specified. - */ - /** - * @cfg {Ext.data.DataReader} reader The {@link Ext.data.DataReader Reader} object which processes the - * data object and returns an Array of {@link Ext.data.Record} objects which are cached keyed by their - * {@link Ext.data.Record#id id} property. - */ - /** - * @cfg {Ext.data.DataWriter} writer - *

The {@link Ext.data.DataWriter Writer} object which processes a record object for being written - * to the server-side database.

- *

When a writer is installed into a Store the {@link #add}, {@link #remove}, and {@link #update} - * events on the store are monitored in order to remotely {@link #createRecords create records}, - * {@link #destroyRecord destroy records}, or {@link #updateRecord update records}.

- *

The proxy for this store will relay any {@link #writexception} events to this store.

- *

Sample implementation: - *


-var writer = new {@link Ext.data.JsonWriter}({
-    encode: true,
-    writeAllFields: true // write all fields, not just those that changed
-});
-
-// Typical Store collecting the Proxy, Reader and Writer together.
-var store = new Ext.data.Store({
-    storeId: 'user',
-    root: 'records',
-    proxy: proxy,
-    reader: reader,
-    writer: writer,     // <-- plug a DataWriter into the store just as you would a Reader
-    paramsAsHash: true,
-    autoSave: false    // <-- false to delay executing create, update, destroy requests
-                        //     until specifically told to do so.
-});
-     * 

- */ - writer : undefined, - /** - * @cfg {Object} baseParams - *

An object containing properties which are to be sent as parameters - * for every HTTP request.

- *

Parameters are encoded as standard HTTP parameters using {@link Ext#urlEncode}.

- *

Note: baseParams may be superseded by any params - * specified in a {@link #load} request, see {@link #load} - * for more details.

- * This property may be modified after creation using the {@link #setBaseParam} - * method. - * @property - */ - /** - * @cfg {Object} sortInfo A config object to specify the sort order in the request of a Store's - * {@link #load} operation. Note that for local sorting, the direction property is - * case-sensitive. See also {@link #remoteSort} and {@link #paramNames}. - * For example:

-sortInfo: {
-    field: 'fieldName',
-    direction: 'ASC' // or 'DESC' (case sensitive for local sorting)
-}
-
- */ - /** - * @cfg {boolean} remoteSort true if sorting is to be handled by requesting the {@link #proxy 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). - *

If remoteSort is true, then clicking on a {@link Ext.grid.Column Grid Column}'s - * {@link Ext.grid.Column#header header} causes the current page to be requested from the server appending - * the following two parameters to the {@link #load params}:

    - *
  • sort : String

    The name (as specified in the Record's - * {@link Ext.data.Field Field definition}) of the field to sort on.

  • - *
  • dir : String

    The direction of the sort, 'ASC' or 'DESC' (case-sensitive).

  • - *

- */ - remoteSort : false, - - /** - * @cfg {Boolean} autoDestroy true to destroy the store when the component the store is bound - * to is destroyed (defaults to false). - *

Note: this should be set to true when using stores that are bound to only 1 component.

- */ - autoDestroy : 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). See {@link #getModifiedRecords} - * for the accessor method to retrieve the modified records. - */ - pruneModifiedRecords : false, - - /** - * Contains the last options object used as the parameter to the {@link #load} method. See {@link #load} - * for the details of what this may contain. This may be useful for accessing any params which were used - * to load the current Record cache. - * @property - */ - lastOptions : null, - - /** - * @cfg {Boolean} autoSave - *

Defaults to true causing the store to automatically {@link #save} records to - * the server when a record is modified (ie: becomes 'dirty'). Specify false to manually call {@link #save} - * to send all modifiedRecords to the server.

- *

Note: each CRUD action will be sent as a separate request.

- */ - autoSave : true, - - /** - * @cfg {Boolean} batch - *

Defaults to true (unless {@link #restful}:true). Multiple - * requests for each CRUD action (CREATE, READ, UPDATE and DESTROY) will be combined - * and sent as one transaction. Only applies when {@link #autoSave} is set - * to false.

- *

If Store is RESTful, the DataProxy is also RESTful, and a unique transaction is - * generated for each record.

- */ - batch : true, - - /** - * @cfg {Boolean} restful - * Defaults to false. Set to true to have the Store and the set - * Proxy operate in a RESTful manner. The store will automatically generate GET, POST, - * PUT and DELETE requests to the server. The HTTP method used for any given CRUD - * action is described in {@link Ext.data.Api#restActions}. For additional information - * see {@link Ext.data.DataProxy#restful}. - *

Note: if {@link #restful}:true batch will - * internally be set to false.

- */ - restful: false, - - /** - * @cfg {Object} paramNames - *

An object containing properties which specify the names of the paging and - * sorting parameters passed to remote servers when loading blocks of data. By default, this - * object takes the following form:


-{
-    start : 'start',  // The parameter name which specifies the start row
-    limit : 'limit',  // The parameter name which specifies number of rows to return
-    sort : 'sort',    // The parameter name which specifies the column to sort on
-    dir : 'dir'       // The parameter name which specifies the sort direction
-}
-
- *

The server must produce the requested data block upon receipt of these parameter names. - * If different parameter names are required, this property can be overriden using a configuration - * property.

- *

A {@link Ext.PagingToolbar PagingToolbar} bound to this Store uses this property to determine - * the parameter names to use in its {@link #load requests}. - */ - paramNames : undefined, - - /** - * @cfg {Object} defaultParamNames - * Provides the default values for the {@link #paramNames} property. To globally modify the parameters - * for all stores, this object should be changed on the store prototype. - */ - defaultParamNames : { - start : 'start', - limit : 'limit', - sort : 'sort', - dir : 'dir' - }, - - isDestroyed: false, - hasMultiSort: false, - - // private - batchKey : '_ext_batch_', - - constructor : function(config){ - /** - * @property multiSort - * @type Boolean - * True if this store is currently sorted by more than one field/direction combination. - */ - - /** - * @property isDestroyed - * @type Boolean - * True if the store has been destroyed already. Read only - */ - - this.data = new Ext.util.MixedCollection(false); - this.data.getKey = function(o){ - return o.id; - }; - - - // temporary removed-records cache - this.removed = []; - - if(config && config.data){ - this.inlineData = config.data; - delete config.data; - } - - Ext.apply(this, config); - - /** - * See the {@link #baseParams corresponding configuration option} - * for a description of this property. - * To modify this property see {@link #setBaseParam}. - * @property - */ - this.baseParams = Ext.isObject(this.baseParams) ? this.baseParams : {}; - - this.paramNames = Ext.applyIf(this.paramNames || {}, this.defaultParamNames); - - if((this.url || this.api) && !this.proxy){ - this.proxy = new Ext.data.HttpProxy({url: this.url, api: this.api}); - } - // If Store is RESTful, so too is the DataProxy - if (this.restful === true && this.proxy) { - // When operating RESTfully, a unique transaction is generated for each record. - // TODO might want to allow implemention of faux REST where batch is possible using RESTful routes only. - this.batch = false; - Ext.data.Api.restify(this.proxy); - } - - if(this.reader){ // reader passed - if(!this.recordType){ - this.recordType = this.reader.recordType; - } - if(this.reader.onMetaChange){ - this.reader.onMetaChange = this.reader.onMetaChange.createSequence(this.onMetaChange, this); - } - if (this.writer) { // writer passed - if (this.writer instanceof(Ext.data.DataWriter) === false) { // <-- config-object instead of instance. - this.writer = this.buildWriter(this.writer); - } - this.writer.meta = this.reader.meta; - this.pruneModifiedRecords = true; - } - } - - /** - * The {@link Ext.data.Record Record} constructor as supplied to (or created by) the - * {@link Ext.data.DataReader Reader}. Read-only. - *

If the Reader was constructed by passing in an Array of {@link Ext.data.Field} definition objects, - * instead of a Record constructor, it will implicitly create a Record constructor from that Array (see - * {@link Ext.data.Record}.{@link Ext.data.Record#create create} for additional details).

- *

This property may be used to create new Records of the type held in this Store, for example:


-    // create the data store
-    var store = new Ext.data.ArrayStore({
-        autoDestroy: true,
-        fields: [
-           {name: 'company'},
-           {name: 'price', type: 'float'},
-           {name: 'change', type: 'float'},
-           {name: 'pctChange', type: 'float'},
-           {name: 'lastChange', type: 'date', dateFormat: 'n/j h:ia'}
-        ]
-    });
-    store.loadData(myData);
-
-    // create the Grid
-    var grid = new Ext.grid.EditorGridPanel({
-        store: store,
-        colModel: new Ext.grid.ColumnModel({
-            columns: [
-                {id:'company', header: 'Company', width: 160, dataIndex: 'company'},
-                {header: 'Price', renderer: 'usMoney', dataIndex: 'price'},
-                {header: 'Change', renderer: change, dataIndex: 'change'},
-                {header: '% Change', renderer: pctChange, dataIndex: 'pctChange'},
-                {header: 'Last Updated', width: 85,
-                    renderer: Ext.util.Format.dateRenderer('m/d/Y'),
-                    dataIndex: 'lastChange'}
-            ],
-            defaults: {
-                sortable: true,
-                width: 75
-            }
-        }),
-        autoExpandColumn: 'company', // match the id specified in the column model
-        height:350,
-        width:600,
-        title:'Array Grid',
-        tbar: [{
-            text: 'Add Record',
-            handler : function(){
-                var defaultData = {
-                    change: 0,
-                    company: 'New Company',
-                    lastChange: (new Date()).clearTime(),
-                    pctChange: 0,
-                    price: 10
-                };
-                var recId = 3; // provide unique id
-                var p = new store.recordType(defaultData, recId); // create new record
-                grid.stopEditing();
-                store.{@link #insert}(0, p); // insert a new record into the store (also see {@link #add})
-                grid.startEditing(0, 0);
-            }
-        }]
-    });
-         * 
- * @property recordType - * @type Function - */ - - if(this.recordType){ - /** - * A {@link Ext.util.MixedCollection MixedCollection} containing the defined {@link Ext.data.Field Field}s - * for the {@link Ext.data.Record Records} stored in this Store. Read-only. - * @property fields - * @type Ext.util.MixedCollection - */ - this.fields = this.recordType.prototype.fields; - } - this.modified = []; - - this.addEvents( - /** - * @event datachanged - * Fires when the data cache has changed in a bulk manner (e.g., it has been sorted, filtered, etc.) and a - * widget that is using this Store as a Record cache should refresh its view. - * @param {Store} this - */ - 'datachanged', - /** - * @event metachange - * Fires when this store's reader provides new metadata (fields). This is currently only supported for JsonReaders. - * @param {Store} this - * @param {Object} meta The JSON metadata - */ - 'metachange', - /** - * @event add - * Fires when Records have been {@link #add}ed to the Store - * @param {Store} this - * @param {Ext.data.Record[]} records The array of Records added - * @param {Number} index The index at which the record(s) were added - */ - 'add', - /** - * @event remove - * Fires when a Record has been {@link #remove}d from the Store - * @param {Store} this - * @param {Ext.data.Record} record The Record that was removed - * @param {Number} index The index at which the record was removed - */ - 'remove', - /** - * @event update - * Fires when a Record has been updated - * @param {Store} this - * @param {Ext.data.Record} record The Record that was updated - * @param {String} operation The update operation being performed. Value may be one of: - *

-     Ext.data.Record.EDIT
-     Ext.data.Record.REJECT
-     Ext.data.Record.COMMIT
-             * 
- */ - 'update', - /** - * @event clear - * Fires when the data cache has been cleared. - * @param {Store} this - * @param {Record[]} records The records that were cleared. - */ - 'clear', - /** - * @event exception - *

Fires if an exception occurs in the Proxy during a remote request. - * This event is relayed through the corresponding {@link Ext.data.DataProxy}. - * See {@link Ext.data.DataProxy}.{@link Ext.data.DataProxy#exception exception} - * for additional details. - * @param {misc} misc See {@link Ext.data.DataProxy}.{@link Ext.data.DataProxy#exception exception} - * for description. - */ - 'exception', - /** - * @event beforeload - * Fires before a request is made for a new data object. If the beforeload handler returns - * false the {@link #load} action will be canceled. - * @param {Store} this - * @param {Object} options The loading options that were specified (see {@link #load} for details) - */ - 'beforeload', - /** - * @event load - * Fires after a new set of Records has been loaded. - * @param {Store} this - * @param {Ext.data.Record[]} records The Records that were loaded - * @param {Object} options The loading options that were specified (see {@link #load} for details) - */ - 'load', - /** - * @event loadexception - *

This event is deprecated in favor of the catch-all {@link #exception} - * event instead.

- *

This event is relayed through the corresponding {@link Ext.data.DataProxy}. - * See {@link Ext.data.DataProxy}.{@link Ext.data.DataProxy#loadexception loadexception} - * for additional details. - * @param {misc} misc See {@link Ext.data.DataProxy}.{@link Ext.data.DataProxy#loadexception loadexception} - * for description. - */ - 'loadexception', - /** - * @event beforewrite - * @param {Ext.data.Store} store - * @param {String} action [Ext.data.Api.actions.create|update|destroy] - * @param {Record/Record[]} rs The Record(s) being written. - * @param {Object} options The loading options that were specified. Edit options.params to add Http parameters to the request. (see {@link #save} for details) - * @param {Object} arg The callback's arg object passed to the {@link #request} function - */ - 'beforewrite', - /** - * @event write - * Fires if the server returns 200 after an Ext.data.Api.actions CRUD action. - * Success of the action is determined in the result['successProperty']property (NOTE for RESTful stores, - * a simple 20x response is sufficient for the actions "destroy" and "update". The "create" action should should return 200 along with a database pk). - * @param {Ext.data.Store} store - * @param {String} action [Ext.data.Api.actions.create|update|destroy] - * @param {Object} result The 'data' picked-out out of the response for convenience. - * @param {Ext.Direct.Transaction} res - * @param {Record/Record[]} rs Store's records, the subject(s) of the write-action - */ - 'write', - /** - * @event beforesave - * Fires before a save action is called. A save encompasses destroying records, updating records and creating records. - * @param {Ext.data.Store} store - * @param {Object} data An object containing the data that is to be saved. The object will contain a key for each appropriate action, - * with an array of records for each action. - */ - 'beforesave', - /** - * @event save - * Fires after a save is completed. A save encompasses destroying records, updating records and creating records. - * @param {Ext.data.Store} store - * @param {Number} batch The identifier for the batch that was saved. - * @param {Object} data An object containing the data that is to be saved. The object will contain a key for each appropriate action, - * with an array of records for each action. - */ - 'save' - - ); - - if(this.proxy){ - // TODO remove deprecated loadexception with ext-3.0.1 - this.relayEvents(this.proxy, ['loadexception', 'exception']); - } - // With a writer set for the Store, we want to listen to add/remove events to remotely create/destroy records. - if (this.writer) { - this.on({ - scope: this, - add: this.createRecords, - remove: this.destroyRecord, - update: this.updateRecord, - clear: this.onClear - }); - } - - this.sortToggle = {}; - if(this.sortField){ - this.setDefaultSort(this.sortField, this.sortDir); - }else if(this.sortInfo){ - this.setDefaultSort(this.sortInfo.field, this.sortInfo.direction); - } - - Ext.data.Store.superclass.constructor.call(this); - - if(this.id){ - this.storeId = this.id; - delete this.id; - } - if(this.storeId){ - Ext.StoreMgr.register(this); - } - if(this.inlineData){ - this.loadData(this.inlineData); - delete this.inlineData; - }else if(this.autoLoad){ - this.load.defer(10, this, [ - typeof this.autoLoad == 'object' ? - this.autoLoad : undefined]); - } - // used internally to uniquely identify a batch - this.batchCounter = 0; - this.batches = {}; - }, - - /** - * builds a DataWriter instance when Store constructor is provided with a writer config-object instead of an instace. - * @param {Object} config Writer configuration - * @return {Ext.data.DataWriter} - * @private - */ - buildWriter : function(config) { - var klass = undefined, - type = (config.format || 'json').toLowerCase(); - switch (type) { - case 'json': - klass = Ext.data.JsonWriter; - break; - case 'xml': - klass = Ext.data.XmlWriter; - break; - default: - klass = Ext.data.JsonWriter; - } - return new klass(config); - }, - - /** - * Destroys the store. - */ - destroy : function(){ - if(!this.isDestroyed){ - if(this.storeId){ - Ext.StoreMgr.unregister(this); - } - this.clearData(); - this.data = null; - Ext.destroy(this.proxy); - this.reader = this.writer = null; - this.purgeListeners(); - this.isDestroyed = true; - } - }, - - /** - * Add Records to the Store and fires the {@link #add} event. To add Records - * to the store from a remote source use {@link #load}({add:true}). - * See also {@link #recordType} and {@link #insert}. - * @param {Ext.data.Record[]} records An Array of Ext.data.Record objects - * to add to the cache. See {@link #recordType}. - */ - add : function(records) { - var i, len, record, index; - - records = [].concat(records); - if (records.length < 1) { - return; - } - - for (i = 0, len = records.length; i < len; i++) { - record = records[i]; - - record.join(this); - - if (record.dirty || record.phantom) { - this.modified.push(record); - } - } - - index = this.data.length; - this.data.addAll(records); - - if (this.snapshot) { - this.snapshot.addAll(records); - } - - this.fireEvent('add', this, records, index); - }, - - /** - * (Local sort only) Inserts the passed Record into the Store at the index where it - * should go based on the current sort information. - * @param {Ext.data.Record} record - */ - addSorted : function(record){ - var index = this.findInsertIndex(record); - this.insert(index, record); - }, - - /** - * @private - * Update a record within the store with a new reference - */ - doUpdate : function(rec){ - this.data.replace(rec.id, rec); - if(this.snapshot){ - this.snapshot.replace(rec.id, rec); - } - this.fireEvent('update', this, rec, Ext.data.Record.COMMIT); - }, - - /** - * Remove Records from the Store and fires the {@link #remove} event. - * @param {Ext.data.Record/Ext.data.Record[]} record The record object or array of records to remove from the cache. - */ - remove : function(record){ - if(Ext.isArray(record)){ - Ext.each(record, function(r){ - this.remove(r); - }, this); - return; - } - var index = this.data.indexOf(record); - if(index > -1){ - record.join(null); - this.data.removeAt(index); - } - if(this.pruneModifiedRecords){ - this.modified.remove(record); - } - if(this.snapshot){ - this.snapshot.remove(record); - } - if(index > -1){ - this.fireEvent('remove', this, record, index); - } - }, - - /** - * Remove a Record from the Store at the specified index. Fires the {@link #remove} event. - * @param {Number} index The index of the record to remove. - */ - removeAt : function(index){ - this.remove(this.getAt(index)); - }, - - /** - * Remove all Records from the Store and fires the {@link #clear} event. - * @param {Boolean} silent [false] Defaults to false. Set true to not fire clear event. - */ - removeAll : function(silent){ - var items = []; - this.each(function(rec){ - items.push(rec); - }); - this.clearData(); - if(this.snapshot){ - this.snapshot.clear(); - } - if(this.pruneModifiedRecords){ - this.modified = []; - } - if (silent !== true) { // <-- prevents write-actions when we just want to clear a store. - this.fireEvent('clear', this, items); - } - }, - - // private - onClear: function(store, records){ - Ext.each(records, function(rec, index){ - this.destroyRecord(this, rec, index); - }, this); - }, - - /** - * Inserts Records into the Store at the given index and fires the {@link #add} event. - * See also {@link #add} and {@link #addSorted}. - * @param {Number} index The start index at which to insert the passed Records. - * @param {Ext.data.Record[]} records An Array of Ext.data.Record objects to add to the cache. - */ - insert : function(index, records) { - var i, len, record; - - records = [].concat(records); - for (i = 0, len = records.length; i < len; i++) { - record = records[i]; - - this.data.insert(index + i, record); - record.join(this); - - if (record.dirty || record.phantom) { - this.modified.push(record); - } - } - - if (this.snapshot) { - this.snapshot.addAll(records); - } - - this.fireEvent('add', this, records, index); - }, - - /** - * Get the index within the cache of the passed Record. - * @param {Ext.data.Record} record The Ext.data.Record object 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 {Ext.data.Record} The Record with the passed id. Returns undefined if not found. - */ - getById : function(id){ - return (this.snapshot || this.data).key(id); - }, - - /** - * Get the Record at the specified index. - * @param {Number} index The index of the Record to find. - * @return {Ext.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 {Ext.data.Record[]} An array of Records - */ - getRange : function(start, end){ - return this.data.getRange(start, end); - }, - - // private - storeOptions : function(o){ - o = Ext.apply({}, o); - delete o.callback; - delete o.scope; - this.lastOptions = o; - }, - - // private - clearData: function(){ - this.data.each(function(rec) { - rec.join(null); - }); - this.data.clear(); - }, - - /** - *

Loads the Record cache from the configured {@link #proxy} using the configured {@link #reader}.

- *

Notes:

    - *
  • Important: loading is asynchronous! This call will return before the new data has been - * loaded. To perform any post-processing where information from the load call is required, specify - * the callback function to be called, or use a {@link Ext.util.Observable#listeners a 'load' event handler}.
  • - *
  • If using {@link Ext.PagingToolbar remote paging}, the first load call must specify the start and limit - * 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.
  • - *
  • If using {@link #remoteSort remote sorting}, the configured {@link #sortInfo} - * will be automatically included with the posted parameters according to the specified - * {@link #paramNames}.
  • - *
- * @param {Object} options An object containing properties which control loading options:
    - *
  • params :Object

    An object containing properties to pass as HTTP - * parameters to a remote data source. Note: params will override any - * {@link #baseParams} of the same name.

    - *

    Parameters are encoded as standard HTTP parameters using {@link Ext#urlEncode}.

  • - *
  • callback : Function

    A function to be called after the Records - * have been loaded. The callback is called after the load event is fired, and is passed the following arguments:

      - *
    • r : Ext.data.Record[] An Array of Records loaded.
    • - *
    • options : Options object from the load call.
    • - *
    • success : Boolean success indicator.

  • - *
  • scope : Object

    Scope with which to call the callback (defaults - * to the Store object)

  • - *
  • add : Boolean

    Indicator to append loaded records rather than - * replace the current cache. Note: see note for {@link #loadData}

  • - *
- * @return {Boolean} If the developer provided {@link #beforeload} event handler returns - * false, the load call will abort and will return false; otherwise will return true. - */ - load : function(options) { - options = Ext.apply({}, options); - this.storeOptions(options); - if(this.sortInfo && this.remoteSort){ - var pn = this.paramNames; - options.params = Ext.apply({}, options.params); - options.params[pn.sort] = this.sortInfo.field; - options.params[pn.dir] = this.sortInfo.direction; - } - try { - return this.execute('read', null, options); // <-- null represents rs. No rs for load actions. - } catch(e) { - this.handleException(e); - return false; - } - }, - - /** - * updateRecord Should not be used directly. This method will be called automatically if a Writer is set. - * Listens to 'update' event. - * @param {Object} store - * @param {Object} record - * @param {Object} action - * @private - */ - updateRecord : function(store, record, action) { - if (action == Ext.data.Record.EDIT && this.autoSave === true && (!record.phantom || (record.phantom && record.isValid()))) { - this.save(); - } - }, - - /** - * @private - * Should not be used directly. Store#add will call this automatically if a Writer is set - * @param {Object} store - * @param {Object} records - * @param {Object} index - */ - createRecords : function(store, records, index) { - var modified = this.modified, - length = records.length, - record, i; - - for (i = 0; i < length; i++) { - record = records[i]; - - if (record.phantom && record.isValid()) { - record.markDirty(); // <-- Mark new records dirty (Ed: why?) - - if (modified.indexOf(record) == -1) { - modified.push(record); - } - } - } - if (this.autoSave === true) { - this.save(); - } - }, - - /** - * Destroys a Record. Should not be used directly. It's called by Store#remove if a Writer is set. - * @param {Store} store this - * @param {Ext.data.Record} record - * @param {Number} index - * @private - */ - destroyRecord : function(store, record, index) { - if (this.modified.indexOf(record) != -1) { // <-- handled already if @cfg pruneModifiedRecords == true - this.modified.remove(record); - } - if (!record.phantom) { - this.removed.push(record); - - // since the record has already been removed from the store but the server request has not yet been executed, - // must keep track of the last known index this record existed. If a server error occurs, the record can be - // put back into the store. @see Store#createCallback where the record is returned when response status === false - record.lastIndex = index; - - if (this.autoSave === true) { - this.save(); - } - } - }, - - /** - * This method should generally not be used directly. This method is called internally - * by {@link #load}, or if a Writer is set will be called automatically when {@link #add}, - * {@link #remove}, or {@link #update} events fire. - * @param {String} action Action name ('read', 'create', 'update', or 'destroy') - * @param {Record/Record[]} rs - * @param {Object} options - * @throws Error - * @private - */ - execute : function(action, rs, options, /* private */ batch) { - // blow up if action not Ext.data.CREATE, READ, UPDATE, DESTROY - if (!Ext.data.Api.isAction(action)) { - throw new Ext.data.Api.Error('execute', action); - } - // make sure options has a fresh, new params hash - options = Ext.applyIf(options||{}, { - params: {} - }); - if(batch !== undefined){ - this.addToBatch(batch); - } - // have to separate before-events since load has a different signature than create,destroy and save events since load does not - // include the rs (record resultset) parameter. Capture return values from the beforeaction into doRequest flag. - var doRequest = true; - - if (action === 'read') { - doRequest = this.fireEvent('beforeload', this, options); - Ext.applyIf(options.params, this.baseParams); - } - else { - // if Writer is configured as listful, force single-record rs to be [{}] instead of {} - // TODO Move listful rendering into DataWriter where the @cfg is defined. Should be easy now. - if (this.writer.listful === true && this.restful !== true) { - rs = (Ext.isArray(rs)) ? rs : [rs]; - } - // if rs has just a single record, shift it off so that Writer writes data as '{}' rather than '[{}]' - else if (Ext.isArray(rs) && rs.length == 1) { - rs = rs.shift(); - } - // Write the action to options.params - if ((doRequest = this.fireEvent('beforewrite', this, action, rs, options)) !== false) { - this.writer.apply(options.params, this.baseParams, action, rs); - } - } - if (doRequest !== false) { - // Send request to proxy. - if (this.writer && this.proxy.url && !this.proxy.restful && !Ext.data.Api.hasUniqueUrl(this.proxy, action)) { - options.params.xaction = action; // <-- really old, probaby unecessary. - } - // Note: Up until this point we've been dealing with 'action' as a key from Ext.data.Api.actions. - // We'll flip it now and send the value into DataProxy#request, since it's the value which maps to - // the user's configured DataProxy#api - // TODO Refactor all Proxies to accept an instance of Ext.data.Request (not yet defined) instead of this looooooong list - // of params. This method is an artifact from Ext2. - this.proxy.request(Ext.data.Api.actions[action], rs, options.params, this.reader, this.createCallback(action, rs, batch), this, options); - } - return doRequest; - }, - - /** - * Saves all pending changes to the store. If the commensurate Ext.data.Api.actions action is not configured, then - * the configured {@link #url} will be used. - *
-     * change            url
-     * ---------------   --------------------
-     * removed records   Ext.data.Api.actions.destroy
-     * phantom records   Ext.data.Api.actions.create
-     * {@link #getModifiedRecords modified records}  Ext.data.Api.actions.update
-     * 
- * @TODO: Create extensions of Error class and send associated Record with thrown exceptions. - * e.g.: Ext.data.DataReader.Error or Ext.data.Error or Ext.data.DataProxy.Error, etc. - * @return {Number} batch Returns a number to uniquely identify the "batch" of saves occurring. -1 will be returned - * if there are no items to save or the save was cancelled. - */ - save : function() { - if (!this.writer) { - throw new Ext.data.Store.Error('writer-undefined'); - } - - var queue = [], - len, - trans, - batch, - data = {}, - i; - // DESTROY: First check for removed records. Records in this.removed are guaranteed non-phantoms. @see Store#remove - if(this.removed.length){ - queue.push(['destroy', this.removed]); - } - - // Check for modified records. Use a copy so Store#rejectChanges will work if server returns error. - var rs = [].concat(this.getModifiedRecords()); - if(rs.length){ - // CREATE: Next check for phantoms within rs. splice-off and execute create. - var phantoms = []; - for(i = rs.length-1; i >= 0; i--){ - if(rs[i].phantom === true){ - var rec = rs.splice(i, 1).shift(); - if(rec.isValid()){ - phantoms.push(rec); - } - }else if(!rs[i].isValid()){ // <-- while we're here, splice-off any !isValid real records - rs.splice(i,1); - } - } - // If we have valid phantoms, create them... - if(phantoms.length){ - queue.push(['create', phantoms]); - } - - // UPDATE: And finally, if we're still here after splicing-off phantoms and !isValid real records, update the rest... - if(rs.length){ - queue.push(['update', rs]); - } - } - len = queue.length; - if(len){ - batch = ++this.batchCounter; - for(i = 0; i < len; ++i){ - trans = queue[i]; - data[trans[0]] = trans[1]; - } - if(this.fireEvent('beforesave', this, data) !== false){ - for(i = 0; i < len; ++i){ - trans = queue[i]; - this.doTransaction(trans[0], trans[1], batch); - } - return batch; - } - } - return -1; - }, - - // private. Simply wraps call to Store#execute in try/catch. Defers to Store#handleException on error. Loops if batch: false - doTransaction : function(action, rs, batch) { - function transaction(records) { - try{ - this.execute(action, records, undefined, batch); - }catch (e){ - this.handleException(e); - } - } - if(this.batch === false){ - for(var i = 0, len = rs.length; i < len; i++){ - transaction.call(this, rs[i]); - } - }else{ - transaction.call(this, rs); - } - }, - - // private - addToBatch : function(batch){ - var b = this.batches, - key = this.batchKey + batch, - o = b[key]; - - if(!o){ - b[key] = o = { - id: batch, - count: 0, - data: {} - }; - } - ++o.count; - }, - - removeFromBatch : function(batch, action, data){ - var b = this.batches, - key = this.batchKey + batch, - o = b[key], - arr; - - - if(o){ - arr = o.data[action] || []; - o.data[action] = arr.concat(data); - if(o.count === 1){ - data = o.data; - delete b[key]; - this.fireEvent('save', this, batch, data); - }else{ - --o.count; - } - } - }, - - // @private callback-handler for remote CRUD actions - // Do not override -- override loadRecords, onCreateRecords, onDestroyRecords and onUpdateRecords instead. - createCallback : function(action, rs, batch) { - var actions = Ext.data.Api.actions; - return (action == 'read') ? this.loadRecords : function(data, response, success) { - // calls: onCreateRecords | onUpdateRecords | onDestroyRecords - this['on' + Ext.util.Format.capitalize(action) + 'Records'](success, rs, [].concat(data)); - // If success === false here, exception will have been called in DataProxy - if (success === true) { - this.fireEvent('write', this, action, data, response, rs); - } - this.removeFromBatch(batch, action, data); - }; - }, - - // Clears records from modified array after an exception event. - // NOTE: records are left marked dirty. Do we want to commit them even though they were not updated/realized? - // TODO remove this method? - clearModified : function(rs) { - if (Ext.isArray(rs)) { - for (var n=rs.length-1;n>=0;n--) { - this.modified.splice(this.modified.indexOf(rs[n]), 1); - } - } else { - this.modified.splice(this.modified.indexOf(rs), 1); - } - }, - - // remap record ids in MixedCollection after records have been realized. @see Store#onCreateRecords, @see DataReader#realize - reMap : function(record) { - if (Ext.isArray(record)) { - for (var i = 0, len = record.length; i < len; i++) { - this.reMap(record[i]); - } - } else { - delete this.data.map[record._phid]; - this.data.map[record.id] = record; - var index = this.data.keys.indexOf(record._phid); - this.data.keys.splice(index, 1, record.id); - delete record._phid; - } - }, - - // @protected onCreateRecord proxy callback for create action - onCreateRecords : function(success, rs, data) { - if (success === true) { - try { - this.reader.realize(rs, data); - this.reMap(rs); - } - catch (e) { - this.handleException(e); - if (Ext.isArray(rs)) { - // Recurse to run back into the try {}. DataReader#realize splices-off the rs until empty. - this.onCreateRecords(success, rs, data); - } - } - } - }, - - // @protected, onUpdateRecords proxy callback for update action - onUpdateRecords : function(success, rs, data) { - if (success === true) { - try { - this.reader.update(rs, data); - } catch (e) { - this.handleException(e); - if (Ext.isArray(rs)) { - // Recurse to run back into the try {}. DataReader#update splices-off the rs until empty. - this.onUpdateRecords(success, rs, data); - } - } - } - }, - - // @protected onDestroyRecords proxy callback for destroy action - onDestroyRecords : function(success, rs, data) { - // splice each rec out of this.removed - rs = (rs instanceof Ext.data.Record) ? [rs] : [].concat(rs); - for (var i=0,len=rs.length;i=0;i--) { - this.insert(rs[i].lastIndex, rs[i]); // <-- lastIndex set in Store#destroyRecord - } - } - }, - - // protected handleException. Possibly temporary until Ext framework has an exception-handler. - handleException : function(e) { - // @see core/Error.js - Ext.handleError(e); - }, - - /** - *

Reloads the Record cache from the configured Proxy using the configured - * {@link Ext.data.Reader Reader} and the options from the last load operation - * performed.

- *

Note: see the Important note in {@link #load}.

- * @param {Object} options

(optional) An Object containing - * {@link #load loading options} which may override the {@link #lastOptions options} - * used in the last {@link #load} operation. See {@link #load} for details - * (defaults to null, in which case the {@link #lastOptions} are - * used).

- *

To add new params to the existing params:


-lastOptions = myStore.lastOptions;
-Ext.apply(lastOptions.params, {
-    myNewParam: true
-});
-myStore.reload(lastOptions);
-     * 
- */ - reload : function(options){ - this.load(Ext.applyIf(options||{}, this.lastOptions)); - }, - - // private - // Called as a callback by the Reader during a load operation. - loadRecords : function(o, options, success){ - var i, len; - - if (this.isDestroyed === true) { - return; - } - if(!o || success === false){ - if(success !== false){ - this.fireEvent('load', this, [], options); - } - if(options.callback){ - options.callback.call(options.scope || this, [], options, false, o); - } - return; - } - var r = o.records, t = o.totalRecords || r.length; - if(!options || options.add !== true){ - if(this.pruneModifiedRecords){ - this.modified = []; - } - for(i = 0, len = r.length; i < len; i++){ - r[i].join(this); - } - if(this.snapshot){ - this.data = this.snapshot; - delete this.snapshot; - } - this.clearData(); - this.data.addAll(r); - this.totalLength = t; - this.applySort(); - this.fireEvent('datachanged', this); - }else{ - var toAdd = [], - rec, - cnt = 0; - for(i = 0, len = r.length; i < len; ++i){ - rec = r[i]; - if(this.indexOfId(rec.id) > -1){ - this.doUpdate(rec); - }else{ - toAdd.push(rec); - ++cnt; - } - } - this.totalLength = Math.max(t, this.data.length + cnt); - this.add(toAdd); - } - 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 and fires the {@link #load} event. A {@link Ext.data.Reader 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 {@link Ext.data.Reader Reader} that is configured and should correspond to - * that {@link Ext.data.Reader Reader}'s {@link Ext.data.Reader#readRecords} parameter. - * @param {Boolean} append (Optional) true to append the new Records rather the default to replace - * the existing cache. - * Note: that Records in a Store are keyed by their {@link Ext.data.Record#id id}, so added Records - * with ids which are already present in the Store will replace existing Records. Only Records with - * new, unique ids will be added. - */ - loadData : function(o, append){ - var r = this.reader.readRecords(o); - this.loadRecords(r, {add: append}, true); - }, - - /** - * Gets the number of cached records. - *

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 {@link #getTotalCount} function returns - * the dataset size. Note: see the Important note in {@link #load}.

- * @return {Number} The number of Records in the Store's cache. - */ - getCount : function(){ - return this.data.length || 0; - }, - - /** - * Gets the total number of records in the dataset as returned by the server. - *

If using paging, for this to be accurate, the data object used by the {@link #reader Reader} - * must contain the dataset size. For remote data sources, the value for this property - * (totalProperty for {@link Ext.data.JsonReader JsonReader}, - * totalRecords for {@link Ext.data.XmlReader XmlReader}) shall be returned by a query on the server. - * Note: see the Important note in {@link #load}.

- * @return {Number} The number of Records as specified in the data object passed to the Reader - * by the Proxy. - *

Note: this value is not updated when changing the contents of the Store locally.

- */ - getTotalCount : function(){ - return this.totalLength || 0; - }, - - /** - * Returns an object describing the current sort state of this Store. - * @return {Object} The sort state of the Store. An object with two properties:
    - *
  • field : String

    The name of the field by which the Records are sorted.

  • - *
  • direction : String

    The sort order, 'ASC' or 'DESC' (case-sensitive).

  • - *
- * See {@link #sortInfo} for additional details. - */ - getSortState : function(){ - return this.sortInfo; - }, - - /** - * @private - * Invokes sortData if we have sortInfo to sort on and are not sorting remotely - */ - applySort : function(){ - if ((this.sortInfo || this.multiSortInfo) && !this.remoteSort) { - this.sortData(); - } - }, - - /** - * @private - * Performs the actual sorting of data. This checks to see if we currently have a multi sort or not. It applies - * each sorter field/direction pair in turn by building an OR'ed master sorting function and running it against - * the full dataset - */ - sortData : function() { - var sortInfo = this.hasMultiSort ? this.multiSortInfo : this.sortInfo, - direction = sortInfo.direction || "ASC", - sorters = sortInfo.sorters, - sortFns = []; - - //if we just have a single sorter, pretend it's the first in an array - if (!this.hasMultiSort) { - sorters = [{direction: direction, field: sortInfo.field}]; - } - - //create a sorter function for each sorter field/direction combo - for (var i=0, j = sorters.length; i < j; i++) { - sortFns.push(this.createSortFunction(sorters[i].field, sorters[i].direction)); - } - - if (sortFns.length == 0) { - return; - } - - //the direction modifier is multiplied with the result of the sorting functions to provide overall sort direction - //(as opposed to direction per field) - var directionModifier = direction.toUpperCase() == "DESC" ? -1 : 1; - - //create a function which ORs each sorter together to enable multi-sort - var fn = function(r1, r2) { - var result = sortFns[0].call(this, r1, r2); - - //if we have more than one sorter, OR any additional sorter functions together - if (sortFns.length > 1) { - for (var i=1, j = sortFns.length; i < j; i++) { - result = result || sortFns[i].call(this, r1, r2); - } - } - - return directionModifier * result; - }; - - //sort the data - this.data.sort(direction, fn); - if (this.snapshot && this.snapshot != this.data) { - this.snapshot.sort(direction, fn); - } - }, - - /** - * @private - * Creates and returns a function which sorts an array by the given field and direction - * @param {String} field The field to create the sorter for - * @param {String} direction The direction to sort by (defaults to "ASC") - * @return {Function} A function which sorts by the field/direction combination provided - */ - createSortFunction: function(field, direction) { - direction = direction || "ASC"; - var directionModifier = direction.toUpperCase() == "DESC" ? -1 : 1; - - var sortType = this.fields.get(field).sortType; - - //create a comparison function. Takes 2 records, returns 1 if record 1 is greater, - //-1 if record 2 is greater or 0 if they are equal - return function(r1, r2) { - var v1 = sortType(r1.data[field]), - v2 = sortType(r2.data[field]); - - return directionModifier * (v1 > v2 ? 1 : (v1 < v2 ? -1 : 0)); - }; - }, - - /** - * Sets the default sort column and order to be used by the next {@link #load} operation. - * @param {String} fieldName The name of the field to sort by. - * @param {String} dir (optional) The sort order, 'ASC' or 'DESC' (case-sensitive, defaults to 'ASC') - */ - setDefaultSort : function(field, dir) { - dir = dir ? dir.toUpperCase() : 'ASC'; - this.sortInfo = {field: field, direction: dir}; - this.sortToggle[field] = dir; - }, - - /** - * 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. See also {@link #remoteSort} and {@link #paramNames}. - * This function accepts two call signatures - pass in a field name as the first argument to sort on a single - * field, or pass in an array of sort configuration objects to sort by multiple fields. - * Single sort example: - * store.sort('name', 'ASC'); - * Multi sort example: - * store.sort([ - * { - * field : 'name', - * direction: 'ASC' - * }, - * { - * field : 'salary', - * direction: 'DESC' - * } - * ], 'ASC'); - * In this second form, the sort configs are applied in order, with later sorters sorting within earlier sorters' results. - * For example, if two records with the same name are present they will also be sorted by salary if given the sort configs - * above. Any number of sort configs can be added. - * @param {String/Array} fieldName The name of the field to sort by, or an array of ordered sort configs - * @param {String} dir (optional) The sort order, 'ASC' or 'DESC' (case-sensitive, defaults to 'ASC') - */ - sort : function(fieldName, dir) { - if (Ext.isArray(arguments[0])) { - return this.multiSort.call(this, fieldName, dir); - } else { - return this.singleSort(fieldName, dir); - } - }, - - /** - * Sorts the store contents by a single field and direction. This is called internally by {@link sort} and would - * not usually be called manually - * @param {String} fieldName The name of the field to sort by. - * @param {String} dir (optional) The sort order, 'ASC' or 'DESC' (case-sensitive, defaults to 'ASC') - */ - singleSort: function(fieldName, dir) { - var field = this.fields.get(fieldName); - if (!field) { - return false; - } - - var name = field.name, - sortInfo = this.sortInfo || null, - sortToggle = this.sortToggle ? this.sortToggle[name] : null; - - if (!dir) { - if (sortInfo && sortInfo.field == name) { // toggle sort dir - dir = (this.sortToggle[name] || 'ASC').toggle('ASC', 'DESC'); - } else { - dir = field.sortDir; - } - } - - this.sortToggle[name] = dir; - this.sortInfo = {field: name, direction: dir}; - this.hasMultiSort = false; - - if (this.remoteSort) { - if (!this.load(this.lastOptions)) { - if (sortToggle) { - this.sortToggle[name] = sortToggle; - } - if (sortInfo) { - this.sortInfo = sortInfo; - } - } - } else { - this.applySort(); - this.fireEvent('datachanged', this); - } - return true; - }, - - /** - * Sorts the contents of this store by multiple field/direction sorters. This is called internally by {@link sort} - * and would not usually be called manually. - * Multi sorting only currently applies to local datasets - multiple sort data is not currently sent to a proxy - * if remoteSort is used. - * @param {Array} sorters Array of sorter objects (field and direction) - * @param {String} direction Overall direction to sort the ordered results by (defaults to "ASC") - */ - multiSort: function(sorters, direction) { - this.hasMultiSort = true; - direction = direction || "ASC"; - - //toggle sort direction - if (this.multiSortInfo && direction == this.multiSortInfo.direction) { - direction = direction.toggle("ASC", "DESC"); - } - - /** - * Object containing overall sort direction and an ordered array of sorter configs used when sorting on multiple fields - * @property multiSortInfo - * @type Object - */ - this.multiSortInfo = { - sorters : sorters, - direction: direction - }; - - if (this.remoteSort) { - this.singleSort(sorters[0].field, sorters[0].direction); - - } else { - this.applySort(); - this.fireEvent('datachanged', this); - } - }, - - /** - * Calls the specified function for each of the {@link Ext.data.Record Records} in the cache. - * @param {Function} fn The function to call. The {@link Ext.data.Record Record} is passed as the first parameter. - * Returning false aborts and exits the iteration. - * @param {Object} scope (optional) The scope (this reference) in which the function is executed. - * Defaults to the current {@link Ext.data.Record Record} in the iteration. - */ - each : function(fn, scope){ - this.data.each(fn, scope); - }, - - /** - * Gets all {@link Ext.data.Record records} modified since the last commit. Modified records are - * persisted across load operations (e.g., during paging). Note: deleted records are not - * included. See also {@link #pruneModifiedRecords} and - * {@link Ext.data.Record}{@link Ext.data.Record#markDirty markDirty}.. - * @return {Ext.data.Record[]} An array of {@link Ext.data.Record Records} containing outstanding - * modifications. To obtain modified fields within a modified record see - *{@link Ext.data.Record}{@link Ext.data.Record#modified modified}.. - */ - getModifiedRecords : function(){ - return this.modified; - }, - - /** - * Sums the value of property for each {@link Ext.data.Record record} between start - * and end and returns the result. - * @param {String} property A field in each record - * @param {Number} start (optional) The record index to start at (defaults to 0) - * @param {Number} end (optional) 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; - }, - - /** - * @private - * Returns a filter function used to test a the given property's value. Defers most of the work to - * Ext.util.MixedCollection's createValueMatcher function - * @param {String} property The property to create the filter function for - * @param {String/RegExp} value The string/regex to compare the property value to - * @param {Boolean} anyMatch True if we don't care if the filter value is not the full value (defaults to false) - * @param {Boolean} caseSensitive True to create a case-sensitive regex (defaults to false) - * @param {Boolean} exactMatch True to force exact match (^ and $ characters added to the regex). Defaults to false. Ignored if anyMatch is true. - */ - createFilterFn : function(property, value, anyMatch, caseSensitive, exactMatch){ - if(Ext.isEmpty(value, false)){ - return false; - } - value = this.data.createValueMatcher(value, anyMatch, caseSensitive, exactMatch); - return function(r) { - return value.test(r.data[property]); - }; - }, - - /** - * @private - * Given an array of filter functions (each with optional scope), constructs and returns a single function that returns - * the result of all of the filters ANDed together - * @param {Array} filters The array of filter objects (each object should contain an 'fn' and optional scope) - * @return {Function} The multiple filter function - */ - createMultipleFilterFn: function(filters) { - return function(record) { - var isMatch = true; - - for (var i=0, j = filters.length; i < j; i++) { - var filter = filters[i], - fn = filter.fn, - scope = filter.scope; - - isMatch = isMatch && fn.call(scope, record); - } - - return isMatch; - }; - }, - - /** - * Filter the {@link Ext.data.Record records} by a specified property. Alternatively, pass an array of filter - * options to filter by more than one property. - * Single filter example: - * store.filter('name', 'Ed', true, true); //finds all records containing the substring 'Ed' - * Multiple filter example: - *

-     * store.filter([
-     *   {
-     *     property     : 'name',
-     *     value        : 'Ed',
-     *     anyMatch     : true, //optional, defaults to true
-     *     caseSensitive: true  //optional, defaults to true
-     *   },
-     *
-     *   //filter functions can also be passed
-     *   {
-     *     fn   : function(record) {
-     *       return record.get('age') == 24
-     *     },
-     *     scope: this
-     *   }
-     * ]);
-     * 
- * @param {String|Array} field A field on your records, or an array containing multiple filter options - * @param {String/RegExp} value Either a string that the field should begin with, or a RegExp to test - * against the field. - * @param {Boolean} anyMatch (optional) true to match any part not just the beginning - * @param {Boolean} caseSensitive (optional) true for case sensitive comparison - * @param {Boolean} exactMatch True to force exact match (^ and $ characters added to the regex). Defaults to false. Ignored if anyMatch is true. - */ - filter : function(property, value, anyMatch, caseSensitive, exactMatch){ - var fn; - //we can accept an array of filter objects, or a single filter object - normalize them here - if (Ext.isObject(property)) { - property = [property]; - } - - if (Ext.isArray(property)) { - var filters = []; - - //normalize the filters passed into an array of filter functions - for (var i=0, j = property.length; i < j; i++) { - var filter = property[i], - func = filter.fn, - scope = filter.scope || this; - - //if we weren't given a filter function, construct one now - if (!Ext.isFunction(func)) { - func = this.createFilterFn(filter.property, filter.value, filter.anyMatch, filter.caseSensitive, filter.exactMatch); - } - - filters.push({fn: func, scope: scope}); - } - - fn = this.createMultipleFilterFn(filters); - } else { - //classic single property filter - fn = this.createFilterFn(property, value, anyMatch, caseSensitive, exactMatch); - } - - return fn ? this.filterBy(fn) : this.clearFilter(); - }, - - /** - * Filter by a function. The specified function will be called for each - * Record in this Store. If the function returns true the Record is included, - * otherwise it is filtered out. - * @param {Function} fn The function to be called. It will be passed the following parameters:
    - *
  • record : Ext.data.Record

    The {@link Ext.data.Record record} - * to test for filtering. Access field values using {@link Ext.data.Record#get}.

  • - *
  • id : Object

    The ID of the Record passed.

  • - *
- * @param {Object} scope (optional) The scope (this reference) in which the function is executed. Defaults to this Store. - */ - filterBy : function(fn, scope){ - this.snapshot = this.snapshot || this.data; - this.data = this.queryBy(fn, scope || this); - this.fireEvent('datachanged', this); - }, - - /** - * Revert to a view of the Record cache with no filtering applied. - * @param {Boolean} suppressEvent If true the filter is cleared silently without firing the - * {@link #datachanged} event. - */ - clearFilter : function(suppressEvent){ - if(this.isFiltered()){ - this.data = this.snapshot; - delete this.snapshot; - if(suppressEvent !== true){ - this.fireEvent('datachanged', this); - } - } - }, - - /** - * Returns true if this store is currently filtered - * @return {Boolean} - */ - isFiltered : function(){ - return !!this.snapshot && this.snapshot != this.data; - }, - - /** - * 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 begin with, or a RegExp to test against the field. - * @param {Boolean} anyMatch (optional) True to match any part not just the beginning - * @param {Boolean} caseSensitive (optional) True for case sensitive comparison - * @return {MixedCollection} Returns an Ext.util.MixedCollection of the matched records - */ - query : function(property, value, anyMatch, caseSensitive){ - var fn = this.createFilterFn(property, value, anyMatch, caseSensitive); - return fn ? this.queryBy(fn) : this.data.clone(); - }, - - /** - * Query the cached records in this Store using a filtering function. The specified function - * will be called with each record in this Store. If the function returns true the record is - * included in the results. - * @param {Function} fn The function to be called. It will be passed the following parameters:
    - *
  • record : Ext.data.Record

    The {@link Ext.data.Record record} - * to test for filtering. Access field values using {@link Ext.data.Record#get}.

  • - *
  • id : Object

    The ID of the Record passed.

  • - *
- * @param {Object} scope (optional) The scope (this reference) in which the function is executed. Defaults to this Store. - * @return {MixedCollection} Returns an Ext.util.MixedCollection of the matched records - **/ - queryBy : function(fn, scope){ - var data = this.snapshot || this.data; - return data.filterBy(fn, scope||this); - }, - - /** - * Finds the index of the first matching Record in this store by a specific field value. - * @param {String} fieldName The name of the Record field to test. - * @param {String/RegExp} value Either a string that the field value - * should begin with, or a RegExp to test against the field. - * @param {Number} startIndex (optional) The index to start searching at - * @param {Boolean} anyMatch (optional) True to match any part of the string, not just the beginning - * @param {Boolean} caseSensitive (optional) True for case sensitive comparison - * @return {Number} The matched index or -1 - */ - find : function(property, value, start, anyMatch, caseSensitive){ - var fn = this.createFilterFn(property, value, anyMatch, caseSensitive); - return fn ? this.data.findIndexBy(fn, null, start) : -1; - }, - - /** - * Finds the index of the first matching Record in this store by a specific field value. - * @param {String} fieldName The name of the Record field to test. - * @param {Mixed} value The value to match the field against. - * @param {Number} startIndex (optional) The index to start searching at - * @return {Number} The matched index or -1 - */ - findExact: function(property, value, start){ - return this.data.findIndexBy(function(rec){ - return rec.get(property) === value; - }, this, start); - }, - - /** - * Find the index of the first matching Record in this Store by a function. - * If the function returns true it is considered a match. - * @param {Function} fn The function to be called. It will be passed the following parameters:
    - *
  • record : Ext.data.Record

    The {@link Ext.data.Record record} - * to test for filtering. Access field values using {@link Ext.data.Record#get}.

  • - *
  • id : Object

    The ID of the Record passed.

  • - *
- * @param {Object} scope (optional) The scope (this reference) in which the function is executed. Defaults to this Store. - * @param {Number} startIndex (optional) The index to start searching at - * @return {Number} The matched index or -1 - */ - findBy : function(fn, scope, start){ - return this.data.findIndexBy(fn, scope, start); - }, - - /** - * 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 || !Ext.isEmpty(v)) && !l[sv]){ - l[sv] = true; - r[r.length] = v; - } - } - return r; - }, - - // private - afterEdit : function(record){ - if(this.modified.indexOf(record) == -1){ - this.modified.push(record); - } - this.fireEvent('update', this, record, Ext.data.Record.EDIT); - }, - - // private - afterReject : function(record){ - this.modified.remove(record); - this.fireEvent('update', this, record, Ext.data.Record.REJECT); - }, - - // private - afterCommit : function(record){ - this.modified.remove(record); - this.fireEvent('update', this, record, Ext.data.Record.COMMIT); - }, - - /** - * Commit all Records with {@link #getModifiedRecords outstanding changes}. To handle updates for changes, - * subscribe to the Store's {@link #update update event}, and perform updating when the third parameter is - * Ext.data.Record.COMMIT. - */ - commitChanges : function(){ - var modified = this.modified.slice(0), - length = modified.length, - i; - - for (i = 0; i < length; i++){ - modified[i].commit(); - } - - this.modified = []; - this.removed = []; - }, - - /** - * {@link Ext.data.Record#reject Reject} outstanding changes on all {@link #getModifiedRecords modified records}. - */ - rejectChanges : function() { - var modified = this.modified.slice(0), - removed = this.removed.slice(0).reverse(), - mLength = modified.length, - rLength = removed.length, - i; - - for (i = 0; i < mLength; i++) { - modified[i].reject(); - } - - for (i = 0; i < rLength; i++) { - this.insert(removed[i].lastIndex || 0, removed[i]); - removed[i].reject(); - } - - this.modified = []; - this.removed = []; - }, - - // private - onMetaChange : function(meta){ - this.recordType = this.reader.recordType; - this.fields = this.recordType.prototype.fields; - delete this.snapshot; - if(this.reader.meta.sortInfo){ - this.sortInfo = this.reader.meta.sortInfo; - }else if(this.sortInfo && !this.fields.get(this.sortInfo.field)){ - delete this.sortInfo; - } - if(this.writer){ - this.writer.meta = this.reader.meta; - } - this.modified = []; - this.fireEvent('metachange', this, this.reader.meta); - }, - - // private - findInsertIndex : function(record){ - this.suspendEvents(); - var data = this.data.clone(); - this.data.add(record); - this.applySort(); - var index = this.data.indexOf(record); - this.data = data; - this.resumeEvents(); - return index; - }, - - /** - * Set the value for a property name in this store's {@link #baseParams}. Usage:


-myStore.setBaseParam('foo', {bar:3});
-
- * @param {String} name Name of the property to assign - * @param {Mixed} value Value to assign the named property - **/ - setBaseParam : function (name, value){ - this.baseParams = this.baseParams || {}; - this.baseParams[name] = value; - } -}); - -Ext.reg('store', Ext.data.Store); - -/** - * @class Ext.data.Store.Error - * @extends Ext.Error - * Store Error extension. - * @param {String} name - */ -Ext.data.Store.Error = Ext.extend(Ext.Error, { - name: 'Ext.data.Store' -}); -Ext.apply(Ext.data.Store.Error.prototype, { - lang: { - 'writer-undefined' : 'Attempted to execute a write-action without a DataWriter installed.' - } -}); diff --git a/assets/js/ext/src/data/StoreMgr.js b/assets/js/ext/src/data/StoreMgr.js deleted file mode 100644 index 16cad18..0000000 --- a/assets/js/ext/src/data/StoreMgr.js +++ /dev/null @@ -1,72 +0,0 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.com/license - */ -/** - * @class Ext.StoreMgr - * @extends Ext.util.MixedCollection - * The default global group of stores. - * @singleton - */ -Ext.StoreMgr = Ext.apply(new Ext.util.MixedCollection(), { - /** - * @cfg {Object} listeners @hide - */ - - /** - * Registers one or more Stores with the StoreMgr. You do not normally need to register stores - * manually. Any store initialized with a {@link Ext.data.Store#storeId} will be auto-registered. - * @param {Ext.data.Store} store1 A Store instance - * @param {Ext.data.Store} store2 (optional) - * @param {Ext.data.Store} etc... (optional) - */ - register : function(){ - for(var i = 0, s; (s = arguments[i]); i++){ - this.add(s); - } - }, - - /** - * Unregisters one or more Stores with the StoreMgr - * @param {String/Object} id1 The id of the Store, or a Store instance - * @param {String/Object} id2 (optional) - * @param {String/Object} etc... (optional) - */ - unregister : function(){ - for(var i = 0, s; (s = arguments[i]); i++){ - this.remove(this.lookup(s)); - } - }, - - /** - * Gets a registered Store by id - * @param {String/Object} id The id of the Store, or a Store instance - * @return {Ext.data.Store} - */ - lookup : function(id){ - if(Ext.isArray(id)){ - var fields = ['field1'], expand = !Ext.isArray(id[0]); - if(!expand){ - for(var i = 2, len = id[0].length; i <= len; ++i){ - fields.push('field' + i); - } - } - return new Ext.data.ArrayStore({ - fields: fields, - data: id, - expandData: expand, - autoDestroy: true, - autoCreated: true - - }); - } - return Ext.isObject(id) ? (id.events ? id : Ext.create(id, 'store')) : this.get(id); - }, - - // getKey implementation for MixedCollection - getKey : function(o){ - return o.storeId; - } -}); \ No newline at end of file diff --git a/assets/js/ext/src/data/Tree.js b/assets/js/ext/src/data/Tree.js deleted file mode 100644 index a34ec62..0000000 --- a/assets/js/ext/src/data/Tree.js +++ /dev/null @@ -1,833 +0,0 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.com/license - */ -/** - * @class Ext.data.Tree - * @extends Ext.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 - */ -Ext.data.Tree = Ext.extend(Ext.util.Observable, { - - constructor: 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", - /** - * @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", - /** - * @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", - /** - * @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", - /** - * @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", - /** - * @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", - /** - * @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", - /** - * @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" - ); - Ext.data.Tree.superclass.constructor.call(this); - }, - - /** - * @cfg {String} pathSeparator - * The token used to separate paths in node ids (defaults to '/'). - */ - pathSeparator: "/", - - // private - 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]; - }, - - // private - registerNode : function(node){ - this.nodeHash[node.id] = node; - }, - - // private - unregisterNode : function(node){ - delete this.nodeHash[node.id]; - }, - - toString : function(){ - return "[Tree"+(this.id?" "+this.id:"")+"]"; - } -}); - -/** - * @class Ext.data.Node - * @extends Ext.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 - */ -Ext.data.Node = Ext.extend(Ext.util.Observable, { - - constructor: 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 = Ext.id(null, "xnode-"); - this.attributes.id = this.id; - } - /** - * All child nodes of this node. @type Array - */ - this.childNodes = []; - /** - * 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; - Ext.data.Node.superclass.constructor.call(this); - }, - - // private - fireEvent : function(evtName){ - // first do standard event for this node - if(Ext.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); - }, - - /** - * Returns true if this node has one or more child nodes, else false. - * @return {Boolean} - */ - hasChildNodes : function(){ - return !this.isLeaf() && this.childNodes.length > 0; - }, - - /** - * Returns true if this node has one or more child nodes, or if the expandable - * node attribute is explicitly specified as true (see {@link #attributes}), otherwise returns false. - * @return {Boolean} - */ - isExpandable : function(){ - return this.attributes.expandable || this.hasChildNodes(); - }, - - /** - * 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(Ext.isArray(node)){ - 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 - * @param {Boolean} destroy true to destroy the node upon removal. Defaults to false. - * @return {Node} The removed node - */ - removeChild : function(node, destroy){ - 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); - } - - this.fireEvent("remove", this.ownerTree, this, node); - if(destroy){ - node.destroy(true); - }else{ - node.clear(); - } - return node; - }, - - // private - clear : function(destroy){ - // clear any references from the node - this.setOwnerTree(null, destroy); - this.parentNode = this.previousSibling = this.nextSibling = null; - if(destroy){ - this.firstChild = this.lastChild = null; - } - }, - - /** - * Destroys the node. - */ - destroy : function(/* private */ silent){ - /* - * Silent is to be used in a number of cases - * 1) When setRootNode is called. - * 2) When destroy on the tree is called - * 3) For destroying child nodes on a node - */ - if(silent === true){ - this.purgeListeners(); - this.clear(true); - Ext.each(this.childNodes, function(n){ - n.destroy(true); - }); - this.childNodes = null; - }else{ - this.remove(true); - } - }, - - /** - * 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; - }, - - /** - * Removes this node from its parent - * @param {Boolean} destroy true to destroy the node upon removal. Defaults to false. - * @return {Node} this - */ - remove : function(destroy){ - if (this.parentNode) { - this.parentNode.removeChild(this, destroy); - } - return this; - }, - - /** - * Removes all child nodes from this node. - * @param {Boolean} destroy true to destroy the node upon removal. Defaults to false. - * @return {Node} this - */ - removeAll : function(destroy){ - var cn = this.childNodes, - n; - while((n = cn[0])){ - this.removeChild(n, destroy); - } - return this; - }, - - /** - * 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){ - var s = oldChild ? oldChild.nextSibling : null; - this.removeChild(oldChild); - this.insertBefore(newChild, s); - 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, destroy){ - // if it is a move, we need to update everyone - if(tree != this.ownerTree){ - if(this.ownerTree){ - this.ownerTree.unregisterNode(this); - } - this.ownerTree = tree; - // If we're destroying, we don't need to recurse since it will be called on each child node - if(destroy !== true){ - Ext.each(this.childNodes, function(n){ - n.setOwnerTree(tree); - }); - } - if(tree){ - tree.registerNode(this); - } - } - }, - - /** - * Changes the id of this node. - * @param {String} id The new id for the node. - */ - setId: function(id){ - if(id !== this.id){ - var t = this.ownerTree; - if(t){ - t.unregisterNode(this); - } - this.id = this.attributes.id = id; - if(t){ - t.registerNode(this); - } - this.onIdChange(id); - } - }, - - // private - onIdChange: Ext.emptyFn, - - /** - * 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 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 (this reference) in which the function is executed. Defaults to the 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.apply(scope || p, args || [p]) === false){ - break; - } - p = p.parentNode; - } - }, - - /** - * Cascades down the tree from this node, calling the specified function with each 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 (this reference) in which the function is executed. Defaults to the 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.apply(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 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 (this reference) in which the function is executed. Defaults to the current Node in the iteration. - * @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.apply(scope || cs[i], 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 - * @param {Boolean} deep (Optional) True to search through nodes deeper than the immediate children - * @return {Node} The found child or null if none was found - */ - findChild : function(attribute, value, deep){ - return this.findChildBy(function(){ - return this.attributes[attribute] == value; - }, null, deep); - }, - - /** - * Finds the first child by a custom function. The child matches if the function passed returns true. - * @param {Function} fn A function which must return true if the passed Node is the required Node. - * @param {Object} scope (optional) The scope (this reference) in which the function is executed. Defaults to the Node being tested. - * @param {Boolean} deep (Optional) True to search through nodes deeper than the immediate children - * @return {Node} The found child or null if none was found - */ - findChildBy : function(fn, scope, deep){ - var cs = this.childNodes, - len = cs.length, - i = 0, - n, - res; - for(; i < len; i++){ - n = cs[i]; - if(fn.call(scope || n, n) === true){ - return n; - }else if (deep){ - res = n.findChildBy(fn, scope, deep); - if(res != null){ - return res; - } - } - - } - return null; - }, - - /** - * Sorts this nodes children using the supplied sort function. - * @param {Function} fn A function which, when passed two Nodes, returns -1, 0 or 1 depending upon required sort order. - * @param {Object} scope (optional)The scope (this reference) in which the function is executed. Defaults to the browser window. - */ - 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/assets/js/ext/src/data/Types.js b/assets/js/ext/src/data/Types.js deleted file mode 100644 index 884bf2e..0000000 --- a/assets/js/ext/src/data/Types.js +++ /dev/null @@ -1,187 +0,0 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.com/license - */ -/** - * @class Ext.data.Types - *

This is s static class containing the system-supplied data types which may be given to a {@link Ext.data.Field Field}.

- *

The properties in this class are used as type indicators in the {@link Ext.data.Field Field} class, so to - * test whether a Field is of a certain type, compare the {@link Ext.data.Field#type type} property against properties - * of this class.

- *

Developers may add their own application-specific data types to this class. Definition names must be UPPERCASE. - * each type definition must contain three properties:

- *
    - *
  • convert : Function
    A function to convert raw data values from a data block into the data - * to be stored in the Field. The function is passed the collowing parameters: - *
      - *
    • v : Mixed
      The data value as read by the Reader, if undefined will use - * the configured {@link Ext.data.Field#defaultValue defaultValue}.
    • - *
    • rec : Mixed
      The data object containing the row as read by the Reader. - * Depending on the Reader type, this could be an Array ({@link Ext.data.ArrayReader ArrayReader}), an object - * ({@link Ext.data.JsonReader JsonReader}), or an XML element ({@link Ext.data.XMLReader XMLReader}).
    • - *
  • - *
  • sortType : Function
    A function to convert the stored data into comparable form, as defined by {@link Ext.data.SortTypes}.
  • - *
  • type : String
    A textual data type name.
  • - *
- *

For example, to create a VELatLong field (See the Microsoft Bing Mapping API) containing the latitude/longitude value of a datapoint on a map from a JsonReader data block - * which contained the properties lat and long, you would define a new data type like this:

- *

-// Add a new Field data type which stores a VELatLong object in the Record.
-Ext.data.Types.VELATLONG = {
-    convert: function(v, data) {
-        return new VELatLong(data.lat, data.long);
-    },
-    sortType: function(v) {
-        return v.Latitude;  // When sorting, order by latitude
-    },
-    type: 'VELatLong'
-};
-
- *

Then, when declaring a Record, use


-var types = Ext.data.Types; // allow shorthand type access
-UnitRecord = Ext.data.Record.create([
-    { name: 'unitName', mapping: 'UnitName' },
-    { name: 'curSpeed', mapping: 'CurSpeed', type: types.INT },
-    { name: 'latitude', mapping: 'lat', type: types.FLOAT },
-    { name: 'latitude', mapping: 'lat', type: types.FLOAT },
-    { name: 'position', type: types.VELATLONG }
-]);
-
- * @singleton - */ -Ext.data.Types = new function(){ - var st = Ext.data.SortTypes; - Ext.apply(this, { - /** - * @type Regexp - * @property stripRe - * A regular expression for stripping non-numeric characters from a numeric value. Defaults to /[\$,%]/g. - * This should be overridden for localization. - */ - stripRe: /[\$,%]/g, - - /** - * @type Object. - * @property AUTO - * This data type means that no conversion is applied to the raw data before it is placed into a Record. - */ - AUTO: { - convert: function(v){ return v; }, - sortType: st.none, - type: 'auto' - }, - - /** - * @type Object. - * @property STRING - * This data type means that the raw data is converted into a String before it is placed into a Record. - */ - STRING: { - convert: function(v){ return (v === undefined || v === null) ? '' : String(v); }, - sortType: st.asUCString, - type: 'string' - }, - - /** - * @type Object. - * @property INT - * This data type means that the raw data is converted into an integer before it is placed into a Record. - *

The synonym INTEGER is equivalent.

- */ - INT: { - convert: function(v){ - return v !== undefined && v !== null && v !== '' ? - parseInt(String(v).replace(Ext.data.Types.stripRe, ''), 10) : (this.useNull ? null : 0); - }, - sortType: st.none, - type: 'int' - }, - - /** - * @type Object. - * @property FLOAT - * This data type means that the raw data is converted into a number before it is placed into a Record. - *

The synonym NUMBER is equivalent.

- */ - FLOAT: { - convert: function(v){ - return v !== undefined && v !== null && v !== '' ? - parseFloat(String(v).replace(Ext.data.Types.stripRe, ''), 10) : (this.useNull ? null : 0); - }, - sortType: st.none, - type: 'float' - }, - - /** - * @type Object. - * @property BOOL - *

This data type means that the raw data is converted into a boolean before it is placed into - * a Record. The string "true" and the number 1 are converted to boolean true.

- *

The synonym BOOLEAN is equivalent.

- */ - BOOL: { - convert: function(v){ return v === true || v === 'true' || v == 1; }, - sortType: st.none, - type: 'bool' - }, - - /** - * @type Object. - * @property DATE - * This data type means that the raw data is converted into a Date before it is placed into a Record. - * The date format is specified in the constructor of the {@link Ext.data.Field} to which this type is - * being applied. - */ - DATE: { - convert: function(v){ - var df = this.dateFormat; - if(!v){ - return null; - } - if(Ext.isDate(v)){ - return v; - } - if(df){ - if(df == 'timestamp'){ - return new Date(v*1000); - } - if(df == 'time'){ - return new Date(parseInt(v, 10)); - } - return Date.parseDate(v, df); - } - var parsed = Date.parse(v); - return parsed ? new Date(parsed) : null; - }, - sortType: st.asDate, - type: 'date' - } - }); - - Ext.apply(this, { - /** - * @type Object. - * @property BOOLEAN - *

This data type means that the raw data is converted into a boolean before it is placed into - * a Record. The string "true" and the number 1 are converted to boolean true.

- *

The synonym BOOL is equivalent.

- */ - BOOLEAN: this.BOOL, - /** - * @type Object. - * @property INTEGER - * This data type means that the raw data is converted into an integer before it is placed into a Record. - *

The synonym INT is equivalent.

- */ - INTEGER: this.INT, - /** - * @type Object. - * @property NUMBER - * This data type means that the raw data is converted into a number before it is placed into a Record. - *

The synonym FLOAT is equivalent.

- */ - NUMBER: this.FLOAT - }); -}; \ No newline at end of file diff --git a/assets/js/ext/src/data/XmlReader.js b/assets/js/ext/src/data/XmlReader.js deleted file mode 100644 index acf6cb5..0000000 --- a/assets/js/ext/src/data/XmlReader.js +++ /dev/null @@ -1,259 +0,0 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.com/license - */ -/** - * @class Ext.data.XmlReader - * @extends Ext.data.DataReader - *

Data reader class to create an Array of {@link Ext.data.Record} objects from an XML document - * based on mappings in a provided {@link Ext.data.Record} constructor.

- *

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" or "application/xml".

- *

Example code:

- *

-var Employee = Ext.data.Record.create([
-   {name: 'name', mapping: 'name'},     // "mapping" property not needed if it is the same as "name"
-   {name: 'occupation'}                 // This field will use "occupation" as the mapping.
-]);
-var myReader = new Ext.data.XmlReader({
-   totalProperty: "results", // The element which contains the total dataset size (optional)
-   record: "row",           // The repeated element which contains row information
-   idProperty: "id"         // The element within the row that provides an ID for the record (optional)
-   messageProperty: "msg"   // The element within the response that provides a user-feedback message (optional)
-}, Employee);
-
- *

- * This would consume an XML file like this: - *


-<?xml version="1.0" encoding="UTF-8"?>
-<dataset>
- <results>2</results>
- <row>
-   <id>1</id>
-   <name>Bill</name>
-   <occupation>Gardener</occupation>
- </row>
- <row>
-   <id>2</id>
-   <name>Ben</name>
-   <occupation>Horticulturalist</occupation>
- </row>
-</dataset>
-
- * @cfg {String} totalProperty 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} record The DomQuery path to the repeated element which contains record information. - * @cfg {String} successProperty The DomQuery path to the success attribute used by forms. - * @cfg {String} idPath 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 {Object} recordType Either an Array of field definition objects as passed to - * {@link Ext.data.Record#create}, or a Record constructor object created using {@link Ext.data.Record#create}. - */ -Ext.data.XmlReader = function(meta, recordType){ - meta = meta || {}; - - // backwards compat, convert idPath or id / success - Ext.applyIf(meta, { - idProperty: meta.idProperty || meta.idPath || meta.id, - successProperty: meta.successProperty || meta.success - }); - - Ext.data.XmlReader.superclass.constructor.call(this, meta, recordType || meta.fields); -}; -Ext.extend(Ext.data.XmlReader, Ext.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 property called responseXML which refers to an XML document object. - * @return {Object} records A data block which is used by an {@link Ext.data.Store} as - * a cache of Ext.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 Ext.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 Ext.data.Store} as - * a cache of Ext.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, - q = Ext.DomQuery, - totalRecords = 0, - success = true; - - if(this.meta.totalProperty){ - totalRecords = this.getTotal(root, 0); - } - if(this.meta.successProperty){ - success = this.getSuccess(root); - } - - var records = this.extractData(q.select(this.meta.record, root), true); // <-- true to return Ext.data.Record[] - - // TODO return Ext.data.Response instance. @see #readResponse - return { - success : success, - records : records, - totalRecords : totalRecords || records.length - }; - }, - - /** - * Decode an XML response from server. - * @param {String} action [{@link Ext.data.Api#actions} create|read|update|destroy] - * @param {Object} response HTTP Response object from browser. - * @return {Ext.data.Response} An instance of {@link Ext.data.Response} - */ - readResponse : function(action, response) { - var q = Ext.DomQuery, - doc = response.responseXML, - root = doc.documentElement || doc; - - // create general Response instance. - var res = new Ext.data.Response({ - action: action, - success : this.getSuccess(root), - message: this.getMessage(root), - data: this.extractData(q.select(this.meta.record, root) || q.select(this.meta.root, root), false), - raw: doc - }); - - if (Ext.isEmpty(res.success)) { - throw new Ext.data.DataReader.Error('successProperty-response', this.meta.successProperty); - } - - // Create actions from a response having status 200 must return pk - if (action === Ext.data.Api.actions.create) { - var def = Ext.isDefined(res.data); - if (def && Ext.isEmpty(res.data)) { - throw new Ext.data.JsonReader.Error('root-empty', this.meta.root); - } - else if (!def) { - throw new Ext.data.JsonReader.Error('root-undefined-response', this.meta.root); - } - } - return res; - }, - - getSuccess : function() { - return true; - }, - - /** - * build response-data extractor functions. - * @private - * @ignore - */ - buildExtractors : function() { - if(this.ef){ - return; - } - var s = this.meta, - Record = this.recordType, - f = Record.prototype.fields, - fi = f.items, - fl = f.length; - - if(s.totalProperty) { - this.getTotal = this.createAccessor(s.totalProperty); - } - if(s.successProperty) { - this.getSuccess = this.createAccessor(s.successProperty); - } - if (s.messageProperty) { - this.getMessage = this.createAccessor(s.messageProperty); - } - this.getRoot = function(res) { - return (!Ext.isEmpty(res[this.meta.record])) ? res[this.meta.record] : res[this.meta.root]; - }; - if (s.idPath || s.idProperty) { - var g = this.createAccessor(s.idPath || s.idProperty); - this.getId = function(rec) { - var id = g(rec) || rec.id; - return (id === undefined || id === '') ? null : id; - }; - } else { - this.getId = function(){return null;}; - } - var ef = []; - for(var i = 0; i < fl; i++){ - f = fi[i]; - var map = (f.mapping !== undefined && f.mapping !== null) ? f.mapping : f.name; - ef.push(this.createAccessor(map)); - } - this.ef = ef; - }, - - /** - * Creates a function to return some particular key of data from a response. - * @param {String} key - * @return {Function} - * @private - * @ignore - */ - createAccessor : function(){ - var q = Ext.DomQuery; - return function(key) { - if (Ext.isFunction(key)) { - return key; - } - switch(key) { - case this.meta.totalProperty: - return function(root, def){ - return q.selectNumber(key, root, def); - }; - break; - case this.meta.successProperty: - return function(root, def) { - var sv = q.selectValue(key, root, true); - var success = sv !== false && sv !== 'false'; - return success; - }; - break; - default: - return function(root, def) { - return q.selectValue(key, root, def); - }; - break; - } - }; - }(), - - /** - * extracts values and type-casts a row of data from server, extracted by #extractData - * @param {Hash} data - * @param {Ext.data.Field[]} items - * @param {Number} len - * @private - * @ignore - */ - extractValues : function(data, items, len) { - var f, values = {}; - for(var j = 0; j < len; j++){ - f = items[j]; - var v = this.ef[j](data); - values[f.name] = f.convert((v !== undefined) ? v : f.defaultValue, data); - } - return values; - } -}); \ No newline at end of file diff --git a/assets/js/ext/src/data/XmlStore.js b/assets/js/ext/src/data/XmlStore.js deleted file mode 100644 index 1173694..0000000 --- a/assets/js/ext/src/data/XmlStore.js +++ /dev/null @@ -1,75 +0,0 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.com/license - */ -/** - * @class Ext.data.XmlStore - * @extends Ext.data.Store - *

Small helper class to make creating {@link Ext.data.Store}s from XML data easier. - * A XmlStore will be automatically configured with a {@link Ext.data.XmlReader}.

- *

A store configuration would be something like:


-var store = new Ext.data.XmlStore({
-    // store configs
-    autoDestroy: true,
-    storeId: 'myStore',
-    url: 'sheldon.xml', // automatically configures a HttpProxy
-    // reader configs
-    record: 'Item', // records will have an "Item" tag
-    idPath: 'ASIN',
-    totalRecords: '@TotalResults'
-    fields: [
-        // set up the fields mapping into the xml doc
-        // The first needs mapping, the others are very basic
-        {name: 'Author', mapping: 'ItemAttributes > Author'},
-        'Title', 'Manufacturer', 'ProductGroup'
-    ]
-});
- * 

- *

This store is configured to consume a returned object of the form:


-<?xml version="1.0" encoding="UTF-8"?>
-<ItemSearchResponse xmlns="http://webservices.amazon.com/AWSECommerceService/2009-05-15">
-    <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/
-            </DetailPageURL>
-            <ItemAttributes>
-                <Author>Sidney Sheldon</Author>
-                <Manufacturer>Warner Books</Manufacturer>
-                <ProductGroup>Book</ProductGroup>
-                <Title>Master of the Game</Title>
-            </ItemAttributes>
-        </Item>
-    </Items>
-</ItemSearchResponse>
- * 
- * An object literal of this form could also be used as the {@link #data} config option.

- *

Note: Although not listed here, this class accepts all of the configuration options of - * {@link Ext.data.XmlReader XmlReader}.

- * @constructor - * @param {Object} config - * @xtype xmlstore - */ -Ext.data.XmlStore = Ext.extend(Ext.data.Store, { - /** - * @cfg {Ext.data.DataReader} reader @hide - */ - constructor: function(config){ - Ext.data.XmlStore.superclass.constructor.call(this, Ext.apply(config, { - reader: new Ext.data.XmlReader(config) - })); - } -}); -Ext.reg('xmlstore', Ext.data.XmlStore); \ No newline at end of file diff --git a/assets/js/ext/src/data/XmlWriter.js b/assets/js/ext/src/data/XmlWriter.js deleted file mode 100644 index 365b180..0000000 --- a/assets/js/ext/src/data/XmlWriter.js +++ /dev/null @@ -1,158 +0,0 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.com/license - */ -/** - * @class Ext.data.XmlWriter - * @extends Ext.data.DataWriter - * DataWriter extension for writing an array or single {@link Ext.data.Record} object(s) in preparation for executing a remote CRUD action via XML. - * XmlWriter uses an instance of {@link Ext.XTemplate} for maximum flexibility in defining your own custom XML schema if the default schema is not appropriate for your needs. - * See the {@link #tpl} configuration-property. - */ -Ext.data.XmlWriter = function(params) { - Ext.data.XmlWriter.superclass.constructor.apply(this, arguments); - // compile the XTemplate for rendering XML documents. - this.tpl = (typeof(this.tpl) === 'string') ? new Ext.XTemplate(this.tpl).compile() : this.tpl.compile(); -}; -Ext.extend(Ext.data.XmlWriter, Ext.data.DataWriter, { - /** - * @cfg {String} documentRoot [xrequest] (Optional) The name of the XML document root-node. Note: - * this parameter is required
only when
sending extra {@link Ext.data.Store#baseParams baseParams} to the server - * during a write-request -- if no baseParams are set, the {@link Ext.data.XmlReader#record} meta-property can - * suffice as the XML document root-node for write-actions involving just a single record. For requests - * involving multiple records and NO baseParams, the {@link Ext.data.XmlWriter#root} property can - * act as the XML document root. - */ - documentRoot: 'xrequest', - /** - * @cfg {Boolean} forceDocumentRoot [false] Set to true to force XML documents having a root-node as defined - * by {@link #documentRoot}, even with no baseParams defined. - */ - forceDocumentRoot: false, - /** - * @cfg {String} root [records] The name of the containing element which will contain the nodes of an write-action involving multiple records. Each - * xml-record written to the server will be wrapped in an element named after {@link Ext.data.XmlReader#record} property. - * eg: -
-<?xml version="1.0" encoding="UTF-8"?>
-<user><first>Barney</first></user>
-
- * However, when multiple records are written in a batch-operation, these records must be wrapped in a containing - * Element. - * eg: -
-<?xml version="1.0" encoding="UTF-8"?>
-    <records>
-        <first>Barney</first></user>
-        <records><first>Barney</first></user>
-    </records>
-
- * Defaults to records. Do not confuse the nature of this property with that of {@link #documentRoot} - */ - root: 'records', - /** - * @cfg {String} xmlVersion [1.0] The version written to header of xml documents. -
<?xml version="1.0" encoding="ISO-8859-15"?>
- */ - xmlVersion : '1.0', - /** - * @cfg {String} xmlEncoding [ISO-8859-15] The encoding written to header of xml documents. -
<?xml version="1.0" encoding="ISO-8859-15"?>
- */ - xmlEncoding: 'ISO-8859-15', - /** - * @cfg {String/Ext.XTemplate} tpl The XML template used to render {@link Ext.data.Api#actions write-actions} to your server. - *

One can easily provide his/her own custom {@link Ext.XTemplate#constructor template-definition} if the default does not suffice.

- *

Defaults to:

-
-<?xml version="{version}" encoding="{encoding}"?>
-    <tpl if="documentRoot"><{documentRoot}>
-    <tpl for="baseParams">
-        <tpl for=".">
-            <{name}>{value}</{name}>
-        </tpl>
-    </tpl>
-    <tpl if="records.length > 1"><{root}>',
-    <tpl for="records">
-        <{parent.record}>
-        <tpl for=".">
-            <{name}>{value}</{name}>
-        </tpl>
-        </{parent.record}>
-    </tpl>
-    <tpl if="records.length > 1"></{root}></tpl>
-    <tpl if="documentRoot"></{documentRoot}></tpl>
-
- *

Templates will be called with the following API

- *
    - *
  • {String} version [1.0] The xml version.
  • - *
  • {String} encoding [ISO-8859-15] The xml encoding.
  • - *
  • {String/false} documentRoot The XML document root-node name or false if not required. See {@link #documentRoot} and {@link #forceDocumentRoot}.
  • - *
  • {String} record The meta-data parameter defined on your {@link Ext.data.XmlReader#record} configuration represents the name of the xml-tag containing each record.
  • - *
  • {String} root The meta-data parameter defined by {@link Ext.data.XmlWriter#root} configuration-parameter. Represents the name of the xml root-tag when sending multiple records to the server.
  • - *
  • {Array} records The records being sent to the server, ie: the subject of the write-action being performed. The records parameter will be always be an array, even when only a single record is being acted upon. - * Each item within the records array will contain an array of field objects having the following properties: - *
      - *
    • {String} name The field-name of the record as defined by your {@link Ext.data.Record#create Ext.data.Record definition}. The "mapping" property will be used, otherwise it will match the "name" property. Use this parameter to define the XML tag-name of the property.
    • - *
    • {Mixed} value The record value of the field enclosed within XML tags specified by name property above.
    • - *
  • - *
  • {Array} baseParams. The baseParams as defined upon {@link Ext.data.Store#baseParams}. Note that the baseParams have been converted into an array of [{name : "foo", value: "bar"}, ...] pairs in the same manner as the records parameter above. See {@link #documentRoot} and {@link #forceDocumentRoot}.
  • - *
- */ - // Encoding the ? here in case it's being included by some kind of page that will parse it (eg. PHP) - tpl: '<\u003fxml version="{version}" encoding="{encoding}"\u003f><{documentRoot}><{name}>{value}<{root}><{parent.record}><{name}>{value}', - - - /** - * XmlWriter implementation of the final stage of a write action. - * @param {Object} params Transport-proxy's (eg: {@link Ext.Ajax#request}) params-object to write-to. - * @param {Object} baseParams as defined by {@link Ext.data.Store#baseParams}. The baseParms must be encoded by the extending class, eg: {@link Ext.data.JsonWriter}, {@link Ext.data.XmlWriter}. - * @param {Object/Object[]} data Data-object representing the compiled Store-recordset. - */ - render : function(params, baseParams, data) { - baseParams = this.toArray(baseParams); - params.xmlData = this.tpl.applyTemplate({ - version: this.xmlVersion, - encoding: this.xmlEncoding, - documentRoot: (baseParams.length > 0 || this.forceDocumentRoot === true) ? this.documentRoot : false, - record: this.meta.record, - root: this.root, - baseParams: baseParams, - records: (Ext.isArray(data[0])) ? data : [data] - }); - }, - - /** - * createRecord - * @protected - * @param {Ext.data.Record} rec - * @return {Array} Array of name:value pairs for attributes of the {@link Ext.data.Record}. See {@link Ext.data.DataWriter#toHash}. - */ - createRecord : function(rec) { - return this.toArray(this.toHash(rec)); - }, - - /** - * updateRecord - * @protected - * @param {Ext.data.Record} rec - * @return {Array} Array of {name:value} pairs for attributes of the {@link Ext.data.Record}. See {@link Ext.data.DataWriter#toHash}. - */ - updateRecord : function(rec) { - return this.toArray(this.toHash(rec)); - - }, - /** - * destroyRecord - * @protected - * @param {Ext.data.Record} rec - * @return {Array} Array containing a attribute-object (name/value pair) representing the {@link Ext.data.DataReader#idProperty idProperty}. - */ - destroyRecord : function(rec) { - var data = {}; - data[this.meta.idProperty] = rec.id; - return this.toArray(data); - } -}); diff --git a/assets/js/ext/src/dd/DDCore.js b/assets/js/ext/src/dd/DDCore.js deleted file mode 100644 index b93e231..0000000 --- a/assets/js/ext/src/dd/DDCore.js +++ /dev/null @@ -1,3158 +0,0 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.com/license - */ -/* - * 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=Ext.EventManager; -var Dom=Ext.lib.Dom; - -/** - * @class Ext.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: - *
    - *
  • linked element: the element that is passed into the constructor. - * This is the element which defines the boundaries for interaction with - * other DragDrop objects.
  • - *
  • 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.
  • - *
  • 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 Ext.dd.DD}. setDragElId() lets you define - * a separate element that would be moved, as in {@link Ext.dd.DDProxy}. - *
  • - *
- * 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: - *
- *  dd = new Ext.dd.DragDrop("div1", "group1");
- * 
- * 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... - *
- *  dd.onDragDrop = function(e, id) {
- *    alert("dd was dropped on " + id);
- *  }
- * 
- * @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 - */ -Ext.dd.DragDrop = function(id, sGroup, config) { - if(id) { - this.init(id, sGroup, config); - } -}; - -Ext.dd.DragDrop.prototype = { - - /** - * Set to false to enable a DragDrop object to fire drag events while dragging - * over its own Element. Defaults to true - DragDrop objects do not by default - * fire drag events to themselves. - * @property ignoreSelf - * @type Boolean - */ - - /** - * 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: - * Ext.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 object who's property names identify HTML tags to be considered invalid as drag handles. - * A non-null property value identifies the tag as invalid. Defaults to the - * following value which prevents drag operations from being initiated by <a> elements:

-{
-    A: "A"
-}
- * @property invalidHandleTypes - * @type Object - */ - invalidHandleTypes: null, - - /** - * An object who's property names identify the IDs of elements to be considered invalid as drag handles. - * A non-null property value identifies the ID as invalid. For example, to prevent - * dragging from being initiated on element ID "foo", use:

-{
-    foo: true
-}
- * @property invalidHandleIds - * @type Object - */ - invalidHandleIds: null, - - /** - * An Array of CSS class names for elements to be considered in valid as drag handles. - * @property invalidHandleClasses - * @type Array - */ - 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 object An object in the format {'group1':true, 'group2':true} - */ - 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; - }, - - /** - * When set to true, other DD objects in cooperating DDGroups do not receive - * notification events when this DD object is dragged over them. Defaults to false. - * @property moveOnly - * @type boolean - */ - moveOnly: false, - - /** - * Unlock this instace - * @method unlock - */ - unlock: function() { - this.locked = false; - }, - - /** - * By default, all instances can be a drop target. This can be disabled by - * setting isTarget to false. - * @property isTarget - * @type boolean - */ - isTarget: true, - - /** - * The padding configured for this drag and drop object for calculating - * the drop zone intersection with this object. - * @property padding - * @type int[] An array containing the 4 padding values: [top, right, bottom, left] - */ - 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 - * @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 available 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: -

- var dd = new Ext.dd.DDProxy("dragDiv1", "proxytest",
-                { dragElId: "existingProxyDiv" });
- dd.startDrag = function(){
-     this.constrainTo("parent-id");
- };
- 
- * Or you can initalize it using the {@link Ext.Element} object: -

- Ext.get("dragDiv1").initDDProxy("proxytest", {dragElId: "existingProxyDiv"}, {
-     startDrag : function(){
-         this.constrainTo("parent-id");
-     }
- });
- 
- * @param {Mixed} 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(Ext.isNumber(pad)){ - pad = {left: pad, right:pad, top:pad, bottom:pad}; - } - pad = pad || this.defaultPadding; - var b = Ext.get(this.getEl()).getBox(), - ce = Ext.get(constrainTo), - s = ce.getScroll(), - c, - cd = ce.dom; - if(cd == document.body){ - c = { x: s.left, y: s.top, width: Ext.lib.Dom.getViewWidth(), height: Ext.lib.Dom.getViewHeight()}; - }else{ - var xy = ce.getXY(); - c = {x : xy[0], y: xy[1], width: cd.clientWidth, height: cd.clientHeight}; - } - - - var topSpace = b.y - c.y, - leftSpace = b.x - c.x; - - this.resetConstraints(); - this.setXConstraint(leftSpace - (pad.left||0), // left - c.width - leftSpace - b.width - (pad.right||0), //right - this.xTickSize - ); - this.setYConstraint(topSpace - (pad.top||0), //top - c.height - topSpace - b.height - (pad.bottom||0), //bottom - this.yTickSize - ); - }, - - /** - * Returns a reference to the linked element - * @method getEl - * @return {HTMLElement} the html element - */ - getEl: function() { - if (!this._domRef) { - this._domRef = Ext.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 Ext.dd.DDProxy - * @method getDragEl - * @return {HTMLElement} the html element - */ - getDragEl: function() { - return Ext.getDom(this.dragElId); - }, - - /** - * Sets up the DragDrop object. Must be called in the constructor of any - * Ext.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 = Ext.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 = Ext.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 setInitPosition - * @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 = Ext.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 = Ext.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 {Ext.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 Ext.lib.Point(Ext.lib.Event.getPageX(e), Ext.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 = Ext.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 = Ext.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= 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= 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); - } - -}; - -})(); -/* - * 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 (!Ext.dd.DragDropMgr) { - -/** - * @class Ext.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 - */ -Ext.dd.DragDropMgr = function() { - - var Event = Ext.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[] - * @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[] - * @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 - */ - initialized: 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 interaction is 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=350 - * @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] && 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 (var 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} oDD the drag obj - * @param {DragDrop} oTargetDD 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 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) || (dc.ignoreSelf === false))) { - 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 - * Ext.dd.DragDropMgr.refreshCache(ddinstance.groups); - *
- * Alternatively: - * - * Ext.dd.DragDropMgr.refreshCache({group1:true, group2:true}); - * - * @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(Ext.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 {Ext.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= Ext.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 Ext.lib.Region( t, r, b, l ); - }, - - /** - * Checks the cursor location to see if it over the target - * @method isOverTarget - * @param {Ext.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 Ext.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) { - Ext.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 (var 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 {Ext.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(Ext.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 Ext.lib.Ext.getDom instead - * @static - */ - getElement: function(id) { - return Ext.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 Ext.lib.Dom instead - * @static - */ - getCss: function(id) { - var el = Ext.getDom(id); - return (el) ? el.style : null; - }, - - /** - * Inner class for cached elements - * @class Ext.dd.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 Ext.lib.Dom.getX instead - * @static - */ - getPosX: function(el) { - return Ext.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 Ext.lib.Dom.getY instead - * @static - */ - getPosY: function(el) { - return Ext.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 Ext.lib.Dom.getStyle - * @static - */ - getStyle: function(el, styleProp) { - return Ext.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 = Ext.lib.Dom.getXY(targetEl); - Ext.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 = Ext.dd.DDM; - if ( Ext.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 -Ext.dd.DDM = Ext.dd.DragDropMgr; -Ext.dd.DDM._addListeners(); - -} - -/** - * @class Ext.dd.DD - * A DragDrop implementation where the linked element follows the - * mouse cursor during a drag. - * @extends Ext.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 - */ -Ext.dd.DD = function(id, sGroup, config) { - if (id) { - this.init(id, sGroup, config); - } -}; - -Ext.extend(Ext.dd.DD, Ext.dd.DragDrop, { - - /** - * When set to true, the utility automatically tries to scroll the browser - * window when 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 : Ext.fly(el, '_dd'); - 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 = Ext.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 = Ext.lib.Dom.getViewHeight(); - - // The client width - var clientW = Ext.lib.Dom.getViewWidth(); - - // 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 - * Ext.dd.DragDrop, but all versions of this method through the - * inheritance chain are called - */ - applyConfig: function() { - Ext.dd.DD.superclass.applyConfig.call(this); - this.scroll = (this.config.scroll !== false); - }, - - /** - * Event that fires prior to the onMouseDown event. Overrides - * Ext.dd.DragDrop. - */ - b4MouseDown: function(e) { - // this.resetConstraints(); - this.autoOffset(e.getPageX(), - e.getPageY()); - }, - - /** - * Event that fires prior to the onDrag event. Overrides - * Ext.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) { - } - - */ - -}); -/** - * @class Ext.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 Ext.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 - */ -Ext.dd.DDProxy = function(id, sGroup, config) { - if (id) { - this.init(id, sGroup, config); - this.initFrame(); - } -}; - -/** - * The default drag frame div id - * @property Ext.dd.DDProxy.dragElId - * @type String - * @static - */ -Ext.dd.DDProxy.dragElId = "ygddfdiv"; - -Ext.extend(Ext.dd.DDProxy, Ext.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 Ext.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() { - Ext.dd.DDProxy.superclass.applyConfig.call(this); - - this.resizeFrame = (this.config.resizeFrame !== false); - this.centerFrame = (this.config.centerFrame); - this.setDragElId(this.config.dragElId || Ext.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); - - Ext.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(); - Ext.fly(this.getDragEl()).setSize(el.offsetWidth, el.offsetHeight); - } - }, - - // overrides Ext.dd.DragDrop - b4MouseDown: function(e) { - var x = e.getPageX(); - var y = e.getPageY(); - this.autoOffset(x, y); - this.setDragElPos(x, y); - }, - - // overrides Ext.dd.DragDrop - b4StartDrag: function(x, y) { - // show the drag frame - this.showFrame(x, y); - }, - - // overrides Ext.dd.DragDrop - b4EndDrag: function(e) { - Ext.fly(this.getDragEl()).hide(); - }, - - // overrides Ext.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 Ext.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"; - Ext.dd.DDM.moveToEl(lel, del); - del.style.visibility = "hidden"; - lel.style.visibility = ""; - - this.afterDrag(); - }, - - beforeMove : function(){ - - }, - - afterDrag : function(){ - - }, - - toString: function() { - return ("DDProxy " + this.id); - } - -}); -/** - * @class Ext.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 Ext.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 - */ -Ext.dd.DDTarget = function(id, sGroup, config) { - if (id) { - this.initTarget(id, sGroup, config); - } -}; - -// Ext.dd.DDTarget.prototype = new Ext.dd.DragDrop(); -Ext.extend(Ext.dd.DDTarget, Ext.dd.DragDrop, { - /** - * @hide - * Overridden and disabled. A DDTarget does not support being dragged. - * @method - */ - getDragEl: Ext.emptyFn, - /** - * @hide - * Overridden and disabled. A DDTarget does not support being dragged. - * @method - */ - isValidHandleChild: Ext.emptyFn, - /** - * @hide - * Overridden and disabled. A DDTarget does not support being dragged. - * @method - */ - startDrag: Ext.emptyFn, - /** - * @hide - * Overridden and disabled. A DDTarget does not support being dragged. - * @method - */ - endDrag: Ext.emptyFn, - /** - * @hide - * Overridden and disabled. A DDTarget does not support being dragged. - * @method - */ - onDrag: Ext.emptyFn, - /** - * @hide - * Overridden and disabled. A DDTarget does not support being dragged. - * @method - */ - onDragDrop: Ext.emptyFn, - /** - * @hide - * Overridden and disabled. A DDTarget does not support being dragged. - * @method - */ - onDragEnter: Ext.emptyFn, - /** - * @hide - * Overridden and disabled. A DDTarget does not support being dragged. - * @method - */ - onDragOut: Ext.emptyFn, - /** - * @hide - * Overridden and disabled. A DDTarget does not support being dragged. - * @method - */ - onDragOver: Ext.emptyFn, - /** - * @hide - * Overridden and disabled. A DDTarget does not support being dragged. - * @method - */ - onInvalidDrop: Ext.emptyFn, - /** - * @hide - * Overridden and disabled. A DDTarget does not support being dragged. - * @method - */ - onMouseDown: Ext.emptyFn, - /** - * @hide - * Overridden and disabled. A DDTarget does not support being dragged. - * @method - */ - onMouseUp: Ext.emptyFn, - /** - * @hide - * Overridden and disabled. A DDTarget does not support being dragged. - * @method - */ - setXConstraint: Ext.emptyFn, - /** - * @hide - * Overridden and disabled. A DDTarget does not support being dragged. - * @method - */ - setYConstraint: Ext.emptyFn, - /** - * @hide - * Overridden and disabled. A DDTarget does not support being dragged. - * @method - */ - resetConstraints: Ext.emptyFn, - /** - * @hide - * Overridden and disabled. A DDTarget does not support being dragged. - * @method - */ - clearConstraints: Ext.emptyFn, - /** - * @hide - * Overridden and disabled. A DDTarget does not support being dragged. - * @method - */ - clearTicks: Ext.emptyFn, - /** - * @hide - * Overridden and disabled. A DDTarget does not support being dragged. - * @method - */ - setInitPosition: Ext.emptyFn, - /** - * @hide - * Overridden and disabled. A DDTarget does not support being dragged. - * @method - */ - setDragElId: Ext.emptyFn, - /** - * @hide - * Overridden and disabled. A DDTarget does not support being dragged. - * @method - */ - setHandleElId: Ext.emptyFn, - /** - * @hide - * Overridden and disabled. A DDTarget does not support being dragged. - * @method - */ - setOuterHandleElId: Ext.emptyFn, - /** - * @hide - * Overridden and disabled. A DDTarget does not support being dragged. - * @method - */ - addInvalidHandleClass: Ext.emptyFn, - /** - * @hide - * Overridden and disabled. A DDTarget does not support being dragged. - * @method - */ - addInvalidHandleId: Ext.emptyFn, - /** - * @hide - * Overridden and disabled. A DDTarget does not support being dragged. - * @method - */ - addInvalidHandleType: Ext.emptyFn, - /** - * @hide - * Overridden and disabled. A DDTarget does not support being dragged. - * @method - */ - removeInvalidHandleClass: Ext.emptyFn, - /** - * @hide - * Overridden and disabled. A DDTarget does not support being dragged. - * @method - */ - removeInvalidHandleId: Ext.emptyFn, - /** - * @hide - * Overridden and disabled. A DDTarget does not support being dragged. - * @method - */ - removeInvalidHandleType: Ext.emptyFn, - - toString: function() { - return ("DDTarget " + this.id); - } -}); \ No newline at end of file diff --git a/assets/js/ext/src/dd/DragSource.js b/assets/js/ext/src/dd/DragSource.js deleted file mode 100644 index 19fe4c3..0000000 --- a/assets/js/ext/src/dd/DragSource.js +++ /dev/null @@ -1,370 +0,0 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.com/license - */ -/** - * @class Ext.dd.DragSource - * @extends Ext.dd.DDProxy - * A simple class that provides the basic implementation needed to make any element draggable. - * @constructor - * @param {Mixed} el The container element - * @param {Object} config - */ -Ext.dd.DragSource = function(el, config){ - this.el = Ext.get(el); - if(!this.dragData){ - this.dragData = {}; - } - - Ext.apply(this, config); - - if(!this.proxy){ - this.proxy = new Ext.dd.StatusProxy(); - } - Ext.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; -}; - -Ext.extend(Ext.dd.DragSource, Ext.dd.DDProxy, { - /** - * @cfg {String} ddGroup - * A named drag drop group to which this object belongs. If a group is specified, then this object will only - * interact with other drag drop objects in the same group (defaults to undefined). - */ - /** - * @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 = Ext.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 {Ext.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 {Ext.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() { - Ext.dd.DragSource.superclass.alignElWithMouse.apply(this, arguments); - this.proxy.sync(); - }, - - // private - onDragOver : function(e, id){ - var target = this.cachedTarget || Ext.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 {Ext.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 {Ext.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 || Ext.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 {Ext.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 {Ext.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 || Ext.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 {Ext.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 {Ext.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(Ext.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 {Ext.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(); - Ext.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 : Ext.emptyFn, - - // private 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 = Ext.id(); // prevent duplicate ids - this.proxy.update(clone); - this.onStartDrag(x, y); - return true; - }, - - /** - * Returns the drag source's underlying {@link Ext.dd.StatusProxy} - * @return {Ext.dd.StatusProxy} proxy The StatusProxy - */ - getProxy : function(){ - return this.proxy; - }, - - /** - * Hides the drag source's {@link Ext.dd.StatusProxy} - */ - hideProxy : function(){ - this.proxy.hide(); - this.proxy.reset(true); - this.dragging = false; - }, - - // private - triggerCacheRefresh : function(){ - Ext.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); - }, - - destroy: function(){ - Ext.dd.DragSource.superclass.destroy.call(this); - Ext.destroy(this.proxy); - } -}); \ No newline at end of file diff --git a/assets/js/ext/src/dd/DragTracker.js b/assets/js/ext/src/dd/DragTracker.js deleted file mode 100644 index 1db3e12..0000000 --- a/assets/js/ext/src/dd/DragTracker.js +++ /dev/null @@ -1,251 +0,0 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.com/license - */ -/** - * @class Ext.dd.DragTracker - * @extends Ext.util.Observable - * A DragTracker listens for drag events on an Element and fires events at the start and end of the drag, - * as well as during the drag. This is useful for components such as {@link Ext.slider.MultiSlider}, where there is - * an element that can be dragged around to change the Slider's value. - * DragTracker provides a series of template methods that should be overridden to provide functionality - * in response to detected drag operations. These are onBeforeStart, onStart, onDrag and onEnd. - * See {@link Ext.slider.MultiSlider}'s initEvents function for an example implementation. - */ -Ext.dd.DragTracker = Ext.extend(Ext.util.Observable, { - /** - * @cfg {Boolean} active - * Defaults to false. - */ - active: false, - /** - * @cfg {Number} tolerance - * Number of pixels the drag target must be moved before dragging is considered to have started. Defaults to 5. - */ - tolerance: 5, - /** - * @cfg {Boolean/Number} autoStart - * Defaults to false. Specify true to defer trigger start by 1000 ms. - * Specify a Number for the number of milliseconds to defer trigger start. - */ - autoStart: false, - - constructor : function(config){ - Ext.apply(this, config); - this.addEvents( - /** - * @event mousedown - * @param {Object} this - * @param {Object} e event object - */ - 'mousedown', - /** - * @event mouseup - * @param {Object} this - * @param {Object} e event object - */ - 'mouseup', - /** - * @event mousemove - * @param {Object} this - * @param {Object} e event object - */ - 'mousemove', - /** - * @event dragstart - * @param {Object} this - * @param {Object} e event object - */ - 'dragstart', - /** - * @event dragend - * @param {Object} this - * @param {Object} e event object - */ - 'dragend', - /** - * @event drag - * @param {Object} this - * @param {Object} e event object - */ - 'drag' - ); - - this.dragRegion = new Ext.lib.Region(0,0,0,0); - - if(this.el){ - this.initEl(this.el); - } - Ext.dd.DragTracker.superclass.constructor.call(this, config); - }, - - initEl: function(el){ - this.el = Ext.get(el); - el.on('mousedown', this.onMouseDown, this, - this.delegate ? {delegate: this.delegate} : undefined); - }, - - destroy : function(){ - this.el.un('mousedown', this.onMouseDown, this); - delete this.el; - }, - - onMouseDown: function(e, target){ - if(this.fireEvent('mousedown', this, e) !== false && this.onBeforeStart(e) !== false){ - this.startXY = this.lastXY = e.getXY(); - this.dragTarget = this.delegate ? target : this.el.dom; - if(this.preventDefault !== false){ - e.preventDefault(); - } - Ext.getDoc().on({ - scope: this, - mouseup: this.onMouseUp, - mousemove: this.onMouseMove, - selectstart: this.stopSelect - }); - if(this.autoStart){ - this.timer = this.triggerStart.defer(this.autoStart === true ? 1000 : this.autoStart, this, [e]); - } - } - }, - - onMouseMove: function(e, target){ - // HACK: IE hack to see if button was released outside of window. */ - if(this.active && Ext.isIE && !e.browserEvent.button){ - e.preventDefault(); - this.onMouseUp(e); - return; - } - - e.preventDefault(); - var xy = e.getXY(), s = this.startXY; - this.lastXY = xy; - if(!this.active){ - if(Math.abs(s[0]-xy[0]) > this.tolerance || Math.abs(s[1]-xy[1]) > this.tolerance){ - this.triggerStart(e); - }else{ - return; - } - } - this.fireEvent('mousemove', this, e); - this.onDrag(e); - this.fireEvent('drag', this, e); - }, - - onMouseUp: function(e) { - var doc = Ext.getDoc(), - wasActive = this.active; - - doc.un('mousemove', this.onMouseMove, this); - doc.un('mouseup', this.onMouseUp, this); - doc.un('selectstart', this.stopSelect, this); - e.preventDefault(); - this.clearStart(); - this.active = false; - delete this.elRegion; - this.fireEvent('mouseup', this, e); - if(wasActive){ - this.onEnd(e); - this.fireEvent('dragend', this, e); - } - }, - - triggerStart: function(e) { - this.clearStart(); - this.active = true; - this.onStart(e); - this.fireEvent('dragstart', this, e); - }, - - clearStart : function() { - if(this.timer){ - clearTimeout(this.timer); - delete this.timer; - } - }, - - stopSelect : function(e) { - e.stopEvent(); - return false; - }, - - /** - * Template method which should be overridden by each DragTracker instance. Called when the user first clicks and - * holds the mouse button down. Return false to disallow the drag - * @param {Ext.EventObject} e The event object - */ - onBeforeStart : function(e) { - - }, - - /** - * Template method which should be overridden by each DragTracker instance. Called when a drag operation starts - * (e.g. the user has moved the tracked element beyond the specified tolerance) - * @param {Ext.EventObject} e The event object - */ - onStart : function(xy) { - - }, - - /** - * Template method which should be overridden by each DragTracker instance. Called whenever a drag has been detected. - * @param {Ext.EventObject} e The event object - */ - onDrag : function(e) { - - }, - - /** - * Template method which should be overridden by each DragTracker instance. Called when a drag operation has been completed - * (e.g. the user clicked and held the mouse down, dragged the element and then released the mouse button) - * @param {Ext.EventObject} e The event object - */ - onEnd : function(e) { - - }, - - /** - * Returns the drag target - * @return {Ext.Element} The element currently being tracked - */ - getDragTarget : function(){ - return this.dragTarget; - }, - - getDragCt : function(){ - return this.el; - }, - - getXY : function(constrain){ - return constrain ? - this.constrainModes[constrain].call(this, this.lastXY) : this.lastXY; - }, - - getOffset : function(constrain){ - var xy = this.getXY(constrain), - s = this.startXY; - return [s[0]-xy[0], s[1]-xy[1]]; - }, - - constrainModes: { - 'point' : function(xy){ - - if(!this.elRegion){ - this.elRegion = this.getDragCt().getRegion(); - } - - var dr = this.dragRegion; - - dr.left = xy[0]; - dr.top = xy[1]; - dr.right = xy[0]; - dr.bottom = xy[1]; - - dr.constrainTo(this.elRegion); - - return [dr.left, dr.top]; - } - } -}); \ No newline at end of file diff --git a/assets/js/ext/src/dd/DragZone.js b/assets/js/ext/src/dd/DragZone.js deleted file mode 100644 index a43d719..0000000 --- a/assets/js/ext/src/dd/DragZone.js +++ /dev/null @@ -1,141 +0,0 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.com/license - */ -/** - * @class Ext.dd.DragZone - * @extends Ext.dd.DragSource - *

This class provides a container DD instance that allows dragging of multiple child source nodes.

- *

This class does not move the drag target nodes, but a proxy element which may contain - * any DOM structure you wish. The DOM element to show in the proxy is provided by either a - * provided implementation of {@link #getDragData}, or by registered draggables registered with {@link Ext.dd.Registry}

- *

If you wish to provide draggability for an arbitrary number of DOM nodes, each of which represent some - * application object (For example nodes in a {@link Ext.DataView DataView}) then use of this class - * is the most efficient way to "activate" those nodes.

- *

By default, this class requires that draggable child nodes are registered with {@link Ext.dd.Registry}. - * However a simpler way to allow a DragZone to manage any number of draggable elements is to configure - * the DragZone with an implementation of the {@link #getDragData} method which interrogates the passed - * mouse event to see if it has taken place within an element, or class of elements. This is easily done - * by using the event's {@link Ext.EventObject#getTarget getTarget} method to identify a node based on a - * {@link Ext.DomQuery} selector. For example, to make the nodes of a DataView draggable, use the following - * technique. Knowledge of the use of the DataView is required:


-myDataView.on('render', function(v) {
-    myDataView.dragZone = new Ext.dd.DragZone(v.getEl(), {
-
-//      On receipt of a mousedown event, see if it is within a DataView node.
-//      Return a drag data object if so.
-        getDragData: function(e) {
-
-//          Use the DataView's own itemSelector (a mandatory property) to
-//          test if the mousedown is within one of the DataView's nodes.
-            var sourceEl = e.getTarget(v.itemSelector, 10);
-
-//          If the mousedown is within a DataView node, clone the node to produce
-//          a ddel element for use by the drag proxy. Also add application data
-//          to the returned data object.
-            if (sourceEl) {
-                d = sourceEl.cloneNode(true);
-                d.id = Ext.id();
-                return {
-                    ddel: d,
-                    sourceEl: sourceEl,
-                    repairXY: Ext.fly(sourceEl).getXY(),
-                    sourceStore: v.store,
-                    draggedRecord: v.{@link Ext.DataView#getRecord getRecord}(sourceEl)
-                }
-            }
-        },
-
-//      Provide coordinates for the proxy to slide back to on failed drag.
-//      This is the original XY coordinates of the draggable element captured
-//      in the getDragData method.
-        getRepairXY: function() {
-            return this.dragData.repairXY;
-        }
-    });
-});
- * See the {@link Ext.dd.DropZone DropZone} documentation for details about building a DropZone which - * cooperates with this DragZone. - * @constructor - * @param {Mixed} el The container element - * @param {Object} config - */ -Ext.dd.DragZone = Ext.extend(Ext.dd.DragSource, { - - constructor : function(el, config){ - Ext.dd.DragZone.superclass.constructor.call(this, el, config); - if(this.containerScroll){ - Ext.dd.ScrollManager.register(this.el); - } - }, - - /** - * This property contains the data representing the dragged object. This data is set up by the implementation - * of the {@link #getDragData} method. It must contain a ddel property, but can contain - * any other data according to the application's needs. - * @type Object - * @property dragData - */ - /** - * @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 Ext.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 Ext.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(Ext.enableFx){ - Ext.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 Ext.Element.fly(this.dragData.ddel).getXY(); - }, - - destroy : function(){ - Ext.dd.DragZone.superclass.destroy.call(this); - if(this.containerScroll){ - Ext.dd.ScrollManager.unregister(this.el); - } - } -}); \ No newline at end of file diff --git a/assets/js/ext/src/dd/DropTarget.js b/assets/js/ext/src/dd/DropTarget.js deleted file mode 100644 index 785ca3b..0000000 --- a/assets/js/ext/src/dd/DropTarget.js +++ /dev/null @@ -1,122 +0,0 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.com/license - */ -/** - * @class Ext.dd.DropTarget - * @extends Ext.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 {Mixed} el The container element - * @param {Object} config - */ -Ext.dd.DropTarget = Ext.extend(Ext.dd.DDTarget, { - - constructor : function(el, config){ - this.el = Ext.get(el); - - Ext.apply(this, config); - - if(this.containerScroll){ - Ext.dd.ScrollManager.register(this.el); - } - - Ext.dd.DropTarget.superclass.constructor.call(this, this.el.dom, this.ddGroup || this.group, - {isTarget: true}); - }, - - /** - * @cfg {String} ddGroup - * A named drag drop group to which this object belongs. If a group is specified, then this object will only - * interact with other drag drop objects in the same group (defaults to undefined). - */ - /** - * @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 Ext.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 {Ext.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 Ext.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 Ext.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 {Ext.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 Ext.dd.StatusProxy} can be updated - */ - notifyOver : function(dd, e, data){ - return this.dropAllowed; - }, - - /** - * The function a {@link Ext.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 {Ext.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 Ext.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 {Ext.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; - }, - - destroy : function(){ - Ext.dd.DropTarget.superclass.destroy.call(this); - if(this.containerScroll){ - Ext.dd.ScrollManager.unregister(this.el); - } - } -}); \ No newline at end of file diff --git a/assets/js/ext/src/dd/DropZone.js b/assets/js/ext/src/dd/DropZone.js deleted file mode 100644 index 3bc592b..0000000 --- a/assets/js/ext/src/dd/DropZone.js +++ /dev/null @@ -1,262 +0,0 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.com/license - */ -/** - * @class Ext.dd.DropZone - * @extends Ext.dd.DropTarget - *

This class provides a container DD instance that allows dropping on multiple child target nodes.

- *

By default, this class requires that child nodes accepting drop are registered with {@link Ext.dd.Registry}. - * However a simpler way to allow a DropZone to manage any number of target elements is to configure the - * DropZone with an implementation of {@link #getTargetFromEvent} which interrogates the passed - * mouse event to see if it has taken place within an element, or class of elements. This is easily done - * by using the event's {@link Ext.EventObject#getTarget getTarget} method to identify a node based on a - * {@link Ext.DomQuery} selector.

- *

Once the DropZone has detected through calling getTargetFromEvent, that the mouse is over - * a drop target, that target is passed as the first parameter to {@link #onNodeEnter}, {@link #onNodeOver}, - * {@link #onNodeOut}, {@link #onNodeDrop}. You may configure the instance of DropZone with implementations - * of these methods to provide application-specific behaviour for these events to update both - * application state, and UI state.

- *

For example to make a GridPanel a cooperating target with the example illustrated in - * {@link Ext.dd.DragZone DragZone}, the following technique might be used:


-myGridPanel.on('render', function() {
-    myGridPanel.dropZone = new Ext.dd.DropZone(myGridPanel.getView().scroller, {
-
-//      If the mouse is over a grid row, return that node. This is
-//      provided as the "target" parameter in all "onNodeXXXX" node event handling functions
-        getTargetFromEvent: function(e) {
-            return e.getTarget(myGridPanel.getView().rowSelector);
-        },
-
-//      On entry into a target node, highlight that node.
-        onNodeEnter : function(target, dd, e, data){ 
-            Ext.fly(target).addClass('my-row-highlight-class');
-        },
-
-//      On exit from a target node, unhighlight that node.
-        onNodeOut : function(target, dd, e, data){ 
-            Ext.fly(target).removeClass('my-row-highlight-class');
-        },
-
-//      While over a target node, return the default drop allowed class which
-//      places a "tick" icon into the drag proxy.
-        onNodeOver : function(target, dd, e, data){ 
-            return Ext.dd.DropZone.prototype.dropAllowed;
-        },
-
-//      On node drop we can interrogate the target to find the underlying
-//      application object that is the real target of the dragged data.
-//      In this case, it is a Record in the GridPanel's Store.
-//      We can use the data set up by the DragZone's getDragData method to read
-//      any data we decided to attach in the DragZone's getDragData method.
-        onNodeDrop : function(target, dd, e, data){
-            var rowIndex = myGridPanel.getView().findRowIndex(target);
-            var r = myGridPanel.getStore().getAt(rowIndex);
-            Ext.Msg.alert('Drop gesture', 'Dropped Record id ' + data.draggedRecord.id +
-                ' on Record id ' + r.id);
-            return true;
-        }
-    });
-}
-
- * See the {@link Ext.dd.DragZone DragZone} documentation for details about building a DragZone which - * cooperates with this DropZone. - * @constructor - * @param {Mixed} el The container element - * @param {Object} config - */ -Ext.dd.DropZone = function(el, config){ - Ext.dd.DropZone.superclass.constructor.call(this, el, config); -}; - -Ext.extend(Ext.dd.DropZone, Ext.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 Ext.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 Ext.dd.Registry.getTargetFromEvent(e); - }, - - /** - * Called when the DropZone determines that a {@link Ext.dd.DragSource} has entered a drop node - * that has either been registered or detected by a configured implementation of {@link #getTargetFromEvent}. - * 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 {Ext.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 while the DropZone determines that a {@link Ext.dd.DragSource} is over a drop node - * that has either been registered or detected by a configured implementation of {@link #getTargetFromEvent}. - * 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 {Ext.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 Ext.dd.StatusProxy} can be updated - */ - onNodeOver : function(n, dd, e, data){ - return this.dropAllowed; - }, - - /** - * Called when the DropZone determines that a {@link Ext.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 {Ext.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 when the DropZone determines that a {@link Ext.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 {Ext.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 while the DropZone determines that a {@link Ext.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 {Ext.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 Ext.dd.StatusProxy} can be updated - */ - onContainerOver : function(dd, e, data){ - return this.dropNotAllowed; - }, - - /** - * Called when the DropZone determines that a {@link Ext.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 {Ext.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 Ext.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 {Ext.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 Ext.dd.StatusProxy} can be updated - */ - notifyEnter : function(dd, e, data){ - return this.dropNotAllowed; - }, - - /** - * The function a {@link Ext.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 {Ext.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 Ext.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 Ext.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 {Ext.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 Ext.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 {Ext.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(){ - Ext.dd.DDM.refreshCache(this.groups); - } -}); \ No newline at end of file diff --git a/assets/js/ext/src/dd/Registry.js b/assets/js/ext/src/dd/Registry.js deleted file mode 100644 index 1be70d4..0000000 --- a/assets/js/ext/src/dd/Registry.js +++ /dev/null @@ -1,127 +0,0 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.com/license - */ -/** - * @class Ext.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 - */ -Ext.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 = "extdd-" + (++autoIdSeed); - el.id = id; - } - return id; - }; - - return { - /** - * Resgister a drag drop element - * @param {String/HTMLElement} element The id or DOM node to register - * @param {Object} data (optional) An 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): - *
-Value      Description
---------- ------------------------------------------
-handles Array of DOM nodes that trigger dragging
- for the element being registered
-isHandle True if the element passed in triggers
- dragging itself, else false -
- */ - 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 = Ext.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 = Ext.lib.Event.getTarget(e); - return t ? elements[t.id] || handles[t.id] : null; - } - }; -}(); \ No newline at end of file diff --git a/assets/js/ext/src/dd/ScrollManager.js b/assets/js/ext/src/dd/ScrollManager.js deleted file mode 100644 index 8703322..0000000 --- a/assets/js/ext/src/dd/ScrollManager.js +++ /dev/null @@ -1,213 +0,0 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.com/license - */ -/** - * @class Ext.dd.ScrollManager - *

Provides automatic scrolling of overflow regions in the page during drag operations.

- *

The ScrollManager configs will be used as the defaults for any scroll container registered with it, - * but you can also override most of the configs per scroll container by adding a - * ddScrollConfig object to the target element that contains these properties: {@link #hthresh}, - * {@link #vthresh}, {@link #increment} and {@link #frequency}. Example usage: - *


-var el = Ext.get('scroll-ct');
-el.ddScrollConfig = {
-    vthresh: 50,
-    hthresh: -1,
-    frequency: 100,
-    increment: 200
-};
-Ext.dd.ScrollManager.register(el);
-
- * Note: This class uses "Point Mode" and is untested in "Intersect Mode". - * @singleton - */ -Ext.dd.ScrollManager = function(){ - var ddm = Ext.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 = Ext.dd.ScrollManager; - var inc = proc.el.ddScrollConfig ? - proc.el.ddScrollConfig.increment : dds.increment; - if(!dds.animate){ - if(proc.el.scroll(proc.dir, inc)){ - triggerRefresh(); - } - }else{ - proc.el.scroll(proc.dir, inc, 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; - var group = el.ddScrollConfig ? el.ddScrollConfig.ddGroup : undefined, - freq = (el.ddScrollConfig && el.ddScrollConfig.frequency) - ? el.ddScrollConfig.frequency - : Ext.dd.ScrollManager.frequency; - - if (group === undefined || ddm.dragCurrent.ddGroup == group) { - proc.id = setInterval(doScroll, freq); - } - }; - - var onFire = function(e, isDrop){ - if(isDrop || !ddm.dragCurrent){ return; } - var dds = Ext.dd.ScrollManager; - if(!dragEl || dragEl != ddm.dragCurrent){ - dragEl = ddm.dragCurrent; - // refresh regions on drag start - dds.refreshCache(); - } - - var xy = Ext.lib.Event.getXY(e); - var pt = new Ext.lib.Point(xy[0], xy[1]); - for(var id in els){ - var el = els[id], r = el._region; - var c = el.ddScrollConfig ? el.ddScrollConfig : dds; - if(r && r.contains(pt) && el.isScrollable()){ - if(r.bottom - pt.y <= c.vthresh){ - if(proc.el != el){ - startProc(el, "down"); - } - return; - }else if(r.right - pt.x <= c.hthresh){ - if(proc.el != el){ - startProc(el, "left"); - } - return; - }else if(pt.y - r.top <= c.vthresh){ - if(proc.el != el){ - startProc(el, "up"); - } - return; - }else if(pt.x - r.left <= c.hthresh){ - 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 {Mixed/Array} el The id of or the element to be scrolled or an array of either - */ - register : function(el){ - if(Ext.isArray(el)){ - for(var i = 0, len = el.length; i < len; i++) { - this.register(el[i]); - } - }else{ - el = Ext.get(el); - els[el.id] = el; - } - }, - - /** - * Unregisters overflow element(s) so they are no longer scrolled - * @param {Mixed/Array} el The id of or the element to be removed or an array of either - */ - unregister : function(el){ - if(Ext.isArray(el)){ - for(var i = 0, len = el.length; i < len; i++) { - this.unregister(el[i]); - } - }else{ - el = Ext.get(el); - delete els[el.id]; - } - }, - - /** - * The number of pixels from the top or bottom edge of a container the pointer needs to be to - * trigger scrolling (defaults to 25) - * @type Number - */ - vthresh : 25, - /** - * The number of pixels from the right or left edge of a container the pointer needs to be to - * trigger scrolling (defaults to 25) - * @type Number - */ - hthresh : 25, - - /** - * The number of pixels to scroll in each scroll increment (defaults to 100) - * @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 Ext.dd.ScrollManager.frequency! (defaults to .4) - * @type Number - */ - animDuration: .4, - - /** - * The named drag drop {@link Ext.dd.DragSource#ddGroup group} to which this container belongs (defaults to undefined). - * If a ddGroup is specified, then container scrolling will only occur when a dragged object is in the same ddGroup. - * @type String - */ - ddGroup: undefined, - - /** - * 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/assets/js/ext/src/dd/StatusProxy.js b/assets/js/ext/src/dd/StatusProxy.js deleted file mode 100644 index 9c9cbc0..0000000 --- a/assets/js/ext/src/dd/StatusProxy.js +++ /dev/null @@ -1,175 +0,0 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.com/license - */ -/** - * @class Ext.dd.StatusProxy - * A specialized drag proxy that supports a drop status icon, {@link Ext.Layer} styles and auto-repair. This is the - * default drag proxy used by all Ext.dd components. - * @constructor - * @param {Object} config - */ -Ext.dd.StatusProxy = function(config){ - Ext.apply(this, config); - this.id = this.id || Ext.id(); - this.el = new Ext.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 = Ext.get(this.el.dom.childNodes[1]); - this.dropStatus = this.dropNotAllowed; -}; - -Ext.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/HTMLElement} html The html that will replace the current innerHTML of the ghost element, or a - * DOM node to append as the child of the ghost element (in which case the innerHTML will be cleared first). - */ - update : function(html){ - if(typeof html == "string"){ - this.ghost.update(html); - }else{ - this.ghost.update(""); - html.style.margin = "0"; - this.ghost.dom.appendChild(html); - } - var el = this.ghost.dom.firstChild; - if(el){ - Ext.fly(el).setStyle('float', 'none'); - } - }, - - /** - * Returns the underlying proxy {@link Ext.Layer} - * @return {Ext.Layer} el - */ - getEl : function(){ - return this.el; - }, - - /** - * Returns the ghost element - * @return {Ext.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 (this reference) in which the callback function is executed. Defaults to the browser window. - */ - 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; - }, - - destroy: function(){ - Ext.destroy(this.ghost, this.el); - } -}; \ No newline at end of file diff --git a/assets/js/ext/src/debug.js b/assets/js/ext/src/debug.js deleted file mode 100644 index 0afd8d2..0000000 --- a/assets/js/ext/src/debug.js +++ /dev/null @@ -1,907 +0,0 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.com/license - */ -Ext.debug = {}; - -(function(){ - -var cp; - -function createConsole(){ - - var scriptPanel = new Ext.debug.ScriptsPanel(); - var logView = new Ext.debug.LogPanel(); - var tree = new Ext.debug.DomTree(); - var compInspector = new Ext.debug.ComponentInspector(); - var compInfoPanel = new Ext.debug.ComponentInfoPanel(); - var storeInspector = new Ext.debug.StoreInspector(); - var objInspector = new Ext.debug.ObjectInspector(); - - var tabs = new Ext.TabPanel({ - activeTab: 0, - border: false, - tabPosition: 'bottom', - items: [{ - title: 'Debug Console', - layout:'border', - items: [logView, scriptPanel] - },{ - title: 'HTML Inspector', - layout:'border', - items: [tree] - },{ - title: 'Component Inspector', - layout: 'border', - items: [compInspector,compInfoPanel] - },{ - title: 'Object Inspector', - layout: 'border', - items: [objInspector] - },{ - title: 'Data Stores', - layout: 'border', - items: [storeInspector] - }] - }); - - cp = new Ext.Panel({ - id: 'x-debug-browser', - title: 'Console', - collapsible: true, - animCollapse: false, - style: 'position:absolute;left:0;bottom:0;z-index:101', - height:200, - logView: logView, - layout: 'fit', - - tools:[{ - id: 'close', - handler: function(){ - cp.destroy(); - cp = null; - Ext.EventManager.removeResizeListener(handleResize); - } - }], - - items: tabs - }); - - cp.render(Ext.getBody()); - - cp.resizer = new Ext.Resizable(cp.el, { - minHeight:50, - handles: "n", - pinned: true, - transparent:true, - resizeElement : function(){ - var box = this.proxy.getBox(); - this.proxy.hide(); - cp.setHeight(box.height); - return box; - } - }); - -// function handleResize(){ -// cp.setWidth(Ext.getBody().getViewSize().width); -// } -// Ext.EventManager.onWindowResize(handleResize); -// -// handleResize(); - - function handleResize(){ - var b = Ext.getBody(); - var size = b.getViewSize(); - if(size.height < b.dom.scrollHeight) { - size.width -= 18; - } - cp.setWidth(size.width); - } - Ext.EventManager.onWindowResize(handleResize); - handleResize(); -} - - -Ext.apply(Ext, { - log : function(){ - if(!cp){ - createConsole(); - } - cp.logView.log.apply(cp.logView, arguments); - }, - - logf : function(format, arg1, arg2, etc){ - Ext.log(String.format.apply(String, arguments)); - }, - - dump : function(o){ - if(typeof o == 'string' || typeof o == 'number' || typeof o == 'undefined' || Ext.isDate(o)){ - Ext.log(o); - }else if(!o){ - Ext.log("null"); - }else if(typeof o != "object"){ - Ext.log('Unknown return type'); - }else if(Ext.isArray(o)){ - Ext.log('['+o.join(',')+']'); - }else{ - var b = ["{\n"]; - for(var key in o){ - var to = typeof o[key]; - if(to != "function" && to != "object"){ - b.push(String.format(" {0}: {1},\n", key, o[key])); - } - } - var s = b.join(""); - if(s.length > 3){ - s = s.substr(0, s.length-2); - } - Ext.log(s + "\n}"); - } - }, - - _timers : {}, - - time : function(name){ - name = name || "def"; - Ext._timers[name] = new Date().getTime(); - }, - - timeEnd : function(name, printResults){ - var t = new Date().getTime(); - name = name || "def"; - var v = String.format("{0} ms", t-Ext._timers[name]); - Ext._timers[name] = new Date().getTime(); - if(printResults !== false){ - Ext.log('Timer ' + (name == "def" ? v : name + ": " + v)); - } - return v; - } -}); - -})(); - - -Ext.debug.ScriptsPanel = Ext.extend(Ext.Panel, { - id:'x-debug-scripts', - region: 'east', - minWidth: 200, - split: true, - width: 350, - border: false, - layout:'anchor', - style:'border-width:0 0 0 1px;', - - initComponent : function(){ - - this.scriptField = new Ext.form.TextArea({ - anchor: '100% -26', - style:'border-width:0;' - }); - - this.trapBox = new Ext.form.Checkbox({ - id: 'console-trap', - boxLabel: 'Trap Errors', - checked: true - }); - - this.toolbar = new Ext.Toolbar([{ - text: 'Run', - scope: this, - handler: this.evalScript - },{ - text: 'Clear', - scope: this, - handler: this.clear - }, - '->', - this.trapBox, - ' ', ' ' - ]); - - this.items = [this.toolbar, this.scriptField]; - - Ext.debug.ScriptsPanel.superclass.initComponent.call(this); - }, - - evalScript : function(){ - var s = this.scriptField.getValue(); - if(this.trapBox.getValue()){ - try{ - var rt = eval(s); - Ext.dump(rt === undefined? '(no return)' : rt); - }catch(e){ - Ext.log(e.message || e.descript); - } - }else{ - var rt = eval(s); - Ext.dump(rt === undefined? '(no return)' : rt); - } - }, - - clear : function(){ - this.scriptField.setValue(''); - this.scriptField.focus(); - } - -}); - -Ext.debug.LogPanel = Ext.extend(Ext.Panel, { - autoScroll: true, - region: 'center', - border: false, - style:'border-width:0 1px 0 0', - - log : function(){ - var markup = [ '
', - Ext.util.Format.htmlEncode(Array.prototype.join.call(arguments, ', ')).replace(/\n/g, '
').replace(/\s/g, ' '), - '
'].join(''), - bd = this.body.dom; - - this.body.insertHtml('beforeend', markup); - bd.scrollTop = bd.scrollHeight; - }, - - clear : function(){ - this.body.update(''); - this.body.dom.scrollTop = 0; - } -}); - -Ext.debug.DomTree = Ext.extend(Ext.tree.TreePanel, { - enableDD:false , - lines:false, - rootVisible:false, - animate:false, - hlColor:'ffff9c', - autoScroll: true, - region:'center', - border:false, - - initComponent : function(){ - - - Ext.debug.DomTree.superclass.initComponent.call(this); - - // tree related stuff - var styles = false, hnode; - var nonSpace = /^\s*$/; - var html = Ext.util.Format.htmlEncode; - var ellipsis = Ext.util.Format.ellipsis; - var styleRe = /\s?([a-z\-]*)\:([^;]*)(?:[;\s\n\r]*)/gi; - - function findNode(n){ - if(!n || n.nodeType != 1 || n == document.body || n == document){ - return false; - } - var pn = [n], p = n; - while((p = p.parentNode) && p.nodeType == 1 && p.tagName.toUpperCase() != 'HTML'){ - pn.unshift(p); - } - var cn = hnode; - for(var i = 0, len = pn.length; i < len; i++){ - cn.expand(); - cn = cn.findChild('htmlNode', pn[i]); - if(!cn){ // in this dialog? - return false; - } - } - cn.select(); - var a = cn.ui.anchor; - this.getTreeEl().dom.scrollTop = Math.max(0 ,a.offsetTop-10); - //treeEl.dom.scrollLeft = Math.max(0 ,a.offsetLeft-10); no likey - cn.highlight(); - return true; - } - - function nodeTitle(n){ - var s = n.tagName; - if(n.id){ - s += '#'+n.id; - }else if(n.className){ - s += '.'+n.className; - } - return s; - } - - /* - function onNodeSelect(t, n, last){ - return; - if(last && last.unframe){ - last.unframe(); - } - var props = {}; - if(n && n.htmlNode){ - if(frameEl.pressed){ - n.frame(); - } - if(inspecting){ - return; - } - addStyle.enable(); - reload.setDisabled(n.leaf); - var dom = n.htmlNode; - stylePanel.setTitle(nodeTitle(dom)); - if(styles && !showAll.pressed){ - var s = dom.style ? dom.style.cssText : ''; - if(s){ - var m; - while ((m = styleRe.exec(s)) != null){ - props[m[1].toLowerCase()] = m[2]; - } - } - }else if(styles){ - var cl = Ext.debug.cssList; - var s = dom.style, fly = Ext.fly(dom); - if(s){ - for(var i = 0, len = cl.length; i' + ellipsis(html(String(c.nodeValue)), 35) + '', - cls: 'x-tree-noicon' - })); - } - } - cb(); - }; - - //tree.getSelectionModel().on('selectionchange', onNodeSelect, null, {buffer:250}); - - this.root = this.setRootNode(new Ext.tree.TreeNode('Ext')); - - hnode = this.root.appendChild(new Ext.debug.HtmlNode( - document.getElementsByTagName('html')[0] - )); - - } -}); - -Ext.debug.ComponentNodeUI = Ext.extend(Ext.tree.TreeNodeUI,{ - onOver : function(e){ - Ext.debug.ComponentNodeUI.superclass.onOver.call(this); - var cmp = this.node.attributes.component; - if (cmp.el && cmp.el.mask && cmp.id !='x-debug-browser') { - try { // Oddly bombs on some elements in IE, gets any we care about though - cmp.el.mask(); - } catch(e) {} - } - }, - - onOut : function(e){ - Ext.debug.ComponentNodeUI.superclass.onOut.call(this); - var cmp = this.node.attributes.component; - if (cmp.el && cmp.el.unmask && cmp.id !='x-debug-browser') { - try { - cmp.el.unmask(); - } catch(e) {} - } - } -}); - -Ext.debug.ComponentInspector = Ext.extend(Ext.tree.TreePanel, { - enableDD:false , - lines:false, - rootVisible:false, - animate:false, - hlColor:'ffff9c', - autoScroll: true, - region:'center', - border:false, - - initComponent : function(){ - this.loader = new Ext.tree.TreeLoader(); - this.bbar = new Ext.Toolbar([{ - text: 'Refresh', - handler: this.refresh, - scope: this - }]); - Ext.debug.ComponentInspector.superclass.initComponent.call(this); - - this.root = this.setRootNode(new Ext.tree.TreeNode({ - text: 'Ext Components', - component: Ext.ComponentMgr.all, - leaf: false - })); - this.parseRootNode(); - - this.on('click', this.onClick, this); - }, - - createNode: function(n,c) { - var leaf = (c.items && c.items.length > 0); - return n.appendChild(new Ext.tree.TreeNode({ - text: c.id + (c.getXType() ? ' [ ' + c.getXType() + ' ]': '' ), - component: c, - uiProvider:Ext.debug.ComponentNodeUI, - leaf: !leaf - })); - }, - - parseChildItems: function(n) { - var cn = n.attributes.component.items; - if (cn) { - for (var i = 0;i < cn.length; i++) { - var c = cn.get(i); - if (c.id != this.id && c.id != this.bottomToolbar.id) { - var newNode = this.createNode(n,c); - if (!newNode.leaf) { - this.parseChildItems(newNode); - } - } - } - } - }, - - parseRootNode: function() { - var n = this.root; - var cn = n.attributes.component.items; - for (var i = 0,c;c = cn[i];i++) { - if (c.id != this.id && c.id != this.bottomToolbar.id) { - if (!c.ownerCt) { - var newNode = this.createNode(n,c); - if (!newNode.leaf) { - this.parseChildItems(newNode); - } - } - } - } - }, - - onClick: function(node, e) { - var oi = Ext.getCmp('x-debug-objinspector'); - oi.refreshNodes(node.attributes.component); - oi.ownerCt.show(); - }, - - refresh: function() { - while (this.root.firstChild) { - this.root.removeChild(this.root.firstChild); - } - this.parseRootNode(); - var ci = Ext.getCmp('x-debug-compinfo'); - if (ci) { - ci.message('refreshed component tree - '+Ext.ComponentMgr.all.length); - } - } -}); - -Ext.debug.ComponentInfoPanel = Ext.extend(Ext.Panel,{ - id:'x-debug-compinfo', - region: 'east', - minWidth: 200, - split: true, - width: 350, - border: false, - autoScroll: true, - layout:'anchor', - style:'border-width:0 0 0 1px;', - - initComponent: function() { - this.watchBox = new Ext.form.Checkbox({ - id: 'x-debug-watchcomp', - boxLabel: 'Watch ComponentMgr', - listeners: { - check: function(cb, val) { - if (val) { - Ext.ComponentMgr.all.on('add', this.onAdd, this); - Ext.ComponentMgr.all.on('remove', this.onRemove, this); - } else { - Ext.ComponentMgr.all.un('add', this.onAdd, this); - Ext.ComponentMgr.all.un('remove', this.onRemove, this); - } - }, - scope: this - } - }); - - this.tbar = new Ext.Toolbar([{ - text: 'Clear', - handler: this.clear, - scope: this - },'->',this.watchBox - ]); - Ext.debug.ComponentInfoPanel.superclass.initComponent.call(this); - }, - - onAdd: function(i, o, key) { - var markup = ['
', - 'Added: '+o.id, - '
'].join(''); - this.insertMarkup(markup); - }, - - onRemove: function(o, key) { - var markup = ['
', - 'Removed: '+o.id, - '
'].join(''); - this.insertMarkup(markup); - }, - - message: function(msg) { - var markup = ['
', - msg, - '
'].join(''); - this.insertMarkup(markup); - }, - insertMarkup: function(markup) { - this.body.insertHtml('beforeend', markup); - this.body.scrollTo('top', 100000); - }, - clear : function(){ - this.body.update(''); - this.body.dom.scrollTop = 0; - } -}); - -Ext.debug.ColumnNodeUI = Ext.extend(Ext.tree.TreeNodeUI, { - focus: Ext.emptyFn, // prevent odd scrolling behavior - - renderElements : function(n, a, targetNode, bulkRender){ - 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 buf = [ - '
  • ', - '"]; - for(var i = 1, len = cols.length; i < len; i++){ - c = cols[i]; - - buf.push('
    ', - '
    ',(c.renderer ? c.renderer(a[c.dataIndex], n, a) : a[c.dataIndex]),"
    ", - "
    "); - } - buf.push( - '
    ', - '', - "
  • "); - - if(bulkRender !== true && n.nextSibling && n.nextSibling.ui.getEl()){ - this.wrap = Ext.DomHelper.insertHtml("beforeBegin", - n.nextSibling.ui.getEl(), buf.join("")); - }else{ - this.wrap = Ext.DomHelper.insertHtml("beforeEnd", targetNode, buf.join("")); - } - - this.elNode = this.wrap.childNodes[0]; - this.ctNode = this.wrap.childNodes[1]; - var cs = this.elNode.firstChild.childNodes; - this.indentNode = cs[0]; - this.ecNode = cs[1]; - this.iconNode = cs[2]; - this.anchor = cs[3]; - this.textNode = cs[3].firstChild; - } -}); - -Ext.debug.ObjectInspector = Ext.extend(Ext.tree.TreePanel, { - id: 'x-debug-objinspector', - enableDD:false , - lines:false, - rootVisible:false, - animate:false, - hlColor:'ffff9c', - autoScroll: true, - region:'center', - border:false, - lines:false, - borderWidth: Ext.isBorderBox ? 0 : 2, // the combined left/right border for each cell - cls:'x-column-tree', - - initComponent : function(){ - this.showFunc = false; - this.toggleFunc = function() { - this.showFunc = !this.showFunc; - this.refreshNodes(this.currentObject); - }; - this.bbar = new Ext.Toolbar([{ - text: 'Show Functions', - enableToggle: true, - pressed: false, - handler: this.toggleFunc, - scope: this - }]); - - Ext.apply(this,{ - title: ' ', - loader: new Ext.tree.TreeLoader(), - columns:[{ - header:'Property', - width: 300, - dataIndex:'name' - },{ - header:'Value', - width: 900, - dataIndex:'value' - }] - }); - - Ext.debug.ObjectInspector.superclass.initComponent.call(this); - - this.root = this.setRootNode(new Ext.tree.TreeNode({ - text: 'Dummy Node', - leaf: false - })); - - if (this.currentObject) { - this.parseNodes(); - } - }, - - refreshNodes: function(newObj) { - this.currentObject = newObj; - var node = this.root; - while(node.firstChild){ - node.removeChild(node.firstChild); - } - this.parseNodes(); - }, - - parseNodes: function() { - for (var o in this.currentObject) { - if (!this.showFunc) { - if (Ext.isFunction(this.currentObject[o])) { - continue; - } - } - this.createNode(o); - } - }, - - createNode: function(o) { - return this.root.appendChild(new Ext.tree.TreeNode({ - name: o, - value: this.currentObject[o], - uiProvider:Ext.debug.ColumnNodeUI, - iconCls: 'x-debug-node', - leaf: true - })); - }, - - onRender : function(){ - Ext.debug.ObjectInspector.superclass.onRender.apply(this, arguments); - this.headers = this.header.createChild({cls:'x-tree-headers'}); - - 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); - } -}); - - -Ext.debug.StoreInspector = Ext.extend(Ext.tree.TreePanel, { - enableDD:false , - lines:false, - rootVisible:false, - animate:false, - hlColor:'ffff9c', - autoScroll: true, - region:'center', - border:false, - - initComponent: function() { - this.bbar = new Ext.Toolbar([{ - text: 'Refresh', - handler: this.refresh, - scope: this - }]); - Ext.debug.StoreInspector.superclass.initComponent.call(this); - - this.root = this.setRootNode(new Ext.tree.TreeNode({ - text: 'Data Stores', - leaf: false - })); - this.on('click', this.onClick, this); - - this.parseStores(); - }, - - parseStores: function() { - var cn = Ext.StoreMgr.items; - for (var i = 0,c;c = cn[i];i++) { - this.root.appendChild({ - text: c.storeId + ' - ' + c.totalLength + ' records', - component: c, - leaf: true - }); - } - }, - - onClick: function(node, e) { - var oi = Ext.getCmp('x-debug-objinspector'); - oi.refreshNodes(node.attributes.component); - oi.ownerCt.show(); - }, - - refresh: function() { - while (this.root.firstChild) { - this.root.removeChild(this.root.firstChild); - } - this.parseStores(); - } -}); - -// highly unusual class declaration -Ext.debug.HtmlNode = function(){ - var html = Ext.util.Format.htmlEncode; - var ellipsis = Ext.util.Format.ellipsis; - var nonSpace = /^\s*$/; - - var attrs = [ - {n: 'id', v: 'id'}, - {n: 'className', v: 'class'}, - {n: 'name', v: 'name'}, - {n: 'type', v: 'type'}, - {n: 'src', v: 'src'}, - {n: 'href', v: 'href'} - ]; - - function hasChild(n){ - for(var i = 0, c; c = n.childNodes[i]; i++){ - if(c.nodeType == 1){ - return true; - } - } - return false; - } - - function renderNode(n, leaf){ - var tag = n.tagName.toLowerCase(); - var s = '<' + tag; - for(var i = 0, len = attrs.length; i < len; i++){ - var a = attrs[i]; - var v = n[a.n]; - if(v && !nonSpace.test(v)){ - s += ' ' + a.v + '="' + html(v) +'"'; - } - } - var style = n.style ? n.style.cssText : ''; - if(style){ - s += ' style="' + html(style.toLowerCase()) +'"'; - } - if(leaf && n.childNodes.length > 0){ - s+='>' + ellipsis(html(String(n.innerHTML)), 35) + '</'+tag+'>'; - }else if(leaf){ - s += ' />'; - }else{ - s += '>'; - } - return s; - } - - var HtmlNode = function(n){ - var leaf = !hasChild(n); - this.htmlNode = n; - this.tagName = n.tagName.toLowerCase(); - var attr = { - text : renderNode(n, leaf), - leaf : leaf, - cls: 'x-tree-noicon' - }; - HtmlNode.superclass.constructor.call(this, attr); - this.attributes.htmlNode = n; // for searching - if(!leaf){ - this.on('expand', this.onExpand, this); - this.on('collapse', this.onCollapse, this); - } - }; - - - Ext.extend(HtmlNode, Ext.tree.AsyncTreeNode, { - cls: 'x-tree-noicon', - preventHScroll: true, - refresh : function(highlight){ - var leaf = !hasChild(this.htmlNode); - this.setText(renderNode(this.htmlNode, leaf)); - if(highlight){ - Ext.fly(this.ui.textNode).highlight(); - } - }, - - onExpand : function(){ - if(!this.closeNode && this.parentNode){ - this.closeNode = this.parentNode.insertBefore(new Ext.tree.TreeNode({ - text:'</' + this.tagName + '>', - cls: 'x-tree-noicon' - }), this.nextSibling); - }else if(this.closeNode){ - this.closeNode.ui.show(); - } - }, - - onCollapse : function(){ - if(this.closeNode){ - this.closeNode.ui.hide(); - } - }, - - render : function(bulkRender){ - HtmlNode.superclass.render.call(this, bulkRender); - }, - - highlightNode : function(){ - //Ext.fly(this.htmlNode).highlight(); - }, - - highlight : function(){ - //Ext.fly(this.ui.textNode).highlight(); - }, - - frame : function(){ - this.htmlNode.style.border = '1px solid #0000ff'; - //this.highlightNode(); - }, - - unframe : function(){ - //Ext.fly(this.htmlNode).removeClass('x-debug-frame'); - this.htmlNode.style.border = ''; - } - }); - - return HtmlNode; -}(); \ No newline at end of file diff --git a/assets/js/ext/src/direct/Direct.js b/assets/js/ext/src/direct/Direct.js deleted file mode 100644 index 5a32cdf..0000000 --- a/assets/js/ext/src/direct/Direct.js +++ /dev/null @@ -1,235 +0,0 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.com/license - */ -/** - * @class Ext.Direct - * @extends Ext.util.Observable - *

    Overview

    - * - *

    Ext.Direct aims to streamline communication between the client and server - * by providing a single interface that reduces the amount of common code - * typically required to validate data and handle returned data packets - * (reading data, error conditions, etc).

    - * - *

    The Ext.direct namespace includes several classes for a closer integration - * with the server-side. The Ext.data namespace also includes classes for working - * with Ext.data.Stores which are backed by data from an Ext.Direct method.

    - * - *

    Specification

    - * - *

    For additional information consult the - * Ext.Direct Specification.

    - * - *

    Providers

    - * - *

    Ext.Direct uses a provider architecture, where one or more providers are - * used to transport data to and from the server. There are several providers - * that exist in the core at the moment:

      - * - *
    • {@link Ext.direct.JsonProvider JsonProvider} for simple JSON operations
    • - *
    • {@link Ext.direct.PollingProvider PollingProvider} for repeated requests
    • - *
    • {@link Ext.direct.RemotingProvider RemotingProvider} exposes server side - * on the client.
    • - *
    - * - *

    A provider does not need to be invoked directly, providers are added via - * {@link Ext.Direct}.{@link Ext.Direct#add add}.

    - * - *

    Router

    - * - *

    Ext.Direct utilizes a "router" on the server to direct requests from the client - * to the appropriate server-side method. Because the Ext.Direct API is completely - * platform-agnostic, you could completely swap out a Java based server solution - * and replace it with one that uses C# without changing the client side JavaScript - * at all.

    - * - *

    Server side events

    - * - *

    Custom events from the server may be handled by the client by adding - * listeners, for example:

    - *
    
    -{"type":"event","name":"message","data":"Successfully polled at: 11:19:30 am"}
    -
    -// add a handler for a 'message' event sent by the server
    -Ext.Direct.on('message', function(e){
    -    out.append(String.format('<p><i>{0}</i></p>', e.data));
    -            out.el.scrollTo('t', 100000, true);
    -});
    - * 
    - * @singleton - */ -Ext.Direct = Ext.extend(Ext.util.Observable, { - /** - * Each event type implements a getData() method. The default event types are: - *
      - *
    • event : Ext.Direct.Event
    • - *
    • exception : Ext.Direct.ExceptionEvent
    • - *
    • rpc : Ext.Direct.RemotingEvent
    • - *
    - * @property eventTypes - * @type Object - */ - - /** - * Four types of possible exceptions which can occur: - *
      - *
    • Ext.Direct.exceptions.TRANSPORT : 'xhr'
    • - *
    • Ext.Direct.exceptions.PARSE : 'parse'
    • - *
    • Ext.Direct.exceptions.LOGIN : 'login'
    • - *
    • Ext.Direct.exceptions.SERVER : 'exception'
    • - *
    - * @property exceptions - * @type Object - */ - exceptions: { - TRANSPORT: 'xhr', - PARSE: 'parse', - LOGIN: 'login', - SERVER: 'exception' - }, - - // private - constructor: function(){ - this.addEvents( - /** - * @event event - * Fires after an event. - * @param {event} e The {@link Ext.Direct#eventTypes Ext.Direct.Event type} that occurred. - * @param {Ext.direct.Provider} provider The {@link Ext.direct.Provider Provider}. - */ - 'event', - /** - * @event exception - * Fires after an event exception. - * @param {event} e The {@link Ext.Direct#eventTypes Ext.Direct.Event type} that occurred. - */ - 'exception' - ); - this.transactions = {}; - this.providers = {}; - }, - - /** - * Adds an Ext.Direct Provider and creates the proxy or stub methods to execute server-side methods. - * If the provider is not already connected, it will auto-connect. - *
    
    -var pollProv = new Ext.direct.PollingProvider({
    -    url: 'php/poll2.php'
    -});
    -
    -Ext.Direct.addProvider(
    -    {
    -        "type":"remoting",       // create a {@link Ext.direct.RemotingProvider}
    -        "url":"php\/router.php", // url to connect to the Ext.Direct server-side router.
    -        "actions":{              // each property within the actions object represents a Class
    -            "TestAction":[       // array of methods within each server side Class
    -            {
    -                "name":"doEcho", // name of method
    -                "len":1
    -            },{
    -                "name":"multiply",
    -                "len":1
    -            },{
    -                "name":"doForm",
    -                "formHandler":true, // handle form on server with Ext.Direct.Transaction
    -                "len":1
    -            }]
    -        },
    -        "namespace":"myApplication",// namespace to create the Remoting Provider in
    -    },{
    -        type: 'polling', // create a {@link Ext.direct.PollingProvider}
    -        url:  'php/poll.php'
    -    },
    -    pollProv // reference to previously created instance
    -);
    -     * 
    - * @param {Object/Array} provider Accepts either an Array of Provider descriptions (an instance - * or config object for a Provider) or any number of Provider descriptions as arguments. Each - * Provider description instructs Ext.Direct how to create client-side stub methods. - */ - addProvider : function(provider){ - var a = arguments; - if(a.length > 1){ - for(var i = 0, len = a.length; i < len; i++){ - this.addProvider(a[i]); - } - return; - } - - // if provider has not already been instantiated - if(!provider.events){ - provider = new Ext.Direct.PROVIDERS[provider.type](provider); - } - provider.id = provider.id || Ext.id(); - this.providers[provider.id] = provider; - - provider.on('data', this.onProviderData, this); - provider.on('exception', this.onProviderException, this); - - - if(!provider.isConnected()){ - provider.connect(); - } - - return provider; - }, - - /** - * Retrieve a {@link Ext.direct.Provider provider} by the - * {@link Ext.direct.Provider#id id} specified when the provider is - * {@link #addProvider added}. - * @param {String} id Unique identifier assigned to the provider when calling {@link #addProvider} - */ - getProvider : function(id){ - return this.providers[id]; - }, - - removeProvider : function(id){ - var provider = id.id ? id : this.providers[id]; - provider.un('data', this.onProviderData, this); - provider.un('exception', this.onProviderException, this); - delete this.providers[provider.id]; - return provider; - }, - - addTransaction: function(t){ - this.transactions[t.tid] = t; - return t; - }, - - removeTransaction: function(t){ - delete this.transactions[t.tid || t]; - return t; - }, - - getTransaction: function(tid){ - return this.transactions[tid.tid || tid]; - }, - - onProviderData : function(provider, e){ - if(Ext.isArray(e)){ - for(var i = 0, len = e.length; i < len; i++){ - this.onProviderData(provider, e[i]); - } - return; - } - if(e.name && e.name != 'event' && e.name != 'exception'){ - this.fireEvent(e.name, e); - }else if(e.type == 'exception'){ - this.fireEvent('exception', e); - } - this.fireEvent('event', e, provider); - }, - - createEvent : function(response, extraProps){ - return new Ext.Direct.eventTypes[response.type](Ext.apply(response, extraProps)); - } -}); -// overwrite impl. with static instance -Ext.Direct = new Ext.Direct(); - -Ext.Direct.TID = 1; -Ext.Direct.PROVIDERS = {}; \ No newline at end of file diff --git a/assets/js/ext/src/direct/Event.js b/assets/js/ext/src/direct/Event.js deleted file mode 100644 index 2795807..0000000 --- a/assets/js/ext/src/direct/Event.js +++ /dev/null @@ -1,34 +0,0 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.com/license - */ -Ext.Direct.Event = function(config){ - Ext.apply(this, config); -}; - -Ext.Direct.Event.prototype = { - status: true, - getData: function(){ - return this.data; - } -}; - -Ext.Direct.RemotingEvent = Ext.extend(Ext.Direct.Event, { - type: 'rpc', - getTransaction: function(){ - return this.transaction || Ext.Direct.getTransaction(this.tid); - } -}); - -Ext.Direct.ExceptionEvent = Ext.extend(Ext.Direct.RemotingEvent, { - status: false, - type: 'exception' -}); - -Ext.Direct.eventTypes = { - 'rpc': Ext.Direct.RemotingEvent, - 'event': Ext.Direct.Event, - 'exception': Ext.Direct.ExceptionEvent -}; diff --git a/assets/js/ext/src/direct/JsonProvider.js b/assets/js/ext/src/direct/JsonProvider.js deleted file mode 100644 index c89c983..0000000 --- a/assets/js/ext/src/direct/JsonProvider.js +++ /dev/null @@ -1,45 +0,0 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.com/license - */ -/** - * @class Ext.direct.JsonProvider - * @extends Ext.direct.Provider - */ -Ext.direct.JsonProvider = Ext.extend(Ext.direct.Provider, { - parseResponse: function(xhr){ - if(!Ext.isEmpty(xhr.responseText)){ - if(typeof xhr.responseText == 'object'){ - return xhr.responseText; - } - return Ext.decode(xhr.responseText); - } - return null; - }, - - getEvents: function(xhr){ - var data = null; - try{ - data = this.parseResponse(xhr); - }catch(e){ - var event = new Ext.Direct.ExceptionEvent({ - data: e, - xhr: xhr, - code: Ext.Direct.exceptions.PARSE, - message: 'Error parsing json response: \n\n ' + data - }); - return [event]; - } - var events = []; - if(Ext.isArray(data)){ - for(var i = 0, len = data.length; i < len; i++){ - events.push(Ext.Direct.createEvent(data[i])); - } - }else{ - events.push(Ext.Direct.createEvent(data)); - } - return events; - } -}); \ No newline at end of file diff --git a/assets/js/ext/src/direct/PollingProvider.js b/assets/js/ext/src/direct/PollingProvider.js deleted file mode 100644 index d44f9e3..0000000 --- a/assets/js/ext/src/direct/PollingProvider.js +++ /dev/null @@ -1,151 +0,0 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.com/license - */ -/** - * @class Ext.direct.PollingProvider - * @extends Ext.direct.JsonProvider - * - *

    Provides for repetitive polling of the server at distinct {@link #interval intervals}. - * The initial request for data originates from the client, and then is responded to by the - * server.

    - * - *

    All configurations for the PollingProvider should be generated by the server-side - * API portion of the Ext.Direct stack.

    - * - *

    An instance of PollingProvider may be created directly via the new keyword or by simply - * specifying type = 'polling'. For example:

    - *
    
    -var pollA = new Ext.direct.PollingProvider({
    -    type:'polling',
    -    url: 'php/pollA.php',
    -});
    -Ext.Direct.addProvider(pollA);
    -pollA.disconnect();
    -
    -Ext.Direct.addProvider(
    -    {
    -        type:'polling',
    -        url: 'php/pollB.php',
    -        id: 'pollB-provider'
    -    }
    -);
    -var pollB = Ext.Direct.getProvider('pollB-provider');
    - * 
    - */ -Ext.direct.PollingProvider = Ext.extend(Ext.direct.JsonProvider, { - /** - * @cfg {Number} priority - * Priority of the request (defaults to 3). See {@link Ext.direct.Provider#priority}. - */ - // override default priority - priority: 3, - - /** - * @cfg {Number} interval - * How often to poll the server-side in milliseconds (defaults to 3000 - every - * 3 seconds). - */ - interval: 3000, - - /** - * @cfg {Object} baseParams An object containing properties which are to be sent as parameters - * on every polling request - */ - - /** - * @cfg {String/Function} url - * The url which the PollingProvider should contact with each request. This can also be - * an imported Ext.Direct method which will accept the baseParams as its only argument. - */ - - // private - constructor : function(config){ - Ext.direct.PollingProvider.superclass.constructor.call(this, config); - this.addEvents( - /** - * @event beforepoll - * Fired immediately before a poll takes place, an event handler can return false - * in order to cancel the poll. - * @param {Ext.direct.PollingProvider} - */ - 'beforepoll', - /** - * @event poll - * This event has not yet been implemented. - * @param {Ext.direct.PollingProvider} - */ - 'poll' - ); - }, - - // inherited - isConnected: function(){ - return !!this.pollTask; - }, - - /** - * Connect to the server-side and begin the polling process. To handle each - * response subscribe to the data event. - */ - connect: function(){ - if(this.url && !this.pollTask){ - this.pollTask = Ext.TaskMgr.start({ - run: function(){ - if(this.fireEvent('beforepoll', this) !== false){ - if(typeof this.url == 'function'){ - this.url(this.baseParams); - }else{ - Ext.Ajax.request({ - url: this.url, - callback: this.onData, - scope: this, - params: this.baseParams - }); - } - } - }, - interval: this.interval, - scope: this - }); - this.fireEvent('connect', this); - }else if(!this.url){ - throw 'Error initializing PollingProvider, no url configured.'; - } - }, - - /** - * Disconnect from the server-side and stop the polling process. The disconnect - * event will be fired on a successful disconnect. - */ - disconnect: function(){ - if(this.pollTask){ - Ext.TaskMgr.stop(this.pollTask); - delete this.pollTask; - this.fireEvent('disconnect', this); - } - }, - - // private - onData: function(opt, success, xhr){ - if(success){ - var events = this.getEvents(xhr); - for(var i = 0, len = events.length; i < len; i++){ - var e = events[i]; - this.fireEvent('data', this, e); - } - }else{ - var e = new Ext.Direct.ExceptionEvent({ - data: e, - code: Ext.Direct.exceptions.TRANSPORT, - message: 'Unable to connect to the server.', - xhr: xhr - }); - this.fireEvent('data', this, e); - } - } -}); - -Ext.Direct.PROVIDERS['polling'] = Ext.direct.PollingProvider; \ No newline at end of file diff --git a/assets/js/ext/src/direct/Provider.js b/assets/js/ext/src/direct/Provider.js deleted file mode 100644 index 453595a..0000000 --- a/assets/js/ext/src/direct/Provider.js +++ /dev/null @@ -1,110 +0,0 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.com/license - */ -/** - * @class Ext.direct.Provider - * @extends Ext.util.Observable - *

    Ext.direct.Provider is an abstract class meant to be extended.

    - * - *

    For example ExtJs implements the following subclasses:

    - *
    
    -Provider
    -|
    -+---{@link Ext.direct.JsonProvider JsonProvider} 
    -    |
    -    +---{@link Ext.direct.PollingProvider PollingProvider}   
    -    |
    -    +---{@link Ext.direct.RemotingProvider RemotingProvider}   
    - * 
    - * @abstract - */ -Ext.direct.Provider = Ext.extend(Ext.util.Observable, { - /** - * @cfg {String} id - * The unique id of the provider (defaults to an {@link Ext#id auto-assigned id}). - * You should assign an id if you need to be able to access the provider later and you do - * not have an object reference available, for example: - *
    
    -Ext.Direct.addProvider(
    -    {
    -        type: 'polling',
    -        url:  'php/poll.php',
    -        id:   'poll-provider'
    -    }
    -);
    -     
    -var p = {@link Ext.Direct Ext.Direct}.{@link Ext.Direct#getProvider getProvider}('poll-provider');
    -p.disconnect();
    -     * 
    - */ - - /** - * @cfg {Number} priority - * Priority of the request. Lower is higher priority, 0 means "duplex" (always on). - * All Providers default to 1 except for PollingProvider which defaults to 3. - */ - priority: 1, - - /** - * @cfg {String} type - * Required, undefined by default. The type of provider specified - * to {@link Ext.Direct Ext.Direct}.{@link Ext.Direct#addProvider addProvider} to create a - * new Provider. Acceptable values by default are:
      - *
    • polling : {@link Ext.direct.PollingProvider PollingProvider}
    • - *
    • remoting : {@link Ext.direct.RemotingProvider RemotingProvider}
    • - *
    - */ - - // private - constructor : function(config){ - Ext.apply(this, config); - this.addEvents( - /** - * @event connect - * Fires when the Provider connects to the server-side - * @param {Ext.direct.Provider} provider The {@link Ext.direct.Provider Provider}. - */ - 'connect', - /** - * @event disconnect - * Fires when the Provider disconnects from the server-side - * @param {Ext.direct.Provider} provider The {@link Ext.direct.Provider Provider}. - */ - 'disconnect', - /** - * @event data - * Fires when the Provider receives data from the server-side - * @param {Ext.direct.Provider} provider The {@link Ext.direct.Provider Provider}. - * @param {event} e The {@link Ext.Direct#eventTypes Ext.Direct.Event type} that occurred. - */ - 'data', - /** - * @event exception - * Fires when the Provider receives an exception from the server-side - */ - 'exception' - ); - Ext.direct.Provider.superclass.constructor.call(this, config); - }, - - /** - * Returns whether or not the server-side is currently connected. - * Abstract method for subclasses to implement. - */ - isConnected: function(){ - return false; - }, - - /** - * Abstract methods for subclasses to implement. - */ - connect: Ext.emptyFn, - - /** - * Abstract methods for subclasses to implement. - */ - disconnect: Ext.emptyFn -}); diff --git a/assets/js/ext/src/direct/RemotingProvider.js b/assets/js/ext/src/direct/RemotingProvider.js deleted file mode 100644 index 426a1ce..0000000 --- a/assets/js/ext/src/direct/RemotingProvider.js +++ /dev/null @@ -1,380 +0,0 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.com/license - */ -/** - * @class Ext.direct.RemotingProvider - * @extends Ext.direct.JsonProvider - * - *

    The {@link Ext.direct.RemotingProvider RemotingProvider} exposes access to - * server side methods on the client (a remote procedure call (RPC) type of - * connection where the client can initiate a procedure on the server).

    - * - *

    This allows for code to be organized in a fashion that is maintainable, - * while providing a clear path between client and server, something that is - * not always apparent when using URLs.

    - * - *

    To accomplish this the server-side needs to describe what classes and methods - * are available on the client-side. This configuration will typically be - * outputted by the server-side Ext.Direct stack when the API description is built.

    - */ -Ext.direct.RemotingProvider = Ext.extend(Ext.direct.JsonProvider, { - /** - * @cfg {Object} actions - * Object literal defining the server side actions and methods. For example, if - * the Provider is configured with: - *
    
    -"actions":{ // each property within the 'actions' object represents a server side Class 
    -    "TestAction":[ // array of methods within each server side Class to be   
    -    {              // stubbed out on client
    -        "name":"doEcho", 
    -        "len":1            
    -    },{
    -        "name":"multiply",// name of method
    -        "len":2           // The number of parameters that will be used to create an
    -                          // array of data to send to the server side function.
    -                          // Ensure the server sends back a Number, not a String. 
    -    },{
    -        "name":"doForm",
    -        "formHandler":true, // direct the client to use specialized form handling method 
    -        "len":1
    -    }]
    -}
    -     * 
    - *

    Note that a Store is not required, a server method can be called at any time. - * In the following example a client side handler is used to call the - * server side method "multiply" in the server-side "TestAction" Class:

    - *
    
    -TestAction.multiply(
    -    2, 4, // pass two arguments to server, so specify len=2
    -    // callback function after the server is called
    -    // result: the result returned by the server
    -    //      e: Ext.Direct.RemotingEvent object
    -    function(result, e){
    -        var t = e.getTransaction();
    -        var action = t.action; // server side Class called
    -        var method = t.method; // server side method called
    -        if(e.status){
    -            var answer = Ext.encode(result); // 8
    -    
    -        }else{
    -            var msg = e.message; // failure message
    -        }
    -    }
    -);
    -     * 
    - * In the example above, the server side "multiply" function will be passed two - * arguments (2 and 4). The "multiply" method should return the value 8 which will be - * available as the result in the example above. - */ - - /** - * @cfg {String/Object} namespace - * Namespace for the Remoting Provider (defaults to the browser global scope of window). - * Explicitly specify the namespace Object, or specify a String to have a - * {@link Ext#namespace namespace created} implicitly. - */ - - /** - * @cfg {String} url - * Required. The url to connect to the {@link Ext.Direct} server-side router. - */ - - /** - * @cfg {String} enableUrlEncode - * Specify which param will hold the arguments for the method. - * Defaults to 'data'. - */ - - /** - * @cfg {Number/Boolean} enableBuffer - *

    true or false to enable or disable combining of method - * calls. If a number is specified this is the amount of time in milliseconds - * to wait before sending a batched request (defaults to 10).

    - *

    Calls which are received within the specified timeframe will be - * concatenated together and sent in a single request, optimizing the - * application by reducing the amount of round trips that have to be made - * to the server.

    - */ - enableBuffer: 10, - - /** - * @cfg {Number} maxRetries - * Number of times to re-attempt delivery on failure of a call. Defaults to 1. - */ - maxRetries: 1, - - /** - * @cfg {Number} timeout - * The timeout to use for each request. Defaults to undefined. - */ - timeout: undefined, - - constructor : function(config){ - Ext.direct.RemotingProvider.superclass.constructor.call(this, config); - this.addEvents( - /** - * @event beforecall - * Fires immediately before the client-side sends off the RPC call. - * By returning false from an event handler you can prevent the call from - * executing. - * @param {Ext.direct.RemotingProvider} provider - * @param {Ext.Direct.Transaction} transaction - * @param {Object} meta The meta data - */ - 'beforecall', - /** - * @event call - * Fires immediately after the request to the server-side is sent. This does - * NOT fire after the response has come back from the call. - * @param {Ext.direct.RemotingProvider} provider - * @param {Ext.Direct.Transaction} transaction - * @param {Object} meta The meta data - */ - 'call' - ); - this.namespace = (Ext.isString(this.namespace)) ? Ext.ns(this.namespace) : this.namespace || window; - this.transactions = {}; - this.callBuffer = []; - }, - - // private - initAPI : function(){ - var o = this.actions; - for(var c in o){ - var cls = this.namespace[c] || (this.namespace[c] = {}), - ms = o[c]; - for(var i = 0, len = ms.length; i < len; i++){ - var m = ms[i]; - cls[m.name] = this.createMethod(c, m); - } - } - }, - - // inherited - isConnected: function(){ - return !!this.connected; - }, - - connect: function(){ - if(this.url){ - this.initAPI(); - this.connected = true; - this.fireEvent('connect', this); - }else if(!this.url){ - throw 'Error initializing RemotingProvider, no url configured.'; - } - }, - - disconnect: function(){ - if(this.connected){ - this.connected = false; - this.fireEvent('disconnect', this); - } - }, - - onData: function(opt, success, xhr){ - if(success){ - var events = this.getEvents(xhr); - for(var i = 0, len = events.length; i < len; i++){ - var e = events[i], - t = this.getTransaction(e); - this.fireEvent('data', this, e); - if(t){ - this.doCallback(t, e, true); - Ext.Direct.removeTransaction(t); - } - } - }else{ - var ts = [].concat(opt.ts); - for(var i = 0, len = ts.length; i < len; i++){ - var t = this.getTransaction(ts[i]); - if(t && t.retryCount < this.maxRetries){ - t.retry(); - }else{ - var e = new Ext.Direct.ExceptionEvent({ - data: e, - transaction: t, - code: Ext.Direct.exceptions.TRANSPORT, - message: 'Unable to connect to the server.', - xhr: xhr - }); - this.fireEvent('data', this, e); - if(t){ - this.doCallback(t, e, false); - Ext.Direct.removeTransaction(t); - } - } - } - } - }, - - getCallData: function(t){ - return { - action: t.action, - method: t.method, - data: t.data, - type: 'rpc', - tid: t.tid - }; - }, - - doSend : function(data){ - var o = { - url: this.url, - callback: this.onData, - scope: this, - ts: data, - timeout: this.timeout - }, callData; - - if(Ext.isArray(data)){ - callData = []; - for(var i = 0, len = data.length; i < len; i++){ - callData.push(this.getCallData(data[i])); - } - }else{ - callData = this.getCallData(data); - } - - if(this.enableUrlEncode){ - var params = {}; - params[Ext.isString(this.enableUrlEncode) ? this.enableUrlEncode : 'data'] = Ext.encode(callData); - o.params = params; - }else{ - o.jsonData = callData; - } - Ext.Ajax.request(o); - }, - - combineAndSend : function(){ - var len = this.callBuffer.length; - if(len > 0){ - this.doSend(len == 1 ? this.callBuffer[0] : this.callBuffer); - this.callBuffer = []; - } - }, - - queueTransaction: function(t){ - if(t.form){ - this.processForm(t); - return; - } - this.callBuffer.push(t); - if(this.enableBuffer){ - if(!this.callTask){ - this.callTask = new Ext.util.DelayedTask(this.combineAndSend, this); - } - this.callTask.delay(Ext.isNumber(this.enableBuffer) ? this.enableBuffer : 10); - }else{ - this.combineAndSend(); - } - }, - - doCall : function(c, m, args){ - var data = null, hs = args[m.len], scope = args[m.len+1]; - - if(m.len !== 0){ - data = args.slice(0, m.len); - } - - var t = new Ext.Direct.Transaction({ - provider: this, - args: args, - action: c, - method: m.name, - data: data, - cb: scope && Ext.isFunction(hs) ? hs.createDelegate(scope) : hs - }); - - if(this.fireEvent('beforecall', this, t, m) !== false){ - Ext.Direct.addTransaction(t); - this.queueTransaction(t); - this.fireEvent('call', this, t, m); - } - }, - - doForm : function(c, m, form, callback, scope){ - var t = new Ext.Direct.Transaction({ - provider: this, - action: c, - method: m.name, - args:[form, callback, scope], - cb: scope && Ext.isFunction(callback) ? callback.createDelegate(scope) : callback, - isForm: true - }); - - if(this.fireEvent('beforecall', this, t, m) !== false){ - Ext.Direct.addTransaction(t); - var isUpload = String(form.getAttribute("enctype")).toLowerCase() == 'multipart/form-data', - params = { - extTID: t.tid, - extAction: c, - extMethod: m.name, - extType: 'rpc', - extUpload: String(isUpload) - }; - - // change made from typeof callback check to callback.params - // to support addl param passing in DirectSubmit EAC 6/2 - Ext.apply(t, { - form: Ext.getDom(form), - isUpload: isUpload, - params: callback && Ext.isObject(callback.params) ? Ext.apply(params, callback.params) : params - }); - this.fireEvent('call', this, t, m); - this.processForm(t); - } - }, - - processForm: function(t){ - Ext.Ajax.request({ - url: this.url, - params: t.params, - callback: this.onData, - scope: this, - form: t.form, - isUpload: t.isUpload, - ts: t - }); - }, - - createMethod : function(c, m){ - var f; - if(!m.formHandler){ - f = function(){ - this.doCall(c, m, Array.prototype.slice.call(arguments, 0)); - }.createDelegate(this); - }else{ - f = function(form, callback, scope){ - this.doForm(c, m, form, callback, scope); - }.createDelegate(this); - } - f.directCfg = { - action: c, - method: m - }; - return f; - }, - - getTransaction: function(opt){ - return opt && opt.tid ? Ext.Direct.getTransaction(opt.tid) : null; - }, - - doCallback: function(t, e){ - var fn = e.status ? 'success' : 'failure'; - if(t && t.cb){ - var hs = t.cb, - result = Ext.isDefined(e.result) ? e.result : e.data; - if(Ext.isFunction(hs)){ - hs(result, e); - } else{ - Ext.callback(hs[fn], hs.scope, [result, e]); - Ext.callback(hs.callback, hs.scope, [result, e]); - } - } - } -}); -Ext.Direct.PROVIDERS['remoting'] = Ext.direct.RemotingProvider; \ No newline at end of file diff --git a/assets/js/ext/src/direct/Transaction.js b/assets/js/ext/src/direct/Transaction.js deleted file mode 100644 index e8f086a..0000000 --- a/assets/js/ext/src/direct/Transaction.js +++ /dev/null @@ -1,32 +0,0 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.com/license - */ -/** - * @class Ext.Direct.Transaction - * @extends Object - *

    Supporting Class for Ext.Direct (not intended to be used directly).

    - * @constructor - * @param {Object} config - */ -Ext.Direct.Transaction = function(config){ - Ext.apply(this, config); - this.tid = ++Ext.Direct.TID; - this.retryCount = 0; -}; -Ext.Direct.Transaction.prototype = { - send: function(){ - this.provider.queueTransaction(this); - }, - - retry: function(){ - this.retryCount++; - this.send(); - }, - - getProvider: function(){ - return this.provider; - } -}; \ No newline at end of file diff --git a/assets/js/ext/src/error-checking.js b/assets/js/ext/src/error-checking.js deleted file mode 100644 index 80f6513..0000000 --- a/assets/js/ext/src/error-checking.js +++ /dev/null @@ -1,364 +0,0 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.com/license - */ -Ext.ns('Ext.debug'); -Ext.debug.Assistant = function(){ - var enabled = true; - - return { - enable: function(){ - enabled = true; - }, - - disable: function(){ - enabled = false; - }, - - init : function(classes){ - var klass, - intercept = false, - fn, - method; - Ext.each(classes, function(cls){ - if(this.namespaceExists(cls.name)){ - klass = this.getClass(cls.name); - method = cls.instance ? this.addInstanceCheck : this.addPrototypeCheck; - Ext.each(cls.checks, function(check){ - intercept = check.intercept == true; - fn = method.call(this, klass, check.name, check.fn, check.intercept == true); - if(check.after){ - check.after(fn); - } - }, this); - } - }, this); - }, - - namespaceExists: function(name){ - var parent = window, - exists = true; - - Ext.each(name.split('.'), function(n){ - if(!Ext.isDefined(parent[n])){ - exists = false; - return false; - } - parent = parent[n]; - }); - return exists; - }, - - getClass : function(name){ - var parent = window; - Ext.each(name.split('.'), function(n){ - parent = parent[n]; - }); - return parent; - }, - - warn: function(){ - if(enabled && window.console){ - console.warn.apply(console, arguments); - } - }, - - error: function(){ - if(enabled && window.console){ - console.error.apply(console, arguments); - } - }, - - addPrototypeCheck : function(cls, method, fn, intercept){ - return (cls.prototype[method] = cls.prototype[method][intercept ? 'createInterceptor' : 'createSequence'](fn)); - }, - - addInstanceCheck : function(cls, method, fn, intercept){ - return (cls[method] = cls[method][intercept ? 'createInterceptor' : 'createSequence'](fn)); - } - }; -}(); - -(function(){ - var A = Ext.debug.Assistant, - cls = []; - - cls.push({ - name: 'Ext.util.Observable', - checks: [{ - name: 'addListener', - intercept: true, - fn: function(eventName, fn){ - if(typeof eventName == 'object'){ - var ev, o; - for(ev in eventName){ - if(!this.filterOptRe.test(ev)){ - o = eventName[ev]; - o = o && o.fn ? o.fn : o; - if(!Ext.isFunction(o)){ - A.error('Non function passed to event listener', this, ev); - return false; - } - } - } - }else{ - if(!Ext.isFunction(fn)){ - A.error('Non function passed to event listener', this, eventName); - } - } - }, - after: function(method){ - Ext.util.Observable.prototype.on = method; - } - }] - }); - - cls.push({ - name: 'Ext.Component', - checks: [{ - name: 'render', - intercept: true, - fn: function(container, position){ - if(!container && !this.el){ - A.error('Unable to render to container', this, container); - } - - if(this.contentEl){ - var el = Ext.getDom(this.contentEl); - if(!el){ - A.error('Specified contentEl does not exist', this, this.contentEl); - return false; - } - } - } - }] - }); - - cls.push({ - name: 'Ext.Container', - checks: [{ - name: 'onBeforeAdd', - intercept: true, - fn: function(c){ - if(c.isDestroyed){ - A.warn('Adding destroyed component to container', c, this); - } - if(c.renderTo){ - A.warn('Using renderTo while adding an item to a Container. You should use the add() method or put the item in the items configuration', c, this); - } - if(c.applyTo){ - A.warn('Using applyTo while adding an item to a Container. You should use the add() method or put the item in the items configuration', c, this); - } - - var type = this.layout.type; - if(type == 'container' || type == 'auto'){ - A.warn('A non sizing layout is being used in a container that has child components. This means the child components will not be sized.', this); - } - } - },{ - name: 'lookupComponent', - intercept: true, - fn: function(c){ - var valid = true; - if(Ext.isEmpty(c)){ - valid = false; - } - if(Ext.isString(c)){ - c = Ext.ComponentMgr.get(comp); - valid = !Ext.isEmpty(c); - } - if(!valid){ - A.error('Adding invalid component to container', this, c); - return false; - } - } - }] - }); - - cls.push({ - name: 'Ext.DataView', - checks: [{ - name: 'initComponent', - fn: function(){ - if(!this.itemSelector){ - A.error('No itemSelector specified', this); - } - } - },{ - name: 'afterRender', - fn: function(){ - if(!this.store){ - A.error('No store attached to DataView', this); - } - } - }] - }); - - cls.push({ - name: 'Ext.Window', - checks: [{ - name: 'show', - intercept: true, - fn: function(){ - if(this.isDestroyed){ - A.error('Trying to show a destroyed window. If you want to reuse the window, look at the closeAction configuration.', this); - return false; - } - } - }] - }); - - cls.push({ - name: 'Ext.grid.GridPanel', - checks: [{ - name: 'initComponent', - fn: function(){ - if(!this.colModel){ - A.error('No column model specified for grid', this); - } - if(!this.store){ - A.error('No store specified for grid', this); - } - } - }] - }); - - cls.push({ - name: 'Ext.grid.GridView', - checks: [{ - name: 'autoExpand', - intercept: true, - fn: function(){ - var g = this.grid, - cm = this.cm; - if(!this.userResized && g.autoExpandColumn){ - var tw = cm.getTotalWidth(false), - aw = this.grid.getGridEl().getWidth(true) - this.getScrollOffset(); - if(tw != aw){ - var ci = cm.getIndexById(g.autoExpandColumn); - if(ci == -1){ - A.error('The autoExpandColumn does not exist in the column model', g, g.autoExpandColumn); - return false; - } - } - } - } - }] - }); - - cls.push({ - name: 'Ext.chart.Chart', - checks: [{ - name: 'initComponent', - fn: function(){ - if(!this.store){ - A.error('No store specified for chart', this); - } - } - }] - }); - - cls.push({ - name: 'Ext.tree.TreePanel', - checks: [{ - name: 'afterRender', - intercept: true, - fn: function(){ - if(!this.root){ - A.error('No root node specified for tree', this); - return false; - } - } - }] - }); - - cls.push({ - name: 'Ext', - instance: true, - checks: [{ - name: 'extend', - intercept: true, - fn: function(){ - if(arguments.length == 2 && !arguments[0]){ - A.error('Invalid base class passed to extend', arguments[0]); - return false; - } - if(arguments.length == 3){ - if(!arguments[0]){ - A.error('Invalid class to extend', arguments[0]); - return false; - }else if(!arguments[1]){ - A.error('Invalid base class passed to extend', arguments[1]); - return false; - } - } - } - },{ - name: 'override', - intercept: true, - fn: function(c){ - if(!c){ - A.error('Invalid class passed to override', c); - return false; - } - } - }] - }); - - cls.push({ - name: 'Ext.ComponentMgr', - instance: true, - checks: [{ - name: 'register', - intercept: true, - fn: function(c){ - if(this.all.indexOfKey(c.id) > -1){ - A.warn('A component with this id already exists', c, c.id); - } - } - },{ - name: 'create', - intercept: true, - fn: function(config, defaultType){ - var types = Ext.ComponentMgr.types; - if(!config.render){ - if(config.xtype){ - if(!types[config.xtype]){ - A.error('Unknown xtype specified', config, config.xtype); - return false; - } - }else{ - if(!types[defaultType]){ - A.error('Unknown defaultType specified', config, defaultType); - return false; - } - } - } - } - }] - }); - - cls.push({ - name: 'Ext.layout.FitLayout', - checks: [{ - name: 'onLayout', - intercept: true, - fn: function(){ - var ct = this.container; - if(ct.items.getCount() > 1){ - A.warn('More than 1 item in the container. A fit layout will only display a single item.', ct); - } - } - }] - }); - - if(Ext.BLANK_IMAGE_URL == 'http:/' + '/www.extjs.com/s.gif'){ - A.warn('You should set the Ext.BLANK_IMAGE_URL to reference a local copy.'); - } - - A.init(cls); - - -})(); \ No newline at end of file diff --git a/assets/js/ext/src/ext-core/examples/carousel/carousel.js b/assets/js/ext/src/ext-core/examples/carousel/carousel.js deleted file mode 100644 index 6aff8ce..0000000 --- a/assets/js/ext/src/ext-core/examples/carousel/carousel.js +++ /dev/null @@ -1,333 +0,0 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.com/license - */ -Ext.ns('Ext.ux'); - -Ext.ux.Carousel = Ext.extend(Ext.util.Observable, { - interval: 3, - transitionDuration: 1, - transitionType: 'carousel', - transitionEasing: 'easeOut', - itemSelector: 'img', - activeSlide: 0, - autoPlay: false, - showPlayButton: false, - pauseOnNavigate: false, - wrap: false, - freezeOnHover: false, - navigationOnHover: false, - hideNavigation: false, - width: null, - height: null, - - constructor: function(elId, config) { - config = config || {}; - Ext.apply(this, config); - - Ext.ux.Carousel.superclass.constructor.call(this, config); - - this.addEvents( - 'beforeprev', - 'prev', - 'beforenext', - 'next', - 'change', - 'play', - 'pause', - 'freeze', - 'unfreeze' - ); - - this.el = Ext.get(elId); - this.slides = this.els = []; - - if(this.autoPlay || this.showPlayButton) { - this.wrap = true; - }; - - if(this.autoPlay && typeof config.showPlayButton === 'undefined') { - this.showPlayButton = true; - } - - this.initMarkup(); - this.initEvents(); - - if(this.carouselSize > 0) { - this.refresh(); - } - }, - - initMarkup: function() { - var dh = Ext.DomHelper; - - this.carouselSize = 0; - var items = this.el.select(this.itemSelector); - this.els.container = dh.append(this.el, {cls: 'ux-carousel-container'}, true); - this.els.slidesWrap = dh.append(this.els.container, {cls: 'ux-carousel-slides-wrap'}, true); - - this.els.navigation = dh.append(this.els.container, {cls: 'ux-carousel-nav'}, true).hide(); - this.els.caption = dh.append(this.els.navigation, {tag: 'h2', cls: 'ux-carousel-caption'}, true); - this.els.navNext = dh.append(this.els.navigation, {tag: 'a', href: '#', cls: 'ux-carousel-nav-next'}, true); - if(this.showPlayButton) { - this.els.navPlay = dh.append(this.els.navigation, {tag: 'a', href: '#', cls: 'ux-carousel-nav-play'}, true) - } - this.els.navPrev = dh.append(this.els.navigation, {tag: 'a', href: '#', cls: 'ux-carousel-nav-prev'}, true); - - // set the dimensions of the container - this.slideWidth = this.width || this.el.getWidth(true); - this.slideHeight = this.height || this.el.getHeight(true); - this.els.container.setStyle({ - width: this.slideWidth + 'px', - height: this.slideHeight + 'px' - }); - - this.els.caption.setWidth((this.slideWidth - (this.els.navNext.getWidth()*2) - (this.showPlayButton ? this.els.navPlay.getWidth() : 0) - 20) + 'px') - - items.appendTo(this.els.slidesWrap).each(function(item) { - item = item.wrap({cls: 'ux-carousel-slide'}); - this.slides.push(item); - item.setWidth(this.slideWidth + 'px').setHeight(this.slideHeight + 'px'); - }, this); - this.carouselSize = this.slides.length; - if(this.navigationOnHover) { - this.els.navigation.setStyle('top', (-1*this.els.navigation.getHeight()) + 'px'); - } - this.el.clip(); - }, - - initEvents: function() { - this.els.navPrev.on('click', function(ev) { - ev.preventDefault(); - var target = ev.getTarget(); - target.blur(); - if(Ext.fly(target).hasClass('ux-carousel-nav-disabled')) return; - this.prev(); - }, this); - - this.els.navNext.on('click', function(ev) { - ev.preventDefault(); - var target = ev.getTarget(); - target.blur(); - if(Ext.fly(target).hasClass('ux-carousel-nav-disabled')) return; - this.next(); - }, this); - - if(this.showPlayButton) { - this.els.navPlay.on('click', function(ev){ - ev.preventDefault(); - ev.getTarget().blur(); - if(this.playing) { - this.pause(); - } - else { - this.play(); - } - }, this); - }; - - if(this.freezeOnHover) { - this.els.container.on('mouseenter', function(){ - if(this.playing) { - this.fireEvent('freeze', this.slides[this.activeSlide]); - Ext.TaskMgr.stop(this.playTask); - } - }, this); - this.els.container.on('mouseleave', function(){ - if(this.playing) { - this.fireEvent('unfreeze', this.slides[this.activeSlide]); - Ext.TaskMgr.start(this.playTask); - } - }, this, {buffer: (this.interval/2)*1000}); - }; - - if(this.navigationOnHover) { - this.els.container.on('mouseenter', function(){ - if(!this.navigationShown) { - this.navigationShown = true; - this.els.navigation.stopFx(false).shift({ - y: this.els.container.getY(), - duration: this.transitionDuration - }) - } - }, this); - - this.els.container.on('mouseleave', function(){ - if(this.navigationShown) { - this.navigationShown = false; - this.els.navigation.stopFx(false).shift({ - y: this.els.navigation.getHeight() - this.els.container.getY(), - duration: this.transitionDuration - }) - } - }, this); - } - - if(this.interval && this.autoPlay) { - this.play(); - }; - }, - - prev: function() { - if (this.fireEvent('beforeprev') === false) { - return; - } - if(this.pauseOnNavigate) { - this.pause(); - } - this.setSlide(this.activeSlide - 1); - - this.fireEvent('prev', this.activeSlide); - return this; - }, - - next: function() { - if(this.fireEvent('beforenext') === false) { - return; - } - if(this.pauseOnNavigate) { - this.pause(); - } - this.setSlide(this.activeSlide + 1); - - this.fireEvent('next', this.activeSlide); - return this; - }, - - play: function() { - if(!this.playing) { - this.playTask = this.playTask || { - run: function() { - this.playing = true; - this.setSlide(this.activeSlide+1); - }, - interval: this.interval*1000, - scope: this - }; - - this.playTaskBuffer = this.playTaskBuffer || new Ext.util.DelayedTask(function() { - Ext.TaskMgr.start(this.playTask); - }, this); - - this.playTaskBuffer.delay(this.interval*1000); - this.playing = true; - if(this.showPlayButton) { - this.els.navPlay.addClass('ux-carousel-playing'); - } - this.fireEvent('play'); - } - return this; - }, - - pause: function() { - if(this.playing) { - Ext.TaskMgr.stop(this.playTask); - this.playTaskBuffer.cancel(); - this.playing = false; - if(this.showPlayButton) { - this.els.navPlay.removeClass('ux-carousel-playing'); - } - this.fireEvent('pause'); - } - return this; - }, - - clear: function() { - this.els.slidesWrap.update(''); - this.slides = []; - this.carouselSize = 0; - this.pause(); - return this; - }, - - add: function(el, refresh) { - var item = Ext.fly(el).appendTo(this.els.slidesWrap).wrap({cls: 'ux-carousel-slide'}); - item.setWidth(this.slideWidth + 'px').setHeight(this.slideHeight + 'px'); - this.slides.push(item); - if(refresh) { - this.refresh(); - } - return this; - }, - - refresh: function() { - this.carouselSize = this.slides.length; - this.els.slidesWrap.setWidth((this.slideWidth * this.carouselSize) + 'px'); - if(this.carouselSize > 0) { - if(!this.hideNavigation) this.els.navigation.show(); - this.activeSlide = 0; - this.setSlide(0, true); - } - return this; - }, - - setSlide: function(index, initial) { - if(!this.wrap && !this.slides[index]) { - return; - } - else if(this.wrap) { - if(index < 0) { - index = this.carouselSize-1; - } - else if(index > this.carouselSize-1) { - index = 0; - } - } - if(!this.slides[index]) { - return; - } - - this.els.caption.update(this.slides[index].child(':first-child', true).title || ''); - var offset = index * this.slideWidth; - if (!initial) { - switch (this.transitionType) { - case 'fade': - this.slides[index].setOpacity(0); - this.slides[this.activeSlide].stopFx(false).fadeOut({ - duration: this.transitionDuration / 2, - callback: function(){ - this.els.slidesWrap.setStyle('left', (-1 * offset) + 'px'); - this.slides[this.activeSlide].setOpacity(1); - this.slides[index].fadeIn({ - duration: this.transitionDuration / 2 - }); - }, - scope: this - }) - break; - - default: - var xNew = (-1 * offset) + this.els.container.getX(); - this.els.slidesWrap.stopFx(false); - this.els.slidesWrap.shift({ - duration: this.transitionDuration, - x: xNew, - easing: this.transitionEasing - }); - break; - } - } - else { - this.els.slidesWrap.setStyle('left', '0'); - } - - this.activeSlide = index; - this.updateNav(); - this.fireEvent('change', this.slides[index], index); - }, - - updateNav: function() { - this.els.navPrev.removeClass('ux-carousel-nav-disabled'); - this.els.navNext.removeClass('ux-carousel-nav-disabled'); - if(!this.wrap) { - if(this.activeSlide === 0) { - this.els.navPrev.addClass('ux-carousel-nav-disabled'); - } - if(this.activeSlide === this.carouselSize-1) { - this.els.navNext.addClass('ux-carousel-nav-disabled'); - } - } - } -}); \ No newline at end of file diff --git a/assets/js/ext/src/ext-core/examples/jsonp/jsonp.js b/assets/js/ext/src/ext-core/examples/jsonp/jsonp.js deleted file mode 100644 index 175ae40..0000000 --- a/assets/js/ext/src/ext-core/examples/jsonp/jsonp.js +++ /dev/null @@ -1,78 +0,0 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.com/license - */ -Ext.ns('Ext.ux'); - -Ext.ux.JSONP = (function(){ - var _queue = [], - _current = null, - _nextRequest = function() { - _current = null; - if(_queue.length) { - _current = _queue.shift(); - _current.script.src = _current.url + '?' + _current.params; - document.getElementsByTagName('head')[0].appendChild(_current.script); - } - }; - - return { - request: function(url, o) { - if(!url) { - return; - } - var me = this; - - o.params = o.params || {}; - if(o.callbackKey) { - o.params[o.callbackKey] = 'Ext.ux.JSONP.callback'; - } - var params = Ext.urlEncode(o.params); - - var script = document.createElement('script'); - script.type = 'text/javascript'; - - if(o.isRawJSON) { - if(Ext.isIE) { - Ext.fly(script).on('readystatechange', function() { - if(script.readyState == 'complete') { - var data = script.innerHTML; - if(data.length) { - me.callback(Ext.decode(data)); - } - } - }); - } - else { - Ext.fly(script).on('load', function() { - var data = script.innerHTML; - if(data.length) { - me.callback(Ext.decode(data)); - } - }); - } - } - - _queue.push({ - url: url, - script: script, - callback: o.callback || function(){}, - scope: o.scope || window, - params: params || null - }); - - if(!_current) { - _nextRequest(); - } - }, - - callback: function(json) { - _current.callback.apply(_current.scope, [json]); - Ext.fly(_current.script).removeAllListeners(); - document.getElementsByTagName('head')[0].removeChild(_current.script); - _nextRequest(); - } - } -})(); \ No newline at end of file diff --git a/assets/js/ext/src/ext-core/examples/lightbox/lightbox.js b/assets/js/ext/src/ext-core/examples/lightbox/lightbox.js deleted file mode 100644 index 951846f..0000000 --- a/assets/js/ext/src/ext-core/examples/lightbox/lightbox.js +++ /dev/null @@ -1,366 +0,0 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.com/license - */ -Ext.ns('Ext.ux'); - -Ext.ux.Lightbox = (function(){ - var els = {}, - images = [], - activeImage, - initialized = false, - selectors = []; - - return { - overlayOpacity: 0.85, - animate: true, - resizeSpeed: 8, - borderSize: 10, - labelImage: "Image", - labelOf: "of", - - init: function() { - this.resizeDuration = this.animate ? ((11 - this.resizeSpeed) * 0.15) : 0; - this.overlayDuration = this.animate ? 0.2 : 0; - - if(!initialized) { - Ext.apply(this, Ext.util.Observable.prototype); - Ext.util.Observable.constructor.call(this); - this.addEvents('open', 'close'); - this.initMarkup(); - this.initEvents(); - initialized = true; - } - }, - - initMarkup: function() { - els.shim = Ext.DomHelper.append(document.body, { - tag: 'iframe', - id: 'ux-lightbox-shim' - }, true); - els.overlay = Ext.DomHelper.append(document.body, { - id: 'ux-lightbox-overlay' - }, true); - - var lightboxTpl = new Ext.Template(this.getTemplate()); - els.lightbox = lightboxTpl.append(document.body, {}, true); - - var ids = - ['outerImageContainer', 'imageContainer', 'image', 'hoverNav', 'navPrev', 'navNext', 'loading', 'loadingLink', - 'outerDataContainer', 'dataContainer', 'data', 'details', 'caption', 'imageNumber', 'bottomNav', 'navClose']; - - Ext.each(ids, function(id){ - els[id] = Ext.get('ux-lightbox-' + id); - }); - - Ext.each([els.overlay, els.lightbox, els.shim], function(el){ - el.setVisibilityMode(Ext.Element.DISPLAY) - el.hide(); - }); - - var size = (this.animate ? 250 : 1) + 'px'; - els.outerImageContainer.setStyle({ - width: size, - height: size - }); - }, - - getTemplate : function() { - return [ - '
    ', - '
    ', - '
    ', - '', - '
    ', - '', - '', - '
    ', - '
    ', - '', - '
    ', - '
    ', - '
    ', - '
    ', - '
    ', - '
    ', - '
    ', - '', - '', - '
    ', - '
    ', - '', - '
    ', - '
    ', - '
    ', - '
    ', - '
    ' - ]; - }, - - initEvents: function() { - var close = function(ev) { - ev.preventDefault(); - this.close(); - }; - - els.overlay.on('click', close, this); - els.loadingLink.on('click', close, this); - els.navClose.on('click', close, this); - - els.lightbox.on('click', function(ev) { - if(ev.getTarget().id == 'ux-lightbox') { - this.close(); - } - }, this); - - els.navPrev.on('click', function(ev) { - ev.preventDefault(); - this.setImage(activeImage - 1); - }, this); - - els.navNext.on('click', function(ev) { - ev.preventDefault(); - this.setImage(activeImage + 1); - }, this); - }, - - register: function(sel, group) { - if(selectors.indexOf(sel) === -1) { - selectors.push(sel); - - Ext.fly(document).on('click', function(ev){ - var target = ev.getTarget(sel); - - if (target) { - ev.preventDefault(); - this.open(target, sel, group); - } - }, this); - } - }, - - open: function(image, sel, group) { - group = group || false; - this.setViewSize(); - els.overlay.fadeIn({ - duration: this.overlayDuration, - endOpacity: this.overlayOpacity, - callback: function() { - images = []; - - var index = 0; - if(!group) { - images.push([image.href, image.title]); - } - else { - var setItems = Ext.query(sel); - Ext.each(setItems, function(item) { - if(item.href) { - images.push([item.href, item.title]); - } - }); - - while (images[index][0] != image.href) { - index++; - } - } - - // calculate top and left offset for the lightbox - var pageScroll = Ext.fly(document).getScroll(); - - var lightboxTop = pageScroll.top + (Ext.lib.Dom.getViewportHeight() / 10); - var lightboxLeft = pageScroll.left; - els.lightbox.setStyle({ - top: lightboxTop + 'px', - left: lightboxLeft + 'px' - }).show(); - - this.setImage(index); - - this.fireEvent('open', images[index]); - }, - scope: this - }); - }, - - setViewSize: function(){ - var viewSize = this.getViewSize(); - els.overlay.setStyle({ - width: viewSize[0] + 'px', - height: viewSize[1] + 'px' - }); - els.shim.setStyle({ - width: viewSize[0] + 'px', - height: viewSize[1] + 'px' - }).show(); - }, - - setImage: function(index){ - activeImage = index; - - this.disableKeyNav(); - if (this.animate) { - els.loading.show(); - } - - els.image.hide(); - els.hoverNav.hide(); - els.navPrev.hide(); - els.navNext.hide(); - els.dataContainer.setOpacity(0.0001); - els.imageNumber.hide(); - - var preload = new Image(); - preload.onload = (function(){ - els.image.dom.src = images[activeImage][0]; - this.resizeImage(preload.width, preload.height); - }).createDelegate(this); - preload.src = images[activeImage][0]; - }, - - resizeImage: function(w, h){ - var wCur = els.outerImageContainer.getWidth(); - var hCur = els.outerImageContainer.getHeight(); - - var wNew = (w + this.borderSize * 2); - var hNew = (h + this.borderSize * 2); - - var wDiff = wCur - wNew; - var hDiff = hCur - hNew; - - var afterResize = function(){ - els.hoverNav.setWidth(els.imageContainer.getWidth() + 'px'); - - els.navPrev.setHeight(h + 'px'); - els.navNext.setHeight(h + 'px'); - - els.outerDataContainer.setWidth(wNew + 'px'); - - this.showImage(); - }; - - if (hDiff != 0 || wDiff != 0) { - els.outerImageContainer.shift({ - height: hNew, - width: wNew, - duration: this.resizeDuration, - scope: this, - callback: afterResize, - delay: 50 - }); - } - else { - afterResize.call(this); - } - }, - - showImage: function(){ - els.loading.hide(); - els.image.fadeIn({ - duration: this.resizeDuration, - scope: this, - callback: function(){ - this.updateDetails(); - } - }); - this.preloadImages(); - }, - - updateDetails: function(){ - var detailsWidth = els.data.getWidth(true) - els.navClose.getWidth() - 10; - els.details.setWidth((detailsWidth > 0 ? detailsWidth : 0) + 'px'); - - els.caption.update(images[activeImage][1]); - - els.caption.show(); - if (images.length > 1) { - els.imageNumber.update(this.labelImage + ' ' + (activeImage + 1) + ' ' + this.labelOf + ' ' + images.length); - els.imageNumber.show(); - } - - els.dataContainer.fadeIn({ - duration: this.resizeDuration/2, - scope: this, - callback: function() { - var viewSize = this.getViewSize(); - els.overlay.setHeight(viewSize[1] + 'px'); - this.updateNav(); - } - }); - }, - - updateNav: function(){ - this.enableKeyNav(); - - els.hoverNav.show(); - - // if not first image in set, display prev image button - if (activeImage > 0) - els.navPrev.show(); - - // if not last image in set, display next image button - if (activeImage < (images.length - 1)) - els.navNext.show(); - }, - - enableKeyNav: function() { - Ext.fly(document).on('keydown', this.keyNavAction, this); - }, - - disableKeyNav: function() { - Ext.fly(document).un('keydown', this.keyNavAction, this); - }, - - keyNavAction: function(ev) { - var keyCode = ev.getKey(); - - if ( - keyCode == 88 || // x - keyCode == 67 || // c - keyCode == 27 - ) { - this.close(); - } - else if (keyCode == 80 || keyCode == 37){ // display previous image - if (activeImage != 0){ - this.setImage(activeImage - 1); - } - } - else if (keyCode == 78 || keyCode == 39){ // display next image - if (activeImage != (images.length - 1)){ - this.setImage(activeImage + 1); - } - } - }, - - preloadImages: function(){ - var next, prev; - if (images.length > activeImage + 1) { - next = new Image(); - next.src = images[activeImage + 1][0]; - } - if (activeImage > 0) { - prev = new Image(); - prev.src = images[activeImage - 1][0]; - } - }, - - close: function(){ - this.disableKeyNav(); - els.lightbox.hide(); - els.overlay.fadeOut({ - duration: this.overlayDuration - }); - els.shim.hide(); - this.fireEvent('close', activeImage); - }, - - getViewSize: function() { - return [Ext.lib.Dom.getViewWidth(), Ext.lib.Dom.getViewHeight()]; - } - } -})(); - -Ext.onReady(Ext.ux.Lightbox.init, Ext.ux.Lightbox); \ No newline at end of file diff --git a/assets/js/ext/src/ext-core/examples/menu/menu.js b/assets/js/ext/src/ext-core/examples/menu/menu.js deleted file mode 100644 index ec0528c..0000000 --- a/assets/js/ext/src/ext-core/examples/menu/menu.js +++ /dev/null @@ -1,258 +0,0 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.com/license - */ -/* - * Ext Core Library Examples 3.0 Beta - * http://extjs.com/ - * Copyright(c) 2006-2009, Ext JS, LLC. - * - * The MIT License - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - * - */ - -Ext.ns('Ext.ux'); - -Ext.ux.Menu = Ext.extend(Ext.util.Observable, { - direction: 'horizontal', - delay: 0.2, - autoWidth: true, - transitionType: 'fade', - transitionDuration: 0.3, - animate: true, - currentClass: 'current', - - constructor: function(elId, config) { - config = config || {}; - Ext.apply(this, config); - - Ext.ux.Menu.superclass.constructor.call(this, config); - - this.addEvents( - 'show', - 'hide', - 'click' - ); - - this.el = Ext.get(elId); - - this.initMarkup(); - this.initEvents(); - - this.setCurrent(); - }, - - initMarkup: function(){ - this.container = this.el.wrap({cls: 'ux-menu-container', style: 'z-index: ' + --Ext.ux.Menu.zSeed}); - this.items = this.el.select('li'); - - this.el.addClass('ux-menu ux-menu-' + this.direction); - this.el.select('>li').addClass('ux-menu-item-main'); - - this.el.select('li:has(>ul)').addClass('ux-menu-item-parent').each(function(item) { - item.down('a') - .addClass('ux-menu-link-parent') - .createChild({tag: 'span', cls: 'ux-menu-arrow'}); - }); - - this.el.select('li:first-child>a').addClass('ux-menu-link-first'); - this.el.select('li:last-child>a').addClass('ux-menu-link-last'); - - // create clear fixes for the floating stuff - this.container.addClass('ux-menu-clearfix'); - - // if autoWidth make every submenu as wide as its biggest child; - if(this.autoWidth) { - this.doAutoWidth(); - } - - var subs = this.el.select('ul'); - subs.addClass('ux-menu-sub'); - - //ie6 and ie7/ie8 quirksmode need iframes behind the submenus - if(Ext.isBorderBox || Ext.isIE7) { - subs.each(function(item) { - item.parent().createChild({tag: 'iframe', cls: 'ux-menu-ie-iframe'}) - .setWidth(item.getWidth()) - .setHeight(item.getHeight()); - }); - } - - subs.addClass('ux-menu-hidden'); - }, - - initEvents: function() { - this.showTask = new Ext.util.DelayedTask(this.showMenu, this); - this.hideTask = new Ext.util.DelayedTask(function() { - this.showTask.cancel(); - this.hideAll(); - this.fireEvent('hide'); - }, this); - - this.el.hover(function() { - this.hideTask.cancel(); - }, function() { - this.hideTask.delay(this.delay*1000); - }, this); - - // for each item that has a submenu, create a mouseenter function that shows its submenu - // delay 5 to make sure enter is fired after mouseover - this.el.select('li.ux-menu-item-parent').on('mouseenter', this.onParentEnter, false, {me: this, delay: 5}); - - // listen for mouseover events on items to hide other items submenus and remove hovers - this.el.on('mouseover', function(ev, t) { - this.manageSiblings(t); - // if this item does not have a submenu, the showMenu task for a sibling could potentially still be fired, so cancel it - if(!Ext.fly(t).hasClass('ux-menu-item-parent')) { - this.showTask.cancel(); - } - }, this, {delegate: 'li'}); - - this.el.on('click', function(ev, t) { - return this.fireEvent('click', ev, t, this); - }, this, {delegate: 'a'}) - }, - - onParentEnter: function(ev, link, o) { - var item = Ext.get(this), - me = o.me; - - // if this item is in a submenu and contains a submenu, check if the submenu is not still animating - if(!item.hasClass('ux-menu-item-main') && item.parent('ul').hasActiveFx()) { - item.parent('ul').stopFx(true); - } - - // if submenu is already shown dont do anything - if(!item.child('ul').hasClass('ux-menu-hidden')) { - return; - } - - me.showTask.delay(me.delay*1000, false, false, [item]); - }, - - showMenu : function(item) { - var menu = item.child('ul'), - x = y = 0; - - item.select('>a').addClass('ux-menu-link-hover'); - - // some different configurations require different positioning - if(this.direction == 'horizontal' && item.hasClass('ux-menu-item-main')) { - y = item.getHeight()+1; - } - else { - x = item.getWidth()+1; - } - - // if its ie, force a repaint of the submenu - if(Ext.isIE) { - menu.select('ul').addClass('ux-menu-hidden'); - // ie bugs... - if(Ext.isBorderBox || Ext.isIE7) { - item.down('iframe').setStyle({left: x + 'px', top: y + 'px', display: 'block'}); - } - } - - menu.setStyle({left: x + 'px', top: y + 'px'}).removeClass('ux-menu-hidden'); - - if(this.animate) { - switch(this.transitionType) { - case 'slide': - if(this.direction == 'horizontal' && item.hasClass('ux-menu-item-main')) { - menu.slideIn('t', { - duration: this.transitionDuration - }); - } - else { - menu.slideIn('l', { - duration: this.transitionDuration - }); - } - break; - - default: - menu.setOpacity(0.001).fadeIn({ - duration: this.transitionDuration - }); - break - } - } - - this.fireEvent('show', item, menu, this); - }, - - manageSiblings: function(item) { - var item = Ext.get(item); - item.parent().select('li.ux-menu-item-parent').each(function(child) { - if(child.dom.id !== item.dom.id) { - child.select('>a').removeClass('ux-menu-link-hover'); - child.select('ul').stopFx(false).addClass('ux-menu-hidden'); - if (Ext.isBorderBox || Ext.isIE7) { - child.select('iframe').setStyle('display', 'none'); - } - } - }); - }, - - hideAll: function() { - this.manageSiblings(this.el); - }, - - setCurrent: function() { - var els = this.el.query('.' + this.currentClass); - if(!els.length) { - return; - } - var item = Ext.get(els[els.length-1]).removeClass(this.currentClass).findParent('li', null, true); - while(item && item.parent('.ux-menu')) { - item.down('a').addClass(this.currentClass); - item = item.parent('li'); - } - }, - - doAutoWidth: function() { - var fixWidth = function(sub) { - var widest = 0; - var items = sub.select('>li'); - - sub.setStyle({width: 3000 + 'px'}); - items.each(function(item) { - widest = Math.max(widest, item.getWidth()); - }); - - widest = Ext.isIE ? widest + 1 : widest; - items.setWidth(widest + 'px'); - sub.setWidth(widest + 'px'); - } - - if(this.direction == 'vertical') { - this.container.select('ul').each(fixWidth); - } - else { - this.el.select('ul').each(fixWidth); - } - - } -}); - -Ext.ux.Menu.zSeed = 10000; \ No newline at end of file diff --git a/assets/js/ext/src/ext-core/examples/rating/rating.js b/assets/js/ext/src/ext-core/examples/rating/rating.js deleted file mode 100644 index ed1efac..0000000 --- a/assets/js/ext/src/ext-core/examples/rating/rating.js +++ /dev/null @@ -1,267 +0,0 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.com/license - */ -Ext.ns('Ext.ux'); - -Ext.ux.Rating = Ext.extend(Ext.util.Observable, { - // Configuration options - starWidth: 16, - split: 1, - resetValue: '', - defaultSelected: -1, - selected: -1, - showTitles: true, - - // Our class constructor - constructor : function(element, config) { - Ext.apply(this, config); - Ext.ux.Rating.superclass.constructor.call(this); - - this.addEvents( - 'change', - 'reset' - ); - - this.el = Ext.get(element); - this.init(); - }, - - init : function() { - var me = this; - - // Some arrays we are going to store data in - this.values = []; - this.titles = []; - this.stars = []; - - // We create a container to put all our stars into - this.container = this.el.createChild({ - cls: 'ux-rating-container ux-rating-clearfix' - }); - - if(this.canReset) { - this.resetEl = this.container.createChild({ - cls: 'ux-rating-reset', - cn: [{ - tag: 'a', - title: this.showTitles ? (this.resetTitle || 'Reset your vote') : '', - html: 'Reset' - }] - }); - this.resetEl.visibilityMode = Ext.Element.DISPLAY; - - this.resetEl.hover(function() { - Ext.fly(this).addClass('ux-rating-reset-hover'); - }, function() { - Ext.fly(this).removeClass('ux-rating-reset-hover'); - }); - - this.resetEl.on('click', this.reset, this); - } - - // We use DomQuery to select the radio buttons - this.radioBoxes = this.el.select('input[type=radio]'); - // Then we can loop over the CompositeElement using each - this.radioBoxes.each(this.initStar, this); - - // We use DomHelper to create our hidden input - this.input = this.container.createChild({ - tag: 'input', - type: 'hidden', - name: this.name, - value: this.values[this.defaultSelected] || this.resetValue - }); - - // Lets remove all the radio buttons from the DOM - this.radioBoxes.remove(); - - this.select(this.defaultSelected === undefined ? false : this.defaultSelected) - - if(this.disabled) { - this.disable(); - } else { - // Enable will set up our event listeners - this.enable(); - } - }, - - initStar : function(item, all, i) { - var sw = Math.floor(this.starWidth / this.split); - - // We use the name and disabled attributes of the first radio button - if(i == 0) { - this.name = item.dom.name; - this.disabled = item.dom.disabled; - } - - // Saving the value and title for this star - this.values[i] = item.dom.value; - this.titles[i] = item.dom.title; - - if(item.dom.checked) { - this.defaultSelected = i; - } - - // Now actually create the star! - var star = this.container.createChild({ - cls: 'ux-rating-star' - }); - - var starLink = star.createChild({ - tag: 'a', - html: this.values[i], - title: this.showTitles ? this.titles[i] : '' - }); - - // Prepare division settings - if(this.split) { - var odd = (i % this.split); - star.setWidth(sw); - starLink.setStyle('margin-left', '-' + (odd * sw) + 'px'); - } - - // Save the reference to this star so we can easily access it later - this.stars.push(star.dom); - }, - - onStarClick : function(ev, t) { - if(!this.disabled) { - this.select(this.stars.indexOf(t)); - } - }, - - onStarOver : function(ev, t) { - if(!this.disabled) { - this.fillTo(this.stars.indexOf(t), true); - } - }, - - onStarOut : function(ev, t) { - if(!this.disabled) { - this.fillTo(this.selected, false); - } - }, - - reset : function(ev, t) { - this.select(-1); - }, - - select : function(index) { - if(index === false || index === -1) { - // remove current selection in el - this.value = this.resetValue; - this.title = ""; - this.input.dom.value = ''; - - if(this.canReset) { - this.resetEl.setOpacity(0.5); - } - - this.fillNone(); - - if(this.selected !== -1) { - this.fireEvent('change', this, this.values[index], this.stars[index]); - } - this.selected = -1; - } - else if(index !== this.selected) { - // Update some properties - this.selected = index; - this.value = this.values[index]; - this.title = this.titles[index]; - - // Set the value of our hidden input so the rating can be submitted - this.input.dom.value = this.value; - - if(this.canReset) { - this.resetEl.setOpacity(0.99); - } - - // the fillTo() method will fill the stars up until the selected one - this.fillTo(index, false); - - // Lets also not forget to fire our custom event! - this.fireEvent('change', this, this.values[index], this.stars[index]); - } - }, - - fillTo : function(index, hover) { - if (index != -1) { - var addClass = hover ? 'ux-rating-star-hover' : 'ux-rating-star-on'; - var removeClass = hover ? 'ux-rating-star-on' : 'ux-rating-star-hover'; - - // We add a css class to each star up until the selected one - Ext.each(this.stars.slice(0, index+1), function() { - Ext.fly(this).removeClass(removeClass).addClass(addClass); - }); - - // And then remove the same class from all the stars after this one - Ext.each(this.stars.slice(index+1), function() { - Ext.fly(this).removeClass([removeClass, addClass]); - }); - } - else { - this.fillNone(); - } - }, - - fillNone : function() { - this.container.select('.ux-rating-star').removeClass(['ux-rating-star-hover', 'ux-rating-star-on']); - }, - - enable : function() { - if(this.canReset) { - this.resetEl.show(); - } - - this.input.dom.disabled = null; - this.disabled = false; - - this.container.removeClass('ux-rating-disabled'); - - // We will be using the technique of event delegation by listening - // for bubbled up events on the container - this.container.on({ - click: this.onStarClick, - mouseover: this.onStarOver, - mouseout: this.onStarOut, - scope: this, - delegate: 'div.ux-rating-star' - }); - }, - - disable : function() { - if(this.canReset) { - this.resetEl.hide(); - } - - this.input.dom.disabled = true; - this.disabled = true; - - this.container.addClass('ux-rating-disabled'); - - this.container.un({ - click: this.onStarClick, - mouseover: this.onStarOver, - mouseout: this.onStarOut, - scope: this, - delegate: 'div.ux-rating-star' - }); - }, - - getValue : function() { - return this.values[this.selected] || this.resetValue; - }, - - destroy : function() { - this.disable(); - this.container.remove(); - this.radioBoxes.appendTo(this.el); - if(this.selected !== -1) { - this.radioBoxes.elements[this.selected].checked = true; - } - } -}); diff --git a/assets/js/ext/src/ext-core/examples/tabs/tabs.js b/assets/js/ext/src/ext-core/examples/tabs/tabs.js deleted file mode 100644 index 6b8a042..0000000 --- a/assets/js/ext/src/ext-core/examples/tabs/tabs.js +++ /dev/null @@ -1,79 +0,0 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.com/license - */ -Ext.ns('Ext.ux'); - -Ext.ux.Tabs = Ext.extend(Ext.util.Observable, { - // Configuration options - activeTab: 0, - - // Our class constructor - constructor : function(element, config) { - Ext.apply(this, config); - Ext.ux.Tabs.superclass.constructor.call(this); - - this.addEvents( - 'beforetabchange', - 'tabchange' - ); - - this.el = Ext.get(element); - this.init(); - }, - - init : function() { - var me = this; - - this.el.addClass('ux-tabs-container'); - - this.tabStrip = this.el.child('ul'); - this.tabStrip.addClass('ux-tabs-strip'); - - this.tabStrip.on('click', this.onStripClick, this, {delegate: 'a'}); - - this.tabs = this.tabStrip.select('> li'); - this.cards = this.el.select('> div'); - - this.cardsContainer = this.el.createChild({ - cls: 'ux-tabs-cards' - }); - this.cardsContainer.setWidth(this.el.getWidth()); - - this.cards.addClass('ux-tabs-card'); - this.cards.appendTo(this.cardsContainer); - - this.el.createChild({ - cls: 'ux-tabs-clearfix' - }); - - this.setActiveTab(this.activeTab || 0); - }, - - onStripClick : function(ev, t) { - if(t && t.href && t.href.indexOf('#')) { - ev.preventDefault(); - this.setActiveTab(t.href.split('#')[1]); - } - }, - - setActiveTab : function(tab) { - var card; - if(Ext.isString(tab)) { - card = Ext.get(tab); - tab = this.tabStrip.child('a[href=#' + tab + ']').parent(); - } - else if (Ext.isNumber(tab)) { - tab = this.tabs.item(tab); - card = Ext.get(tab.first().dom.href.split('#')[1]); - } - - if(tab && card && this.fireEvent('beforetabchange', tab, card) !== false) { - card.radioClass('ux-tabs-card-active'); - tab.radioClass('ux-tabs-tab-active'); - this.fireEvent('tabchange', tab, card); - } - } -}); \ No newline at end of file diff --git a/assets/js/ext/src/ext-core/src/adapter/ext-base-ajax.js b/assets/js/ext/src/ext-core/src/adapter/ext-base-ajax.js deleted file mode 100644 index 0c4812f..0000000 --- a/assets/js/ext/src/ext-core/src/adapter/ext-base-ajax.js +++ /dev/null @@ -1,371 +0,0 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.com/license - */ -/* -* 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 -*/ -Ext.lib.Ajax = function() { - var activeX = ['Msxml2.XMLHTTP.6.0', - 'Msxml2.XMLHTTP.3.0', - 'Msxml2.XMLHTTP'], - CONTENTTYPE = 'Content-Type'; - - // private - function setHeader(o) { - var conn = o.conn, - prop, - headers = {}; - - function setTheHeaders(conn, headers){ - for (prop in headers) { - if (headers.hasOwnProperty(prop)) { - conn.setRequestHeader(prop, headers[prop]); - } - } - } - - Ext.apply(headers, pub.headers, pub.defaultHeaders); - setTheHeaders(conn, headers); - delete pub.headers; - } - - // private - function createExceptionObject(tId, callbackArg, isAbort, isTimeout) { - return { - tId : tId, - status : isAbort ? -1 : 0, - statusText : isAbort ? 'transaction aborted' : 'communication failure', - isAbort: isAbort, - isTimeout: isTimeout, - argument : callbackArg - }; - } - - // private - function initHeader(label, value) { - (pub.headers = pub.headers || {})[label] = value; - } - - // private - function createResponseObject(o, callbackArg) { - var headerObj = {}, - headerStr, - conn = o.conn, - t, - s, - // see: https://prototype.lighthouseapp.com/projects/8886/tickets/129-ie-mangles-http-response-status-code-204-to-1223 - isBrokenStatus = conn.status == 1223; - - try { - headerStr = o.conn.getAllResponseHeaders(); - Ext.each(headerStr.replace(/\r\n/g, '\n').split('\n'), function(v){ - t = v.indexOf(':'); - if(t >= 0){ - s = v.substr(0, t).toLowerCase(); - if(v.charAt(t + 1) == ' '){ - ++t; - } - headerObj[s] = v.substr(t + 1); - } - }); - } catch(e) {} - - return { - tId : o.tId, - // Normalize the status and statusText when IE returns 1223, see the above link. - status : isBrokenStatus ? 204 : conn.status, - statusText : isBrokenStatus ? 'No Content' : conn.statusText, - getResponseHeader : function(header){return headerObj[header.toLowerCase()];}, - getAllResponseHeaders : function(){return headerStr;}, - responseText : conn.responseText, - responseXML : conn.responseXML, - argument : callbackArg - }; - } - - // private - function releaseObject(o) { - if (o.tId) { - pub.conn[o.tId] = null; - } - o.conn = null; - o = null; - } - - // private - function handleTransactionResponse(o, callback, isAbort, isTimeout) { - if (!callback) { - 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) || (Ext.isIE && httpStatus == 1223)) { - responseObject = 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 = createExceptionObject(o.tId, callback.argument, (isAbort ? isAbort : false), isTimeout); - if (callback.failure) { - if (!callback.scope) { - callback.failure(responseObject); - } - else { - callback.failure.apply(callback.scope, [responseObject]); - } - } - break; - default: - responseObject = createResponseObject(o, callback.argument); - if (callback.failure) { - if (!callback.scope) { - callback.failure(responseObject); - } - else { - callback.failure.apply(callback.scope, [responseObject]); - } - } - } - } - - releaseObject(o); - responseObject = null; - } - - function checkResponse(o, callback, conn, tId, poll, cbTimeout){ - if (conn && conn.readyState == 4) { - clearInterval(poll[tId]); - poll[tId] = null; - - if (cbTimeout) { - clearTimeout(pub.timeout[tId]); - pub.timeout[tId] = null; - } - handleTransactionResponse(o, callback); - } - } - - function checkTimeout(o, callback){ - pub.abort(o, callback, true); - } - - - // private - function handleReadyState(o, callback){ - callback = callback || {}; - var conn = o.conn, - tId = o.tId, - poll = pub.poll, - cbTimeout = callback.timeout || null; - - if (cbTimeout) { - pub.conn[tId] = conn; - pub.timeout[tId] = setTimeout(checkTimeout.createCallback(o, callback), cbTimeout); - } - poll[tId] = setInterval(checkResponse.createCallback(o, callback, conn, tId, poll, cbTimeout), pub.pollInterval); - } - - // private - function asyncRequest(method, uri, callback, postData) { - var o = getConnectionObject() || null; - - if (o) { - o.conn.open(method, uri, true); - - if (pub.useDefaultXhrHeader) { - initHeader('X-Requested-With', pub.defaultXhrHeader); - } - - if(postData && pub.useDefaultHeader && (!pub.headers || !pub.headers[CONTENTTYPE])){ - initHeader(CONTENTTYPE, pub.defaultPostHeader); - } - - if (pub.defaultHeaders || pub.headers) { - setHeader(o); - } - - handleReadyState(o, callback); - o.conn.send(postData || null); - } - return o; - } - - // private - function getConnectionObject() { - var o; - - try { - if (o = createXhrObject(pub.transactionId)) { - pub.transactionId++; - } - } catch(e) { - } finally { - return o; - } - } - - // private - function createXhrObject(transactionId) { - var http; - - try { - http = new XMLHttpRequest(); - } catch(e) { - for (var i = 0; i < activeX.length; ++i) { - try { - http = new ActiveXObject(activeX[i]); - break; - } catch(e) {} - } - } finally { - return {conn : http, tId : transactionId}; - } - } - - var pub = { - request : function(method, uri, cb, data, options) { - if(options){ - var me = this, - xmlData = options.xmlData, - jsonData = options.jsonData, - hs; - - Ext.applyIf(me, options); - - if(xmlData || jsonData){ - hs = me.headers; - if(!hs || !hs[CONTENTTYPE]){ - initHeader(CONTENTTYPE, xmlData ? 'text/xml' : 'application/json'); - } - data = xmlData || (!Ext.isPrimitive(jsonData) ? Ext.encode(jsonData) : jsonData); - } - } - return asyncRequest(method || options.method || "POST", uri, cb, data); - }, - - serializeForm : function(form) { - var fElements = form.elements || (document.forms[form] || Ext.getDom(form)).elements, - hasSubmit = false, - encoder = encodeURIComponent, - name, - data = '', - type, - hasValue; - - Ext.each(fElements, function(element){ - name = element.name; - type = element.type; - - if (!element.disabled && name) { - if (/select-(one|multiple)/i.test(type)) { - Ext.each(element.options, function(opt){ - if (opt.selected) { - hasValue = opt.hasAttribute ? opt.hasAttribute('value') : opt.getAttributeNode('value').specified; - data += String.format("{0}={1}&", encoder(name), encoder(hasValue ? opt.value : opt.text)); - } - }); - } else if (!(/file|undefined|reset|button/i.test(type))) { - if (!(/radio|checkbox/i.test(type) && !element.checked) && !(type == 'submit' && hasSubmit)) { - data += encoder(name) + '=' + encoder(element.value) + '&'; - hasSubmit = /submit/i.test(type); - } - } - } - }); - return data.substr(0, data.length - 1); - }, - - useDefaultHeader : true, - defaultPostHeader : 'application/x-www-form-urlencoded; charset=UTF-8', - useDefaultXhrHeader : true, - defaultXhrHeader : 'XMLHttpRequest', - poll : {}, - timeout : {}, - conn: {}, - pollInterval : 50, - transactionId : 0, - -// This is never called - Is it worth exposing this? -// setProgId : function(id) { -// activeX.unshift(id); -// }, - -// This is never called - Is it worth exposing this? -// setDefaultPostHeader : function(b) { -// this.useDefaultHeader = b; -// }, - -// This is never called - Is it worth exposing this? -// setDefaultXhrHeader : function(b) { -// this.useDefaultXhrHeader = b; -// }, - -// This is never called - Is it worth exposing this? -// setPollingInterval : function(i) { -// if (typeof i == 'number' && isFinite(i)) { -// this.pollInterval = i; -// } -// }, - -// This is never called - Is it worth exposing this? -// resetDefaultHeaders : function() { -// this.defaultHeaders = null; -// }, - - abort : function(o, callback, isTimeout) { - var me = this, - tId = o.tId, - isAbort = false; - - if (me.isCallInProgress(o)) { - o.conn.abort(); - clearInterval(me.poll[tId]); - me.poll[tId] = null; - clearTimeout(pub.timeout[tId]); - me.timeout[tId] = null; - - handleTransactionResponse(o, callback, (isAbort = true), isTimeout); - } - return isAbort; - }, - - isCallInProgress : function(o) { - // if there is a connection and readyState is not 0 or 4 - return o.conn && !{0:true,4:true}[o.conn.readyState]; - } - }; - return pub; -}(); \ No newline at end of file diff --git a/assets/js/ext/src/ext-core/src/adapter/ext-base-anim-extra.js b/assets/js/ext/src/ext-core/src/adapter/ext-base-anim-extra.js deleted file mode 100644 index 0fa28ae..0000000 --- a/assets/js/ext/src/ext-core/src/adapter/ext-base-anim-extra.js +++ /dev/null @@ -1,305 +0,0 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.com/license - */ -// Easing functions -(function(){ - // shortcuts to aid compression - var abs = Math.abs, - pi = Math.PI, - asin = Math.asin, - pow = Math.pow, - sin = Math.sin, - EXTLIB = Ext.lib; - - Ext.apply(EXTLIB.Easing, { - - easeBoth: function (t, b, c, d) { - return ((t /= d / 2) < 1) ? c / 2 * t * t + b : -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) { - return ((t /= d / 2) < 1) ? c / 2 * t * t * t * t + b : -c / 2 * ((t -= 2) * t * t * t - 2) + b; - }, - - elasticIn: function (t, b, c, d, a, p) { - if (t == 0 || (t /= d) == 1) { - return t == 0 ? b : b + c; - } - p = p || (d * .3); - - var s; - if (a >= abs(c)) { - s = p / (2 * pi) * asin(c / a); - } else { - a = c; - s = p / 4; - } - - return -(a * pow(2, 10 * (t -= 1)) * sin((t * d - s) * (2 * pi) / p)) + b; - - }, - - elasticOut: function (t, b, c, d, a, p) { - if (t == 0 || (t /= d) == 1) { - return t == 0 ? b : b + c; - } - p = p || (d * .3); - - var s; - if (a >= abs(c)) { - s = p / (2 * pi) * asin(c / a); - } else { - a = c; - s = p / 4; - } - - return a * pow(2, -10 * t) * sin((t * d - s) * (2 * pi) / p) + c + b; - }, - - elasticBoth: function (t, b, c, d, a, p) { - if (t == 0 || (t /= d / 2) == 2) { - return t == 0 ? b : b + c; - } - - p = p || (d * (.3 * 1.5)); - - var s; - if (a >= abs(c)) { - s = p / (2 * pi) * asin(c / a); - } else { - a = c; - s = p / 4; - } - - return t < 1 ? - -.5 * (a * pow(2, 10 * (t -= 1)) * sin((t * d - s) * (2 * pi) / p)) + b : - a * pow(2, -10 * (t -= 1)) * sin((t * d - s) * (2 * pi) / p) * .5 + c + b; - }, - - backIn: function (t, b, c, d, s) { - s = s || 1.70158; - return c * (t /= d) * t * ((s + 1) * t - s) + b; - }, - - - backOut: function (t, b, c, d, s) { - if (!s) { - s = 1.70158; - } - return c * ((t = t / d - 1) * t * ((s + 1) * t + s) + 1) + b; - }, - - - backBoth: function (t, b, c, d, s) { - s = s || 1.70158; - - return ((t /= d / 2 ) < 1) ? - c / 2 * (t * t * (((s *= (1.525)) + 1) * t - s)) + b : - c / 2 * ((t -= 2) * t * (((s *= (1.525)) + 1) * t + s) + 2) + b; - }, - - - bounceIn: function (t, b, c, d) { - return c - EXTLIB.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) { - return (t < d / 2) ? - EXTLIB.Easing.bounceIn(t * 2, 0, c, d) * .5 + b : - EXTLIB.Easing.bounceOut(t * 2 - d, 0, c, d) * .5 + c * .5 + b; - } - }); -})(); - -(function() { - var EXTLIB = Ext.lib; - // Color Animation - EXTLIB.Anim.color = function(el, args, duration, easing, cb, scope) { - return EXTLIB.Anim.run(el, args, duration, easing, cb, scope, EXTLIB.ColorAnim); - }; - - EXTLIB.ColorAnim = function(el, attributes, duration, method) { - EXTLIB.ColorAnim.superclass.constructor.call(this, el, attributes, duration, method); - }; - - Ext.extend(EXTLIB.ColorAnim, EXTLIB.AnimBase); - - var superclass = EXTLIB.ColorAnim.superclass, - colorRE = /color$/i, - transparentRE = /^transparent|rgba\(0, 0, 0, 0\)$/, - rgbRE = /^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i, - hexRE= /^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i, - hex3RE = /^#?([0-9A-F]{1})([0-9A-F]{1})([0-9A-F]{1})$/i, - isset = function(v){ - return typeof v !== 'undefined'; - }; - - // private - function parseColor(s) { - var pi = parseInt, - base, - out = null, - c; - - if (s.length == 3) { - return s; - } - - Ext.each([hexRE, rgbRE, hex3RE], function(re, idx){ - base = (idx % 2 == 0) ? 16 : 10; - c = re.exec(s); - if(c && c.length == 4){ - out = [pi(c[1], base), pi(c[2], base), pi(c[3], base)]; - return false; - } - }); - return out; - } - - Ext.apply(EXTLIB.ColorAnim.prototype, { - getAttr : function(attr) { - var me = this, - el = me.el, - val; - if(colorRE.test(attr)){ - while(el && transparentRE.test(val = Ext.fly(el).getStyle(attr))){ - el = el.parentNode; - val = "fff"; - } - }else{ - val = superclass.getAttr.call(me, attr); - } - return val; - }, - - doMethod : function(attr, start, end) { - var me = this, - val, - floor = Math.floor, - i, - len, - v; - - if(colorRE.test(attr)){ - val = []; - end = end || []; - - for(i = 0, len = start.length; i < len; i++) { - v = start[i]; - val[i] = superclass.doMethod.call(me, attr, v, end[i]); - } - val = 'rgb(' + floor(val[0]) + ',' + floor(val[1]) + ',' + floor(val[2]) + ')'; - }else{ - val = superclass.doMethod.call(me, attr, start, end); - } - return val; - }, - - setRunAttr : function(attr) { - var me = this, - a = me.attributes[attr], - to = a.to, - by = a.by, - ra; - - superclass.setRunAttr.call(me, attr); - ra = me.runAttrs[attr]; - if(colorRE.test(attr)){ - var start = parseColor(ra.start), - end = parseColor(ra.end); - - if(!isset(to) && isset(by)){ - end = parseColor(by); - for(var i=0,len=start.length; i 0 && isFinite(tweak)){ - if(tween.curFrame + tweak >= frames){ - tweak = frames - (frame + 1); - } - tween.curFrame += tweak; - } - }; - }; - - EXTLIB.Bezier = new function() { - - this.getPosition = function(points, t) { - var n = points.length, - tmp = [], - c = 1 - t, - i, - j; - - for (i = 0; i < n; ++i) { - tmp[i] = [points[i][0], points[i][1]]; - } - - for (j = 1; j < n; ++j) { - for (i = 0; i < n - j; ++i) { - tmp[i][0] = c * tmp[i][0] + t * tmp[parseInt(i + 1, 10)][0]; - tmp[i][1] = c * tmp[i][1] + t * tmp[parseInt(i + 1, 10)][1]; - } - } - - return [ tmp[0][0], tmp[0][1] ]; - - }; - }; - - - EXTLIB.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; - } - }; - - (function() { - EXTLIB.Motion = function(el, attributes, duration, method) { - if (el) { - EXTLIB.Motion.superclass.constructor.call(this, el, attributes, duration, method); - } - }; - - Ext.extend(EXTLIB.Motion, Ext.lib.AnimBase); - - var superclass = EXTLIB.Motion.superclass, - pointsRe = /^points$/i; - - Ext.apply(EXTLIB.Motion.prototype, { - setAttr: function(attr, val, unit){ - var me = this, - setAttr = superclass.setAttr; - - if (pointsRe.test(attr)) { - unit = unit || 'px'; - setAttr.call(me, 'left', val[0], unit); - setAttr.call(me, 'top', val[1], unit); - } else { - setAttr.call(me, attr, val, unit); - } - }, - - getAttr: function(attr){ - var me = this, - getAttr = superclass.getAttr; - - return pointsRe.test(attr) ? [getAttr.call(me, 'left'), getAttr.call(me, 'top')] : getAttr.call(me, attr); - }, - - doMethod: function(attr, start, end){ - var me = this; - - return pointsRe.test(attr) - ? EXTLIB.Bezier.getPosition(me.runAttrs[attr], me.method(me.curFrame, 0, 100, me.totalFrames) / 100) - : superclass.doMethod.call(me, attr, start, end); - }, - - setRunAttr: function(attr){ - if(pointsRe.test(attr)){ - - var me = this, - el = this.el, - points = this.attributes.points, - control = points.control || [], - from = points.from, - to = points.to, - by = points.by, - DOM = EXTLIB.Dom, - start, - i, - end, - len, - ra; - - - if(control.length > 0 && !Ext.isArray(control[0])){ - control = [control]; - }else{ - /* - var tmp = []; - for (i = 0,len = control.length; i < len; ++i) { - tmp[i] = control[i]; - } - control = tmp; - */ - } - - Ext.fly(el, '_anim').position(); - DOM.setXY(el, isset(from) ? from : DOM.getXY(el)); - start = me.getAttr('points'); - - - if(isset(to)){ - end = translateValues.call(me, to, start); - for (i = 0,len = control.length; i < len; ++i) { - control[i] = translateValues.call(me, control[i], start); - } - } else if (isset(by)) { - end = [start[0] + by[0], start[1] + by[1]]; - - for (i = 0,len = control.length; i < len; ++i) { - control[i] = [ start[0] + control[i][0], start[1] + control[i][1] ]; - } - } - - ra = this.runAttrs[attr] = [start]; - if (control.length > 0) { - ra = ra.concat(control); - } - - ra[ra.length] = end; - }else{ - superclass.setRunAttr.call(this, attr); - } - } - }); - - var translateValues = function(val, start) { - var pageXY = EXTLIB.Dom.getXY(this.el); - return [val[0] - pageXY[0] + start[0], val[1] - pageXY[1] + start[1]]; - }; - })(); -})(); \ No newline at end of file diff --git a/assets/js/ext/src/ext-core/src/adapter/ext-base-begin.js b/assets/js/ext/src/ext-core/src/adapter/ext-base-begin.js deleted file mode 100644 index 16a54fb..0000000 --- a/assets/js/ext/src/ext-core/src/adapter/ext-base-begin.js +++ /dev/null @@ -1,18 +0,0 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.com/license - */ -(function(){ - var libFlyweight; - - function fly(el) { - if (!libFlyweight) { - libFlyweight = new Ext.Element.Flyweight(); - } - libFlyweight.dom = el; - return libFlyweight; - } - - \ No newline at end of file diff --git a/assets/js/ext/src/ext-core/src/adapter/ext-base-dom.js b/assets/js/ext/src/ext-core/src/adapter/ext-base-dom.js deleted file mode 100644 index f92755f..0000000 --- a/assets/js/ext/src/ext-core/src/adapter/ext-base-dom.js +++ /dev/null @@ -1,160 +0,0 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.com/license - */ -(function(){ - var doc = document, - isCSS1 = doc.compatMode == "CSS1Compat", - MAX = Math.max, - ROUND = Math.round, - PARSEINT = parseInt; - - Ext.lib.Dom = { - isAncestor : function(p, c) { - var ret = false; - - p = Ext.getDom(p); - c = Ext.getDom(c); - if (p && c) { - if (p.contains) { - return p.contains(c); - } else if (p.compareDocumentPosition) { - return !!(p.compareDocumentPosition(c) & 16); - } else { - while (c = c.parentNode) { - ret = c == p || ret; - } - } - } - return ret; - }, - - getViewWidth : function(full) { - return full ? this.getDocumentWidth() : this.getViewportWidth(); - }, - - getViewHeight : function(full) { - return full ? this.getDocumentHeight() : this.getViewportHeight(); - }, - - getDocumentHeight: function() { - return MAX(!isCSS1 ? doc.body.scrollHeight : doc.documentElement.scrollHeight, this.getViewportHeight()); - }, - - getDocumentWidth: function() { - return MAX(!isCSS1 ? doc.body.scrollWidth : doc.documentElement.scrollWidth, this.getViewportWidth()); - }, - - getViewportHeight: function(){ - return Ext.isIE ? - (Ext.isStrict ? doc.documentElement.clientHeight : doc.body.clientHeight) : - self.innerHeight; - }, - - getViewportWidth : function() { - return !Ext.isStrict && !Ext.isOpera ? doc.body.clientWidth : - Ext.isIE ? doc.documentElement.clientWidth : self.innerWidth; - }, - - getY : function(el) { - return this.getXY(el)[1]; - }, - - getX : function(el) { - return this.getXY(el)[0]; - }, - - getXY : function(el) { - var p, - pe, - b, - bt, - bl, - dbd, - x = 0, - y = 0, - scroll, - hasAbsolute, - bd = (doc.body || doc.documentElement), - ret = [0,0]; - - el = Ext.getDom(el); - - if(el != bd){ - if (el.getBoundingClientRect) { - b = el.getBoundingClientRect(); - scroll = fly(document).getScroll(); - ret = [ROUND(b.left + scroll.left), ROUND(b.top + scroll.top)]; - } else { - p = el; - hasAbsolute = fly(el).isStyle("position", "absolute"); - - while (p) { - pe = fly(p); - x += p.offsetLeft; - y += p.offsetTop; - - hasAbsolute = hasAbsolute || pe.isStyle("position", "absolute"); - - if (Ext.isGecko) { - y += bt = PARSEINT(pe.getStyle("borderTopWidth"), 10) || 0; - x += bl = PARSEINT(pe.getStyle("borderLeftWidth"), 10) || 0; - - if (p != el && !pe.isStyle('overflow','visible')) { - x += bl; - y += bt; - } - } - p = p.offsetParent; - } - - if (Ext.isSafari && hasAbsolute) { - x -= bd.offsetLeft; - y -= bd.offsetTop; - } - - if (Ext.isGecko && !hasAbsolute) { - 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 (!Ext.isOpera || (p.tagName != 'TR' && !fly(p).isStyle("display", "inline"))) { - x -= p.scrollLeft; - y -= p.scrollTop; - } - p = p.parentNode; - } - ret = [x,y]; - } - } - return ret; - }, - - setXY : function(el, xy) { - (el = Ext.fly(el, '_setXY')).position(); - - var pts = el.translatePoints(xy), - style = el.dom.style, - pos; - - for (pos in pts) { - if (!isNaN(pts[pos])) { - style[pos] = pts[pos] + "px"; - } - } - }, - - setX : function(el, x) { - this.setXY(el, [x, false]); - }, - - setY : function(el, y) { - this.setXY(el, [false, y]); - } - }; -})(); \ No newline at end of file diff --git a/assets/js/ext/src/ext-core/src/adapter/ext-base-end.js b/assets/js/ext/src/ext-core/src/adapter/ext-base-end.js deleted file mode 100644 index e9fc03a..0000000 --- a/assets/js/ext/src/ext-core/src/adapter/ext-base-end.js +++ /dev/null @@ -1,21 +0,0 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.com/license - */ - - if (Ext.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); - } -})(); \ No newline at end of file diff --git a/assets/js/ext/src/ext-core/src/adapter/ext-base-event.js b/assets/js/ext/src/ext-core/src/adapter/ext-base-event.js deleted file mode 100644 index 593c40a..0000000 --- a/assets/js/ext/src/ext-core/src/adapter/ext-base-event.js +++ /dev/null @@ -1,359 +0,0 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.com/license - */ -Ext.lib.Event = function() { - var loadComplete = false, - unloadListeners = {}, - retryCount = 0, - onAvailStack = [], - _interval, - locked = false, - win = window, - doc = document, - - // constants - POLL_RETRYS = 200, - POLL_INTERVAL = 20, - TYPE = 0, - FN = 1, - OBJ = 2, - ADJ_SCOPE = 3, - SCROLLLEFT = 'scrollLeft', - SCROLLTOP = 'scrollTop', - UNLOAD = 'unload', - MOUSEOVER = 'mouseover', - MOUSEOUT = 'mouseout', - // private - doAdd = function() { - var ret; - if (win.addEventListener) { - ret = function(el, eventName, fn, capture) { - if (eventName == 'mouseenter') { - fn = fn.createInterceptor(checkRelatedTarget); - el.addEventListener(MOUSEOVER, fn, (capture)); - } else if (eventName == 'mouseleave') { - fn = fn.createInterceptor(checkRelatedTarget); - el.addEventListener(MOUSEOUT, fn, (capture)); - } else { - el.addEventListener(eventName, fn, (capture)); - } - return fn; - }; - } else if (win.attachEvent) { - ret = function(el, eventName, fn, capture) { - el.attachEvent("on" + eventName, fn); - return fn; - }; - } else { - ret = function(){}; - } - return ret; - }(), - // private - doRemove = function(){ - var ret; - if (win.removeEventListener) { - ret = function (el, eventName, fn, capture) { - if (eventName == 'mouseenter') { - eventName = MOUSEOVER; - } else if (eventName == 'mouseleave') { - eventName = MOUSEOUT; - } - el.removeEventListener(eventName, fn, (capture)); - }; - } else if (win.detachEvent) { - ret = function (el, eventName, fn) { - el.detachEvent("on" + eventName, fn); - }; - } else { - ret = function(){}; - } - return ret; - }(); - - function checkRelatedTarget(e) { - return !elContains(e.currentTarget, pub.getRelatedTarget(e)); - } - - function elContains(parent, child) { - if(parent && parent.firstChild){ - while(child) { - if(child === parent) { - return true; - } - child = child.parentNode; - if(child && (child.nodeType != 1)) { - child = null; - } - } - } - return false; - } - - // private - function _tryPreloadAttach() { - var ret = false, - notAvail = [], - element, i, v, override, - tryAgain = !loadComplete || (retryCount > 0); - - if(!locked){ - locked = true; - - for(i = 0; i < onAvailStack.length; ++i){ - v = onAvailStack[i]; - if(v && (element = doc.getElementById(v.id))){ - if(!v.checkReady || loadComplete || element.nextSibling || (doc && doc.body)) { - override = v.override; - element = override ? (override === true ? v.obj : override) : element; - v.fn.call(element, v.obj); - onAvailStack.remove(v); - --i; - }else{ - notAvail.push(v); - } - } - } - - retryCount = (notAvail.length === 0) ? 0 : retryCount - 1; - - if (tryAgain) { - startInterval(); - } else { - clearInterval(_interval); - _interval = null; - } - ret = !(locked = false); - } - return ret; - } - - // private - function startInterval() { - if(!_interval){ - var callback = function() { - _tryPreloadAttach(); - }; - _interval = setInterval(callback, POLL_INTERVAL); - } - } - - // private - function getScroll() { - var dd = doc.documentElement, - db = doc.body; - if(dd && (dd[SCROLLTOP] || dd[SCROLLLEFT])){ - return [dd[SCROLLLEFT], dd[SCROLLTOP]]; - }else if(db){ - return [db[SCROLLLEFT], db[SCROLLTOP]]; - }else{ - return [0, 0]; - } - } - - // private - function getPageCoord (ev, xy) { - ev = ev.browserEvent || ev; - var coord = ev['page' + xy]; - if (!coord && coord !== 0) { - coord = ev['client' + xy] || 0; - - if (Ext.isIE) { - coord += getScroll()[xy == "X" ? 0 : 1]; - } - } - - return coord; - } - - var pub = { - extAdapter: true, - 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 = POLL_RETRYS; - startInterval(); - }, - - // This function should ALWAYS be called from Ext.EventManager - addListener: function(el, eventName, fn) { - el = Ext.getDom(el); - if (el && fn) { - if (eventName == UNLOAD) { - if (unloadListeners[el.id] === undefined) { - unloadListeners[el.id] = []; - } - unloadListeners[el.id].push([eventName, fn]); - return fn; - } - return doAdd(el, eventName, fn, false); - } - return false; - }, - - // This function should ALWAYS be called from Ext.EventManager - removeListener: function(el, eventName, fn) { - el = Ext.getDom(el); - var i, len, li, lis; - if (el && fn) { - if(eventName == UNLOAD){ - if((lis = unloadListeners[el.id]) !== undefined){ - for(i = 0, len = lis.length; i < len; i++){ - if((li = lis[i]) && li[TYPE] == eventName && li[FN] == fn){ - unloadListeners[el.id].splice(i, 1); - } - } - } - return; - } - doRemove(el, eventName, fn, false); - } - }, - - getTarget : function(ev) { - ev = ev.browserEvent || ev; - return this.resolveTextNode(ev.target || ev.srcElement); - }, - - resolveTextNode : Ext.isGecko ? function(node){ - if(!node){ - return; - } - // work around firefox bug, https://bugzilla.mozilla.org/show_bug.cgi?id=101197 - var s = HTMLElement.prototype.toString.call(node); - if(s == '[xpconnect wrapped native prototype]' || s == '[object XULElement]'){ - return; - } - return node.nodeType == 3 ? node.parentNode : node; - } : function(node){ - return node && node.nodeType == 3 ? node.parentNode : node; - }, - - getRelatedTarget : function(ev) { - ev = ev.browserEvent || ev; - return this.resolveTextNode(ev.relatedTarget || - (/(mouseout|mouseleave)/.test(ev.type) ? ev.toElement : - /(mouseover|mouseenter)/.test(ev.type) ? ev.fromElement : null)); - }, - - getPageX : function(ev) { - return getPageCoord(ev, "X"); - }, - - getPageY : function(ev) { - return getPageCoord(ev, "Y"); - }, - - - getXY : function(ev) { - return [this.getPageX(ev), this.getPageY(ev)]; - }, - - 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) { - e = e || win.event; - if (!e) { - var c = this.getEvent.caller; - while (c) { - e = c.arguments[0]; - if (e && Event == e.constructor) { - break; - } - c = c.caller; - } - } - return e; - }, - - getCharCode : function(ev) { - ev = ev.browserEvent || ev; - return ev.charCode || ev.keyCode || 0; - }, - - //clearCache: function() {}, - // deprecated, call from EventManager - getListeners : function(el, eventName) { - Ext.EventManager.getListeners(el, eventName); - }, - - // deprecated, call from EventManager - purgeElement : function(el, recurse, eventName) { - Ext.EventManager.purgeElement(el, recurse, eventName); - }, - - _load : function(e) { - loadComplete = true; - - if (Ext.isIE && e !== true) { - // IE8 complains that _load is null or not an object - // so lets remove self via arguments.callee - doRemove(win, "load", arguments.callee); - } - }, - - _unload : function(e) { - var EU = Ext.lib.Event, - i, v, ul, id, len, scope; - - for (id in unloadListeners) { - ul = unloadListeners[id]; - for (i = 0, len = ul.length; i < len; i++) { - v = ul[i]; - if (v) { - try{ - scope = v[ADJ_SCOPE] ? (v[ADJ_SCOPE] === true ? v[OBJ] : v[ADJ_SCOPE]) : win; - v[FN].call(scope, EU.getEvent(e), v[OBJ]); - }catch(ex){} - } - } - }; - - Ext.EventManager._unload(); - - doRemove(win, UNLOAD, EU._unload); - } - }; - - // Initialize stuff. - pub.on = pub.addListener; - pub.un = pub.removeListener; - if (doc && doc.body) { - pub._load(true); - } else { - doAdd(win, "load", pub._load); - } - doAdd(win, UNLOAD, pub._unload); - _tryPreloadAttach(); - - return pub; -}(); diff --git a/assets/js/ext/src/ext-core/src/adapter/ext-base-point.js b/assets/js/ext/src/ext-core/src/adapter/ext-base-point.js deleted file mode 100644 index beaef38..0000000 --- a/assets/js/ext/src/ext-core/src/adapter/ext-base-point.js +++ /dev/null @@ -1,17 +0,0 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.com/license - */ - Ext.lib.Point = function(x, y) { - if (Ext.isArray(x)) { - y = x[1]; - x = x[0]; - } - var me = this; - me.x = me.right = me.left = me[0] = x; - me.y = me.top = me.bottom = me[1] = y; - }; - - Ext.lib.Point.prototype = new Ext.lib.Region(); diff --git a/assets/js/ext/src/ext-core/src/adapter/ext-base-region.js b/assets/js/ext/src/ext-core/src/adapter/ext-base-region.js deleted file mode 100644 index b3e9c39..0000000 --- a/assets/js/ext/src/ext-core/src/adapter/ext-base-region.js +++ /dev/null @@ -1,81 +0,0 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.com/license - */ - Ext.lib.Region = function(t, r, b, l) { - var me = this; - me.top = t; - me[1] = t; - me.right = r; - me.bottom = b; - me.left = l; - me[0] = l; - }; - - Ext.lib.Region.prototype = { - contains : function(region) { - var me = this; - return ( region.left >= me.left && - region.right <= me.right && - region.top >= me.top && - region.bottom <= me.bottom ); - - }, - - getArea : function() { - var me = this; - return ( (me.bottom - me.top) * (me.right - me.left) ); - }, - - intersect : function(region) { - var me = this, - t = Math.max(me.top, region.top), - r = Math.min(me.right, region.right), - b = Math.min(me.bottom, region.bottom), - l = Math.max(me.left, region.left); - - if (b >= t && r >= l) { - return new Ext.lib.Region(t, r, b, l); - } - }, - - union : function(region) { - var me = this, - t = Math.min(me.top, region.top), - r = Math.max(me.right, region.right), - b = Math.max(me.bottom, region.bottom), - l = Math.min(me.left, region.left); - - return new Ext.lib.Region(t, r, b, l); - }, - - constrainTo : function(r) { - var me = this; - me.top = me.top.constrain(r.top, r.bottom); - me.bottom = me.bottom.constrain(r.top, r.bottom); - me.left = me.left.constrain(r.left, r.right); - me.right = me.right.constrain(r.left, r.right); - return me; - }, - - adjust : function(t, l, b, r) { - var me = this; - me.top += t; - me.left += l; - me.right += r; - me.bottom += b; - return me; - } - }; - - Ext.lib.Region.getRegion = function(el) { - var p = Ext.lib.Dom.getXY(el), - t = p[1], - r = p[0] + el.offsetWidth, - b = p[1] + el.offsetHeight, - l = p[0]; - - return new Ext.lib.Region(t, r, b, l); - }; \ No newline at end of file diff --git a/assets/js/ext/src/ext-core/src/core/CompositeElementLite.js b/assets/js/ext/src/ext-core/src/core/CompositeElementLite.js deleted file mode 100644 index a8cd3ff..0000000 --- a/assets/js/ext/src/ext-core/src/core/CompositeElementLite.js +++ /dev/null @@ -1,322 +0,0 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.com/license - */ -/** - * @class Ext.CompositeElementLite - *

    This class encapsulates a collection of DOM elements, providing methods to filter - * members, or to perform collective actions upon the whole set.

    - *

    Although they are not listed, this class supports all of the methods of {@link Ext.Element} and - * {@link Ext.Fx}. The methods from these classes will be performed on all the elements in this collection.

    - * Example:
    
    -var els = Ext.select("#some-el div.some-class");
    -// or select directly from an existing element
    -var el = Ext.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);
    -
    - */
    -Ext.CompositeElementLite = function(els, root){
    -    /**
    -     * 

    The Array of DOM elements which this CompositeElement encapsulates. Read-only.

    - *

    This will not usually be accessed in developers' code, but developers wishing - * to augment the capabilities of the CompositeElementLite class may use it when adding - * methods to the class.

    - *

    For example to add the nextAll method to the class to add all - * following siblings of selected elements, the code would be

    -Ext.override(Ext.CompositeElementLite, {
    -    nextAll: function() {
    -        var els = this.elements, i, l = els.length, n, r = [], ri = -1;
    -
    -//      Loop through all elements in this Composite, accumulating
    -//      an Array of all siblings.
    -        for (i = 0; i < l; i++) {
    -            for (n = els[i].nextSibling; n; n = n.nextSibling) {
    -                r[++ri] = n;
    -            }
    -        }
    -
    -//      Add all found siblings to this Composite
    -        return this.add(r);
    -    }
    -});
    - * @type Array - * @property elements - */ - this.elements = []; - this.add(els, root); - this.el = new Ext.Element.Flyweight(); -}; - -Ext.CompositeElementLite.prototype = { - isComposite: true, - - // private - getElement : function(el){ - // Set the shared flyweight dom property to the current element - var e = this.el; - e.dom = el; - e.id = el.id; - return e; - }, - - // private - transformElement : function(el){ - return Ext.getDom(el); - }, - - /** - * Returns the number of elements in this Composite. - * @return Number - */ - getCount : function(){ - return this.elements.length; - }, - /** - * Adds elements to this Composite object. - * @param {Mixed} els Either an Array of DOM elements to add, or another Composite object who's elements should be added. - * @return {CompositeElement} This Composite object. - */ - add : function(els, root){ - var me = this, - elements = me.elements; - if(!els){ - return this; - } - if(typeof els == "string"){ - els = Ext.Element.selectorFunction(els, root); - }else if(els.isComposite){ - els = els.elements; - }else if(!Ext.isIterable(els)){ - els = [els]; - } - - for(var i = 0, len = els.length; i < len; ++i){ - elements.push(me.transformElement(els[i])); - } - return me; - }, - - invoke : function(fn, args){ - var me = this, - els = me.elements, - len = els.length, - e, - i; - - for(i = 0; i < len; i++) { - e = els[i]; - if(e){ - Ext.Element.prototype[fn].apply(me.getElement(e), args); - } - } - return me; - }, - /** - * Returns a flyweight Element of the dom element object at the specified index - * @param {Number} index - * @return {Ext.Element} - */ - item : function(index){ - var me = this, - el = me.elements[index], - out = null; - - if(el){ - out = me.getElement(el); - } - return out; - }, - - // fixes scope with flyweight - addListener : function(eventName, handler, scope, opt){ - var els = this.elements, - len = els.length, - i, e; - - for(i = 0; iCalls the passed function for each element in this composite.

    - * @param {Function} fn The function to call. The function is passed the following parameters:
      - *
    • el : Element
      The current Element in the iteration. - * This is the flyweight (shared) Ext.Element instance, so if you require a - * a reference to the dom node, use el.dom.
    • - *
    • c : Composite
      This Composite object.
    • - *
    • idx : Number
      The zero-based index in the iteration.
    • - *
    - * @param {Object} scope (optional) The scope (this reference) in which the function is executed. (defaults to the Element) - * @return {CompositeElement} this - */ - each : function(fn, scope){ - var me = this, - els = me.elements, - len = els.length, - i, e; - - for(i = 0; i - *
  • el : Ext.Element
    The current DOM element.
  • - *
  • index : Number
    The current index within the collection.
  • - * - * @return {CompositeElement} this - */ - filter : function(selector){ - var els = [], - me = this, - fn = Ext.isFunction(selector) ? selector - : function(el){ - return el.is(selector); - }; - - me.each(function(el, self, i) { - if (fn(el, i) !== false) { - els[els.length] = me.transformElement(el); - } - }); - - me.elements = els; - return me; - }, - - /** - * Find the index of the passed element within the composite collection. - * @param el {Mixed} The id of an element, or an Ext.Element, or an HtmlElement to find within the composite collection. - * @return Number The index of the passed Ext.Element in the composite collection, or -1 if not found. - */ - indexOf : function(el){ - return this.elements.indexOf(this.transformElement(el)); - }, - - /** - * Replaces the specified element with the passed element. - * @param {Mixed} el The id of an element, the Element itself, the index of the element in this composite - * to replace. - * @param {Mixed} 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 = !isNaN(el) ? el : this.indexOf(el), - d; - if(index > -1){ - replacement = Ext.getDom(replacement); - if(domReplace){ - d = this.elements[index]; - d.parentNode.insertBefore(replacement, d); - Ext.removeNode(d); - } - this.elements.splice(index, 1, replacement); - } - return this; - }, - - /** - * Removes all elements. - */ - clear : function(){ - this.elements = []; - } -}; - -Ext.CompositeElementLite.prototype.on = Ext.CompositeElementLite.prototype.addListener; - -/** - * @private - * Copies all of the functions from Ext.Element's prototype onto CompositeElementLite's prototype. - * This is called twice - once immediately below, and once again after additional Ext.Element - * are added in Ext JS - */ -Ext.CompositeElementLite.importElementMethods = function() { - var fnName, - ElProto = Ext.Element.prototype, - CelProto = Ext.CompositeElementLite.prototype; - - for (fnName in ElProto) { - if (typeof ElProto[fnName] == 'function'){ - (function(fnName) { - CelProto[fnName] = CelProto[fnName] || function() { - return this.invoke(fnName, arguments); - }; - }).call(CelProto, fnName); - - } - } -}; - -Ext.CompositeElementLite.importElementMethods(); - -if(Ext.DomQuery){ - Ext.Element.selectorFunction = Ext.DomQuery.select; -} - -/** - * Selects elements based on the passed CSS selector to enable {@link Ext.Element Element} methods - * to be applied to many related elements in one statement through the returned {@link Ext.CompositeElement CompositeElement} or - * {@link Ext.CompositeElementLite CompositeElementLite} object. - * @param {String/Array} selector The CSS selector or an array of elements - * @param {HTMLElement/String} root (optional) The root element of the query or id of the root - * @return {CompositeElementLite/CompositeElement} - * @member Ext.Element - * @method select - */ -Ext.Element.select = function(selector, root){ - var els; - if(typeof selector == "string"){ - els = Ext.Element.selectorFunction(selector, root); - }else if(selector.length !== undefined){ - els = selector; - }else{ - throw "Invalid selector"; - } - return new Ext.CompositeElementLite(els); -}; -/** - * Selects elements based on the passed CSS selector to enable {@link Ext.Element Element} methods - * to be applied to many related elements in one statement through the returned {@link Ext.CompositeElement CompositeElement} or - * {@link Ext.CompositeElementLite CompositeElementLite} object. - * @param {String/Array} selector The CSS selector or an array of elements - * @param {HTMLElement/String} root (optional) The root element of the query or id of the root - * @return {CompositeElementLite/CompositeElement} - * @member Ext - * @method select - */ -Ext.select = Ext.Element.select; diff --git a/assets/js/ext/src/ext-core/src/core/DomHelper.js b/assets/js/ext/src/ext-core/src/core/DomHelper.js deleted file mode 100644 index b3037d7..0000000 --- a/assets/js/ext/src/ext-core/src/core/DomHelper.js +++ /dev/null @@ -1,426 +0,0 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.com/license - */ -/** - * @class Ext.DomHelper - *

    The DomHelper class provides a layer of abstraction from DOM and transparently supports creating - * elements via DOM or using HTML fragments. It also has the ability to create HTML fragment templates - * from your DOM building code.

    - * - *

    DomHelper element specification object

    - *

    A specification object is used when creating elements. Attributes of this object - * are assumed to be element attributes, except for 4 special attributes: - *

      - *
    • tag :
      The tag name of the element
    • - *
    • children : or cn
      An array of the - * same kind of element definition objects to be created and appended. These can be nested - * as deep as you want.
    • - *
    • cls :
      The class attribute of the element. - * This will end up being either the "class" attribute on a HTML fragment or className - * for a DOM node, depending on whether DomHelper is using fragments or DOM.
    • - *
    • html :
      The innerHTML for the element
    • - *

    - * - *

    Insertion methods

    - *

    Commonly used insertion methods: - *

      - *
    • {@link #append} :
    • - *
    • {@link #insertBefore} :
    • - *
    • {@link #insertAfter} :
    • - *
    • {@link #overwrite} :
    • - *
    • {@link #createTemplate} :
    • - *
    • {@link #insertHtml} :
    • - *

    - * - *

    Example

    - *

    This is an example, where an unordered list with 3 children items is appended to an existing - * element with id 'my-div':
    -

    
    -var dh = Ext.DomHelper; // create shorthand alias
    -// specification object
    -var spec = {
    -    id: 'my-ul',
    -    tag: 'ul',
    -    cls: 'my-list',
    -    // append children after creating
    -    children: [     // may also specify 'cn' instead of 'children'
    -        {tag: 'li', id: 'item0', html: 'List Item 0'},
    -        {tag: 'li', id: 'item1', html: 'List Item 1'},
    -        {tag: 'li', id: 'item2', html: 'List Item 2'}
    -    ]
    -};
    -var list = dh.append(
    -    'my-div', // the context element 'my-div' can either be the id or the actual node
    -    spec      // the specification object
    -);
    - 

    - *

    Element creation specification parameters in this class may also be passed as an Array of - * specification objects. This can be used to insert multiple sibling nodes into an existing - * container very efficiently. For example, to add more list items to the example above:

    
    -dh.append('my-ul', [
    -    {tag: 'li', id: 'item3', html: 'List Item 3'},
    -    {tag: 'li', id: 'item4', html: 'List Item 4'}
    -]);
    - * 

    - * - *

    Templating

    - *

    The real power is in the built-in templating. Instead of creating or appending any elements, - * {@link #createTemplate} returns a Template object which can be used over and over to - * insert new elements. Revisiting the example above, we could utilize templating this time: - *

    
    -// create the node
    -var list = dh.append('my-div', {tag: 'ul', cls: 'my-list'});
    -// get template
    -var tpl = dh.createTemplate({tag: 'li', id: 'item{0}', html: 'List Item {0}'});
    -
    -for(var i = 0; i < 5, i++){
    -    tpl.append(list, [i]); // use template to append to the actual node
    -}
    - * 

    - *

    An example using a template:

    
    -var html = '{2}';
    -
    -var tpl = new Ext.DomHelper.createTemplate(html);
    -tpl.append('blog-roll', ['link1', 'http://www.jackslocum.com/', "Jack's Site"]);
    -tpl.append('blog-roll', ['link2', 'http://www.dustindiaz.com/', "Dustin's Site"]);
    - * 

    - * - *

    The same example using named parameters:

    
    -var html = '{text}';
    -
    -var tpl = new Ext.DomHelper.createTemplate(html);
    -tpl.append('blog-roll', {
    -    id: 'link1',
    -    url: 'http://www.jackslocum.com/',
    -    text: "Jack's Site"
    -});
    -tpl.append('blog-roll', {
    -    id: 'link2',
    -    url: 'http://www.dustindiaz.com/',
    -    text: "Dustin's Site"
    -});
    - * 

    - * - *

    Compiling Templates

    - *

    Templates are applied using regular expressions. The performance is great, but if - * you are adding a bunch of DOM elements using the same template, you can increase - * performance even further by {@link Ext.Template#compile "compiling"} the template. - * The way "{@link Ext.Template#compile compile()}" works is the template is parsed and - * broken up at the different variable points and a dynamic function is created and eval'ed. - * The generated function performs string concatenation of these parts and the passed - * variables instead of using regular expressions. - *

    
    -var html = '{text}';
    -
    -var tpl = new Ext.DomHelper.createTemplate(html);
    -tpl.compile();
    -
    -//... use template like normal
    - * 

    - * - *

    Performance Boost

    - *

    DomHelper will transparently create HTML fragments when it can. Using HTML fragments instead - * of DOM can significantly boost performance.

    - *

    Element creation specification parameters may also be strings. If {@link #useDom} is false, - * then the string is used as innerHTML. If {@link #useDom} is true, a string specification - * results in the creation of a text node. Usage:

    - *
    
    -Ext.DomHelper.useDom = true; // force it to use DOM; reduces performance
    - * 
    - * @singleton - */ -Ext.DomHelper = function(){ - var tempTableEl = null, - emptyTags = /^(?:br|frame|hr|img|input|link|meta|range|spacer|wbr|area|param|col)$/i, - tableRe = /^table|tbody|tr|td$/i, - confRe = /tag|children|cn|html$/i, - tableElRe = /td|tr|tbody/i, - cssRe = /([a-z0-9-]+)\s*:\s*([^;\s]+(?:\s*[^;\s]+)*);?/gi, - endRe = /end/i, - pub, - // kill repeat to save bytes - afterbegin = 'afterbegin', - afterend = 'afterend', - beforebegin = 'beforebegin', - beforeend = 'beforeend', - ts = '', - te = '
    ', - tbs = ts+'', - tbe = ''+te, - trs = tbs + '', - tre = ''+tbe; - - // private - function doInsert(el, o, returnElement, pos, sibling, append){ - var newNode = pub.insertHtml(pos, Ext.getDom(el), createHtml(o)); - return returnElement ? Ext.get(newNode, true) : newNode; - } - - // build as innerHTML where available - function createHtml(o){ - var b = '', - attr, - val, - key, - cn; - - if(typeof o == "string"){ - b = o; - } else if (Ext.isArray(o)) { - for (var i=0; i < o.length; i++) { - if(o[i]) { - b += createHtml(o[i]); - } - }; - } else { - b += '<' + (o.tag = o.tag || 'div'); - for (attr in o) { - val = o[attr]; - if(!confRe.test(attr)){ - if (typeof val == "object") { - b += ' ' + attr + '="'; - for (key in val) { - b += key + ':' + val[key] + ';'; - }; - b += '"'; - }else{ - b += ' ' + ({cls : 'class', htmlFor : 'for'}[attr] || attr) + '="' + val + '"'; - } - } - }; - // Now either just close the tag or try to add children and close the tag. - if (emptyTags.test(o.tag)) { - b += '/>'; - } else { - b += '>'; - if ((cn = o.children || o.cn)) { - b += createHtml(cn); - } else if(o.html){ - b += o.html; - } - b += ''; - } - } - return b; - } - - function ieTable(depth, s, h, e){ - tempTableEl.innerHTML = [s, h, e].join(''); - var i = -1, - el = tempTableEl, - ns; - while(++i < depth){ - el = el.firstChild; - } -// If the result is multiple siblings, then encapsulate them into one fragment. - if(ns = el.nextSibling){ - var df = document.createDocumentFragment(); - while(el){ - ns = el.nextSibling; - df.appendChild(el); - el = ns; - } - el = df; - } - return el; - } - - /** - * @ignore - * Nasty code for IE's broken table implementation - */ - function insertIntoTable(tag, where, el, html) { - var node, - before; - - tempTableEl = tempTableEl || document.createElement('div'); - - if(tag == 'td' && (where == afterbegin || where == beforeend) || - !tableElRe.test(tag) && (where == beforebegin || where == afterend)) { - return; - } - before = where == beforebegin ? el : - where == afterend ? el.nextSibling : - where == afterbegin ? el.firstChild : null; - - if (where == beforebegin || where == afterend) { - el = el.parentNode; - } - - if (tag == 'td' || (tag == 'tr' && (where == beforeend || where == afterbegin))) { - node = ieTable(4, trs, html, tre); - } else if ((tag == 'tbody' && (where == beforeend || where == afterbegin)) || - (tag == 'tr' && (where == beforebegin || where == afterend))) { - node = ieTable(3, tbs, html, tbe); - } else { - node = ieTable(2, ts, html, te); - } - el.insertBefore(node, before); - return node; - } - - - pub = { - /** - * 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 e.g. 'width:100px', or object in the form {width:'100px'}, or - * a function which returns such a specification. - */ - applyStyles : function(el, styles){ - if (styles) { - var matches; - - el = Ext.fly(el); - if (typeof styles == "function") { - styles = styles.call(); - } - if (typeof styles == "string") { - /** - * Since we're using the g flag on the regex, we need to set the lastIndex. - * This automatically happens on some implementations, but not others, see: - * http://stackoverflow.com/questions/2645273/javascript-regular-expression-literal-persists-between-function-calls - * http://blog.stevenlevithan.com/archives/fixing-javascript-regexp - */ - cssRe.lastIndex = 0; - while ((matches = cssRe.exec(styles))) { - el.setStyle(matches[1], matches[2]); - } - } else if (typeof styles == "object") { - el.setStyle(styles); - } - } - }, - - /** - * 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 fragment - * @return {HTMLElement} The new node - */ - insertHtml : function(where, el, html){ - var hash = {}, - hashVal, - setStart, - range, - frag, - rangeEl, - rs; - - where = where.toLowerCase(); - // add these here because they are used in both branches of the condition. - hash[beforebegin] = ['BeforeBegin', 'previousSibling']; - hash[afterend] = ['AfterEnd', 'nextSibling']; - - if (el.insertAdjacentHTML) { - if(tableRe.test(el.tagName) && (rs = insertIntoTable(el.tagName.toLowerCase(), where, el, html))){ - return rs; - } - // add these two to the hash. - hash[afterbegin] = ['AfterBegin', 'firstChild']; - hash[beforeend] = ['BeforeEnd', 'lastChild']; - if ((hashVal = hash[where])) { - el.insertAdjacentHTML(hashVal[0], html); - return el[hashVal[1]]; - } - } else { - range = el.ownerDocument.createRange(); - setStart = 'setStart' + (endRe.test(where) ? 'After' : 'Before'); - if (hash[where]) { - range[setStart](el); - frag = range.createContextualFragment(html); - el.parentNode.insertBefore(frag, where == beforebegin ? el : el.nextSibling); - return el[(where == beforebegin ? 'previous' : 'next') + 'Sibling']; - } else { - rangeEl = (where == afterbegin ? 'first' : 'last') + 'Child'; - if (el.firstChild) { - range[setStart](el[rangeEl]); - frag = range.createContextualFragment(html); - if(where == afterbegin){ - el.insertBefore(frag, el.firstChild); - }else{ - el.appendChild(frag); - } - } else { - el.innerHTML = html; - } - return el[rangeEl]; - } - } - throw 'Illegal insertion point -> "' + where + '"'; - }, - - /** - * Creates new DOM element(s) and inserts them before el. - * @param {Mixed} 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 Ext.Element - * @return {HTMLElement/Ext.Element} The new node - */ - insertBefore : function(el, o, returnElement){ - return doInsert(el, o, returnElement, beforebegin); - }, - - /** - * Creates new DOM element(s) and inserts them after el. - * @param {Mixed} el The context element - * @param {Object} o The DOM object spec (and children) - * @param {Boolean} returnElement (optional) true to return a Ext.Element - * @return {HTMLElement/Ext.Element} The new node - */ - insertAfter : function(el, o, returnElement){ - return doInsert(el, o, returnElement, afterend, 'nextSibling'); - }, - - /** - * Creates new DOM element(s) and inserts them as the first child of el. - * @param {Mixed} 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 Ext.Element - * @return {HTMLElement/Ext.Element} The new node - */ - insertFirst : function(el, o, returnElement){ - return doInsert(el, o, returnElement, afterbegin, 'firstChild'); - }, - - /** - * Creates new DOM element(s) and appends them to el. - * @param {Mixed} 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 Ext.Element - * @return {HTMLElement/Ext.Element} The new node - */ - append : function(el, o, returnElement){ - return doInsert(el, o, returnElement, beforeend, '', true); - }, - - /** - * Creates new DOM element(s) and overwrites the contents of el with them. - * @param {Mixed} 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 Ext.Element - * @return {HTMLElement/Ext.Element} The new node - */ - overwrite : function(el, o, returnElement){ - el = Ext.getDom(el); - el.innerHTML = createHtml(o); - return returnElement ? Ext.get(el.firstChild) : el.firstChild; - }, - - createHtml : createHtml - }; - return pub; -}(); diff --git a/assets/js/ext/src/ext-core/src/core/DomQuery.js b/assets/js/ext/src/ext-core/src/core/DomQuery.js deleted file mode 100644 index 5fefcba..0000000 --- a/assets/js/ext/src/ext-core/src/core/DomQuery.js +++ /dev/null @@ -1,932 +0,0 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.com/license - */ -/* - * This is code is also distributed under MIT license for use - * with jQuery and prototype JavaScript libraries. - */ -/** - * @class Ext.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). -

    -DomQuery supports most of the CSS3 selectors spec, along with some custom selectors and basic XPath.

    - -

    -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. -

    -

    Element Selectors:

    -
      -
    • * any element
    • -
    • E an element with the tag E
    • -
    • E F All descendent elements of E that have the tag F
    • -
    • E > F or E/F all direct children elements of E that have the tag F
    • -
    • E + F all elements with the tag F that are immediately preceded by an element with the tag E
    • -
    • E ~ F all elements with the tag F that are preceded by a sibling element with the tag E
    • -
    -

    Attribute Selectors:

    -

    The use of @ and quotes are optional. For example, div[@foo='bar'] is also a valid attribute selector.

    -
      -
    • E[foo] has an attribute "foo"
    • -
    • E[foo=bar] has an attribute "foo" that equals "bar"
    • -
    • E[foo^=bar] has an attribute "foo" that starts with "bar"
    • -
    • E[foo$=bar] has an attribute "foo" that ends with "bar"
    • -
    • E[foo*=bar] has an attribute "foo" that contains the substring "bar"
    • -
    • E[foo%=2] has an attribute "foo" that is evenly divisible by 2
    • -
    • E[foo!=bar] attribute "foo" does not equal "bar"
    • -
    -

    Pseudo Classes:

    -
      -
    • E:first-child E is the first child of its parent
    • -
    • E:last-child E is the last child of its parent
    • -
    • E:nth-child(n) E is the nth child of its parent (1 based as per the spec)
    • -
    • E:nth-child(odd) E is an odd child of its parent
    • -
    • E:nth-child(even) E is an even child of its parent
    • -
    • E:only-child E is the only child of its parent
    • -
    • E:checked E is an element that is has a checked attribute that is true (e.g. a radio or checkbox)
    • -
    • E:first the first E in the resultset
    • -
    • E:last the last E in the resultset
    • -
    • E:nth(n) the nth E in the resultset (1 based)
    • -
    • E:odd shortcut for :nth-child(odd)
    • -
    • E:even shortcut for :nth-child(even)
    • -
    • E:contains(foo) E's innerHTML contains the substring "foo"
    • -
    • E:nodeValue(foo) E contains a textNode with a nodeValue that equals "foo"
    • -
    • E:not(S) an E element that does not match simple selector S
    • -
    • E:has(S) an E element that has a descendent that matches simple selector S
    • -
    • E:next(S) an E element whose next sibling matches simple selector S
    • -
    • E:prev(S) an E element whose previous sibling matches simple selector S
    • -
    • E:any(S1|S2|S2) an E element which matches any of the simple selectors S1, S2 or S3//\\
    • -
    -

    CSS Value Selectors:

    -
      -
    • E{display=none} css value "display" that equals "none"
    • -
    • E{display^=none} css value "display" that starts with "none"
    • -
    • E{display$=none} css value "display" that ends with "none"
    • -
    • E{display*=none} css value "display" that contains the substring "none"
    • -
    • E{display%=2} css value "display" that is evenly divisible by 2
    • -
    • E{display!=none} css value "display" that does not equal "none"
    • -
    - * @singleton - */ -Ext.DomQuery = function(){ - var cache = {}, - simpleCache = {}, - valueCache = {}, - nonSpace = /\S/, - trimRe = /^\s+|\s+$/g, - tplRe = /\{(\d+)\}/g, - modeRe = /^(\s?[\/>+~]\s?|\s|$)/, - tagTokenRe = /^(#)?([\w-\*]+)/, - nthRe = /(\d*)n\+?(\d*)/, - nthRe2 = /\D/, - // 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. - isIE = window.ActiveXObject ? true : false, - key = 30803; - - // this eval is stop the compressor from - // renaming the variable to something shorter - eval("var batch = 30803;"); - - // Retrieve the child node from a particular - // parent at the specified index. - function child(parent, index){ - var i = 0, - n = parent.firstChild; - while(n){ - if(n.nodeType == 1){ - if(++i == index){ - return n; - } - } - n = n.nextSibling; - } - return null; - } - - // retrieve the next element node - function next(n){ - while((n = n.nextSibling) && n.nodeType != 1); - return n; - } - - // retrieve the previous element node - function prev(n){ - while((n = n.previousSibling) && n.nodeType != 1); - return n; - } - - // Mark each child node with a nodeIndex skipping and - // removing empty text nodes. - function children(parent){ - var n = parent.firstChild, - nodeIndex = -1, - nextNode; - while(n){ - nextNode = n.nextSibling; - // clean worthless empty nodes. - if(n.nodeType == 3 && !nonSpace.test(n.nodeValue)){ - parent.removeChild(n); - }else{ - // add an expando nodeIndex - n.nodeIndex = ++nodeIndex; - } - n = nextNode; - } - return this; - } - - - // nodeSet - array of nodes - // cls - CSS Class - function byClassName(nodeSet, cls){ - if(!cls){ - return nodeSet; - } - var result = [], ri = -1; - for(var i = 0, ci; ci = nodeSet[i]; i++){ - if((' '+ci.className+' ').indexOf(cls) != -1){ - result[++ri] = ci; - } - } - return result; - }; - - function attrValue(n, attr){ - // if its an array, use the first node. - 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]; - - }; - - - // ns - nodes - // mode - false, /, >, +, ~ - // tagName - defaults to "*" - function getNodes(ns, mode, tagName){ - var result = [], ri = -1, cs; - if(!ns){ - return result; - } - tagName = tagName || "*"; - // convert to array - if(typeof ns.getElementsByTagName != "undefined"){ - ns = [ns]; - } - - // no mode specified, grab all elements by tagName - // at any depth - 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; - } - } - // Direct Child mode (/ or >) - // E > F or E/F all direct children elements of E that have the tag - } else if(mode == "/" || mode == ">"){ - var utag = tagName.toUpperCase(); - for(var i = 0, ni, cn; ni = ns[i]; i++){ - cn = ni.childNodes; - for(var j = 0, cj; cj = cn[j]; j++){ - if(cj.nodeName == utag || cj.nodeName == tagName || tagName == '*'){ - result[++ri] = cj; - } - } - } - // Immediately Preceding mode (+) - // E + F all elements with the tag F that are immediately preceded by an element with the tag E - }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; - } - } - // Sibling mode (~) - // E ~ F all elements with the tag F that are preceded by a sibling element with the tag E - }else if(mode == "~"){ - var utag = tagName.toUpperCase(); - for(var i = 0, n; n = ns[i]; i++){ - while((n = n.nextSibling)){ - if (n.nodeName == utag || n.nodeName == tagName || tagName == '*'){ - 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 result = [], ri = -1; - tagName = tagName.toLowerCase(); - for(var i = 0, ci; ci = cs[i]; i++){ - if(ci.nodeType == 1 && ci.tagName.toLowerCase() == tagName){ - result[++ri] = ci; - } - } - return result; - } - - function byId(cs, id){ - if(cs.tagName || cs == document){ - cs = [cs]; - } - if(!id){ - return cs; - } - var result = [], ri = -1; - for(var i = 0, ci; ci = cs[i]; i++){ - if(ci && ci.id == id){ - result[++ri] = ci; - return result; - } - } - return result; - } - - // operators are =, !=, ^=, $=, *=, %=, |= and ~= - // custom can be "{" - function byAttribute(cs, attr, value, op, custom){ - var result = [], - ri = -1, - useGetStyle = custom == "{", - fn = Ext.DomQuery.operators[op], - a, - xml, - hasXml; - - for(var i = 0, ci; ci = cs[i]; i++){ - // skip non-element nodes. - if(ci.nodeType != 1){ - continue; - } - // only need to do this for the first node - if(!hasXml){ - xml = Ext.DomQuery.isXml(ci); - hasXml = true; - } - - // we only need to change the property names if we're dealing with html nodes, not XML - if(!xml){ - if(useGetStyle){ - a = Ext.DomQuery.getStyle(ci, attr); - } else if (attr == "class" || attr == "className"){ - a = ci.className; - } else if (attr == "for"){ - a = ci.htmlFor; - } else if (attr == "href"){ - // getAttribute href bug - // http://www.glennjones.net/Post/809/getAttributehrefbug.htm - a = ci.getAttribute("href", 2); - } else{ - a = ci.getAttribute(attr); - } - }else{ - a = ci.getAttribute(attr); - } - if((fn && fn(a, value)) || (!fn && a)){ - result[++ri] = ci; - } - } - return result; - } - - function byPseudo(cs, name, value){ - return Ext.DomQuery.pseudos[name](cs, value); - } - - function nodupIEXml(cs){ - var d = ++key, - r; - cs[0].setAttribute("_nodup", d); - 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, - r = []; - for(var i = 0, len = c1.length; i < len; i++){ - c1[i].setAttribute("_qdiff", d); - } - 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, - d = ++key, - r = []; - if(!len1){ - return c2; - } - if(isIE && typeof c1[0].selectSingleNode != "undefined"){ - return quickDiffIEXml(c1, c2); - } - for(var i = 0; i < len1; i++){ - c1[i]._qdiff = d; - } - 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, id); - } - - return { - getStyle : function(el, name){ - return Ext.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"; - - // setup fn preamble - var fn = ["var f = function(root){\n var mode; ++batch; var n = root || document;\n"], - mode, - lastPath, - matchers = Ext.DomQuery.matchers, - matchersLn = matchers.length, - modeMatch, - // accept leading mode switch - lmode = path.match(modeRe); - - if(lmode && lmode[1]){ - fn[fn.length] = 'mode="'+lmode[1].replace(trimRe, "")+'";'; - path = path.replace(lmode[1], ""); - } - - // strip leading slashes - while(path.substr(0, 1)=="/"){ - path = path.substr(1); - } - - while(path && lastPath != path){ - lastPath = path; - var tokenMatch = path.match(tagTokenRe); - if(type == "select"){ - if(tokenMatch){ - // ID Selector - if(tokenMatch[1] == "#"){ - fn[fn.length] = 'n = quickId(n, mode, root, "'+tokenMatch[2]+'");'; - }else{ - fn[fn.length] = 'n = getNodes(n, mode, "'+tokenMatch[2]+'");'; - } - path = path.replace(tokenMatch[0], ""); - }else if(path.substr(0, 1) != '@'){ - fn[fn.length] = 'n = getNodes(n, mode, "*");'; - } - // type of "simple" - }else{ - if(tokenMatch){ - if(tokenMatch[1] == "#"){ - fn[fn.length] = 'n = byId(n, "'+tokenMatch[2]+'");'; - }else{ - fn[fn.length] = 'n = byTag(n, "'+tokenMatch[2]+'");'; - } - path = path.replace(tokenMatch[0], ""); - } - } - while(!(modeMatch = path.match(modeRe))){ - var matched = false; - for(var j = 0; j < matchersLn; j++){ - var t = matchers[j]; - var m = path.match(t.re); - if(m){ - fn[fn.length] = t.select.replace(tplRe, function(x, i){ - return m[i]; - }); - path = path.replace(m[0], ""); - matched = true; - break; - } - } - // prevent infinite loop on bad selector - if(!matched){ - throw 'Error parsing selector, parsing failed at "' + path + '"'; - } - } - if(modeMatch[1]){ - fn[fn.length] = 'mode="'+modeMatch[1].replace(trimRe, "")+'";'; - path = path.replace(modeMatch[1], ""); - } - } - // close fn out - fn[fn.length] = "return nodup(n);\n}"; - - // eval fn and return it - 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/String} root (optional) The start of the query (defaults to document). - * @return {Array} An Array of DOM elements which match the selector. If there are - * no matches, and empty Array is returned. - */ - jsSelect: function(path, root, type){ - // set root to doc if not specified. - root = root || document; - - if(typeof root == "string"){ - root = document.getElementById(root); - } - var paths = path.split(","), - results = []; - - // loop over each selector - for(var i = 0, len = paths.length; i < len; i++){ - var subPath = paths[i].replace(trimRe, ""); - // compile and place in cache - if(!cache[subPath]){ - cache[subPath] = Ext.DomQuery.compile(subPath); - if(!cache[subPath]){ - throw subPath + " is not a valid selector"; - } - } - var result = cache[subPath](root); - if(result && result != document){ - results = results.concat(result); - } - } - - // if there were multiple selectors, make sure dups - // are eliminated - if(paths.length > 1){ - return nodup(results); - } - return results; - }, - isXml: function(el) { - var docEl = (el ? el.ownerDocument || el : 0).documentElement; - return docEl ? docEl.nodeName !== "HTML" : false; - }, - select : document.querySelectorAll ? function(path, root, type) { - root = root || document; - if (!Ext.DomQuery.isXml(root)) { - try { - var cs = root.querySelectorAll(path); - return Ext.toArray(cs); - } - catch (ex) {} - } - return Ext.DomQuery.jsSelect.call(this, path, root, type); - } : function(path, root, type) { - return Ext.DomQuery.jsSelect.call(this, path, root, type); - }, - - /** - * 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} The DOM element which matched the selector. - */ - selectNode : function(path, root){ - return Ext.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 - * @return {String} - */ - selectValue : function(path, root, defaultValue){ - path = path.replace(trimRe, ""); - if(!valueCache[path]){ - valueCache[path] = Ext.DomQuery.compile(path, "select"); - } - var n = valueCache[path](root), v; - n = n[0] ? n[0] : n; - - // overcome a limitation of maximum textnode size - // Rumored to potentially crash IE6 but has not been confirmed. - // http://reference.sitepoint.com/javascript/Node/normalize - // https://developer.mozilla.org/En/DOM/Node.normalize - if (typeof n.normalize == 'function') n.normalize(); - - 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. Returns the defaultValue, or 0 if none is specified. - * @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 = Ext.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 = Ext.isArray(el), - result = Ext.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} An Array of DOM elements which match the selector. If there are - * no matches, and empty Array is returned. - */ - filter : function(els, ss, nonMatches){ - ss = ss.replace(trimRe, ""); - if(!simpleCache[ss]){ - simpleCache[ss] = Ext.DomQuery.compile(ss, "simple"); - } - var result = simpleCache[ss](els); - return nonMatches ? quickDiff(result, els) : result; - }, - - /** - * Collection of matching regular expressions and code snippets. - * Each capture group within () will be replace the {} in the select - * statement as specified by their index. - */ - matchers : [{ - re: /^\.([\w-]+)/, - select: 'n = byClassName(n, " {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, "{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 c= where c is any character other than space, > <. - */ - 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; - } - }, - - /** - *

    Object hash of "pseudo class" filter functions which are used when filtering selections. Each function is passed - * two parameters:

      - *
    • c : Array
      An Array of DOM elements to filter.
    • - *
    • v : String
      The argument (if any) supplied in the selector.
    • - *
    - *

    A filter function returns an Array of DOM elements which conform to the pseudo class.

    - *

    In addition to the provided pseudo classes listed above such as first-child and nth-child, - * developers may add additional, custom psuedo class filters to select elements according to application-specific requirements.

    - *

    For example, to filter <a> elements to only return links to external resources:

    - *
    -Ext.DomQuery.pseudos.external = function(c, v){
    -    var r = [], ri = -1;
    -    for(var i = 0, ci; ci = c[i]; i++){
    -//      Include in result set only if it's a link to an external resource
    -        if(ci.hostname != location.hostname){
    -            r[++ri] = ci;
    -        }
    -    }
    -    return r;
    -};
    - * Then external links could be gathered with the following statement:
    -var externalLinks = Ext.select("a:external");
    -
    - */ - 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, - m = nthRe.exec(a == "even" && "2n" || a == "odd" && "2n+1" || !nthRe2.test(a) && "n+" + a || a), - 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 Ext.DomQuery.filter(c, ss, true); - }, - - "any" : function(c, selectors){ - var ss = selectors.split('|'), - r = [], ri = -1, s; - for(var i = 0, ci; ci = c[i]; i++){ - for(var j = 0; s = ss[j]; j++){ - if(Ext.DomQuery.is(ci, s)){ - r[++ri] = ci; - break; - } - } - } - return r; - }, - - "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 = Ext.DomQuery.select, - 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 = Ext.DomQuery.is, - 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 = Ext.DomQuery.is, - 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 Ext.DomQuery#select} - * @param {String} path The selector/xpath query - * @param {Node} root (optional) The start of the query (defaults to document). - * @return {Array} - * @member Ext - * @method query - */ -Ext.query = Ext.DomQuery.select; diff --git a/assets/js/ext/src/ext-core/src/core/Element.fx.js b/assets/js/ext/src/ext-core/src/core/Element.fx.js deleted file mode 100644 index 964385d..0000000 --- a/assets/js/ext/src/ext-core/src/core/Element.fx.js +++ /dev/null @@ -1,421 +0,0 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.com/license - */ -/** - * @class Ext.Element - */ -/** - * Visibility mode constant for use with {@link #setVisibilityMode}. Use visibility to hide element - * @static - * @type Number - */ -Ext.Element.VISIBILITY = 1; -/** - * Visibility mode constant for use with {@link #setVisibilityMode}. Use display to hide element - * @static - * @type Number - */ -Ext.Element.DISPLAY = 2; - -/** - * Visibility mode constant for use with {@link #setVisibilityMode}. Use offsets (x and y positioning offscreen) - * to hide element. - * @static - * @type Number - */ -Ext.Element.OFFSETS = 3; - - -Ext.Element.ASCLASS = 4; - -/** - * Defaults to 'x-hide-nosize' - * @static - * @type String - */ -Ext.Element.visibilityCls = 'x-hide-nosize'; - -Ext.Element.addMethods(function(){ - var El = Ext.Element, - OPACITY = "opacity", - VISIBILITY = "visibility", - DISPLAY = "display", - HIDDEN = "hidden", - OFFSETS = "offsets", - ASCLASS = "asclass", - NONE = "none", - NOSIZE = 'nosize', - ORIGINALDISPLAY = 'originalDisplay', - VISMODE = 'visibilityMode', - ISVISIBLE = 'isVisible', - data = El.data, - getDisplay = function(dom){ - var d = data(dom, ORIGINALDISPLAY); - if(d === undefined){ - data(dom, ORIGINALDISPLAY, d = ''); - } - return d; - }, - getVisMode = function(dom){ - var m = data(dom, VISMODE); - if(m === undefined){ - data(dom, VISMODE, m = 1); - } - return m; - }; - - return { - /** - * The element's default display mode (defaults to "") - * @type String - */ - originalDisplay : "", - visibilityMode : 1, - - /** - * 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 {Number} visMode Ext.Element.VISIBILITY or Ext.Element.DISPLAY - * @return {Ext.Element} this - */ - setVisibilityMode : function(visMode){ - data(this.dom, VISMODE, visMode); - return this; - }, - - /** - * Perform custom animation on this element. - *
      - *
    • Animation Properties
    • - * - *

      The Animation Control Object enables gradual transitions for any member of an - * element's style object that takes a numeric value including but not limited to - * these properties:

        - *
      • bottom, top, left, right
      • - *
      • height, width
      • - *
      • margin, padding
      • - *
      • borderWidth
      • - *
      • opacity
      • - *
      • fontSize
      • - *
      • lineHeight
      • - *
      - * - * - *
    • Animation Property Attributes
    • - * - *

      Each Animation Property is a config object with optional properties:

      - *
        - *
      • by* : relative change - start at current value, change by this value
      • - *
      • from : ignore current value, start from this value
      • - *
      • to* : start at current value, go to this value
      • - *
      • unit : any allowable unit specification
      • - *

        * do not specify both to and by for an animation property

        - *
      - * - *
    • Animation Types
    • - * - *

      The supported animation types:

        - *
      • 'run' : Default - *
        
        -var el = Ext.get('complexEl');
        -el.animate(
        -    // animation control object
        -    {
        -        borderWidth: {to: 3, from: 0},
        -        opacity: {to: .3, from: 1},
        -        height: {to: 50, from: el.getHeight()},
        -        width: {to: 300, from: el.getWidth()},
        -        top  : {by: - 100, unit: 'px'},
        -    },
        -    0.35,      // animation duration
        -    null,      // callback
        -    'easeOut', // easing method
        -    'run'      // animation type ('run','color','motion','scroll')
        -);
        -         * 
        - *
      • - *
      • 'color' - *

        Animates transition of background, text, or border colors.

        - *
        
        -el.animate(
        -    // animation control object
        -    {
        -        color: { to: '#06e' },
        -        backgroundColor: { to: '#e06' }
        -    },
        -    0.35,      // animation duration
        -    null,      // callback
        -    'easeOut', // easing method
        -    'color'    // animation type ('run','color','motion','scroll')
        -);
        -         * 
        - *
      • - * - *
      • 'motion' - *

        Animates the motion of an element to/from specific points using optional bezier - * way points during transit.

        - *
        
        -el.animate(
        -    // animation control object
        -    {
        -        borderWidth: {to: 3, from: 0},
        -        opacity: {to: .3, from: 1},
        -        height: {to: 50, from: el.getHeight()},
        -        width: {to: 300, from: el.getWidth()},
        -        top  : {by: - 100, unit: 'px'},
        -        points: {
        -            to: [50, 100],  // go to this point
        -            control: [      // optional bezier way points
        -                [ 600, 800],
        -                [-100, 200]
        -            ]
        -        }
        -    },
        -    3000,      // animation duration (milliseconds!)
        -    null,      // callback
        -    'easeOut', // easing method
        -    'motion'   // animation type ('run','color','motion','scroll')
        -);
        -         * 
        - *
      • - *
      • 'scroll' - *

        Animate horizontal or vertical scrolling of an overflowing page element.

        - *
        
        -el.animate(
        -    // animation control object
        -    {
        -        scroll: {to: [400, 300]}
        -    },
        -    0.35,      // animation duration
        -    null,      // callback
        -    'easeOut', // easing method
        -    'scroll'   // animation type ('run','color','motion','scroll')
        -);
        -         * 
        - *
      • - *
      - * - *
    - * - * @param {Object} args The 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) {@link Ext.Fx#easing} method to use (defaults to 'easeOut') - * @param {String} animType (optional) 'run' is the default. Can also be 'color', - * 'motion', or 'scroll' - * @return {Ext.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 me = this, - anim = Ext.lib.Anim[animType]( - me.dom, - args, - (opt.duration || defaultDur) || .35, - (opt.easing || defaultEase) || 'easeOut', - function(){ - if(cb) cb.call(me); - if(opt.callback) opt.callback.call(opt.scope || me, me, opt); - }, - me - ); - 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]}); - }, - - /** - * Checks whether the element is currently visible using both visibility and display properties. - * @return {Boolean} True if the element is currently visible, else false - */ - isVisible : function() { - var me = this, - dom = me.dom, - visible = data(dom, ISVISIBLE); - - if(typeof visible == 'boolean'){ //return the cached value if registered - return visible; - } - //Determine the current state based on display states - visible = !me.isStyle(VISIBILITY, HIDDEN) && - !me.isStyle(DISPLAY, NONE) && - !((getVisMode(dom) == El.ASCLASS) && me.hasClass(me.visibilityCls || El.visibilityCls)); - - data(dom, ISVISIBLE, visible); - return visible; - }, - - /** - * 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 {Ext.Element} this - */ - setVisible : function(visible, animate){ - var me = this, isDisplay, isVisibility, isOffsets, isNosize, - dom = me.dom, - visMode = getVisMode(dom); - - - // hideMode string override - if (typeof animate == 'string'){ - switch (animate) { - case DISPLAY: - visMode = El.DISPLAY; - break; - case VISIBILITY: - visMode = El.VISIBILITY; - break; - case OFFSETS: - visMode = El.OFFSETS; - break; - case NOSIZE: - case ASCLASS: - visMode = El.ASCLASS; - break; - } - me.setVisibilityMode(visMode); - animate = false; - } - - if (!animate || !me.anim) { - if(visMode == El.ASCLASS ){ - - me[visible?'removeClass':'addClass'](me.visibilityCls || El.visibilityCls); - - } else if (visMode == El.DISPLAY){ - - return me.setDisplayed(visible); - - } else if (visMode == El.OFFSETS){ - - if (!visible){ - me.hideModeStyles = { - position: me.getStyle('position'), - top: me.getStyle('top'), - left: me.getStyle('left') - }; - me.applyStyles({position: 'absolute', top: '-10000px', left: '-10000px'}); - } else { - me.applyStyles(me.hideModeStyles || {position: '', top: '', left: ''}); - delete me.hideModeStyles; - } - - }else{ - me.fixDisplay(); - dom.style.visibility = visible ? "visible" : HIDDEN; - } - }else{ - // closure for composites - if(visible){ - me.setOpacity(.01); - me.setVisible(true); - } - me.anim({opacity: { to: (visible?1:0) }}, - me.preanim(arguments, 1), - null, - .35, - 'easeIn', - function(){ - visible || me.setVisible(false).setOpacity(1); - }); - } - data(dom, ISVISIBLE, visible); //set logical visibility state - return me; - }, - - - /** - * @private - * Determine if the Element has a relevant height and width available based - * upon current logical visibility state - */ - hasMetrics : function(){ - var dom = this.dom; - return this.isVisible() || (getVisMode(dom) == El.VISIBILITY); - }, - - /** - * 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 {Ext.Element} this - */ - toggle : function(animate){ - var me = this; - me.setVisible(!me.isVisible(), me.preanim(arguments, 0)); - return me; - }, - - /** - * Sets the CSS display property. Uses originalDisplay if the specified value is a boolean true. - * @param {Mixed} value Boolean value to display the element using its default display, or a string to set the display directly. - * @return {Ext.Element} this - */ - setDisplayed : function(value) { - if(typeof value == "boolean"){ - value = value ? getDisplay(this.dom) : NONE; - } - this.setStyle(DISPLAY, value); - return this; - }, - - // private - fixDisplay : function(){ - var me = this; - if(me.isStyle(DISPLAY, NONE)){ - me.setStyle(VISIBILITY, HIDDEN); - me.setStyle(DISPLAY, getDisplay(this.dom)); // first try reverting to default - if(me.isStyle(DISPLAY, NONE)){ // if that fails, default to block - me.setStyle(DISPLAY, "block"); - } - } - }, - - /** - * 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 {Ext.Element} this - */ - hide : function(animate){ - // hideMode override - if (typeof animate == 'string'){ - this.setVisible(false, animate); - return this; - } - 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 {Ext.Element} this - */ - show : function(animate){ - // hideMode override - if (typeof animate == 'string'){ - this.setVisible(true, animate); - return this; - } - this.setVisible(true, this.preanim(arguments, 0)); - return this; - } - }; -}()); \ No newline at end of file diff --git a/assets/js/ext/src/ext-core/src/core/Element.insertion.js b/assets/js/ext/src/ext-core/src/core/Element.insertion.js deleted file mode 100644 index 530f1a7..0000000 --- a/assets/js/ext/src/ext-core/src/core/Element.insertion.js +++ /dev/null @@ -1,145 +0,0 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.com/license - */ -/** - * @class Ext.Element - */ -Ext.Element.addMethods( -function() { - var GETDOM = Ext.getDom, - GET = Ext.get, - DH = Ext.DomHelper; - - return { - /** - * Appends the passed element(s) to this element - * @param {String/HTMLElement/Array/Element/CompositeElement} el - * @return {Ext.Element} this - */ - appendChild: function(el){ - return GET(el).appendTo(this); - }, - - /** - * Appends this element to the passed element - * @param {Mixed} el The new parent element - * @return {Ext.Element} this - */ - appendTo: function(el){ - GETDOM(el).appendChild(this.dom); - return this; - }, - - /** - * Inserts this element before the passed element in the DOM - * @param {Mixed} el The element before which this element will be inserted - * @return {Ext.Element} this - */ - insertBefore: function(el){ - (el = GETDOM(el)).parentNode.insertBefore(this.dom, el); - return this; - }, - - /** - * Inserts this element after the passed element in the DOM - * @param {Mixed} el The element to insert after - * @return {Ext.Element} this - */ - insertAfter: function(el){ - (el = GETDOM(el)).parentNode.insertBefore(this.dom, el.nextSibling); - return this; - }, - - /** - * Inserts (or creates) an element (or DomHelper config) as the first child of this element - * @param {Mixed/Object} el The id or element to insert or a DomHelper config to create and insert - * @return {Ext.Element} The new child - */ - insertFirst: function(el, returnDom){ - el = el || {}; - if(el.nodeType || el.dom || typeof el == 'string'){ // element - el = GETDOM(el); - this.dom.insertBefore(el, this.dom.firstChild); - return !returnDom ? GET(el) : el; - }else{ // dh config - return this.createChild(el, this.dom.firstChild, returnDom); - } - }, - - /** - * Replaces the passed element with this element - * @param {Mixed} el The element to replace - * @return {Ext.Element} this - */ - replace: function(el){ - el = GET(el); - this.insertBefore(el); - el.remove(); - return this; - }, - - /** - * Replaces this element with the passed element - * @param {Mixed/Object} el The new element or a DomHelper config of an element to create - * @return {Ext.Element} this - */ - replaceWith: function(el){ - var me = this; - - if(el.nodeType || el.dom || typeof el == 'string'){ - el = GETDOM(el); - me.dom.parentNode.insertBefore(el, me.dom); - }else{ - el = DH.insertBefore(me.dom, el); - } - - delete Ext.elCache[me.id]; - Ext.removeNode(me.dom); - me.id = Ext.id(me.dom = el); - Ext.Element.addToCache(me.isFlyweight ? new Ext.Element(me.dom) : me); - return me; - }, - - /** - * 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 {Ext.Element} The new child element - */ - createChild: function(config, insertBefore, returnDom){ - config = config || {tag:'div'}; - return insertBefore ? - DH.insertBefore(insertBefore, config, returnDom !== true) : - DH[!this.dom.firstChild ? 'overwrite' : 'append'](this.dom, config, returnDom !== true); - }, - - /** - * 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 Ext.Element - * @return {HTMLElement/Element} The newly created wrapper element - */ - wrap: function(config, returnDom){ - var newEl = DH.insertBefore(this.dom, config || {tag: "div"}, !returnDom); - newEl.dom ? newEl.dom.appendChild(this.dom) : newEl.appendChild(this.dom); - return newEl; - }, - - /** - * Inserts an html fragment into this element - * @param {String} where Where to insert the html in relation to this element - beforeBegin, afterBegin, beforeEnd, afterEnd. - * @param {String} html The HTML fragment - * @param {Boolean} returnEl (optional) True to return an Ext.Element (defaults to false) - * @return {HTMLElement/Ext.Element} The inserted node (or nearest related if more than 1 inserted) - */ - insertHtml : function(where, html, returnEl){ - var el = DH.insertHtml(where, this.dom, html); - return returnEl ? Ext.get(el) : el; - } - }; -}()); \ No newline at end of file diff --git a/assets/js/ext/src/ext-core/src/core/Element.js b/assets/js/ext/src/ext-core/src/core/Element.js deleted file mode 100644 index b3b11f8..0000000 --- a/assets/js/ext/src/ext-core/src/core/Element.js +++ /dev/null @@ -1,985 +0,0 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.com/license - */ -/** - * @class Ext.Element - *

    Encapsulates a DOM element, adding simple DOM manipulation facilities, normalizing for browser differences.

    - *

    All instances of this class inherit the methods of {@link Ext.Fx} making visual effects easily available to all DOM elements.

    - *

    Note that the events documented in this class are not Ext events, they encapsulate browser events. To - * access the underlying browser event, see {@link Ext.EventObject#browserEvent}. Some older - * browsers may not support the full range of events. Which events are supported is beyond the control of ExtJs.

    - * Usage:
    -
    
    -// by id
    -var el = Ext.get("my-div");
    -
    -// by DOM element reference
    -var el = Ext.get(myDivElement);
    -
    - * Animations
    - *

    When an element is manipulated, by default there is no animation.

    - *
    
    -var el = Ext.get("my-div");
    -
    -// no animation
    -el.setWidth(100);
    - * 
    - *

    Many of the functions for manipulating an element have an optional "animate" parameter. This - * parameter can be specified as boolean (true) for default animation effects.

    - *
    
    -// default animation
    -el.setWidth(100, true);
    - * 
    - * - *

    To configure the effects, an object literal with animation options to use as the Element animation - * configuration object can also be specified. Note that the supported Element animation configuration - * options are a subset of the {@link Ext.Fx} animation options specific to Fx effects. The supported - * Element animation configuration options are:

    -
    -Option    Default   Description
    ---------- --------  ---------------------------------------------
    -{@link Ext.Fx#duration duration}  .35       The duration of the animation in seconds
    -{@link Ext.Fx#easing easing}    easeOut   The easing method
    -{@link Ext.Fx#callback callback}  none      A function to execute when the anim completes
    -{@link Ext.Fx#scope scope}     this      The scope (this) of the callback function
    -
    - * - *
    
    -// Element animation options object
    -var opt = {
    -    {@link Ext.Fx#duration duration}: 1,
    -    {@link Ext.Fx#easing easing}: 'elasticIn',
    -    {@link Ext.Fx#callback callback}: this.foo,
    -    {@link Ext.Fx#scope scope}: this
    -};
    -// animation with some options set
    -el.setWidth(100, opt);
    - * 
    - *

    The Element animation object being used for the animation will be set on the options - * object as "anim", which allows you to stop or manipulate the animation. Here is an example:

    - *
    
    -// using the "anim" property to get the Anim object
    -if(opt.anim.isAnimated()){
    -    opt.anim.stop();
    -}
    - * 
    - *

    Also see the {@link #animate} method for another animation technique.

    - *

    Composite (Collections of) Elements

    - *

    For working with collections of Elements, see {@link Ext.CompositeElement}

    - * @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). - */ -(function(){ -var DOC = document; - -Ext.Element = function(element, forceNew){ - var dom = typeof element == "string" ? - DOC.getElementById(element) : element, - id; - - if(!dom) return null; - - id = dom.id; - - if(!forceNew && id && Ext.elCache[id]){ // element object already exists - return Ext.elCache[id].el; - } - - /** - * The DOM element - * @type HTMLElement - */ - this.dom = dom; - - /** - * The DOM element ID - * @type String - */ - this.id = id || Ext.id(dom); -}; - -var DH = Ext.DomHelper, - El = Ext.Element, - EC = Ext.elCache; - -El.prototype = { - /** - * 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 {Ext.Element} this - */ - set : function(o, useSet){ - var el = this.dom, - attr, - val, - useSet = (useSet !== false) && !!el.setAttribute; - - for (attr in o) { - if (o.hasOwnProperty(attr)) { - val = o[attr]; - if (attr == 'style') { - DH.applyStyles(el, val); - } else if (attr == 'cls') { - el.className = val; - } else if (useSet) { - el.setAttribute(attr, val); - } else { - el[attr] = val; - } - } - } - return this; - }, - -// Mouse events - /** - * @event click - * Fires when a mouse click is detected within the element. - * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event. - * @param {HtmlElement} t The target of the event. - * @param {Object} o The options configuration passed to the {@link #addListener} call. - */ - /** - * @event contextmenu - * Fires when a right click is detected within the element. - * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event. - * @param {HtmlElement} t The target of the event. - * @param {Object} o The options configuration passed to the {@link #addListener} call. - */ - /** - * @event dblclick - * Fires when a mouse double click is detected within the element. - * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event. - * @param {HtmlElement} t The target of the event. - * @param {Object} o The options configuration passed to the {@link #addListener} call. - */ - /** - * @event mousedown - * Fires when a mousedown is detected within the element. - * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event. - * @param {HtmlElement} t The target of the event. - * @param {Object} o The options configuration passed to the {@link #addListener} call. - */ - /** - * @event mouseup - * Fires when a mouseup is detected within the element. - * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event. - * @param {HtmlElement} t The target of the event. - * @param {Object} o The options configuration passed to the {@link #addListener} call. - */ - /** - * @event mouseover - * Fires when a mouseover is detected within the element. - * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event. - * @param {HtmlElement} t The target of the event. - * @param {Object} o The options configuration passed to the {@link #addListener} call. - */ - /** - * @event mousemove - * Fires when a mousemove is detected with the element. - * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event. - * @param {HtmlElement} t The target of the event. - * @param {Object} o The options configuration passed to the {@link #addListener} call. - */ - /** - * @event mouseout - * Fires when a mouseout is detected with the element. - * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event. - * @param {HtmlElement} t The target of the event. - * @param {Object} o The options configuration passed to the {@link #addListener} call. - */ - /** - * @event mouseenter - * Fires when the mouse enters the element. - * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event. - * @param {HtmlElement} t The target of the event. - * @param {Object} o The options configuration passed to the {@link #addListener} call. - */ - /** - * @event mouseleave - * Fires when the mouse leaves the element. - * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event. - * @param {HtmlElement} t The target of the event. - * @param {Object} o The options configuration passed to the {@link #addListener} call. - */ - -// Keyboard events - /** - * @event keypress - * Fires when a keypress is detected within the element. - * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event. - * @param {HtmlElement} t The target of the event. - * @param {Object} o The options configuration passed to the {@link #addListener} call. - */ - /** - * @event keydown - * Fires when a keydown is detected within the element. - * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event. - * @param {HtmlElement} t The target of the event. - * @param {Object} o The options configuration passed to the {@link #addListener} call. - */ - /** - * @event keyup - * Fires when a keyup is detected within the element. - * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event. - * @param {HtmlElement} t The target of the event. - * @param {Object} o The options configuration passed to the {@link #addListener} call. - */ - - -// HTML frame/object events - /** - * @event load - * Fires when the user agent finishes loading all content within the element. Only supported by window, frames, objects and images. - * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event. - * @param {HtmlElement} t The target of the event. - * @param {Object} o The options configuration passed to the {@link #addListener} call. - */ - /** - * @event unload - * Fires when the user agent removes all content from a window or frame. For elements, it fires when the target element or any of its content has been removed. - * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event. - * @param {HtmlElement} t The target of the event. - * @param {Object} o The options configuration passed to the {@link #addListener} call. - */ - /** - * @event abort - * Fires when an object/image is stopped from loading before completely loaded. - * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event. - * @param {HtmlElement} t The target of the event. - * @param {Object} o The options configuration passed to the {@link #addListener} call. - */ - /** - * @event error - * Fires when an object/image/frame cannot be loaded properly. - * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event. - * @param {HtmlElement} t The target of the event. - * @param {Object} o The options configuration passed to the {@link #addListener} call. - */ - /** - * @event resize - * Fires when a document view is resized. - * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event. - * @param {HtmlElement} t The target of the event. - * @param {Object} o The options configuration passed to the {@link #addListener} call. - */ - /** - * @event scroll - * Fires when a document view is scrolled. - * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event. - * @param {HtmlElement} t The target of the event. - * @param {Object} o The options configuration passed to the {@link #addListener} call. - */ - -// Form events - /** - * @event select - * Fires when a user selects some text in a text field, including input and textarea. - * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event. - * @param {HtmlElement} t The target of the event. - * @param {Object} o The options configuration passed to the {@link #addListener} call. - */ - /** - * @event change - * Fires when a control loses the input focus and its value has been modified since gaining focus. - * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event. - * @param {HtmlElement} t The target of the event. - * @param {Object} o The options configuration passed to the {@link #addListener} call. - */ - /** - * @event submit - * Fires when a form is submitted. - * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event. - * @param {HtmlElement} t The target of the event. - * @param {Object} o The options configuration passed to the {@link #addListener} call. - */ - /** - * @event reset - * Fires when a form is reset. - * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event. - * @param {HtmlElement} t The target of the event. - * @param {Object} o The options configuration passed to the {@link #addListener} call. - */ - /** - * @event focus - * Fires when an element receives focus either via the pointing device or by tab navigation. - * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event. - * @param {HtmlElement} t The target of the event. - * @param {Object} o The options configuration passed to the {@link #addListener} call. - */ - /** - * @event blur - * Fires when an element loses focus either via the pointing device or by tabbing navigation. - * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event. - * @param {HtmlElement} t The target of the event. - * @param {Object} o The options configuration passed to the {@link #addListener} call. - */ - -// User Interface events - /** - * @event DOMFocusIn - * Where supported. Similar to HTML focus event, but can be applied to any focusable element. - * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event. - * @param {HtmlElement} t The target of the event. - * @param {Object} o The options configuration passed to the {@link #addListener} call. - */ - /** - * @event DOMFocusOut - * Where supported. Similar to HTML blur event, but can be applied to any focusable element. - * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event. - * @param {HtmlElement} t The target of the event. - * @param {Object} o The options configuration passed to the {@link #addListener} call. - */ - /** - * @event DOMActivate - * Where supported. Fires when an element is activated, for instance, through a mouse click or a keypress. - * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event. - * @param {HtmlElement} t The target of the event. - * @param {Object} o The options configuration passed to the {@link #addListener} call. - */ - -// DOM Mutation events - /** - * @event DOMSubtreeModified - * Where supported. Fires when the subtree is modified. - * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event. - * @param {HtmlElement} t The target of the event. - * @param {Object} o The options configuration passed to the {@link #addListener} call. - */ - /** - * @event DOMNodeInserted - * Where supported. Fires when a node has been added as a child of another node. - * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event. - * @param {HtmlElement} t The target of the event. - * @param {Object} o The options configuration passed to the {@link #addListener} call. - */ - /** - * @event DOMNodeRemoved - * Where supported. Fires when a descendant node of the element is removed. - * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event. - * @param {HtmlElement} t The target of the event. - * @param {Object} o The options configuration passed to the {@link #addListener} call. - */ - /** - * @event DOMNodeRemovedFromDocument - * Where supported. Fires when a node is being removed from a document. - * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event. - * @param {HtmlElement} t The target of the event. - * @param {Object} o The options configuration passed to the {@link #addListener} call. - */ - /** - * @event DOMNodeInsertedIntoDocument - * Where supported. Fires when a node is being inserted into a document. - * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event. - * @param {HtmlElement} t The target of the event. - * @param {Object} o The options configuration passed to the {@link #addListener} call. - */ - /** - * @event DOMAttrModified - * Where supported. Fires when an attribute has been modified. - * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event. - * @param {HtmlElement} t The target of the event. - * @param {Object} o The options configuration passed to the {@link #addListener} call. - */ - /** - * @event DOMCharacterDataModified - * Where supported. Fires when the character data has been modified. - * @param {Ext.EventObject} e The {@link Ext.EventObject} encapsulating the DOM event. - * @param {HtmlElement} t The target of the event. - * @param {Object} o The options configuration passed to the {@link #addListener} call. - */ - - /** - * The default unit to append to CSS values where a unit isn't provided (defaults to px). - * @type String - */ - defaultUnit : "px", - - /** - * 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 Ext.DomQuery.is(this.dom, simpleSelector); - }, - - /** - * Tries to focus the element. Any exceptions are caught and ignored. - * @param {Number} defer (optional) Milliseconds to defer the focus - * @return {Ext.Element} this - */ - focus : function(defer, /* private */ dom) { - var me = this, - dom = dom || me.dom; - try{ - if(Number(defer)){ - me.focus.defer(defer, null, [null, dom]); - }else{ - dom.focus(); - } - }catch(e){} - return me; - }, - - /** - * Tries to blur the element. Any exceptions are caught and ignored. - * @return {Ext.Element} this - */ - blur : function() { - try{ - this.dom.blur(); - }catch(e){} - return this; - }, - - /** - * Returns the value of the "value" attribute - * @param {Boolean} asNumber true to parse the value as a number - * @return {String/Number} - */ - getValue : function(asNumber){ - var val = this.dom.value; - return asNumber ? parseInt(val, 10) : val; - }, - - /** - * Appends an event handler to this element. The shorthand version {@link #on} is equivalent. - * @param {String} eventName The name of event to handle. - * @param {Function} fn The handler function the event invokes. This function is passed - * the following parameters:
      - *
    • evt : EventObject
      The {@link Ext.EventObject EventObject} describing the event.
    • - *
    • el : HtmlElement
      The DOM element which was the target of the event. - * Note that this may be filtered by using the delegate option.
    • - *
    • o : Object
      The options object from the addListener call.
    • - *
    - * @param {Object} scope (optional) The scope (this reference) in which the handler function is executed. - * If omitted, defaults to this Element.. - * @param {Object} options (optional) An object containing handler configuration properties. - * This may contain any of the following properties:
      - *
    • scope Object :
      The scope (this reference) in which the handler function is executed. - * If omitted, defaults to this Element.
    • - *
    • delegate String:
      A simple selector to filter the target or look for a descendant of the target. See below for additional details.
    • - *
    • stopEvent Boolean:
      True to stop the event. That is stop propagation, and prevent the default action.
    • - *
    • preventDefault Boolean:
      True to prevent the default action
    • - *
    • stopPropagation Boolean:
      True to prevent event propagation
    • - *
    • normalized Boolean:
      False to pass a browser event to the handler function instead of an Ext.EventObject
    • - *
    • target Ext.Element:
      Only call the handler if the event was fired on the target Element, not if the event was bubbled up from a child node.
    • - *
    • delay Number:
      The number of milliseconds to delay the invocation of the handler after the event fires.
    • - *
    • single Boolean:
      True to add a handler to handle just the next firing of the event, and then remove itself.
    • - *
    • buffer Number:
      Causes the handler to be scheduled to run in an {@link Ext.util.DelayedTask} delayed - * by the specified number of milliseconds. If the event fires again within that time, the original - * handler is not invoked, but the new handler is scheduled in its place.
    • - *

    - *

    - * Combining Options
    - * In the following examples, the shorthand form {@link #on} is used rather than the more verbose - * addListener. The two are equivalent. Using the options argument, it is possible to combine different - * types of listeners:
    - *
    - * A delayed, one-time listener that auto stops the event and adds a custom argument (forumId) to the - * options object. The options object is available as the third parameter in the handler function.

    - * Code:
    
    -el.on('click', this.onClick, this, {
    -    single: true,
    -    delay: 100,
    -    stopEvent : true,
    -    forumId: 4
    -});

    - *

    - * Attaching multiple handlers in 1 call
    - * The method also allows for a single argument to be passed which is a config object containing properties - * which specify multiple handlers.

    - *

    - * Code:

    
    -el.on({
    -    'click' : {
    -        fn: this.onClick,
    -        scope: this,
    -        delay: 100
    -    },
    -    'mouseover' : {
    -        fn: this.onMouseOver,
    -        scope: this
    -    },
    -    'mouseout' : {
    -        fn: this.onMouseOut,
    -        scope: this
    -    }
    -});
    - *

    - * Or a shorthand syntax:
    - * Code:

    -el.on({ - 'click' : this.onClick, - 'mouseover' : this.onMouseOver, - 'mouseout' : this.onMouseOut, - scope: this -}); - *

    - *

    delegate

    - *

    This is a configuration option that you can pass along when registering a handler for - * an event to assist with event delegation. Event delegation is a technique that is used to - * reduce memory consumption and prevent exposure to memory-leaks. By registering an event - * for a container element as opposed to each element within a container. By setting this - * configuration option to a simple selector, the target element will be filtered to look for - * a descendant of the target. - * For example:

    
    -// using this markup:
    -<div id='elId'>
    -    <p id='p1'>paragraph one</p>
    -    <p id='p2' class='clickable'>paragraph two</p>
    -    <p id='p3'>paragraph three</p>
    -</div>
    -// utilize event delegation to registering just one handler on the container element:
    -el = Ext.get('elId');
    -el.on(
    -    'click',
    -    function(e,t) {
    -        // handle click
    -        console.info(t.id); // 'p2'
    -    },
    -    this,
    -    {
    -        // filter the target element to be a descendant with the class 'clickable'
    -        delegate: '.clickable'
    -    }
    -);
    -     * 

    - * @return {Ext.Element} this - */ - addListener : function(eventName, fn, scope, options){ - Ext.EventManager.on(this.dom, eventName, fn, scope || this, options); - return this; - }, - - /** - * Removes an event handler from this element. The shorthand version {@link #un} is equivalent. - * Note: if a scope was explicitly specified when {@link #addListener adding} the - * listener, the same scope must be specified here. - * Example: - *
    
    -el.removeListener('click', this.handlerFn);
    -// or
    -el.un('click', this.handlerFn);
    -
    - * @param {String} eventName The name of the event from which to remove the handler. - * @param {Function} fn The handler function to remove. This must be a reference to the function passed into the {@link #addListener} call. - * @param {Object} scope If a scope (this reference) was specified when the listener was added, - * then this must refer to the same object. - * @return {Ext.Element} this - */ - removeListener : function(eventName, fn, scope){ - Ext.EventManager.removeListener(this.dom, eventName, fn, scope || this); - return this; - }, - - /** - * Removes all previous added listeners from this element - * @return {Ext.Element} this - */ - removeAllListeners : function(){ - Ext.EventManager.removeAll(this.dom); - return this; - }, - - /** - * Recursively removes all previous added listeners from this element and its children - * @return {Ext.Element} this - */ - purgeAllListeners : function() { - Ext.EventManager.purgeElement(this, true); - return this; - }, - /** - * @private Test if size has a unit, otherwise appends the default - */ - addUnits : function(size){ - if(size === "" || size == "auto" || size === undefined){ - size = size || ''; - } else if(!isNaN(size) || !unitPattern.test(size)){ - size = size + (this.defaultUnit || 'px'); - } - return size; - }, - - /** - *

    Updates the innerHTML of this Element - * from a specified URL. Note that this is subject to the Same Origin Policy

    - *

    Updating innerHTML of an element will not execute embedded <script> elements. This is a browser restriction.

    - * @param {Mixed} options. Either a sring containing the URL from which to load the HTML, or an {@link Ext.Ajax#request} options object specifying - * exactly how to request the HTML. - * @return {Ext.Element} this - */ - load : function(url, params, cb){ - Ext.Ajax.request(Ext.apply({ - params: params, - url: url.url || url, - callback: cb, - el: this.dom, - indicatorText: url.indicatorText || '' - }, Ext.isObject(url) ? url : {})); - return this; - }, - - /** - * Tests various css rules/browsers to determine if this element uses a border box - * @return {Boolean} - */ - isBorderBox : function(){ - return Ext.isBorderBox || Ext.isForcedBorderBox || noBoxAdjust[(this.dom.tagName || "").toLowerCase()]; - }, - - /** - *

    Removes this element's dom reference. Note that event and cache removal is handled at {@link Ext#removeNode}

    - */ - remove : function(){ - var me = this, - dom = me.dom; - - if (dom) { - delete me.dom; - Ext.removeNode(dom); - } - }, - - /** - * Sets up event handlers to call the passed functions when the mouse is moved into and out of the Element. - * @param {Function} overFn The function to call when the mouse enters the Element. - * @param {Function} outFn The function to call when the mouse leaves the Element. - * @param {Object} scope (optional) The scope (this reference) in which the functions are executed. Defaults to the Element's DOM element. - * @param {Object} options (optional) Options for the listener. See {@link Ext.util.Observable#addListener the options parameter}. - * @return {Ext.Element} this - */ - hover : function(overFn, outFn, scope, options){ - var me = this; - me.on('mouseenter', overFn, scope || me.dom, options); - me.on('mouseleave', outFn, scope || me.dom, options); - return me; - }, - - /** - * 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){ - return !el ? false : Ext.lib.Dom.isAncestor(this.dom, el.dom ? el.dom : 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 - * @deprecated - */ - getAttributeNS : function(ns, name){ - return this.getAttribute(name, ns); - }, - - /** - * Returns the value of an attribute from the element's underlying DOM node. - * @param {String} name The attribute name - * @param {String} namespace (optional) The namespace in which to look for the attribute - * @return {String} The attribute value - */ - getAttribute : Ext.isIE ? function(name, ns){ - var d = this.dom, - type = typeof d[ns + ":" + name]; - - if(['undefined', 'unknown'].indexOf(type) == -1){ - return d[ns + ":" + name]; - } - return d[name]; - } : function(name, ns){ - var d = this.dom; - return d.getAttributeNS(ns, name) || d.getAttribute(ns + ":" + name) || d.getAttribute(name) || d[name]; - }, - - /** - * Update the innerHTML of this element - * @param {String} html The new HTML - * @return {Ext.Element} this - */ - update : function(html) { - if (this.dom) { - this.dom.innerHTML = html; - } - return this; - } -}; - -var ep = El.prototype; - -El.addMethods = function(o){ - Ext.apply(ep, o); -}; - -/** - * Appends an event handler (shorthand for {@link #addListener}). - * @param {String} eventName The name of event to handle. - * @param {Function} fn The handler function the event invokes. - * @param {Object} scope (optional) The scope (this reference) in which the handler function is executed. - * @param {Object} options (optional) An object containing standard {@link #addListener} options - * @member Ext.Element - * @method on - */ -ep.on = ep.addListener; - -/** - * Removes an event handler from this element (see {@link #removeListener} for additional notes). - * @param {String} eventName The name of the event from which to remove the handler. - * @param {Function} fn The handler function to remove. This must be a reference to the function passed into the {@link #addListener} call. - * @param {Object} scope If a scope (this reference) was specified when the listener was added, - * then this must refer to the same object. - * @return {Ext.Element} this - * @member Ext.Element - * @method un - */ -ep.un = ep.removeListener; - -/** - * true to automatically adjust width and height settings for box-model issues (default to true) - */ -ep.autoBoxAdjust = true; - -// private -var unitPattern = /\d+(px|em|%|en|ex|pt|in|cm|mm|pc)$/i, - docEl; - -/** - * @private - */ - -/** - * Retrieves Ext.Element objects. - *

    This method does not retrieve {@link Ext.Component Component}s. This method - * retrieves Ext.Element objects which encapsulate DOM elements. To retrieve a Component by - * its ID, use {@link Ext.ComponentMgr#get}.

    - *

    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 {Mixed} el The id of the node, a DOM Node or an existing Element. - * @return {Element} The Element object (or null if no matching element was found) - * @static - * @member Ext.Element - * @method get - */ -El.get = function(el){ - var ex, - elm, - id; - if(!el){ return null; } - if (typeof el == "string") { // element id - if (!(elm = DOC.getElementById(el))) { - return null; - } - if (EC[el] && EC[el].el) { - ex = EC[el].el; - ex.dom = elm; - } else { - ex = El.addToCache(new El(elm)); - } - return ex; - } else if (el.tagName) { // dom element - if(!(id = el.id)){ - id = Ext.id(el); - } - if (EC[id] && EC[id].el) { - ex = EC[id].el; - ex.dom = el; - } else { - ex = El.addToCache(new El(el)); - } - return ex; - } else if (el instanceof El) { - if(el != docEl){ - // refresh dom element in case no longer valid, - // catch case where it hasn't been appended - - // If an el instance is passed, don't pass to getElementById without some kind of id - if (Ext.isIE && (el.id == undefined || el.id == '')) { - el.dom = el.dom; - } else { - el.dom = DOC.getElementById(el.id) || el.dom; - } - } - return el; - } else if(el.isComposite) { - return el; - } else if(Ext.isArray(el)) { - return El.select(el); - } else if(el == DOC) { - // create a bogus element object representing the document object - if(!docEl){ - var f = function(){}; - f.prototype = El.prototype; - docEl = new f(); - docEl.dom = DOC; - } - return docEl; - } - return null; -}; - -El.addToCache = function(el, id){ - id = id || el.id; - EC[id] = { - el: el, - data: {}, - events: {} - }; - return el; -}; - -// private method for getting and setting element data -El.data = function(el, key, value){ - el = El.get(el); - if (!el) { - return null; - } - var c = EC[el.id].data; - if(arguments.length == 2){ - return c[key]; - }else{ - return (c[key] = value); - } -}; - -// private -// Garbage collection - uncache elements/purge listeners on orphaned elements -// so we don't hold a reference and cause the browser to retain them -function garbageCollect(){ - if(!Ext.enableGarbageCollector){ - clearInterval(El.collectorThreadId); - } else { - var eid, - el, - d, - o; - - for(eid in EC){ - o = EC[eid]; - if(o.skipGC){ - continue; - } - el = o.el; - 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 && !DOC.getElementById(eid))){ - if(Ext.enableListenerCollection){ - Ext.EventManager.removeAll(d); - } - delete EC[eid]; - } - } - // Cleanup IE Object leaks - if (Ext.isIE) { - var t = {}; - for (eid in EC) { - t[eid] = EC[eid]; - } - EC = Ext.elCache = t; - } - } -} -El.collectorThreadId = setInterval(garbageCollect, 30000); - -var flyFn = function(){}; -flyFn.prototype = El.prototype; - -// dom is optional -El.Flyweight = function(dom){ - this.dom = dom; -}; - -El.Flyweight.prototype = new flyFn(); -El.Flyweight.prototype.isFlyweight = true; -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. Shorthand of {@link Ext.Element#fly}

    - *

    Use this to make one-time references to DOM elements which are not going to be accessed again either by - * application code, or by Ext's classes. If accessing an element which will be processed regularly, then {@link Ext#get} - * will be more appropriate to take advantage of the caching provided by the Ext.Element class.

    - * @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 Ext uses "_global") - * @return {Element} The shared Element object (or null if no matching element was found) - * @member Ext.Element - * @method fly - */ -El.fly = function(el, named){ - var ret = null; - named = named || '_global'; - - if (el = Ext.getDom(el)) { - (El._flyweights[named] = El._flyweights[named] || new El.Flyweight()).dom = el; - ret = El._flyweights[named]; - } - return ret; -}; - -/** - * Retrieves Ext.Element objects. - *

    This method does not retrieve {@link Ext.Component Component}s. This method - * retrieves Ext.Element objects which encapsulate DOM elements. To retrieve a Component by - * its ID, use {@link Ext.ComponentMgr#get}.

    - *

    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 Ext.Element#get} - * @param {Mixed} el The id of the node, a DOM Node or an existing Element. - * @return {Element} The Element object (or null if no matching element was found) - * @member Ext - * @method get - */ -Ext.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 Ext.Element#fly}

    - *

    Use this to make one-time references to DOM elements which are not going to be accessed again either by - * application code, or by Ext's classes. If accessing an element which will be processed regularly, then {@link Ext#get} - * will be more appropriate to take advantage of the caching provided by the Ext.Element class.

    - * @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 Ext uses "_global") - * @return {Element} The shared Element object (or null if no matching element was found) - * @member Ext - * @method fly - */ -Ext.fly = El.fly; - -// speedy lookup for elements never to box adjust -var noBoxAdjust = Ext.isStrict ? { - select:1 -} : { - input:1, select:1, textarea:1 -}; -if(Ext.isIE || Ext.isGecko){ - noBoxAdjust['button'] = 1; -} - -})(); diff --git a/assets/js/ext/src/ext-core/src/core/Element.position.js b/assets/js/ext/src/ext-core/src/core/Element.position.js deleted file mode 100644 index 3b8a39d..0000000 --- a/assets/js/ext/src/ext-core/src/core/Element.position.js +++ /dev/null @@ -1,301 +0,0 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.com/license - */ -/** - * @class Ext.Element - */ -(function(){ -var D = Ext.lib.Dom, - LEFT = "left", - RIGHT = "right", - TOP = "top", - BOTTOM = "bottom", - POSITION = "position", - STATIC = "static", - RELATIVE = "relative", - AUTO = "auto", - ZINDEX = "z-index"; - -Ext.Element.addMethods({ - /** - * 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); - }, - - /** - * Returns the offsets of this element from the passed element. Both element must be part of the DOM tree and not have display:none to have page coordinates. - * @param {Mixed} element The element to get the offsets from. - * @return {Array} The XY page offsets (e.g. [100, -200]) - */ - getOffsetsTo : function(el){ - var o = this.getXY(), - e = Ext.fly(el, '_internal').getXY(); - return [o[0]-e[0],o[1]-e[1]]; - }, - - /** - * 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 {Ext.Element} this - */ - setX : function(x, animate){ - return this.setXY([x, this.getY()], this.animTest(arguments, animate, 1)); - }, - - /** - * 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 {Ext.Element} this - */ - setY : function(y, animate){ - return this.setXY([this.getX(), y], this.animTest(arguments, animate, 1)); - }, - - /** - * Sets the element's left position directly using CSS style (instead of {@link #setX}). - * @param {String} left The left CSS property value - * @return {Ext.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 {Ext.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 {Ext.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 {Ext.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 {Ext.Element} this - */ - setXY : function(pos, animate){ - var me = this; - if(!animate || !me.anim){ - D.setXY(me.dom, pos); - }else{ - me.anim({points: {to: pos}}, me.preanim(arguments, 1), 'motion'); - } - return me; - }, - - /** - * 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 {Ext.Element} this - */ - setLocation : function(x, y, animate){ - return this.setXY([x, y], this.animTest(arguments, animate, 2)); - }, - - /** - * 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 {Ext.Element} this - */ - moveTo : function(x, y, animate){ - return this.setXY([x, y], this.animTest(arguments, animate, 2)); - }, - - /** - * Gets the left X coordinate - * @param {Boolean} local True to get the local css position instead of page coordinate - * @return {Number} - */ - getLeft : function(local){ - return !local ? this.getX() : 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){ - var me = this; - return !local ? me.getX() + me.getWidth() : (me.getLeft(true) + me.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) { - return !local ? this.getY() : 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){ - var me = this; - return !local ? me.getY() + me.getHeight() : (me.getTop(true) + me.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){ - var me = this; - - if(!pos && me.isStyle(POSITION, STATIC)){ - me.setStyle(POSITION, RELATIVE); - } else if(pos) { - me.setStyle(POSITION, pos); - } - if(zIndex){ - me.setStyle(ZINDEX, zIndex); - } - if(x || y) me.setXY([x || false, y || false]); - }, - - /** - * 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 {Ext.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(ZINDEX) - }; - }, - - /** - * Set positioning with an object returned by getPositioning(). - * @param {Object} posCfg - * @return {Ext.Element} this - */ - setPositioning : function(pc){ - var me = this, - style = me.dom.style; - - me.setStyle(pc); - - if(pc.right == AUTO){ - style.right = ""; - } - if(pc.bottom == AUTO){ - style.bottom = ""; - } - - return me; - }, - - /** - * 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 (optional) The page y, required if x is not an array - * @return {Object} An object with left and top properties. e.g. {left: (value), top: (value)} - */ - translatePoints : function(x, y){ - y = isNaN(x[1]) ? y : x[1]; - x = isNaN(x[0]) ? x : x[0]; - var me = this, - relative = me.isStyle(POSITION, RELATIVE), - o = me.getXY(), - l = parseInt(me.getStyle(LEFT), 10), - t = parseInt(me.getStyle(TOP), 10); - - l = !isNaN(l) ? l : (relative ? 0 : me.dom.offsetLeft); - t = !isNaN(t) ? t : (relative ? 0 : me.dom.offsetTop); - - return {left: (x - o[0] + l), top: (y - o[1] + t)}; - }, - - animTest : function(args, animate, i) { - return !!animate && this.preanim ? this.preanim(args, i) : false; - } -}); -})(); \ No newline at end of file diff --git a/assets/js/ext/src/ext-core/src/core/Element.scroll.js b/assets/js/ext/src/ext-core/src/core/Element.scroll.js deleted file mode 100644 index f42c0de..0000000 --- a/assets/js/ext/src/ext-core/src/core/Element.scroll.js +++ /dev/null @@ -1,58 +0,0 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.com/license - */ -/** - * @class Ext.Element - */ -Ext.Element.addMethods({ - /** - * 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. - * @return {Element} this - */ - scrollTo : function(side, value){ - this.dom["scroll" + (/top/i.test(side) ? "Top" : "Left")] = value; - return this; - }, - - /** - * 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, - body = doc.body, - docElement = doc.documentElement, - l, - t, - ret; - - if(d == doc || d == body){ - if(Ext.isIE && Ext.isStrict){ - l = docElement.scrollLeft; - t = docElement.scrollTop; - }else{ - l = window.pageXOffset; - t = window.pageYOffset; - } - ret = {left: l || (body ? body.scrollLeft : 0), top: t || (body ? body.scrollTop : 0)}; - }else{ - ret = {left: d.scrollLeft, top: d.scrollTop}; - } - return ret; - } -}); \ No newline at end of file diff --git a/assets/js/ext/src/ext-core/src/core/Element.style.js b/assets/js/ext/src/ext-core/src/core/Element.style.js deleted file mode 100644 index a99d3e7..0000000 --- a/assets/js/ext/src/ext-core/src/core/Element.style.js +++ /dev/null @@ -1,503 +0,0 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.com/license - */ -/** - * @class Ext.Element - */ -Ext.Element.addMethods(function(){ - // local style camelizing for speed - var supports = Ext.supports, - propCache = {}, - camelRe = /(-[a-z])/gi, - view = document.defaultView, - opacityRe = /alpha\(opacity=(.*)\)/i, - trimRe = /^\s+|\s+$/g, - EL = Ext.Element, - spacesRe = /\s+/, - wordsRe = /\w/g, - PADDING = "padding", - MARGIN = "margin", - BORDER = "border", - LEFT = "-left", - RIGHT = "-right", - TOP = "-top", - BOTTOM = "-bottom", - WIDTH = "-width", - MATH = Math, - HIDDEN = 'hidden', - ISCLIPPED = 'isClipped', - OVERFLOW = 'overflow', - OVERFLOWX = 'overflow-x', - OVERFLOWY = 'overflow-y', - ORIGINALCLIP = 'originalClip', - // special markup used throughout Ext when box wrapping elements - borders = {l: BORDER + LEFT + WIDTH, r: BORDER + RIGHT + WIDTH, t: BORDER + TOP + WIDTH, b: BORDER + BOTTOM + WIDTH}, - paddings = {l: PADDING + LEFT, r: PADDING + RIGHT, t: PADDING + TOP, b: PADDING + BOTTOM}, - margins = {l: MARGIN + LEFT, r: MARGIN + RIGHT, t: MARGIN + TOP, b: MARGIN + BOTTOM}, - data = Ext.Element.data; - - - // private - function camelFn(m, a) { - return a.charAt(1).toUpperCase(); - } - - function chkCache(prop) { - return propCache[prop] || (propCache[prop] = prop == 'float' ? (supports.cssFloat ? 'cssFloat' : 'styleFloat') : prop.replace(camelRe, camelFn)); - } - - return { - // private ==> used by Fx - adjustWidth : function(width) { - var me = this; - var isNum = (typeof width == "number"); - if(isNum && me.autoBoxAdjust && !me.isBorderBox()){ - width -= (me.getBorderWidth("lr") + me.getPadding("lr")); - } - return (isNum && width < 0) ? 0 : width; - }, - - // private ==> used by Fx - adjustHeight : function(height) { - var me = this; - var isNum = (typeof height == "number"); - if(isNum && me.autoBoxAdjust && !me.isBorderBox()){ - height -= (me.getBorderWidth("tb") + me.getPadding("tb")); - } - return (isNum && height < 0) ? 0 : height; - }, - - - /** - * 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 {Ext.Element} this - */ - addClass : function(className){ - var me = this, - i, - len, - v, - cls = []; - // Separate case is for speed - if (!Ext.isArray(className)) { - if (typeof className == 'string' && !this.hasClass(className)) { - me.dom.className += " " + className; - } - } - else { - for (i = 0, len = className.length; i < len; i++) { - v = className[i]; - if (typeof v == 'string' && (' ' + me.dom.className + ' ').indexOf(' ' + v + ' ') == -1) { - cls.push(v); - } - } - if (cls.length) { - me.dom.className += " " + cls.join(" "); - } - } - return me; - }, - - /** - * Removes one or more CSS classes from the element. - * @param {String/Array} className The CSS class to remove, or an array of classes - * @return {Ext.Element} this - */ - removeClass : function(className){ - var me = this, - i, - idx, - len, - cls, - elClasses; - if (!Ext.isArray(className)){ - className = [className]; - } - if (me.dom && me.dom.className) { - elClasses = me.dom.className.replace(trimRe, '').split(spacesRe); - for (i = 0, len = className.length; i < len; i++) { - cls = className[i]; - if (typeof cls == 'string') { - cls = cls.replace(trimRe, ''); - idx = elClasses.indexOf(cls); - if (idx != -1) { - elClasses.splice(idx, 1); - } - } - } - me.dom.className = elClasses.join(" "); - } - return me; - }, - - /** - * 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 {Ext.Element} this - */ - radioClass : function(className){ - var cn = this.dom.parentNode.childNodes, - v, - i, - len; - className = Ext.isArray(className) ? className : [className]; - for (i = 0, len = cn.length; i < len; i++) { - v = cn[i]; - if (v && v.nodeType == 1) { - Ext.fly(v, '_internal').removeClass(className); - } - }; - return this.addClass(className); - }, - - /** - * 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 {Ext.Element} this - */ - toggleClass : function(className){ - return this.hasClass(className) ? this.removeClass(className) : this.addClass(className); - }, - - /** - * 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 {Ext.Element} this - */ - replaceClass : function(oldClassName, newClassName){ - return this.removeClass(oldClassName).addClass(newClassName); - }, - - isStyle : function(style, val) { - return this.getStyle(style) == val; - }, - - /** - * Normalizes currentStyle and computedStyle. - * @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, - out, - display; - - if(el == document){ - return null; - } - prop = chkCache(prop); - out = (v = el.style[prop]) ? v : - (cs = view.getComputedStyle(el, "")) ? cs[prop] : null; - - // Ignore cases when the margin is correctly reported as 0, the bug only shows - // numbers larger. - if(prop == 'marginRight' && out != '0px' && !supports.correctRightMargin){ - display = el.style.display; - el.style.display = 'inline-block'; - out = view.getComputedStyle(el, '').marginRight; - el.style.display = display; - } - - if(prop == 'backgroundColor' && out == 'rgba(0, 0, 0, 0)' && !supports.correctTransparentColor){ - out = 'transparent'; - } - return out; - } : - function(prop){ - var el = this.dom, - m, - cs; - - if(el == document) return null; - if (prop == 'opacity') { - if (el.style.filter.match) { - if(m = el.style.filter.match(opacityRe)){ - var fv = parseFloat(m[1]); - if(!isNaN(fv)){ - return fv ? fv / 100 : 0; - } - } - } - return 1; - } - prop = chkCache(prop); - return el.style[prop] || ((cs = el.currentStyle) ? cs[prop] : null); - }; - }(), - - /** - * 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 - * color anims. - */ - getColor : function(attr, defaultValue, prefix){ - var v = this.getStyle(attr), - color = (typeof prefix != 'undefined') ? prefix : '#', - h; - - if(!v || (/transparent|inherit/.test(v))) { - return defaultValue; - } - if(/^r/.test(v)){ - Ext.each(v.slice(4, v.length -1).split(','), function(s){ - h = parseInt(s, 10); - color += (h < 16 ? '0' : '') + h.toString(16); - }); - }else{ - v = v.replace('#', ''); - color += v.length == 3 ? v.replace(/^(\w)(\w)(\w)$/, '$1$1$2$2$3$3') : v; - } - return(color.length > 5 ? color.toLowerCase() : defaultValue); - }, - - /** - * 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 {Ext.Element} this - */ - setStyle : function(prop, value){ - var tmp, style; - - if (typeof prop != 'object') { - tmp = {}; - tmp[prop] = value; - prop = tmp; - } - for (style in prop) { - value = prop[style]; - style == 'opacity' ? - this.setOpacity(value) : - this.dom.style[chkCache(style)] = value; - } - return this; - }, - - /** - * 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) a standard Element animation config object or true for - * the default animation ({duration: .35, easing: 'easeIn'}) - * @return {Ext.Element} this - */ - setOpacity : function(opacity, animate){ - var me = this, - s = me.dom.style; - - if(!animate || !me.anim){ - if(Ext.isIE){ - var opac = opacity < 1 ? 'alpha(opacity=' + opacity * 100 + ')' : '', - val = s.filter.replace(opacityRe, '').replace(trimRe, ''); - - s.zoom = 1; - s.filter = val + (val.length > 0 ? ' ' : '') + opac; - }else{ - s.opacity = opacity; - } - }else{ - me.anim({opacity: {to: opacity}}, me.preanim(arguments, 1), null, .35, 'easeIn'); - } - return me; - }, - - /** - * Clears any opacity settings from this element. Required in some cases for IE. - * @return {Ext.Element} this - */ - clearOpacity : function(){ - var style = this.dom.style; - if(Ext.isIE){ - if(!Ext.isEmpty(style.filter)){ - style.filter = style.filter.replace(opacityRe, '').replace(trimRe, ''); - } - }else{ - style.opacity = style['-moz-opacity'] = style['-khtml-opacity'] = ''; - } - return this; - }, - - /** - * 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 me = this, - dom = me.dom, - hidden = Ext.isIE && me.isStyle('display', 'none'), - h = MATH.max(dom.offsetHeight, hidden ? 0 : dom.clientHeight) || 0; - - h = !contentHeight ? h : h - me.getBorderWidth("tb") - me.getPadding("tb"); - return h < 0 ? 0 : h; - }, - - /** - * 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 me = this, - dom = me.dom, - hidden = Ext.isIE && me.isStyle('display', 'none'), - w = MATH.max(dom.offsetWidth, hidden ? 0 : dom.clientWidth) || 0; - w = !contentWidth ? w : w - me.getBorderWidth("lr") - me.getPadding("lr"); - return w < 0 ? 0 : w; - }, - - /** - * Set the width of this Element. - * @param {Mixed} width The new width. This may be one of:
      - *
    • A Number specifying the new width in this Element's {@link #defaultUnit}s (by default, pixels).
    • - *
    • A String used to set the CSS width style. Animation may not be used. - *
    - * @param {Boolean/Object} animate (optional) true for the default animation or a standard Element animation config object - * @return {Ext.Element} this - */ - setWidth : function(width, animate){ - var me = this; - width = me.adjustWidth(width); - !animate || !me.anim ? - me.dom.style.width = me.addUnits(width) : - me.anim({width : {to : width}}, me.preanim(arguments, 1)); - return me; - }, - - /** - * Set the height of this Element. - *
    
    -// change the height to 200px and animate with default configuration
    -Ext.fly('elementId').setHeight(200, true);
    -
    -// change the height to 150px and animate with a custom configuration
    -Ext.fly('elId').setHeight(150, {
    -    duration : .5, // animation will have a duration of .5 seconds
    -    // will change the content to "finished"
    -    callback: function(){ this.{@link #update}("finished"); }
    -});
    -         * 
    - * @param {Mixed} height The new height. This may be one of:
      - *
    • A Number specifying the new height in this Element's {@link #defaultUnit}s (by default, pixels.)
    • - *
    • A String used to set the CSS height style. Animation may not be used.
    • - *
    - * @param {Boolean/Object} animate (optional) true for the default animation or a standard Element animation config object - * @return {Ext.Element} this - */ - setHeight : function(height, animate){ - var me = this; - height = me.adjustHeight(height); - !animate || !me.anim ? - me.dom.style.height = me.addUnits(height) : - me.anim({height : {to : height}}, me.preanim(arguments, 1)); - return me; - }, - - /** - * 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 left width + the border right width. - * @return {Number} The width of the sides passed added together - */ - getBorderWidth : function(side){ - return this.addStyles(side, 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 left + the padding right. - * @return {Number} The padding of the sides passed added together - */ - getPadding : function(side){ - return this.addStyles(side, paddings); - }, - - /** - * Store the current overflow setting and clip overflow on the element - use {@link #unclip} to remove - * @return {Ext.Element} this - */ - clip : function(){ - var me = this, - dom = me.dom; - - if(!data(dom, ISCLIPPED)){ - data(dom, ISCLIPPED, true); - data(dom, ORIGINALCLIP, { - o: me.getStyle(OVERFLOW), - x: me.getStyle(OVERFLOWX), - y: me.getStyle(OVERFLOWY) - }); - me.setStyle(OVERFLOW, HIDDEN); - me.setStyle(OVERFLOWX, HIDDEN); - me.setStyle(OVERFLOWY, HIDDEN); - } - return me; - }, - - /** - * Return clipping (overflow) to original clipping before {@link #clip} was called - * @return {Ext.Element} this - */ - unclip : function(){ - var me = this, - dom = me.dom; - - if(data(dom, ISCLIPPED)){ - data(dom, ISCLIPPED, false); - var o = data(dom, ORIGINALCLIP); - if(o.o){ - me.setStyle(OVERFLOW, o.o); - } - if(o.x){ - me.setStyle(OVERFLOWX, o.x); - } - if(o.y){ - me.setStyle(OVERFLOWY, o.y); - } - } - return me; - }, - - // private - addStyles : function(sides, styles){ - var ttlSize = 0, - sidesArr = sides.match(wordsRe), - side, - size, - i, - len = sidesArr.length; - for (i = 0; i < len; i++) { - side = sidesArr[i]; - size = side && parseInt(this.getStyle(styles[side]), 10); - if (size) { - ttlSize += MATH.abs(size); - } - } - return ttlSize; - }, - - margins : margins - }; -}() -); diff --git a/assets/js/ext/src/ext-core/src/core/Element.traversal.js b/assets/js/ext/src/ext-core/src/core/Element.traversal.js deleted file mode 100644 index 58405e9..0000000 --- a/assets/js/ext/src/ext-core/src/core/Element.traversal.js +++ /dev/null @@ -1,175 +0,0 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.com/license - */ -/** - * @class Ext.Element - */ -Ext.Element.addMethods(function(){ - var PARENTNODE = 'parentNode', - NEXTSIBLING = 'nextSibling', - PREVIOUSSIBLING = 'previousSibling', - DQ = Ext.DomQuery, - GET = Ext.get; - - return { - /** - * 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/Mixed} maxDepth (optional) The max depth to search as a number or element (defaults to 50 || document.body) - * @param {Boolean} returnEl (optional) True to return a Ext.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, - stopEl; - if(Ext.isGecko && Object.prototype.toString.call(p) == '[object XULElement]') { - return null; - } - maxDepth = maxDepth || 50; - if (isNaN(maxDepth)) { - stopEl = Ext.getDom(maxDepth); - maxDepth = Number.MAX_VALUE; - } - while(p && p.nodeType == 1 && depth < maxDepth && p != b && p != stopEl){ - if(DQ.is(p, simpleSelector)){ - return returnEl ? 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/Mixed} 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 Ext.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 = Ext.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 Ext.Element. - * @param {String} selector The simple selector to test - * @param {Number/Mixed} maxDepth (optional) The max depth to - search as a number or element (defaults to 10 || document.body) - * @return {Ext.Element} The matching DOM node (or null if no match was found) - */ - up : function(simpleSelector, maxDepth){ - return this.findParentNode(simpleSelector, maxDepth, true); - }, - - /** - * Creates a {@link Ext.CompositeElement} for child nodes based on the passed CSS selector (the selector should not contain an id). - * @param {String} selector The CSS selector - * @return {CompositeElement/CompositeElementLite} The composite element - */ - select : function(selector){ - return Ext.Element.select(selector, 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){ - return DQ.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 Ext.Element (defaults to false) - * @return {HTMLElement/Ext.Element} The child Ext.Element (or DOM node if returnDom = true) - */ - child : function(selector, returnDom){ - var n = DQ.selectNode(selector, this.dom); - return returnDom ? n : 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 Ext.Element (defaults to false) - * @return {HTMLElement/Ext.Element} The child Ext.Element (or DOM node if returnDom = true) - */ - down : function(selector, returnDom){ - var n = DQ.selectNode(" > " + selector, this.dom); - return returnDom ? n : GET(n); - }, - - /** - * Gets the parent node for this element, optionally chaining up trying to match a selector - * @param {String} selector (optional) Find a parent node that matches the passed simple selector - * @param {Boolean} returnDom (optional) True to return a raw dom node instead of an Ext.Element - * @return {Ext.Element/HTMLElement} The parent node or null - */ - parent : function(selector, returnDom){ - return this.matchNode(PARENTNODE, PARENTNODE, selector, returnDom); - }, - - /** - * Gets the next sibling, skipping text nodes - * @param {String} selector (optional) Find the next sibling that matches the passed simple selector - * @param {Boolean} returnDom (optional) True to return a raw dom node instead of an Ext.Element - * @return {Ext.Element/HTMLElement} The next sibling or null - */ - next : function(selector, returnDom){ - return this.matchNode(NEXTSIBLING, NEXTSIBLING, selector, returnDom); - }, - - /** - * Gets the previous sibling, skipping text nodes - * @param {String} selector (optional) Find the previous sibling that matches the passed simple selector - * @param {Boolean} returnDom (optional) True to return a raw dom node instead of an Ext.Element - * @return {Ext.Element/HTMLElement} The previous sibling or null - */ - prev : function(selector, returnDom){ - return this.matchNode(PREVIOUSSIBLING, PREVIOUSSIBLING, selector, returnDom); - }, - - - /** - * Gets the first child, skipping text nodes - * @param {String} selector (optional) Find the next sibling that matches the passed simple selector - * @param {Boolean} returnDom (optional) True to return a raw dom node instead of an Ext.Element - * @return {Ext.Element/HTMLElement} The first child or null - */ - first : function(selector, returnDom){ - return this.matchNode(NEXTSIBLING, 'firstChild', selector, returnDom); - }, - - /** - * Gets the last child, skipping text nodes - * @param {String} selector (optional) Find the previous sibling that matches the passed simple selector - * @param {Boolean} returnDom (optional) True to return a raw dom node instead of an Ext.Element - * @return {Ext.Element/HTMLElement} The last child or null - */ - last : function(selector, returnDom){ - return this.matchNode(PREVIOUSSIBLING, 'lastChild', selector, returnDom); - }, - - matchNode : function(dir, start, selector, returnDom){ - var n = this.dom[start]; - while(n){ - if(n.nodeType == 1 && (!selector || DQ.is(n, selector))){ - return !returnDom ? GET(n) : n; - } - n = n[dir]; - } - return null; - } - }; -}()); \ No newline at end of file diff --git a/assets/js/ext/src/ext-core/src/core/EventManager.js b/assets/js/ext/src/ext-core/src/core/EventManager.js deleted file mode 100644 index 56c44f3..0000000 --- a/assets/js/ext/src/ext-core/src/core/EventManager.js +++ /dev/null @@ -1,933 +0,0 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.com/license - */ -/** - * @class Ext.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 Ext.EventObject} for more details on normalized event objects. - * @singleton - */ -Ext.EventManager = function(){ - var docReadyEvent, - docReadyProcId, - docReadyState = false, - DETECT_NATIVE = Ext.isGecko || Ext.isWebKit || Ext.isSafari, - E = Ext.lib.Event, - D = Ext.lib.Dom, - DOC = document, - WINDOW = window, - DOMCONTENTLOADED = "DOMContentLoaded", - COMPLETE = 'complete', - propRe = /^(?:scope|delay|buffer|single|stopEvent|preventDefault|stopPropagation|normalized|args|delegate)$/, - /* - * This cache is used to hold special js objects, the document and window, that don't have an id. We need to keep - * a reference to them so we can look them up at a later point. - */ - specialElCache = []; - - function getId(el){ - var id = false, - i = 0, - len = specialElCache.length, - skip = false, - o; - - if (el) { - if (el.getElementById || el.navigator) { - // look up the id - for(; i < len; ++i){ - o = specialElCache[i]; - if(o.el === el){ - id = o.id; - break; - } - } - if(!id){ - // for browsers that support it, ensure that give the el the same id - id = Ext.id(el); - specialElCache.push({ - id: id, - el: el - }); - skip = true; - } - }else{ - id = Ext.id(el); - } - if(!Ext.elCache[id]){ - Ext.Element.addToCache(new Ext.Element(el), id); - if(skip){ - Ext.elCache[id].skipGC = true; - } - } - } - return id; - } - - /// There is some jquery work around stuff here that isn't needed in Ext Core. - function addListener(el, ename, fn, task, wrap, scope){ - el = Ext.getDom(el); - var id = getId(el), - es = Ext.elCache[id].events, - wfn; - - wfn = E.on(el, ename, wrap); - es[ename] = es[ename] || []; - - /* 0 = Original Function, - 1 = Event Manager Wrapped Function, - 2 = Scope, - 3 = Adapter Wrapped Function, - 4 = Buffered Task - */ - es[ename].push([fn, wrap, scope, wfn, task]); - - // this is a workaround for jQuery and should somehow be removed from Ext Core in the future - // without breaking ExtJS. - - // workaround for jQuery - if(el.addEventListener && ename == "mousewheel"){ - var args = ["DOMMouseScroll", wrap, false]; - el.addEventListener.apply(el, args); - Ext.EventManager.addListener(WINDOW, 'unload', function(){ - el.removeEventListener.apply(el, args); - }); - } - - // fix stopped mousedowns on the document - if(el == DOC && ename == "mousedown"){ - Ext.EventManager.stoppedMouseDownEvent.addListener(wrap); - } - } - - function doScrollChk(){ - /* Notes: - 'doScroll' will NOT work in a IFRAME/FRAMESET. - The method succeeds but, a DOM query done immediately after -- FAILS. - */ - if(window != top){ - return false; - } - - try{ - DOC.documentElement.doScroll('left'); - }catch(e){ - return false; - } - - fireDocReady(); - return true; - } - /** - * @return {Boolean} True if the document is in a 'complete' state (or was determined to - * be true by other means). If false, the state is evaluated again until canceled. - */ - function checkReadyState(e){ - - if(Ext.isIE && doScrollChk()){ - return true; - } - if(DOC.readyState == COMPLETE){ - fireDocReady(); - return true; - } - docReadyState || (docReadyProcId = setTimeout(arguments.callee, 2)); - return false; - } - - var styles; - function checkStyleSheets(e){ - styles || (styles = Ext.query('style, link[rel=stylesheet]')); - if(styles.length == DOC.styleSheets.length){ - fireDocReady(); - return true; - } - docReadyState || (docReadyProcId = setTimeout(arguments.callee, 2)); - return false; - } - - function OperaDOMContentLoaded(e){ - DOC.removeEventListener(DOMCONTENTLOADED, arguments.callee, false); - checkStyleSheets(); - } - - function fireDocReady(e){ - if(!docReadyState){ - docReadyState = true; //only attempt listener removal once - - if(docReadyProcId){ - clearTimeout(docReadyProcId); - } - if(DETECT_NATIVE) { - DOC.removeEventListener(DOMCONTENTLOADED, fireDocReady, false); - } - if(Ext.isIE && checkReadyState.bindIE){ //was this was actually set ?? - DOC.detachEvent('onreadystatechange', checkReadyState); - } - E.un(WINDOW, "load", arguments.callee); - } - if(docReadyEvent && !Ext.isReady){ - Ext.isReady = true; - docReadyEvent.fire(); - docReadyEvent.listeners = []; - } - - } - - function initDocReady(){ - docReadyEvent || (docReadyEvent = new Ext.util.Event()); - if (DETECT_NATIVE) { - DOC.addEventListener(DOMCONTENTLOADED, fireDocReady, false); - } - /* - * Handle additional (exceptional) detection strategies here - */ - if (Ext.isIE){ - //Use readystatechange as a backup AND primary detection mechanism for a FRAME/IFRAME - //See if page is already loaded - if(!checkReadyState()){ - checkReadyState.bindIE = true; - DOC.attachEvent('onreadystatechange', checkReadyState); - } - - }else if(Ext.isOpera ){ - /* Notes: - Opera needs special treatment needed here because CSS rules are NOT QUITE - available after DOMContentLoaded is raised. - */ - - //See if page is already loaded and all styleSheets are in place - (DOC.readyState == COMPLETE && checkStyleSheets()) || - DOC.addEventListener(DOMCONTENTLOADED, OperaDOMContentLoaded, false); - - }else if (Ext.isWebKit){ - //Fallback for older Webkits without DOMCONTENTLOADED support - checkReadyState(); - } - // no matter what, make sure it fires on load - E.on(WINDOW, "load", fireDocReady); - } - - function createTargeted(h, o){ - return function(){ - var args = Ext.toArray(arguments); - if(o.target == Ext.EventObject.setEvent(args[0]).target){ - h.apply(this, args); - } - }; - } - - function createBuffered(h, o, task){ - return function(e){ - // create new event object impl so new events don't wipe out properties - task.delay(o.buffer, h, null, [new Ext.EventObjectImpl(e)]); - }; - } - - function createSingle(h, el, ename, fn, scope){ - return function(e){ - Ext.EventManager.removeListener(el, ename, fn, scope); - h(e); - }; - } - - function createDelayed(h, o, fn){ - return function(e){ - var task = new Ext.util.DelayedTask(h); - if(!fn.tasks) { - fn.tasks = []; - } - fn.tasks.push(task); - task.delay(o.delay || 10, h, null, [new Ext.EventObjectImpl(e)]); - }; - } - - function listen(element, ename, opt, fn, scope){ - var o = (!opt || typeof opt == "boolean") ? {} : opt, - el = Ext.getDom(element), task; - - fn = fn || o.fn; - scope = scope || o.scope; - - if(!el){ - throw "Error listening for \"" + ename + '\". Element "' + element + '" doesn\'t exist.'; - } - function h(e){ - // prevent errors while unload occurring - if(!Ext){// !window[xname]){ ==> can't we do this? - return; - } - e = Ext.EventObject.setEvent(e); - var t; - if (o.delegate) { - if(!(t = e.getTarget(o.delegate, el))){ - return; - } - } else { - t = e.target; - } - if (o.stopEvent) { - e.stopEvent(); - } - if (o.preventDefault) { - e.preventDefault(); - } - if (o.stopPropagation) { - e.stopPropagation(); - } - if (o.normalized === false) { - e = e.browserEvent; - } - - fn.call(scope || el, e, t, o); - } - if(o.target){ - h = createTargeted(h, o); - } - if(o.delay){ - h = createDelayed(h, o, fn); - } - if(o.single){ - h = createSingle(h, el, ename, fn, scope); - } - if(o.buffer){ - task = new Ext.util.DelayedTask(h); - h = createBuffered(h, o, task); - } - - addListener(el, ename, fn, task, h, scope); - return h; - } - - var pub = { - /** - * Appends an event handler to an element. The shorthand version {@link #on} is equivalent. Typically you will - * use {@link Ext.Element#addListener} directly on an Element in favor of calling this version. - * @param {String/HTMLElement} el The html element or id to assign the event handler to. - * @param {String} eventName The name of the event to listen for. - * @param {Function} handler The handler function the event invokes. This function is passed - * the following parameters:
      - *
    • evt : EventObject
      The {@link Ext.EventObject EventObject} describing the event.
    • - *
    • t : Element
      The {@link Ext.Element Element} which was the target of the event. - * Note that this may be filtered by using the delegate option.
    • - *
    • o : Object
      The options object from the addListener call.
    • - *
    - * @param {Object} scope (optional) The scope (this reference) in which the handler function is executed. Defaults to the Element. - * @param {Object} options (optional) An object containing handler configuration properties. - * This may contain any of the following properties:
      - *
    • scope : Object
      The scope (this reference) in which the handler function is executed. Defaults to the Element.
    • - *
    • delegate : String
      A simple selector to filter the target or look for a descendant of the target
    • - *
    • stopEvent : Boolean
      True to stop the event. That is stop propagation, and prevent the default action.
    • - *
    • preventDefault : Boolean
      True to prevent the default action
    • - *
    • stopPropagation : Boolean
      True to prevent event propagation
    • - *
    • normalized : Boolean
      False to pass a browser event to the handler function instead of an Ext.EventObject
    • - *
    • delay : Number
      The number of milliseconds to delay the invocation of the handler after te event fires.
    • - *
    • single : Boolean
      True to add a handler to handle just the next firing of the event, and then remove itself.
    • - *
    • buffer : Number
      Causes the handler to be scheduled to run in an {@link Ext.util.DelayedTask} delayed - * by the specified number of milliseconds. If the event fires again within that time, the original - * handler is not invoked, but the new handler is scheduled in its place.
    • - *
    • target : Element
      Only call the handler if the event was fired on the target Element, not if the event was bubbled up from a child node.
    • - *

    - *

    See {@link Ext.Element#addListener} for examples of how to use these options.

    - */ - addListener : function(element, eventName, fn, scope, options){ - if(typeof eventName == 'object'){ - var o = eventName, e, val; - for(e in o){ - val = o[e]; - if(!propRe.test(e)){ - if(Ext.isFunction(val)){ - // shared options - listen(element, e, o, val, o.scope); - }else{ - // individual options - listen(element, e, val); - } - } - } - } else { - listen(element, eventName, options, fn, scope); - } - }, - - /** - * Removes an event handler from an element. The shorthand version {@link #un} is equivalent. Typically - * you will use {@link Ext.Element#removeListener} directly on an Element in favor of calling this version. - * @param {String/HTMLElement} el The id or html element from which to remove the listener. - * @param {String} eventName The name of the event. - * @param {Function} fn The handler function to remove. This must be a reference to the function passed into the {@link #addListener} call. - * @param {Object} scope If a scope (this reference) was specified when the listener was added, - * then this must refer to the same object. - */ - removeListener : function(el, eventName, fn, scope){ - el = Ext.getDom(el); - var id = getId(el), - f = el && (Ext.elCache[id].events)[eventName] || [], - wrap, i, l, k, len, fnc; - - for (i = 0, len = f.length; i < len; i++) { - - /* 0 = Original Function, - 1 = Event Manager Wrapped Function, - 2 = Scope, - 3 = Adapter Wrapped Function, - 4 = Buffered Task - */ - if (Ext.isArray(fnc = f[i]) && fnc[0] == fn && (!scope || fnc[2] == scope)) { - if(fnc[4]) { - fnc[4].cancel(); - } - k = fn.tasks && fn.tasks.length; - if(k) { - while(k--) { - fn.tasks[k].cancel(); - } - delete fn.tasks; - } - wrap = fnc[1]; - E.un(el, eventName, E.extAdapter ? fnc[3] : wrap); - - // jQuery workaround that should be removed from Ext Core - if(wrap && el.addEventListener && eventName == "mousewheel"){ - el.removeEventListener("DOMMouseScroll", wrap, false); - } - - // fix stopped mousedowns on the document - if(wrap && el == DOC && eventName == "mousedown"){ - Ext.EventManager.stoppedMouseDownEvent.removeListener(wrap); - } - - f.splice(i, 1); - if (f.length === 0) { - delete Ext.elCache[id].events[eventName]; - } - for (k in Ext.elCache[id].events) { - return false; - } - Ext.elCache[id].events = {}; - return false; - } - } - }, - - /** - * Removes all event handers from an element. Typically you will use {@link Ext.Element#removeAllListeners} - * directly on an Element in favor of calling this version. - * @param {String/HTMLElement} el The id or html element from which to remove all event handlers. - */ - removeAll : function(el){ - el = Ext.getDom(el); - var id = getId(el), - ec = Ext.elCache[id] || {}, - es = ec.events || {}, - f, i, len, ename, fn, k, wrap; - - for(ename in es){ - if(es.hasOwnProperty(ename)){ - f = es[ename]; - /* 0 = Original Function, - 1 = Event Manager Wrapped Function, - 2 = Scope, - 3 = Adapter Wrapped Function, - 4 = Buffered Task - */ - for (i = 0, len = f.length; i < len; i++) { - fn = f[i]; - if(fn[4]) { - fn[4].cancel(); - } - if(fn[0].tasks && (k = fn[0].tasks.length)) { - while(k--) { - fn[0].tasks[k].cancel(); - } - delete fn.tasks; - } - wrap = fn[1]; - E.un(el, ename, E.extAdapter ? fn[3] : wrap); - - // jQuery workaround that should be removed from Ext Core - if(el.addEventListener && wrap && ename == "mousewheel"){ - el.removeEventListener("DOMMouseScroll", wrap, false); - } - - // fix stopped mousedowns on the document - if(wrap && el == DOC && ename == "mousedown"){ - Ext.EventManager.stoppedMouseDownEvent.removeListener(wrap); - } - } - } - } - if (Ext.elCache[id]) { - Ext.elCache[id].events = {}; - } - }, - - getListeners : function(el, eventName) { - el = Ext.getDom(el); - var id = getId(el), - ec = Ext.elCache[id] || {}, - es = ec.events || {}, - results = []; - if (es && es[eventName]) { - return es[eventName]; - } else { - return null; - } - }, - - purgeElement : function(el, recurse, eventName) { - el = Ext.getDom(el); - var id = getId(el), - ec = Ext.elCache[id] || {}, - es = ec.events || {}, - i, f, len; - if (eventName) { - if (es && es.hasOwnProperty(eventName)) { - f = es[eventName]; - for (i = 0, len = f.length; i < len; i++) { - Ext.EventManager.removeListener(el, eventName, f[i][0]); - } - } - } else { - Ext.EventManager.removeAll(el); - } - if (recurse && el && el.childNodes) { - for (i = 0, len = el.childNodes.length; i < len; i++) { - Ext.EventManager.purgeElement(el.childNodes[i], recurse, eventName); - } - } - }, - - _unload : function() { - var el; - for (el in Ext.elCache) { - Ext.EventManager.removeAll(el); - } - delete Ext.elCache; - delete Ext.Element._flyweights; - - // Abort any outstanding Ajax requests - var c, - conn, - tid, - ajax = Ext.lib.Ajax; - (typeof ajax.conn == 'object') ? conn = ajax.conn : conn = {}; - for (tid in conn) { - c = conn[tid]; - if (c) { - ajax.abort({conn: c, tId: tid}); - } - } - }, - /** - * Adds a listener to be notified when the document is ready (before onload and before images are loaded). Can be - * accessed shorthanded as Ext.onReady(). - * @param {Function} fn The method the event invokes. - * @param {Object} scope (optional) The scope (this reference) in which the handler function executes. Defaults to the browser window. - * @param {boolean} options (optional) Options object as passed to {@link Ext.Element#addListener}. It is recommended that the options - * {single: true} be used so that the handler is removed on first invocation. - */ - onDocumentReady : function(fn, scope, options){ - if (Ext.isReady) { // if it already fired or document.body is present - docReadyEvent || (docReadyEvent = new Ext.util.Event()); - docReadyEvent.addListener(fn, scope, options); - docReadyEvent.fire(); - docReadyEvent.listeners = []; - } else { - if (!docReadyEvent) { - initDocReady(); - } - options = options || {}; - options.delay = options.delay || 1; - docReadyEvent.addListener(fn, scope, options); - } - }, - - /** - * Forces a document ready state transition for the framework. Used when Ext is loaded - * into a DOM structure AFTER initial page load (Google API or other dynamic load scenario. - * Any pending 'onDocumentReady' handlers will be fired (if not already handled). - */ - fireDocReady : fireDocReady - }; - /** - * Appends an event handler to an element. Shorthand for {@link #addListener}. - * @param {String/HTMLElement} el The html element or id to assign the event handler to - * @param {String} eventName The name of the event to listen for. - * @param {Function} handler The handler function the event invokes. - * @param {Object} scope (optional) (this reference) in which the handler function executes. Defaults to the Element. - * @param {Object} options (optional) An object containing standard {@link #addListener} options - * @member Ext.EventManager - * @method on - */ - pub.on = pub.addListener; - /** - * Removes an event handler from an element. Shorthand for {@link #removeListener}. - * @param {String/HTMLElement} el The id or html element from which to remove the listener. - * @param {String} eventName The name of the event. - * @param {Function} fn The handler function to remove. This must be a reference to the function passed into the {@link #on} call. - * @param {Object} scope If a scope (this reference) was specified when the listener was added, - * then this must refer to the same object. - * @member Ext.EventManager - * @method un - */ - pub.un = pub.removeListener; - - pub.stoppedMouseDownEvent = new Ext.util.Event(); - return pub; -}(); -/** - * Adds a listener to be notified when the document is ready (before onload and before images are loaded). Shorthand of {@link Ext.EventManager#onDocumentReady}. - * @param {Function} fn The method the event invokes. - * @param {Object} scope (optional) The scope (this reference) in which the handler function executes. Defaults to the browser window. - * @param {boolean} options (optional) Options object as passed to {@link Ext.Element#addListener}. It is recommended that the options - * {single: true} be used so that the handler is removed on first invocation. - * @member Ext - * @method onReady - */ -Ext.onReady = Ext.EventManager.onDocumentReady; - - -//Initialize doc classes -(function(){ - var initExtCss = function() { - // find the body element - var bd = document.body || document.getElementsByTagName('body')[0]; - if (!bd) { - return false; - } - - var cls = [' ', - Ext.isIE ? "ext-ie " + (Ext.isIE6 ? 'ext-ie6' : (Ext.isIE7 ? 'ext-ie7' : 'ext-ie8')) - : Ext.isGecko ? "ext-gecko " + (Ext.isGecko2 ? 'ext-gecko2' : 'ext-gecko3') - : Ext.isOpera ? "ext-opera" - : Ext.isWebKit ? "ext-webkit" : ""]; - - if (Ext.isSafari) { - cls.push("ext-safari " + (Ext.isSafari2 ? 'ext-safari2' : (Ext.isSafari3 ? 'ext-safari3' : 'ext-safari4'))); - } else if(Ext.isChrome) { - cls.push("ext-chrome"); - } - - if (Ext.isMac) { - cls.push("ext-mac"); - } - if (Ext.isLinux) { - cls.push("ext-linux"); - } - - // add to the parent to allow for selectors like ".ext-strict .ext-ie" - if (Ext.isStrict || Ext.isBorderBox) { - var p = bd.parentNode; - if (p) { - Ext.fly(p, '_internal').addClass(((Ext.isStrict && Ext.isIE ) || (!Ext.enableForcedBoxModel && !Ext.isIE)) ? ' ext-strict' : ' ext-border-box'); - } - } - // Forced border box model class applied to all elements. Bypassing javascript based box model adjustments - // in favor of css. This is for non-IE browsers. - if (Ext.enableForcedBoxModel && !Ext.isIE) { - Ext.isForcedBorderBox = true; - cls.push("ext-forced-border-box"); - } - - Ext.fly(bd, '_internal').addClass(cls); - return true; - }; - - if (!initExtCss()) { - Ext.onReady(initExtCss); - } -})(); - -/** - * Code used to detect certain browser feature/quirks/bugs at startup. - */ -(function(){ - var supports = Ext.apply(Ext.supports, { - /** - * In Webkit, there is an issue with getting the margin right property, see - * https://bugs.webkit.org/show_bug.cgi?id=13343 - */ - correctRightMargin: true, - - /** - * Webkit browsers return rgba(0, 0, 0) when a transparent color is used - */ - correctTransparentColor: true, - - /** - * IE uses styleFloat, not cssFloat for the float property. - */ - cssFloat: true - }); - - var supportTests = function(){ - var div = document.createElement('div'), - doc = document, - view, - last; - - div.innerHTML = '
    '; - doc.body.appendChild(div); - last = div.lastChild; - - if((view = doc.defaultView)){ - if(view.getComputedStyle(div.firstChild.firstChild, null).marginRight != '0px'){ - supports.correctRightMargin = false; - } - if(view.getComputedStyle(last, null).backgroundColor != 'transparent'){ - supports.correctTransparentColor = false; - } - } - supports.cssFloat = !!last.style.cssFloat; - doc.body.removeChild(div); - }; - - if (Ext.isReady) { - supportTests(); - } else { - Ext.onReady(supportTests); - } -})(); - - -/** - * @class Ext.EventObject - * Just as {@link Ext.Element} wraps around a native DOM node, Ext.EventObject - * wraps the browser's native event-object normalizing cross-browser differences, - * such as which mouse button is clicked, keys pressed, mechanisms to stop - * event-propagation along with a method to prevent default actions from taking place. - *

    For example:

    - *
    
    -function handleClick(e, t){ // e is not a standard event object, it is a Ext.EventObject
    -    e.preventDefault();
    -    var target = e.getTarget(); // same as t (the target HTMLElement)
    -    ...
    -}
    -var myDiv = {@link Ext#get Ext.get}("myDiv");  // get reference to an {@link Ext.Element}
    -myDiv.on(         // 'on' is shorthand for addListener
    -    "click",      // perform an action on click of myDiv
    -    handleClick   // reference to the action handler
    -);
    -// other methods to do the same:
    -Ext.EventManager.on("myDiv", 'click', handleClick);
    -Ext.EventManager.addListener("myDiv", 'click', handleClick);
    - 
    - * @singleton - */ -Ext.EventObject = function(){ - var E = Ext.lib.Event, - clickRe = /(dbl)?click/, - // safari keypress events for special keys return bad keycodes - safariKeys = { - 3 : 13, // enter - 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 - btnMap = Ext.isIE ? {1:0,4:1,2:2} : {0:0,1:1,2:2}; - - Ext.EventObjectImpl = function(e){ - if(e){ - this.setEvent(e.browserEvent || e); - } - }; - - Ext.EventObjectImpl.prototype = { - /** @private */ - setEvent : function(e){ - var me = this; - if(e == me || (e && e.browserEvent)){ // already wrapped - return e; - } - me.browserEvent = e; - if(e){ - // normalize buttons - me.button = e.button ? btnMap[e.button] : (e.which ? e.which - 1 : -1); - if(clickRe.test(e.type) && me.button == -1){ - me.button = 0; - } - me.type = e.type; - me.shiftKey = e.shiftKey; - // mac metaKey behaves like ctrlKey - me.ctrlKey = e.ctrlKey || e.metaKey || false; - me.altKey = e.altKey; - // in getKey these will be normalized for the mac - me.keyCode = e.keyCode; - me.charCode = e.charCode; - // cache the target for the delayed and or buffered events - me.target = E.getTarget(e); - // same for XY - me.xy = E.getXY(e); - }else{ - me.button = -1; - me.shiftKey = false; - me.ctrlKey = false; - me.altKey = false; - me.keyCode = 0; - me.charCode = 0; - me.target = null; - me.xy = [0, 0]; - } - return me; - }, - - /** - * Stop the event (preventDefault and stopPropagation) - */ - stopEvent : function(){ - var me = this; - if(me.browserEvent){ - if(me.browserEvent.type == 'mousedown'){ - Ext.EventManager.stoppedMouseDownEvent.fire(me); - } - E.stopEvent(me.browserEvent); - } - }, - - /** - * Prevents the browsers default handling of the event. - */ - preventDefault : function(){ - if(this.browserEvent){ - E.preventDefault(this.browserEvent); - } - }, - - /** - * Cancels bubbling of the event. - */ - stopPropagation : function(){ - var me = this; - if(me.browserEvent){ - if(me.browserEvent.type == 'mousedown'){ - Ext.EventManager.stoppedMouseDownEvent.fire(me); - } - E.stopPropagation(me.browserEvent); - } - }, - - /** - * Gets the character 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(){ - return this.normalizeKey(this.keyCode || this.charCode); - }, - - // private - normalizeKey: function(k){ - return Ext.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 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/Mixed} 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 Ext.Element object instead of DOM node - * @return {HTMLelement} - */ - getTarget : function(selector, maxDepth, returnEl){ - return selector ? Ext.fly(this.target).findParent(selector, maxDepth, returnEl) : (returnEl ? Ext.get(this.target) : this.target); - }, - - /** - * Gets the related target. - * @return {HTMLElement} - */ - getRelatedTarget : function(){ - return this.browserEvent ? E.getRelatedTarget(this.browserEvent) : 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 target of this event is a child of el. Unless the allowEl parameter is set, it will return false if if the target is el. - * Example usage:
    
    -        // Handle click on any child of an element
    -        Ext.getBody().on('click', function(e){
    -            if(e.within('some-el')){
    -                alert('Clicked on a child of some-el!');
    -            }
    -        });
    -
    -        // Handle click directly on an element, ignoring clicks on child nodes
    -        Ext.getBody().on('click', function(e,t){
    -            if((t.id == 'some-el') && !e.within(t, true)){
    -                alert('Clicked directly on some-el!');
    -            }
    -        });
    -        
    - * @param {Mixed} el The id, DOM element or Ext.Element to check - * @param {Boolean} related (optional) true to test if the related target is within el instead of the target - * @param {Boolean} allowEl {optional} true to also check if the passed element is the target or related target - * @return {Boolean} - */ - within : function(el, related, allowEl){ - if(el){ - var t = this[related ? "getRelatedTarget" : "getTarget"](); - return t && ((allowEl ? (t == Ext.getDom(el)) : false) || Ext.fly(el).contains(t)); - } - return false; - } - }; - - return new Ext.EventObjectImpl(); -}(); diff --git a/assets/js/ext/src/ext-core/src/core/Ext.js b/assets/js/ext/src/ext-core/src/core/Ext.js deleted file mode 100644 index 01e6076..0000000 --- a/assets/js/ext/src/ext-core/src/core/Ext.js +++ /dev/null @@ -1,1051 +0,0 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.com/license - */ -// for old browsers -window.undefined = window.undefined; - -/** - * @class Ext - * Ext core utilities and functions. - * @singleton - */ - -Ext = { - /** - * The version of the framework - * @type String - */ - version : '3.3.1', - versionDetail : { - major : 3, - minor : 3, - patch : 1 - } -}; - -/** - * 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 Ext apply - */ -Ext.apply = function(o, c, defaults){ - // no "this" reference for friendly out of scope calls - if(defaults){ - Ext.apply(o, defaults); - } - if(o && c && typeof c == 'object'){ - for(var p in c){ - o[p] = c[p]; - } - } - return o; -}; - -(function(){ - var idSeed = 0, - toString = Object.prototype.toString, - ua = navigator.userAgent.toLowerCase(), - check = function(r){ - return r.test(ua); - }, - DOC = document, - docMode = DOC.documentMode, - isStrict = DOC.compatMode == "CSS1Compat", - isOpera = check(/opera/), - isChrome = check(/\bchrome\b/), - isWebKit = check(/webkit/), - isSafari = !isChrome && check(/safari/), - isSafari2 = isSafari && check(/applewebkit\/4/), // unique to Safari 2 - isSafari3 = isSafari && check(/version\/3/), - isSafari4 = isSafari && check(/version\/4/), - isIE = !isOpera && check(/msie/), - isIE7 = isIE && (check(/msie 7/) || docMode == 7), - isIE8 = isIE && (check(/msie 8/) && docMode != 7), - isIE6 = isIE && !isIE7 && !isIE8, - isGecko = !isWebKit && check(/gecko/), - isGecko2 = isGecko && check(/rv:1\.8/), - isGecko3 = isGecko && check(/rv:1\.9/), - isBorderBox = isIE && !isStrict, - isWindows = check(/windows|win32/), - isMac = check(/macintosh|mac os x/), - isAir = check(/adobeair/), - isLinux = check(/linux/), - isSecure = /^https/i.test(window.location.protocol); - - // remove css image flicker - if(isIE6){ - try{ - DOC.execCommand("BackgroundImageCache", false, true); - }catch(e){} - } - - Ext.apply(Ext, { - /** - * URL to a blank file used by Ext when in secure mode for iframe src and onReady src to prevent - * the IE insecure content warning ('about:blank', except for IE in secure mode, which is 'javascript:""'). - * @type String - */ - SSL_SECURE_URL : isSecure && isIE ? 'javascript:""' : 'about:blank', - /** - * True if the browser is in strict (standards-compliant) mode, as opposed to quirks 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 if the {@link Ext.Fx} Class is available - * @type Boolean - * @property enableFx - */ - - /** - * HIGHLY EXPERIMENTAL - * True to force css based border-box model override and turning off javascript based adjustments. This is a - * runtime configuration and must be set before onReady. - * @type Boolean - */ - enableForcedBoxModel : false, - - /** - * True to automatically uncache orphaned Ext.Elements periodically (defaults to true) - * @type Boolean - */ - enableGarbageCollector : true, - - /** - * True to automatically purge event listeners during garbageCollection (defaults to false). - * @type Boolean - */ - enableListenerCollection : false, - - /** - * EXPERIMENTAL - True to cascade listener removal to child elements when an element is removed. - * Currently not optimized for performance. - * @type Boolean - */ - enableNestedListenerRemoval : false, - - /** - * Indicates whether to use native browser parsing for JSON methods. - * This option is ignored if the browser does not support native JSON methods. - * Note: Native JSON methods will not work with objects that have functions. - * Also, property names must be quoted, otherwise the data will not parse. (Defaults to false) - * @type Boolean - */ - USE_NATIVE_JSON : false, - - /** - * 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){ - for(var p in c){ - if(!Ext.isDefined(o[p])){ - o[p] = c[p]; - } - } - } - return o; - }, - - /** - * Generates unique ids. If the element already has an id, it is unchanged - * @param {Mixed} el (optional) The element to generate an id for - * @param {String} prefix (optional) Id prefix (defaults "ext-gen") - * @return {String} The generated Id. - */ - id : function(el, prefix){ - el = Ext.getDom(el, true) || {}; - if (!el.id) { - el.id = (prefix || "ext-gen") + (++idSeed); - } - return el.id; - }, - - /** - *

    Extends one class to create a subclass and optionally overrides members with the passed literal. This method - * also adds the function "override()" to the subclass that can be used to override members of the class.

    - * For example, to create a subclass of Ext GridPanel: - *
    
    -MyGridPanel = Ext.extend(Ext.grid.GridPanel, {
    -    constructor: function(config) {
    -
    -//      Create configuration for this Grid.
    -        var store = new Ext.data.Store({...});
    -        var colModel = new Ext.grid.ColumnModel({...});
    -
    -//      Create a new config object containing our computed properties
    -//      *plus* whatever was in the config parameter.
    -        config = Ext.apply({
    -            store: store,
    -            colModel: colModel
    -        }, config);
    -
    -        MyGridPanel.superclass.constructor.call(this, config);
    -
    -//      Your postprocessing here
    -    },
    -
    -    yourMethod: function() {
    -        // etc.
    -    }
    -});
    -
    - * - *

    This function also supports a 3-argument call in which the subclass's constructor is - * passed as an argument. In this form, the parameters are as follows:

    - *
      - *
    • subclass : Function
      The subclass constructor.
    • - *
    • superclass : Function
      The constructor of class being extended
    • - *
    • overrides : Object
      A literal with members which are copied into the subclass's - * prototype, and are therefore shared among all instances of the new class.
    • - *
    - * - * @param {Function} superclass The constructor of class being extended. - * @param {Object} overrides

    A literal with members which are copied into the subclass's - * prototype, and are therefore shared between all instances of the new class.

    - *

    This may contain a special member named constructor. This is used - * to define the constructor of the new class, and is returned. If this property is - * not specified, a constructor is generated and returned which just calls the - * superclass's constructor passing on its parameters.

    - *

    It is essential that you call the superclass constructor in any provided constructor. See example code.

    - * @return {Function} The subclass constructor from the overrides parameter, or a generated one if not provided. - */ - extend : function(){ - // inline overrides - var io = function(o){ - for(var m in o){ - this[m] = o[m]; - } - }; - var oc = Object.prototype.constructor; - - return function(sb, sp, overrides){ - if(typeof sp == 'object'){ - overrides = sp; - sp = sb; - sb = overrides.constructor != oc ? overrides.constructor : 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 == oc){ - spp.constructor=sp; - } - sb.override = function(o){ - Ext.override(sb, o); - }; - sbp.superclass = sbp.supr = (function(){ - return spp; - }); - sbp.override = io; - Ext.override(sb, overrides); - sb.extend = function(o){return Ext.extend(sb, o);}; - return sb; - }; - }(), - - /** - * Adds a list of functions to the prototype of an existing class, overwriting any existing methods with the same name. - * Usage:
    
    -Ext.override(MyClass, {
    -    newMethod1: function(){
    -        // etc.
    -    },
    -    newMethod2: function(foo){
    -        // etc.
    -    }
    -});
    -
    - * @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; - Ext.apply(p, overrides); - if(Ext.isIE && overrides.hasOwnProperty('toString')){ - p.toString = overrides.toString; - } - } - }, - - /** - * Creates namespaces to be used for scoping variables and classes so that they are not global. - * Specifying the last node of a namespace implicitly creates all other nodes. Usage: - *
    
    -Ext.namespace('Company', 'Company.data');
    -Ext.namespace('Company.data'); // equivalent and preferable to above syntax
    -Company.Widget = function() { ... }
    -Company.data.CustomStore = function(config) { ... }
    -
    - * @param {String} namespace1 - * @param {String} namespace2 - * @param {String} etc - * @return {Object} The namespace object. (If multiple arguments are passed, this will be the last namespace created) - * @method namespace - */ - namespace : function(){ - var o, d; - Ext.each(arguments, function(v) { - d = v.split("."); - o = window[d[0]] = window[d[0]] || {}; - Ext.each(d.slice(1), function(v2){ - o = o[v2] = o[v2] || {}; - }); - }); - return o; - }, - - /** - * Takes an object and converts it to an encoded URL. e.g. Ext.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 - * @param {String} pre (optional) A prefix to add to the url encoded string - * @return {String} - */ - urlEncode : function(o, pre){ - var empty, - buf = [], - e = encodeURIComponent; - - Ext.iterate(o, function(key, item){ - empty = Ext.isEmpty(item); - Ext.each(empty ? key : item, function(val){ - buf.push('&', e(key), '=', (!Ext.isEmpty(val) && (val != key || !empty)) ? (Ext.isDate(val) ? Ext.encode(val).replace(/"/g, '') : e(val)) : ''); - }); - }); - if(!pre){ - buf.shift(); - pre = ''; - } - return pre + buf.join(''); - }, - - /** - * Takes an encoded URL and and converts it to an object. Example:
    
    -Ext.urlDecode("foo=1&bar=2"); // returns {foo: "1", bar: "2"}
    -Ext.urlDecode("foo=1&bar=2&bar=3&bar=4", false); // returns {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(Ext.isEmpty(string)){ - return {}; - } - var obj = {}, - pairs = string.split('&'), - d = decodeURIComponent, - name, - value; - Ext.each(pairs, function(pair) { - pair = pair.split('='); - name = d(pair[0]); - value = d(pair[1]); - obj[name] = overwrite || !obj[name] ? value : - [].concat(obj[name]).concat(value); - }); - return obj; - }, - - /** - * Appends content to the query string of a URL, handling logic for whether to place - * a question mark or ampersand. - * @param {String} url The URL to append to. - * @param {String} s The content to append to the URL. - * @return (String) The resulting URL - */ - urlAppend : function(url, s){ - if(!Ext.isEmpty(s)){ - return url + (url.indexOf('?') === -1 ? '?' : '&') + s; - } - return url; - }, - - /** - * Converts any iterable (numeric indices and a length property) into a true array - * Don't use this on strings. IE doesn't support "abc"[0] which this implementation depends on. - * For strings, use this instead: "abc".match(/./g) => [a,b,c]; - * @param {Iterable} the iterable object to be turned into a true Array. - * @return (Array) array - */ - toArray : function(){ - return isIE ? - function(a, i, j, res){ - res = []; - for(var x = 0, len = a.length; x < len; x++) { - res.push(a[x]); - } - return res.slice(i || 0, j || res.length); - } : - function(a, i, j){ - return Array.prototype.slice.call(a, i || 0, j || a.length); - }; - }(), - - isIterable : function(v){ - //check for array or arguments - if(Ext.isArray(v) || v.callee){ - return true; - } - //check for node list type - if(/NodeList|HTMLCollection/.test(toString.call(v))){ - return true; - } - //NodeList has an item and length property - //IXMLDOMNodeList has nextNode method, needs to be checked first. - return ((typeof v.nextNode != 'undefined' || v.item) && Ext.isNumber(v.length)); - }, - - /** - * Iterates an array calling the supplied function. - * @param {Array/NodeList/Mixed} array The array to be iterated. If this - * argument is not really an array, the supplied function is called once. - * @param {Function} fn The function to be called with each item. If the - * supplied function returns false, iteration stops and this method returns - * the current index. This function is called with - * the following arguments: - *
      - *
    • item : Mixed - *
      The item at the current index - * in the passed array
    • - *
    • index : Number - *
      The current index within the array
    • - *
    • allItems : Array - *
      The array passed as the first - * argument to Ext.each.
    • - *
    - * @param {Object} scope The scope (this reference) in which the specified function is executed. - * Defaults to the item at the current index - * within the passed array. - * @return See description for the fn parameter. - */ - each : function(array, fn, scope){ - if(Ext.isEmpty(array, true)){ - return; - } - if(!Ext.isIterable(array) || Ext.isPrimitive(array)){ - 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; - }; - } - }, - - /** - * Iterates either the elements in an array, or each of the properties in an object. - * Note: If you are only iterating arrays, it is better to call {@link #each}. - * @param {Object/Array} object The object or array to be iterated - * @param {Function} fn The function to be called for each iteration. - * The iteration will stop if the supplied function returns false, or - * all array elements / object properties have been covered. The signature - * varies depending on the type of object being interated: - *
      - *
    • Arrays : (Object item, Number index, Array allItems) - *
      - * When iterating an array, the supplied function is called with each item.
    • - *
    • Objects : (String key, Object value, Object) - *
      - * When iterating an object, the supplied function is called with each key-value pair in - * the object, and the iterated object
    • - *
    - * @param {Object} scope The scope (this reference) in which the specified function is executed. Defaults to - * the object being iterated. - */ - iterate : function(obj, fn, scope){ - if(Ext.isEmpty(obj)){ - return; - } - if(Ext.isIterable(obj)){ - Ext.each(obj, fn, scope); - return; - }else if(typeof obj == 'object'){ - for(var prop in obj){ - if(obj.hasOwnProperty(prop)){ - if(fn.call(scope || obj, prop, obj[prop], obj) === false){ - return; - }; - } - } - } - }, - - /** - * Return the dom node for the passed String (id), dom node, or Ext.Element. - * Optional 'strict' flag is needed for IE since it can return 'name' and - * 'id' elements by using getElementById. - * Here are some examples: - *
    
    -// gets dom node based on id
    -var elDom = Ext.getDom('elId');
    -// gets dom node based on the dom node
    -var elDom1 = Ext.getDom(elDom);
    -
    -// If we don't know if we are working with an
    -// Ext.Element or a dom node use Ext.getDom
    -function(el){
    -    var dom = Ext.getDom(el);
    -    // do something with the dom node
    -}
    -         * 
    - * Note: the dom node to be found actually needs to exist (be rendered, etc) - * when this method is called to be successful. - * @param {Mixed} el - * @return HTMLElement - */ - getDom : function(el, strict){ - if(!el || !DOC){ - return null; - } - if (el.dom){ - return el.dom; - } else { - if (typeof el == 'string') { - var e = DOC.getElementById(el); - // IE returns elements with the 'name' and 'id' attribute. - // we do a strict check to return the element with only the id attribute - if (e && isIE && strict) { - if (el == e.getAttribute('id')) { - return e; - } else { - return null; - } - } - return e; - } else { - return el; - } - } - }, - - /** - * Returns the current document body as an {@link Ext.Element}. - * @return Ext.Element The document body - */ - getBody : function(){ - return Ext.get(DOC.body || DOC.documentElement); - }, - - /** - * Returns the current document body as an {@link Ext.Element}. - * @return Ext.Element The document body - */ - getHead : function() { - var head; - - return function() { - if (head == undefined) { - head = Ext.get(DOC.getElementsByTagName("head")[0]); - } - - return head; - }; - }(), - - /** - * Removes a DOM node from the document. - */ - /** - *

    Removes this element from the document, removes all DOM event listeners, and deletes the cache reference. - * All DOM event listeners are removed from this element. If {@link Ext#enableNestedListenerRemoval} is - * true, then DOM event listeners are also removed from all child nodes. The body node - * will be ignored if passed in.

    - * @param {HTMLElement} node The node to remove - */ - removeNode : isIE && !isIE8 ? function(){ - var d; - return function(n){ - if(n && n.tagName != 'BODY'){ - (Ext.enableNestedListenerRemoval) ? Ext.EventManager.purgeElement(n, true) : Ext.EventManager.removeAll(n); - d = d || DOC.createElement('div'); - d.appendChild(n); - d.innerHTML = ''; - delete Ext.elCache[n.id]; - } - }; - }() : function(n){ - if(n && n.parentNode && n.tagName != 'BODY'){ - (Ext.enableNestedListenerRemoval) ? Ext.EventManager.purgeElement(n, true) : Ext.EventManager.removeAll(n); - n.parentNode.removeChild(n); - delete Ext.elCache[n.id]; - } - }, - - /** - *

    Returns true if the passed value is empty.

    - *

    The value is deemed to be empty if it is

      - *
    • null
    • - *
    • undefined
    • - *
    • an empty array
    • - *
    • a zero length string (Unless the allowBlank parameter is true)
    • - *
    - * @param {Mixed} value The value to test - * @param {Boolean} allowBlank (optional) true to allow empty strings (defaults to false) - * @return {Boolean} - */ - isEmpty : function(v, allowBlank){ - return v === null || v === undefined || ((Ext.isArray(v) && !v.length)) || (!allowBlank ? v === '' : false); - }, - - /** - * Returns true if the passed value is a JavaScript array, otherwise false. - * @param {Mixed} value The value to test - * @return {Boolean} - */ - isArray : function(v){ - return toString.apply(v) === '[object Array]'; - }, - - /** - * Returns true if the passed object is a JavaScript date object, otherwise false. - * @param {Object} object The object to test - * @return {Boolean} - */ - isDate : function(v){ - return toString.apply(v) === '[object Date]'; - }, - - /** - * Returns true if the passed value is a JavaScript Object, otherwise false. - * @param {Mixed} value The value to test - * @return {Boolean} - */ - isObject : function(v){ - return !!v && Object.prototype.toString.call(v) === '[object Object]'; - }, - - /** - * Returns true if the passed value is a JavaScript 'primitive', a string, number or boolean. - * @param {Mixed} value The value to test - * @return {Boolean} - */ - isPrimitive : function(v){ - return Ext.isString(v) || Ext.isNumber(v) || Ext.isBoolean(v); - }, - - /** - * Returns true if the passed value is a JavaScript Function, otherwise false. - * @param {Mixed} value The value to test - * @return {Boolean} - */ - isFunction : function(v){ - return toString.apply(v) === '[object Function]'; - }, - - /** - * Returns true if the passed value is a number. Returns false for non-finite numbers. - * @param {Mixed} value The value to test - * @return {Boolean} - */ - isNumber : function(v){ - return typeof v === 'number' && isFinite(v); - }, - - /** - * Returns true if the passed value is a string. - * @param {Mixed} value The value to test - * @return {Boolean} - */ - isString : function(v){ - return typeof v === 'string'; - }, - - /** - * Returns true if the passed value is a boolean. - * @param {Mixed} value The value to test - * @return {Boolean} - */ - isBoolean : function(v){ - return typeof v === 'boolean'; - }, - - /** - * Returns true if the passed value is an HTMLElement - * @param {Mixed} value The value to test - * @return {Boolean} - */ - isElement : function(v) { - return v ? !!v.tagName : false; - }, - - /** - * Returns true if the passed value is not undefined. - * @param {Mixed} value The value to test - * @return {Boolean} - */ - isDefined : function(v){ - return typeof v !== 'undefined'; - }, - - /** - * True if the detected browser is Opera. - * @type Boolean - */ - isOpera : isOpera, - /** - * True if the detected browser uses WebKit. - * @type Boolean - */ - isWebKit : isWebKit, - /** - * True if the detected browser is Chrome. - * @type Boolean - */ - isChrome : isChrome, - /** - * True if the detected browser is Safari. - * @type Boolean - */ - isSafari : isSafari, - /** - * True if the detected browser is Safari 3.x. - * @type Boolean - */ - isSafari3 : isSafari3, - /** - * True if the detected browser is Safari 4.x. - * @type Boolean - */ - isSafari4 : isSafari4, - /** - * True if the detected browser is Safari 2.x. - * @type Boolean - */ - isSafari2 : isSafari2, - /** - * True if the detected browser is Internet Explorer. - * @type Boolean - */ - isIE : isIE, - /** - * True if the detected browser is Internet Explorer 6.x. - * @type Boolean - */ - isIE6 : isIE6, - /** - * True if the detected browser is Internet Explorer 7.x. - * @type Boolean - */ - isIE7 : isIE7, - /** - * True if the detected browser is Internet Explorer 8.x. - * @type Boolean - */ - isIE8 : isIE8, - /** - * True if the detected browser uses the Gecko layout engine (e.g. Mozilla, Firefox). - * @type Boolean - */ - isGecko : isGecko, - /** - * True if the detected browser uses a pre-Gecko 1.9 layout engine (e.g. Firefox 2.x). - * @type Boolean - */ - isGecko2 : isGecko2, - /** - * True if the detected browser uses a Gecko 1.9+ layout engine (e.g. Firefox 3.x). - * @type Boolean - */ - isGecko3 : isGecko3, - /** - * True if the detected browser is Internet Explorer running in non-strict mode. - * @type Boolean - */ - isBorderBox : isBorderBox, - /** - * True if the detected platform is Linux. - * @type Boolean - */ - isLinux : isLinux, - /** - * True if the detected platform is Windows. - * @type Boolean - */ - isWindows : isWindows, - /** - * True if the detected platform is Mac OS. - * @type Boolean - */ - isMac : isMac, - /** - * True if the detected platform is Adobe Air. - * @type Boolean - */ - isAir : isAir - }); - - /** - * Creates namespaces to be used for scoping variables and classes so that they are not global. - * Specifying the last node of a namespace implicitly creates all other nodes. Usage: - *
    
    -Ext.namespace('Company', 'Company.data');
    -Ext.namespace('Company.data'); // equivalent and preferable to above syntax
    -Company.Widget = function() { ... }
    -Company.data.CustomStore = function(config) { ... }
    -
    - * @param {String} namespace1 - * @param {String} namespace2 - * @param {String} etc - * @return {Object} The namespace object. (If multiple arguments are passed, this will be the last namespace created) - * @method ns - */ - Ext.ns = Ext.namespace; -})(); - -Ext.ns('Ext.util', 'Ext.lib', 'Ext.data', 'Ext.supports'); - -Ext.elCache = {}; - -/** - * @class Function - * These functions are available on every Function object (any JavaScript function). - */ -Ext.apply(Function.prototype, { - /** - * Creates an interceptor function. The passed function 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 function is called with the parameters of the original function. Example usage: - *
    
    -var sayHi = function(name){
    -    alert('Hi, ' + name);
    -}
    -
    -sayHi('Fred'); // alerts "Hi, Fred"
    -
    -// create a new function that validates input without
    -// directly modifying the original function:
    -var sayHiToFriend = sayHi.createInterceptor(function(name){
    -    return name == 'Brian';
    -});
    -
    -sayHiToFriend('Fred');  // no alert
    -sayHiToFriend('Brian'); // alerts "Hi, Brian"
    -
    - * @param {Function} fcn The function to call before the original - * @param {Object} scope (optional) The scope (this reference) in which the passed function is executed. - * If omitted, defaults to the scope in which the original function is called or the browser window. - * @return {Function} The new function - */ - createInterceptor : function(fcn, scope){ - var method = this; - return !Ext.isFunction(fcn) ? - this : - function() { - var me = this, - args = arguments; - fcn.target = me; - fcn.method = method; - return (fcn.apply(scope || me || window, args) !== false) ? - method.apply(me || window, args) : - null; - }; - }, - - /** - * Creates a callback that passes arguments[0], arguments[1], arguments[2], ... - * Call directly on any function. Example: myFunction.createCallback(arg1, arg2) - * Will create a function that is bound to those 2 args. If a specific scope is required in the - * callback, use {@link #createDelegate} instead. The function returned by createCallback always - * executes in the window scope. - *

    This method is required when you want to pass arguments to a callback function. If no arguments - * are needed, you can simply pass a reference to the function as a callback (e.g., callback: myFn). - * However, if you tried to pass a function with arguments (e.g., callback: myFn(arg1, arg2)) the function - * would simply execute immediately when the code is parsed. Example usage: - *

    
    -var sayHi = function(name){
    -    alert('Hi, ' + name);
    -}
    -
    -// clicking the button alerts "Hi, Fred"
    -new Ext.Button({
    -    text: 'Say Hi',
    -    renderTo: Ext.getBody(),
    -    handler: sayHi.createCallback('Fred')
    -});
    -
    - * @return {Function} The new function - */ - createCallback : function(/*args...*/){ - // make args available, in function below - var args = arguments, - 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: this.myFunction.createDelegate(this, [arg1, arg2]) - * Will create a function that is automatically scoped to obj so that the this variable inside the - * callback points to obj. Example usage: - *
    
    -var sayHi = function(name){
    -    // Note this use of "this.text" here.  This function expects to
    -    // execute within a scope that contains a text property.  In this
    -    // example, the "this" variable is pointing to the btn object that
    -    // was passed in createDelegate below.
    -    alert('Hi, ' + name + '. You clicked the "' + this.text + '" button.');
    -}
    -
    -var btn = new Ext.Button({
    -    text: 'Say Hi',
    -    renderTo: Ext.getBody()
    -});
    -
    -// This callback will execute in the scope of the
    -// button instance. Clicking the button alerts
    -// "Hi, Fred. You clicked the "Say Hi" button."
    -btn.on('click', sayHi.createDelegate(btn, ['Fred']));
    -
    - * @param {Object} scope (optional) The scope (this reference) in which the function is executed. - * If omitted, defaults to the browser window. - * @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 (Ext.isNumber(appendArgs)){ - 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, optionally in a specific scope. Example usage: - *
    
    -var sayHi = function(name){
    -    alert('Hi, ' + name);
    -}
    -
    -// executes immediately:
    -sayHi('Fred');
    -
    -// executes after 2 seconds:
    -sayHi.defer(2000, this, ['Fred']);
    -
    -// this syntax is sometimes useful for deferring
    -// execution of an anonymous function:
    -(function(){
    -    alert('Anonymous');
    -}).defer(100);
    -
    - * @param {Number} millis The number of milliseconds for the setTimeout call (if less than or equal to 0 the function is executed immediately) - * @param {Object} scope (optional) The scope (this reference) in which the function is executed. - * If omitted, defaults to the browser window. - * @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 > 0){ - return setTimeout(fn, millis); - } - fn(); - return 0; - } -}); - -/** - * @class String - * These functions are available on every String object. - */ -Ext.applyIf(String, { - /** - * 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: - *
    
    -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>'
    -     * 
    - * @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 = Ext.toArray(arguments, 1); - return format.replace(/\{(\d+)\}/g, function(m, i){ - return args[i]; - }); - } -}); - -/** - * @class Array - */ -Ext.applyIf(Array.prototype, { - /** - * Checks whether or not the specified object exists in the array. - * @param {Object} o The object to check for - * @param {Number} from (Optional) The index at which to begin the search - * @return {Number} The index of o in the array (or -1 if it is not found) - */ - indexOf : function(o, from){ - var len = this.length; - from = from || 0; - from += (from < 0) ? len : 0; - for (; from < len; ++from){ - if(this[from] === o){ - return from; - } - } - return -1; - }, - - /** - * Removes the specified object from the array. If the object is not found nothing happens. - * @param {Object} o The object to remove - * @return {Array} this array - */ - remove : function(o){ - var index = this.indexOf(o); - if(index != -1){ - this.splice(index, 1); - } - return this; - } -}); diff --git a/assets/js/ext/src/ext-core/src/core/Fx.js b/assets/js/ext/src/ext-core/src/core/Fx.js deleted file mode 100644 index 60e7547..0000000 --- a/assets/js/ext/src/ext-core/src/core/Fx.js +++ /dev/null @@ -1,1112 +0,0 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.com/license - */ -(function(){ - // contants - var NULL = null, - UNDEFINED = undefined, - TRUE = true, - FALSE = false, - SETX = "setX", - SETY = "setY", - SETXY = "setXY", - LEFT = "left", - BOTTOM = "bottom", - TOP = "top", - RIGHT = "right", - HEIGHT = "height", - WIDTH = "width", - POINTS = "points", - HIDDEN = "hidden", - ABSOLUTE = "absolute", - VISIBLE = "visible", - MOTION = "motion", - POSITION = "position", - EASEOUT = "easeOut", - /* - * Use a light flyweight here since we are using so many callbacks and are always assured a DOM element - */ - flyEl = new Ext.Element.Flyweight(), - queues = {}, - getObject = function(o){ - return o || {}; - }, - fly = function(dom){ - flyEl.dom = dom; - flyEl.id = Ext.id(dom); - return flyEl; - }, - /* - * Queueing now stored outside of the element due to closure issues - */ - getQueue = function(id){ - if(!queues[id]){ - queues[id] = []; - } - return queues[id]; - }, - setQueue = function(id, value){ - queues[id] = value; - }; - -//Notifies Element that fx methods are available -Ext.enableFx = TRUE; - -/** - * @class Ext.Fx - *

    A class to provide basic animation and visual effects support. Note: This class is automatically applied - * to the {@link Ext.Element} interface when included, so all effects calls should be performed via {@link Ext.Element}. - * Conversely, since the effects are not actually defined in {@link Ext.Element}, Ext.Fx must be - * {@link Ext#enableFx included} in order for the Element effects to work.


    - * - *

    Method Chaining

    - *

    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. Also see {@link #callback}.


    - * - *

    Anchor Options for Motion Effects

    - *

    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:

    -
    -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
    -
    - * Note: some Fx methods accept specific custom config parameters. The options shown in the Config Options - * section below are common options that can be passed to any Fx method unless otherwise noted.
    - * - * @cfg {Function} callback A function called when the effect is finished. Note that effects are queued internally by the - * Fx class, so a callback is not required to specify another effect -- effects can simply be chained together - * and called in sequence (see note for Method Chaining above), for example:
    
    - * el.slideIn().highlight();
    - * 
    - * The callback is intended for any additional code that should run once a particular effect has completed. The Element - * being operated upon is passed as the first parameter. - * - * @cfg {Object} scope The scope (this reference) in which the {@link #callback} function is executed. Defaults to the browser window. - * - * @cfg {String} easing A valid Ext.lib.Easing value for the effect:

      - *
    • backBoth
    • - *
    • backIn
    • - *
    • backOut
    • - *
    • bounceBoth
    • - *
    • bounceIn
    • - *
    • bounceOut
    • - *
    • easeBoth
    • - *
    • easeBothStrong
    • - *
    • easeIn
    • - *
    • easeInStrong
    • - *
    • easeNone
    • - *
    • easeOut
    • - *
    • easeOutStrong
    • - *
    • elasticBoth
    • - *
    • elasticIn
    • - *
    • elasticOut
    • - *
    - * - * @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 {Number} endOpacity Only applicable for {@link #fadeIn} or {@link #fadeOut}, a number between - * 0 and 1 inclusive to configure the ending opacity value. - * - * @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 display CSS property instead of visibility 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 preceding effects should be stopped and removed before running current effect (only applies to non blocking effects) - */ -Ext.Fx = { - - // private - calls the function taking arguments from the argHash based on the key. Returns the return value of the function. - // this is useful for replacing switch statements (for example). - switchStatements : function(key, fn, argHash){ - return fn.apply(this, argHash[key]); - }, - - /** - * 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: - *
    
    -// 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
    -});
    -
    - * @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 {Ext.Element} The Element - */ - slideIn : function(anchor, o){ - o = getObject(o); - var me = this, - dom = me.dom, - st = dom.style, - xy, - r, - b, - wrap, - after, - st, - args, - pt, - bw, - bh; - - anchor = anchor || "t"; - - me.queueFx(o, function(){ - xy = fly(dom).getXY(); - // fix display to visibility - fly(dom).fixDisplay(); - - // restore values after effect - r = fly(dom).getFxRestore(); - b = {x: xy[0], y: xy[1], 0: xy[0], 1: xy[1], width: dom.offsetWidth, height: dom.offsetHeight}; - b.right = b.x + b.width; - b.bottom = b.y + b.height; - - // fixed size for slide - fly(dom).setWidth(b.width).setHeight(b.height); - - // wrap if needed - wrap = fly(dom).fxWrap(r.pos, o, HIDDEN); - - st.visibility = VISIBLE; - st.position = ABSOLUTE; - - // clear out temp styles after slide and unwrap - function after(){ - fly(dom).fxUnwrap(wrap, r.pos, o); - st.width = r.width; - st.height = r.height; - fly(dom).afterFx(o); - } - - // time to calculate the positions - pt = {to: [b.x, b.y]}; - bw = {to: b.width}; - bh = {to: b.height}; - - function argCalc(wrap, style, ww, wh, sXY, sXYval, s1, s2, w, h, p){ - var ret = {}; - fly(wrap).setWidth(ww).setHeight(wh); - if(fly(wrap)[sXY]){ - fly(wrap)[sXY](sXYval); - } - style[s1] = style[s2] = "0"; - if(w){ - ret.width = w; - } - if(h){ - ret.height = h; - } - if(p){ - ret.points = p; - } - return ret; - }; - - args = fly(dom).switchStatements(anchor.toLowerCase(), argCalc, { - t : [wrap, st, b.width, 0, NULL, NULL, LEFT, BOTTOM, NULL, bh, NULL], - l : [wrap, st, 0, b.height, NULL, NULL, RIGHT, TOP, bw, NULL, NULL], - r : [wrap, st, b.width, b.height, SETX, b.right, LEFT, TOP, NULL, NULL, pt], - b : [wrap, st, b.width, b.height, SETY, b.bottom, LEFT, TOP, NULL, bh, pt], - tl : [wrap, st, 0, 0, NULL, NULL, RIGHT, BOTTOM, bw, bh, pt], - bl : [wrap, st, 0, 0, SETY, b.y + b.height, RIGHT, TOP, bw, bh, pt], - br : [wrap, st, 0, 0, SETXY, [b.right, b.bottom], LEFT, TOP, bw, bh, pt], - tr : [wrap, st, 0, 0, SETX, b.x + b.width, LEFT, BOTTOM, bw, bh, pt] - }); - - st.visibility = VISIBLE; - fly(wrap).show(); - - arguments.callee.anim = fly(wrap).fxanim(args, - o, - MOTION, - .5, - EASEOUT, - after); - }); - return me; - }, - - /** - * 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: - *
    
    -// 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
    -});
    -
    - * @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 {Ext.Element} The Element - */ - slideOut : function(anchor, o){ - o = getObject(o); - var me = this, - dom = me.dom, - st = dom.style, - xy = me.getXY(), - wrap, - r, - b, - a, - zero = {to: 0}; - - anchor = anchor || "t"; - - me.queueFx(o, function(){ - - // restore values after effect - r = fly(dom).getFxRestore(); - b = {x: xy[0], y: xy[1], 0: xy[0], 1: xy[1], width: dom.offsetWidth, height: dom.offsetHeight}; - b.right = b.x + b.width; - b.bottom = b.y + b.height; - - // fixed size for slide - fly(dom).setWidth(b.width).setHeight(b.height); - - // wrap if needed - wrap = fly(dom).fxWrap(r.pos, o, VISIBLE); - - st.visibility = VISIBLE; - st.position = ABSOLUTE; - fly(wrap).setWidth(b.width).setHeight(b.height); - - function after(){ - o.useDisplay ? fly(dom).setDisplayed(FALSE) : fly(dom).hide(); - fly(dom).fxUnwrap(wrap, r.pos, o); - st.width = r.width; - st.height = r.height; - fly(dom).afterFx(o); - } - - function argCalc(style, s1, s2, p1, v1, p2, v2, p3, v3){ - var ret = {}; - - style[s1] = style[s2] = "0"; - ret[p1] = v1; - if(p2){ - ret[p2] = v2; - } - if(p3){ - ret[p3] = v3; - } - - return ret; - }; - - a = fly(dom).switchStatements(anchor.toLowerCase(), argCalc, { - t : [st, LEFT, BOTTOM, HEIGHT, zero], - l : [st, RIGHT, TOP, WIDTH, zero], - r : [st, LEFT, TOP, WIDTH, zero, POINTS, {to : [b.right, b.y]}], - b : [st, LEFT, TOP, HEIGHT, zero, POINTS, {to : [b.x, b.bottom]}], - tl : [st, RIGHT, BOTTOM, WIDTH, zero, HEIGHT, zero], - bl : [st, RIGHT, TOP, WIDTH, zero, HEIGHT, zero, POINTS, {to : [b.x, b.bottom]}], - br : [st, LEFT, TOP, WIDTH, zero, HEIGHT, zero, POINTS, {to : [b.x + b.width, b.bottom]}], - tr : [st, LEFT, BOTTOM, WIDTH, zero, HEIGHT, zero, POINTS, {to : [b.right, b.y]}] - }); - - arguments.callee.anim = fly(wrap).fxanim(a, - o, - MOTION, - .5, - EASEOUT, - after); - }); - return me; - }, - - /** - * 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: - *
    
    -// default
    -el.puff();
    -
    -// common config options shown with default values
    -el.puff({
    -    easing: 'easeOut',
    -    duration: .5,
    -    remove: false,
    -    useDisplay: false
    -});
    -
    - * @param {Object} options (optional) Object literal with any of the Fx config options - * @return {Ext.Element} The Element - */ - puff : function(o){ - o = getObject(o); - var me = this, - dom = me.dom, - st = dom.style, - width, - height, - r; - - me.queueFx(o, function(){ - width = fly(dom).getWidth(); - height = fly(dom).getHeight(); - fly(dom).clearOpacity(); - fly(dom).show(); - - // restore values after effect - r = fly(dom).getFxRestore(); - - function after(){ - o.useDisplay ? fly(dom).setDisplayed(FALSE) : fly(dom).hide(); - fly(dom).clearOpacity(); - fly(dom).setPositioning(r.pos); - st.width = r.width; - st.height = r.height; - st.fontSize = ''; - fly(dom).afterFx(o); - } - - arguments.callee.anim = fly(dom).fxanim({ - width : {to : fly(dom).adjustWidth(width * 2)}, - height : {to : fly(dom).adjustHeight(height * 2)}, - points : {by : [-width * .5, -height * .5]}, - opacity : {to : 0}, - fontSize: {to : 200, unit: "%"} - }, - o, - MOTION, - .5, - EASEOUT, - after); - }); - return me; - }, - - /** - * 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: - *
    
    -// default
    -el.switchOff();
    -
    -// all config options shown with default values
    -el.switchOff({
    -    easing: 'easeIn',
    -    duration: .3,
    -    remove: false,
    -    useDisplay: false
    -});
    -
    - * @param {Object} options (optional) Object literal with any of the Fx config options - * @return {Ext.Element} The Element - */ - switchOff : function(o){ - o = getObject(o); - var me = this, - dom = me.dom, - st = dom.style, - r; - - me.queueFx(o, function(){ - fly(dom).clearOpacity(); - fly(dom).clip(); - - // restore values after effect - r = fly(dom).getFxRestore(); - - function after(){ - o.useDisplay ? fly(dom).setDisplayed(FALSE) : fly(dom).hide(); - fly(dom).clearOpacity(); - fly(dom).setPositioning(r.pos); - st.width = r.width; - st.height = r.height; - fly(dom).afterFx(o); - }; - - fly(dom).fxanim({opacity : {to : 0.3}}, - NULL, - NULL, - .1, - NULL, - function(){ - fly(dom).clearOpacity(); - (function(){ - fly(dom).fxanim({ - height : {to : 1}, - points : {by : [0, fly(dom).getHeight() * .5]} - }, - o, - MOTION, - 0.3, - 'easeIn', - after); - }).defer(100); - }); - }); - return me; - }, - - /** - * 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: -
    
    -// 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
    -});
    -
    - * @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 {Ext.Element} The Element - */ - highlight : function(color, o){ - o = getObject(o); - var me = this, - dom = me.dom, - attr = o.attr || "backgroundColor", - a = {}, - restore; - - me.queueFx(o, function(){ - fly(dom).clearOpacity(); - fly(dom).show(); - - function after(){ - dom.style[attr] = restore; - fly(dom).afterFx(o); - } - restore = dom.style[attr]; - a[attr] = {from: color || "ffff9c", to: o.endColor || fly(dom).getColor(attr) || "ffffff"}; - arguments.callee.anim = fly(dom).fxanim(a, - o, - 'color', - 1, - 'easeIn', - after); - }); - return me; - }, - - /** - * Shows a ripple of exploding, attenuating borders to draw attention to an Element. - * Usage: -
    
    -// 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 each individual ripple.
    -    // Note: Easing is not configurable and will be ignored if included
    -});
    -
    - * @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 {Ext.Element} The Element - */ - frame : function(color, count, o){ - o = getObject(o); - var me = this, - dom = me.dom, - proxy, - active; - - me.queueFx(o, function(){ - color = color || '#C3DAF9'; - if(color.length == 6){ - color = '#' + color; - } - count = count || 1; - fly(dom).show(); - - var xy = fly(dom).getXY(), - b = {x: xy[0], y: xy[1], 0: xy[0], 1: xy[1], width: dom.offsetWidth, height: dom.offsetHeight}, - queue = function(){ - proxy = fly(document.body || document.documentElement).createChild({ - style:{ - position : ABSOLUTE, - 'z-index': 35000, // yee haw - border : '0px solid ' + color - } - }); - return proxy.queueFx({}, animFn); - }; - - - arguments.callee.anim = { - isAnimated: true, - stop: function() { - count = 0; - proxy.stopFx(); - } - }; - - function animFn(){ - var scale = Ext.isBorderBox ? 2 : 1; - active = proxy.anim({ - 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: o.duration || 1, - callback: function() { - proxy.remove(); - --count > 0 ? queue() : fly(dom).afterFx(o); - } - }); - arguments.callee.anim = { - isAnimated: true, - stop: function(){ - active.stop(); - } - }; - }; - queue(); - }); - return me; - }, - - /** - * Creates a pause before any subsequent queued effects begin. If there are - * no effects queued after the pause it will have no effect. - * Usage: -
    
    -el.pause(1);
    -
    - * @param {Number} seconds The length of time to pause (in seconds) - * @return {Ext.Element} The Element - */ - pause : function(seconds){ - var dom = this.dom, - t; - - this.queueFx({}, function(){ - t = setTimeout(function(){ - fly(dom).afterFx({}); - }, seconds * 1000); - arguments.callee.anim = { - isAnimated: true, - stop: function(){ - clearTimeout(t); - fly(dom).afterFx({}); - } - }; - }); - return this; - }, - - /** - * Fade an element in (from transparent to opaque). The ending opacity can be specified - * using the {@link #endOpacity} config option. - * Usage: -
    
    -// 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
    -});
    -
    - * @param {Object} options (optional) Object literal with any of the Fx config options - * @return {Ext.Element} The Element - */ - fadeIn : function(o){ - o = getObject(o); - var me = this, - dom = me.dom, - to = o.endOpacity || 1; - - me.queueFx(o, function(){ - fly(dom).setOpacity(0); - fly(dom).fixDisplay(); - dom.style.visibility = VISIBLE; - arguments.callee.anim = fly(dom).fxanim({opacity:{to:to}}, - o, NULL, .5, EASEOUT, function(){ - if(to == 1){ - fly(dom).clearOpacity(); - } - fly(dom).afterFx(o); - }); - }); - return me; - }, - - /** - * Fade an element out (from opaque to transparent). The ending opacity can be specified - * using the {@link #endOpacity} config option. Note that IE may require - * {@link #useDisplay}:true in order to redisplay correctly. - * Usage: -
    
    -// 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
    -});
    -
    - * @param {Object} options (optional) Object literal with any of the Fx config options - * @return {Ext.Element} The Element - */ - fadeOut : function(o){ - o = getObject(o); - var me = this, - dom = me.dom, - style = dom.style, - to = o.endOpacity || 0; - - me.queueFx(o, function(){ - arguments.callee.anim = fly(dom).fxanim({ - opacity : {to : to}}, - o, - NULL, - .5, - EASEOUT, - function(){ - if(to == 0){ - Ext.Element.data(dom, 'visibilityMode') == Ext.Element.DISPLAY || o.useDisplay ? - style.display = "none" : - style.visibility = HIDDEN; - - fly(dom).clearOpacity(); - } - fly(dom).afterFx(o); - }); - }); - return me; - }, - - /** - * Animates the transition of an element's dimensions from a starting height/width - * to an ending height/width. This method is a convenience implementation of {@link shift}. - * Usage: -
    
    -// 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
    -    }
    -);
    -
    - * @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 {Ext.Element} The Element - */ - scale : function(w, h, o){ - this.shift(Ext.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: -
    
    -// 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
    -});
    -
    - * @param {Object} options Object literal with any of the Fx config options - * @return {Ext.Element} The Element - */ - shift : function(o){ - o = getObject(o); - var dom = this.dom, - a = {}; - - this.queueFx(o, function(){ - for (var prop in o) { - if (o[prop] != UNDEFINED) { - a[prop] = {to : o[prop]}; - } - } - - a.width ? a.width.to = fly(dom).adjustWidth(o.width) : a; - a.height ? a.height.to = fly(dom).adjustWidth(o.height) : a; - - if (a.x || a.y || a.xy) { - a.points = a.xy || - {to : [ a.x ? a.x.to : fly(dom).getX(), - a.y ? a.y.to : fly(dom).getY()]}; - } - - arguments.callee.anim = fly(dom).fxanim(a, - o, - MOTION, - .35, - EASEOUT, - function(){ - fly(dom).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: - *
    
    -// 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
    -});
    -
    - * @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 {Ext.Element} The Element - */ - ghost : function(anchor, o){ - o = getObject(o); - var me = this, - dom = me.dom, - st = dom.style, - a = {opacity: {to: 0}, points: {}}, - pt = a.points, - r, - w, - h; - - anchor = anchor || "b"; - - me.queueFx(o, function(){ - // restore values after effect - r = fly(dom).getFxRestore(); - w = fly(dom).getWidth(); - h = fly(dom).getHeight(); - - function after(){ - o.useDisplay ? fly(dom).setDisplayed(FALSE) : fly(dom).hide(); - fly(dom).clearOpacity(); - fly(dom).setPositioning(r.pos); - st.width = r.width; - st.height = r.height; - fly(dom).afterFx(o); - } - - pt.by = fly(dom).switchStatements(anchor.toLowerCase(), function(v1,v2){ return [v1, v2];}, { - t : [0, -h], - l : [-w, 0], - r : [w, 0], - b : [0, h], - tl : [-w, -h], - bl : [-w, h], - br : [w, h], - tr : [w, -h] - }); - - arguments.callee.anim = fly(dom).fxanim(a, - o, - MOTION, - .5, - EASEOUT, after); - }); - return me; - }, - - /** - * Ensures that all effects queued after syncFx is called on the element are - * run concurrently. This is the opposite of {@link #sequenceFx}. - * @return {Ext.Element} The Element - */ - syncFx : function(){ - var me = this; - me.fxDefaults = Ext.apply(me.fxDefaults || {}, { - block : FALSE, - concurrent : TRUE, - stopFx : FALSE - }); - return me; - }, - - /** - * Ensures that all effects queued after sequenceFx is called on the element are - * run in sequence. This is the opposite of {@link #syncFx}. - * @return {Ext.Element} The Element - */ - sequenceFx : function(){ - var me = this; - me.fxDefaults = Ext.apply(me.fxDefaults || {}, { - block : FALSE, - concurrent : FALSE, - stopFx : FALSE - }); - return me; - }, - - /* @private */ - nextFx : function(){ - var ef = getQueue(this.dom.id)[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 getQueue(this.dom.id)[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 {Ext.Element} The Element - */ - stopFx : function(finish){ - var me = this, - id = me.dom.id; - if(me.hasActiveFx()){ - var cur = getQueue(id)[0]; - if(cur && cur.anim){ - if(cur.anim.isAnimated){ - setQueue(id, [cur]); //clear - cur.anim.stop(finish !== undefined ? finish : TRUE); - }else{ - setQueue(id, []); - } - } - } - return me; - }, - - /* @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 = getQueue(this.dom.id); - return q && q[0] && q[0].block; - }, - - /* @private */ - queueFx : function(o, fn){ - var me = fly(this.dom); - if(!me.hasFxBlock()){ - Ext.applyIf(o, me.fxDefaults); - if(!o.concurrent){ - var run = me.beforeFx(o); - fn.block = o.block; - getQueue(me.dom.id).push(fn); - if(run){ - me.nextFx(); - } - }else{ - fn.call(me); - } - } - return me; - }, - - /* @private */ - fxWrap : function(pos, o, vis){ - var dom = this.dom, - wrap, - wrapXY; - if(!o.wrap || !(wrap = Ext.getDom(o.wrap))){ - if(o.fixPosition){ - wrapXY = fly(dom).getXY(); - } - var div = document.createElement("div"); - div.style.visibility = vis; - wrap = dom.parentNode.insertBefore(div, dom); - fly(wrap).setPositioning(pos); - if(fly(wrap).isStyle(POSITION, "static")){ - fly(wrap).position("relative"); - } - fly(dom).clearPositioning('auto'); - fly(wrap).clip(); - wrap.appendChild(dom); - if(wrapXY){ - fly(wrap).setXY(wrapXY); - } - } - return wrap; - }, - - /* @private */ - fxUnwrap : function(wrap, pos, o){ - var dom = this.dom; - fly(dom).clearPositioning(); - fly(dom).setPositioning(pos); - if(!o.wrap){ - var pn = fly(wrap).dom.parentNode; - pn.insertBefore(dom, wrap); - fly(wrap).remove(); - } - }, - - /* @private */ - getFxRestore : function(){ - var st = this.dom.style; - return {pos: this.getPositioning(), width: st.width, height : st.height}; - }, - - /* @private */ - afterFx : function(o){ - var dom = this.dom, - id = dom.id; - if(o.afterStyle){ - fly(dom).setStyle(o.afterStyle); - } - if(o.afterCls){ - fly(dom).addClass(o.afterCls); - } - if(o.remove == TRUE){ - fly(dom).remove(); - } - if(o.callback){ - o.callback.call(o.scope, fly(dom)); - } - if(!o.concurrent){ - getQueue(id).shift(); - fly(dom).nextFx(); - } - }, - - /* @private */ - fxanim : function(args, opt, animType, defaultDur, defaultEase, cb){ - animType = animType || 'run'; - opt = opt || {}; - var anim = Ext.lib.Anim[animType]( - this.dom, - args, - (opt.duration || defaultDur) || .35, - (opt.easing || defaultEase) || EASEOUT, - cb, - this - ); - opt.anim = anim; - return anim; - } -}; - -// backwards compat -Ext.Fx.resize = Ext.Fx.scale; - -//When included, Ext.Fx is automatically applied to Element so that all basic -//effects are available directly via the Element API -Ext.Element.addMethods(Ext.Fx); -})(); diff --git a/assets/js/ext/src/ext-core/src/core/Loader.js b/assets/js/ext/src/ext-core/src/core/Loader.js deleted file mode 100644 index d8a39f2..0000000 --- a/assets/js/ext/src/ext-core/src/core/Loader.js +++ /dev/null @@ -1,96 +0,0 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.com/license - */ -/** - * @class Ext.Loader - * @singleton - * Simple class to help load JavaScript files on demand - */ -Ext.Loader = Ext.apply({}, { - /** - * Loads a given set of .js files. Calls the callback function when all files have been loaded - * Set preserveOrder to true to ensure non-parallel loading of files if load order is important - * @param {Array} fileList Array of all files to load - * @param {Function} callback Callback to call after all files have been loaded - * @param {Object} scope The scope to call the callback in - * @param {Boolean} preserveOrder True to make files load in serial, one after the other (defaults to false) - */ - load: function(fileList, callback, scope, preserveOrder) { - var scope = scope || this, - head = document.getElementsByTagName("head")[0], - fragment = document.createDocumentFragment(), - numFiles = fileList.length, - loadedFiles = 0, - me = this; - - /** - * Loads a particular file from the fileList by index. This is used when preserving order - */ - var loadFileIndex = function(index) { - head.appendChild( - me.buildScriptTag(fileList[index], onFileLoaded) - ); - }; - - /** - * Callback function which is called after each file has been loaded. This calls the callback - * passed to load once the final file in the fileList has been loaded - */ - var onFileLoaded = function() { - loadedFiles ++; - - //if this was the last file, call the callback, otherwise load the next file - if (numFiles == loadedFiles && typeof callback == 'function') { - callback.call(scope); - } else { - if (preserveOrder === true) { - loadFileIndex(loadedFiles); - } - } - }; - - if (preserveOrder === true) { - loadFileIndex.call(this, 0); - } else { - //load each file (most browsers will do this in parallel) - Ext.each(fileList, function(file, index) { - fragment.appendChild( - this.buildScriptTag(file, onFileLoaded) - ); - }, this); - - head.appendChild(fragment); - } - }, - - /** - * @private - * Creates and returns a script tag, but does not place it into the document. If a callback function - * is passed, this is called when the script has been loaded - * @param {String} filename The name of the file to create a script tag for - * @param {Function} callback Optional callback, which is called when the script has been loaded - * @return {Element} The new script ta - */ - buildScriptTag: function(filename, callback) { - var script = document.createElement('script'); - script.type = "text/javascript"; - script.src = filename; - - //IE has a different way of handling <script> loads, so we need to check for it here - if (script.readyState) { - script.onreadystatechange = function() { - if (script.readyState == "loaded" || script.readyState == "complete") { - script.onreadystatechange = null; - callback(); - } - }; - } else { - script.onload = callback; - } - - return script; - } -}); diff --git a/assets/js/ext/src/ext-core/src/core/Template.js b/assets/js/ext/src/ext-core/src/core/Template.js deleted file mode 100644 index 19c9a1d..0000000 --- a/assets/js/ext/src/ext-core/src/core/Template.js +++ /dev/null @@ -1,246 +0,0 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.com/license - */ -/** - * @class Ext.Template - *

    Represents an HTML fragment template. Templates may be {@link #compile precompiled} - * for greater performance.

    - *

    For example usage {@link #Template see the constructor}.

    - * - * @constructor - * An instance of this class may be created by passing to the constructor either - * a single argument, or multiple arguments: - *
      - *
    • single argument : String/Array - *
      - * The single argument may be either a String or an Array:
        - *
      • String :
      • 
        -var t = new Ext.Template("<div>Hello {0}.</div>");
        -t.{@link #append}('some-element', ['foo']);
        - * 
        - *
      • Array :
      • - * An Array will be combined with join(''). -
        
        -var t = new Ext.Template([
        -    '<div name="{id}">',
        -        '<span class="{cls}">{name:trim} {value:ellipsis(10)}</span>',
        -    '</div>',
        -]);
        -t.{@link #compile}();
        -t.{@link #append}('some-element', {id: 'myid', cls: 'myclass', name: 'foo', value: 'bar'});
        -
        - *
    • - *
    • multiple arguments : String, Object, Array, ... - *
      - * Multiple arguments will be combined with join(''). - *
      
      -var t = new Ext.Template(
      -    '<div name="{id}">',
      -        '<span class="{cls}">{name} {value}</span>',
      -    '</div>',
      -    // a configuration object:
      -    {
      -        compiled: true,      // {@link #compile} immediately
      -        disableFormats: true // See Notes below.
      -    }
      -);
      - * 
      - *

      Notes:

      - *
        - *
      • Formatting and disableFormats are not applicable for Ext Core.
      • - *
      • For a list of available format functions, see {@link Ext.util.Format}.
      • - *
      • disableFormats reduces {@link #apply} time - * when no formatting is required.
      • - *
      - *
    • - *
    - * @param {Mixed} config - */ -Ext.Template = function(html){ - var me = this, - a = arguments, - buf = [], - v; - - if (Ext.isArray(html)) { - html = html.join(""); - } else if (a.length > 1) { - for(var i = 0, len = a.length; i < len; i++){ - v = a[i]; - if(typeof v == 'object'){ - Ext.apply(me, v); - } else { - buf.push(v); - } - }; - html = buf.join(''); - } - - /**@private*/ - me.html = html; - /** - * @cfg {Boolean} compiled Specify true to compile the template - * immediately (see {@link #compile}). - * Defaults to false. - */ - if (me.compiled) { - me.compile(); - } -}; -Ext.Template.prototype = { - /** - * @cfg {RegExp} re The regular expression used to match template variables. - * Defaults to:
    
    -     * re : /\{([\w-]+)\}/g                                     // for Ext Core
    -     * re : /\{([\w-]+)(?:\:([\w\.]*)(?:\((.*?)?\))?)?\}/g      // for Ext JS
    -     * 
    - */ - re : /\{([\w-]+)\}/g, - /** - * See {@link #re}. - * @type RegExp - * @property re - */ - - /** - * Returns an HTML fragment of this template with the specified values applied. - * @param {Object/Array} values - * The template values. Can be an array if the params are numeric (i.e. {0}) - * or an object (i.e. {foo: 'bar'}). - * @return {String} The HTML fragment - */ - applyTemplate : function(values){ - var me = this; - - return me.compiled ? - me.compiled(values) : - me.html.replace(me.re, function(m, name){ - return values[name] !== undefined ? values[name] : ""; - }); - }, - - /** - * 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 {Ext.Template} this - */ - set : function(html, compile){ - var me = this; - me.html = html; - me.compiled = null; - return compile ? me.compile() : me; - }, - - /** - * Compiles the template into an internal function, eliminating the RegEx overhead. - * @return {Ext.Template} this - */ - compile : function(){ - var me = this, - sep = Ext.isGecko ? "+" : ","; - - function fn(m, name){ - name = "values['" + name + "']"; - return "'"+ sep + '(' + name + " == undefined ? '' : " + name + ')' + sep + "'"; - } - - eval("this.compiled = function(values){ return " + (Ext.isGecko ? "'" : "['") + - me.html.replace(/\\/g, '\\\\').replace(/(\r\n|\n)/g, '\\n').replace(/'/g, "\\'").replace(this.re, fn) + - (Ext.isGecko ? "';};" : "'].join('');};")); - return me; - }, - - /** - * Applies the supplied values to the template and inserts the new node(s) as the first child of el. - * @param {Mixed} el The context element - * @param {Object/Array} 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 Ext.Element (defaults to undefined) - * @return {HTMLElement/Ext.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 {Mixed} el The context element - * @param {Object/Array} 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 Ext.Element (defaults to undefined) - * @return {HTMLElement/Ext.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 {Mixed} el The context element - * @param {Object/Array} 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 Ext.Element (defaults to undefined) - * @return {HTMLElement/Ext.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 the specified el. - *

    For example usage {@link #Template see the constructor}.

    - * @param {Mixed} el The context element - * @param {Object/Array} values - * The template values. Can be an array if the params are numeric (i.e. {0}) - * or an object (i.e. {foo: 'bar'}). - * @param {Boolean} returnElement (optional) true to return an Ext.Element (defaults to undefined) - * @return {HTMLElement/Ext.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 = Ext.getDom(el); - var newNode = Ext.DomHelper.insertHtml(where, el, this.applyTemplate(values)); - return returnEl ? Ext.get(newNode, true) : newNode; - }, - - /** - * Applies the supplied values to the template and overwrites the content of el with the new node(s). - * @param {Mixed} el The context element - * @param {Object/Array} 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 Ext.Element (defaults to undefined) - * @return {HTMLElement/Ext.Element} The new node or Element - */ - overwrite : function(el, values, returnElement){ - el = Ext.getDom(el); - el.innerHTML = this.applyTemplate(values); - return returnElement ? Ext.get(el.firstChild, true) : el.firstChild; - } -}; -/** - * Alias for {@link #applyTemplate} - * Returns an HTML fragment of this template with the specified values applied. - * @param {Object/Array} values - * The template values. Can be an array if the params are numeric (i.e. {0}) - * or an object (i.e. {foo: 'bar'}). - * @return {String} The HTML fragment - * @member Ext.Template - * @method apply - */ -Ext.Template.prototype.apply = Ext.Template.prototype.applyTemplate; - -/** - * Creates a template from the passed element's value (display:none textarea, preferred) or innerHTML. - * @param {String/HTMLElement} el A DOM element or its id - * @param {Object} config A configuration object - * @return {Ext.Template} The created template - * @static - */ -Ext.Template.from = function(el, config){ - el = Ext.getDom(el); - return new Ext.Template(el.value || el.innerHTML, config || ''); -}; diff --git a/assets/js/ext/src/ext-core/src/data/Connection.js b/assets/js/ext/src/ext-core/src/data/Connection.js deleted file mode 100644 index 14cee01..0000000 --- a/assets/js/ext/src/ext-core/src/data/Connection.js +++ /dev/null @@ -1,583 +0,0 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.com/license - */ -(function(){ - var BEFOREREQUEST = "beforerequest", - REQUESTCOMPLETE = "requestcomplete", - REQUESTEXCEPTION = "requestexception", - UNDEFINED = undefined, - LOAD = 'load', - POST = 'POST', - GET = 'GET', - WINDOW = window; - - /** - * @class Ext.data.Connection - * @extends Ext.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.

    - *

    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 - * success callback - * in the request options object, - * or an {@link #requestcomplete event listener}.

    - *

    File Uploads

    File uploads are not performed using normal "Ajax" techniques, that - * is they are not performed using XMLHttpRequests. Instead the form is submitted in the standard - * manner with the DOM <form> element temporarily modified to have its - * target set to refer - * to a dynamically generated, hidden <iframe> which is inserted into the document - * but removed after the return data has been gathered.

    - *

    The server response is parsed by the browser to create the document for the IFRAME. If the - * server is using JSON to send the return object, then the - * Content-Type header - * must be set to "text/html" in order to tell the browser to insert the text unchanged into the document body.

    - *

    Characters which are significant to an HTML parser must be sent as HTML entities, so encode - * "<" as "&lt;", "&" as "&amp;" etc.

    - *

    The response text is retrieved from the document, and a fake XMLHttpRequest object - * is created containing a responseText property in order to conform to the - * requirements of event handlers and callbacks.

    - *

    Be aware that file upload packets are sent with the content type multipart/form - * and some server technologies (notably JEE) may require some custom processing in order to - * retrieve parameter names and parameter values from the packet content.

    - *

    Also note that it's not possible to check the response code of the hidden iframe, so the success handler will ALWAYS fire.

    - * @constructor - * @param {Object} config a configuration object. - */ - Ext.data.Connection = function(config){ - Ext.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, - /** - * @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 The XMLHttpRequest Object - * for details. - * @param {Object} options The options config object passed to the {@link #request} method. - */ - REQUESTCOMPLETE, - /** - * @event requestexception - * Fires if an error HTTP status was returned from the server. - * See HTTP Status Code Definitions - * for details of HTTP status codes. - * @param {Connection} conn This Connection object. - * @param {Object} response The XHR object containing the response data. - * See The XMLHttpRequest Object - * for details. - * @param {Object} options The options config object passed to the {@link #request} method. - */ - REQUESTEXCEPTION - ); - Ext.data.Connection.superclass.constructor.call(this); - }; - - Ext.extend(Ext.data.Connection, Ext.util.Observable, { - /** - * @cfg {String} url (Optional)

    The default URL to be used for requests to the server. Defaults to undefined.

    - *

    The url config may be a function which returns the URL to use for the Ajax request. The scope - * (this reference) of the function is the scope option passed to the {@link #request} method.

    - */ - /** - * @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 {@link #request} params are present, POST will be used; - * otherwise, GET will be used.) - */ - /** - * @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, - - /** - * @cfg {String} disableCachingParam (Optional) Change the parameter which is sent went disabling caching - * through a cache buster. Defaults to '_dc' - * @type String - */ - disableCachingParam: '_dc', - - /** - *

    Sends an HTTP request to a remote server.

    - *

    Important: Ajax server requests are asynchronous, and this call will - * return before the response has been received. Process any returned data - * in a callback function.

    - *
    
    -Ext.Ajax.request({
    -   url: 'ajax_demo/sample.json',
    -   success: function(response, opts) {
    -      var obj = Ext.decode(response.responseText);
    -      console.dir(obj);
    -   },
    -   failure: function(response, opts) {
    -      console.log('server-side failure with status code ' + response.status);
    -   }
    -});
    -         * 
    - *

    To execute a callback function in the correct scope, use the scope option.

    - * @param {Object} options An object which may contain the following properties:
      - *
    • url : String/Function (Optional)
      The URL to - * which to send the request, or a function to call which returns a URL string. The scope of the - * function is specified by the scope option. Defaults to the configured - * {@link #url}.
    • - *
    • params : 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. The scope of the function - * is specified by the scope option.
    • - *
    • method : 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. Note that - * the method name is case-sensitive and should be all caps.
    • - *
    • callback : 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:
        - *
      • options : Object
        The parameter to the request call.
      • - *
      • success : Boolean
        True if the request succeeded.
      • - *
      • response : Object
        The XMLHttpRequest object containing the response data. - * See http://www.w3.org/TR/XMLHttpRequest/ for details about - * accessing elements of the response.
      • - *
    • - *
    • success : Function (Optional)
      The function - * to be called upon success of the request. The callback is passed the following - * parameters:
        - *
      • response : Object
        The XMLHttpRequest object containing the response data.
      • - *
      • options : Object
        The parameter to the request call.
      • - *
    • - *
    • failure : Function (Optional)
      The function - * to be called upon failure of the request. The callback is passed the - * following parameters:
        - *
      • response : Object
        The XMLHttpRequest object containing the response data.
      • - *
      • options : Object
        The parameter to the request call.
      • - *
    • - *
    • scope : Object (Optional)
      The scope in - * which to execute the callbacks: The "this" object for the callback function. If the url, or params options were - * specified as functions from which to draw values, then this also serves as the scope for those function calls. - * Defaults to the browser window.
    • - *
    • timeout : Number (Optional)
      The timeout in milliseconds to be used for this request. Defaults to 30 seconds.
    • - *
    • form : Element/HTMLElement/String (Optional)
      The <form> - * Element or the id of the <form> to pull parameters from.
    • - *
    • isUpload : Boolean (Optional)
      Only meaningful when used - * with the form option. - *

      True if the form object is a file upload (will be set automatically if the form was - * configured with enctype "multipart/form-data").

      - *

      File uploads are not performed using normal "Ajax" techniques, that is they are not - * performed using XMLHttpRequests. Instead the form is submitted in the standard manner with the - * DOM <form> element temporarily modified to have its - * target set to refer - * to a dynamically generated, hidden <iframe> which is inserted into the document - * but removed after the return data has been gathered.

      - *

      The server response is parsed by the browser to create the document for the IFRAME. If the - * server is using JSON to send the return object, then the - * Content-Type header - * must be set to "text/html" in order to tell the browser to insert the text unchanged into the document body.

      - *

      The response text is retrieved from the document, and a fake XMLHttpRequest object - * is created containing a responseText property in order to conform to the - * requirements of event handlers and callbacks.

      - *

      Be aware that file upload packets are sent with the content type multipart/form - * and some server technologies (notably JEE) may require some custom processing in order to - * retrieve parameter names and parameter values from the packet content.

      - *
    • - *
    • headers : Object (Optional)
      Request - * headers to set for the request.
    • - *
    • xmlData : 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.
    • - *
    • jsonData : Object/String (Optional)
      JSON - * data to use as the post. Note: This will be used instead of params for the post - * data. Any params will be appended to the URL.
    • - *
    • disableCaching : Boolean (Optional)
      True - * to add a unique cache-buster param to GET requests.
    • - *

    - *

    The options object may also contain any other property which might be needed to perform - * postprocessing in a callback because it is passed to callback functions.

    - * @return {Number} transactionId The id of the server transaction. This may be used - * to cancel the request. - */ - request : function(o){ - var me = this; - if(me.fireEvent(BEFOREREQUEST, me, o)){ - if (o.el) { - if(!Ext.isEmpty(o.indicatorText)){ - me.indicatorText = '
    '+o.indicatorText+"
    "; - } - if(me.indicatorText) { - Ext.getDom(o.el).innerHTML = me.indicatorText; - } - o.success = (Ext.isFunction(o.success) ? o.success : function(){}).createInterceptor(function(response) { - Ext.getDom(o.el).innerHTML = response.responseText; - }); - } - - var p = o.params, - url = o.url || me.url, - method, - cb = {success: me.handleResponse, - failure: me.handleFailure, - scope: me, - argument: {options: o}, - timeout : Ext.num(o.timeout, me.timeout) - }, - form, - serForm; - - - if (Ext.isFunction(p)) { - p = p.call(o.scope||WINDOW, o); - } - - p = Ext.urlEncode(me.extraParams, Ext.isObject(p) ? Ext.urlEncode(p) : p); - - if (Ext.isFunction(url)) { - url = url.call(o.scope || WINDOW, o); - } - - if((form = Ext.getDom(o.form))){ - url = url || form.action; - if(o.isUpload || (/multipart\/form-data/i.test(form.getAttribute("enctype")))) { - return me.doFormUpload.call(me, o, p, url); - } - serForm = Ext.lib.Ajax.serializeForm(form); - p = p ? (p + '&' + serForm) : serForm; - } - - method = o.method || me.method || ((p || o.xmlData || o.jsonData) ? POST : GET); - - if(method === GET && (me.disableCaching && o.disableCaching !== false) || o.disableCaching === true){ - var dcp = o.disableCachingParam || me.disableCachingParam; - url = Ext.urlAppend(url, dcp + '=' + (new Date().getTime())); - } - - o.headers = Ext.apply(o.headers || {}, me.defaultHeaders || {}); - - if(o.autoAbort === true || me.autoAbort) { - me.abort(); - } - - if((method == GET || o.xmlData || o.jsonData) && p){ - url = Ext.urlAppend(url, p); - p = ''; - } - return (me.transId = Ext.lib.Ajax.request(method, url, cb, p, o)); - }else{ - return o.callback ? o.callback.apply(o.scope, [o,UNDEFINED,UNDEFINED]) : 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){ - return transId ? Ext.lib.Ajax.isCallInProgress(transId) : !! this.transId; - }, - - /** - * Aborts any outstanding request. - * @param {Number} transactionId (Optional) defaults to the last transaction - */ - abort : function(transId){ - if(transId || this.isLoading()){ - Ext.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); - if(options.success){ - options.success.call(options.scope, response, options); - } - if(options.callback){ - options.callback.call(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); - if(options.failure){ - options.failure.call(options.scope, response, options); - } - if(options.callback){ - options.callback.call(options.scope, options, false, response); - } - }, - - // private - doFormUpload : function(o, ps, url){ - var id = Ext.id(), - doc = document, - frame = doc.createElement('iframe'), - form = Ext.getDom(o.form), - hiddens = [], - hd, - encoding = 'multipart/form-data', - buf = { - target: form.target, - method: form.method, - encoding: form.encoding, - enctype: form.enctype, - action: form.action - }; - - /* - * Originally this behaviour was modified for Opera 10 to apply the secure URL after - * the frame had been added to the document. It seems this has since been corrected in - * Opera so the behaviour has been reverted, the URL will be set before being added. - */ - Ext.fly(frame).set({ - id: id, - name: id, - cls: 'x-hidden', - src: Ext.SSL_SECURE_URL - }); - - doc.body.appendChild(frame); - - // This is required so that IE doesn't pop the response up in a new window. - if(Ext.isIE){ - document.frames[id].name = id; - } - - - Ext.fly(form).set({ - target: id, - method: POST, - enctype: encoding, - encoding: encoding, - action: url || buf.action - }); - - // add dynamic params - Ext.iterate(Ext.urlDecode(ps, false), function(k, v){ - hd = doc.createElement('input'); - Ext.fly(hd).set({ - type: 'hidden', - value: v, - name: k - }); - form.appendChild(hd); - hiddens.push(hd); - }); - - function cb(){ - var me = this, - // bogus response object - r = {responseText : '', - responseXML : null, - argument : o.argument}, - doc, - firstChild; - - try{ - doc = frame.contentWindow.document || frame.contentDocument || WINDOW.frames[id].document; - if(doc){ - if(doc.body){ - if(/textarea/i.test((firstChild = doc.body.firstChild || {}).tagName)){ // json response wrapped in textarea - r.responseText = firstChild.value; - }else{ - r.responseText = doc.body.innerHTML; - } - } - //in IE the document may still have a body even if returns XML. - r.responseXML = doc.XMLDocument || doc; - } - } - catch(e) {} - - Ext.EventManager.removeListener(frame, LOAD, cb, me); - - me.fireEvent(REQUESTCOMPLETE, me, r, o); - - function runCallback(fn, scope, args){ - if(Ext.isFunction(fn)){ - fn.apply(scope, args); - } - } - - runCallback(o.success, o.scope, [r, o]); - runCallback(o.callback, o.scope, [o, true, r]); - - if(!me.debugUploads){ - setTimeout(function(){Ext.removeNode(frame);}, 100); - } - } - - Ext.EventManager.on(frame, LOAD, cb, this); - form.submit(); - - Ext.fly(form).set(buf); - Ext.each(hiddens, function(h) { - Ext.removeNode(h); - }); - } - }); -})(); - -/** - * @class Ext.Ajax - * @extends Ext.data.Connection - *

    The global Ajax request class that provides a simple way to make Ajax requests - * with maximum flexibility.

    - *

    Since Ext.Ajax is a singleton, you can set common properties/events for it once - * and override them at the request function level only if necessary.

    - *

    Common Properties you may want to set are:

      - *
    • {@link #method}

    • - *
    • {@link #extraParams}

    • - *
    • {@link #url}

    • - *
    - *
    
    -// Default headers to pass in every request
    -Ext.Ajax.defaultHeaders = {
    -    'Powered-By': 'Ext'
    -};
    - * 
    - *

    - *

    Common Events you may want to set are:

      - *
    • {@link Ext.data.Connection#beforerequest beforerequest}

    • - *
    • {@link Ext.data.Connection#requestcomplete requestcomplete}

    • - *
    • {@link Ext.data.Connection#requestexception requestexception}

    • - *
    - *
    
    -// Example: show a spinner during all Ajax requests
    -Ext.Ajax.on('beforerequest', this.showSpinner, this);
    -Ext.Ajax.on('requestcomplete', this.hideSpinner, this);
    -Ext.Ajax.on('requestexception', this.hideSpinner, this);
    - * 
    - *

    - *

    An example request:

    - *
    
    -// Basic request
    -Ext.Ajax.{@link Ext.data.Connection#request request}({
    -   url: 'foo.php',
    -   success: someFn,
    -   failure: otherFn,
    -   headers: {
    -       'my-header': 'foo'
    -   },
    -   params: { foo: 'bar' }
    -});
    -
    -// Simple ajax form submission
    -Ext.Ajax.{@link Ext.data.Connection#request request}({
    -    form: 'some-form',
    -    params: 'foo=bar'
    -});
    - * 
    - *

    - * @singleton - */ -Ext.Ajax = new Ext.data.Connection({ - /** - * @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) - * If the server receives all requests through one URL, setting this once is easier than - * entering it on every request. - * @type String - */ - /** - * @property extraParams - * An object containing properties which are used as extra parameters to each request made - * by this object (defaults to undefined). Session information and other data that you need - * to pass with each request are commonly put here. - * @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. Note that this is case-sensitive and - * should be all caps (defaults to undefined; if not set but params are present will use - * "POST", otherwise will use "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 Ext.lib.Ajax.serializeForm(form); - } -}); diff --git a/assets/js/ext/src/ext-core/src/util/DelayedTask.js b/assets/js/ext/src/ext-core/src/util/DelayedTask.js deleted file mode 100644 index 898c7ce..0000000 --- a/assets/js/ext/src/ext-core/src/util/DelayedTask.js +++ /dev/null @@ -1,70 +0,0 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.com/license - */ -/** - * @class Ext.util.DelayedTask - *

    The DelayedTask class provides a convenient way to "buffer" the execution of a method, - * performing setTimeout where a new timeout cancels the old timeout. When called, the - * task will wait the specified time period before executing. If durng that time period, - * the task is called again, the original call will be cancelled. This continues so that - * the function is only called a single time for each iteration.

    - *

    This method is especially useful for things like detecting whether a user has finished - * typing in a text field. 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. Usage:

    
    -var task = new Ext.util.DelayedTask(function(){
    -    alert(Ext.getDom('myInputField').value.length);
    -});
    -// Wait 500ms before calling our function. If the user presses another key 
    -// during that 500ms, it will be cancelled and we'll wait another 500ms.
    -Ext.get('myInputField').on('keypress', function(){
    -    task.{@link #delay}(500); 
    -});
    - * 
    - *

    Note that we are using a DelayedTask here to illustrate a point. The configuration - * option buffer for {@link Ext.util.Observable#addListener addListener/on} will - * also setup a delayed task for you to buffer events.

    - * @constructor The parameters to this constructor serve as defaults and are not required. - * @param {Function} fn (optional) The default function to call. - * @param {Object} scope The default scope (The this reference) in which the - * function is called. If not specified, this will refer to the browser window. - * @param {Array} args (optional) The default Array of arguments. - */ -Ext.util.DelayedTask = function(fn, scope, args){ - var me = this, - id, - call = function(){ - 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. Remember that if no scope - * is specified, this will refer to the browser window. - * @param {Array} newArgs (optional) Overrides args passed to constructor - */ - me.delay = function(delay, newFn, newScope, newArgs){ - me.cancel(); - fn = newFn || fn; - scope = newScope || scope; - args = newArgs || args; - id = setInterval(call, delay); - }; - - /** - * Cancel the last queued timeout - */ - me.cancel = function(){ - if(id){ - clearInterval(id); - id = null; - } - }; -}; \ No newline at end of file diff --git a/assets/js/ext/src/ext-core/src/util/JSON.js b/assets/js/ext/src/ext-core/src/util/JSON.js deleted file mode 100644 index 1b0e60d..0000000 --- a/assets/js/ext/src/ext-core/src/util/JSON.js +++ /dev/null @@ -1,190 +0,0 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.com/license - */ -/** - * @class Ext.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 - */ -Ext.util.JSON = new (function(){ - var useHasOwn = !!{}.hasOwnProperty, - isNative = function() { - var useNative = null; - - return function() { - if (useNative === null) { - useNative = Ext.USE_NATIVE_JSON && window.JSON && JSON.toString() == '[object JSON]'; - } - - return useNative; - }; - }(), - pad = function(n) { - return n < 10 ? "0" + n : n; - }, - doDecode = function(json){ - return eval("(" + json + ")"); - }, - doEncode = function(o){ - if(!Ext.isDefined(o) || o === null){ - return "null"; - }else if(Ext.isArray(o)){ - return encodeArray(o); - }else if(Ext.isDate(o)){ - return Ext.util.JSON.encodeDate(o); - }else if(Ext.isString(o)){ - return encodeString(o); - }else if(typeof o == "number"){ - //don't use isNumber here, since finite checks happen inside isNumber - return isFinite(o) ? String(o) : "null"; - }else if(Ext.isBoolean(o)){ - return String(o); - }else { - var a = ["{"], b, i, v; - for (i in o) { - // don't encode DOM objects - if(!o.getElementsByTagName){ - 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(doEncode(i), ":", - v === null ? "null" : doEncode(v)); - b = true; - } - } - } - } - a.push("}"); - return a.join(""); - } - }, - m = { - "\b": '\\b', - "\t": '\\t', - "\n": '\\n', - "\f": '\\f', - "\r": '\\r', - '"' : '\\"', - "\\": '\\\\' - }, - 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 + '"'; - }, - 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" : Ext.util.JSON.encode(v)); - b = true; - } - } - a.push("]"); - return a.join(""); - }; - - /** - *

    Encodes a Date. This returns the actual string which is inserted into the JSON string as the literal expression. - * The returned value includes enclosing double quotation marks.

    - *

    The default return format is "yyyy-mm-ddThh:mm:ss".

    - *

    To override this:

    
    -Ext.util.JSON.encodeDate = function(d) {
    -    return d.format('"Y-m-d"');
    -};
    -
    - * @param {Date} d The Date to encode - * @return {String} The string literal to use in a JSON string. - */ - this.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() { - var ec; - return function(o) { - if (!ec) { - // setup encoding function on first access - ec = isNative() ? JSON.stringify : doEncode; - } - return ec(o); - }; - }(); - - - /** - * Decodes (parses) a JSON string to an object. If the JSON is invalid, this function throws a SyntaxError unless the safe option is set. - * @param {String} json The JSON string - * @return {Object} The resulting object - */ - this.decode = function() { - var dc; - return function(json) { - if (!dc) { - // setup decoding function on first access - dc = isNative() ? JSON.parse : doDecode; - } - return dc(json); - }; - }(); - -})(); -/** - * Shorthand for {@link Ext.util.JSON#encode} - * @param {Mixed} o The variable to encode - * @return {String} The JSON string - * @member Ext - * @method encode - */ -Ext.encode = Ext.util.JSON.encode; -/** - * Shorthand for {@link Ext.util.JSON#decode} - * @param {String} json The JSON string - * @param {Boolean} safe (optional) Whether to return null or throw an exception if the JSON is invalid. - * @return {Object} The resulting object - * @member Ext - * @method decode - */ -Ext.decode = Ext.util.JSON.decode; diff --git a/assets/js/ext/src/ext-core/src/util/Observable.js b/assets/js/ext/src/ext-core/src/util/Observable.js deleted file mode 100644 index 62f9f42..0000000 --- a/assets/js/ext/src/ext-core/src/util/Observable.js +++ /dev/null @@ -1,528 +0,0 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.com/license - */ -(function(){ - -var EXTUTIL = Ext.util, - EACH = Ext.each, - TRUE = true, - FALSE = false; -/** - * @class Ext.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, and, optionally, a property "listeners" - * with configured listeners defined.
    - * For example: - *
    
    -Employee = Ext.extend(Ext.util.Observable, {
    -    constructor: function(config){
    -        this.name = config.name;
    -        this.addEvents({
    -            "fired" : true,
    -            "quit" : true
    -        });
    -
    -        // Copy configured listeners into *this* object so that the base class's
    -        // constructor will add them.
    -        this.listeners = config.listeners;
    -
    -        // Call our superclass constructor to complete construction process.
    -        Employee.superclass.constructor.call(this, config)
    -    }
    -});
    -
    - * This could then be used like this:
    
    -var newEmployee = new Employee({
    -    name: employeeName,
    -    listeners: {
    -        quit: function() {
    -            // By default, "this" will be the object that fired the event.
    -            alert(this.name + " has quit!");
    -        }
    -    }
    -});
    -
    - */ -EXTUTIL.Observable = function(){ - /** - * @cfg {Object} listeners (optional)

    A config object containing one or more event handlers to be added to this - * object during initialization. This should be a valid listeners config object as specified in the - * {@link #addListener} example for attaching multiple handlers at once.

    - *

    DOM events from ExtJs {@link Ext.Component Components}

    - *

    While some ExtJs Component classes export selected DOM events (e.g. "click", "mouseover" etc), this - * is usually only done when extra value can be added. For example the {@link Ext.DataView DataView}'s - * {@link Ext.DataView#click click} event passing the node clicked on. To access DOM - * events directly from a Component's HTMLElement, listeners must be added to the {@link Ext.Component#getEl Element} after the Component - * has been rendered. A plugin can simplify this step:

    
    -// Plugin is configured with a listeners config object.
    -// The Component is appended to the argument list of all handler functions.
    -Ext.DomObserver = Ext.extend(Object, {
    -    constructor: function(config) {
    -        this.listeners = config.listeners ? config.listeners : config;
    -    },
    -
    -    // Component passes itself into plugin's init method
    -    init: function(c) {
    -        var p, l = this.listeners;
    -        for (p in l) {
    -            if (Ext.isFunction(l[p])) {
    -                l[p] = this.createHandler(l[p], c);
    -            } else {
    -                l[p].fn = this.createHandler(l[p].fn, c);
    -            }
    -        }
    -
    -        // Add the listeners to the Element immediately following the render call
    -        c.render = c.render.{@link Function#createSequence createSequence}(function() {
    -            var e = c.getEl();
    -            if (e) {
    -                e.on(l);
    -            }
    -        });
    -    },
    -
    -    createHandler: function(fn, c) {
    -        return function(e) {
    -            fn.call(this, e, c);
    -        };
    -    }
    -});
    -
    -var combo = new Ext.form.ComboBox({
    -
    -    // Collapse combo when its element is clicked on
    -    plugins: [ new Ext.DomObserver({
    -        click: function(evt, comp) {
    -            comp.collapse();
    -        }
    -    })],
    -    store: myStore,
    -    typeAhead: true,
    -    mode: 'local',
    -    triggerAction: 'all'
    -});
    -     * 

    - */ - var me = this, e = me.events; - if(me.listeners){ - me.on(me.listeners); - delete me.listeners; - } - me.events = e || {}; -}; - -EXTUTIL.Observable.prototype = { - // private - filterOptRe : /^(?:scope|delay|buffer|single)$/, - - /** - *

    Fires the specified event with the passed parameters (minus the event name).

    - *

    An event may be set to bubble up an Observable parent hierarchy (See {@link Ext.Component#getBubbleTarget}) - * by calling {@link #enableBubble}.

    - * @param {String} eventName The name of the event to fire. - * @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 a = Array.prototype.slice.call(arguments, 0), - ename = a[0].toLowerCase(), - me = this, - ret = TRUE, - ce = me.events[ename], - cc, - q, - c; - if (me.eventsSuspended === TRUE) { - if (q = me.eventQueue) { - q.push(a); - } - } - else if(typeof ce == 'object') { - if (ce.bubble){ - if(ce.fire.apply(ce, a.slice(1)) === FALSE) { - return FALSE; - } - c = me.getBubbleTarget && me.getBubbleTarget(); - if(c && c.enableBubble) { - cc = c.events[ename]; - if(!cc || typeof cc != 'object' || !cc.bubble) { - c.enableBubble(ename); - } - return c.fireEvent.apply(c, a); - } - } - else { - a.shift(); - ret = ce.fire.apply(ce, a); - } - } - return ret; - }, - - /** - * Appends an event handler to this object. - * @param {String} eventName The name of the event to listen for. - * @param {Function} handler The method the event invokes. - * @param {Object} scope (optional) The scope (this reference) in which the handler function is executed. - * If omitted, defaults to the object which fired the event. - * @param {Object} options (optional) An object containing handler configuration. - * properties. This may contain any of the following properties:
      - *
    • scope : Object
      The scope (this reference) in which the handler function is executed. - * If omitted, defaults to the object which fired the event.
    • - *
    • delay : Number
      The number of milliseconds to delay the invocation of the handler after the event fires.
    • - *
    • single : Boolean
      True to add a handler to handle just the next firing of the event, and then remove itself.
    • - *
    • buffer : Number
      Causes the handler to be scheduled to run in an {@link Ext.util.DelayedTask} delayed - * by the specified number of milliseconds. If the event fires again within that time, the original - * handler is not invoked, but the new handler is scheduled in its place.
    • - *
    • target : Observable
      Only call the handler if the event was fired on the target Observable, not - * if the event was bubbled up from a child Observable.
    • - *

    - *

    - * Combining Options
    - * Using the options argument, it is possible to combine different types of listeners:
    - *
    - * A delayed, one-time listener. - *

    
    -myDataView.on('click', this.onClick, this, {
    -single: true,
    -delay: 100
    -});
    - *

    - * Attaching multiple handlers in 1 call
    - * The method also allows for a single argument to be passed which is a config object containing properties - * which specify multiple handlers. - *

    - *

    
    -myGridPanel.on({
    -'click' : {
    -    fn: this.onClick,
    -    scope: this,
    -    delay: 100
    -},
    -'mouseover' : {
    -    fn: this.onMouseOver,
    -    scope: this
    -},
    -'mouseout' : {
    -    fn: this.onMouseOut,
    -    scope: this
    -}
    -});
    - *

    - * Or a shorthand syntax:
    - *

    
    -myGridPanel.on({
    -'click' : this.onClick,
    -'mouseover' : this.onMouseOver,
    -'mouseout' : this.onMouseOut,
    - scope: this
    -});
    - */ - addListener : function(eventName, fn, scope, o){ - var me = this, - e, - oe, - ce; - - if (typeof eventName == 'object') { - o = eventName; - for (e in o) { - oe = o[e]; - if (!me.filterOptRe.test(e)) { - me.addListener(e, oe.fn || oe, oe.scope || o.scope, oe.fn ? oe : o); - } - } - } else { - eventName = eventName.toLowerCase(); - ce = me.events[eventName] || TRUE; - if (typeof ce == 'boolean') { - me.events[eventName] = ce = new EXTUTIL.Event(me, eventName); - } - ce.addListener(fn, scope, typeof o == 'object' ? o : {}); - } - }, - - /** - * Removes an event handler. - * @param {String} eventName The type of event the handler was associated with. - * @param {Function} handler The handler to remove. This must be a reference to the function passed into the {@link #addListener} call. - * @param {Object} scope (optional) The scope originally specified 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(){ - var events = this.events, - evt, - key; - for(key in events){ - evt = events[key]; - if(typeof evt == 'object'){ - evt.clearListeners(); - } - } - }, - - /** - * Adds the specified events to the list of events which this Observable may fire. - * @param {Object|String} o Either an object with event names as properties with a value of true - * or the first event name string if multiple event names are being passed as separate parameters. - * @param {string} Optional. Event name if multiple event names are being passed as separate parameters. - * Usage:
    
    -this.addEvents('storeloaded', 'storecleared');
    -
    - */ - addEvents : function(o){ - var me = this; - me.events = me.events || {}; - if (typeof o == 'string') { - var a = arguments, - i = a.length; - while(i--) { - me.events[a[i]] = me.events[a[i]] || TRUE; - } - } else { - Ext.applyIf(me.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.toLowerCase()]; - return typeof e == 'object' && e.listeners.length > 0; - }, - - /** - * Suspend the firing of all events. (see {@link #resumeEvents}) - * @param {Boolean} queueSuspended Pass as true to queue up suspended events to be fired - * after the {@link #resumeEvents} call instead of discarding all suspended events; - */ - suspendEvents : function(queueSuspended){ - this.eventsSuspended = TRUE; - if(queueSuspended && !this.eventQueue){ - this.eventQueue = []; - } - }, - - /** - * Resume firing events. (see {@link #suspendEvents}) - * If events were suspended using the queueSuspended parameter, then all - * events fired during event suspension will be sent to any listeners now. - */ - resumeEvents : function(){ - var me = this, - queued = me.eventQueue || []; - me.eventsSuspended = FALSE; - delete me.eventQueue; - EACH(queued, function(e) { - me.fireEvent.apply(me, e); - }); - } -}; - -var OBSERVABLE = EXTUTIL.Observable.prototype; -/** - * Appends an event handler to this object (shorthand for {@link #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 (this reference) in which the handler function is executed. - * If omitted, defaults to the object which fired the event. - * @param {Object} options (optional) An object containing handler configuration. - * @method - */ -OBSERVABLE.on = OBSERVABLE.addListener; -/** - * Removes an event handler (shorthand for {@link #removeListener}.) - * @param {String} eventName The type of event the handler was associated with. - * @param {Function} handler The handler to remove. This must be a reference to the function passed into the {@link #addListener} call. - * @param {Object} scope (optional) The scope originally specified for the handler. - * @method - */ -OBSERVABLE.un = OBSERVABLE.removeListener; - -/** - * Removes all added captures from the Observable. - * @param {Observable} o The Observable to release - * @static - */ -EXTUTIL.Observable.releaseCapture = function(o){ - o.fireEvent = OBSERVABLE.fireEvent; -}; - -function createTargeted(h, o, scope){ - return function(){ - if(o.target == arguments[0]){ - h.apply(scope, Array.prototype.slice.call(arguments, 0)); - } - }; -}; - -function createBuffered(h, o, l, scope){ - l.task = new EXTUTIL.DelayedTask(); - return function(){ - l.task.delay(o.buffer, h, scope, Array.prototype.slice.call(arguments, 0)); - }; -}; - -function createSingle(h, e, fn, scope){ - return function(){ - e.removeListener(fn, scope); - return h.apply(scope, arguments); - }; -}; - -function createDelayed(h, o, l, scope){ - return function(){ - var task = new EXTUTIL.DelayedTask(), - args = Array.prototype.slice.call(arguments, 0); - if(!l.tasks) { - l.tasks = []; - } - l.tasks.push(task); - task.delay(o.delay || 10, function(){ - l.tasks.remove(task); - h.apply(scope, args); - }, scope); - }; -}; - -EXTUTIL.Event = function(obj, name){ - this.name = name; - this.obj = obj; - this.listeners = []; -}; - -EXTUTIL.Event.prototype = { - addListener : function(fn, scope, options){ - var me = this, - l; - scope = scope || me.obj; - if(!me.isListening(fn, scope)){ - l = me.createListener(fn, scope, options); - if(me.firing){ // if we are currently firing this event, don't disturb the listener loop - me.listeners = me.listeners.slice(0); - } - me.listeners.push(l); - } - }, - - createListener: function(fn, scope, o){ - o = o || {}; - scope = scope || this.obj; - var l = { - fn: fn, - scope: scope, - options: o - }, h = fn; - if(o.target){ - h = createTargeted(h, o, scope); - } - if(o.delay){ - h = createDelayed(h, o, l, scope); - } - if(o.single){ - h = createSingle(h, this, fn, scope); - } - if(o.buffer){ - h = createBuffered(h, o, l, scope); - } - l.fireFn = h; - return l; - }, - - findListener : function(fn, scope){ - var list = this.listeners, - i = list.length, - l; - - scope = scope || this.obj; - while(i--){ - l = list[i]; - if(l){ - 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, - l, - k, - me = this, - ret = FALSE; - if((index = me.findListener(fn, scope)) != -1){ - if (me.firing) { - me.listeners = me.listeners.slice(0); - } - l = me.listeners[index]; - if(l.task) { - l.task.cancel(); - delete l.task; - } - k = l.tasks && l.tasks.length; - if(k) { - while(k--) { - l.tasks[k].cancel(); - } - delete l.tasks; - } - me.listeners.splice(index, 1); - ret = TRUE; - } - return ret; - }, - - // Iterate to stop any buffered/delayed events - clearListeners : function(){ - var me = this, - l = me.listeners, - i = l.length; - while(i--) { - me.removeListener(l[i].fn, l[i].scope); - } - }, - - fire : function(){ - var me = this, - listeners = me.listeners, - len = listeners.length, - i = 0, - l; - - if(len > 0){ - me.firing = TRUE; - var args = Array.prototype.slice.call(arguments, 0); - for (; i < len; i++) { - l = listeners[i]; - if(l && l.fireFn.apply(l.scope || me.obj || window, args) === FALSE) { - return (me.firing = FALSE); - } - } - } - me.firing = FALSE; - return TRUE; - } - -}; -})(); diff --git a/assets/js/ext/src/ext-core/src/util/TaskMgr.js b/assets/js/ext/src/ext-core/src/util/TaskMgr.js deleted file mode 100644 index 942d861..0000000 --- a/assets/js/ext/src/ext-core/src/util/TaskMgr.js +++ /dev/null @@ -1,180 +0,0 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.com/license - */ -/** - * @class Ext.util.TaskRunner - * Provides the ability to execute one or more arbitrary tasks in a multithreaded - * manner. Generally, you can use the singleton {@link Ext.TaskMgr} instead, but - * if needed, you can create separate instances of TaskRunner. Any number of - * separate tasks can be started at any time and will run independently of each - * other. Example usage: - *
    
    -// Start a simple clock task that updates a div once per second
    -var updateClock = function(){
    -    Ext.fly('clock').update(new Date().format('g:i:s A'));
    -} 
    -var task = {
    -    run: updateClock,
    -    interval: 1000 //1 second
    -}
    -var runner = new Ext.util.TaskRunner();
    -runner.start(task);
    -
    -// equivalent using TaskMgr
    -Ext.TaskMgr.start({
    -    run: updateClock,
    -    interval: 1000
    -});
    -
    - * 
    - *

    See the {@link #start} method for details about how to configure a task object.

    - * Also see {@link Ext.util.DelayedTask}. - * - * @constructor - * @param {Number} interval (optional) The minimum precision in milliseconds supported by this TaskRunner instance - * (defaults to 10) - */ -Ext.util.TaskRunner = function(interval){ - interval = interval || 10; - var tasks = [], - removeQueue = [], - id = 0, - running = false, - - // private - stopThread = function(){ - running = false; - clearInterval(id); - id = 0; - }, - - // private - startThread = function(){ - if(!running){ - running = true; - id = setInterval(runTasks, interval); - } - }, - - // private - removeTask = function(t){ - removeQueue.push(t); - if(t.onStop){ - t.onStop.apply(t.scope || t); - } - }, - - // private - runTasks = function(){ - var rqLen = removeQueue.length, - now = new Date().getTime(); - - if(rqLen > 0){ - for(var i = 0; i < rqLen; i++){ - tasks.remove(removeQueue[i]); - } - removeQueue = []; - if(tasks.length < 1){ - stopThread(); - return; - } - } - for(var i = 0, t, itime, rt, len = tasks.length; i < len; ++i){ - t = tasks[i]; - itime = now - t.taskRunTime; - if(t.interval <= itime){ - 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); - } - } - }; - - /** - * Starts a new task. - * @method start - * @param {Object} task

    A config object that supports the following properties:

      - *
    • run : Function

      The function to execute each time the task is invoked. The - * function will be called at each interval and passed the args argument if specified, and the - * current invocation count if not.

      - *

      If a particular scope (this reference) is required, be sure to specify it using the scope argument.

      - *

      Return false from this function to terminate the task.

    • - *
    • interval : Number
      The frequency in milliseconds with which the task - * should be invoked.
    • - *
    • args : Array
      (optional) An array of arguments to be passed to the function - * specified by run. If not specified, the current invocation count is passed.
    • - *
    • scope : Object
      (optional) The scope (this reference) in which to execute the - * run function. Defaults to the task config object.
    • - *
    • duration : Number
      (optional) The length of time in milliseconds to invoke - * the task before stopping automatically (defaults to indefinite).
    • - *
    • repeat : Number
      (optional) The number of times to invoke the task before - * stopping automatically (defaults to indefinite).
    • - *

    - *

    Before each invocation, Ext injects the property taskRunCount into the task object so - * that calculations based on the repeat count can be performed.

    - * @return {Object} The task - */ - this.start = function(task){ - tasks.push(task); - task.taskStartTime = new Date().getTime(); - task.taskRunTime = 0; - task.taskRunCount = 0; - startThread(); - return task; - }; - - /** - * Stops an existing running task. - * @method stop - * @param {Object} task The task to stop - * @return {Object} The task - */ - this.stop = function(task){ - removeTask(task); - return task; - }; - - /** - * Stops all tasks that are currently running. - * @method stopAll - */ - this.stopAll = function(){ - stopThread(); - for(var i = 0, len = tasks.length; i < len; i++){ - if(tasks[i].onStop){ - tasks[i].onStop(); - } - } - tasks = []; - removeQueue = []; - }; -}; - -/** - * @class Ext.TaskMgr - * @extends Ext.util.TaskRunner - * A static {@link Ext.util.TaskRunner} instance that can be used to start and stop arbitrary tasks. See - * {@link Ext.util.TaskRunner} for supported methods and task config properties. - *
    
    -// Start a simple clock task that updates a div once per second
    -var task = {
    -    run: function(){
    -        Ext.fly('clock').update(new Date().format('g:i:s A'));
    -    },
    -    interval: 1000 //1 second
    -}
    -Ext.TaskMgr.start(task);
    -
    - *

    See the {@link #start} method for details about how to configure a task object.

    - * @singleton - */ -Ext.TaskMgr = new Ext.util.TaskRunner(); \ No newline at end of file diff --git a/assets/js/ext/src/ext-core/test/yui_2.6.0/yui/build/logger/logger-min.js b/assets/js/ext/src/ext-core/test/yui_2.6.0/yui/build/logger/logger-min.js deleted file mode 100644 index 4d50114..0000000 --- a/assets/js/ext/src/ext-core/test/yui_2.6.0/yui/build/logger/logger-min.js +++ /dev/null @@ -1,15 +0,0 @@ -/*! - * Ext JS Library 3.3.1 - * Copyright(c) 2006-2010 Sencha Inc. - * licensing@sencha.com - * http://www.sencha.com/license - */ -/* -Copyright (c) 2008, Yahoo! Inc. All rights reserved. -Code licensed under the BSD License: -http://developer.yahoo.net/yui/license.txt -version: 2.6.0 -*/ -YAHOO.widget.LogMsg=function(A){this.msg=this.time=this.category=this.source=this.sourceDetail=null;if(A&&(A.constructor==Object)){for(var B in A){if(A.hasOwnProperty(B)){this[B]=A[B];}}}};YAHOO.widget.LogWriter=function(A){if(!A){YAHOO.log("Could not instantiate LogWriter due to invalid source.","error","LogWriter");return ;}this._source=A;};YAHOO.widget.LogWriter.prototype.toString=function(){return"LogWriter "+this._sSource;};YAHOO.widget.LogWriter.prototype.log=function(A,B){YAHOO.widget.Logger.log(A,B,this._source);};YAHOO.widget.LogWriter.prototype.getSource=function(){return this._source;};YAHOO.widget.LogWriter.prototype.setSource=function(A){if(!A){YAHOO.log("Could not set source due to invalid source.","error",this.toString());return ;}else{this._source=A;}};YAHOO.widget.LogWriter.prototype._source=null;YAHOO.widget.LogReader=function(B,A){this._sName=YAHOO.widget.LogReader._index;YAHOO.widget.LogReader._index++;this._buffer=[];this._filterCheckboxes={};this._lastTime=YAHOO.widget.Logger.getStartTime();if(A&&(A.constructor==Object)){for(var C in A){if(A.hasOwnProperty(C)){this[C]=A[C];}}}this._initContainerEl(B);if(!this._elContainer){YAHOO.log("Could not instantiate LogReader due to an invalid container element "+B,"error",this.toString());return ;}this._initHeaderEl();this._initConsoleEl();this._initFooterEl();this._initDragDrop();this._initCategories();this._initSources();YAHOO.widget.Logger.newLogEvent.subscribe(this._onNewLog,this);YAHOO.widget.Logger.logResetEvent.subscribe(this._onReset,this);YAHOO.widget.Logger.categoryCreateEvent.subscribe(this._onCategoryCreate,this);YAHOO.widget.Logger.sourceCreateEvent.subscribe(this._onSourceCreate,this);this._filterLogs();YAHOO.log("LogReader initialized",null,this.toString());};YAHOO.lang.augmentObject(YAHOO.widget.LogReader,{_index:0,ENTRY_TEMPLATE:(function(){var A=document.createElement("pre");YAHOO.util.Dom.addClass(A,"yui-log-entry");return A;})(),VERBOSE_TEMPLATE:"

    {label} {totalTime}ms (+{elapsedTime}) {localTime}:

    {sourceAndDetail}

    {message}

    ",BASIC_TEMPLATE:"

    {label} {totalTime}ms (+{elapsedTime}) {localTime}: {sourceAndDetail}: {message}

    "});YAHOO.widget.LogReader.prototype={logReaderEnabled:true,width:null,height:null,top:null,left:null,right:null,bottom:null,fontSize:null,footerEnabled:true,verboseOutput:true,entryFormat:null,newestOnTop:true,outputBuffer:100,thresholdMax:500,thresholdMin:100,isCollapsed:false,isPaused:false,draggable:true,toString:function(){return"LogReader instance"+this._sName;},pause:function(){this.isPaused=true;this._timeout=null;this.logReaderEnabled=false;if(this._btnPause){this._btnPause.value="Resume";}},resume:function(){this.isPaused=false;this.logReaderEnabled=true;this._printBuffer();if(this._btnPause){this._btnPause.value="Pause";}},hide:function(){this._elContainer.style.display="none";},show:function(){this._elContainer.style.display="block";},collapse:function(){this._elConsole.style.display="none";if(this._elFt){this._elFt.style.display="none";}this._btnCollapse.value="Expand";this.isCollapsed=true;},expand:function(){this._elConsole.style.display="block";if(this._elFt){this._elFt.style.display="block";}this._btnCollapse.value="Collapse";this.isCollapsed=false;},getCheckbox:function(A){return this._filterCheckboxes[A];},getCategories:function(){return this._categoryFilters;},showCategory:function(B){var D=this._categoryFilters;if(D.indexOf){if(D.indexOf(B)>-1){return ;}}else{for(var A=0;A-1){return ;}}else{for(var B=0;B/g,">");}return"";},_sName:null,_buffer:null,_consoleMsgCount:0,_lastTime:null,_timeout:null,_filterCheckboxes:null,_categoryFilters:null,_sourceFilters:null,_elContainer:null,_elHd:null,_elCollapse:null,_btnCollapse:null,_title:null,_elConsole:null,_elFt:null,_elBtns:null,_elCategoryFilters:null,_elSourceFilters:null,_btnPause:null,_btnClear:null,_initContainerEl:function(B){B=YAHOO.util.Dom.get(B);if(B&&B.tagName&&(B.tagName.toLowerCase()=="div")){this._elContainer=B;YAHOO.util.Dom.addClass(this._elContainer,"yui-log");}else{this._elContainer=document.body.appendChild(document.createElement("div"));YAHOO.util.Dom.addClass(this._elContainer,"yui-log"); -YAHOO.util.Dom.addClass(this._elContainer,"yui-log-container");var A=this._elContainer.style;if(this.width){A.width=this.width;}if(this.right){A.right=this.right;}if(this.top){A.top=this.top;}if(this.left){A.left=this.left;A.right="auto";}if(this.bottom){A.bottom=this.bottom;A.top="auto";}if(this.fontSize){A.fontSize=this.fontSize;}if(navigator.userAgent.toLowerCase().indexOf("opera")!=-1){document.body.style+="";}}},_initHeaderEl:function(){var A=this;if(this._elHd){YAHOO.util.Event.purgeElement(this._elHd,true);this._elHd.innerHTML="";}this._elHd=this._elContainer.appendChild(document.createElement("div"));this._elHd.id="yui-log-hd"+this._sName;this._elHd.className="yui-log-hd";this._elCollapse=this._elHd.appendChild(document.createElement("div"));this._elCollapse.className="yui-log-btns";this._btnCollapse=document.createElement("input");this._btnCollapse.type="button";this._btnCollapse.className="yui-log-button";this._btnCollapse.value="Collapse";this._btnCollapse=this._elCollapse.appendChild(this._btnCollapse);YAHOO.util.Event.addListener(A._btnCollapse,"click",A._onClickCollapseBtn,A);this._title=this._elHd.appendChild(document.createElement("h4"));this._title.innerHTML="Logger Console";},_initConsoleEl:function(){if(this._elConsole){YAHOO.util.Event.purgeElement(this._elConsole,true);this._elConsole.innerHTML="";}this._elConsole=this._elContainer.appendChild(document.createElement("div"));this._elConsole.className="yui-log-bd";if(this.height){this._elConsole.style.height=this.height;}},_initFooterEl:function(){var A=this;if(this.footerEnabled){if(this._elFt){YAHOO.util.Event.purgeElement(this._elFt,true);this._elFt.innerHTML="";}this._elFt=this._elContainer.appendChild(document.createElement("div"));this._elFt.className="yui-log-ft";this._elBtns=this._elFt.appendChild(document.createElement("div"));this._elBtns.className="yui-log-btns";this._btnPause=document.createElement("input");this._btnPause.type="button";this._btnPause.className="yui-log-button";this._btnPause.value="Pause";this._btnPause=this._elBtns.appendChild(this._btnPause);YAHOO.util.Event.addListener(A._btnPause,"click",A._onClickPauseBtn,A);this._btnClear=document.createElement("input");this._btnClear.type="button";this._btnClear.className="yui-log-button";this._btnClear.value="Clear";this._btnClear=this._elBtns.appendChild(this._btnClear);YAHOO.util.Event.addListener(A._btnClear,"click",A._onClickClearBtn,A);this._elCategoryFilters=this._elFt.appendChild(document.createElement("div"));this._elCategoryFilters.className="yui-log-categoryfilters";this._elSourceFilters=this._elFt.appendChild(document.createElement("div"));this._elSourceFilters.className="yui-log-sourcefilters";}},_initDragDrop:function(){if(YAHOO.util.DD&&this.draggable&&this._elHd){var A=new YAHOO.util.DD(this._elContainer);A.setHandleElId(this._elHd.id);this._elHd.style.cursor="move";}},_initCategories:function(){this._categoryFilters=[];var C=YAHOO.widget.Logger.categories;for(var A=0;Athis.thresholdMax)){Q=0;}K=(B>Q)?(B-Q):0;for(H=K;H0){C=G.substring(0,D);A=G.substring(D,G.length);}else{C=G;}if(this._isNewSource(C)){this._createNewSource(C);}}var H=new Date();var J=new YAHOO.widget.LogMsg({msg:B,time:H,category:F,source:C,sourceDetail:A});var I=this._stack;var E=this.maxStackEntries;if(E&&!isNaN(E)&&(I.length>=E)){I.shift();}I.push(J);this.newLogEvent.fire(J);if(this._browserConsoleEnabled){this._printToBrowserConsole(J);}return true;}else{return false;}};YAHOO.widget.Logger.reset=function(){this._stack=[];this._startTime=new Date().getTime();this.loggerEnabled=true;this.log("Logger reset");this.logResetEvent.fire();};YAHOO.widget.Logger.getStack=function(){return this._stack;};YAHOO.widget.Logger.getStartTime=function(){return this._startTime;};YAHOO.widget.Logger.disableBrowserConsole=function(){YAHOO.log("Logger output to the function console.log() has been disabled.");this._browserConsoleEnabled=false;};YAHOO.widget.Logger.enableBrowserConsole=function(){this._browserConsoleEnabled=true;YAHOO.log("Logger output to the function console.log() has been enabled.");};YAHOO.widget.Logger.handleWindowErrors=function(){if(!YAHOO.widget.Logger._windowErrorsHandled){if(window.error){YAHOO.widget.Logger._origOnWindowError=window.onerror;}window.onerror=YAHOO.widget.Logger._onWindowError;YAHOO.widget.Logger._windowErrorsHandled=true;YAHOO.log("Logger handling of window.onerror has been enabled.");}else{YAHOO.log("Logger handling of window.onerror had already been enabled.");}};YAHOO.widget.Logger.unhandleWindowErrors=function(){if(YAHOO.widget.Logger._windowErrorsHandled){if(YAHOO.widget.Logger._origOnWindowError){window.onerror=YAHOO.widget.Logger._origOnWindowError;YAHOO.widget.Logger._origOnWindowError=null;}else{window.onerror=null;}YAHOO.widget.Logger._windowErrorsHandled=false;YAHOO.log("Logger handling of window.onerror has been disabled.");}else{YAHOO.log("Logger handling of window.onerror had already been disabled.");}};YAHOO.widget.Logger.categoryCreateEvent=new YAHOO.util.CustomEvent("categoryCreate",this,true);YAHOO.widget.Logger.sourceCreateEvent=new YAHOO.util.CustomEvent("sourceCreate",this,true);YAHOO.widget.Logger.newLogEvent=new YAHOO.util.CustomEvent("newLog",this,true);YAHOO.widget.Logger.logResetEvent=new YAHOO.util.CustomEvent("logReset",this,true);YAHOO.widget.Logger._createNewCategory=function(A){this.categories.push(A);this.categoryCreateEvent.fire(A);};YAHOO.widget.Logger._isNewCategory=function(B){for(var A=0;A0)?A.dump(D[F],I-1):L);}else{K.push(D[F]);}K.push(J);}if(K.length>1){K.pop();}K.push("]");}else{K.push("{");for(F in D){if(A.hasOwnProperty(D,F)){K.push(F+G);if(A.isObject(D[F])){K.push((I>0)?A.dump(D[F],I-1):L);}else{K.push(D[F]);}K.push(J);}}if(K.length>1){K.pop();}K.push("}");}return K.join("");},substitute:function(S,E,L){var I,H,G,O,P,R,N=[],F,J="dump",M=" ",D="{",Q="}";for(;;){I=S.lastIndexOf(D);if(I<0){break;}H=S.indexOf(Q,I);if(I+1>=H){break;}F=S.substring(I+1,H);O=F;R=null;G=O.indexOf(M);if(G>-1){R=O.substring(G+1);O=O.substring(0,G);}P=E[O];if(L){P=L(O,P,R);}if(A.isObject(P)){if(A.isArray(P)){P=A.dump(P,parseInt(R,10));}else{R=R||"";var K=R.indexOf(J);if(K>-1){R=R.substring(4);}if(P.toString===Object.prototype.toString||K>-1){P=A.dump(P,parseInt(R,10));}else{P=P.toString();}}}else{if(!A.isString(P)&&!A.isNumber(P)){P="~-"+N.length+"-~";N[N.length]=F;}}S=S.substring(0,I)+P+S.substring(H+1);}for(I=N.length-1;I>=0;I=I-1){S=S.replace(new RegExp("~-"+I+"-~"),"{"+N[I]+"}","g");}return S;},trim:function(D){try{return D.replace(/^\s+|\s+$/g,"");}catch(E){return D;}},merge:function(){var G={},E=arguments;for(var F=0,D=E.length;F=this.left&&A.right<=this.right&&A.top>=this.top&&A.bottom<=this.bottom);};YAHOO.util.Region.prototype.getArea=function(){return((this.bottom-this.top)*(this.right-this.left));};YAHOO.util.Region.prototype.intersect=function(E){var C=Math.max(this.top,E.top);var D=Math.min(this.right,E.right);var A=Math.min(this.bottom,E.bottom);var B=Math.max(this.left,E.left);if(A>=C&&D>=B){return new YAHOO.util.Region(C,D,A,B);}else{return null;}};YAHOO.util.Region.prototype.union=function(E){var C=Math.min(this.top,E.top);var D=Math.max(this.right,E.right);var A=Math.max(this.bottom,E.bottom);var B=Math.min(this.left,E.left);return new YAHOO.util.Region(C,D,A,B);};YAHOO.util.Region.prototype.toString=function(){return("Region {"+"top: "+this.top+", right: "+this.right+", bottom: "+this.bottom+", left: "+this.left+"}");};YAHOO.util.Region.getRegion=function(D){var F=YAHOO.util.Dom.getXY(D);var C=F[1];var E=F[0]+D.offsetWidth;var A=F[1]+D.offsetHeight;var B=F[0];return new YAHOO.util.Region(C,E,A,B);};YAHOO.util.Point=function(A,B){if(YAHOO.lang.isArray(A)){B=A[1];A=A[0];}this.x=this.right=this.left=this[0]=A;this.y=this.top=this.bottom=this[1]=B;};YAHOO.util.Point.prototype=new YAHOO.util.Region();YAHOO.register("dom",YAHOO.util.Dom,{version:"2.6.0",build:"1321"});YAHOO.util.CustomEvent=function(D,B,C,A){this.type=D;this.scope=B||window;this.silent=C;this.signature=A||YAHOO.util.CustomEvent.LIST;this.subscribers=[];if(!this.silent){}var E="_YUICEOnSubscribe";if(D!==E){this.subscribeEvent=new YAHOO.util.CustomEvent(E,this,true);}this.lastError=null;};YAHOO.util.CustomEvent.LIST=0;YAHOO.util.CustomEvent.FLAT=1;YAHOO.util.CustomEvent.prototype={subscribe:function(B,C,A){if(!B){throw new Error("Invalid callback for subscriber to '"+this.type+"'");}if(this.subscribeEvent){this.subscribeEvent.fire(B,C,A);}this.subscribers.push(new YAHOO.util.Subscriber(B,C,A));},unsubscribe:function(D,F){if(!D){return this.unsubscribeAll();}var E=false;for(var B=0,A=this.subscribers.length;B0){B=I[0];}try{G=M.fn.call(L,B,M.obj);}catch(F){this.lastError=F;if(A){throw F;}}}else{try{G=M.fn.call(L,this.type,I,M.obj);}catch(H){this.lastError=H;if(A){throw H;}}}if(false===G){if(!this.silent){}break;}}}return(G!==false);},unsubscribeAll:function(){for(var A=this.subscribers.length-1;A>-1;A--){this._delete(A);}this.subscribers=[];return A;},_delete:function(A){var B=this.subscribers[A];if(B){delete B.fn;delete B.obj;}this.subscribers.splice(A,1);},toString:function(){return"CustomEvent: "+"'"+this.type+"', "+"scope: "+this.scope;}};YAHOO.util.Subscriber=function(B,C,A){this.fn=B;this.obj=YAHOO.lang.isUndefined(C)?null:C;this.override=A;};YAHOO.util.Subscriber.prototype.getScope=function(A){if(this.override){if(this.override===true){return this.obj;}else{return this.override;}}return A;};YAHOO.util.Subscriber.prototype.contains=function(A,B){if(B){return(this.fn==A&&this.obj==B);}else{return(this.fn==A);}};YAHOO.util.Subscriber.prototype.toString=function(){return"Subscriber { obj: "+this.obj+", override: "+(this.override||"no")+" }";};if(!YAHOO.util.Event){YAHOO.util.Event=function(){var H=false;var I=[];var J=[];var G=[];var E=[];var C=0;var F=[];var B=[];var A=0;var D={63232:38,63233:40,63234:37,63235:39,63276:33,63277:34,25:9};var K=YAHOO.env.ua.ie?"focusin":"focus";var L=YAHOO.env.ua.ie?"focusout":"blur";return{POLL_RETRYS:2000,POLL_INTERVAL:20,EL:0,TYPE:1,FN:2,WFN:3,UNLOAD_OBJ:3,ADJ_SCOPE:4,OBJ:5,OVERRIDE:6,CAPTURE:7,lastError:null,isSafari:YAHOO.env.ua.webkit,webkit:YAHOO.env.ua.webkit,isIE:YAHOO.env.ua.ie,_interval:null,_dri:null,DOMReady:false,throwErrors:false,startInterval:function(){if(!this._interval){var M=this;var N=function(){M._tryPreloadAttach();};this._interval=setInterval(N,this.POLL_INTERVAL);}},onAvailable:function(R,O,S,Q,P){var M=(YAHOO.lang.isString(R))?[R]:R;for(var N=0;N-1;Q--){W=(this._removeListener(N[Q],M,V,Y)&&W);}return W;}}if(!V||!V.call){return this.purgeElement(N,false,M);}if("unload"==M){for(Q=J.length-1;Q>-1;Q--){X=J[Q];if(X&&X[0]==N&&X[1]==M&&X[2]==V){J.splice(Q,1);return true;}}return false;}var R=null;var S=arguments[4];if("undefined"===typeof S){S=this._getCacheIndex(N,M,V);}if(S>=0){R=I[S];}if(!N||!R){return false;}if(this.useLegacyEvent(N,M)){var P=this.getLegacyIndex(N,M);var O=E[P];if(O){for(Q=0,T=O.length;Q0&&F.length>0);}var R=[];var T=function(V,W){var U=V;if(W.override){if(W.override===true){U=W.obj;}else{U=W.override;}}W.fn.call(U,W.obj);};var N,M,Q,P,O=[];for(N=0,M=F.length;N-1;N--){Q=F[N];if(!Q||!Q.id){F.splice(N,1);}}this.startInterval();}else{clearInterval(this._interval);this._interval=null;}this.locked=false;},purgeElement:function(Q,R,T){var O=(YAHOO.lang.isString(Q))?this.getEl(Q):Q;var S=this.getListeners(O,T),P,M;if(S){for(P=S.length-1;P>-1;P--){var N=S[P];this._removeListener(O,N.type,N.fn,N.capture);}}if(R&&O&&O.childNodes){for(P=0,M=O.childNodes.length;P-1;O--){N=I[O];if(N){M._removeListener(N[M.EL],N[M.TYPE],N[M.FN],N[M.CAPTURE],O);}}N=null;}G=null;M._simpleRemove(window,"unload",M._unload);},_getScrollLeft:function(){return this._getScroll()[1];},_getScrollTop:function(){return this._getScroll()[0];},_getScroll:function(){var M=document.documentElement,N=document.body;if(M&&(M.scrollTop||M.scrollLeft)){return[M.scrollTop,M.scrollLeft];}else{if(N){return[N.scrollTop,N.scrollLeft];}else{return[0,0];}}},regCE:function(){},_simpleAdd:function(){if(window.addEventListener){return function(O,P,N,M){O.addEventListener(P,N,(M));};}else{if(window.attachEvent){return function(O,P,N,M){O.attachEvent("on"+P,N);};}else{return function(){};}}}(),_simpleRemove:function(){if(window.removeEventListener){return function(O,P,N,M){O.removeEventListener(P,N,(M));};}else{if(window.detachEvent){return function(N,O,M){N.detachEvent("on"+O,M);};}else{return function(){};}}}()};}();(function(){var EU=YAHOO.util.Event;EU.on=EU.addListener;EU.onFocus=EU.addFocusListener;EU.onBlur=EU.addBlurListener; -/* DOMReady: based on work by: Dean Edwards/John Resig/Matthias Miller */ -if(EU.isIE){YAHOO.util.Event.onDOMReady(YAHOO.util.Event._tryPreloadAttach,YAHOO.util.Event,true);var n=document.createElement("p");EU._dri=setInterval(function(){try{n.doScroll("left");clearInterval(EU._dri);EU._dri=null;EU._ready();n=null;}catch(ex){}},EU.POLL_INTERVAL);}else{if(EU.webkit&&EU.webkit<525){EU._dri=setInterval(function(){var rs=document.readyState;if("loaded"==rs||"complete"==rs){clearInterval(EU._dri);EU._dri=null;EU._ready();}},EU.POLL_INTERVAL);}else{EU._simpleAdd(document,"DOMContentLoaded",EU._ready);}}EU._simpleAdd(window,"load",EU._load);EU._simpleAdd(window,"unload",EU._unload);EU._tryPreloadAttach();})();}YAHOO.util.EventProvider=function(){};YAHOO.util.EventProvider.prototype={__yui_events:null,__yui_subscribers:null,subscribe:function(A,C,F,E){this.__yui_events=this.__yui_events||{}; -var D=this.__yui_events[A];if(D){D.subscribe(C,F,E);}else{this.__yui_subscribers=this.__yui_subscribers||{};var B=this.__yui_subscribers;if(!B[A]){B[A]=[];}B[A].push({fn:C,obj:F,override:E});}},unsubscribe:function(C,E,G){this.__yui_events=this.__yui_events||{};var A=this.__yui_events;if(C){var F=A[C];if(F){return F.unsubscribe(E,G);}}else{var B=true;for(var D in A){if(YAHOO.lang.hasOwnProperty(A,D)){B=B&&A[D].unsubscribe(E,G);}}return B;}return false;},unsubscribeAll:function(A){return this.unsubscribe(A);},createEvent:function(G,D){this.__yui_events=this.__yui_events||{};var A=D||{};var I=this.__yui_events;if(I[G]){}else{var H=A.scope||this;var E=(A.silent);var B=new YAHOO.util.CustomEvent(G,H,E,YAHOO.util.CustomEvent.FLAT);I[G]=B;if(A.onSubscribeCallback){B.subscribeEvent.subscribe(A.onSubscribeCallback);}this.__yui_subscribers=this.__yui_subscribers||{};var F=this.__yui_subscribers[G];if(F){for(var C=0;C0){return YAHOO.lang.substitute(B,{message:A});}else{return A;}},fail:function(A){throw new YAHOO.util.AssertionError(this._formatMessage(A,"Test force-failed."));},areEqual:function(B,C,A){if(B!=C){throw new YAHOO.util.ComparisonFailure(this._formatMessage(A,"Values should be equal."),B,C);}},areNotEqual:function(A,C,B){if(A==C){throw new YAHOO.util.UnexpectedValue(this._formatMessage(B,"Values should not be equal."),A);}},areNotSame:function(A,C,B){if(A===C){throw new YAHOO.util.UnexpectedValue(this._formatMessage(B,"Values should not be the same."),A);}},areSame:function(B,C,A){if(B!==C){throw new YAHOO.util.ComparisonFailure(this._formatMessage(A,"Values should be the same."),B,C);}},isFalse:function(B,A){if(false!==B){throw new YAHOO.util.ComparisonFailure(this._formatMessage(A,"Value should be false."),false,B);}},isTrue:function(B,A){if(true!==B){throw new YAHOO.util.ComparisonFailure(this._formatMessage(A,"Value should be true."),true,B);}},isNaN:function(B,A){if(!isNaN(B)){throw new YAHOO.util.ComparisonFailure(this._formatMessage(A,"Value should be NaN."),NaN,B);}},isNotNaN:function(B,A){if(isNaN(B)){throw new YAHOO.util.UnexpectedValue(this._formatMessage(A,"Values should not be NaN."),NaN);}},isNotNull:function(B,A){if(YAHOO.lang.isNull(B)){throw new YAHOO.util.UnexpectedValue(this._formatMessage(A,"Values should not be null."),null);}},isNotUndefined:function(B,A){if(YAHOO.lang.isUndefined(B)){throw new YAHOO.util.UnexpectedValue(this._formatMessage(A,"Value should not be undefined."),undefined);}},isNull:function(B,A){if(!YAHOO.lang.isNull(B)){throw new YAHOO.util.ComparisonFailure(this._formatMessage(A,"Value should be null."),null,B);}},isUndefined:function(B,A){if(!YAHOO.lang.isUndefined(B)){throw new YAHOO.util.ComparisonFailure(this._formatMessage(A,"Value should be undefined."),undefined,B);}},isArray:function(B,A){if(!YAHOO.lang.isArray(B)){throw new YAHOO.util.UnexpectedValue(this._formatMessage(A,"Value should be an array."),B);}},isBoolean:function(B,A){if(!YAHOO.lang.isBoolean(B)){throw new YAHOO.util.UnexpectedValue(this._formatMessage(A,"Value should be a Boolean."),B);}},isFunction:function(B,A){if(!YAHOO.lang.isFunction(B)){throw new YAHOO.util.UnexpectedValue(this._formatMessage(A,"Value should be a function."),B);}},isInstanceOf:function(B,C,A){if(!(C instanceof B)){throw new YAHOO.util.ComparisonFailure(this._formatMessage(A,"Value isn't an instance of expected type."),B,C);}},isNumber:function(B,A){if(!YAHOO.lang.isNumber(B)){throw new YAHOO.util.UnexpectedValue(this._formatMessage(A,"Value should be a number."),B);}},isObject:function(B,A){if(!YAHOO.lang.isObject(B)){throw new YAHOO.util.UnexpectedValue(this._formatMessage(A,"Value should be an object."),B);}},isString:function(B,A){if(!YAHOO.lang.isString(B)){throw new YAHOO.util.UnexpectedValue(this._formatMessage(A,"Value should be a string."),B);}},isTypeOf:function(A,C,B){if(typeof C!=A){throw new YAHOO.util.ComparisonFailure(this._formatMessage(B,"Value should be of type "+expected+"."),expected,typeof actual);}}};YAHOO.util.AssertionError=function(A){arguments.callee.superclass.constructor.call(this,A);this.message=A;this.name="AssertionError";};YAHOO.lang.extend(YAHOO.util.AssertionError,Error,{getMessage:function(){return this.message;},toString:function(){return this.name+": "+this.getMessage();},valueOf:function(){return this.toString();}});YAHOO.util.ComparisonFailure=function(B,A,C){arguments.callee.superclass.constructor.call(this,B);this.expected=A;this.actual=C;this.name="ComparisonFailure";};YAHOO.lang.extend(YAHOO.util.ComparisonFailure,YAHOO.util.AssertionError,{getMessage:function(){return this.message+"\nExpected: "+this.expected+" ("+(typeof this.expected)+")\nActual:"+this.actual+" ("+(typeof this.actual)+")";}});YAHOO.util.UnexpectedValue=function(B,A){arguments.callee.superclass.constructor.call(this,B);this.unexpected=A;this.name="UnexpectedValue";};YAHOO.lang.extend(YAHOO.util.UnexpectedValue,YAHOO.util.AssertionError,{getMessage:function(){return this.message+"\nUnexpected: "+this.unexpected+" ("+(typeof this.unexpected)+") ";}});YAHOO.util.ShouldFail=function(A){arguments.callee.superclass.constructor.call(this,A||"This test should fail but didn't.");this.name="ShouldFail";};YAHOO.lang.extend(YAHOO.util.ShouldFail,YAHOO.util.AssertionError);YAHOO.util.ShouldError=function(A){arguments.callee.superclass.constructor.call(this,A||"This test should have thrown an error but didn't."); -this.name="ShouldError";};YAHOO.lang.extend(YAHOO.util.ShouldError,YAHOO.util.AssertionError);YAHOO.util.UnexpectedError=function(A){arguments.callee.superclass.constructor.call(this,"Unexpected error: "+A.message);this.cause=A;this.name="UnexpectedError";this.stack=A.stack;};YAHOO.lang.extend(YAHOO.util.UnexpectedError,YAHOO.util.AssertionError);YAHOO.util.ArrayAssert={contains:function(E,D,B){var C=false;var F=YAHOO.util.Assert;for(var A=0;A0){var B=YAHOO.util.Assert;B.fail(B._formatMessage(A,"Array should be empty."));}},isNotEmpty:function(C,A){if(C.length===0){var B=YAHOO.util.Assert;B.fail(B._formatMessage(A,"Array should not be empty."));}},itemsAreSame:function(D,F,C){var A=Math.max(D.length,F.length);var E=YAHOO.util.Assert;for(var B=0;B=0;B--){if(D[B]===E){F.areEqual(A,B,F._formatMessage(C,"Value exists at index "+B+" but should be at index "+A+"."));return ;}}F.fail(F._formatMessage(C,"Value doesn't exist in array."));}};YAHOO.namespace("util");YAHOO.util.ObjectAssert={propertiesAreEqual:function(D,G,C){var F=YAHOO.util.Assert;var B=[];for(var E in D){B.push(E);}for(var A=0;A0)?M:N;F.fireEvent("on"+J,I); -}else{throw new Error("simulateKeyEvent(): No event simulation framework present.");}}},simulateMouseEvent:function(K,P,H,E,Q,J,G,F,D,B,C,A,O,M,I,L){K=YAHOO.util.Dom.get(K);if(!K){throw new Error("simulateMouseEvent(): Invalid target.");}if(YAHOO.lang.isString(P)){P=P.toLowerCase();switch(P){case"mouseover":case"mouseout":case"mousedown":case"mouseup":case"click":case"dblclick":case"mousemove":break;default:throw new Error("simulateMouseEvent(): Event type '"+P+"' not supported.");}}else{throw new Error("simulateMouseEvent(): Event type must be a string.");}if(!YAHOO.lang.isBoolean(H)){H=true;}if(!YAHOO.lang.isBoolean(E)){E=(P!="mousemove");}if(!YAHOO.lang.isObject(Q)){Q=window;}if(!YAHOO.lang.isNumber(J)){J=1;}if(!YAHOO.lang.isNumber(G)){G=0;}if(!YAHOO.lang.isNumber(F)){F=0;}if(!YAHOO.lang.isNumber(D)){D=0;}if(!YAHOO.lang.isNumber(B)){B=0;}if(!YAHOO.lang.isBoolean(C)){C=false;}if(!YAHOO.lang.isBoolean(A)){A=false;}if(!YAHOO.lang.isBoolean(O)){O=false;}if(!YAHOO.lang.isBoolean(M)){M=false;}if(!YAHOO.lang.isNumber(I)){I=0;}var N=null;if(YAHOO.lang.isFunction(document.createEvent)){N=document.createEvent("MouseEvents");if(N.initMouseEvent){N.initMouseEvent(P,H,E,Q,J,G,F,D,B,C,A,O,M,I,L);}else{N=document.createEvent("UIEvents");N.initEvent(P,H,E);N.view=Q;N.detail=J;N.screenX=G;N.screenY=F;N.clientX=D;N.clientY=B;N.ctrlKey=C;N.altKey=A;N.metaKey=M;N.shiftKey=O;N.button=I;N.relatedTarget=L;}if(L&&!N.relatedTarget){if(P=="mouseout"){N.toElement=L;}else{if(P=="mouseover"){N.fromElement=L;}}}K.dispatchEvent(N);}else{if(YAHOO.lang.isObject(document.createEventObject)){N=document.createEventObject();N.bubbles=H;N.cancelable=E;N.view=Q;N.detail=J;N.screenX=G;N.screenY=F;N.clientX=D;N.clientY=B;N.ctrlKey=C;N.altKey=A;N.metaKey=M;N.shiftKey=O;switch(I){case 0:N.button=1;break;case 1:N.button=4;break;case 2:break;default:N.button=0;}N.relatedTarget=L;K.fireEvent("on"+P,N);}else{throw new Error("simulateMouseEvent(): No event simulation framework present.");}}},fireMouseEvent:function(C,B,A){A=A||{};this.simulateMouseEvent(C,B,A.bubbles,A.cancelable,A.view,A.detail,A.screenX,A.screenY,A.clientX,A.clientY,A.ctrlKey,A.altKey,A.shiftKey,A.metaKey,A.button,A.relatedTarget);},click:function(B,A){this.fireMouseEvent(B,"click",A);},dblclick:function(B,A){this.fireMouseEvent(B,"dblclick",A);},mousedown:function(B,A){this.fireMouseEvent(B,"mousedown",A);},mousemove:function(B,A){this.fireMouseEvent(B,"mousemove",A);},mouseout:function(B,A){this.fireMouseEvent(B,"mouseout",A);},mouseover:function(B,A){this.fireMouseEvent(B,"mouseover",A);},mouseup:function(B,A){this.fireMouseEvent(B,"mouseup",A);},fireKeyEvent:function(B,C,A){A=A||{};this.simulateKeyEvent(C,B,A.bubbles,A.cancelable,A.view,A.ctrlKey,A.altKey,A.shiftKey,A.metaKey,A.keyCode,A.charCode);},keydown:function(B,A){this.fireKeyEvent("keydown",B,A);},keypress:function(B,A){this.fireKeyEvent("keypress",B,A);},keyup:function(B,A){this.fireKeyEvent("keyup",B,A);}};YAHOO.namespace("tool");YAHOO.tool.TestManager={TEST_PAGE_BEGIN_EVENT:"testpagebegin",TEST_PAGE_COMPLETE_EVENT:"testpagecomplete",TEST_MANAGER_BEGIN_EVENT:"testmanagerbegin",TEST_MANAGER_COMPLETE_EVENT:"testmanagercomplete",_curPage:null,_frame:null,_logger:null,_timeoutId:0,_pages:[],_results:null,_handleTestRunnerComplete:function(A){this.fireEvent(this.TEST_PAGE_COMPLETE_EVENT,{page:this._curPage,results:A.results});this._processResults(this._curPage,A.results);this._logger.clearTestRunner();if(this._pages.length){this._timeoutId=setTimeout(function(){YAHOO.tool.TestManager._run();},1000);}else{this.fireEvent(this.TEST_MANAGER_COMPLETE_EVENT,this._results);}},_processResults:function(C,A){var B=this._results;B.passed+=A.passed;B.failed+=A.failed;B.ignored+=A.ignored;B.total+=A.total;B.duration+=A.duration;if(A.failed){B.failedPages.push(C);}else{B.passedPages.push(C);}A.name=C;A.type="page";B[C]=A;},_run:function(){this._curPage=this._pages.shift();this.fireEvent(this.TEST_PAGE_BEGIN_EVENT,this._curPage);this._frame.location.replace(this._curPage);},load:function(){if(parent.YAHOO.tool.TestManager!==this){parent.YAHOO.tool.TestManager.load();}else{if(this._frame){var A=this._frame.YAHOO.tool.TestRunner;this._logger.setTestRunner(A);A.subscribe(A.COMPLETE_EVENT,this._handleTestRunnerComplete,this,true);A.run();}}},setPages:function(A){this._pages=A;},start:function(){if(!this._initialized){this.createEvent(this.TEST_PAGE_BEGIN_EVENT);this.createEvent(this.TEST_PAGE_COMPLETE_EVENT);this.createEvent(this.TEST_MANAGER_BEGIN_EVENT);this.createEvent(this.TEST_MANAGER_COMPLETE_EVENT);if(!this._frame){var A=document.createElement("iframe");A.style.visibility="hidden";A.style.position="absolute";document.body.appendChild(A);this._frame=A.contentWindow||A.contentDocument.parentWindow;}if(!this._logger){this._logger=new YAHOO.tool.TestLogger();}this._initialized=true;}this._results={passed:0,failed:0,ignored:0,total:0,type:"report",name:"YUI Test Results",duration:0,failedPages:[],passedPages:[]};this.fireEvent(this.TEST_MANAGER_BEGIN_EVENT,null);this._run();},stop:function(){clearTimeout(this._timeoutId);}};YAHOO.lang.augmentObject(YAHOO.tool.TestManager,YAHOO.util.EventProvider.prototype);YAHOO.namespace("tool");YAHOO.tool.TestLogger=function(B,A){YAHOO.tool.TestLogger.superclass.constructor.call(this,B,A);this.init();};YAHOO.lang.extend(YAHOO.tool.TestLogger,YAHOO.widget.LogReader,{footerEnabled:true,newestOnTop:false,formatMsg:function(B){var A=B.category;var C=this.html2Text(B.msg);return"

    "+A.toUpperCase()+" "+C+"

    ";},init:function(){if(YAHOO.tool.TestRunner){this.setTestRunner(YAHOO.tool.TestRunner);}this.hideSource("global");this.hideSource("LogReader");this.hideCategory("warn");this.hideCategory("window");this.hideCategory("time");this.clearConsole();},clearTestRunner:function(){if(this._runner){this._runner.unsubscribeAll();this._runner=null;}},setTestRunner:function(A){if(this._runner){this.clearTestRunner();}this._runner=A;A.subscribe(A.TEST_PASS_EVENT,this._handleTestRunnerEvent,this,true); -A.subscribe(A.TEST_FAIL_EVENT,this._handleTestRunnerEvent,this,true);A.subscribe(A.TEST_IGNORE_EVENT,this._handleTestRunnerEvent,this,true);A.subscribe(A.BEGIN_EVENT,this._handleTestRunnerEvent,this,true);A.subscribe(A.COMPLETE_EVENT,this._handleTestRunnerEvent,this,true);A.subscribe(A.TEST_SUITE_BEGIN_EVENT,this._handleTestRunnerEvent,this,true);A.subscribe(A.TEST_SUITE_COMPLETE_EVENT,this._handleTestRunnerEvent,this,true);A.subscribe(A.TEST_CASE_BEGIN_EVENT,this._handleTestRunnerEvent,this,true);A.subscribe(A.TEST_CASE_COMPLETE_EVENT,this._handleTestRunnerEvent,this,true);},_handleTestRunnerEvent:function(D){var A=YAHOO.tool.TestRunner;var C="";var B="";switch(D.type){case A.BEGIN_EVENT:C="Testing began at "+(new Date()).toString()+".";B="info";break;case A.COMPLETE_EVENT:C="Testing completed at "+(new Date()).toString()+".\nPassed:"+D.results.passed+" Failed:"+D.results.failed+" Total:"+D.results.total;B="info";break;case A.TEST_FAIL_EVENT:C=D.testName+": "+D.error.getMessage();B="fail";break;case A.TEST_IGNORE_EVENT:C=D.testName+": ignored.";B="ignore";break;case A.TEST_PASS_EVENT:C=D.testName+": passed.";B="pass";break;case A.TEST_SUITE_BEGIN_EVENT:C="Test suite \""+D.testSuite.name+"\" started.";B="info";break;case A.TEST_SUITE_COMPLETE_EVENT:C="Test suite \""+D.testSuite.name+"\" completed.\nPassed:"+D.results.passed+" Failed:"+D.results.failed+" Total:"+D.results.total;B="info";break;case A.TEST_CASE_BEGIN_EVENT:C="Test case \""+D.testCase.name+"\" started.";B="info";break;case A.TEST_CASE_COMPLETE_EVENT:C="Test case \""+D.testCase.name+"\" completed.\nPassed:"+D.results.passed+" Failed:"+D.results.failed+" Total:"+D.results.total;B="info";break;default:C="Unexpected event "+D.type;C="info";}YAHOO.log(C,B,"TestRunner");}});YAHOO.namespace("tool.TestFormat");YAHOO.tool.TestFormat.JSON=function(A){return YAHOO.lang.JSON.stringify(A);};YAHOO.tool.TestFormat.XML=function(C){var A=YAHOO.lang;var B="<"+C.type+" name=\""+C.name.replace(/"/g,""").replace(/'/g,"'")+"\"";if(A.isNumber(C.duration)){B+=" duration=\""+C.duration+"\"";}if(C.type=="test"){B+=" result=\""+C.result+"\" message=\""+C.message+"\">";}else{B+=" passed=\""+C.passed+"\" failed=\""+C.failed+"\" ignored=\""+C.ignored+"\" total=\""+C.total+"\">";for(var D in C){if(A.hasOwnProperty(C,D)&&A.isObject(C[D])&&!A.isArray(C[D])){B+=arguments.callee(C[D]);}}}B+="";return B;};YAHOO.namespace("tool");YAHOO.tool.TestReporter=function(A,B){this.url=A;this.format=B||YAHOO.tool.TestFormat.XML;this._fields=new Object();this._form=null;this._iframe=null;};YAHOO.tool.TestReporter.prototype={constructor:YAHOO.tool.TestReporter,_convertToISOString:function(A){function B(C){return C<10?"0"+C:C;}return A.getUTCFullYear()+"-"+B(A.getUTCMonth()+1)+"-"+B(A.getUTCDate())+"T"+B(A.getUTCHours())+":"+B(A.getUTCMinutes())+":"+B(A.getUTCSeconds())+"Z";},addField:function(A,B){this._fields[A]=B;},clearFields:function(){this._fields=new Object();},destroy:function(){if(this._form){this._form.parentNode.removeChild(this._form);this._form=null;}if(this._iframe){this._iframe.parentNode.removeChild(this._iframe);this._iframe=null;}this._fields=null;},report:function(A){if(!this._form){this._form=document.createElement("form");this._form.method="post";this._form.style.visibility="hidden";this._form.style.position="absolute";this._form.style.top=0;document.body.appendChild(this._form);if(YAHOO.env.ua.ie){this._iframe=document.createElement("