extjs-rails 4.1.0.alpha5 → 4.1.0.alpha6
Sign up to get free protection for your applications and to get access to all the features.
- data/app/assets/javascripts/extjs-rails.js +95613 -11000
- data/lib/extjs-rails/version.rb +1 -1
- metadata +2 -509
- data/app/assets/javascripts/src/AbstractComponent.js +0 -3290
- data/app/assets/javascripts/src/AbstractManager.js +0 -144
- data/app/assets/javascripts/src/AbstractPlugin.js +0 -72
- data/app/assets/javascripts/src/Action.js +0 -276
- data/app/assets/javascripts/src/Ajax.js +0 -99
- data/app/assets/javascripts/src/Component.js +0 -1344
- data/app/assets/javascripts/src/ComponentLoader.js +0 -202
- data/app/assets/javascripts/src/ComponentManager.js +0 -47
- data/app/assets/javascripts/src/ComponentQuery.js +0 -521
- data/app/assets/javascripts/src/Editor.js +0 -494
- data/app/assets/javascripts/src/ElementLoader.js +0 -404
- data/app/assets/javascripts/src/FocusManager.js +0 -712
- data/app/assets/javascripts/src/Img.js +0 -111
- data/app/assets/javascripts/src/Layer.js +0 -543
- data/app/assets/javascripts/src/LoadMask.js +0 -432
- data/app/assets/javascripts/src/ModelManager.js +0 -186
- data/app/assets/javascripts/src/PluginManager.js +0 -110
- data/app/assets/javascripts/src/ProgressBar.js +0 -336
- data/app/assets/javascripts/src/Shadow.js +0 -233
- data/app/assets/javascripts/src/ShadowPool.js +0 -43
- data/app/assets/javascripts/src/Template.js +0 -331
- data/app/assets/javascripts/src/XTemplate.js +0 -365
- data/app/assets/javascripts/src/XTemplateCompiler.js +0 -450
- data/app/assets/javascripts/src/XTemplateParser.js +0 -249
- data/app/assets/javascripts/src/ZIndexManager.js +0 -519
- data/app/assets/javascripts/src/app/Application.js +0 -271
- data/app/assets/javascripts/src/app/Controller.js +0 -458
- data/app/assets/javascripts/src/app/EventBus.js +0 -112
- data/app/assets/javascripts/src/button/Button.js +0 -1483
- data/app/assets/javascripts/src/button/Cycle.js +0 -215
- data/app/assets/javascripts/src/button/Split.js +0 -99
- data/app/assets/javascripts/src/chart/Callout.js +0 -140
- data/app/assets/javascripts/src/chart/Chart.js +0 -966
- data/app/assets/javascripts/src/chart/Highlight.js +0 -172
- data/app/assets/javascripts/src/chart/Label.js +0 -241
- data/app/assets/javascripts/src/chart/Legend.js +0 -474
- data/app/assets/javascripts/src/chart/LegendItem.js +0 -217
- data/app/assets/javascripts/src/chart/Mask.js +0 -230
- data/app/assets/javascripts/src/chart/MaskLayer.js +0 -48
- data/app/assets/javascripts/src/chart/Navigation.js +0 -79
- data/app/assets/javascripts/src/chart/Shape.js +0 -106
- data/app/assets/javascripts/src/chart/Tip.js +0 -98
- data/app/assets/javascripts/src/chart/TipSurface.js +0 -42
- data/app/assets/javascripts/src/chart/axis/Abstract.js +0 -73
- data/app/assets/javascripts/src/chart/axis/Axis.js +0 -961
- data/app/assets/javascripts/src/chart/axis/Category.js +0 -130
- data/app/assets/javascripts/src/chart/axis/Gauge.js +0 -203
- data/app/assets/javascripts/src/chart/axis/Numeric.js +0 -235
- data/app/assets/javascripts/src/chart/axis/Radial.js +0 -204
- data/app/assets/javascripts/src/chart/axis/Time.js +0 -135
- data/app/assets/javascripts/src/chart/series/Area.js +0 -803
- data/app/assets/javascripts/src/chart/series/Bar.js +0 -853
- data/app/assets/javascripts/src/chart/series/Cartesian.js +0 -328
- data/app/assets/javascripts/src/chart/series/Column.js +0 -104
- data/app/assets/javascripts/src/chart/series/Gauge.js +0 -490
- data/app/assets/javascripts/src/chart/series/Line.js +0 -1104
- data/app/assets/javascripts/src/chart/series/Pie.js +0 -1072
- data/app/assets/javascripts/src/chart/series/Radar.js +0 -440
- data/app/assets/javascripts/src/chart/series/Scatter.js +0 -668
- data/app/assets/javascripts/src/chart/series/Series.js +0 -443
- data/app/assets/javascripts/src/chart/theme/Base.js +0 -175
- data/app/assets/javascripts/src/chart/theme/Theme.js +0 -253
- data/app/assets/javascripts/src/container/AbstractContainer.js +0 -1062
- data/app/assets/javascripts/src/container/ButtonGroup.js +0 -143
- data/app/assets/javascripts/src/container/Container.js +0 -212
- data/app/assets/javascripts/src/container/DockingContainer.js +0 -265
- data/app/assets/javascripts/src/container/Viewport.js +0 -184
- data/app/assets/javascripts/src/core/dom/Element.form.js +0 -50
- data/app/assets/javascripts/src/core/dom/Element.static-more.js +0 -159
- data/app/assets/javascripts/src/core/examples/index.html +0 -321
- data/app/assets/javascripts/src/core/examples/index.js +0 -6
- data/app/assets/javascripts/src/core/examples/src/Sample/CTO.js +0 -25
- data/app/assets/javascripts/src/core/examples/src/Sample/CoolGuy.js +0 -20
- data/app/assets/javascripts/src/core/examples/src/Sample/Developer.js +0 -43
- data/app/assets/javascripts/src/core/examples/src/Sample/Gun.js +0 -3
- data/app/assets/javascripts/src/core/examples/src/Sample/HumanResource.js +0 -23
- data/app/assets/javascripts/src/core/examples/src/Sample/Musician.js +0 -20
- data/app/assets/javascripts/src/core/examples/src/Sample/Person.js +0 -50
- data/app/assets/javascripts/src/core/examples/src/Sample/ability/CanComposeSongs.js +0 -9
- data/app/assets/javascripts/src/core/examples/src/Sample/ability/CanPlayGuitar.js +0 -9
- data/app/assets/javascripts/src/core/examples/src/Sample/ability/CanSing.js +0 -18
- data/app/assets/javascripts/src/core/examples/src/Sample/deadlock/A.js +0 -3
- data/app/assets/javascripts/src/core/examples/src/Sample/deadlock/B.js +0 -3
- data/app/assets/javascripts/src/core/examples/src/Sample/deadlock/C.js +0 -3
- data/app/assets/javascripts/src/core/examples/src/Sample/deadlock/D.js +0 -3
- data/app/assets/javascripts/src/core/examples/src/Sample/deadlock/E.js +0 -3
- data/app/assets/javascripts/src/core/examples/src/Sample/notdeadlock/A.js +0 -3
- data/app/assets/javascripts/src/core/examples/src/Sample/notdeadlock/B.js +0 -4
- data/app/assets/javascripts/src/core/examples/src/Sample/notdeadlock/C.js +0 -3
- data/app/assets/javascripts/src/core/src/EventManager.js +0 -1167
- data/app/assets/javascripts/src/core/src/EventObject.js +0 -883
- data/app/assets/javascripts/src/core/src/Ext-more.js +0 -1283
- data/app/assets/javascripts/src/core/src/Ext.js +0 -736
- data/app/assets/javascripts/src/core/src/Support.js +0 -662
- data/app/assets/javascripts/src/core/src/class/Base.js +0 -1085
- data/app/assets/javascripts/src/core/src/class/Class.js +0 -676
- data/app/assets/javascripts/src/core/src/class/ClassManager.js +0 -1591
- data/app/assets/javascripts/src/core/src/class/Loader.js +0 -1423
- data/app/assets/javascripts/src/core/src/dom/AbstractElement.alignment.js +0 -173
- data/app/assets/javascripts/src/core/src/dom/AbstractElement.insertion.js +0 -193
- data/app/assets/javascripts/src/core/src/dom/AbstractElement.js +0 -681
- data/app/assets/javascripts/src/core/src/dom/AbstractElement.position.js +0 -356
- data/app/assets/javascripts/src/core/src/dom/AbstractElement.static.js +0 -474
- data/app/assets/javascripts/src/core/src/dom/AbstractElement.style.js +0 -851
- data/app/assets/javascripts/src/core/src/dom/AbstractElement.traversal.js +0 -180
- data/app/assets/javascripts/src/core/src/dom/AbstractHelper.js +0 -291
- data/app/assets/javascripts/src/core/src/dom/AbstractQuery.js +0 -72
- data/app/assets/javascripts/src/core/src/dom/CompositeElement.js +0 -75
- data/app/assets/javascripts/src/core/src/dom/CompositeElementLite.js +0 -436
- data/app/assets/javascripts/src/core/src/dom/DomQuery-aria.js +0 -1049
- data/app/assets/javascripts/src/core/src/env/Browser.js +0 -186
- data/app/assets/javascripts/src/core/src/env/FeatureDetector.js +0 -274
- data/app/assets/javascripts/src/core/src/env/OS.js +0 -141
- data/app/assets/javascripts/src/core/src/lang/Array.js +0 -1205
- data/app/assets/javascripts/src/core/src/lang/Date.js +0 -1463
- data/app/assets/javascripts/src/core/src/lang/Error.js +0 -326
- data/app/assets/javascripts/src/core/src/lang/Function.js +0 -485
- data/app/assets/javascripts/src/core/src/lang/Number.js +0 -175
- data/app/assets/javascripts/src/core/src/lang/Object.js +0 -606
- data/app/assets/javascripts/src/core/src/lang/String.js +0 -333
- data/app/assets/javascripts/src/core/src/misc/JSON.js +0 -236
- data/app/assets/javascripts/src/core/src/perf/Accumulator.js +0 -244
- data/app/assets/javascripts/src/core/src/perf/Monitor.js +0 -197
- data/app/assets/javascripts/src/core/src/util/DelayedTask.js +0 -71
- data/app/assets/javascripts/src/core/src/util/Event.js +0 -215
- data/app/assets/javascripts/src/core/src/util/Format.js +0 -551
- data/app/assets/javascripts/src/core/src/util/TaskManager.js +0 -417
- data/app/assets/javascripts/src/core/src/version/Version.js +0 -364
- data/app/assets/javascripts/src/core/test/unit/README.MD +0 -91
- data/app/assets/javascripts/src/core/test/unit/bootstrap.js +0 -39
- data/app/assets/javascripts/src/core/test/unit/build/build-data.js +0 -34
- data/app/assets/javascripts/src/core/test/unit/build/build.sh +0 -2
- data/app/assets/javascripts/src/core/test/unit/data.js +0 -27
- data/app/assets/javascripts/src/core/test/unit/index.html +0 -15
- data/app/assets/javascripts/src/core/test/unit/other_specs/dom.html +0 -40
- data/app/assets/javascripts/src/core/test/unit/other_specs/dom/extjs-api.js +0 -12
- data/app/assets/javascripts/src/core/test/unit/other_specs/dom/platform-api.js +0 -134
- data/app/assets/javascripts/src/core/test/unit/other_specs/dom/sanity.js +0 -4
- data/app/assets/javascripts/src/core/test/unit/other_specs/dom/touch-api-out.js +0 -128
- data/app/assets/javascripts/src/core/test/unit/other_specs/dom/touch-api.js +0 -89
- data/app/assets/javascripts/src/core/test/unit/other_specs/env/Environment.js +0 -357
- data/app/assets/javascripts/src/core/test/unit/resources/APITest.js +0 -37
- data/app/assets/javascripts/src/core/test/unit/resources/jsb3.js +0 -14
- data/app/assets/javascripts/src/core/test/unit/resources/test-setup.js +0 -137
- data/app/assets/javascripts/src/core/test/unit/spec/EventManager.js +0 -629
- data/app/assets/javascripts/src/core/test/unit/spec/Ext-mess.backup +0 -198
- data/app/assets/javascripts/src/core/test/unit/spec/Ext-more.js +0 -520
- data/app/assets/javascripts/src/core/test/unit/spec/Ext.js +0 -1550
- data/app/assets/javascripts/src/core/test/unit/spec/Support.js +0 -250
- data/app/assets/javascripts/src/core/test/unit/spec/class/Base.js +0 -47
- data/app/assets/javascripts/src/core/test/unit/spec/class/Class.js +0 -561
- data/app/assets/javascripts/src/core/test/unit/spec/class/ClassManager.js +0 -555
- data/app/assets/javascripts/src/core/test/unit/spec/dom/CompositeElementLite.js +0 -409
- data/app/assets/javascripts/src/core/test/unit/spec/dom/DomHelper.js +0 -444
- data/app/assets/javascripts/src/core/test/unit/spec/dom/Element.insertion.js +0 -342
- data/app/assets/javascripts/src/core/test/unit/spec/dom/Element.js +0 -731
- data/app/assets/javascripts/src/core/test/unit/spec/dom/Element.static.js +0 -201
- data/app/assets/javascripts/src/core/test/unit/spec/dom/Element.style.js +0 -118
- data/app/assets/javascripts/src/core/test/unit/spec/dom/Element.traversal.js +0 -336
- data/app/assets/javascripts/src/core/test/unit/spec/lang/Array.js +0 -1229
- data/app/assets/javascripts/src/core/test/unit/spec/lang/Date.js +0 -697
- data/app/assets/javascripts/src/core/test/unit/spec/lang/Error.js +0 -277
- data/app/assets/javascripts/src/core/test/unit/spec/lang/Function.js +0 -536
- data/app/assets/javascripts/src/core/test/unit/spec/lang/Number.js +0 -323
- data/app/assets/javascripts/src/core/test/unit/spec/lang/Object.js +0 -591
- data/app/assets/javascripts/src/core/test/unit/spec/lang/String.js +0 -451
- data/app/assets/javascripts/src/core/test/unit/spec/misc/JSON.js +0 -252
- data/app/assets/javascripts/src/core/test/unit/spec/util/Format.js +0 -521
- data/app/assets/javascripts/src/core/test/unit/spec/version/Version.js +0 -148
- data/app/assets/javascripts/src/core/test/unit/specs.html +0 -19
- data/app/assets/javascripts/src/data/AbstractStore.js +0 -887
- data/app/assets/javascripts/src/data/ArrayStore.js +0 -74
- data/app/assets/javascripts/src/data/Batch.js +0 -236
- data/app/assets/javascripts/src/data/BufferStore.js +0 -13
- data/app/assets/javascripts/src/data/Connection.js +0 -969
- data/app/assets/javascripts/src/data/DirectStore.js +0 -50
- data/app/assets/javascripts/src/data/Errors.js +0 -52
- data/app/assets/javascripts/src/data/Field.js +0 -341
- data/app/assets/javascripts/src/data/IdGenerator.js +0 -198
- data/app/assets/javascripts/src/data/JsonP.js +0 -253
- data/app/assets/javascripts/src/data/JsonPStore.js +0 -51
- data/app/assets/javascripts/src/data/JsonStore.js +0 -60
- data/app/assets/javascripts/src/data/Model.js +0 -1673
- data/app/assets/javascripts/src/data/NodeInterface.js +0 -1294
- data/app/assets/javascripts/src/data/NodeStore.js +0 -254
- data/app/assets/javascripts/src/data/Operation.js +0 -331
- data/app/assets/javascripts/src/data/Request.js +0 -40
- data/app/assets/javascripts/src/data/ResultSet.js +0 -56
- data/app/assets/javascripts/src/data/SequentialIdGenerator.js +0 -61
- data/app/assets/javascripts/src/data/SortTypes.js +0 -125
- data/app/assets/javascripts/src/data/Store.js +0 -2609
- data/app/assets/javascripts/src/data/StoreManager.js +0 -156
- data/app/assets/javascripts/src/data/Tree.js +0 -290
- data/app/assets/javascripts/src/data/TreeStore.js +0 -655
- data/app/assets/javascripts/src/data/Types.js +0 -190
- data/app/assets/javascripts/src/data/UuidGenerator.js +0 -215
- data/app/assets/javascripts/src/data/XmlStore.js +0 -76
- data/app/assets/javascripts/src/data/association/Association.js +0 -243
- data/app/assets/javascripts/src/data/association/BelongsTo.js +0 -291
- data/app/assets/javascripts/src/data/association/HasMany.js +0 -289
- data/app/assets/javascripts/src/data/association/HasOne.js +0 -304
- data/app/assets/javascripts/src/data/proxy/Ajax.js +0 -282
- data/app/assets/javascripts/src/data/proxy/Client.js +0 -21
- data/app/assets/javascripts/src/data/proxy/Direct.js +0 -181
- data/app/assets/javascripts/src/data/proxy/JsonP.js +0 -313
- data/app/assets/javascripts/src/data/proxy/LocalStorage.js +0 -69
- data/app/assets/javascripts/src/data/proxy/Memory.js +0 -156
- data/app/assets/javascripts/src/data/proxy/Proxy.js +0 -433
- data/app/assets/javascripts/src/data/proxy/Rest.js +0 -173
- data/app/assets/javascripts/src/data/proxy/Server.js +0 -460
- data/app/assets/javascripts/src/data/proxy/SessionStorage.js +0 -39
- data/app/assets/javascripts/src/data/proxy/WebStorage.js +0 -546
- data/app/assets/javascripts/src/data/reader/Array.js +0 -68
- data/app/assets/javascripts/src/data/reader/Json.js +0 -383
- data/app/assets/javascripts/src/data/reader/Reader.js +0 -735
- data/app/assets/javascripts/src/data/reader/Xml.js +0 -292
- data/app/assets/javascripts/src/data/validations.js +0 -149
- data/app/assets/javascripts/src/data/writer/Json.js +0 -81
- data/app/assets/javascripts/src/data/writer/Writer.js +0 -147
- data/app/assets/javascripts/src/data/writer/Xml.js +0 -88
- data/app/assets/javascripts/src/dd/DD.js +0 -300
- data/app/assets/javascripts/src/dd/DDProxy.js +0 -204
- data/app/assets/javascripts/src/dd/DDTarget.js +0 -171
- data/app/assets/javascripts/src/dd/DragDrop.js +0 -1101
- data/app/assets/javascripts/src/dd/DragDropManager.js +0 -1264
- data/app/assets/javascripts/src/dd/DragSource.js +0 -392
- data/app/assets/javascripts/src/dd/DragTracker.js +0 -562
- data/app/assets/javascripts/src/dd/DragZone.js +0 -137
- data/app/assets/javascripts/src/dd/DropTarget.js +0 -118
- data/app/assets/javascripts/src/dd/DropZone.js +0 -254
- data/app/assets/javascripts/src/dd/Registry.js +0 -117
- data/app/assets/javascripts/src/dd/ScrollManager.js +0 -218
- data/app/assets/javascripts/src/dd/StatusProxy.js +0 -179
- data/app/assets/javascripts/src/diag/layout/Context.js +0 -523
- data/app/assets/javascripts/src/diag/layout/ContextItem.js +0 -179
- data/app/assets/javascripts/src/direct/Event.js +0 -35
- data/app/assets/javascripts/src/direct/ExceptionEvent.js +0 -16
- data/app/assets/javascripts/src/direct/JsonProvider.js +0 -82
- data/app/assets/javascripts/src/direct/Manager.js +0 -263
- data/app/assets/javascripts/src/direct/PollingProvider.js +0 -156
- data/app/assets/javascripts/src/direct/Provider.js +0 -96
- data/app/assets/javascripts/src/direct/RemotingEvent.js +0 -24
- data/app/assets/javascripts/src/direct/RemotingMethod.js +0 -100
- data/app/assets/javascripts/src/direct/RemotingProvider.js +0 -510
- data/app/assets/javascripts/src/direct/Transaction.js +0 -41
- data/app/assets/javascripts/src/dom/Element.alignment.js +0 -378
- data/app/assets/javascripts/src/dom/Element.anim.js +0 -962
- data/app/assets/javascripts/src/dom/Element.dd.js +0 -40
- data/app/assets/javascripts/src/dom/Element.fx.js +0 -194
- data/app/assets/javascripts/src/dom/Element.js +0 -1407
- data/app/assets/javascripts/src/dom/Element.position.js +0 -501
- data/app/assets/javascripts/src/dom/Element.scroll.js +0 -214
- data/app/assets/javascripts/src/dom/Element.style.js +0 -792
- data/app/assets/javascripts/src/dom/Element.traversal.js +0 -8
- data/app/assets/javascripts/src/dom/Helper.js +0 -466
- data/app/assets/javascripts/src/dom/Query.js +0 -1067
- data/app/assets/javascripts/src/draw/Color.js +0 -303
- data/app/assets/javascripts/src/draw/Component.js +0 -245
- data/app/assets/javascripts/src/draw/CompositeSprite.js +0 -299
- data/app/assets/javascripts/src/draw/Draw.js +0 -1217
- data/app/assets/javascripts/src/draw/Matrix.js +0 -183
- data/app/assets/javascripts/src/draw/Sprite.js +0 -554
- data/app/assets/javascripts/src/draw/SpriteDD.js +0 -87
- data/app/assets/javascripts/src/draw/Surface.js +0 -1001
- data/app/assets/javascripts/src/draw/Text.js +0 -175
- data/app/assets/javascripts/src/draw/engine/ImageExporter.js +0 -106
- data/app/assets/javascripts/src/draw/engine/Svg.js +0 -734
- data/app/assets/javascripts/src/draw/engine/SvgExporter.js +0 -280
- data/app/assets/javascripts/src/draw/engine/Vml.js +0 -916
- data/app/assets/javascripts/src/flash/Component.js +0 -248
- data/app/assets/javascripts/src/form/Basic.js +0 -1018
- data/app/assets/javascripts/src/form/CheckboxGroup.js +0 -441
- data/app/assets/javascripts/src/form/CheckboxManager.js +0 -26
- data/app/assets/javascripts/src/form/FieldAncestor.js +0 -210
- data/app/assets/javascripts/src/form/FieldContainer.js +0 -290
- data/app/assets/javascripts/src/form/FieldSet.js +0 -506
- data/app/assets/javascripts/src/form/Label.js +0 -110
- data/app/assets/javascripts/src/form/Labelable.js +0 -764
- data/app/assets/javascripts/src/form/Panel.js +0 -335
- data/app/assets/javascripts/src/form/RadioGroup.js +0 -124
- data/app/assets/javascripts/src/form/RadioManager.js +0 -26
- data/app/assets/javascripts/src/form/action/Action.js +0 -307
- data/app/assets/javascripts/src/form/action/DirectLoad.js +0 -107
- data/app/assets/javascripts/src/form/action/DirectSubmit.js +0 -119
- data/app/assets/javascripts/src/form/action/Load.js +0 -120
- data/app/assets/javascripts/src/form/action/StandardSubmit.js +0 -34
- data/app/assets/javascripts/src/form/action/Submit.js +0 -257
- data/app/assets/javascripts/src/form/field/Base.js +0 -813
- data/app/assets/javascripts/src/form/field/Checkbox.js +0 -505
- data/app/assets/javascripts/src/form/field/ComboBox.js +0 -1427
- data/app/assets/javascripts/src/form/field/Date.js +0 -578
- data/app/assets/javascripts/src/form/field/Display.js +0 -155
- data/app/assets/javascripts/src/form/field/Field.js +0 -430
- data/app/assets/javascripts/src/form/field/File.js +0 -265
- data/app/assets/javascripts/src/form/field/Hidden.js +0 -75
- data/app/assets/javascripts/src/form/field/HtmlEditor.js +0 -1439
- data/app/assets/javascripts/src/form/field/Number.js +0 -380
- data/app/assets/javascripts/src/form/field/Picker.js +0 -321
- data/app/assets/javascripts/src/form/field/Radio.js +0 -279
- data/app/assets/javascripts/src/form/field/Spinner.js +0 -321
- data/app/assets/javascripts/src/form/field/Text.js +0 -727
- data/app/assets/javascripts/src/form/field/TextArea.js +0 -228
- data/app/assets/javascripts/src/form/field/Time.js +0 -459
- data/app/assets/javascripts/src/form/field/Trigger.js +0 -469
- data/app/assets/javascripts/src/form/field/VTypes.js +0 -172
- data/app/assets/javascripts/src/fx/Anim.js +0 -472
- data/app/assets/javascripts/src/fx/Animator.js +0 -410
- data/app/assets/javascripts/src/fx/CubicBezier.js +0 -77
- data/app/assets/javascripts/src/fx/Easing.js +0 -136
- data/app/assets/javascripts/src/fx/Manager.js +0 -353
- data/app/assets/javascripts/src/fx/PropertyHandler.js +0 -381
- data/app/assets/javascripts/src/fx/Queue.js +0 -123
- data/app/assets/javascripts/src/fx/target/Component.js +0 -118
- data/app/assets/javascripts/src/fx/target/CompositeElement.js +0 -46
- data/app/assets/javascripts/src/fx/target/CompositeElementCSS.js +0 -22
- data/app/assets/javascripts/src/fx/target/CompositeSprite.js +0 -34
- data/app/assets/javascripts/src/fx/target/Element.js +0 -83
- data/app/assets/javascripts/src/fx/target/ElementCSS.js +0 -77
- data/app/assets/javascripts/src/fx/target/Sprite.js +0 -128
- data/app/assets/javascripts/src/fx/target/Target.js +0 -36
- data/app/assets/javascripts/src/grid/CellEditor.js +0 -172
- data/app/assets/javascripts/src/grid/ColumnComponentLayout.js +0 -34
- data/app/assets/javascripts/src/grid/ColumnLayout.js +0 -201
- data/app/assets/javascripts/src/grid/Lockable.js +0 -863
- data/app/assets/javascripts/src/grid/LockingView.js +0 -169
- data/app/assets/javascripts/src/grid/PagingScroller.js +0 -539
- data/app/assets/javascripts/src/grid/Panel.js +0 -393
- data/app/assets/javascripts/src/grid/RowEditor.js +0 -731
- data/app/assets/javascripts/src/grid/RowNumberer.js +0 -76
- data/app/assets/javascripts/src/grid/Scroller.js +0 -5
- data/app/assets/javascripts/src/grid/View.js +0 -44
- data/app/assets/javascripts/src/grid/ViewDropZone.js +0 -41
- data/app/assets/javascripts/src/grid/column/Action.js +0 -318
- data/app/assets/javascripts/src/grid/column/Boolean.js +0 -82
- data/app/assets/javascripts/src/grid/column/Column.js +0 -835
- data/app/assets/javascripts/src/grid/column/Date.js +0 -63
- data/app/assets/javascripts/src/grid/column/Number.js +0 -52
- data/app/assets/javascripts/src/grid/column/Template.js +0 -58
- data/app/assets/javascripts/src/grid/feature/AbstractSummary.js +0 -154
- data/app/assets/javascripts/src/grid/feature/Chunking.js +0 -77
- data/app/assets/javascripts/src/grid/feature/Feature.js +0 -158
- data/app/assets/javascripts/src/grid/feature/Grouping.js +0 -822
- data/app/assets/javascripts/src/grid/feature/GroupingSummary.js +0 -243
- data/app/assets/javascripts/src/grid/feature/RowBody.js +0 -116
- data/app/assets/javascripts/src/grid/feature/RowWrap.js +0 -120
- data/app/assets/javascripts/src/grid/feature/Summary.js +0 -167
- data/app/assets/javascripts/src/grid/header/Container.js +0 -965
- data/app/assets/javascripts/src/grid/header/DragZone.js +0 -69
- data/app/assets/javascripts/src/grid/header/DropZone.js +0 -265
- data/app/assets/javascripts/src/grid/plugin/CellEditing.js +0 -453
- data/app/assets/javascripts/src/grid/plugin/DragDrop.js +0 -254
- data/app/assets/javascripts/src/grid/plugin/Editing.js +0 -561
- data/app/assets/javascripts/src/grid/plugin/HeaderReorderer.js +0 -49
- data/app/assets/javascripts/src/grid/plugin/HeaderResizer.js +0 -292
- data/app/assets/javascripts/src/grid/plugin/RowEditing.js +0 -339
- data/app/assets/javascripts/src/grid/property/Grid.js +0 -351
- data/app/assets/javascripts/src/grid/property/HeaderContainer.js +0 -109
- data/app/assets/javascripts/src/grid/property/Property.js +0 -36
- data/app/assets/javascripts/src/grid/property/Store.js +0 -141
- data/app/assets/javascripts/src/layout/ClassList.js +0 -90
- data/app/assets/javascripts/src/layout/Context.js +0 -1232
- data/app/assets/javascripts/src/layout/ContextItem.js +0 -1470
- data/app/assets/javascripts/src/layout/Layout.js +0 -761
- data/app/assets/javascripts/src/layout/component/Auto.js +0 -220
- data/app/assets/javascripts/src/layout/component/Body.js +0 -80
- data/app/assets/javascripts/src/layout/component/BoundList.js +0 -95
- data/app/assets/javascripts/src/layout/component/Button.js +0 -261
- data/app/assets/javascripts/src/layout/component/Component.js +0 -427
- data/app/assets/javascripts/src/layout/component/Dock.js +0 -1132
- data/app/assets/javascripts/src/layout/component/Draw.js +0 -79
- data/app/assets/javascripts/src/layout/component/FieldSet.js +0 -62
- data/app/assets/javascripts/src/layout/component/ProgressBar.js +0 -54
- data/app/assets/javascripts/src/layout/component/Tab.js +0 -23
- data/app/assets/javascripts/src/layout/component/field/ComboBox.js +0 -52
- data/app/assets/javascripts/src/layout/component/field/Field.js +0 -372
- data/app/assets/javascripts/src/layout/component/field/FieldContainer.js +0 -48
- data/app/assets/javascripts/src/layout/component/field/HtmlEditor.js +0 -54
- data/app/assets/javascripts/src/layout/component/field/Slider.js +0 -58
- data/app/assets/javascripts/src/layout/component/field/Text.js +0 -75
- data/app/assets/javascripts/src/layout/component/field/TextArea.js +0 -51
- data/app/assets/javascripts/src/layout/component/field/Trigger.js +0 -132
- data/app/assets/javascripts/src/layout/container/Absolute.js +0 -121
- data/app/assets/javascripts/src/layout/container/Accordion.js +0 -308
- data/app/assets/javascripts/src/layout/container/Anchor.js +0 -403
- data/app/assets/javascripts/src/layout/container/Auto.js +0 -70
- data/app/assets/javascripts/src/layout/container/Border-old-js +0 -1079
- data/app/assets/javascripts/src/layout/container/Border.js +0 -816
- data/app/assets/javascripts/src/layout/container/Box.js +0 -929
- data/app/assets/javascripts/src/layout/container/Card.js +0 -361
- data/app/assets/javascripts/src/layout/container/CheckboxGroup.js +0 -376
- data/app/assets/javascripts/src/layout/container/Column.js +0 -234
- data/app/assets/javascripts/src/layout/container/Container.js +0 -961
- data/app/assets/javascripts/src/layout/container/Editor.js +0 -74
- data/app/assets/javascripts/src/layout/container/Fit.js +0 -287
- data/app/assets/javascripts/src/layout/container/Form.js +0 -157
- data/app/assets/javascripts/src/layout/container/HBox.js +0 -134
- data/app/assets/javascripts/src/layout/container/Table.js +0 -412
- data/app/assets/javascripts/src/layout/container/VBox.js +0 -139
- data/app/assets/javascripts/src/layout/container/boxOverflow/Menu.js +0 -365
- data/app/assets/javascripts/src/layout/container/boxOverflow/None.js +0 -83
- data/app/assets/javascripts/src/layout/container/boxOverflow/Scroller.js +0 -475
- data/app/assets/javascripts/src/menu/CheckItem.js +0 -169
- data/app/assets/javascripts/src/menu/ColorPicker.js +0 -110
- data/app/assets/javascripts/src/menu/DatePicker.js +0 -100
- data/app/assets/javascripts/src/menu/Item.js +0 -553
- data/app/assets/javascripts/src/menu/KeyNav.js +0 -134
- data/app/assets/javascripts/src/menu/Manager.js +0 -219
- data/app/assets/javascripts/src/menu/Menu.js +0 -579
- data/app/assets/javascripts/src/menu/Separator.js +0 -126
- data/app/assets/javascripts/src/panel/AbstractPanel.js +0 -323
- data/app/assets/javascripts/src/panel/DD.js +0 -99
- data/app/assets/javascripts/src/panel/Header.js +0 -518
- data/app/assets/javascripts/src/panel/Panel.js +0 -2150
- data/app/assets/javascripts/src/panel/Proxy.js +0 -131
- data/app/assets/javascripts/src/panel/Table.js +0 -1018
- data/app/assets/javascripts/src/panel/Tool.js +0 -304
- data/app/assets/javascripts/src/picker/Color.js +0 -219
- data/app/assets/javascripts/src/picker/Date.js +0 -1140
- data/app/assets/javascripts/src/picker/Month.js +0 -490
- data/app/assets/javascripts/src/picker/Time.js +0 -165
- data/app/assets/javascripts/src/resizer/BorderSplitter.js +0 -22
- data/app/assets/javascripts/src/resizer/BorderSplitterTracker.js +0 -210
- data/app/assets/javascripts/src/resizer/Handle.js +0 -29
- data/app/assets/javascripts/src/resizer/ResizeTracker.js +0 -346
- data/app/assets/javascripts/src/resizer/Resizer.js +0 -477
- data/app/assets/javascripts/src/resizer/Splitter.js +0 -242
- data/app/assets/javascripts/src/resizer/SplitterTracker.js +0 -230
- data/app/assets/javascripts/src/selection/CellModel.js +0 -395
- data/app/assets/javascripts/src/selection/CheckboxModel.js +0 -234
- data/app/assets/javascripts/src/selection/DataViewModel.js +0 -160
- data/app/assets/javascripts/src/selection/Model.js +0 -646
- data/app/assets/javascripts/src/selection/RowModel.js +0 -499
- data/app/assets/javascripts/src/selection/TreeModel.js +0 -78
- data/app/assets/javascripts/src/slider/Multi.js +0 -835
- data/app/assets/javascripts/src/slider/Single.js +0 -56
- data/app/assets/javascripts/src/slider/Thumb.js +0 -259
- data/app/assets/javascripts/src/slider/Tip.js +0 -130
- data/app/assets/javascripts/src/state/CookieProvider.js +0 -120
- data/app/assets/javascripts/src/state/LocalStorageProvider.js +0 -72
- data/app/assets/javascripts/src/state/Manager.js +0 -70
- data/app/assets/javascripts/src/state/Provider.js +0 -182
- data/app/assets/javascripts/src/state/Stateful.js +0 -364
- data/app/assets/javascripts/src/tab/Bar.js +0 -258
- data/app/assets/javascripts/src/tab/Panel.js +0 -654
- data/app/assets/javascripts/src/tab/Tab.js +0 -358
- data/app/assets/javascripts/src/tail.js +0 -10
- data/app/assets/javascripts/src/tip/QuickTip.js +0 -335
- data/app/assets/javascripts/src/tip/QuickTipManager.js +0 -239
- data/app/assets/javascripts/src/tip/Tip.js +0 -160
- data/app/assets/javascripts/src/tip/ToolTip.js +0 -691
- data/app/assets/javascripts/src/toolbar/Fill.js +0 -28
- data/app/assets/javascripts/src/toolbar/Item.js +0 -16
- data/app/assets/javascripts/src/toolbar/Paging.js +0 -600
- data/app/assets/javascripts/src/toolbar/Separator.js +0 -23
- data/app/assets/javascripts/src/toolbar/Spacer.js +0 -33
- data/app/assets/javascripts/src/toolbar/TextItem.js +0 -57
- data/app/assets/javascripts/src/toolbar/Toolbar-legacy.js +0 -123
- data/app/assets/javascripts/src/toolbar/Toolbar.js +0 -447
- data/app/assets/javascripts/src/tree/Column.js +0 -90
- data/app/assets/javascripts/src/tree/Panel.js +0 -505
- data/app/assets/javascripts/src/tree/View.js +0 -658
- data/app/assets/javascripts/src/tree/ViewDragZone.js +0 -49
- data/app/assets/javascripts/src/tree/ViewDropZone.js +0 -287
- data/app/assets/javascripts/src/tree/plugin/TreeViewDragDrop.js +0 -244
- data/app/assets/javascripts/src/util/AbstractMixedCollection.js +0 -772
- data/app/assets/javascripts/src/util/Animate.js +0 -426
- data/app/assets/javascripts/src/util/Bindable.js +0 -102
- data/app/assets/javascripts/src/util/CSS.js +0 -185
- data/app/assets/javascripts/src/util/ClickRepeater.js +0 -238
- data/app/assets/javascripts/src/util/ComponentDragger.js +0 -126
- data/app/assets/javascripts/src/util/Cookies.js +0 -91
- data/app/assets/javascripts/src/util/ElementContainer.js +0 -293
- data/app/assets/javascripts/src/util/Filter.js +0 -159
- data/app/assets/javascripts/src/util/Floating.js +0 -321
- data/app/assets/javascripts/src/util/Grouper.js +0 -26
- data/app/assets/javascripts/src/util/HashMap.js +0 -356
- data/app/assets/javascripts/src/util/History.js +0 -285
- data/app/assets/javascripts/src/util/Inflector.js +0 -297
- data/app/assets/javascripts/src/util/KeyMap.js +0 -427
- data/app/assets/javascripts/src/util/KeyNav.js +0 -239
- data/app/assets/javascripts/src/util/LruCache.js +0 -257
- data/app/assets/javascripts/src/util/Memento.js +0 -131
- data/app/assets/javascripts/src/util/MixedCollection.js +0 -239
- data/app/assets/javascripts/src/util/Observable.js +0 -1003
- data/app/assets/javascripts/src/util/Offset.js +0 -60
- data/app/assets/javascripts/src/util/Point.js +0 -93
- data/app/assets/javascripts/src/util/ProtoElement.js +0 -205
- data/app/assets/javascripts/src/util/Queue.js +0 -76
- data/app/assets/javascripts/src/util/Region.js +0 -388
- data/app/assets/javascripts/src/util/Renderable.js +0 -1079
- data/app/assets/javascripts/src/util/Sortable.js +0 -248
- data/app/assets/javascripts/src/util/Sorter.js +0 -179
- data/app/assets/javascripts/src/util/TextMetrics.js +0 -148
- data/app/assets/javascripts/src/view/AbstractView.js +0 -1103
- data/app/assets/javascripts/src/view/BoundList.js +0 -207
- data/app/assets/javascripts/src/view/BoundListKeyNav.js +0 -92
- data/app/assets/javascripts/src/view/DragZone.js +0 -106
- data/app/assets/javascripts/src/view/DropZone.js +0 -240
- data/app/assets/javascripts/src/view/Table.js +0 -1229
- data/app/assets/javascripts/src/view/TableChunker.js +0 -139
- data/app/assets/javascripts/src/view/View.js +0 -636
- data/app/assets/javascripts/src/window/MessageBox.js +0 -880
- data/app/assets/javascripts/src/window/Window-legacy.js +0 -56
- data/app/assets/javascripts/src/window/Window.js +0 -793
@@ -1,342 +0,0 @@
|
|
1
|
-
describe("Ext.Element.insertion", function() {
|
2
|
-
var proto = Ext.Element.prototype,
|
3
|
-
el, testEl,
|
4
|
-
span, testSpanEl,
|
5
|
-
child1, child2, child3;
|
6
|
-
|
7
|
-
beforeEach(function() {
|
8
|
-
testEl = Ext.getBody().createChild({
|
9
|
-
id: 'ExtElementHelper',
|
10
|
-
children: [
|
11
|
-
{id: 'child1'},
|
12
|
-
{id: 'child2'},
|
13
|
-
{id: 'child3'}
|
14
|
-
]
|
15
|
-
});
|
16
|
-
|
17
|
-
testSpanEl = Ext.getBody().createChild({
|
18
|
-
id : 'ExtElementSpanHelper',
|
19
|
-
tag : 'span'
|
20
|
-
});
|
21
|
-
|
22
|
-
el = new Ext.Element(Ext.getDom(testEl));
|
23
|
-
span = new Ext.Element(Ext.getDom(testSpanEl));
|
24
|
-
|
25
|
-
child1 = Ext.get('child1');
|
26
|
-
child2 = Ext.get('child2');
|
27
|
-
child3 = Ext.get('child3');
|
28
|
-
});
|
29
|
-
|
30
|
-
afterEach(function() {
|
31
|
-
testEl.remove();
|
32
|
-
testSpanEl.remove();
|
33
|
-
});
|
34
|
-
describe("appendChild", function() {
|
35
|
-
it("should append the child", function() {
|
36
|
-
expect(el.contains(span)).toBeFalsy();
|
37
|
-
|
38
|
-
el.appendChild(span);
|
39
|
-
|
40
|
-
expect(el.contains(span)).toBeTruthy();
|
41
|
-
});
|
42
|
-
});
|
43
|
-
|
44
|
-
describe("appendTo", function() {
|
45
|
-
it("should append the el to the specified el", function() {
|
46
|
-
expect(span.contains(el)).toBeFalsy();
|
47
|
-
|
48
|
-
el.appendTo(span);
|
49
|
-
|
50
|
-
expect(span.contains(el)).toBeTruthy();
|
51
|
-
});
|
52
|
-
});
|
53
|
-
|
54
|
-
describe("insertBefore", function() {
|
55
|
-
it("should insert the el before the specified el", function() {
|
56
|
-
var nodes = Ext.getDom(child1).parentNode.childNodes,
|
57
|
-
array = Ext.toArray(nodes);
|
58
|
-
|
59
|
-
|
60
|
-
expect(Ext.Array.indexOf(array, Ext.getDom(child2))).toEqual(1);
|
61
|
-
|
62
|
-
child2.insertBefore(child1);
|
63
|
-
|
64
|
-
nodes = Ext.getDom(child1).parentNode.childNodes;
|
65
|
-
array = Ext.toArray(nodes);
|
66
|
-
|
67
|
-
expect(Ext.Array.indexOf(array, Ext.getDom(child2))).toEqual(0);
|
68
|
-
});
|
69
|
-
});
|
70
|
-
|
71
|
-
describe("insertAfter", function() {
|
72
|
-
it("should insert the el after the specified el", function() {
|
73
|
-
var nodes = Ext.getDom(child1).parentNode.childNodes,
|
74
|
-
array = Ext.toArray(nodes);
|
75
|
-
|
76
|
-
expect(Ext.Array.indexOf(array, Ext.getDom(child2))).toEqual(1);
|
77
|
-
|
78
|
-
child2.insertAfter(child3);
|
79
|
-
|
80
|
-
nodes = Ext.getDom(child1).parentNode.childNodes;
|
81
|
-
array = Ext.toArray(nodes);
|
82
|
-
|
83
|
-
expect(Ext.Array.indexOf(array, Ext.getDom(child2))).toEqual(2);
|
84
|
-
});
|
85
|
-
});
|
86
|
-
|
87
|
-
describe("insertFirst", function() {
|
88
|
-
it("should insert the el into the specified el", function() {
|
89
|
-
var nodes = Ext.getDom(child2).childNodes;
|
90
|
-
expect(nodes.length).toEqual(0);
|
91
|
-
|
92
|
-
child2.insertFirst(child1);
|
93
|
-
|
94
|
-
nodes = Ext.getDom(child2).childNodes;
|
95
|
-
expect(nodes.length).toEqual(1);
|
96
|
-
});
|
97
|
-
});
|
98
|
-
|
99
|
-
describe("insertSibling", function() {
|
100
|
-
describe("when array", function() {
|
101
|
-
describe("after", function() {
|
102
|
-
it("should create each of the elements and add them to the el parent", function() {
|
103
|
-
var nodes = Ext.getDom(el).childNodes;
|
104
|
-
expect(nodes.length).toEqual(3);
|
105
|
-
|
106
|
-
child1.insertSibling([
|
107
|
-
{id: 'sibling1'},
|
108
|
-
{id: 'sibling2'}
|
109
|
-
], 'after');
|
110
|
-
|
111
|
-
nodes = Ext.getDom(el).childNodes;
|
112
|
-
expect(nodes.length).toEqual(5);
|
113
|
-
});
|
114
|
-
});
|
115
|
-
|
116
|
-
describe("before", function() {
|
117
|
-
it("should create each of the elements and add them to the el parent", function() {
|
118
|
-
var nodes = Ext.getDom(el).childNodes;
|
119
|
-
expect(nodes.length).toEqual(3);
|
120
|
-
|
121
|
-
child1.insertSibling([
|
122
|
-
{id: 'sibling1'},
|
123
|
-
{id: 'sibling2'}
|
124
|
-
], 'before');
|
125
|
-
|
126
|
-
nodes = Ext.getDom(el).childNodes;
|
127
|
-
expect(nodes.length).toEqual(5);
|
128
|
-
});
|
129
|
-
});
|
130
|
-
});
|
131
|
-
|
132
|
-
describe("when Ext.Element", function() {
|
133
|
-
describe("after", function() {
|
134
|
-
it("should move the element next to the el", function() {
|
135
|
-
var nodes = Ext.getDom(el).childNodes;
|
136
|
-
expect(nodes.length).toEqual(3);
|
137
|
-
|
138
|
-
child1.insertSibling(span, 'after');
|
139
|
-
|
140
|
-
nodes = Ext.getDom(el).childNodes;
|
141
|
-
expect(nodes.length).toEqual(4);
|
142
|
-
});
|
143
|
-
});
|
144
|
-
|
145
|
-
describe("before", function() {
|
146
|
-
it("should move the element next to the el", function() {
|
147
|
-
var nodes = Ext.getDom(el).childNodes;
|
148
|
-
expect(nodes.length).toEqual(3);
|
149
|
-
|
150
|
-
child1.insertSibling(span, 'before');
|
151
|
-
|
152
|
-
nodes = Ext.getDom(el).childNodes;
|
153
|
-
expect(nodes.length).toEqual(4);
|
154
|
-
});
|
155
|
-
});
|
156
|
-
});
|
157
|
-
|
158
|
-
describe("other", function() {
|
159
|
-
describe("after", function() {
|
160
|
-
it("should move the element next to the el", function() {
|
161
|
-
var nodes = Ext.getDom(el).childNodes;
|
162
|
-
expect(nodes.length).toEqual(3);
|
163
|
-
|
164
|
-
child1.insertSibling({
|
165
|
-
id: 'sibling1'
|
166
|
-
}, 'after');
|
167
|
-
|
168
|
-
nodes = Ext.getDom(el).childNodes;
|
169
|
-
expect(nodes.length).toEqual(4);
|
170
|
-
});
|
171
|
-
});
|
172
|
-
|
173
|
-
describe("before", function() {
|
174
|
-
it("should move the element next to the el", function() {
|
175
|
-
var nodes = Ext.getDom(el).childNodes;
|
176
|
-
expect(nodes.length).toEqual(3);
|
177
|
-
|
178
|
-
child1.insertSibling({
|
179
|
-
id: 'sibling1'
|
180
|
-
}, 'before');
|
181
|
-
|
182
|
-
nodes = Ext.getDom(el).childNodes;
|
183
|
-
expect(nodes.length).toEqual(4);
|
184
|
-
});
|
185
|
-
|
186
|
-
describe("return dom", function() {
|
187
|
-
it("should move the element next to the el", function() {
|
188
|
-
var nodes = Ext.getDom(el).childNodes,
|
189
|
-
dom;
|
190
|
-
|
191
|
-
expect(nodes.length).toEqual(3);
|
192
|
-
|
193
|
-
dom = child1.insertSibling({
|
194
|
-
id: 'sibling1'
|
195
|
-
}, 'before', true);
|
196
|
-
|
197
|
-
nodes = Ext.getDom(el).childNodes;
|
198
|
-
expect(nodes.length).toEqual(4);
|
199
|
-
expect(dom).toBeDefined();
|
200
|
-
});
|
201
|
-
});
|
202
|
-
});
|
203
|
-
});
|
204
|
-
});
|
205
|
-
|
206
|
-
describe("replace", function() {
|
207
|
-
it("should replace the passed element with this element", function() {
|
208
|
-
var nodes = Ext.getDom(el).childNodes;
|
209
|
-
expect(nodes.length).toEqual(3);
|
210
|
-
|
211
|
-
child1.replace(child2);
|
212
|
-
|
213
|
-
nodes = Ext.getDom(el).childNodes;
|
214
|
-
expect(nodes.length).toEqual(2);
|
215
|
-
});
|
216
|
-
});
|
217
|
-
|
218
|
-
describe("replaceWith", function() {
|
219
|
-
it("should replace this element with the passed element", function() {
|
220
|
-
var nodes = Ext.getDom(el).childNodes;
|
221
|
-
expect(nodes.length).toEqual(3);
|
222
|
-
|
223
|
-
child1.replaceWith({tag: "div", cls: "childtestdiv"});
|
224
|
-
|
225
|
-
expect(child1.hasCls("childtestdiv"));
|
226
|
-
|
227
|
-
nodes = Ext.getDom(el).childNodes;
|
228
|
-
expect(nodes.length).toEqual(3);
|
229
|
-
});
|
230
|
-
});
|
231
|
-
|
232
|
-
describe("createChild", function() {
|
233
|
-
it("should create a child", function() {
|
234
|
-
var nodes = Ext.getDom(el).childNodes;
|
235
|
-
expect(nodes.length).toEqual(3);
|
236
|
-
|
237
|
-
el.createChild({id: 'child4'});
|
238
|
-
|
239
|
-
nodes = Ext.getDom(el).childNodes;
|
240
|
-
expect(nodes.length).toEqual(4);
|
241
|
-
});
|
242
|
-
|
243
|
-
it("should create a child before an el", function() {
|
244
|
-
var nodes = Ext.getDom(el).childNodes,
|
245
|
-
array = Ext.toArray(nodes);
|
246
|
-
|
247
|
-
expect(nodes.length).toEqual(3);
|
248
|
-
expect(Ext.Array.indexOf(array, Ext.getDom(child2))).toEqual(1);
|
249
|
-
|
250
|
-
el.createChild({id: 'child4'}, child2);
|
251
|
-
|
252
|
-
nodes = Ext.getDom(el).childNodes;
|
253
|
-
array = Ext.toArray(nodes);
|
254
|
-
|
255
|
-
expect(nodes.length).toEqual(4);
|
256
|
-
expect(Ext.Array.indexOf(array, Ext.getDom(child2))).toEqual(2);
|
257
|
-
});
|
258
|
-
});
|
259
|
-
|
260
|
-
describe("wrap", function() {
|
261
|
-
it("should wrap the element", function() {
|
262
|
-
var parent = Ext.getDom(child1).parentNode;
|
263
|
-
|
264
|
-
child1.wrap({
|
265
|
-
cls: 'wrapper'
|
266
|
-
});
|
267
|
-
|
268
|
-
expect(Ext.getDom(child1).parentNode.parentNode).toEqual(parent);
|
269
|
-
expect(Ext.getDom(child1).parentNode.className).toEqual('wrapper');
|
270
|
-
});
|
271
|
-
|
272
|
-
it("return the el", function() {
|
273
|
-
var node = child1.wrap({
|
274
|
-
cls: 'wrapper'
|
275
|
-
});
|
276
|
-
|
277
|
-
expect(Ext.isElement(node)).toBeFalsy();
|
278
|
-
});
|
279
|
-
|
280
|
-
it("return the dom", function() {
|
281
|
-
var node = child1.wrap({
|
282
|
-
cls: 'wrapper'
|
283
|
-
}, true);
|
284
|
-
|
285
|
-
expect(Ext.isElement(node)).toBeTruthy();
|
286
|
-
});
|
287
|
-
});
|
288
|
-
|
289
|
-
describe("insertHtml", function() {
|
290
|
-
describe("beforeBegin", function() {
|
291
|
-
it("should insert the html", function() {
|
292
|
-
expect(Ext.getDom(el).childNodes.length).toEqual(3);
|
293
|
-
|
294
|
-
child1.insertHtml('beforeBegin', '<div></div>');
|
295
|
-
|
296
|
-
expect(Ext.getDom(el).childNodes.length).toEqual(4);
|
297
|
-
});
|
298
|
-
});
|
299
|
-
|
300
|
-
describe("afterBegin", function() {
|
301
|
-
it("should insert the html", function() {
|
302
|
-
expect(Ext.getDom(child1).childNodes.length).toEqual(0);
|
303
|
-
|
304
|
-
child1.insertHtml('afterBegin', '<div></div>');
|
305
|
-
|
306
|
-
expect(Ext.getDom(child1).childNodes.length).toEqual(1);
|
307
|
-
});
|
308
|
-
});
|
309
|
-
|
310
|
-
describe("beforeEnd", function() {
|
311
|
-
it("should insert the html", function() {
|
312
|
-
expect(Ext.getDom(child1).childNodes.length).toEqual(0);
|
313
|
-
|
314
|
-
child1.insertHtml('beforeEnd', '<div></div>');
|
315
|
-
|
316
|
-
expect(Ext.getDom(child1).childNodes.length).toEqual(1);
|
317
|
-
});
|
318
|
-
});
|
319
|
-
|
320
|
-
describe("afterEnd", function() {
|
321
|
-
it("should insert the html", function() {
|
322
|
-
expect(Ext.getDom(el).childNodes.length).toEqual(3);
|
323
|
-
|
324
|
-
child1.insertHtml('afterEnd', '<div></div>');
|
325
|
-
|
326
|
-
expect(Ext.getDom(el).childNodes.length).toEqual(4);
|
327
|
-
});
|
328
|
-
});
|
329
|
-
|
330
|
-
it("should return a dom", function() {
|
331
|
-
var node = child1.insertHtml('afterEnd', '<div></div>');
|
332
|
-
|
333
|
-
expect(Ext.isElement(node)).toBeTruthy();
|
334
|
-
});
|
335
|
-
|
336
|
-
it("should return an el", function() {
|
337
|
-
var node = child1.insertHtml('afterEnd', '<div></div>', true);
|
338
|
-
|
339
|
-
expect(Ext.isElement(node)).toBeFalsy();
|
340
|
-
});
|
341
|
-
});
|
342
|
-
}, "/src/dom/Element.insertion.js");
|
@@ -1,731 +0,0 @@
|
|
1
|
-
describe("Ext.dom.Element", function() {
|
2
|
-
var domEl,
|
3
|
-
element;
|
4
|
-
|
5
|
-
afterEach(function() {
|
6
|
-
if (element) {
|
7
|
-
element.remove();
|
8
|
-
}
|
9
|
-
|
10
|
-
if (domEl && domEl.parentNode === document.body) {
|
11
|
-
document.body.removeChild(domEl);
|
12
|
-
}
|
13
|
-
});
|
14
|
-
|
15
|
-
describe("instantiation", function() {
|
16
|
-
beforeEach(function() {
|
17
|
-
domEl = document.createElement("div");
|
18
|
-
Ext.getBody().appendChild(domEl);
|
19
|
-
});
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
it("should set dom element id if it hasn't already one", function() {
|
24
|
-
element = new Ext.dom.Element(domEl);
|
25
|
-
|
26
|
-
expect(domEl.id).toBeDefined();
|
27
|
-
});
|
28
|
-
|
29
|
-
it("should not set dom element id if it has already one", function() {
|
30
|
-
var id = Ext.id();
|
31
|
-
|
32
|
-
domEl.id = id;
|
33
|
-
element = new Ext.dom.Element(domEl);
|
34
|
-
|
35
|
-
expect(domEl.id).toEqual(id);
|
36
|
-
});
|
37
|
-
|
38
|
-
it("should set dom property to dom element", function() {
|
39
|
-
element = new Ext.dom.Element(domEl);
|
40
|
-
|
41
|
-
expect(element.dom).toBe(domEl);
|
42
|
-
});
|
43
|
-
|
44
|
-
it("should set id property to dom id", function() {
|
45
|
-
var id = Ext.id();
|
46
|
-
|
47
|
-
domEl.id = id;
|
48
|
-
element = new Ext.dom.Element(domEl);
|
49
|
-
|
50
|
-
expect(element.id).toEqual(id);
|
51
|
-
});
|
52
|
-
|
53
|
-
it("should not set dom or id property if first argument is undefined", function() {
|
54
|
-
element = new Ext.dom.Element();
|
55
|
-
|
56
|
-
expect(element.id).toBeUndefined();
|
57
|
-
expect(element.dom).toBeUndefined();
|
58
|
-
});
|
59
|
-
|
60
|
-
it("should find a dom element if a string corresponding to it's id is passed as first argument", function() {
|
61
|
-
var id = Ext.id();
|
62
|
-
|
63
|
-
domEl.id = id;
|
64
|
-
|
65
|
-
element = new Ext.dom.Element(id);
|
66
|
-
|
67
|
-
expect(element.dom).toBe(domEl);
|
68
|
-
});
|
69
|
-
});
|
70
|
-
|
71
|
-
function describeMethods(){
|
72
|
-
describe("set", function() {
|
73
|
-
it("should call Ext.core.DomHelper.applyStyles if object passed as first argument has style property", function() {
|
74
|
-
var style = {width:'100px'};
|
75
|
-
|
76
|
-
spyOn(Ext.core.DomHelper, "applyStyles");
|
77
|
-
|
78
|
-
element.set({style: style});
|
79
|
-
|
80
|
-
expect(Ext.core.DomHelper.applyStyles).toHaveBeenCalledWith(element.dom, style);
|
81
|
-
});
|
82
|
-
|
83
|
-
it("should set dom element className if object passed as first argument has cls property", function() {
|
84
|
-
var cls = "x-test-class";
|
85
|
-
|
86
|
-
element.set({cls: cls});
|
87
|
-
|
88
|
-
expect(element.dom.className).toEqual(cls);
|
89
|
-
});
|
90
|
-
|
91
|
-
it("should use setAttribute by default", function() {
|
92
|
-
spyOn(element.dom, "setAttribute");
|
93
|
-
|
94
|
-
element.set({align: "center"});
|
95
|
-
|
96
|
-
expect(element.dom.setAttribute).toHaveBeenCalledWith("align", "center");
|
97
|
-
});
|
98
|
-
|
99
|
-
it("should be able to use expandos", function() {
|
100
|
-
spyOn(element.dom, "setAttribute");
|
101
|
-
|
102
|
-
element.set({align: "center"}, false);
|
103
|
-
|
104
|
-
|
105
|
-
expect(element.dom.align).toEqual("center");
|
106
|
-
});
|
107
|
-
|
108
|
-
});
|
109
|
-
|
110
|
-
describe("is", function() {
|
111
|
-
it("Returns true if this element matches the passed simple selector", function() {
|
112
|
-
element.set({cls: "x-test-class"});
|
113
|
-
|
114
|
-
expect(element.is("div.x-test-class")).toBe(true);
|
115
|
-
});
|
116
|
-
});
|
117
|
-
|
118
|
-
describe("focus", function() {
|
119
|
-
it("should focus dom element", function() {
|
120
|
-
spyOn(element.dom, "focus");
|
121
|
-
|
122
|
-
element.focus();
|
123
|
-
|
124
|
-
expect(element.dom.focus).toHaveBeenCalled();
|
125
|
-
});
|
126
|
-
|
127
|
-
it("should be able to defer dom element focus", function() {
|
128
|
-
spyOn(element.dom, "focus");
|
129
|
-
element.focus(1);
|
130
|
-
|
131
|
-
waitsFor(function(){
|
132
|
-
return element.dom.focus.calls.length === 1;
|
133
|
-
}, "element.dom.focus was never called");
|
134
|
-
|
135
|
-
runs(function() {
|
136
|
-
expect(element.dom.focus).toHaveBeenCalled();
|
137
|
-
});
|
138
|
-
});
|
139
|
-
|
140
|
-
it("should ignore any exception", function() {
|
141
|
-
element.dom.focus = function() {
|
142
|
-
throw "error";
|
143
|
-
};
|
144
|
-
|
145
|
-
expect(element.focus).not.toThrow("error");
|
146
|
-
});
|
147
|
-
});
|
148
|
-
|
149
|
-
describe("blur", function() {
|
150
|
-
it("should blur dom element", function() {
|
151
|
-
spyOn(element.dom, "blur");
|
152
|
-
|
153
|
-
element.blur();
|
154
|
-
|
155
|
-
expect(element.dom.blur).toHaveBeenCalled();
|
156
|
-
});
|
157
|
-
|
158
|
-
|
159
|
-
it("should ignore any exception", function() {
|
160
|
-
element.dom.blur = function() {
|
161
|
-
throw "error";
|
162
|
-
};
|
163
|
-
|
164
|
-
expect(element.blur).not.toThrow("error");
|
165
|
-
});
|
166
|
-
});
|
167
|
-
|
168
|
-
describe("getValue", function() {
|
169
|
-
beforeEach(function() {
|
170
|
-
element.dom.value = "10";
|
171
|
-
});
|
172
|
-
|
173
|
-
it("should return the dom value", function() {
|
174
|
-
expect(element.getValue()).toEqual("10");
|
175
|
-
});
|
176
|
-
|
177
|
-
it("should return the dom value as Number", function() {
|
178
|
-
expect(element.getValue(true)).toEqual(10);
|
179
|
-
});
|
180
|
-
});
|
181
|
-
|
182
|
-
describe("listeners", function() {
|
183
|
-
var options;
|
184
|
-
|
185
|
-
beforeEach(function() {
|
186
|
-
options = {delay: 10};
|
187
|
-
});
|
188
|
-
|
189
|
-
describe("addListener", function() {
|
190
|
-
it("should call Ext.EventManager.on", function() {
|
191
|
-
spyOn(Ext.EventManager, "on");
|
192
|
-
|
193
|
-
element.addListener("click", Ext.emptyFn, fakeScope, options);
|
194
|
-
|
195
|
-
expect(Ext.EventManager.on).toHaveBeenCalledWith(element, "click", Ext.emptyFn, fakeScope, options);
|
196
|
-
});
|
197
|
-
});
|
198
|
-
|
199
|
-
describe("removeListener", function() {
|
200
|
-
it("should call Ext.EventManager.un", function() {
|
201
|
-
spyOn(Ext.EventManager, "un");
|
202
|
-
|
203
|
-
element.removeListener("click", Ext.emptyFn, fakeScope);
|
204
|
-
|
205
|
-
expect(Ext.EventManager.un).toHaveBeenCalledWith(element, "click", Ext.emptyFn, fakeScope);
|
206
|
-
});
|
207
|
-
});
|
208
|
-
|
209
|
-
describe("removeAllListener", function() {
|
210
|
-
it("should call Ext.EventManager.removeAll", function() {
|
211
|
-
spyOn(Ext.EventManager, "removeAll");
|
212
|
-
|
213
|
-
element.removeAllListeners();
|
214
|
-
|
215
|
-
expect(Ext.EventManager.removeAll).toHaveBeenCalledWith(element.dom);
|
216
|
-
});
|
217
|
-
});
|
218
|
-
|
219
|
-
describe("purgeAllListener", function() {
|
220
|
-
it("should call Ext.EventManager.purgeElement", function() {
|
221
|
-
spyOn(Ext.EventManager, "purgeElement");
|
222
|
-
|
223
|
-
element.purgeAllListeners();
|
224
|
-
|
225
|
-
expect(Ext.EventManager.purgeElement).toHaveBeenCalledWith(element);
|
226
|
-
});
|
227
|
-
});
|
228
|
-
});
|
229
|
-
|
230
|
-
describe("addUnits", function() {
|
231
|
-
it("should return an empty string if size passed is an empty string", function() {
|
232
|
-
expect(element.addUnits("")).toEqual("");
|
233
|
-
});
|
234
|
-
|
235
|
-
it("should return auto if size passed is 'auto' string", function() {
|
236
|
-
expect(element.addUnits("auto")).toEqual("auto");
|
237
|
-
});
|
238
|
-
|
239
|
-
it("should return an empty string if size passed is undefined", function() {
|
240
|
-
expect(element.addUnits(undefined)).toEqual("");
|
241
|
-
});
|
242
|
-
|
243
|
-
it("should return an empty string if size passed is null", function() {
|
244
|
-
expect(element.addUnits(null)).toEqual("");
|
245
|
-
});
|
246
|
-
});
|
247
|
-
|
248
|
-
describe("remove", function() {
|
249
|
-
beforeEach(function() {
|
250
|
-
spyOn(Ext, "removeNode").andCallThrough();
|
251
|
-
element.remove();
|
252
|
-
});
|
253
|
-
|
254
|
-
it("should remove dom property", function() {
|
255
|
-
expect(element.dom).toBeUndefined();
|
256
|
-
});
|
257
|
-
|
258
|
-
it("should call Ext.removeNode", function() {
|
259
|
-
expect(Ext.removeNode).toHaveBeenCalledWith(domEl);
|
260
|
-
});
|
261
|
-
});
|
262
|
-
|
263
|
-
describe("hover", function() {
|
264
|
-
var overFn, outFn, options;
|
265
|
-
beforeEach(function() {
|
266
|
-
overFn = function() {
|
267
|
-
return 1;
|
268
|
-
};
|
269
|
-
|
270
|
-
outFn = function() {
|
271
|
-
return 2;
|
272
|
-
};
|
273
|
-
|
274
|
-
options = {
|
275
|
-
foo: true
|
276
|
-
};
|
277
|
-
|
278
|
-
spyOn(element, "on");
|
279
|
-
});
|
280
|
-
|
281
|
-
describe("mouseenter event", function() {
|
282
|
-
it("should add a listener on mouseenter", function() {
|
283
|
-
element.hover(overFn, outFn, fakeScope, options);
|
284
|
-
|
285
|
-
expect(element.on).toHaveBeenCalledWith("mouseenter", overFn, fakeScope, options);
|
286
|
-
});
|
287
|
-
|
288
|
-
it("should set scope to element.dom if it is not passed in arguments", function() {
|
289
|
-
element.hover(overFn, outFn, null, options);
|
290
|
-
|
291
|
-
expect(element.on).toHaveBeenCalledWith("mouseenter", overFn, element.dom, options);
|
292
|
-
});
|
293
|
-
});
|
294
|
-
|
295
|
-
describe("mouseleave event", function() {
|
296
|
-
it("should add a listener on mouseleave", function() {
|
297
|
-
element.hover(overFn, outFn, fakeScope, options);
|
298
|
-
|
299
|
-
expect(element.on).toHaveBeenCalledWith("mouseleave", outFn, fakeScope, options);
|
300
|
-
});
|
301
|
-
|
302
|
-
it("should set scope to element.dom if it is not passed in arguments", function() {
|
303
|
-
element.hover(overFn, outFn, null, options);
|
304
|
-
|
305
|
-
expect(element.on).toHaveBeenCalledWith("mouseleave", outFn, element.dom, options);
|
306
|
-
});
|
307
|
-
});
|
308
|
-
});
|
309
|
-
|
310
|
-
describe("contains", function() {
|
311
|
-
/**
|
312
|
-
* TODO: Removed tests for now, need to reinstate once the refactoring is done.
|
313
|
-
*/
|
314
|
-
});
|
315
|
-
|
316
|
-
describe("getAttributeNs", function() {
|
317
|
-
it("should call element getAttribute", function() {
|
318
|
-
spyOn(element, "getAttribute");
|
319
|
-
|
320
|
-
element.getAttributeNS("ns1", "align");
|
321
|
-
|
322
|
-
expect(element.getAttribute).toHaveBeenCalledWith("align", "ns1");
|
323
|
-
});
|
324
|
-
});
|
325
|
-
|
326
|
-
describe("getAttribute", function() {
|
327
|
-
var element2, element3;
|
328
|
-
beforeEach(function() {
|
329
|
-
element2 = Ext.getBody().createChild({tag: "div"});
|
330
|
-
|
331
|
-
|
332
|
-
if (element.dom.setAttribute) {
|
333
|
-
element.dom.setAttribute("qtip", "bar");
|
334
|
-
element2.dom.setAttribute("ext:qtip", "foo");
|
335
|
-
} else {
|
336
|
-
element.dom["qtip"] = "bar";
|
337
|
-
element2.dom["ext:qtip"] = "foo";
|
338
|
-
}
|
339
|
-
|
340
|
-
if (element.dom.setAttributeNS) {
|
341
|
-
element3 = Ext.getBody().createChild({tag: "div"});
|
342
|
-
element3.dom.setAttributeNS("ext", "qtip", "foobar");
|
343
|
-
}
|
344
|
-
});
|
345
|
-
|
346
|
-
afterEach(function() {
|
347
|
-
if (element2) {
|
348
|
-
element2.remove();
|
349
|
-
}
|
350
|
-
|
351
|
-
if (element3) {
|
352
|
-
element3.remove();
|
353
|
-
}
|
354
|
-
});
|
355
|
-
|
356
|
-
describe("without namespace", function() {
|
357
|
-
it("should return the attribute value if it exists", function() {
|
358
|
-
expect(element.getAttribute("qtip")).toEqual("bar");
|
359
|
-
});
|
360
|
-
|
361
|
-
it("should return null if the attribute does not exist", function() {
|
362
|
-
expect(element.getAttribute("nothing")).toBeNull();
|
363
|
-
});
|
364
|
-
});
|
365
|
-
|
366
|
-
describe("with namespace", function() {
|
367
|
-
it("should return null on a non-namespaced attribute", function() {
|
368
|
-
expect(element.getAttribute("qtip", "ext")).toBeNull();
|
369
|
-
});
|
370
|
-
|
371
|
-
it("should return null if the attribute belong to another namespace", function() {
|
372
|
-
expect(element2.getAttribute("qtip", "nothing")).toBeNull();
|
373
|
-
});
|
374
|
-
|
375
|
-
it("should return the attribute value if it belongs to the namespace", function() {
|
376
|
-
if (element3) {
|
377
|
-
expect(element3.getAttribute("qtip", "ext")).toEqual("foobar");
|
378
|
-
}
|
379
|
-
});
|
380
|
-
|
381
|
-
it("should handle xml namespace", function() {
|
382
|
-
expect(element2.getAttribute("qtip", "ext")).toEqual("foo");
|
383
|
-
});
|
384
|
-
});
|
385
|
-
});
|
386
|
-
|
387
|
-
describe("update", function() {
|
388
|
-
beforeEach(function() {
|
389
|
-
element.dom.innerHTML = "hello world";
|
390
|
-
});
|
391
|
-
|
392
|
-
it("should update dom element innerHTML", function() {
|
393
|
-
element.update("foobar");
|
394
|
-
|
395
|
-
expect(element.dom).hasHTML("foobar");
|
396
|
-
});
|
397
|
-
|
398
|
-
it("should return element", function() {
|
399
|
-
expect(element.update("foobar")).toBe(element);
|
400
|
-
});
|
401
|
-
});
|
402
|
-
|
403
|
-
describe("prototype aliases", function() {
|
404
|
-
it("should aliases addListener with on", function() {
|
405
|
-
expect(typeof(element.on)).toEqual('function');
|
406
|
-
});
|
407
|
-
|
408
|
-
it("should aliases removeListener with un", function() {
|
409
|
-
expect(typeof(element.un)).toEqual('function');
|
410
|
-
});
|
411
|
-
|
412
|
-
it("should aliases removeAllListeners with clearListeners", function() {
|
413
|
-
expect(typeof(element.clearListeners)).toEqual('function');
|
414
|
-
});
|
415
|
-
});
|
416
|
-
|
417
|
-
describe("visibilityMode", function(){
|
418
|
-
it('must be able to setVisibilityMode and getVisibilityMode', function(){
|
419
|
-
element.setVisibilityMode(Ext.dom.Element.DISPLAY);
|
420
|
-
expect(element.getVisibilityMode()).toBe(Ext.dom.Element.DISPLAY);
|
421
|
-
|
422
|
-
element.setVisibilityMode(Ext.dom.Element.VISIBILITY);
|
423
|
-
expect(element.getVisibilityMode()).toBe(Ext.dom.Element.VISIBILITY);
|
424
|
-
});
|
425
|
-
|
426
|
-
it("should retain visibilityMode on flyweights", function(){
|
427
|
-
Ext.fly(element.dom).setVisibilityMode(Ext.dom.Element.DISPLAY);
|
428
|
-
expect(Ext.fly(element.dom).getVisibilityMode()).toBe(Ext.dom.Element.DISPLAY);
|
429
|
-
});
|
430
|
-
});
|
431
|
-
|
432
|
-
describe("visibility", function(){
|
433
|
-
var child, grandChild,
|
434
|
-
modes = [Ext.dom.Element.DISPLAY, Ext.dom.Element.VISIBILITY];
|
435
|
-
|
436
|
-
beforeEach(function() {
|
437
|
-
child = element.createChild({tag: "div"});
|
438
|
-
if (child) {
|
439
|
-
child.setVisible(true);
|
440
|
-
grandChild = child.createChild({tag: "div"});
|
441
|
-
if (grandChild) {
|
442
|
-
grandChild.setVisible(true);
|
443
|
-
}
|
444
|
-
}
|
445
|
-
});
|
446
|
-
|
447
|
-
afterEach(function() {
|
448
|
-
if (grandChild) {
|
449
|
-
grandChild.remove();
|
450
|
-
}
|
451
|
-
if (child) {
|
452
|
-
child.remove();
|
453
|
-
}
|
454
|
-
});
|
455
|
-
|
456
|
-
it("should toggle the visibility of the element itself", function(){
|
457
|
-
for (var i in modes) {
|
458
|
-
element.setVisibilityMode(modes[i]);
|
459
|
-
|
460
|
-
element.setVisible(false);
|
461
|
-
expect(element.isVisible(false)).toBe(false);
|
462
|
-
|
463
|
-
element.setVisible(true);
|
464
|
-
expect(element.isVisible(false)).toBe(true);
|
465
|
-
}
|
466
|
-
});
|
467
|
-
|
468
|
-
it("should toggle the 'deep' visibility of the grand-child", function(){
|
469
|
-
for (var i in modes) {
|
470
|
-
element.setVisibilityMode(modes[i]);
|
471
|
-
|
472
|
-
element.setVisible(false);
|
473
|
-
expect(grandChild.isVisible(true)).toBe(false);
|
474
|
-
|
475
|
-
element.setVisible(true);
|
476
|
-
expect(grandChild.isVisible(true)).toBe(true);
|
477
|
-
}
|
478
|
-
});
|
479
|
-
});
|
480
|
-
|
481
|
-
}
|
482
|
-
|
483
|
-
describe('methods', function(){
|
484
|
-
beforeEach(function() {
|
485
|
-
domEl = document.createElement('div');
|
486
|
-
document.body.appendChild(domEl);
|
487
|
-
});
|
488
|
-
|
489
|
-
describe("new Ext.dom.Element", function(){
|
490
|
-
beforeEach(function() {
|
491
|
-
element = new Ext.dom.Element(domEl);
|
492
|
-
});
|
493
|
-
describeMethods();
|
494
|
-
});
|
495
|
-
|
496
|
-
describe("Ext.fly", function(){
|
497
|
-
beforeEach(function(){
|
498
|
-
element = Ext.fly(domEl);
|
499
|
-
});
|
500
|
-
describeMethods();
|
501
|
-
});
|
502
|
-
|
503
|
-
});
|
504
|
-
|
505
|
-
describe("class methods", function() {
|
506
|
-
var element2, domEl2, id;
|
507
|
-
|
508
|
-
beforeEach(function() {
|
509
|
-
element = Ext.getBody().createChild({tag: "div"});
|
510
|
-
domEl = element.dom;
|
511
|
-
|
512
|
-
id = Ext.id();
|
513
|
-
domEl2 = document.createElement("div");
|
514
|
-
domEl2.id = id;
|
515
|
-
document.body.appendChild(domEl2);
|
516
|
-
|
517
|
-
spyOn(Ext.dom.Element, "addToCache").andCallThrough();
|
518
|
-
});
|
519
|
-
|
520
|
-
afterEach(function() {
|
521
|
-
if (element2) {
|
522
|
-
element2.remove();
|
523
|
-
}
|
524
|
-
if (domEl2 && domEl2.parentNode === document.body) {
|
525
|
-
document.body.removeChild(domEl2);
|
526
|
-
}
|
527
|
-
});
|
528
|
-
|
529
|
-
describe("get", function() {
|
530
|
-
describe("alias", function() {
|
531
|
-
it("should alias Ext.dom.Element.get with Ext.get", function() {
|
532
|
-
spyOn(Ext.dom.Element, 'get');
|
533
|
-
Ext.get();
|
534
|
-
expect(Ext.dom.Element.get).toHaveBeenCalled();
|
535
|
-
});
|
536
|
-
});
|
537
|
-
|
538
|
-
describe("passing string id as first argument", function() {
|
539
|
-
describe("with a dom element which is not already encapsulated", function() {
|
540
|
-
it("should return a new Ext.dom.Element", function() {
|
541
|
-
element2 = Ext.get(id);
|
542
|
-
|
543
|
-
expect(element2 instanceof Ext.dom.Element).toBe(true);
|
544
|
-
});
|
545
|
-
|
546
|
-
it("should encapsulate the dom element in the Ext.dom.Element", function() {
|
547
|
-
element2 = Ext.get(id);
|
548
|
-
|
549
|
-
expect(element2.dom).toBe(domEl2);
|
550
|
-
});
|
551
|
-
|
552
|
-
it("should add element to Ext.cache", function() {
|
553
|
-
element2 = Ext.get(id);
|
554
|
-
|
555
|
-
expect(Ext.dom.Element.addToCache).toHaveBeenCalledWith(element2);
|
556
|
-
});
|
557
|
-
});
|
558
|
-
|
559
|
-
describe("with a dom element which is already encapsulated", function() {
|
560
|
-
it("should return the corresponding Ext.Element", function() {
|
561
|
-
expect(Ext.get(domEl)).toBe(element);
|
562
|
-
});
|
563
|
-
|
564
|
-
it("should not add element to Ext.cache if it is already in", function() {
|
565
|
-
Ext.get(domEl);
|
566
|
-
|
567
|
-
expect(Ext.dom.Element.addToCache).not.toHaveBeenCalled();
|
568
|
-
});
|
569
|
-
});
|
570
|
-
});
|
571
|
-
|
572
|
-
describe("passing dom element as first argument", function() {
|
573
|
-
describe("with a dom element which is not already encapsulated", function() {
|
574
|
-
it("should return a new Ext.dom.Element", function() {
|
575
|
-
element2 = Ext.get(domEl2);
|
576
|
-
|
577
|
-
expect(element2 instanceof Ext.dom.Element).toBe(true);
|
578
|
-
});
|
579
|
-
|
580
|
-
it("should encapsulate the dom element in the Ext.dom.Element", function() {
|
581
|
-
element2 = Ext.get(domEl2);
|
582
|
-
|
583
|
-
expect(element2.dom).toBe(domEl2);
|
584
|
-
});
|
585
|
-
|
586
|
-
it("should add element to Ext.cache", function() {
|
587
|
-
element2 = Ext.get(domEl2);
|
588
|
-
|
589
|
-
expect(Ext.dom.Element.addToCache).toHaveBeenCalledWith(element2);
|
590
|
-
});
|
591
|
-
});
|
592
|
-
|
593
|
-
describe("with a dom element which is already encapsulated", function() {
|
594
|
-
it("should return the corresponding Ext.Element", function() {
|
595
|
-
expect(Ext.get(domEl.id)).toBe(element);
|
596
|
-
});
|
597
|
-
|
598
|
-
it("should not add element to Ext.cache if it is already in", function() {
|
599
|
-
Ext.get(domEl.id);
|
600
|
-
|
601
|
-
expect(Ext.dom.Element.addToCache).not.toHaveBeenCalled();
|
602
|
-
});
|
603
|
-
});
|
604
|
-
});
|
605
|
-
|
606
|
-
describe("passing an Ext.dom.Element as first argument", function() {
|
607
|
-
it("should return Ext.dom.Element", function() {
|
608
|
-
expect(Ext.get(element)).toBe(element);
|
609
|
-
});
|
610
|
-
});
|
611
|
-
|
612
|
-
describe("passing a CompositeElement as first argument", function() {
|
613
|
-
var compositeElement;
|
614
|
-
|
615
|
-
beforeEach(function() {
|
616
|
-
compositeElement = Ext.select("div");
|
617
|
-
});
|
618
|
-
|
619
|
-
it("should return Ext.dom.Element", function() {
|
620
|
-
expect(Ext.get(compositeElement)).toBe(compositeElement);
|
621
|
-
});
|
622
|
-
});
|
623
|
-
|
624
|
-
describe("passing an array as first argument", function() {
|
625
|
-
it("should call Ext.dom.Element.select", function() {
|
626
|
-
var arr = [domEl, domEl2];
|
627
|
-
spyOn(Ext.dom.Element, "select");
|
628
|
-
|
629
|
-
Ext.get(arr);
|
630
|
-
|
631
|
-
expect(Ext.dom.Element.select).toHaveBeenCalledWith(arr);
|
632
|
-
});
|
633
|
-
});
|
634
|
-
|
635
|
-
describe("passing document as first argument", function() {
|
636
|
-
it("should return an Ext.dom.Element", function() {
|
637
|
-
expect(Ext.get(document) instanceof Ext.dom.Element).toBe(true);
|
638
|
-
});
|
639
|
-
|
640
|
-
xit("should return a bogus Ext.dom.Element", function() {
|
641
|
-
expect(Ext.get(document).id).not.toBeDefined();
|
642
|
-
});
|
643
|
-
|
644
|
-
it("should return an Ext.dom.Element that encapsulate document", function() {
|
645
|
-
expect(Ext.get(document).dom).toBe(document);
|
646
|
-
});
|
647
|
-
});
|
648
|
-
});
|
649
|
-
|
650
|
-
xdescribe("garbageCollector", function() {
|
651
|
-
|
652
|
-
});
|
653
|
-
|
654
|
-
describe("fly", function() {
|
655
|
-
var flyWeight;
|
656
|
-
|
657
|
-
beforeEach(function() {
|
658
|
-
spyOn(Ext, "getDom").andCallThrough();
|
659
|
-
|
660
|
-
});
|
661
|
-
|
662
|
-
describe("global flyweight", function() {
|
663
|
-
beforeEach(function() {
|
664
|
-
flyWeight = Ext.fly(domEl2);
|
665
|
-
});
|
666
|
-
|
667
|
-
it("should return an Ext.dom.Element.Fly", function() {
|
668
|
-
expect(flyWeight instanceof Ext.dom.AbstractElement.Fly).toBe(true);
|
669
|
-
});
|
670
|
-
|
671
|
-
it("should not cache a dom element", function() {
|
672
|
-
expect(Ext.cache[domEl2.id]).toBeUndefined();
|
673
|
-
});
|
674
|
-
|
675
|
-
it("should call Ext.getDom", function() {
|
676
|
-
expect(Ext.getDom).toHaveBeenCalledWith(domEl2);
|
677
|
-
});
|
678
|
-
|
679
|
-
it("should create a one time reference", function() {
|
680
|
-
expect(Ext.dom.AbstractElement._flyweights._global).toEqual(flyWeight);
|
681
|
-
});
|
682
|
-
});
|
683
|
-
|
684
|
-
describe("named reusable flyweight", function() {
|
685
|
-
beforeEach(function() {
|
686
|
-
flyWeight = Ext.fly(domEl2, "myflyweight");
|
687
|
-
});
|
688
|
-
|
689
|
-
it("should return an Ext.dom.Element.Flyweight", function() {
|
690
|
-
expect(flyWeight instanceof Ext.dom.AbstractElement.Fly).toBe(true);
|
691
|
-
});
|
692
|
-
|
693
|
-
it("should not cache a dom element", function() {
|
694
|
-
expect(Ext.cache[domEl2.id]).toBeUndefined();
|
695
|
-
});
|
696
|
-
|
697
|
-
it("should call Ext.getDom", function() {
|
698
|
-
expect(Ext.getDom).toHaveBeenCalledWith(domEl2);
|
699
|
-
});
|
700
|
-
|
701
|
-
it("should create a one time reference", function() {
|
702
|
-
expect(Ext.dom.AbstractElement._flyweights.myflyweight).toEqual(flyWeight);
|
703
|
-
});
|
704
|
-
});
|
705
|
-
});
|
706
|
-
|
707
|
-
describe("aliases", function() {
|
708
|
-
it("should aliases Ext.dom.Element.get with Ext.get", function() {
|
709
|
-
spyOn(Ext.dom.Element, 'get');
|
710
|
-
Ext.get();
|
711
|
-
expect(Ext.dom.Element.get).toHaveBeenCalled();
|
712
|
-
});
|
713
|
-
|
714
|
-
it("should aliases Ext.Element fly with Ext.fly", function() {
|
715
|
-
spyOn(Ext.dom.AbstractElement, 'fly');
|
716
|
-
Ext.fly();
|
717
|
-
expect(Ext.dom.AbstractElement.fly).toHaveBeenCalled();
|
718
|
-
});
|
719
|
-
});
|
720
|
-
});
|
721
|
-
|
722
|
-
describe("getXY", function(){
|
723
|
-
var unAttached;
|
724
|
-
beforeEach(function(){
|
725
|
-
unAttached = document.createElement('div');
|
726
|
-
});
|
727
|
-
it("should not throw when reading unattached element", function(){
|
728
|
-
Ext.fly(unAttached).getXY();
|
729
|
-
});
|
730
|
-
});
|
731
|
-
}, "/src/dom/Element.js");
|