Author: teflon114
Date: Sun Sep 14 11:52:39 2008
New Revision: 83
Added:
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/adapter/
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/adapter/ext-base.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/adapter/jquery-bridge.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/adapter/prototype-bridge.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/adapter/yui-bridge.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/core/
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/core/CompositeElement.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/core/DomHelper.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/core/DomQuery.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/core/Element.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/core/EventManager.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/core/Ext.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/core/Fx.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/core/Template.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/core/UpdateManager.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/data/
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/data/ArrayReader.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/data/Connection.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/data/DataField.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/data/DataProxy.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/data/DataReader.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/data/GroupingStore.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/data/HttpProxy.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/data/JsonReader.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/data/JsonStore.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/data/MemoryProxy.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/data/Record.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/data/ScriptTagProxy.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/data/SimpleStore.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/data/SortTypes.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/data/Store.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/data/StoreMgr.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/data/Tree.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/data/XmlReader.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/dd/
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/dd/DDCore.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/dd/DragSource.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/dd/DragTracker.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/dd/DragZone.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/dd/DropTarget.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/dd/DropZone.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/dd/Registry.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/dd/ScrollManager.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/dd/StatusProxy.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/debug.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/locale/
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/locale/ext-lang-af.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/locale/ext-lang-bg.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/locale/ext-lang-ca.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/locale/ext-lang-cs.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/locale/ext-lang-da.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/locale/ext-lang-de.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/locale/ext-lang-el_GR.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/locale/ext-lang-en.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/locale/ext-lang-en_UK.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/locale/ext-lang-es.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/locale/ext-lang-fa.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/locale/ext-lang-fr.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/locale/ext-lang-fr_CA.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/locale/ext-lang-gr.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/locale/ext-lang-he.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/locale/ext-lang-hr.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/locale/ext-lang-hu.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/locale/ext-lang-id.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/locale/ext-lang-it.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/locale/ext-lang-ja.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/locale/ext-lang-ko.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/locale/ext-lang-lt.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/locale/ext-lang-lv.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/locale/ext-lang-mk.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/locale/ext-lang-nl.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/locale/ext-lang-no_NB.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/locale/ext-lang-no_NN.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/locale/ext-lang-pl.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/locale/ext-lang-pt.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/locale/ext-lang-pt_BR.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/locale/ext-lang-ro.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/locale/ext-lang-ru.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/locale/ext-lang-sk.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/locale/ext-lang-sl.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/locale/ext-lang-sr.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/locale/ext-lang-sr_RS.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/locale/ext-lang-sv_SE.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/locale/ext-lang-th.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/locale/ext-lang-tr.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/locale/ext-lang-ukr.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/locale/ext-lang-vn.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/locale/ext-lang-zh_CN.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/locale/ext-lang-zh_TW.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/state/
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/state/CookieProvider.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/state/Provider.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/state/StateManager.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/util/
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/util/CSS.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/util/ClickRepeater.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/util/Date.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/util/DelayedTask.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/util/Format.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/util/History.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/util/JSON.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/util/KeyMap.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/util/KeyNav.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/util/MixedCollection.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/util/Observable.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/util/TaskMgr.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/util/TextMetrics.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/util/XTemplate.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/Action.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/BoxComponent.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/Button.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/ColorPalette.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/Component.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/ComponentMgr.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/Container.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/CycleButton.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/DataView.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/DatePicker.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/Editor.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/Layer.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/LoadMask.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/MessageBox.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/PagingToolbar.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/Panel.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/PanelDD.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/ProgressBar.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/Resizable.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/Shadow.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/Slider.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/SplitBar.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/SplitButton.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/StatusBar.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/TabPanel.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/Toolbar.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/Viewport.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/Window.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/WindowManager.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/form/
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/form/Action.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/form/BasicForm.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/form/Checkbox.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/form/CheckboxGroup.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/form/Combo.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/form/DateField.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/form/Field.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/form/FieldSet.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/form/Form.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/form/Hidden.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/form/HtmlEditor.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/form/Label.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/form/NumberField.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/form/Radio.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/form/RadioGroup.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/form/TextArea.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/form/TextField.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/form/TimeField.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/form/TriggerField.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/form/VTypes.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/grid/
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/grid/AbstractSelectionModel.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/grid/CellSelectionModel.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/grid/CheckboxSelectionModel.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/grid/ColumnDD.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/grid/ColumnModel.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/grid/ColumnSplitDD.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/grid/EditorGrid.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/grid/GridDD.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/grid/GridEditor.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/grid/GridPanel.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/grid/GridView.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/grid/GroupingView.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/grid/PropertyGrid.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/grid/RowNumberer.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/grid/RowSelectionModel.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/layout/
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/layout/AbsoluteLayout.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/layout/AccordionLayout.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/layout/AnchorLayout.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/layout/BorderLayout.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/layout/CardLayout.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/layout/ColumnLayout.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/layout/ContainerLayout.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/layout/FitLayout.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/layout/FormLayout.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/layout/TableLayout.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/menu/
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/menu/Adapter.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/menu/BaseItem.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/menu/CheckItem.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/menu/ColorItem.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/menu/ColorMenu.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/menu/DateItem.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/menu/DateMenu.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/menu/Item.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/menu/Menu.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/menu/MenuMgr.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/menu/Separator.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/menu/TextItem.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/tips/
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/tips/QuickTip.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/tips/QuickTips.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/tips/Tip.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/tips/ToolTip.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/tree/
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/tree/AsyncTreeNode.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/tree/TreeDragZone.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/tree/TreeDropZone.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/tree/TreeEditor.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/tree/TreeEventModel.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/tree/TreeFilter.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/tree/TreeLoader.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/tree/TreeNode.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/tree/TreeNodeUI.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/tree/TreePanel.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/tree/TreeSelectionModel.js
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/widgets/tree/TreeSorter.js
Removed:
trunk/ExtJS2Parser/ExtJS2Parser/ext-2.1/
Modified:
trunk/CHANGELOG.txt
trunk/ExtJS2Parser/ExtJS2Parser.sln
trunk/ExtJS2Parser/ExtJS2Parser/Components/ExtConfig.cs
trunk/ExtJS2Parser/ExtJS2Parser/Components/ExtProperty.cs
trunk/ExtJS2Parser/ExtJS2Parser/SourceConverter.cs
trunk/ExtJS2Parser/ExtSharp/ExtSharp.csproj
Log:
* Updated ExtSharp to use ExtJS 2.2
* Updated ExtJS2Parser solution to VS2008
Modified: trunk/CHANGELOG.txt
==============================================================================
--- trunk/CHANGELOG.txt (original)
+++ trunk/CHANGELOG.txt Sun Sep 14 11:52:39 2008
@@ -1,3 +1,7 @@
+09/14/2008 - teflon
+* Updated ExtSharp to use ExtJS 2.2
+* Updated ExtJS2Parser solution to VS2008
+
06/21/2008 - teflon
* Fixed a bug introduced in ExtJS 2.1
- the problem occured when ExtJS called String.format in the
Date.formatCodeToRegex() function.
Modified: trunk/ExtJS2Parser/ExtJS2Parser.sln
==============================================================================
--- trunk/ExtJS2Parser/ExtJS2Parser.sln (original)
+++ trunk/ExtJS2Parser/ExtJS2Parser.sln Sun Sep 14 11:52:39 2008
@@ -1,22 +1,11 @@

-Microsoft Visual Studio Solution File, Format Version 9.00
-# Visual Studio 2005
+Microsoft Visual Studio Solution File, Format Version 10.00
+# Visual Studio 2008
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}")
= "ExtJS2Parser", "ExtJS2Parser\ExtJS2Parser.csproj", "{B7059AE3-DA23-47E5-93E7-FDBEF009E4A3}"
- ProjectSection(WebsiteProperties) = preProject
- Debug.AspNetCompiler.Debug = "True"
- Release.AspNetCompiler.Debug = "False"
- EndProjectSection
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}")
= "ExtSharp", "ExtSharp\ExtSharp.csproj", "{66530ECC-B564-4F33-A297-0E96189E64B6}"
- ProjectSection(WebsiteProperties) = preProject
- Debug.AspNetCompiler.Debug = "True"
- Release.AspNetCompiler.Debug = "False"
- EndProjectSection
EndProject
Global
- GlobalSection(TextTemplating) = postSolution
- TextTemplating = 1
- EndGlobalSection
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
@@ -31,5 +20,8 @@
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(TextTemplating) = postSolution
+ TextTemplating = 1
EndGlobalSection
EndGlobal
Modified: trunk/ExtJS2Parser/ExtJS2Parser/Components/ExtConfig.cs
==============================================================================
--- trunk/ExtJS2Parser/ExtJS2Parser/Components/ExtConfig.cs (original)
+++ trunk/ExtJS2Parser/ExtJS2Parser/Components/ExtConfig.cs Sun Sep 14
11:52:39 2008
@@ -90,6 +90,8 @@
// Ext.BasicForm bug
if (config.Name == "fileUpload.") config.Name
= "fileUpload";
+ // bad syntax in Ext.grid.GridPanel
+ if (config.Name.StartsWith("<p>")) config.Name =
config.Name.Substring(3);
ec.Configs.Add(config);
Modified: trunk/ExtJS2Parser/ExtJS2Parser/Components/ExtProperty.cs
==============================================================================
--- trunk/ExtJS2Parser/ExtJS2Parser/Components/ExtProperty.cs (original)
+++ trunk/ExtJS2Parser/ExtJS2Parser/Components/ExtProperty.cs Sun Sep 14
11:52:39 2008
@@ -131,6 +131,9 @@
// Ext.BasicForm bug
if (ep.Name == "fileUpload.") ep.Name = "fileUpload";
+ if (ep.Name == "store" && ec.Name == "ComboBox") ep.Type
= "Ext.data.Store";
+ // bad syntax in Ext.grid.GridPanel
+ if (ep.Name.StartsWith("<p>")) ep.Name = ep.Name.Substring(3);
ec.Properties.AddProperty(ep);
}
Modified: trunk/ExtJS2Parser/ExtJS2Parser/SourceConverter.cs
==============================================================================
--- trunk/ExtJS2Parser/ExtJS2Parser/SourceConverter.cs (original)
+++ trunk/ExtJS2Parser/ExtJS2Parser/SourceConverter.cs Sun Sep 14 11:52:39
2008
@@ -9,7 +9,7 @@
public static bool ShowDoc = true;
// these paths are relative to \bin\Debug\ dirsxa
- private readonly string SourcePath = @"..\..\ext-2.1\";
+ private readonly string SourcePath = @"..\..\ext-2.2\";
private readonly string OutputPath = @"..\..\..\ExtSharp\";
public static string CRLF = Environment.NewLine;
public static char[] CRLFA = Environment.NewLine.ToCharArray();
Added: trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/adapter/ext-base.js
==============================================================================
--- (empty file)
+++ trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/adapter/ext-base.js Sun Sep 14
11:52:39 2008
@@ -0,0 +1,2189 @@
+/*
+ * Ext JS Library 2.2
+ * Copyright(c) 2006-2008, Ext JS, LLC.
+ *
lice...@extjs.com
+ *
+ *
http://extjs.com/license
+ */
+
+(function() {
+ var libFlyweight;
+
+ Ext.lib.Dom = {
+ getViewWidth : function(full) {
+ return full ? this.getDocumentWidth() :
this.getViewportWidth();
+ },
+
+ getViewHeight : function(full) {
+ return full ? this.getDocumentHeight() :
this.getViewportHeight();
+ },
+
+ getDocumentHeight: function() {
+ var scrollHeight = (document.compatMode != "CSS1Compat") ?
document.body.scrollHeight : document.documentElement.scrollHeight;
+ return Math.max(scrollHeight, this.getViewportHeight());
+ },
+
+ getDocumentWidth: function() {
+ var scrollWidth = (document.compatMode != "CSS1Compat") ?
document.body.scrollWidth : document.documentElement.scrollWidth;
+ return Math.max(scrollWidth, this.getViewportWidth());
+ },
+
+ getViewportHeight: function(){
+ if(Ext.isIE){
+ return Ext.isStrict ?
document.documentElement.clientHeight :
+ document.body.clientHeight;
+ }else{
+ return self.innerHeight;
+ }
+ },
+
+ getViewportWidth: function() {
+ if(Ext.isIE){
+ return Ext.isStrict ?
document.documentElement.clientWidth :
+ document.body.clientWidth;
+ }else{
+ return self.innerWidth;
+ }
+ },
+
+ isAncestor : function(p, c) {
+ p = Ext.getDom(p);
+ c = Ext.getDom(c);
+ if (!p || !c) {
+ return false;
+ }
+
+ if (p.contains && !Ext.isSafari) {
+ return p.contains(c);
+ } else if (p.compareDocumentPosition) {
+ return !!(p.compareDocumentPosition(c) & 16);
+ } else {
+ var parent = c.parentNode;
+ while (parent) {
+ if (parent == p) {
+ return true;
+ }
+ else if (!parent.tagName ||
parent.tagName.toUpperCase() == "HTML") {
+ return false;
+ }
+ parent = parent.parentNode;
+ }
+ return false;
+ }
+ },
+
+ getRegion : function(el) {
+ return Ext.lib.Region.getRegion(el);
+ },
+
+ getY : function(el) {
+ return this.getXY(el)[1];
+ },
+
+ getX : function(el) {
+ return this.getXY(el)[0];
+ },
+
+
+ getXY : function(el) {
+ var p, pe, b, scroll, bd = (document.body ||
document.documentElement);
+ el = Ext.getDom(el);
+
+ if(el == bd){
+ return [0, 0];
+ }
+
+ if (el.getBoundingClientRect) {
+ b = el.getBoundingClientRect();
+ scroll = fly(document).getScroll();
+ return [b.left + scroll.left, b.top + scroll.top];
+ }
+ var x = 0, y = 0;
+
+ p = el;
+
+ var hasAbsolute = fly(el).getStyle("position") == "absolute";
+
+ while (p) {
+
+ x += p.offsetLeft;
+ y += p.offsetTop;
+
+ if (!hasAbsolute && fly(p).getStyle("position")
== "absolute") {
+ hasAbsolute = true;
+ }
+
+ if (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]);
+ }
+ };
+
+/*
+ * 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.Event = function() {
+ var loadComplete = false;
+ var listeners = [];
+ var unloadListeners = [];
+ var retryCount = 0;
+ var onAvailStack = [];
+ var counter = 0;
+ var lastError = null;
+
+ return {
+ POLL_RETRYS: 200,
+ POLL_INTERVAL: 20,
+ EL: 0,
+ TYPE: 1,
+ FN: 2,
+ WFN: 3,
+ OBJ: 3,
+ ADJ_SCOPE: 4,
+ _interval: null,
+
+ startInterval: function() {
+ if (!this._interval) {
+ var self = this;
+ var callback = function() {
+ self._tryPreloadAttach();
+ };
+ this._interval = setInterval(callback,
this.POLL_INTERVAL);
+
+ }
+ },
+
+ onAvailable: function(p_id, p_fn, p_obj, p_override) {
+ onAvailStack.push({ id: p_id,
+ fn: p_fn,
+ obj: p_obj,
+ override: p_override,
+ checkReady: false });
+
+ retryCount = this.POLL_RETRYS;
+ this.startInterval();
+ },
+
+
+ addListener: function(el, eventName, fn) {
+ el = Ext.getDom(el);
+ if (!el || !fn) {
+ return false;
+ }
+
+ if ("unload" == eventName) {
+ unloadListeners[unloadListeners.length] =
+ [el, eventName, fn];
+ return true;
+ }
+
+ // prevent unload errors with simple check
+ var wrappedFn = function(e) {
+ return typeof Ext != 'undefined' ?
fn(Ext.lib.Event.getEvent(e)) : false;
+ };
+
+ var li = [el, eventName, fn, wrappedFn];
+
+ var index = listeners.length;
+ listeners[index] = li;
+
+ this.doAdd(el, eventName, wrappedFn, false);
+ return true;
+
+ },
+
+
+ removeListener: function(el, eventName, fn) {
+ var i, len;
+
+ el = Ext.getDom(el);
+
+ if(!fn) {
+ return this.purgeElement(el, false, eventName);
+ }
+
+
+ if ("unload" == eventName) {
+
+ for (i = 0,len = unloadListeners.length; i < len; i++)
{
+ var li = unloadListeners[i];
+ if (li &&
+ li[0] == el &&
+ li[1] == eventName &&
+ li[2] == fn) {
+ unloadListeners.splice(i, 1);
+ return true;
+ }
+ }
+
+ return false;
+ }
+
+ var cacheItem = null;
+
+
+ var index = arguments[3];
+
+ if ("undefined" == typeof index) {
+ index = this._getCacheIndex(el, eventName, fn);
+ }
+
+ if (index >= 0) {
+ cacheItem = listeners[index];
+ }
+
+ if (!el || !cacheItem) {
+ return false;
+ }
+
+ this.doRemove(el, eventName, cacheItem[this.WFN], false);
+
+ delete listeners[index][this.WFN];
+ delete listeners[index][this.FN];
+ listeners.splice(index, 1);
+
+ return true;
+
+ },
+
+
+ getTarget: function(ev, resolveTextNode) {
+ ev = ev.browserEvent || ev;
+ var t = ev.target || ev.srcElement;
+ return this.resolveTextNode(t);
+ },
+
+
+ resolveTextNode: function(node) {
+ if (Ext.isSafari && node && 3 == node.nodeType) {
+ return node.parentNode;
+ } else {
+ return node;
+ }
+ },
+
+
+ getPageX: function(ev) {
+ ev = ev.browserEvent || ev;
+ var x = ev.pageX;
+ if (!x && 0 !== x) {
+ x = ev.clientX || 0;
+
+ if (Ext.isIE) {
+ x += this.getScroll()[1];
+ }
+ }
+
+ return x;
+ },
+
+
+ getPageY: function(ev) {
+ ev = ev.browserEvent || ev;
+ var y = ev.pageY;
+ if (!y && 0 !== y) {
+ y = ev.clientY || 0;
+
+ if (Ext.isIE) {
+ y += this.getScroll()[0];
+ }
+ }
+
+
+ return y;
+ },
+
+
+ getXY: function(ev) {
+ ev = ev.browserEvent || ev;
+ return [this.getPageX(ev), this.getPageY(ev)];
+ },
+
+
+ getRelatedTarget: function(ev) {
+ ev = ev.browserEvent || ev;
+ var t = ev.relatedTarget;
+ if (!t) {
+ if (ev.type == "mouseout") {
+ t = ev.toElement;
+ } else if (ev.type == "mouseover") {
+ t = ev.fromElement;
+ }
+ }
+
+ return this.resolveTextNode(t);
+ },
+
+
+ getTime: function(ev) {
+ ev = ev.browserEvent || ev;
+ if (!ev.time) {
+ var t = new Date().getTime();
+ try {
+ ev.time = t;
+ } catch(ex) {
+ this.lastError = ex;
+ return t;
+ }
+ }
+
+ return ev.time;
+ },
+
+
+ stopEvent: function(ev) {
+ this.stopPropagation(ev);
+ this.preventDefault(ev);
+ },
+
+
+ stopPropagation: function(ev) {
+ ev = ev.browserEvent || ev;
+ if (ev.stopPropagation) {
+ ev.stopPropagation();
+ } else {
+ ev.cancelBubble = true;
+ }
+ },
+
+
+ preventDefault: function(ev) {
+ ev = ev.browserEvent || ev;
+ if(ev.preventDefault) {
+ ev.preventDefault();
+ } else {
+ ev.returnValue = false;
+ }
+ },
+
+
+ getEvent: function(e) {
+ var ev = e || window.event;
+ if (!ev) {
+ var c = this.getEvent.caller;
+ while (c) {
+ ev = c.arguments[0];
+ if (ev && Event == ev.constructor) {
+ break;
+ }
+ c = c.caller;
+ }
+ }
+ return ev;
+ },
+
+
+ getCharCode: function(ev) {
+ ev = ev.browserEvent || ev;
+ return ev.charCode || ev.keyCode || 0;
+ },
+
+
+ _getCacheIndex: function(el, eventName, fn) {
+ for (var i = 0,len = listeners.length; i < len; ++i) {
+ var li = listeners[i];
+ if (li &&
+ li[this.FN] == fn &&
+ li[this.EL] == el &&
+ li[this.TYPE] == eventName) {
+ return i;
+ }
+ }
+
+ return -1;
+ },
+
+
+ elCache: {},
+
+
+ getEl: function(id) {
+ return document.getElementById(id);
+ },
+
+
+ clearCache: function() {
+ },
+
+
+ _load: function(e) {
+ loadComplete = true;
+ var EU = Ext.lib.Event;
+
+
+ if (Ext.isIE) {
+ EU.doRemove(window, "load", EU._load);
+ }
+ },
+
+
+ _tryPreloadAttach: function() {
+
+ if (this.locked) {
+ return false;
+ }
+
+ this.locked = true;
+
+
+ var tryAgain = !loadComplete;
+ if (!tryAgain) {
+ tryAgain = (retryCount > 0);
+ }
+
+
+ var notAvail = [];
+ for (var i = 0,len = onAvailStack.length; i < len; ++i) {
+ var item = onAvailStack[i];
+ if (item) {
+ var el = this.getEl(
item.id);
+
+ if (el) {
+ if (!item.checkReady ||
+ loadComplete ||
+ el.nextSibling ||
+ (document && document.body)) {
+
+ var scope = el;
+ if (item.override) {
+ if (item.override === true) {
+ scope = item.obj;
+ } else {
+ scope = item.override;
+ }
+ }
+ item.fn.call(scope, item.obj);
+ onAvailStack[i] = null;
+ }
+ } else {
+ notAvail.push(item);
+ }
+ }
+ }
+
+ retryCount = (notAvail.length === 0) ? 0 : retryCount - 1;
+
+ if (tryAgain) {
+
+ this.startInterval();
+ } else {
+ clearInterval(this._interval);
+ this._interval = null;
+ }
+
+ this.locked = false;
+
+ return true;
+
+ },
+
+
+ purgeElement: function(el, recurse, eventName) {
+ var elListeners = this.getListeners(el, eventName);
+ if (elListeners) {
+ for (var i = 0,len = elListeners.length; i < len; ++i)
{
+ var l = elListeners[i];
+ this.removeListener(el, l.type, l.fn);
+ }
+ }
+
+ if (recurse && el && el.childNodes) {
+ for (i = 0,len = el.childNodes.length; i < len; ++i) {
+ this.purgeElement(el.childNodes[i], recurse,
eventName);
+ }
+ }
+ },
+
+
+ getListeners: function(el, eventName) {
+ var results = [], searchLists;
+ if (!eventName) {
+ searchLists = [listeners, unloadListeners];
+ } else if (eventName == "unload") {
+ searchLists = [unloadListeners];
+ } else {
+ searchLists = [listeners];
+ }
+
+ for (var j = 0; j < searchLists.length; ++j) {
+ var searchList = searchLists[j];
+ if (searchList && searchList.length > 0) {
+ for (var i = 0,len = searchList.length; i < len;
++i) {
+ var l = searchList[i];
+ if (l && l[this.EL] === el &&
+ (!eventName || eventName ===
l[this.TYPE])) {
+ results.push({
+ type: l[this.TYPE],
+ fn: l[this.FN],
+ obj: l[this.OBJ],
+ adjust: l[this.ADJ_SCOPE],
+ index: i
+ });
+ }
+ }
+ }
+ }
+
+ return (results.length) ? results : null;
+ },
+
+
+ _unload: function(e) {
+
+ var EU = Ext.lib.Event, i, j, l, len, index;
+
+ for (i = 0,len = unloadListeners.length; i < len; ++i) {
+ l = unloadListeners[i];
+ if (l) {
+ var scope = window;
+ if (l[EU.ADJ_SCOPE]) {
+ if (l[EU.ADJ_SCOPE] === true) {
+ scope = l[EU.OBJ];
+ } else {
+ scope = l[EU.ADJ_SCOPE];
+ }
+ }
+ l[EU.FN].call(scope, EU.getEvent(e), l[EU.OBJ]);
+ unloadListeners[i] = null;
+ l = null;
+ scope = null;
+ }
+ }
+
+ unloadListeners = null;
+
+ if (listeners && listeners.length > 0) {
+ j = listeners.length;
+ while (j) {
+ index = j - 1;
+ l = listeners[index];
+ if (l) {
+ EU.removeListener(l[EU.EL], l[EU.TYPE],
+ l[EU.FN], index);
+ }
+ j = j - 1;
+ }
+ l = null;
+
+ EU.clearCache();
+ }
+
+ EU.doRemove(window, "unload", EU._unload);
+
+ },
+
+
+ getScroll: function() {
+ var dd = document.documentElement, db = document.body;
+ if (dd && (dd.scrollTop || dd.scrollLeft)) {
+ return [dd.scrollTop, dd.scrollLeft];
+ } else if (db) {
+ return [db.scrollTop, db.scrollLeft];
+ } else {
+ return [0, 0];
+ }
+ },
+
+
+ doAdd: function () {
+ if (window.addEventListener) {
+ return function(el, eventName, fn, capture) {
+ el.addEventListener(eventName, fn, (capture));
+ };
+ } else if (window.attachEvent) {
+ return function(el, eventName, fn, capture) {
+ el.attachEvent("on" + eventName, fn);
+ };
+ } else {
+ return function() {
+ };
+ }
+ }(),
+
+
+ doRemove: function() {
+ if (window.removeEventListener) {
+ return function (el, eventName, fn, capture) {
+ el.removeEventListener(eventName, fn, (capture));
+ };
+ } else if (window.detachEvent) {
+ return function (el, eventName, fn) {
+ el.detachEvent("on" + eventName, fn);
+ };
+ } else {
+ return function() {
+ };
+ }
+ }()
+ };
+
+ }();
+
+ var E = Ext.lib.Event;
+ E.on = E.addListener;
+ E.un = E.removeListener;
+ if(document && document.body) {
+ E._load();
+ } else {
+ E.doAdd(window, "load", E._load);
+ }
+ E.doAdd(window, "unload", E._unload);
+ E._tryPreloadAttach();
+
+ 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)){
+ this.initHeader(h, hs[h], false);
+ }
+ }
+ }
+ if(options.xmlData){
+ if (!hs || !hs['Content-Type']){
+ this.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']){
+
this.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 this.asyncRequest(method, uri, cb, data);
+ },
+
+ serializeForm : function(form) {
+ if(typeof form == 'string') {
+ form = (document.getElementById(form) ||
document.forms[form]);
+ }
+
+ var el, name, val, disabled, data = '', hasSubmit = false;
+ for (var i = 0; i < form.elements.length; i++) {
+ el = form.elements[i];
+ disabled = form.elements[i].disabled;
+ name = form.elements[i].name;
+ val = form.elements[i].value;
+
+ if (!disabled && name){
+ switch (el.type)
+ {
+ case 'select-one':
+ case 'select-multiple':
+ for (var j = 0; j < el.options.length; j++) {
+ if (el.options[j].selected) {
+ if (Ext.isIE) {
+ data += encodeURIComponent(name)
+ '=' + encodeURIComponent(el.options[j].attributes['value'].specified ?
el.options[j].value : el.options[j].text) + '&';
+ }
+ else {
+ data += encodeURIComponent(name)
+ '=' + encodeURIComponent(el.options[j].hasAttribute('value') ?
el.options[j].value : el.options[j].text) + '&';
+ }
+ }
+ }
+ break;
+ case 'radio':
+ case 'checkbox':
+ if (el.checked) {
+ data += encodeURIComponent(name) + '=' +
encodeURIComponent(val) + '&';
+ }
+ break;
+ case 'file':
+
+ case undefined:
+
+ case 'reset':
+
+ case 'button':
+
+ break;
+ case 'submit':
+ if(hasSubmit == false) {
+ data += encodeURIComponent(name) + '=' +
encodeURIComponent(val) + '&';
+ hasSubmit = true;
+ }
+ break;
+ default:
+ data += encodeURIComponent(name) + '=' +
encodeURIComponent(val) + '&';
+ break;
+ }
+ }
+ }
+ data = data.substr(0, data.length - 1);
+ return data;
+ },
+
+ headers:{},
+
+ hasHeaders:false,
+
+ useDefaultHeader:true,
+
+ defaultPostHeader:'application/x-www-form-urlencoded;
charset=UTF-8',
+
+ useDefaultXhrHeader:true,
+
+ defaultXhrHeader:'XMLHttpRequest',
+
+ hasDefaultHeaders:true,
+
+ defaultHeaders:{},
+
+ poll:{},
+
+ timeout:{},
+
+ pollInterval:50,
+
+ transactionId:0,
+
+ setProgId:function(id)
+ {
+ this.activeX.unshift(id);
+ },
+
+ setDefaultPostHeader:function(b)
+ {
+ this.useDefaultHeader = b;
+ },
+
+ setDefaultXhrHeader:function(b)
+ {
+ this.useDefaultXhrHeader = b;
+ },
+
+ setPollingInterval:function(i)
+ {
+ if (typeof i == 'number' && isFinite(i)) {
+ this.pollInterval = i;
+ }
+ },
+
+ createXhrObject:function(transactionId)
+ {
+ var obj,http;
+ try
+ {
+
+ http = new XMLHttpRequest();
+
+ obj = { conn:http, tId:transactionId };
+ }
+ catch(e)
+ {
+ for (var i = 0; i < this.activeX.length; ++i) {
+ try
+ {
+
+ http = new ActiveXObject(this.activeX[i]);
+
+ obj = { conn:http, tId:transactionId };
+ break;
+ }
+ catch(e) {
+ }
+ }
+ }
+ finally
+ {
+ return obj;
+ }
+ },
+
+ getConnectionObject:function()
+ {
+ var o;
+ var tId = this.transactionId;
+
+ try
+ {
+ o = this.createXhrObject(tId);
+ if (o) {
+ this.transactionId++;
+ }
+ }
+ catch(e) {
+ }
+ finally
+ {
+ return o;
+ }
+ },
+
+ asyncRequest:function(method, uri, callback, postData)
+ {
+ var o = this.getConnectionObject();
+
+ if (!o) {
+ return null;
+ }
+ else {
+ o.conn.open(method, uri, true);
+
+ if (this.useDefaultXhrHeader) {
+ if (!this.defaultHeaders['X-Requested-With']) {
+ this.initHeader('X-Requested-With',
this.defaultXhrHeader, true);
+ }
+ }
+
+ if(postData && this.useDefaultHeader && (!this.hasHeaders |
| !this.headers['Content-Type'])){
+ this.initHeader('Content-Type',
this.defaultPostHeader);
+ }
+
+ if (this.hasDefaultHeaders || this.hasHeaders) {
+ this.setHeader(o);
+ }
+
+ this.handleReadyState(o, callback);
+ o.conn.send(postData || null);
+
+ return o;
+ }
+ },
+
+ handleReadyState:function(o, callback)
+ {
+ var oConn = this;
+
+ if (callback && callback.timeout) {
+ this.timeout[o.tId] = window.setTimeout(function() {
+ oConn.abort(o, callback, true);
+ }, callback.timeout);
+ }
+
+ this.poll[o.tId] = window.setInterval(
+ function() {
+ if (o.conn && o.conn.readyState == 4) {
+ window.clearInterval(oConn.poll[o.tId]);
+ delete oConn.poll[o.tId];
+
+ if (callback && callback.timeout) {
+ window.clearTimeout(oConn.timeout[o.tId]);
+ delete oConn.timeout[o.tId];
+ }
+
+ oConn.handleTransactionResponse(o, callback);
+ }
+ }
+ , this.pollInterval);
+ },
+
+ handleTransactionResponse:function(o, callback, isAbort)
+ {
+
+ if (!callback) {
+ this.releaseObject(o);
+ return;
+ }
+
+ var httpStatus, responseObject;
+
+ try
+ {
+ if (o.conn.status !== undefined && o.conn.status != 0) {
+ httpStatus = o.conn.status;
+ }
+ else {
+ httpStatus = 13030;
+ }
+ }
+ catch(e) {
+
+
+ httpStatus = 13030;
+ }
+
+ if (httpStatus >= 200 && httpStatus < 300) {
+ responseObject = this.createResponseObject(o,
callback.argument);
+ if (callback.success) {
+ if (!callback.scope) {
+ callback.success(responseObject);
+ }
+ else {
+
+
+ callback.success.apply(callback.scope,
[responseObject]);
+ }
+ }
+ }
+ else {
+ switch (httpStatus) {
+
+ case 12002:
+ case 12029:
+ case 12030:
+ case 12031:
+ case 12152:
+ case 13030:
+ responseObject = this.createExceptionObject(o.tId,
callback.argument, (isAbort ? isAbort : false));
+ if (callback.failure) {
+ if (!callback.scope) {
+ callback.failure(responseObject);
+ }
+ else {
+ callback.failure.apply(callback.scope,
[responseObject]);
+ }
+ }
+ break;
+ default:
+ responseObject = this.createResponseObject(o,
callback.argument);
+ if (callback.failure) {
+ if (!callback.scope) {
+ callback.failure(responseObject);
+ }
+ else {
+ callback.failure.apply(callback.scope,
[responseObject]);
+ }
+ }
+ }
+ }
+
+ this.releaseObject(o);
+ responseObject = null;
+ },
+
+ createResponseObject:function(o, callbackArg)
+ {
+ var obj = {};
+ var headerObj = {};
+
+ try
+ {
+ var headerStr = o.conn.getAllResponseHeaders();
+ var header = headerStr.split('\n');
+ for (var i = 0; i < header.length; i++) {
+ var delimitPos = header[i].indexOf(':');
+ if (delimitPos != -1) {
+ headerObj[header[i].substring(0, delimitPos)] =
header[i].substring(delimitPos + 2);
+ }
+ }
+ }
+ catch(e) {
+ }
+
+ obj.tId = o.tId;
+ obj.status = o.conn.status;
+ obj.statusText = o.conn.statusText;
+ obj.getResponseHeader = headerObj;
+ obj.getAllResponseHeaders = headerStr;
+ obj.responseText = o.conn.responseText;
+ obj.responseXML = o.conn.responseXML;
+
+ if (typeof callbackArg !== undefined) {
+ obj.argument = callbackArg;
+ }
+
+ return obj;
+ },
+
+ createExceptionObject:function(tId, callbackArg, isAbort)
+ {
+ var COMM_CODE = 0;
+ var COMM_ERROR = 'communication failure';
+ var ABORT_CODE = -1;
+ var ABORT_ERROR = 'transaction aborted';
+
+ var obj = {};
+
+ obj.tId = tId;
+ if (isAbort) {
+ obj.status = ABORT_CODE;
+ obj.statusText = ABORT_ERROR;
+ }
+ else {
+ obj.status = COMM_CODE;
+ obj.statusText = COMM_ERROR;
+ }
+
+ if (callbackArg) {
+ obj.argument = callbackArg;
+ }
+
+ return obj;
+ },
+
+ initHeader:function(label, value, isDefault)
+ {
+ var headerObj = (isDefault) ? this.defaultHeaders :
this.headers;
+
+ if (headerObj[label] === undefined) {
+ headerObj[label] = value;
+ }
+ else {
+
+
+ headerObj[label] = value + "," + headerObj[label];
+ }
+
+ if (isDefault) {
+ this.hasDefaultHeaders = true;
+ }
+ else {
+ this.hasHeaders = true;
+ }
+ },
+
+
+ setHeader:function(o)
+ {
+ if (this.hasDefaultHeaders) {
+ for (var prop in this.defaultHeaders) {
+ if (this.defaultHeaders.hasOwnProperty(prop)) {
+ o.conn.setRequestHeader(prop,
this.defaultHeaders[prop]);
+ }
+ }
+ }
+
+ if (this.hasHeaders) {
+ for (var prop in this.headers) {
+ if (this.headers.hasOwnProperty(prop)) {
+ o.conn.setRequestHeader(prop, this.headers[prop]);
+ }
+ }
+ this.headers = {};
+ this.hasHeaders = false;
+ }
+ },
+
+ resetDefaultHeaders:function() {
+ delete this.defaultHeaders;
+ this.defaultHeaders = {};
+ this.hasDefaultHeaders = false;
+ },
+
+ abort:function(o, callback, isTimeout)
+ {
+ if (this.isCallInProgress(o)) {
+ o.conn.abort();
+ window.clearInterval(this.poll[o.tId]);
+ delete this.poll[o.tId];
+ if (isTimeout) {
+ delete this.timeout[o.tId];
+ }
+
+ this.handleTransactionResponse(o, callback, true);
+
+ return true;
+ }
+ else {
+ return false;
+ }
+ },
+
+
+ isCallInProgress:function(o)
+ {
+
+
+ if (o.conn) {
+ return o.conn.readyState != 4 && o.conn.readyState != 0;
+ }
+ else {
+
+ return false;
+ }
+ },
+
+
+ releaseObject:function(o)
+ {
+
+ o.conn = null;
+
+ o = null;
+ },
+
+ activeX:[
+ 'MSXML2.XMLHTTP.3.0',
+ 'MSXML2.XMLHTTP',
+ 'Microsoft.XMLHTTP'
+ ]
+
+
+ };
+
+
+ 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();
+
+
+ Ext.lib.Anim = {
+ scroll : function(el, args, duration, easing, cb, scope) {
+ return this.run(el, args, duration, easing, cb, scope,
Ext.lib.Scroll);
+ },
+
+ motion : function(el, args, duration, easing, cb, scope) {
+ return this.run(el, args, duration, easing, cb, scope,
Ext.lib.Motion);
+ },
+
+ color : function(el, args, duration, easing, cb, scope) {
+ return this.run(el, args, duration, easing, cb, scope,
Ext.lib.ColorAnim);
+ },
+
+ run : function(el, args, duration, easing, cb, scope, type) {
+ type = type || Ext.lib.AnimBase;
+ if (typeof easing == "string") {
+ easing = Ext.lib.Easing[easing];
+ }
+ var anim = new type(el, args, duration, easing);
+ anim.animateX(function() {
+ Ext.callback(cb, scope);
+ });
+ return anim;
+ }
+ };
+
+
+ function fly(el) {
+ if (!libFlyweight) {
+ libFlyweight = new Ext.Element.Flyweight();
+ }
+ libFlyweight.dom = el;
+ return libFlyweight;
+ }
+
+
+ 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);
+ }
+
+ Ext.lib.AnimBase = function(el, attributes, duration, method) {
+ if (el) {
+ this.init(el, attributes, duration, method);
+ }
+ };
+
+ Ext.lib.AnimBase.prototype = {
+
+ toString: function() {
+ var el = this.getEl();
+ var id =
el.id || el.tagName;
+ return ("Anim " + id);
+ },
+
+ patterns: {
+ noNegatives: /width|height|opacity|padding/i,
+ offsetAttribute: /^((width|height)|(top|left))$/,
+ defaultUnit: /width|height|top$|bottom$|left$|right$/i,
+ offsetUnit: /\d+(em|%|en|ex|pt|in|cm|mm|pc)$/i
+ },
+
+
+ doMethod: function(attr, start, end) {
+ return this.method(this.currentFrame, start, end - start,
this.totalFrames);
+ },
+
+
+ setAttribute: function(attr, val, unit) {
+ if (this.patterns.noNegatives.test(attr)) {
+ val = (val > 0) ? val : 0;
+ }
+
+ Ext.fly(this.getEl(), '_anim').setStyle(attr, val + unit);
+ },
+
+
+ getAttribute: function(attr) {
+ var el = this.getEl();
+ var val = fly(el).getStyle(attr);
+
+ if (val !== 'auto' && !this.patterns.offsetUnit.test(val)) {
+ return parseFloat(val);
+ }
+
+ var a = this.patterns.offsetAttribute.exec(attr) || [];
+ var pos = !!( a[3] );
+ var box = !!( a[2] );
+
+
+ if (box || (fly(el).getStyle('position') == 'absolute' &&
pos)) {
+ val = el['offset' + a[0].charAt(0).toUpperCase() +
a[0].substr(1)];
+ } else {
+ val = 0;
+ }
+
+ return val;
+ },
+
+
+ getDefaultUnit: function(attr) {
+ if (this.patterns.defaultUnit.test(attr)) {
+ return 'px';
+ }
+
+ return '';
+ },
+
+ animateX : function(callback, scope) {
+ var f = function() {
+ this.onComplete.removeListener(f);
+ if (typeof callback == "function") {
+ callback.call(scope || this, this);
+ }
+ };
+ this.onComplete.addListener(f, this);
+ this.animate();
+ },
+
+
+ setRuntimeAttribute: function(attr) {
+ var start;
+ var end;
+ var attributes = this.attributes;
+
+ this.runtimeAttributes[attr] = {};
+
+ var isset = function(prop) {
+ return (typeof prop !== 'undefined');
+ };
+
+ if (!isset(attributes[attr]['to'])
&& !isset(attributes[attr]['by'])) {
+ return false;
+ }
+
+ start = ( isset(attributes[attr]['from']) ) ?
attributes[attr]['from'] : this.getAttribute(attr);
+
+
+ if (isset(attributes[attr]['to'])) {
+ end = attributes[attr]['to'];
+ } else if (isset(attributes[attr]['by'])) {
+ if (start.constructor == Array) {
+ end = [];
+ for (var i = 0, len = start.length; i < len; ++i) {
+ end[i] = start[i] + attributes[attr]['by'][i];
+ }
+ } else {
+ end = start + attributes[attr]['by'];
+ }
+ }
+
+ this.runtimeAttributes[attr].start = start;
+ this.runtimeAttributes[attr].end = end;
+
+
+ this.runtimeAttributes[attr].unit = (
isset(attributes[attr].unit) ) ? attributes[attr]['unit'] :
this.getDefaultUnit(attr);
+ },
+
+
+ init: function(el, attributes, duration, method) {
+
+ var isAnimated = false;
+
+
+ var startTime = null;
+
+
+ var actualFrames = 0;
+
+
+ el = Ext.getDom(el);
+
+
+ this.attributes = attributes || {};
+
+
+ this.duration = duration || 1;
+
+
+ this.method = method || Ext.lib.Easing.easeNone;
+
+
+ this.useSeconds = true;
+
+
+ this.currentFrame = 0;
+
+
+ this.totalFrames = Ext.lib.AnimMgr.fps;
+
+
+ this.getEl = function() {
+ return el;
+ };
+
+
+ this.isAnimated = function() {
+ return isAnimated;
+ };
+
+
+ this.getStartTime = function() {
+ return startTime;
+ };
+
+ this.runtimeAttributes = {};
+
+
+ this.animate = function() {
+ if (this.isAnimated()) {
+ return false;
+ }
+
+ this.currentFrame = 0;
+
+ this.totalFrames = ( this.useSeconds ) ?
Math.ceil(Ext.lib.AnimMgr.fps * this.duration) : this.duration;
+
+ Ext.lib.AnimMgr.registerElement(this);
+ };
+
+
+ this.stop = function(finish) {
+ if (finish) {
+ this.currentFrame = this.totalFrames;
+ this._onTween.fire();
+ }
+ Ext.lib.AnimMgr.stop(this);
+ };
+
+ var onStart = function() {
+ this.onStart.fire();
+
+ this.runtimeAttributes = {};
+ for (var attr in this.attributes) {
+ this.setRuntimeAttribute(attr);
+ }
+
+ isAnimated = true;
+ actualFrames = 0;
+ startTime = new Date();
+ };
+
+
+ var onTween = function() {
+ var data = {
+ duration: new Date() - this.getStartTime(),
+ currentFrame: this.currentFrame
+ };
+
+ data.toString = function() {
+ return (
+ 'duration: ' + data.duration +
+ ', currentFrame: ' + data.currentFrame
+ );
+ };
+
+ this.onTween.fire(data);
+
+ var runtimeAttributes = this.runtimeAttributes;
+
+ for (var attr in runtimeAttributes) {
+ this.setAttribute(attr, this.doMethod(attr,
runtimeAttributes[attr].start, runtimeAttributes[attr].end),
runtimeAttributes[attr].unit);
+ }
+
+ actualFrames += 1;
+ };
+
+ var onComplete = function() {
+ var actual_duration = (new Date() - startTime) / 1000 ;
+
+ var data = {
+ duration: actual_duration,
+ frames: actualFrames,
+ fps: actualFrames / actual_duration
+ };
+
+ data.toString = function() {
+ return (
+ 'duration: ' + data.duration +
+ ', frames: ' + data.frames +
+ ', fps: ' + data.fps
+ );
+ };
+
+ isAnimated = false;
+ actualFrames = 0;
+ this.onComplete.fire(data);
+ };
+
+
+ this._onStart = new Ext.util.Event(this);
+ this.onStart = new Ext.util.Event(this);
+ this.onTween = new Ext.util.Event(this);
+ this._onTween = new Ext.util.Event(this);
+ this.onComplete = new Ext.util.Event(this);
+ this._onComplete = new Ext.util.Event(this);
+ this._onStart.addListener(onStart);
+ this._onTween.addListener(onTween);
+ this._onComplete.addListener(onComplete);
+ }
+ };
+
+
+ Ext.lib.AnimMgr = new function() {
+
+ var thread = null;
+
+
+ var queue = [];
+
+
+ var tweenCount = 0;
+
+
+ this.fps = 1000;
+
+
+ this.delay = 1;
+
+
+ this.registerElement = function(tween) {
+ queue[queue.length] = tween;
+ tweenCount += 1;
+ tween._onStart.fire();
+ this.start();
+ };
+
+
+ this.unRegister = function(tween, index) {
+ tween._onComplete.fire();
+ index = index || getIndex(tween);
+ if (index != -1) {
+ queue.splice(index, 1);
+ }
+
+ tweenCount -= 1;
+ if (tweenCount <= 0) {
+ this.stop();
+ }
+ };
+
+
+ this.start = function() {
+ if (thread === null) {
+ thread = setInterval(this.run, this.delay);
+ }
+ };
+
+
+ this.stop = function(tween) {
+ if (!tween) {
+ clearInterval(thread);
+
+ for (var i = 0, len = queue.length; i < len; ++i) {
+ if (queue[0].isAnimated()) {
+ this.unRegister(queue[0], 0);
+ }
+ }
+
+ queue = [];
+ thread = null;
+ tweenCount = 0;
+ }
+ else {
+ this.unRegister(tween);
+ }
+ };
+
+
+ this.run = function() {
+ for (var i = 0, len = queue.length; i < len; ++i) {
+ var tween = queue[i];
+ if (!tween || !tween.isAnimated()) {
+ continue;
+ }
+
+ if (tween.currentFrame < tween.totalFrames ||
tween.totalFrames === null)
+ {
+ tween.currentFrame += 1;
+
+ if (tween.useSeconds) {
+ correctFrame(tween);
+ }
+ tween._onTween.fire();
+ }
+ else {
+ Ext.lib.AnimMgr.stop(tween, i);
+ }
+ }
+ };
+
+ var getIndex = function(anim) {
+ for (var i = 0, len = queue.length; i < len; ++i) {
+ if (queue[i] == anim) {
+ return i;
+ }
+ }
+ return -1;
+ };
+
+
+ var correctFrame = function(tween) {
+ var frames = tween.totalFrames;
+ var frame = tween.currentFrame;
+ var expected = (tween.currentFrame * tween.duration * 1000 /
tween.totalFrames);
+ var elapsed = (new Date() - tween.getStartTime());
+ var tweak = 0;
+
+ if (elapsed < tween.duration * 1000) {
+ tweak = Math.round((elapsed / expected - 1) *
tween.currentFrame);
+ } else {
+ tweak = frames - (frame + 1);
+ }
+ if (tweak > 0 && isFinite(tweak)) {
+ if (tween.currentFrame + tweak >= frames) {
+ tweak = frames - (frame + 1);
+ }
+
+ tween.currentFrame += tweak;
+ }
+ };
+ };
+
+ Ext.lib.Bezier = new function() {
+
+ this.getPosition = function(points, t) {
+ var n = points.length;
+ var tmp = [];
+
+ for (var i = 0; i < n; ++i) {
+ tmp[i] = [points[i][0], points[i][1]];
+ }
+
+ for (var j = 1; j < n; ++j) {
+ for (i = 0; i < n - j; ++i) {
+ tmp[i][0] = (1 - t) * tmp[i][0] + t * tmp[parseInt(i +
1, 10)][0];
+ tmp[i][1] = (1 - t) * tmp[i][1] + t * tmp[parseInt(i +
1, 10)][1];
+ }
+ }
+
+ return [ tmp[0][0], tmp[0][1] ];
+
+ };
+ };
+ (function() {
+
+ Ext.lib.ColorAnim = function(el, attributes, duration, method) {
+ Ext.lib.ColorAnim.superclass.constructor.call(this, el,
attributes, duration, method);
+ };
+
+ Ext.extend(Ext.lib.ColorAnim, Ext.lib.AnimBase);
+
+
+ var Y = Ext.lib;
+ var superclass = Y.ColorAnim.superclass;
+ var proto = Y.ColorAnim.prototype;
+
+ proto.toString = function() {
+ var el = this.getEl();
+ var id =
el.id || el.tagName;
+ return ("ColorAnim " + id);
+ };
+
+ proto.patterns.color = /color$/i;
+ proto.patterns.rgb =
/^rgb\(([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\)$/i;
+ proto.patterns.hex =
/^#?([0-9A-F]{2})([0-9A-F]{2})([0-9A-F]{2})$/i;
+ proto.patterns.hex3 =
/^#?([0-9A-F]{1})([0-9A-F]{1})([0-9A-F]{1})$/i;
+ proto.patterns.transparent = /^transparent|rgba\(0, 0, 0, 0\)$/;
+
+
+ proto.parseColor = function(s) {
+ if (s.length == 3) {
+ return s;
+ }
+
+ var c = this.patterns.hex.exec(s);
+ if (c && c.length == 4) {
+ return [ parseInt(c[1], 16), parseInt(c[2], 16),
parseInt(c[3], 16) ];
+ }
+
+ c = this.patterns.rgb.exec(s);
+ if (c && c.length == 4) {
+ return [ parseInt(c[1], 10), parseInt(c[2], 10),
parseInt(c[3], 10) ];
+ }
+
+ c = this.patterns.hex3.exec(s);
+ if (c && c.length == 4) {
+ return [ parseInt(c[1] + c[1], 16), parseInt(c[2] + c[2],
16), parseInt(c[3] + c[3], 16) ];
+ }
+
+ return null;
+ };
+
+ proto.getAttribute = function(attr) {
+ var el = this.getEl();
+ if (this.patterns.color.test(attr)) {
+ var val = fly(el).getStyle(attr);
+
+ if (this.patterns.transparent.test(val)) {
+ var parent = el.parentNode;
+ val = fly(parent).getStyle(attr);
+
+ while (parent && this.patterns.transparent.test(val)) {
+ parent = parent.parentNode;
+ val = fly(parent).getStyle(attr);
+ if (parent.tagName.toUpperCase() == 'HTML') {
+ val = '#fff';
+ }
+ }
+ }
+ } else {
+ val = superclass.getAttribute.call(this, attr);
+ }
+
+ return val;
+ };
+
+ proto.doMethod = function(attr, start, end) {
+ var val;
+
+ if (this.patterns.color.test(attr)) {
+ val = [];
+ for (var i = 0, len = start.length; i < len; ++i) {
+ val[i] = superclass.doMethod.call(this, attr,
start[i], end[i]);
+ }
+
+ val = 'rgb(' + Math.floor(val[0]) + ',' +
Math.floor(val[1]) + ',' + Math.floor(val[2]) + ')';
+ }
+ else {
+ val = superclass.doMethod.call(this, attr, start, end);
+ }
+
+ return val;
+ };
+
+ proto.setRuntimeAttribute = function(attr) {
+ superclass.setRuntimeAttribute.call(this, attr);
+
+ if (this.patterns.color.test(attr)) {
+ var attributes = this.attributes;
+ var start =
this.parseColor(this.runtimeAttributes[attr].start);
+ var end =
this.parseColor(this.runtimeAttributes[attr].end);
+
+ if (typeof attributes[attr]['to'] === 'undefined' &&
typeof attributes[attr]['by'] !== 'undefined') {
+ end = this.parseColor(attributes[attr].by);
+
+ for (var i = 0, len = start.length; i < len; ++i) {
+ end[i] = start[i] + end[i];
+ }
+ }
+
+ this.runtimeAttributes[attr].start = start;
+ this.runtimeAttributes[attr].end = end;
+ }
+ };
+ })();
+
+
+ Ext.lib.Easing = {
+
+
+ easeNone: function (t, b, c, d) {
+ return c * t / d + b;
+ },
+
+
+ easeIn: function (t, b, c, d) {
+ return c * (t /= d) * t + b;
+ },
+
+
+ easeOut: function (t, b, c, d) {
+ return -c * (t /= d) * (t - 2) + b;
+ },
+
+
+ easeBoth: function (t, b, c, d) {
+ if ((t /= d / 2) < 1) {
+ return c / 2 * t * t + b;
+ }
+
+ return -c / 2 * ((--t) * (t - 2) - 1) + b;
+ },
+
+
+ easeInStrong: function (t, b, c, d) {
+ return c * (t /= d) * t * t * t + b;
+ },
+
+
+ easeOutStrong: function (t, b, c, d) {
+ return -c * ((t = t / d - 1) * t * t * t - 1) + b;
+ },
+
+
+ easeBothStrong: function (t, b, c, d) {
+ if ((t /= d / 2) < 1) {
+ return c / 2 * t * t * t * t + b;
+ }
+
+ return -c / 2 * ((t -= 2) * t * t * t - 2) + b;
+ },
+
+
+
+ elasticIn: function (t, b, c, d, a, p) {
+ if (t == 0) {
+ return b;
+ }
+ if ((t /= d) == 1) {
+ return b + c;
+ }
+ if (!p) {
+ p = d * .3;
+ }
+
+ if (!a || a < Math.abs(c)) {
+ a = c;
+ var s = p / 4;
+ }
+ else {
+ var s = p / (2 * Math.PI) * Math.asin(c / a);
+ }
+
+ return -(a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * d - s)
* (2 * Math.PI) / p)) + b;
+ },
+
+
+ elasticOut: function (t, b, c, d, a, p) {
+ if (t == 0) {
+ return b;
+ }
+ if ((t /= d) == 1) {
+ return b + c;
+ }
+ if (!p) {
+ p = d * .3;
+ }
+
+ if (!a || a < Math.abs(c)) {
+ a = c;
+ var s = p / 4;
+ }
+ else {
+ var s = p / (2 * Math.PI) * Math.asin(c / a);
+ }
+
+ return a * Math.pow(2, -10 * t) * Math.sin((t * d - s) * (2 *
Math.PI) / p) + c + b;
+ },
+
+
+ elasticBoth: function (t, b, c, d, a, p) {
+ if (t == 0) {
+ return b;
+ }
+
+ if ((t /= d / 2) == 2) {
+ return b + c;
+ }
+
+ if (!p) {
+ p = d * (.3 * 1.5);
+ }
+
+ if (!a || a < Math.abs(c)) {
+ a = c;
+ var s = p / 4;
+ }
+ else {
+ var s = p / (2 * Math.PI) * Math.asin(c / a);
+ }
+
+ if (t < 1) {
+ return -.5 * (a * Math.pow(2, 10 * (t -= 1)) *
+ Math.sin((t * d - s) * (2 * Math.PI) / p)) +
b;
+ }
+ return a * Math.pow(2, -10 * (t -= 1)) *
+ Math.sin((t * d - s) * (2 * Math.PI) / p) * .5 + c + b;
+ },
+
+
+
+ backIn: function (t, b, c, d, s) {
+ if (typeof s == 'undefined') {
+ s = 1.70158;
+ }
+ return c * (t /= d) * t * ((s + 1) * t - s) + b;
+ },
+
+
+ backOut: function (t, b, c, d, s) {
+ if (typeof s == 'undefined') {
+ s = 1.70158;
+ }
+ return c * ((t = t / d - 1) * t * ((s + 1) * t + s) + 1) + b;
+ },
+
+
+ backBoth: function (t, b, c, d, s) {
+ if (typeof s == 'undefined') {
+ s = 1.70158;
+ }
+
+ if ((t /= d / 2 ) < 1) {
+ return c / 2 * (t * t * (((s *= (1.525)) + 1) * t - s)) +
b;
+ }
+ return c / 2 * ((t -= 2) * t * (((s *= (1.525)) + 1) * t + s)
+ 2) + b;
+ },
+
+
+ bounceIn: function (t, b, c, d) {
+ return c - Ext.lib.Easing.bounceOut(d - t, 0, c, d) + b;
+ },
+
+
+ bounceOut: function (t, b, c, d) {
+ if ((t /= d) < (1 / 2.75)) {
+ return c * (7.5625 * t * t) + b;
+ } else if (t < (2 / 2.75)) {
+ return c * (7.5625 * (t -= (1.5 / 2.75)) * t + .75) + b;
+ } else if (t < (2.5 / 2.75)) {
+ return c * (7.5625 * (t -= (2.25 / 2.75)) * t + .9375) + b;
+ }
+ return c * (7.5625 * (t -= (2.625 / 2.75)) * t + .984375) + b;
+ },
+
+
+ bounceBoth: function (t, b, c, d) {
+ if (t < d / 2) {
+ return Ext.lib.Easing.bounceIn(t * 2, 0, c, d) * .5 + b;
+ }
+ return Ext.lib.Easing.bounceOut(t * 2 - d, 0, c, d) * .5 + c
* .5 + b;
+ }
+ };
+
+ (function() {
+ Ext.lib.Motion = function(el, attributes, duration, method) {
+ if (el) {
+ Ext.lib.Motion.superclass.constructor.call(this, el,
attributes, duration, method);
+ }
+ };
+
+ Ext.extend(Ext.lib.Motion, Ext.lib.ColorAnim);
+
+
+ var Y = Ext.lib;
+ var superclass = Y.Motion.superclass;
+ var proto = Y.Motion.prototype;
+
+ proto.toString = function() {
+ var el = this.getEl();
+ var id =
el.id || el.tagName;
+ return ("Motion " + id);
+ };
+
+ proto.patterns.points = /^points$/i;
+
+ proto.setAttribute = function(attr, val, unit) {
+ if (this.patterns.points.test(attr)) {
+ unit = unit || 'px';
+ superclass.setAttribute.call(this, 'left', val[0], unit);
+ superclass.setAttribute.call(this, 'top', val[1], unit);
+ } else {
+ superclass.setAttribute.call(this, attr, val, unit);
+ }
+ };
+
+ proto.getAttribute = function(attr) {
+ if (this.patterns.points.test(attr)) {
+ var val = [
+ superclass.getAttribute.call(this, 'left'),
+ superclass.getAttribute.call(this, 'top')
+ ];
+ } else {
+ val = superclass.getAttribute.call(this, attr);
+ }
+
+ return val;
+ };
+
+ proto.doMethod = function(attr, start, end) {
+ var val = null;
+
+ if (this.patterns.points.test(attr)) {
+ var t = this.method(this.currentFrame, 0, 100,
this.totalFrames) / 100;
+ val = Y.Bezier.getPosition(this.runtimeAttributes[attr],
t);
+ } else {
+ val = superclass.doMethod.call(this, attr, start, end);
+ }
+ return val;
+ };
+
+ proto.setRuntimeAttribute = function(attr) {
+ if (this.patterns.points.test(attr)) {
+ var el = this.getEl();
+ var attributes = this.attributes;
+ var start;
+ var control = attributes['points']['control'] || [];
+ var end;
+ var i, len;
+
+ if (control.length > 0 && !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();
+
+ if (isset(attributes['points']['from'])) {
+ Ext.lib.Dom.setXY(el, attributes['points']['from']);
+ }
+ else {
+ Ext.lib.Dom.setXY(el, Ext.lib.Dom.getXY(el));
+ }
+
+ start = this.getAttribute('points');
+
+
+ if (isset(attributes['points']['to'])) {
+ end = translateValues.call(this,
attributes['points']['to'], start);
+
+ var pageXY = Ext.lib.Dom.getXY(this.getEl());
+ for (i = 0,len = control.length; i < len; ++i) {
+ control[i] = translateValues.call(this,
control[i], start);
+ }
+
+
+ } else if (isset(attributes['points']['by'])) {
+ end = [ start[0] + attributes['points']['by'][0],
start[1] + attributes['points']['by'][1] ];
+
+ for (i = 0,len = control.length; i < len; ++i) {
+ control[i] = [ start[0] + control[i][0], start[1]
+ control[i][1] ];
+ }
+ }
+
+ this.runtimeAttributes[attr] = [start];
+
+ if (control.length > 0) {
+ this.runtimeAttributes[attr] =
this.runtimeAttributes[attr].concat(control);
+ }
+
+
this.runtimeAttributes[attr][this.runtimeAttributes[attr].length] = end;
+ }
+ else {
+ superclass.setRuntimeAttribute.call(this, attr);
+ }
+ };
+
+ var translateValues = function(val, start) {
+ var pageXY = Ext.lib.Dom.getXY(this.getEl());
+ val = [ val[0] - pageXY[0] + start[0], val[1] - pageXY[1] +
start[1] ];
+
+ return val;
+ };
+
+ var isset = function(prop) {
+ return (typeof prop !== 'undefined');
+ };
+ })();
+
+
+ (function() {
+ Ext.lib.Scroll = function(el, attributes, duration, method) {
+ if (el) {
+ Ext.lib.Scroll.superclass.constructor.call(this, el,
attributes, duration, method);
+ }
+ };
+
+ Ext.extend(Ext.lib.Scroll, Ext.lib.ColorAnim);
+
+
+ var Y = Ext.lib;
+ var superclass = Y.Scroll.superclass;
+ var proto = Y.Scroll.prototype;
+
+ proto.toString = function() {
+ var el = this.getEl();
+ var id =
el.id || el.tagName;
+ return ("Scroll " + id);
+ };
+
+ proto.doMethod = function(attr, start, end) {
+ var val = null;
+
+ if (attr == 'scroll') {
+ val = [
+ this.method(this.currentFrame, start[0], end[0] -
start[0], this.totalFrames),
+ this.method(this.currentFrame, start[1], end[1] -
start[1], this.totalFrames)
+ ];
+
+ } else {
+ val = superclass.doMethod.call(this, attr, start, end);
+ }
+ return val;
+ };
+
+ proto.getAttribute = function(attr) {
+ var val = null;
+ var el = this.getEl();
+
+ if (attr == 'scroll') {
+ val = [ el.scrollLeft, el.scrollTop ];
+ } else {
+ val = superclass.getAttribute.call(this, attr);
+ }
+
+ return val;
+ };
+
+ proto.setAttribute = function(attr, val, unit) {
+ var el = this.getEl();
+
+ if (attr == 'scroll') {
+ el.scrollLeft = val[0];
+ el.scrollTop = val[1];
+ } else {
+ superclass.setAttribute.call(this, attr, val, unit);
+ }
+ };
+ })();
+
+
+})();
\ No newline at end of file
Added: trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/adapter/jquery-bridge.js
==============================================================================
--- (empty file)
+++ trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/adapter/jquery-bridge.js Sun
Sep 14 11:52:39 2008
@@ -0,0 +1,541 @@
+/*
+ * Ext JS Library 2.2
+ * Copyright(c) 2006-2008, Ext JS, LLC.
+ *
lice...@extjs.com
+ *
+ *
http://extjs.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){
+ p = Ext.getDom(p);
+ c = Ext.getDom(c);
+ if (!p || !c) {return false;}
+
+ if(p.contains && !Ext.isSafari) {
+ return p.contains(c);
+ }else if(p.compareDocumentPosition) {
+ return !!(p.compareDocumentPosition(c) & 16);
+ }else{
+ var parent = c.parentNode;
+ while (parent) {
+ if (parent == p) {
+ return true;
+ }
+ else if (!parent.tagName || parent.tagName.toUpperCase()
== "HTML") {
+ return false;
+ }
+ parent = parent.parentNode;
+ }
+ return false;
+ }
+ },
+
+ getRegion : function(el){
+ return 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 [b.left + scroll.left, b.top + scroll.top];
+ }
+ var x = 0, y = 0;
+
+ p = el;
+
+ var hasAbsolute = fly(el).getStyle("position") == "absolute";
+
+ while (p) {
+
+ x += p.offsetLeft;
+ y += p.offsetTop;
+
+ if (!hasAbsolute && fly(p).getStyle("position") == "absolute")
{
+ hasAbsolute = true;
+ }
+
+ if (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: function(node) {
+ if (node && 3 == node.nodeType) {
+ return node.parentNode;
+ } else {
+ return 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, {
+ responseText: xhr.responseText,
+ responseXML : xhr.responseXML,
+ argument: cb.argument
+ });
+ }else if(cb.success){
+ cb.success.call(cb.scope||window, {
+ responseText: xhr.responseText,
+ responseXML : xhr.responseXML,
+ argument: cb.argument
+ });
+ }
+ };
+ };
+ 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){
+ if(args[k].from){
+ if(k != 'points'){
+ e.setStyle(k, args[k].from);
+ }
+ }
+ 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;
+ break;
+ case 'height':
+ o.height =
args.height.to;
+ break;
+ case 'opacity':
+ o.opacity =
args.opacity.to;
+ break;
+ case 'left':
+ o.left =
args.left.to;
+ break;
+ case 'top':
+ o.top =
args.top.to;
+ break;
+ default:
+ o[k] = args[k].to;
+ 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
Added: trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/adapter/prototype-bridge.js
==============================================================================
--- (empty file)
+++ trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/adapter/prototype-bridge.js Sun
Sep 14 11:52:39 2008
@@ -0,0 +1,548 @@
+/*
+ * Ext JS Library 2.2
+ * Copyright(c) 2006-2008, Ext JS, LLC.
+ *
lice...@extjs.com
+ *
+ *
http://extjs.com/license
+ */
+
+(function(){
+
+var libFlyweight;
+
+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?
+ p = Ext.getDom(p);
+ c = Ext.getDom(c);
+ if (!p || !c) {return false;}
+
+ if(p.contains && !Ext.isSafari) {
+ return p.contains(c);
+ }else if(p.compareDocumentPosition) {
+ return !!(p.compareDocumentPosition(c) & 16);
+ }else{
+ var parent = c.parentNode;
+ while (parent) {
+ if (parent == p) {
+ return true;
+ }
+ else if (!parent.tagName || parent.tagName.toUpperCase()
== "HTML") {
+ return false;
+ }
+ parent = parent.parentNode;
+ }
+ return false;
+ }
+ },
+
+ getRegion : function(el){
+ return 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 [b.left + scroll.left, b.top + scroll.top];
+ }
+ var x = 0, y = 0;
+
+ p = el;
+
+ var hasAbsolute = fly(el).getStyle("position") == "absolute";
+
+ while (p) {
+
+ x += p.offsetLeft;
+ y += p.offsetTop;
+
+ if (!hasAbsolute && fly(p).getStyle("position") == "absolute")
{
+ hasAbsolute = true;
+ }
+
+ if (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: function(node) {
+ if (node && 3 == node.nodeType) {
+ return node.parentNode;
+ } else {
+ return 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){
+ Event.observe(el, eventName, fn, false);
+ },
+
+ un : function(el, eventName, fn){
+ 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, {
+ responseText: xhr.responseText,
+ responseXML : xhr.responseXML,
+ argument: cb.argument
+ });
+ } : Ext.emptyFn;
+ };
+ var createFailure = function(cb){
+ return cb.failure ? function(xhr){
+ cb.failure.call(cb.scope||window, {
+ responseText: xhr.responseText,
+ responseXML : xhr.responseXML,
+ argument: cb.argument
+ });
+ } : Ext.emptyFn;
+ };
+ 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
Added: trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/adapter/yui-bridge.js
==============================================================================
--- (empty file)
+++ trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/adapter/yui-bridge.js Sun Sep
14 11:52:39 2008
@@ -0,0 +1,342 @@
+/*
+ * Ext JS Library 2.2
+ * Copyright(c) 2006-2008, Ext JS, LLC.
+ *
lice...@extjs.com
+ *
+ *
http://extjs.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;
+var D = YAHOO.util.Dom;
+var CN = YAHOO.util.Connect;
+
+var ES = YAHOO.util.Easing;
+var A = YAHOO.util.Anim;
+var libFlyweight;
+
+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 [b.left + scroll.left, b.top + scroll.top];
+ }
+ var x = 0, y = 0;
+
+ p = el;
+
+ var hasAbsolute = fly(el).getStyle("position") == "absolute";
+
+ while (p) {
+
+ x += p.offsetLeft;
+ y += p.offsetTop;
+
+ if (!hasAbsolute && fly(p).getStyle("position") == "absolute")
{
+ hasAbsolute = true;
+ }
+
+ if (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){
+ E.on(el, eventName, fn, scope, override);
+ },
+
+ un : function(el, eventName, fn){
+ 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
Added: trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/core/CompositeElement.js
==============================================================================
--- (empty file)
+++ trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/core/CompositeElement.js Sun
Sep 14 11:52:39 2008
@@ -0,0 +1,371 @@
+/*
+ * Ext JS Library 2.2
+ * Copyright(c) 2006-2008, Ext JS, LLC.
+ *
lice...@extjs.com
+ *
+ *
http://extjs.com/license
+ */
+
+/**
+ * @class Ext.CompositeElement
+ * Standard composite class. Creates a Ext.Element for every element in
the collection.
+ * <br><br>
+ * <b>NOTE: Although they are not listed, this class supports all of the
set/update methods of Ext.Element. All Ext.Element
+ * actions will be performed on all the elements in this collection.</b>
+ * <br><br>
+ * All methods return <i>this</i> and can be chained.
+ <pre><code>
+ var els = 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);
+ </code></pre>
+ */
+Ext.CompositeElement = function(els){
+ this.elements = [];
+ this.addElements(els);
+};
+Ext.CompositeElement.prototype = {
+ isComposite: true,
+ addElements : function(els){
+ if(!els) return this;
+ if(typeof els == "string"){
+ els = Ext.Element.selectorFunction(els);
+ }
+ var yels = this.elements;
+ var index = yels.length-1;
+ for(var i = 0, len = els.length; i < len; i++) {
+ yels[++index] = Ext.get(els[i]);
+ }
+ return this;
+ },
+
+ /**
+ * Clears this composite and adds the elements returned by the passed
selector.
+ * @param {String/Array} els A string CSS selector, an array of
elements or an element
+ * @return {CompositeElement} this
+ */
+ fill : function(els){
+ this.elements = [];
+ this.add(els);
+ return this;
+ },
+
+ /**
+ * Filters this composite to only elements that match the passed
selector.
+ * @param {String} selector A string CSS selector
+ * @return {CompositeElement} this
+ */
+ filter : function(selector){
+ var els = [];
+ this.each(function(el){
+ if(
el.is(selector)){
+ els[els.length] = el.dom;
+ }
+ });
+ this.fill(els);
+ return this;
+ },
+
+ invoke : function(fn, args){
+ var els = this.elements;
+ for(var i = 0, len = els.length; i < len; i++) {
+ Ext.Element.prototype[fn].apply(els[i], args);
+ }
+ return this;
+ },
+ /**
+ * Adds elements to this composite.
+ * @param {String/Array} els A string CSS selector, an array of
elements or an element
+ * @return {CompositeElement} this
+ */
+ add : function(els){
+ if(typeof els == "string"){
+ this.addElements(Ext.Element.selectorFunction(els));
+ }else if(els.length !== undefined){
+ this.addElements(els);
+ }else{
+ this.addElements([els]);
+ }
+ return this;
+ },
+ /**
+ * Calls the passed function passing (el, this, index) for each element
in this composite.
+ * @param {Function} fn The function to call
+ * @param {Object} scope (optional) The <i>this</i> object (defaults to
the element)
+ * @return {CompositeElement} this
+ */
+ each : function(fn, scope){
+ var els = this.elements;
+ for(var i = 0, len = els.length; i < len; i++){
+ if(fn.call(scope || els[i], els[i], this, i) === false) {
+ break;
+ }
+ }
+ return this;
+ },
+
+ /**
+ * Returns the Element object at the specified index
+ * @param {Number} index
+ * @return {Ext.Element}
+ */
+ item : function(index){
+ return this.elements[index] || null;
+ },
+
+ /**
+ * 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.elements.length-1);
+ },
+
+ /**
+ * Returns the number of elements in this composite
+ * @return Number
+ */
+ getCount : function(){
+ return this.elements.length;
+ },
+
+ /**
+ * Returns true if this composite contains the passed element
+ * @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;
+ },
+
+ /**
+ * 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(Ext.get(el));
+ },
+
+
+ /**
+ * Removes the specified element(s).
+ * @param {Mixed} el The id of an element, the Element itself, the
index of the element in this composite
+ * or an array of any of those.
+ * @param {Boolean} removeDom (optional) True to also remove the
element from the document
+ * @return {CompositeElement} this
+ */
+ removeElement : function(el, removeDom){
+ if(Ext.isArray(el)){
+ for(var i = 0, len = el.length; i < len; i++){
+ this.removeElement(el[i]);
+ }
+ return this;
+ }
+ var index = typeof el == 'number' ? el : this.indexOf(el);
+ if(index !== -1 && this.elements[index]){
+ if(removeDom){
+ var d = this.elements[index];
+ if(d.dom){
+ d.remove();
+ }else{
+ Ext.removeNode(d);
+ }
+ }
+ this.elements.splice(index, 1);
+ }
+ return this;
+ },
+
+ /**
+ * 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 = typeof el == 'number' ? el : this.indexOf(el);
+ if(index !== -1){
+ if(domReplace){
+ this.elements[index].replaceWith(replacement);
+ }else{
+ this.elements.splice(index, 1, Ext.get(replacement))
+ }
+ }
+ return this;
+ },
+
+ /**
+ * Removes all elements.
+ */
+ clear : function(){
+ this.elements = [];
+ }
+};
+(function(){
+Ext.CompositeElement.createCall = function(proto, fnName){
+ if(!proto[fnName]){
+ proto[fnName] = function(){
+ return this.invoke(fnName, arguments);
+ };
+ }
+};
+for(var fnName in Ext.Element.prototype){
+ if(typeof Ext.Element.prototype[fnName] == "function"){
+ Ext.CompositeElement.createCall(Ext.CompositeElement.prototype,
fnName);
+ }
+};
+})();
+
+/**
+ * @class Ext.CompositeElementLite
+ * @extends Ext.CompositeElement
+ * Flyweight composite class. Reuses the same Ext.Element for element
operations.
+ <pre><code>
+ 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);
+ </code></pre><br><br>
+ * <b>NOTE: Although they are not listed, this class supports all of the
set/update methods of Ext.Element. All Ext.Element
+ * actions will be performed on all the elements in this collection.</b>
+ */
+Ext.CompositeElementLite = function(els){
+ Ext.CompositeElementLite.superclass.constructor.call(this, els);
+ this.el = new Ext.Element.Flyweight();
+};
+Ext.extend(Ext.CompositeElementLite, Ext.CompositeElement, {
+ addElements : function(els){
+ if(els){
+ if(Ext.isArray(els)){
+ this.elements = this.elements.concat(els);
+ }else{
+ var yels = this.elements;
+ var index = yels.length-1;
+ for(var i = 0, len = els.length; i < len; i++) {
+ yels[++index] = els[i];
+ }
+ }
+ }
+ return this;
+ },
+ invoke : function(fn, args){
+ var els = this.elements;
+ var el = this.el;
+ for(var i = 0, len = els.length; i < len; i++) {
+ el.dom = els[i];
+ Ext.Element.prototype[fn].apply(el, args);
+ }
+ return this;
+ },
+ /**
+ * Returns a flyweight Element of the dom element object at the
specified index
+ * @param {Number} index
+ * @return {Ext.Element}
+ */
+ item : function(index){
+ if(!this.elements[index]){
+ return null;
+ }
+ this.el.dom = this.elements[index];
+ return this.el;
+ },
+
+ // fixes scope with flyweight
+ addListener : function(eventName, handler, scope, opt){
+ var els = this.elements;
+ for(var i = 0, len = els.length; i < len; i++) {
+ Ext.EventManager.on(els[i], eventName, handler, scope ||
els[i], opt);
+ }
+ return this;
+ },
+
+ /**
+ * Calls the passed function passing (el, this, index) for each element
in this composite. <b>The element
+ * passed is the flyweight (shared) Ext.Element instance, so if you
require a
+ * a reference to the dom node, use el.dom.</b>
+ * @param {Function} fn The function to call
+ * @param {Object} scope (optional) The <i>this</i> object (defaults to
the element)
+ * @return {CompositeElement} this
+ */
+ each : function(fn, scope){
+ var els = this.elements;
+ var el = this.el;
+ for(var i = 0, len = els.length; i < len; i++){
+ el.dom = els[i];
+ if(fn.call(scope || el, el, this, i) === false){
+ break;
+ }
+ }
+ return this;
+ },
+
+ indexOf : function(el){
+ return this.elements.indexOf(Ext.getDom(el));
+ },
+
+ replaceElement : function(el, replacement, domReplace){
+ var index = typeof el == 'number' ? el : this.indexOf(el);
+ if(index !== -1){
+ replacement = Ext.getDom(replacement);
+ if(domReplace){
+ var d = this.elements[index];
+ d.parentNode.insertBefore(replacement, d);
+ Ext.removeNode(d);
+ }
+ this.elements.splice(index, 1, replacement);
+ }
+ return this;
+ }
+});
+Ext.CompositeElementLite.prototype.on =
Ext.CompositeElementLite.prototype.addListener;
+if(Ext.DomQuery){
+ Ext.Element.selectorFunction = Ext.DomQuery.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";
+ }
+ if(unique === true){
+ return new Ext.CompositeElement(els);
+ }else{
+ return new Ext.CompositeElementLite(els);
+ }
+};
+/**
+ * Selects elements based on the passed CSS selector to enable working on
them as 1.
+ * @param {String/Array} selector The CSS selector or an array of elements
+ * @param {Boolean} unique (optional) true to create a unique 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
Added: trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/core/DomHelper.js
==============================================================================
--- (empty file)
+++ trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/core/DomHelper.js Sun Sep 14
11:52:39 2008
@@ -0,0 +1,419 @@
+/*
+ * Ext JS Library 2.2
+ * Copyright(c) 2006-2008, Ext JS, LLC.
+ *
lice...@extjs.com
+ *
+ *
http://extjs.com/license
+ */
+
+/**
+ * @class Ext.DomHelper
+ * Utility class for working with DOM and/or Templates. It transparently
supports using HTML fragments or DOM.<br>
+ * This is an example, where an unordered list with 5 children items is
appended to an existing element with id 'my-div':<br>
+ <pre><code>
+var dh = Ext.DomHelper;
+var list = dh.append('my-div', {
+ id: 'my-ul', tag: 'ul', cls: 'my-list', 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'},
+ {tag: 'li', id: 'item3', html: 'List Item 3'},
+ {tag: 'li', id: 'item4', html: 'List Item 4'}
+ ]
+});
+ </code></pre>
+ * <p>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:<pre><code>
+dh.append('my-ul', [
+ {tag: 'li', id: 'item5', html: 'List Item 5'},
+ {tag: 'li', id: 'item6', html: 'List Item 6'} ]);
+</code></pre></p>
+ * <p>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.</p>
+ * For more information and examples, see <a
href="
http://www.jackslocum.com/blog/2006/10/06/domhelper-create-elements-using-dom-html-fragments-or-templates/">the
original blog post</a>.
+ * @singleton
+ */
+Ext.DomHelper = function(){
+ var tempTableEl = null;
+ var emptyTags = /^(?:br|frame|hr|img|input|link|meta|range|spacer|wbr|
area|param|col)$/i;
+ var tableRe = /^table|tbody|tr|td$/i;
+
+ // build as innerHTML where available
+ var createHtml = function(o){
+ if(typeof o == 'string'){
+ return o;
+ }
+ var b = "";
+ if (Ext.isArray(o)) {
+ for (var i = 0, l = o.length; i < l; i++) {
+ b += createHtml(o[i]);
+ }
+ return b;
+ }
+ if(!o.tag){
+ o.tag = "div";
+ }
+ b += "<" + o.tag;
+ for(var attr in o){
+ if(attr == "tag" || attr == "children" || attr == "cn" || attr
== "html" || typeof o[attr] == "function") continue;
+ if(attr == "style"){
+ var s = o["style"];
+ if(typeof s == "function"){
+ s = s.call();
+ }
+ if(typeof s == "string"){
+ b += ' style="' + s + '"';
+ }else if(typeof s == "object"){
+ b += ' style="';
+ for(var key in s){
+ if(typeof s[key] != "function"){
+ b += key + ":" + s[key] + ";";
+ }
+ }
+ b += '"';
+ }
+ }else{
+ if(attr == "cls"){
+ b += ' class="' + o["cls"] + '"';
+ }else if(attr == "htmlFor"){
+ b += ' for="' + o["htmlFor"] + '"';
+ }else{
+ b += " " + attr + '="' + o[attr] + '"';
+ }
+ }
+ }
+ if(emptyTags.test(o.tag)){
+ b += "/>";
+ }else{
+ b += ">";
+ var cn = o.children ||
o.cn;
+ if(cn){
+ b += createHtml(cn);
+ } else if(o.html){
+ b += o.html;
+ }
+ b += "</" + o.tag + ">";
+ }
+ return b;
+ };
+
+ // build as dom
+ /** @ignore */
+ var createDom = function(o, parentNode){
+ var el;
+ if (Ext.isArray(o)) { // Allow Arrays of
siblings to be inserted
+ el = document.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 = document.createTextNode(o);
+ } else {
+ el = document.createElement(o.tag||'div');
+ var useSet = !!el.setAttribute; // In IE some elements don't
have setAttribute
+ for(var attr in o){
+ if(attr == "tag" || attr == "children" || attr == "cn" ||
attr == "html" || attr == "style" || typeof o[attr] == "function") continue;
+ if(attr=="cls"){
+ el.className = o["cls"];
+ }else{
+ if(useSet) el.setAttribute(attr, o[attr]);
+ else el[attr] = o[attr];
+ }
+ }
+ Ext.DomHelper.applyStyles(el, o.style);
+ var cn = o.children ||
o.cn;
+ if(cn){
+ createDom(cn, el);
+ } else if(o.html){
+ el.innerHTML = o.html;
+ }
+ }
+ if(parentNode){
+ parentNode.appendChild(el);
+ }
+ return el;
+ };
+
+ var ieTable = function(depth, s, h, e){
+ tempTableEl.innerHTML = [s, h, e].join('');
+ var i = -1, el = tempTableEl;
+ while(++i < depth){
+ el = el.firstChild;
+ }
+ return el;
+ };
+
+ // kill repeat to save bytes
+ var ts = '<table>',
+ te = '</table>',
+ tbs = ts+'<tbody>',
+ tbe = '</tbody>'+te,
+ trs = tbs + '<tr>',
+ tre = '</tr>'+tbe;
+
+ /**
+ * @ignore
+ * Nasty code for IE's broken table implementation
+ */
+ var insertIntoTable = function(tag, where, el, html){
+ if(!tempTableEl){
+ tempTableEl = document.createElement('div');
+ }
+ var node;
+ var before = null;
+ if(tag == 'td'){
+ if(where == 'afterbegin' || where == 'beforeend'){ // INTO a TD
+ return;
+ }
+ if(where == 'beforebegin'){
+ before = el;
+ el = el.parentNode;
+ } else{
+ before = el.nextSibling;
+ el = el.parentNode;
+ }
+ node = ieTable(4, trs, html, tre);
+ }
+ else if(tag == 'tr'){
+ if(where == 'beforebegin'){
+ before = el;
+ el = el.parentNode;
+ node = ieTable(3, tbs, html, tbe);
+ } else if(where == 'afterend'){
+ before = el.nextSibling;
+ el = el.parentNode;
+ node = ieTable(3, tbs, html, tbe);
+ } else{ // INTO a TR
+ if(where == 'afterbegin'){
+ before = el.firstChild;
+ }
+ node = ieTable(4, trs, html, tre);
+ }
+ } else if(tag == 'tbody'){
+ if(where == 'beforebegin'){
+ before = el;
+ el = el.parentNode;
+ node = ieTable(2, ts, html, te);
+ } else if(where == 'afterend'){
+ before = el.nextSibling;
+ el = el.parentNode;
+ node = ieTable(2, ts, html, te);
+ } else{
+ if(where == 'afterbegin'){
+ before = el.firstChild;
+ }
+ node = ieTable(3, tbs, html, tbe);
+ }
+ } else{ // TABLE
+ if(where == 'beforebegin' || where == 'afterend'){ // OUTSIDE
the table
+ return;
+ }
+ if(where == 'afterbegin'){
+ before = el.firstChild;
+ }
+ node = ieTable(2, ts, html, te);
+ }
+ el.insertBefore(node, before);
+ return node;
+ };
+
+
+ return {
+ /** True to force the use of DOM instead of html fragments @type
Boolean */
+ useDom : false,
+
+ /**
+ * Returns the markup for the passed Element(s) config.
+ * @param {Object} o The DOM object spec (and children)
+ * @return {String}
+ */
+ markup : function(o){
+ return createHtml(o);
+ },
+
+ /**
+ * Applies a style specification to an element.
+ * @param {String/HTMLElement} el The element to apply styles to
+ * @param {String/Object/Function} styles A style specification string
eg "width:100px", or object in the form {width:"100px"}, or
+ * a function which returns such a specification.
+ */
+ applyStyles : function(el, styles){
+ if(styles){
+ el = Ext.fly(el);
+ if(typeof styles == "string"){
+ var re = /\s?([a-z\-]*)\:\s?([^;]*);?/gi;
+ var matches;
+ while ((matches = re.exec(styles)) != null){
+ el.setStyle(matches[1], matches[2]);
+ }
+ }else if (typeof styles == "object"){
+ for (var style in styles){
+ el.setStyle(style, styles[style]);
+ }
+ }else if (typeof styles == "function"){
+ Ext.DomHelper.applyStyles(el, styles.call());
+ }
+ }
+ },
+
+ /**
+ * Inserts an HTML fragment into the DOM.
+ * @param {String} where Where to insert the html in relation to el -
beforeBegin, afterBegin, beforeEnd, afterEnd.
+ * @param {HTMLElement} el The context element
+ * @param {String} html The HTML fragmenet
+ * @return {HTMLElement} The new node
+ */
+ insertHtml : function(where, el, html){
+ where = where.toLowerCase();
+ if(el.insertAdjacentHTML){
+ if(tableRe.test(el.tagName)){
+ var rs;
+ if(rs = insertIntoTable(el.tagName.toLowerCase(), where,
el, html)){
+ return rs;
+ }
+ }
+ switch(where){
+ case "beforebegin":
+ el.insertAdjacentHTML('BeforeBegin', html);
+ return el.previousSibling;
+ case "afterbegin":
+ el.insertAdjacentHTML('AfterBegin', html);
+ return el.firstChild;
+ case "beforeend":
+ el.insertAdjacentHTML('BeforeEnd', html);
+ return el.lastChild;
+ case "afterend":
+ el.insertAdjacentHTML('AfterEnd', html);
+ return el.nextSibling;
+ }
+ throw 'Illegal insertion point -> "' + where + '"';
+ }
+ var range = el.ownerDocument.createRange();
+ var frag;
+ switch(where){
+ case "beforebegin":
+ range.setStartBefore(el);
+ frag = range.createContextualFragment(html);
+ el.parentNode.insertBefore(frag, el);
+ return el.previousSibling;
+ case "afterbegin":
+ if(el.firstChild){
+ range.setStartBefore(el.firstChild);
+ frag = range.createContextualFragment(html);
+ el.insertBefore(frag, el.firstChild);
+ return el.firstChild;
+ }else{
+ el.innerHTML = html;
+ return el.firstChild;
+ }
+ case "beforeend":
+ if(el.lastChild){
+ range.setStartAfter(el.lastChild);
+ frag = range.createContextualFragment(html);
+ el.appendChild(frag);
+ return el.lastChild;
+ }else{
+ el.innerHTML = html;
+ return el.lastChild;
+ }
+ case "afterend":
+ range.setStartAfter(el);
+ frag = range.createContextualFragment(html);
+ el.parentNode.insertBefore(frag, el.nextSibling);
+ return el.nextSibling;
+ }
+ throw 'Illegal insertion point -> "' + where + '"';
+ },
+
+ /**
+ * Creates new DOM element(s) and inserts them before el.
+ * @param {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 this.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 this.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 this.doInsert(el, o,
returnElement, "afterBegin", "firstChild");
+ },
+
+ // private
+ doInsert : function(el, o, returnElement, pos, sibling){
+ el = Ext.getDom(el);
+ var newNode;
+ if(this.useDom){
+ newNode = createDom(o, null);
+ (sibling === "firstChild" ? el :
el.parentNode).insertBefore(newNode, sibling ? el[sibling] : el);
+ }else{
+ var html = createHtml(o);
+ newNode = this.insertHtml(pos, el, html);
+ }
+ return returnElement ? Ext.get(newNode, true) : newNode;
+ },
+
+ /**
+ * 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){
+ el = Ext.getDom(el);
+ var newNode;
+ if(this.useDom){
+ newNode = createDom(o, null);
+ el.appendChild(newNode);
+ }else{
+ var html = createHtml(o);
+ newNode = this.insertHtml("beforeEnd", el, html);
+ }
+ return returnElement ? Ext.get(newNode, true) : newNode;
+ },
+
+ /**
+ * 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, true) :
el.firstChild;
+ },
+
+ /**
+ * 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 = createHtml(o);
+ return new Ext.Template(html);
+ }
+ };
+}();
Added: trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/core/DomQuery.js
==============================================================================
--- (empty file)
+++ trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/core/DomQuery.js Sun Sep 14
11:52:39 2008
@@ -0,0 +1,814 @@
+/*
+ * Ext JS Library 2.2
+ * Copyright(c) 2006-2008, Ext JS, LLC.
+ *
lice...@extjs.com
+ *
+ *
http://extjs.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).
+<p>
+DomQuery supports most of the <a
href="
http://www.w3.org/TR/2005/WD-css3-selectors-20051215/#selectors">CSS3
selectors spec</a>, along with some custom selectors and basic XPath.</p>
+
+<p>
+All selectors, attribute filters and pseudos below can be combined
infinitely in any order. For
example "div.foo:nth-child(odd)[@foo=bar].bar:first" would be a perfectly
valid selector. Node filters are processed in the order in which they
appear, which allows you to optimize your queries for your document
structure.
+</p>
+<h4>Element Selectors:</h4>
+<ul class="list">
+ <li> <b>*</b> any element</li>
+ <li> <b>E</b> an element with the tag E</li>
+ <li> <b>E F</b> All descendent elements of E that have the tag F</li>
+ <li> <b>E > F</b> or <b>E/F</b> all direct children elements of E that
have the tag F</li>
+ <li> <b>E + F</b> all elements with the tag F that are immediately
preceded by an element with the tag E</li>
+ <li> <b>E ~ F</b> all elements with the tag F that are preceded by a
sibling element with the tag E</li>
+</ul>
+<h4>Attribute Selectors:</h4>
+<p>The use of @ and quotes are optional. For example, div[@foo='bar'] is
also a valid attribute selector.</p>
+<ul class="list">
+ <li> <b>E[foo]</b> has an attribute "foo"</li>
+ <li> <b>E[foo=bar]</b> has an attribute "foo" that equals "bar"</li>
+ <li> <b>E[foo^=bar]</b> has an attribute "foo" that starts
with "bar"</li>
+ <li> <b>E[foo$=bar]</b> has an attribute "foo" that ends
with "bar"</li>
+ <li> <b>E[foo*=bar]</b> has an attribute "foo" that contains the
substring "bar"</li>
+ <li> <b>E[foo%=2]</b> has an attribute "foo" that is evenly divisible
by 2</li>
+ <li> <b>E[foo!=bar]</b> has an attribute "foo" that does not
equal "bar"</li>
+</ul>
+<h4>Pseudo Classes:</h4>
+<ul class="list">
+ <li> <b>E:first-child</b> E is the first child of its parent</li>
+ <li> <b>E:last-child</b> E is the last child of its parent</li>
+ <li> <b>E:nth-child(<i>n</i>)</b> E is the <i>n</i>th child of its
parent (1 based as per the spec)</li>
+ <li> <b>E:nth-child(odd)</b> E is an odd child of its parent</li>
+ <li> <b>E:nth-child(even)</b> E is an even child of its parent</li>
+ <li> <b>E:only-child</b> E is the only child of its parent</li>
+ <li> <b>E:checked</b> E is an element that is has a checked attribute
that is true (e.g. a radio or checkbox) </li>
+ <li> <b>E:first</b> the first E in the resultset</li>
+ <li> <b>E:last</b> the last E in the resultset</li>
+ <li> <b>E:nth(<i>n</i>)</b> the <i>n</i>th E in the resultset (1
based)</li>
+ <li> <b>E:odd</b> shortcut for :nth-child(odd)</li>
+ <li> <b>E:even</b> shortcut for :nth-child(even)</li>
+ <li> <b>E:contains(foo)</b> E's innerHTML contains the
substring "foo"</li>
+ <li> <b>E:nodeValue(foo)</b> E contains a textNode with a nodeValue
that equals "foo"</li>
+ <li> <b>E:not(S)</b> an E element that does not match simple selector
S</li>
+ <li> <b>E:has(S)</b> an E element that has a descendent that matches
simple selector S</li>
+ <li> <b>E:next(S)</b> an E element whose next sibling matches simple
selector S</li>
+ <li> <b>E:prev(S)</b> an E element whose previous sibling matches
simple selector S</li>
+</ul>
+<h4>CSS Value Selectors:</h4>
+<ul class="list">
+ <li> <b>E{display=none}</b> css value "display" that equals "none"</li>
+ <li> <b>E{display^=none}</b> css value "display" that starts
with "none"</li>
+ <li> <b>E{display$=none}</b> css value "display" that ends
with "none"</li>
+ <li> <b>E{display*=none}</b> css value "display" that contains the
substring "none"</li>
+ <li> <b>E{display%=2}</b> css value "display" that is evenly divisible
by 2</li>
+ <li> <b>E{display!=none}</b> css value "display" that does not
equal "none"</li>
+</ul>
+ * @singleton
+ */
+Ext.DomQuery = function(){
+ var cache = {}, simpleCache = {}, valueCache = {};
+ var nonSpace = /\S/;
+ var trimRe = /^\s+|\s+$/g;
+ var tplRe = /\{(\d+)\}/g;
+ var modeRe = /^(\s?[\/>+~]\s?|\s|$)/;
+ var tagTokenRe = /^(#)?([\w-\*]+)/;
+ var nthRe = /(\d*)n\+?(\d*)/, nthRe2 = /\D/;
+
+ function child(p, index){
+ var i = 0;
+ var n = p.firstChild;
+ while(n){
+ if(n.nodeType == 1){
+ if(++i == index){
+ return n;
+ }
+ }
+ n = n.nextSibling;
+ }
+ return null;
+ };
+
+ function next(n){
+ while((n = n.nextSibling) && n.nodeType != 1);
+ return n;
+ };
+
+ function prev(n){
+ while((n = n.previousSibling) && n.nodeType != 1);
+ return n;
+ };
+
+ function children(d){
+ var n = d.firstChild, ni = -1;
+ while(n){
+ var nx = n.nextSibling;
+ if(n.nodeType == 3 && !nonSpace.test(n.nodeValue)){
+ d.removeChild(n);
+ }else{
+ n.nodeIndex = ++ni;
+ }
+ n = nx;
+ }
+ return this;
+ };
+
+ function byClassName(c, a, v){
+ if(!v){
+ return c;
+ }
+ var r = [], ri = -1, cn;
+ for(var i = 0, ci; ci = c[i]; i++){
+ if((' '+ci.className+' ').indexOf(v) != -1){
+ r[++ri] = ci;
+ }
+ }
+ return r;
+ };
+
+ function attrValue(n, attr){
+ if(!n.tagName && typeof n.length != "undefined"){
+ n = n[0];
+ }
+ if(!n){
+ return null;
+ }
+ if(attr == "for"){
+ return n.htmlFor;
+ }
+ if(attr == "class" || attr == "className"){
+ return n.className;
+ }
+ return n.getAttribute(attr) || n[attr];
+
+ };
+
+ function getNodes(ns, mode, tagName){
+ var result = [], ri = -1, cs;
+ if(!ns){
+ return result;
+ }
+ tagName = tagName || "*";
+ if(typeof ns.getElementsByTagName != "undefined"){
+ ns = [ns];
+ }
+ if(!mode){
+ for(var i = 0, ni; ni = ns[i]; i++){
+ cs = ni.getElementsByTagName(tagName);
+ for(var j = 0, ci; ci = cs[j]; j++){
+ result[++ri] = ci;
+ }
+ }
+ }else if(mode == "/" || mode == ">"){
+ var utag = tagName.toUpperCase();
+ for(var i = 0, ni, cn; ni = ns[i]; i++){
+ cn = ni.children || ni.childNodes;
+ for(var j = 0, cj; cj = cn[j]; j++){
+ if(cj.nodeName == utag || cj.nodeName == tagName ||
tagName == '*'){
+ result[++ri] = cj;
+ }
+ }
+ }
+ }else if(mode == "+"){
+ var utag = tagName.toUpperCase();
+ for(var i = 0, n; n = ns[i]; i++){
+ while((n = n.nextSibling) && n.nodeType != 1);
+ if(n && (n.nodeName == utag || n.nodeName == tagName ||
tagName == '*')){
+ result[++ri] = n;
+ }
+ }
+ }else if(mode == "~"){
+ for(var i = 0, n; n = ns[i]; i++){
+ while((n = n.nextSibling) && (n.nodeType != 1 || (tagName
== '*' || n.tagName.toLowerCase()!=tagName)));
+ if(n){
+ result[++ri] = n;
+ }
+ }
+ }
+ return result;
+ };
+
+ function concat(a, b){
+ if(b.slice){
+ return a.concat(b);
+ }
+ for(var i = 0, l = b.length; i < l; i++){
+ a[a.length] = b[i];
+ }
+ return a;
+ }
+
+ function byTag(cs, tagName){
+ if(cs.tagName || cs == document){
+ cs = [cs];
+ }
+ if(!tagName){
+ return cs;
+ }
+ var r = [], ri = -1;
+ tagName = tagName.toLowerCase();
+ for(var i = 0, ci; ci = cs[i]; i++){
+ if(ci.nodeType == 1 && ci.tagName.toLowerCase()==tagName){
+ r[++ri] = ci;
+ }
+ }
+ return r;
+ };
+
+ function byId(cs, attr, id){
+ if(cs.tagName || cs == document){
+ cs = [cs];
+ }
+ if(!id){
+ return cs;
+ }
+ var r = [], ri = -1;
+ for(var i = 0,ci; ci = cs[i]; i++){
+ if(ci &&
ci.id == id){
+ r[++ri] = ci;
+ return r;
+ }
+ }
+ return r;
+ };
+
+ function byAttribute(cs, attr, value, op, custom){
+ var r = [], ri = -1, st = custom=="{";
+ var f = Ext.DomQuery.operators[op];
+ for(var i = 0, ci; ci = cs[i]; i++){
+ var a;
+ if(st){
+ 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"){
+ a = ci.getAttribute("href", 2);
+ }else{
+ a = ci.getAttribute(attr);
+ }
+ if((f && f(a, value)) || (!f && a)){
+ r[++ri] = ci;
+ }
+ }
+ return r;
+ };
+
+ function byPseudo(cs, name, value){
+ return Ext.DomQuery.pseudos[name](cs, value);
+ };
+
+ // This is for IE MSXML which does not support expandos.
+ // IE runs the same speed using setAttribute, however FF slows way down
+ // and Safari completely fails so they need to continue to use
expandos.
+ var isIE = window.ActiveXObject ? true : false;
+
+ // this eval is stop the compressor from
+ // renaming the variable to something shorter
+ eval("var batch = 30803;");
+
+ var key = 30803;
+
+ function nodupIEXml(cs){
+ var d = ++key;
+ cs[0].setAttribute("_nodup", d);
+ var r = [cs[0]];
+ for(var i = 1, len = cs.length; i < len; i++){
+ var c = cs[i];
+ if(!c.getAttribute("_nodup") != d){
+ c.setAttribute("_nodup", d);
+ r[r.length] = c;
+ }
+ }
+ for(var i = 0, len = cs.length; i < len; i++){
+ cs[i].removeAttribute("_nodup");
+ }
+ return r;
+ }
+
+ function nodup(cs){
+ if(!cs){
+ return [];
+ }
+ var len = cs.length, c, i, r = cs, cj, ri = -1;
+ if(!len || typeof cs.nodeType != "undefined" || len == 1){
+ return cs;
+ }
+ if(isIE && typeof cs[0].selectSingleNode != "undefined"){
+ return nodupIEXml(cs);
+ }
+ var d = ++key;
+ cs[0]._nodup = d;
+ for(i = 1; c = cs[i]; i++){
+ if(c._nodup != d){
+ c._nodup = d;
+ }else{
+ r = [];
+ for(var j = 0; j < i; j++){
+ r[++ri] = cs[j];
+ }
+ for(j = i+1; cj = cs[j]; j++){
+ if(cj._nodup != d){
+ cj._nodup = d;
+ r[++ri] = cj;
+ }
+ }
+ return r;
+ }
+ }
+ return r;
+ }
+
+ function quickDiffIEXml(c1, c2){
+ var d = ++key;
+ for(var i = 0, len = c1.length; i < len; i++){
+ c1[i].setAttribute("_qdiff", d);
+ }
+ var r = [];
+ for(var i = 0, len = c2.length; i < len; i++){
+ if(c2[i].getAttribute("_qdiff") != d){
+ r[r.length] = c2[i];
+ }
+ }
+ for(var i = 0, len = c1.length; i < len; i++){
+ c1[i].removeAttribute("_qdiff");
+ }
+ return r;
+ }
+
+ function quickDiff(c1, c2){
+ var len1 = c1.length;
+ if(!len1){
+ return c2;
+ }
+ if(isIE && c1[0].selectSingleNode){
+ return quickDiffIEXml(c1, c2);
+ }
+ var d = ++key;
+ for(var i = 0; i < len1; i++){
+ c1[i]._qdiff = d;
+ }
+ var r = [];
+ for(var i = 0, len = c2.length; i < len; i++){
+ if(c2[i]._qdiff != d){
+ r[r.length] = c2[i];
+ }
+ }
+ return r;
+ }
+
+ function quickId(ns, mode, root, id){
+ if(ns == root){
+ var d = root.ownerDocument || root;
+ return d.getElementById(id);
+ }
+ ns = getNodes(ns, mode, "*");
+ return byId(ns, null, id);
+ }
+
+ return {
+ getStyle : function(el, name){
+ return 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";
+
+ var fn = ["var f = function(root){\n var mode; ++batch; var n
= root || document;\n"];
+ var q = path, mode, lq;
+ var tk = Ext.DomQuery.matchers;
+ var tklen = tk.length;
+ var mm;
+
+ // accept leading mode switch
+ var lmode = q.match(modeRe);
+ if(lmode && lmode[1]){
+ fn[fn.length] = 'mode="'+lmode[1].replace(trimRe, "")+'";';
+ q = q.replace(lmode[1], "");
+ }
+ // strip leading slashes
+ while(path.substr(0, 1)=="/"){
+ path = path.substr(1);
+ }
+
+ while(q && lq != q){
+ lq = q;
+ var tm = q.match(tagTokenRe);
+ if(type == "select"){
+ if(tm){
+ if(tm[1] == "#"){
+ fn[fn.length] = 'n = quickId(n, mode,
root, "'+tm[2]+'");';
+ }else{
+ fn[fn.length] = 'n = getNodes(n,
mode, "'+tm[2]+'");';
+ }
+ q = q.replace(tm[0], "");
+ }else if(q.substr(0, 1) != '@'){
+ fn[fn.length] = 'n = getNodes(n, mode, "*");';
+ }
+ }else{
+ if(tm){
+ if(tm[1] == "#"){
+ fn[fn.length] = 'n = byId(n,
null, "'+tm[2]+'");';
+ }else{
+ fn[fn.length] = 'n = byTag(n, "'+tm[2]+'");';
+ }
+ q = q.replace(tm[0], "");
+ }
+ }
+ while(!(mm = q.match(modeRe))){
+ var matched = false;
+ for(var j = 0; j < tklen; j++){
+ var t = tk[j];
+ var m = q.match(
t.re);
+ if(m){
+ fn[fn.length] = t.select.replace(tplRe,
function(x, i){
+ return m[i];
+ });
+ q = q.replace(m[0], "");
+ matched = true;
+ break;
+ }
+ }
+ // prevent infinite loop on bad selector
+ if(!matched){
+ throw 'Error parsing selector, parsing failed
at "' + q + '"';
+ }
+ }
+ if(mm[1]){
+ fn[fn.length]
= 'mode="'+mm[1].replace(trimRe, "")+'";';
+ q = q.replace(mm[1], "");
+ }
+ }
+ fn[fn.length] = "return nodup(n);\n}";
+ eval(fn.join(""));
+ return f;
+ },
+
+ /**
+ * Selects a group of elements.
+ * @param {String} selector The selector/xpath query (can be a
comma separated list of selectors)
+ * @param {Node} root (optional) The start of the query (defaults
to document).
+ * @return {Array}
+ */
+ select : function(path, root, type){
+ if(!root || root == document){
+ root = document;
+ }
+ if(typeof root == "string"){
+ root = document.getElementById(root);
+ }
+ var paths = path.split(",");
+ var results = [];
+ for(var i = 0, len = paths.length; i < len; i++){
+ var p = paths[i].replace(trimRe, "");
+ if(!cache[p]){
+ cache[p] = Ext.DomQuery.compile(p);
+ if(!cache[p]){
+ throw p + " is not a valid selector";
+ }
+ }
+ var result = cache[p](root);
+ if(result && result != document){
+ results = results.concat(result);
+ }
+ }
+ if(paths.length > 1){
+ return nodup(results);
+ }
+ return results;
+ },
+
+ /**
+ * Selects a single element.
+ * @param {String} selector The selector/xpath query
+ * @param {Node} root (optional) The start of the query (defaults
to document).
+ * @return {Element}
+ */
+ selectNode : function(path, root){
+ return 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);
+ n = n[0] ? n[0] : n;
+ var v = (n && n.firstChild ? n.firstChild.nodeValue : null);
+ return ((v === null||v === undefined||v==='') ? defaultValue :
v);
+ },
+
+ /**
+ * Selects the value of a node, parsing integers and floats.
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);
+ var 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}
+ */
+ 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.
+ */
+ matchers : [{
+ re: /^\.([\w-]+)/,
+ select: 'n = byClassName(n, null, " {1} ");'
+ }, {
+ re: /^\:([\w-]+)(?:\(((?:[^\s>\/]*|.*?))\))?/,
+ select: 'n = byPseudo(n, "{1}", "{2}");'
+ },{
+ re:
/^(?:([\[\{])(?:@)?([\w-]+)\s?(?:(=|.=)\s?['"]?(.*?)["']?)?[\]\}])/,
+ select: 'n = byAttribute(n, "{2}", "{4}", "{3}", "{1}");'
+ }, {
+ re: /^#([\w-]+)/,
+ select: 'n = byId(n, null, "{1}");'
+ },{
+ re: /^@([\w-]+)/,
+ select: 'return
{firstChild:{nodeValue:attrValue(n, "{1}")}};'
+ }
+ ],
+
+ /**
+ * Collection of operator comparison functions. The default
operators are =, !=, ^=, $=, *=, %=, |= and ~=.
+ * New operators can be added as long as the match the format
<i>c</i>= where <i>c</i> is any character other than space, > <.
+ */
+ operators : {
+ "=" : function(a, v){
+ return a == v;
+ },
+ "!=" : function(a, v){
+ return a != v;
+ },
+ "^=" : function(a, v){
+ return a && a.substr(0, v.length) == v;
+ },
+ "$=" : function(a, v){
+ return a && a.substr(a.length-v.length) == v;
+ },
+ "*=" : function(a, v){
+ return a && a.indexOf(v) !== -1;
+ },
+ "%=" : function(a, v){
+ return (a % v) == 0;
+ },
+ "|=" : function(a, v){
+ return a && (a == v || a.substr(0, v.length+1) == v+'-');
+ },
+ "~=" : function(a, v){
+ return a && (' '+a+' ').indexOf(' '+v+' ') != -1;
+ }
+ },
+
+ /**
+ * Collection of "pseudo class" processors. Each processor is
passed the current nodeset (array)
+ * and the argument (if any) supplied in the selector.
+ */
+ pseudos : {
+ "first-child" : function(c){
+ var r = [], ri = -1, n;
+ for(var i = 0, ci; ci = n = c[i]; i++){
+ while((n = n.previousSibling) && n.nodeType != 1);
+ if(!n){
+ r[++ri] = ci;
+ }
+ }
+ return r;
+ },
+
+ "last-child" : function(c){
+ var r = [], ri = -1, n;
+ for(var i = 0, ci; ci = n = c[i]; i++){
+ while((n = n.nextSibling) && n.nodeType != 1);
+ if(!n){
+ r[++ri] = ci;
+ }
+ }
+ return r;
+ },
+
+ "nth-child" : function(c, a) {
+ var r = [], ri = -1;
+ var m = nthRe.exec(a == "even" && "2n" || a == "odd"
&& "2n+1" || !nthRe2.test(a) && "n+" + a || a);
+ var f = (m[1] || 1) - 0, l = m[2] - 0;
+ for(var i = 0, n; n = c[i]; i++){
+ var pn = n.parentNode;
+ if (batch != pn._batch) {
+ var j = 0;
+ for(var cn = pn.firstChild; cn; cn =
cn.nextSibling){
+ if(cn.nodeType == 1){
+ cn.nodeIndex = ++j;
+ }
+ }
+ pn._batch = batch;
+ }
+ if (f == 1) {
+ if (l == 0 || n.nodeIndex == l){
+ r[++ri] = n;
+ }
+ } else if ((n.nodeIndex + l) % f == 0){
+ r[++ri] = n;
+ }
+ }
+
+ return r;
+ },
+
+ "only-child" : function(c){
+ var r = [], ri = -1;;
+ for(var i = 0, ci; ci = c[i]; i++){
+ if(!prev(ci) && !next(ci)){
+ r[++ri] = ci;
+ }
+ }
+ return r;
+ },
+
+ "empty" : function(c){
+ var r = [], ri = -1;
+ for(var i = 0, ci; ci = c[i]; i++){
+ var cns = ci.childNodes, j = 0, cn, empty = true;
+ while(cn = cns[j]){
+ ++j;
+ if(cn.nodeType == 1 || cn.nodeType == 3){
+ empty = false;
+ break;
+ }
+ }
+ if(empty){
+ r[++ri] = ci;
+ }
+ }
+ return r;
+ },
+
+ "contains" : function(c, v){
+ var r = [], ri = -1;
+ for(var i = 0, ci; ci = c[i]; i++){
+ if((ci.textContent||ci.innerText||'').indexOf(v) !=
-1){
+ r[++ri] = ci;
+ }
+ }
+ return r;
+ },
+
+ "nodeValue" : function(c, v){
+ var r = [], ri = -1;
+ for(var i = 0, ci; ci = c[i]; i++){
+ if(ci.firstChild && ci.firstChild.nodeValue == v){
+ r[++ri] = ci;
+ }
+ }
+ return r;
+ },
+
+ "checked" : function(c){
+ var r = [], ri = -1;
+ for(var i = 0, ci; ci = c[i]; i++){
+ if(ci.checked == true){
+ r[++ri] = ci;
+ }
+ }
+ return r;
+ },
+
+ "not" : function(c, ss){
+ return Ext.DomQuery.filter(c, ss, true);
+ },
+
+ "any" : function(c, selectors){
+ var ss = selectors.split('|');
+ var 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;
+ var r = [], ri = -1;
+ for(var i = 0, ci; ci = c[i]; i++){
+ if(s(ss, ci).length > 0){
+ r[++ri] = ci;
+ }
+ }
+ return r;
+ },
+
+ "next" : function(c, ss){
+ var is =
Ext.DomQuery.is;
+ var r = [], ri = -1;
+ for(var i = 0, ci; ci = c[i]; i++){
+ var n = next(ci);
+ if(n && is(n, ss)){
+ r[++ri] = ci;
+ }
+ }
+ return r;
+ },
+
+ "prev" : function(c, ss){
+ var is =
Ext.DomQuery.is;
+ var r = [], ri = -1;
+ for(var i = 0, ci; ci = c[i]; i++){
+ var n = prev(ci);
+ if(n && is(n, ss)){
+ r[++ri] = ci;
+ }
+ }
+ return r;
+ }
+ }
+ };
+}();
+
+/**
+ * Selects an array of DOM nodes by CSS/XPath selector. Shorthand of
{@link 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;
Added: trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/core/Element.js
==============================================================================
--- (empty file)
+++ trunk/ExtJS2Parser/ExtJS2Parser/ext-2.2/core/Element.js Sun Sep 14
11:52:39 2008
@@ -0,0 +1,3060 @@
+/*
+ * Ext JS Library 2.2
+ * Copyright(c) 2006-2008, Ext JS, LLC.
+ *
lice...@extjs.com
+ *
+ *
http://extjs.com/license
+ */
+
+/**
+ * @class Ext.Element
+ * Represents an Element in the DOM.<br><br>
+ * Usage:<br>
+<pre><code>
+// by id
+var el = Ext.get("my-div");
+
+// by DOM element reference
+var el = Ext.get(myDivElement);
+</code></pre>
+ * <b>Animations</b><br />
+ * Many of the functions for manipulating an element have an
optional "animate" parameter. The animate parameter
+ * should either be a boolean (true) or an object literal with animation
options. Note that the supported Element animation
+ * options are a subset of the {@link Ext.Fx} animation options specific
to Fx effects. The Element animation options are:
+<pre>
+Option Default Description
+--------- -------- ---------------------------------------------
+duration .35 The duration of the animation in seconds
+easing easeOut The easing method
+callback none A function to execute when the anim completes
+scope this The scope (this) of the callback function
+</pre>
+* Also, the Anim object being used for the animation will be set on your
options object as "anim", which allows you to stop or
+* manipulate the animation. Here's an example:
+<pre><code>
+var el = Ext.get("my-div");
+
+// no animation
+el.setWidth(100);
+
+// default animation
+el.setWidth(100, true);
+
+// animation with some options set
+el.setWidth(100, {
+ duration: 1,
+ callback: this.foo,
+ scope: this
+});
+
+// using the "anim" property to get the Anim object
+var opt = {
+ duration: 1,
+ callback: this.foo,
+ scope: this
+};
+el.setWidth(100, opt);
+...
+if(opt.anim.isAnimated()){
+ opt.anim.stop();
+}
+</code></pre>
+* <b> Composite (Collections of) Elements</b><br />
+ * For working with collections of Elements, see {@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 D = Ext.lib.Dom;
+var E = Ext.lib.Event;
+var A = Ext.lib.Anim;
+
+// local style camelizing for speed
+var propCache = {};
+var camelRe = /(-[a-z])/gi;
+var camelFn = function(m, a){ return a.charAt(1).toUpperCase(); };
+var view = document.defaultView;
+
+Ext.Element = function(element, forceNew){
+ var dom = typeof element == "string" ?
+ document.getElementById(element) : element;
+ if(!dom){ // invalid id/element
+ return null;
+ }
+ var id =
dom.id;
+ if(forceNew !== true && id && Ext.Element.cache[id]){ // element
object already exists
+ return Ext.Element.cache[id];
+ }
+
+ /**
+ * The DOM element
+ * @type HTMLElement
+ */
+ this.dom = dom;
+
+ /**
+ * The DOM element ID
+ * @type String
+ */
+
this.id = id || Ext.id(dom);
+};
+
+var El = Ext.Element;
+
+El.prototype = {
+ /**
+ * The element's default display mode (defaults to "")
+ * @type String
+ */
+ originalDisplay : "",
+
+ visibilityMode : 1,
+ /**
+ * The default unit to append to CSS values where a unit isn't
provided (defaults to px).
+ * @type String
+ */
+ defaultUnit : "px",
+ /**
+ * Sets the element's visibility mode. When setVisible() is called it
+ * will use this to determine whether to set the visibility or the
display property.
+ * @param visMode Element.VISIBILITY or Element.DISPLAY
+ * @return {Ext.Element} this
+ */
+ setVisibilityMode : function(visMode){
+ this.visibilityMode = visMode;
+ return this;
+ },
+ /**
+ * Convenience method for setVisibilityMode(Element.DISPLAY)
+ * @param {String} display (optional) What to set display to when
visible
+ * @return {Ext.Element} this
+ */
+ enableDisplayMode : function(display){
+ this.setVisibilityMode(El.DISPLAY);
+ if(typeof display != "undefined") this.originalDisplay = display;
+ return this;
+ },
+
+ /**
+ * Looks at this node and then at parent nodes for a match of the
passed simple selector (e.g. div.some-class or span:first-child)
+ * @param {String} selector The simple selector to test
+ * @param {Number/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)
+ */
+ findParent : function(simpleSelector, maxDepth, returnEl){
+ var p = this.dom, b = document.body, depth = 0, dq = Ext.DomQuery,
stopEl;
+ maxDepth = maxDepth || 50;
+ if(typeof maxDepth != "number"){
+ stopEl = Ext.getDom(maxDepth);
+ maxDepth = 10;
+ }
+ while(p && p.nodeType == 1 && depth < maxDepth && p != b && p !=
stopEl){
+ if(
dq.is(p, simpleSelector)){
+ return returnEl ? Ext.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);
+ },
+
+
+
+ /**
+ * 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);
+ },
+
+ /**
+ * Perform animation on this element.
+ * @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) 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 anim = Ext.lib.Anim[animType](
+ this.dom, args,
+ (opt.duration || defaultDur) || .35,
+ (opt.easing || defaultEase) || 'easeOut',
+ function(){
+ Ext.callback(cb, this);
+ Ext.callback(opt.callback, opt.scope || this, [this, opt]);
+ },
+ this
+ );
+ opt.anim = anim;
+ return anim;
+ },
+
+ // private legacy anim prep
+ preanim : function(a, i){
+ return !a[i] ? false : (typeof a[i] == "object" ? a[i]: {duration:
a[i+1], callback: a[i+2], easing: a[i+3]});
+ },
+
+ /**
+ * Removes worthless text nodes
+ * @param {Boolean} forceReclean (optional) By default the element
+ * keeps track if it has been cleaned already so
+ * you can call this over and over. However, if you update the element
and
+ * need to force a reclean, you can pass true.
+ */
+ clean : function(forceReclean){
+ if(this.isCleaned && forceReclean !== true){
+ return this;
+ }
+ var ns = /\S/;
+ var d = this.dom, n = d.firstChild, ni = -1;
+ while(n){
+ var nx = n.nextSibling;
+ if(n.nodeType == 3 && !ns.test(n.nodeValue)){
+ d.removeChild(n);
+ }else{
+ n.nodeIndex = ++ni;
+ }
+ n = nx;
+ }
+ this.isCleaned = true;
+ return this;
+ },
+
+ /**
+ * 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;
+ var el = this.dom;
+
+ var o = this.getOffsetsTo(c),
+ l = o[0] + c.scrollLeft,
+ t = o[1] + c.scrollTop,
+ b = t+el.offsetHeight,
+ r = l+el.offsetWidth;
+
+ var ch = c.clientHeight;
+ var ct = parseInt(c.scrollTop, 10);
+ var cl = parseInt(c.scrollLeft, 10);
+ var cb = ct + ch;
+ var cr = cl + c.clientWidth;
+
+ if(el.offsetHeight > ch || t < ct){
+ c.scrollTop = t;
+ }else if(b > cb){
+ c.scrollTop = b-ch;
+ }
+ c.scrollTop = c.scrollTop; // corrects IE, other browsers will
ignore
+
+ 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);
+ },
+
+ /**
+ * Measures the element's content height and updates height to match.
Note: this function uses setTimeout so
+ * the new height may not be available immediately.
+ * @param {Boolean} animate (optional) Animate the transition
(defaults to false)
+ * @param {Float} duration (optional) Length of the animation in
seconds (defaults to .35)
+ * @param {Function} onComplete (optional) Function to call when
animation completes
+ * @param {String} easing (optional) Easing method to use (defaults to
easeOut)
+ * @return {Ext.Element} this
+ */
+ autoHeight : function(animate, duration, onComplete, easing){
+ var oldHeight = this.getHeight();
+ this.clip();
+ this.setHeight(1); // force clipping
+ setTimeout(function(){
+ var height = parseInt(this.dom.scrollHeight, 10); // parseInt
for Safari
+ if(!animate){
+ this.setHeight(height);
+ this.unclip();
+ if(typeof onComplete == "function"){
+ onComplete();
+ }
+ }else{
+ this.setHeight(oldHeight); // restore original height
+ this.setHeight(height, animate, duration, function(){
+ this.unclip();
+ if(typeof onComplete == "function") onComplete();
+ }.createDelegate(this), easing);
+ }
+ }.createDelegate(this), 0);
+ return this;
+ },
+
+ /**
+ * Returns true if this element is an ancestor of the passed element
+ * @param {HTMLElement/String} el The element to check
+ * @return {Boolean} True if this element is an ancestor of el, else
false
+ */
+ contains : function(el){
+ if(!el){return false;}
+ return D.isAncestor(this.dom, el.dom ? el.dom : el);
+ },
+
+ /**
+ * Checks whether the element is currently visible using both
visibility and display properties.
+ * @param {Boolean} deep (optional) True to walk the dom and see if
parent elements are hidden (defaults to false)
+ * @return {Boolean} True if the element is currently visible, else
false
+ */
+ isVisible : function(deep) {
+ var vis = !(this.getStyle("visibility") == "hidden" ||
this.getStyle("display") == "none");
+ if(deep !== true || !vis){
+ return vis;
+ }
+ var p = this.dom.parentNode;
+ while(p && p.tagName.toLowerCase() != "body"){
+ if(!Ext.fly(p, '_isVisible').isVisible()){
+ return false;
+ }
+ p = p.parentNode;
+ }
+ return 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
+ * @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 El.select(selector, unique, this.dom);
+ },
+
+ /**
+ * Selects child nodes based on the passed CSS selector (the selector
should not contain an id).
+ * @param {String} selector The CSS selector
+ * @return {Array} An array of the matched nodes
+ */
+ query : function(selector){
+ return Ext.DomQuery.select(selector, this.dom);
+ },
+
+ /**
+ * Selects a single child at any depth below this element based on the
passed CSS selector (the selector should not contain an id).
+ * @param {String} selector The CSS selector
+ * @param {Boolean} returnDom (optional) True to return the DOM node
instead of 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 = Ext.DomQuery.selectNode(selector, this.dom);
+ return returnDom ? n : Ext.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 = Ext.DomQuery.selectNode(" > " + selector, this.dom);
+ return returnDom ? n : Ext.get(n);
+ },
+
+ /**
+ * 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
+
==============================================================================
Diff truncated at 200k characters